use of net.minecraft.client.gui.screen.ingame.SignEditScreen in project BleachHack by BleachDrinker420.
the class AutoSign method onOpenScreen.
@BleachSubscribe
public void onOpenScreen(EventOpenScreen event) {
if (text.length < 3)
return;
if (event.getScreen() instanceof SignEditScreen) {
event.setCancelled(true);
if (getSetting(0).asToggle().getState()) {
text = new String[] {};
while (text.length < 4) {
IntStream chars = new Random().ints(0, 0x10FFFF);
int amount = getSetting(0).asToggle().getChild(0).asSlider().getValueInt();
text = chars.limit(amount * 5).mapToObj(i -> String.valueOf((char) i)).collect(Collectors.joining()).split("(?<=\\G.{" + amount + "})");
}
}
SignBlockEntity sign = ((SignEditScreen) event.getScreen()).sign;
mc.player.networkHandler.sendPacket(new UpdateSignC2SPacket(sign.getPos(), text[0], text[1], text[2], text[3]));
}
}
use of net.minecraft.client.gui.screen.ingame.SignEditScreen in project meteor-client by MeteorDevelopment.
the class AutoSign method onOpenScreen.
@EventHandler
private void onOpenScreen(OpenScreenEvent event) {
if (!(event.screen instanceof SignEditScreen) || text == null)
return;
SignBlockEntity sign = ((SignEditScreenAccessor) event.screen).getSign();
mc.player.networkHandler.sendPacket(new UpdateSignC2SPacket(sign.getPos(), text[0], text[1], text[2], text[3]));
event.cancel();
}
use of net.minecraft.client.gui.screen.ingame.SignEditScreen in project Client by MatHax.
the class AutoSign method onOpenScreen.
@EventHandler
private void onOpenScreen(OpenScreenEvent event) {
if (!(event.screen instanceof SignEditScreen))
return;
SignBlockEntity sign = ((SignEditScreenAccessor) event.screen).getSign();
String lineOne = Placeholders.apply(lineone.get().replace("%date%", getDate()));
String lineTwo = Placeholders.apply(linetwo.get().replace("%date%", getDate()));
String lineThree = Placeholders.apply(linethree.get().replace("%date%", getDate()));
String lineFour = Placeholders.apply(linefour.get().replace("%date%", getDate()));
mc.player.networkHandler.sendPacket(new UpdateSignC2SPacket(sign.getPos(), lineOne, lineTwo, lineThree, lineFour));
event.cancel();
}
Aggregations