use of net.minecraft.screen.ShulkerBoxScreenHandler in project BleachHack by BleachDrinker420.
the class CmdPeek method onCommand.
@Override
public void onCommand(String alias, String[] args) throws Exception {
ItemStack item = mc.player.getInventory().getMainHandStack();
if (item.getItem() instanceof BlockItem) {
Block block = ((BlockItem) item.getItem()).getBlock();
if (!(block instanceof ShulkerBoxBlock || block instanceof ChestBlock || block instanceof DispenserBlock || block instanceof HopperBlock)) {
BleachLogger.error("Must be holding a containter to peek.");
return;
}
} else if (item.getItem() != Items.BUNDLE) {
BleachLogger.error("Must be holding a containter to peek.");
return;
}
List<ItemStack> items = ItemContentUtils.getItemsInContainer(item);
SimpleInventory inv = new SimpleInventory(items.toArray(new ItemStack[27]));
BleachQueue.add(() -> mc.setScreen(new PeekShulkerScreen(new ShulkerBoxScreenHandler(420, mc.player.getInventory(), inv), mc.player.getInventory(), item.getName())));
}
use of net.minecraft.screen.ShulkerBoxScreenHandler in project KiwiClient by TangyKiwi.
the class Dupe method packetSent.
public static void packetSent(Packet<?> p) {
if (shouldDupe() && p instanceof PlayerActionC2SPacket) {
PlayerActionC2SPacket packet = (PlayerActionC2SPacket) p;
if (packet.getAction() == PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK) {
ScreenHandler var3 = MinecraftClient.getInstance().player.currentScreenHandler;
if (var3 instanceof ShulkerBoxScreenHandler) {
ShulkerBoxScreenHandler screenHandler = (ShulkerBoxScreenHandler) var3;
Int2ObjectArrayMap<ItemStack> stack = new Int2ObjectArrayMap();
stack.put(0, screenHandler.getSlot(0).getStack());
ClickSlotC2SPacket cs = new ClickSlotC2SPacket(screenHandler.syncId, 0, 0, 0, SlotActionType.PICKUP, screenHandler.getSlot(0).getStack(), stack);
MinecraftClient.getInstance().getNetworkHandler().sendPacket(cs);
actuallyPullThrough = false;
preDoDupe = false;
}
}
}
}
use of net.minecraft.screen.ShulkerBoxScreenHandler in project EdenClient by HahaOO7.
the class ContainerInfo method onInventoryChange.
private void onInventoryChange(PlayerInventory playerInventory) {
ScreenHandler sh = playerInventory.player.currentScreenHandler;
if (!(sh instanceof ShulkerBoxScreenHandler) && !(sh instanceof GenericContainerScreenHandler)) {
lastInteractedBlock = null;
return;
}
List<ItemStack> items = sh.getStacks();
items = items.subList(0, items.size() - 36);
if (items.isEmpty())
lastInteractedBlock = null;
else
onOpenInventory(items);
}
Aggregations