Search in sources :

Example 1 with SignEditScreenAccessor

use of meteordevelopment.meteorclient.mixin.SignEditScreenAccessor 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();
}
Also used : SignBlockEntity(net.minecraft.block.entity.SignBlockEntity) SignEditScreenAccessor(meteordevelopment.meteorclient.mixin.SignEditScreenAccessor) SignEditScreen(net.minecraft.client.gui.screen.ingame.SignEditScreen) UpdateSignC2SPacket(net.minecraft.network.packet.c2s.play.UpdateSignC2SPacket) EventHandler(meteordevelopment.orbit.EventHandler)

Aggregations

SignEditScreenAccessor (meteordevelopment.meteorclient.mixin.SignEditScreenAccessor)1 EventHandler (meteordevelopment.orbit.EventHandler)1 SignBlockEntity (net.minecraft.block.entity.SignBlockEntity)1 SignEditScreen (net.minecraft.client.gui.screen.ingame.SignEditScreen)1 UpdateSignC2SPacket (net.minecraft.network.packet.c2s.play.UpdateSignC2SPacket)1