use of net.minecraft.screen.ScreenHandler in project BleachHack by BleachDrinker420.
the class AutoSteal method onOpenScreen.
@BleachSubscribe
public void onOpenScreen(EventOpenScreen event) {
currentSyncId = -1;
if (mc.player != null) {
if (event.getScreen() instanceof HandledScreen) {
ScreenHandler handler = ((HandledScreen<?>) event.getScreen()).getScreenHandler();
if (handler instanceof GenericContainerScreenHandler) {
currentSyncId = handler.syncId;
lastOpen = currentTime;
if (getSetting(0).asMode().getMode() >= 1) {
event.setCancelled(true);
}
} else {
currentItems = null;
mc.player.networkHandler.sendPacket(new CloseHandledScreenC2SPacket(currentSyncId));
}
} else {
currentItems = null;
mc.player.networkHandler.sendPacket(new CloseHandledScreenC2SPacket(currentSyncId));
}
}
}
use of net.minecraft.screen.ScreenHandler in project Biome-Makeover by Lemonszz.
the class S2C_HandleWitchQuests method receive.
@Override
public void receive(MinecraftClient client, ClientPlayNetworkHandler handler, PacketByteBuf buf, PacketSender responseSender) {
int syncId = buf.readVarInt();
WitchQuestList witchQuests = new WitchQuestList(buf);
client.execute(() -> {
ScreenHandler screenHandler = MinecraftClient.getInstance().player.currentScreenHandler;
if (syncId == screenHandler.syncId && screenHandler instanceof WitchScreenHandler) {
((WitchScreenHandler) screenHandler).setQuests(witchQuests);
}
});
}
use of net.minecraft.screen.ScreenHandler in project Paradise-Lost by devs-immortal.
the class SheepuffEntity method createDyeMixingCraftingInventory.
private static CraftingInventory createDyeMixingCraftingInventory(DyeColor parentColor, DyeColor mateColor) {
CraftingInventory craftingInventory_1 = new CraftingInventory(new ScreenHandler(null, -1) {
@Override
public boolean canUse(PlayerEntity playerIn) {
return false;
}
}, 2, 1);
craftingInventory_1.setStack(0, new ItemStack(DyeItem.byColor(parentColor)));
craftingInventory_1.setStack(1, new ItemStack(DyeItem.byColor(mateColor)));
return craftingInventory_1;
}
Aggregations