use of net.minecraft.screen.GenericContainerScreenHandler 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));
}
}
}
Aggregations