53 lines
2.1 KiB
Java
53 lines
2.1 KiB
Java
package baritone.api.utils;
|
|
import intent.zeroday.util.MaterialsHelper;
|
|
import intent.zeroday.util.module.AutoPlayMinecraftHelper;
|
|
|
|
|
|
import baritone.pathing.BuilderProcess;
|
|
import net.minecraft.block.Block;
|
|
import net.minecraft.block.state.IBlockState;
|
|
import net.minecraft.client.Minecraft;
|
|
import net.minecraft.item.Item;
|
|
import net.minecraft.util.BlockPos;
|
|
|
|
public final class BaritoneMinecraftUtil {
|
|
public static Minecraft minecraft = Minecraft.getMinecraft();
|
|
|
|
public static final void handleBlock(Block block2, int value) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
boolean active2 = getBuilderProcess().isActive2();
|
|
if (!active2) {
|
|
int value2 = AutoPlayMinecraftHelper.resolveIndex5(Item.getItemFromBlock(block2));
|
|
if (value2 > 0) {
|
|
for (int idx = -value; idx < value; idx++) {
|
|
for (int idx2 = value; idx2 > -value; idx2--) {
|
|
for (int idx3 = -value; idx3 < value; idx3++) {
|
|
BlockPos pos = new BlockPos(
|
|
minecraft.thePlayer.posX + idx, minecraft.thePlayer.posY + idx2, minecraft.thePlayer.posZ + idx3
|
|
);
|
|
BlockPos pos2 = new BlockPos(
|
|
minecraft.thePlayer.posX + idx, minecraft.thePlayer.posY + idx2 - (1.0), minecraft.thePlayer.posZ + idx3
|
|
);
|
|
boolean enabled = minecraft.theWorld.getBlockState(pos).getBlock().canPlaceBlockAt(minecraft.theWorld, pos);
|
|
if (enabled && minecraft.theWorld.getBlockState(pos2).getBlock().isBlockNormalCube()) {
|
|
getBuilderProcess()
|
|
.handleString(block2.getLocalizedName(), new MaterialsHelper(1, 1, 1, new IBlockState[][][]{{{block2.getDefaultState()}}}), pos);
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
public static final BuilderProcess getBuilderProcess() {
|
|
return (BuilderProcess)BaritoneBaritoneSettingsUtil.getGuiZeroEntityPlayer().getBaritoneCore().getBuilderProcess2();
|
|
}
|
|
}
|