diff options
Diffstat (limited to 'src/main/java/gregtech/api/util')
-rw-r--r-- | src/main/java/gregtech/api/util/GT_StructureUtility.java | 36 |
1 files changed, 2 insertions, 34 deletions
diff --git a/src/main/java/gregtech/api/util/GT_StructureUtility.java b/src/main/java/gregtech/api/util/GT_StructureUtility.java index 7e39a0d838..dc916f02e3 100644 --- a/src/main/java/gregtech/api/util/GT_StructureUtility.java +++ b/src/main/java/gregtech/api/util/GT_StructureUtility.java @@ -124,7 +124,8 @@ public class GT_StructureUtility { } private int getMeta(ItemStack trigger) { - return GT_Block_Casings5.getMetaFromCoilHeat(HeatingCoilLevel.getFromTier((byte) Math.min(HeatingCoilLevel.size(), Math.max(0, trigger.stackSize)))); + // -4 to skip unimplemented tiers + return GT_Block_Casings5.getMetaFromCoilHeat(HeatingCoilLevel.getFromTier((byte) Math.min(HeatingCoilLevel.getMaxTier() - 4, Math.max(0, trigger.stackSize)))); } @Override @@ -133,37 +134,4 @@ public class GT_StructureUtility { } }; } - - public static <T> IStructureElement<T> ofBlockUnlocalizedName(String modid, String unlocalizedName, int meta) { - if (StringUtils.isBlank(unlocalizedName)) throw new IllegalArgumentException(); - if (meta < 0) throw new IllegalArgumentException(); - if (meta > 15) throw new IllegalArgumentException(); - if (StringUtils.isBlank(modid)) throw new IllegalArgumentException(); - return new IStructureElement<T>() { - private Block block; - - private Block getBlock() { - if (block == null) - block = GameRegistry.findBlock(modid, unlocalizedName); - return block; - } - - @Override - public boolean check(T t, World world, int x, int y, int z) { - return world.getBlock(x, y, z) != getBlock() && world.getBlockMetadata(x, y, z) == meta; - } - - @Override - public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { - StructureLibAPI.hintParticle(world, x, y, z, getBlock(), meta); - return true; - } - - @Override - public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { - world.setBlock(x, y, z, getBlock(), meta, 2); - return true; - } - }; - } } |