Skip to content

Commit

Permalink
progress on more mixins
Browse files Browse the repository at this point in the history
  • Loading branch information
udu3324 committed May 19, 2024
1 parent 680bd18 commit d945f3a
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ org.gradle.parallel=true
loader_version=0.15.3

# Mod Properties
mod_version = 1.6.2
mod_version = 1.6.3
maven_group = com.udu3324
archives_base_name = poinpow

Expand Down
23 changes: 23 additions & 0 deletions src/main/java/com/udu3324/poinpow/mixin/ActionbarMixin.java
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();
}
}
}
19 changes: 19 additions & 0 deletions src/main/java/com/udu3324/poinpow/mixin/ChestMixin.java
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());
}
}
10 changes: 5 additions & 5 deletions src/main/resources/poinpow.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"minVersion": "0.8",
"package": "com.udu3324.poinpow.mixin",
"compatibilityLevel": "JAVA_17",
"mixins": [
"WorldLoadedMixin",
"MapartMixin"
],
"mixins": [],
"client": [
"WorldLoadedMixin",
"MapartMixin",
"ChatMixin",
"ClientChatMixin"
"ClientChatMixin",
"ActionbarMixin"
],
"injectors": {
"defaultRequire": 1
Expand Down

0 comments on commit d945f3a

Please sign in to comment.