diff options
-rw-r--r-- | src/main/java/ftbsc/bscv/modules/self/Scaffold.java | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/main/java/ftbsc/bscv/modules/self/Scaffold.java b/src/main/java/ftbsc/bscv/modules/self/Scaffold.java new file mode 100644 index 0000000..655e933 --- /dev/null +++ b/src/main/java/ftbsc/bscv/modules/self/Scaffold.java @@ -0,0 +1,46 @@ +package ftbsc.bscv.modules.self; + +import java.util.ArrayList; +import java.util.List; + +import com.google.auto.service.AutoService; + +import ftbsc.bscv.api.ILoadable; +import ftbsc.bscv.modules.AbstractModule; +import ftbsc.bscv.tools.Inventory; +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.inventory.container.Slot; +import net.minecraft.util.Hand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.vector.Vector3d; +import net.minecraftforge.event.TickEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; + +@AutoService(ILoadable.class) +public class Scaffold extends AbstractModule { + + + + + + @SubscribeEvent + public void onTick(TickEvent.ClientTickEvent event) { + if (MC.level == null || MC.player == null) return; + BlockPos block_pos_below = MC.player.blockPosition().below(); + BlockState block_below = MC.level.getBlockState(block_pos_below); + if (block_below.getBlock() == Blocks.AIR) { + List<Slot> hotbar = Inventory.hotbar(MC.player); + for(Slot slot : hotbar) { + boolean canPlace = slot.getItem().getItem().canAttackBlock(block_below, MC.level,block_pos_below,MC.player); // this doesn't work for sure + if(canPlace) { + Vector3d vector = new Vector3d(block_pos_below.getX(), block_pos_below.getY(),block_pos_below.getZ()); //we need utilsssss :( + MC.player.interactAt(MC.player, vector, Hand.MAIN_HAND); + + } + } + + } + } + +} |