И так жду моих любимых попкорнов от вендовского парадигмы и хангера // package ru.neiron.modules.impl.util; import net.minecraft.block.Blocks; import net.minecraft.client.Minecraft; import net.minecraft.item.BlockItem; import net.minecraft.item.ItemStack; import net.minecraft.util.Direction; import net.minecraft.util.Hand; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.vector.Vector3d; import ru.neiron.events.Event; import ru.neiron.events.impl.player.EventUpdate; import ru.neiron.modules.Function; import ru.neiron.modules.FunctionAnnotation; import ru.neiron.modules.Type; @FunctionAnnotation( name = "Scaffold", type = Type.Util ) public class AirPlace extends Function { private final Minecraft mc = Minecraft.getInstance(); public AirPlace() { } @Override public void onEvent(Event e) { if (e instanceof EventUpdate){ this.getItemInHotbar(); this.placeBlock(); } } public void placeBlock() { BlockPos var1 = this.mc.player.getPosition(); BlockPos var2 = new BlockPos(var1.getX(), var1.getY() - 1, var1.getZ()); if (this.mc.world.getBlockState(var2).getBlock() == Blocks.AIR) { BlockRayTraceResult var3 = new BlockRayTraceResult(Vector3d.ZERO, Direction.UP, var2, false); this.mc.playerController.processRightClickBlock(this.mc.player, this.mc.world, Hand.MAIN_HAND, var3); } } public int getItemInHotbar() { int paradigma = 0; while(paradigma < 9) { ItemStack var2 = this.mc.player.inventory.getStackInSlot(paradigma); if (!(var2.getItem() instanceof BlockItem)) { return paradigma; } ++paradigma; } return 1; } }