autosigntext

This commit is contained in:
Jess H 2024-05-24 04:35:38 +01:00
parent cbf44cdd70
commit 050e3286f0
6 changed files with 77 additions and 6 deletions

View file

@ -13,6 +13,7 @@ import com.baseband.client.module.render.ClickGUI;
import com.baseband.client.module.render.Freecam; import com.baseband.client.module.render.Freecam;
import com.baseband.client.module.render.HUD; import com.baseband.client.module.render.HUD;
import com.baseband.client.module.render.Nametags; import com.baseband.client.module.render.Nametags;
import com.baseband.client.module.world.AutoSignText;
/** /**
* @author TudbuT * @author TudbuT
@ -38,7 +39,8 @@ public class Setup {
new ElytraFly(), new ElytraFly(),
new ExtraChat(), new ExtraChat(),
new Velocity(), new Velocity(),
new Nametags() new Nametags(),
new AutoSignText()
}; };

View file

@ -0,0 +1,31 @@
package com.baseband.client.mixins;
import com.baseband.client.init.BaseBand;
import com.baseband.client.module.world.AutoSignText;
import net.minecraft.client.gui.inventory.GuiEditSign;
import net.minecraft.tileentity.TileEntitySign;
import net.minecraft.util.text.TextComponentString;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(value = GuiEditSign.class, priority = Integer.MAX_VALUE)
public class MixinGuiEditSign {
@Final
@Shadow
private TileEntitySign tileSign;
@Inject(method = "initGui", at = @At("RETURN"))
public void initGui(CallbackInfo callback) {
if(BaseBand.getModule(AutoSignText.class).enabled) {
tileSign.signText[0] = new TextComponentString(BaseBand.getModule(AutoSignText.class).signTextFirst);
tileSign.signText[1] = new TextComponentString(BaseBand.getModule(AutoSignText.class).signTextSecond);
tileSign.signText[2] = new TextComponentString(BaseBand.getModule(AutoSignText.class).signTextThird);
tileSign.signText[3] = new TextComponentString(BaseBand.getModule(AutoSignText.class).signTextFourth);
}
}
}

View file

@ -17,7 +17,8 @@ public enum Category {
CHAT("Chat", Chat.class), CHAT("Chat", Chat.class),
CLIENT("Client", Client.class), CLIENT("Client", Client.class),
COMBAT("Combat", Combat.class), COMBAT("Combat", Combat.class),
MOVEMENT("Movement", Movement.class) MOVEMENT("Movement", Movement.class),
WORLD("World", World.class)
; ;

View file

@ -0,0 +1,11 @@
package com.baseband.client.module.category;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface World {
}

View file

@ -0,0 +1,25 @@
package com.baseband.client.module.world;
import com.baseband.client.configuration.annotation.Config;
import com.baseband.client.module.Feature;
import com.baseband.client.module.category.World;
@World
public class AutoSignText extends Feature {
@Override
public String toString() {
return "AutoSignText";
}
@Config("Line 1")
public String signTextFirst = "Try editing this";
@Config("Line 2")
public String signTextSecond = "In the GUI!";
@Config("Line 3")
public String signTextThird = "Try editing this";
@Config("Line 4")
public String signTextFourth = "In the GUI!";
}

View file

@ -4,13 +4,14 @@
"package": "com.baseband.client.mixins", "package": "com.baseband.client.mixins",
"minVersion": "0", "minVersion": "0",
"refmap": "mixins.baseband.refmap.json", "refmap": "mixins.baseband.refmap.json",
"mixins": [ "client": [
"ICPacketChat", "ICPacketChat",
"IMinecraft", "IMinecraft",
"IRenderManager", "IRenderManager",
"MixinNetworkManager",
"MixinFMLNetworkRegistry",
"MixinEntityPlayerSP", "MixinEntityPlayerSP",
"MixinGuiNewChat" "MixinFMLNetworkRegistry",
"MixinGuiNewChat",
"MixinNetworkManager",
"MixinGuiEditSign"
] ]
} }