i dont know tudbut perhaps you can rewrite this
All checks were successful
/ Build BaseBand DSM & Broadway (push) Successful in 2m13s

This commit is contained in:
Jess H 2024-06-20 02:03:04 +01:00
parent 7a3d903bff
commit e2ff3c5a14
Signed by: UnixSystemV
GPG key ID: 9B21C50B68D67F19
5 changed files with 69 additions and 2 deletions

View file

@ -49,6 +49,7 @@ public class Setup {
new ChatCrypt(), new ChatCrypt(),
new ChatExtras(), new ChatExtras(),
new ChatFilter(), new ChatFilter(),
new ColourSign(),
new Notifier(), new Notifier(),
new ClickGUI(), new ClickGUI(),
new Connect(), new Connect(),

View file

@ -0,0 +1,51 @@
package de.com.baseband.client.feature.modules.ingame;
import de.com.baseband.client.event.events.PacketEvent;
import de.com.baseband.client.feature.Feature;
import de.com.baseband.client.mixin.mixins.ICPacketUpdateSign;
import de.com.baseband.client.registry.annotation.Config;
import net.minecraft.network.play.client.CPacketUpdateSign;
public class ColourSign extends Feature {
@Override
public String toString() {
return "ColourSign";
}
@Config("Mode")
public Mode mode;
enum Mode {
Vanilla,
Spigot
}
@Override
public void onTick() {
meta = mode.name();
}
public void packetOut(PacketEvent event) {
if (event.getPacket() instanceof CPacketUpdateSign) {
ICPacketUpdateSign updateSignAccessor = ((ICPacketUpdateSign) event.getPacket());
String[] lines = updateSignAccessor.getLines();
for (int i = 0; i < 4; ++i) {
String line = lines[i];
if (line != null && !line.isEmpty()) {
switch (mode) {
case Vanilla: {
lines[i] = line.replace("&", "§§0");
break;
}
case Spigot: {
lines[i] = line.replace("&", "§§§00");
break;
}
}
}
}
updateSignAccessor.setLines(lines);
}
}
}

View file

@ -8,10 +8,10 @@ import de.com.baseband.client.event.events.PacketEvent;
import de.com.baseband.client.feature.Features; import de.com.baseband.client.feature.Features;
import de.com.baseband.client.feature.modules.chat.ChatExtras; import de.com.baseband.client.feature.modules.chat.ChatExtras;
import de.com.baseband.client.feature.modules.client.Client; import de.com.baseband.client.feature.modules.client.Client;
import de.com.baseband.client.feature.modules.ingame.AutoSignText;
import de.com.baseband.client.feature.modules.movement.Velocity; import de.com.baseband.client.feature.modules.movement.Velocity;
import de.com.baseband.client.feature.modules.render.NoRender; import de.com.baseband.client.feature.modules.render.NoRender;
import de.com.baseband.client.feature.modules.render.SwingSpeed; import de.com.baseband.client.feature.modules.render.SwingSpeed;
import de.com.baseband.client.feature.modules.ingame.AutoSignText;
import de.com.baseband.client.util.adapt.FieldFinder; import de.com.baseband.client.util.adapt.FieldFinder;
import de.com.baseband.client.util.net.ScreenshotHelper; import de.com.baseband.client.util.net.ScreenshotHelper;
import net.minecraft.client.gui.ChatLine; import net.minecraft.client.gui.ChatLine;

View file

@ -0,0 +1,14 @@
package de.com.baseband.client.mixin.mixins;
import net.minecraft.network.play.client.CPacketUpdateSign;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
@Mixin(CPacketUpdateSign.class)
public interface ICPacketUpdateSign {
@Accessor(value = "lines")
String[] getLines();
@Accessor(value = "lines")
void setLines(String[] lines);
}

View file

@ -6,15 +6,16 @@
"refmap": "mixins.baseband.refmap.json", "refmap": "mixins.baseband.refmap.json",
"client": [ "client": [
"ICPacketChat", "ICPacketChat",
"ICPacketUpdateSign",
"IMinecraft", "IMinecraft",
"IPlayerControllerMP", "IPlayerControllerMP",
"IRenderManager", "IRenderManager",
"ISPacketExplosion", "ISPacketExplosion",
"ITimer", "ITimer",
"MixinEntity",
"MixinEntityLivingBase", "MixinEntityLivingBase",
"MixinEntityPlayerSP", "MixinEntityPlayerSP",
"MixinEntityRender", "MixinEntityRender",
"MixinEntity",
"MixinEventBus", "MixinEventBus",
"MixinFMLNetworkRegistry", "MixinFMLNetworkRegistry",
"MixinGuiEditSign", "MixinGuiEditSign",