From 620fc9af643c079598dd0129d08c92f00d2d8ede Mon Sep 17 00:00:00 2001 From: Logan Darklock Date: Tue, 3 Sep 2019 21:44:45 -0700 Subject: [PATCH] Sliiightly more efficient AbstractSchematic#approxPlaceable() --- .../java/baritone/api/schematic/AbstractSchematic.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/api/java/baritone/api/schematic/AbstractSchematic.java b/src/api/java/baritone/api/schematic/AbstractSchematic.java index ec4d8731..4a7e9b25 100644 --- a/src/api/java/baritone/api/schematic/AbstractSchematic.java +++ b/src/api/java/baritone/api/schematic/AbstractSchematic.java @@ -6,6 +6,7 @@ import baritone.api.utils.ISchematic; import net.minecraft.block.state.IBlockState; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.init.Blocks; +import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; @@ -54,17 +55,20 @@ public abstract class AbstractSchematic implements ISchematic { // 27 + 9 for (int i = 0; i < 36; i++) { ItemStack stack = inventory.get(i); + Item item = stack.getItem(); if (!stack.isEmpty() && stack.getItem() instanceof ItemBlock) { + ItemBlock itemBlock = (ItemBlock) item; + // - placeable.add(((ItemBlock) stack.getItem()).getBlock().getStateForPlacement( + placeable.add(itemBlock.getBlock().getStateForPlacement( ctx.world(), ctx.playerFeet(), EnumFacing.UP, (float) player.posX, (float) player.posY, (float) player.posZ, - stack.getItem().getMetadata(stack.getMetadata()), + itemBlock.getMetadata(stack.getMetadata()), player )); //