i dont know tudbut perhaps you can rewrite this
All checks were successful
/ Build BaseBand DSM & Broadway (push) Successful in 2m13s
All checks were successful
/ Build BaseBand DSM & Broadway (push) Successful in 2m13s
This commit is contained in:
parent
7a3d903bff
commit
e2ff3c5a14
5 changed files with 69 additions and 2 deletions
|
@ -49,6 +49,7 @@ public class Setup {
|
|||
new ChatCrypt(),
|
||||
new ChatExtras(),
|
||||
new ChatFilter(),
|
||||
new ColourSign(),
|
||||
new Notifier(),
|
||||
new ClickGUI(),
|
||||
new Connect(),
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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.modules.chat.ChatExtras;
|
||||
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.render.NoRender;
|
||||
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.net.ScreenshotHelper;
|
||||
import net.minecraft.client.gui.ChatLine;
|
||||
|
|
|
@ -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);
|
||||
}
|
|
@ -6,15 +6,16 @@
|
|||
"refmap": "mixins.baseband.refmap.json",
|
||||
"client": [
|
||||
"ICPacketChat",
|
||||
"ICPacketUpdateSign",
|
||||
"IMinecraft",
|
||||
"IPlayerControllerMP",
|
||||
"IRenderManager",
|
||||
"ISPacketExplosion",
|
||||
"ITimer",
|
||||
"MixinEntity",
|
||||
"MixinEntityLivingBase",
|
||||
"MixinEntityPlayerSP",
|
||||
"MixinEntityRender",
|
||||
"MixinEntity",
|
||||
"MixinEventBus",
|
||||
"MixinFMLNetworkRegistry",
|
||||
"MixinGuiEditSign",
|
||||
|
|
Loading…
Add table
Reference in a new issue