-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
48 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/main/java/com/udu3324/poinpow/mixin/ActionbarMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.udu3324.poinpow.mixin; | ||
|
||
import net.minecraft.client.gui.hud.InGameHud; | ||
import net.minecraft.text.Text; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(InGameHud.class) | ||
public class ActionbarMixin { | ||
@Inject(method = "setOverlayMessage", at = @At("HEAD"), cancellable = true) | ||
private void onActionBarSet(Text message, boolean tinted, CallbackInfo ci) { | ||
String text = message.getLiteralString(); | ||
System.out.println("smth changed "); | ||
if (text == null) return; | ||
System.out.println("found msg!!! " + text); | ||
|
||
if (text.equals("eee")) { | ||
ci.cancel(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.udu3324.poinpow.mixin; | ||
|
||
import net.minecraft.network.PacketByteBuf; | ||
import net.minecraft.network.packet.s2c.play.InventoryS2CPacket; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
|
||
@Mixin(InventoryS2CPacket.class) | ||
public class ChestMixin { | ||
@Inject(method = "write", at = @At("HEAD")) | ||
private void pleaseWork(PacketByteBuf buf) { | ||
//todo | ||
//System.out.println("!!!!!!!!!!!!!!!!!!!"); | ||
//System.out.println("buf: " + buf.readString()); | ||
//System.out.println("found " + inventory.getStack(0).getItem().getName().getString()); | ||
//System.out.println("found " + inventory.getStack(0).getItem().getName().getLiteralString()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters