From f297d6c576675819a801c6f3fdeb4affc1315347 Mon Sep 17 00:00:00 2001 From: Tec Date: Mon, 14 Sep 2020 20:19:54 +0200 Subject: Remove boxing --- .../mechanics/structure/StructureUtility.java | 532 ++++++++++----------- .../mechanics/structure/adders/IBlockAdder.java | 2 +- .../mechanics/structure/adders/IHatchAdder.java | 2 +- 3 files changed, 268 insertions(+), 268 deletions(-) (limited to 'src/main/java/com') diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java b/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java index 131822fa46..14930952c5 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java @@ -39,18 +39,18 @@ public class StructureUtility { @SuppressWarnings("rawtypes") private static final IStructureElement AIR = new IStructureElement() { @Override - public boolean check(Object t, World world, int x, int y, int z) { + public boolean check(Object multiBlock, World world, int x, int y, int z) { return world.getBlock(x, y, z).getMaterial() == Material.air; } @Override - public boolean spawnHint(Object o, World world, int x, int y, int z, ItemStack trigger) { + public boolean spawnHint(Object multiBlock, World world, int x, int y, int z, ItemStack trigger) { TecTech.proxy.hint_particle(world, x, y, z, sHintCasingsTT, 13); return true; } @Override - public boolean placeBlock(Object o, World world, int x, int y, int z, ItemStack trigger) { + public boolean placeBlock(Object multiBlock, World world, int x, int y, int z, ItemStack trigger) { world.setBlock(x, y, z, Blocks.air, 0, 2); return false; } @@ -58,18 +58,18 @@ public class StructureUtility { @SuppressWarnings("rawtypes") private static final IStructureElement NOT_AIR = new IStructureElement() { @Override - public boolean check(Object t, World world, int x, int y, int z) { + public boolean check(Object multiBlock, World world, int x, int y, int z) { return world.getBlock(x, y, z).getMaterial() != Material.air; } @Override - public boolean spawnHint(Object o, World world, int x, int y, int z, ItemStack trigger) { + public boolean spawnHint(Object multiBlock, World world, int x, int y, int z, ItemStack trigger) { TecTech.proxy.hint_particle(world, x, y, z, sHintCasingsTT, 14); return true; } @Override - public boolean placeBlock(Object o, World world, int x, int y, int z, ItemStack trigger) { + public boolean placeBlock(Object multiBlock, World world, int x, int y, int z, ItemStack trigger) { world.setBlock(x, y, z, sHintCasingsTT, 14, 2); return true; } @@ -77,18 +77,18 @@ public class StructureUtility { @SuppressWarnings("rawtypes") private static final IStructureElement ERROR = new IStructureElement() { @Override - public boolean check(Object t, World world, int x, int y, int z) { + public boolean check(Object multiBlock, World world, int x, int y, int z) { return false; } @Override - public boolean spawnHint(Object o, World world, int x, int y, int z, ItemStack trigger) { + public boolean spawnHint(Object multiBlock, World world, int x, int y, int z, ItemStack trigger) { TecTech.proxy.hint_particle(world, x, y, z, sHintCasingsTT, 15); return true; } @Override - public boolean placeBlock(Object o, World world, int x, int y, int z, ItemStack trigger) { + public boolean placeBlock(Object multiBlock, World world, int x, int y, int z, ItemStack trigger) { return true; } }; @@ -98,12 +98,12 @@ public class StructureUtility { } @SuppressWarnings("unchecked") - public static IStructureElement isAir() { + public static IStructureElement isAir() { return AIR; } @SuppressWarnings("unchecked") - public static IStructureElement notAir() { + public static IStructureElement notAir() { return NOT_AIR; } @@ -112,11 +112,11 @@ public class StructureUtility { * Placement is always handled by this and does nothing. * Makes little to no use it in fallback chain. * - * @param + * @param * @return */ @SuppressWarnings("unchecked") - public static IStructureElement error() { + public static IStructureElement error() { return ERROR; } @@ -126,19 +126,19 @@ public class StructureUtility { * Check always returns: true. * * @param dots - * @param + * @param * @return */ - public static IStructureElementNoPlacement ofHint(int dots) { + public static IStructureElementNoPlacement ofHint(int dots) { int meta = dots - 1; - return new IStructureElementNoPlacement() { + return new IStructureElementNoPlacement() { @Override - public boolean check(T t, World world, int x, int y, int z) { + public boolean check(MultiBlock multiBlock, World world, int x, int y, int z) { return true; } @Override - public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { + public boolean spawnHint(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { TecTech.proxy.hint_particle(world, x, y, z, sHintCasingsTT, meta); return false; } @@ -149,18 +149,18 @@ public class StructureUtility { * Check always returns: true. * * @param icons - * @param + * @param * @return */ - public static IStructureElementNoPlacement ofHintDeferred(Supplier icons) { - return new IStructureElementNoPlacement() { + public static IStructureElementNoPlacement ofHintDeferred(Supplier icons) { + return new IStructureElementNoPlacement() { @Override - public boolean check(T t, World world, int x, int y, int z) { + public boolean check(MultiBlock multiBlock, World world, int x, int y, int z) { return true; } @Override - public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { + public boolean spawnHint(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { TecTech.proxy.hint_particle(world, x, y, z, icons.get()); return false; } @@ -172,18 +172,18 @@ public class StructureUtility { * * @param icons * @param RGBa - * @param + * @param * @return */ - public static IStructureElementNoPlacement ofHintDeferred(Supplier icons, short[] RGBa) { - return new IStructureElementNoPlacement() { + public static IStructureElementNoPlacement ofHintDeferred(Supplier icons, short[] RGBa) { + return new IStructureElementNoPlacement() { @Override - public boolean check(T t, World world, int x, int y, int z) { + public boolean check(MultiBlock multiBlock, World world, int x, int y, int z) { return true; } @Override - public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { + public boolean spawnHint(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { TecTech.proxy.hint_particle_tinted(world, x, y, z, icons.get(), RGBa); return false; } @@ -197,19 +197,19 @@ public class StructureUtility { /** * Does not allow Block duplicates (with different meta) */ - public static IStructureElementNoPlacement ofBlocksFlatHint(Map blocsMap, Block hintBlock, int hintMeta) { + public static IStructureElementNoPlacement ofBlocksFlatHint(Map blocsMap, Block hintBlock, int hintMeta) { if (blocsMap == null || blocsMap.isEmpty() || hintBlock == null) { throw new IllegalArgumentException(); } - return new IStructureElementNoPlacement() { + return new IStructureElementNoPlacement() { @Override - public boolean check(T t, World world, int x, int y, int z) { + public boolean check(MultiBlock multiBlock, World world, int x, int y, int z) { Block worldBlock = world.getBlock(x, y, z); return blocsMap.getOrDefault(worldBlock, MIN_VALUE) == worldBlock.getDamageValue(world, x, y, z); } @Override - public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { + public boolean spawnHint(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { TecTech.proxy.hint_particle(world, x, y, z, hintBlock, hintMeta); return true; } @@ -219,7 +219,7 @@ public class StructureUtility { /** * Allows block duplicates (with different meta) */ - public static IStructureElementNoPlacement ofBlocksMapHint(Map> blocsMap, Block hintBlock, int hintMeta) { + public static IStructureElementNoPlacement ofBlocksMapHint(Map> blocsMap, Block hintBlock, int hintMeta) { if (blocsMap == null || blocsMap.isEmpty() || hintBlock == null) { throw new IllegalArgumentException(); } @@ -228,57 +228,57 @@ public class StructureUtility { throw new IllegalArgumentException(); } } - return new IStructureElementNoPlacement() { + return new IStructureElementNoPlacement() { @Override - public boolean check(T t, World world, int x, int y, int z) { + public boolean check(MultiBlock multiBlock, World world, int x, int y, int z) { Block worldBlock = world.getBlock(x, y, z); return blocsMap.getOrDefault(worldBlock, Collections.emptySet()).contains(worldBlock.getDamageValue(world, x, y, z)); } @Override - public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { + public boolean spawnHint(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { TecTech.proxy.hint_particle(world, x, y, z, hintBlock, hintMeta); return true; } }; } - public static IStructureElementNoPlacement ofBlockHint(Block block, int meta, Block hintBlock, int hintMeta) { + public static IStructureElementNoPlacement ofBlockHint(Block block, int meta, Block hintBlock, int hintMeta) { if (block == null || hintBlock == null) { throw new IllegalArgumentException(); } - return new IStructureElementNoPlacement() { + return new IStructureElementNoPlacement() { @Override - public boolean check(T t, World world, int x, int y, int z) { + public boolean check(MultiBlock multiBlock, World world, int x, int y, int z) { Block worldBlock = world.getBlock(x, y, z); return block == worldBlock && meta == worldBlock.getDamageValue(world, x, y, z); } @Override - public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { + public boolean spawnHint(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { TecTech.proxy.hint_particle(world, x, y, z, hintBlock, hintMeta); return true; } }; } - public static IStructureElementNoPlacement ofBlockHint(Block block, int meta) { + public static IStructureElementNoPlacement ofBlockHint(Block block, int meta) { return ofBlockHint(block, meta, block, meta); } - public static IStructureElementNoPlacement ofBlockAdderHint(IBlockAdder iBlockAdder, Block hintBlock, int hintMeta) { + public static IStructureElementNoPlacement ofBlockAdderHint(IBlockAdder iBlockAdder, Block hintBlock, int hintMeta) { if (iBlockAdder == null || hintBlock == null) { throw new IllegalArgumentException(); } - return new IStructureElementNoPlacement() { + return new IStructureElementNoPlacement() { @Override - public boolean check(T t, World world, int x, int y, int z) { + public boolean check(MultiBlock multiBlock, World world, int x, int y, int z) { Block worldBlock = world.getBlock(x, y, z); - return iBlockAdder.apply(t, worldBlock, worldBlock.getDamageValue(world, x, y, z)); + return iBlockAdder.apply(multiBlock, worldBlock, worldBlock.getDamageValue(world, x, y, z)); } @Override - public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { + public boolean spawnHint(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { TecTech.proxy.hint_particle(world, x, y, z, hintBlock, hintMeta); return true; } @@ -288,46 +288,46 @@ public class StructureUtility { /** * Does not allow Block duplicates (with different meta) */ - public static IStructureElement ofBlocksFlat(Map blocsMap, Block defaultBlock, int defaultMeta) { + public static IStructureElement ofBlocksFlat(Map blocsMap, Block defaultBlock, int defaultMeta) { if (blocsMap == null || blocsMap.isEmpty() || defaultBlock == null) { throw new IllegalArgumentException(); } if(defaultBlock instanceof ICustomBlockSetting){ - return new IStructureElement() { + return new IStructureElement() { @Override - public boolean check(T t, World world, int x, int y, int z) { + public boolean check(MultiBlock multiBlock, World world, int x, int y, int z) { Block worldBlock = world.getBlock(x, y, z); return blocsMap.getOrDefault(worldBlock, MIN_VALUE) == worldBlock.getDamageValue(world, x, y, z); } @Override - public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { + public boolean placeBlock(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { ((ICustomBlockSetting) defaultBlock).setBlock(world, x, y, z, defaultMeta); return true; } @Override - public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { + public boolean spawnHint(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { TecTech.proxy.hint_particle(world, x, y, z, defaultBlock, defaultMeta); return true; } }; }else { - return new IStructureElement() { + return new IStructureElement() { @Override - public boolean check(T t, World world, int x, int y, int z) { + public boolean check(MultiBlock multiBlock, World world, int x, int y, int z) { Block worldBlock = world.getBlock(x, y, z); return blocsMap.getOrDefault(worldBlock, MIN_VALUE) == worldBlock.getDamageValue(world, x, y, z); } @Override - public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { + public boolean placeBlock(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { world.setBlock(x, y, z, defaultBlock, defaultMeta, 2); return true; } @Override - public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { + public boolean spawnHint(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { TecTech.proxy.hint_particle(world, x, y, z, defaultBlock, defaultMeta); return true; } @@ -338,7 +338,7 @@ public class StructureUtility { /** * Allows block duplicates (with different meta) */ - public static IStructureElement ofBlocksMap(Map> blocsMap, Block defaultBlock, int defaultMeta) { + public static IStructureElement ofBlocksMap(Map> blocsMap, Block defaultBlock, int defaultMeta) { if (blocsMap == null || blocsMap.isEmpty() || defaultBlock == null) { throw new IllegalArgumentException(); } @@ -348,41 +348,41 @@ public class StructureUtility { } } if(defaultBlock instanceof ICustomBlockSetting){ - return new IStructureElement() { + return new IStructureElement() { @Override - public boolean check(T t, World world, int x, int y, int z) { + public boolean check(MultiBlock multiBlock, World world, int x, int y, int z) { Block worldBlock = world.getBlock(x, y, z); return blocsMap.getOrDefault(worldBlock, Collections.emptySet()).contains(worldBlock.getDamageValue(world, x, y, z)); } @Override - public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { + public boolean placeBlock(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { ((ICustomBlockSetting) defaultBlock).setBlock(world, x, y, z, defaultMeta); return true; } @Override - public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { + public boolean spawnHint(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { TecTech.proxy.hint_particle(world, x, y, z, defaultBlock, defaultMeta); return true; } }; }else { - return new IStructureElement() { + return new IStructureElement() { @Override - public boolean check(T t, World world, int x, int y, int z) { + public boolean check(MultiBlock multiBlock, World world, int x, int y, int z) { Block worldBlock = world.getBlock(x, y, z); return blocsMap.getOrDefault(worldBlock, Collections.emptySet()).contains(worldBlock.getDamageValue(world, x, y, z)); } @Override - public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { + public boolean placeBlock(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { world.setBlock(x, y, z, defaultBlock, defaultMeta, 2); return true; } @Override - public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { + public boolean spawnHint(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { TecTech.proxy.hint_particle(world, x, y, z, defaultBlock, defaultMeta); return true; } @@ -390,46 +390,46 @@ public class StructureUtility { } } - public static IStructureElement ofBlock(Block block, int meta, Block defaultBlock, int defaultMeta) { + public static IStructureElement ofBlock(Block block, int meta, Block defaultBlock, int defaultMeta) { if (block == null || defaultBlock == null) { throw new IllegalArgumentException(); } if(block instanceof ICustomBlockSetting){ - return new IStructureElement() { + return new IStructureElement() { @Override - public boolean check(T t, World world, int x, int y, int z) { + public boolean check(MultiBlock multiBlock, World world, int x, int y, int z) { Block worldBlock = world.getBlock(x, y, z); return block == worldBlock && meta == worldBlock.getDamageValue(world, x, y, z); } @Override - public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { + public boolean placeBlock(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { ((ICustomBlockSetting) defaultBlock).setBlock(world, x, y, z, defaultMeta); return true; } @Override - public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { + public boolean spawnHint(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { TecTech.proxy.hint_particle(world, x, y, z, defaultBlock, defaultMeta); return true; } }; } else { - return new IStructureElement() { + return new IStructureElement() { @Override - public boolean check(T t, World world, int x, int y, int z) { + public boolean check(MultiBlock multiBlock, World world, int x, int y, int z) { Block worldBlock = world.getBlock(x, y, z); return block == worldBlock && meta == worldBlock.getDamageValue(world, x, y, z); } @Override - public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { + public boolean placeBlock(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { world.setBlock(x, y, z, defaultBlock, defaultMeta, 2); return true; } @Override - public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { + public boolean spawnHint(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { TecTech.proxy.hint_particle(world, x, y, z, defaultBlock, defaultMeta); return true; } @@ -440,44 +440,44 @@ public class StructureUtility { /** * Same as above but ignores target meta id */ - public static IStructureElement ofBlockAnyMeta(Block block, Block defaultBlock, int defaultMeta) { + public static IStructureElement ofBlockAnyMeta(Block block, Block defaultBlock, int defaultMeta) { if (block == null || defaultBlock == null) { throw new IllegalArgumentException(); } if(block instanceof ICustomBlockSetting){ - return new IStructureElement() { + return new IStructureElement() { @Override - public boolean check(T t, World world, int x, int y, int z) { + public boolean check(MultiBlock multiBlock, World world, int x, int y, int z) { return block == world.getBlock(x, y, z); } @Override - public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { + public boolean placeBlock(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { ((ICustomBlockSetting) defaultBlock).setBlock(world, x, y, z, defaultMeta); return true; } @Override - public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { + public boolean spawnHint(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { TecTech.proxy.hint_particle(world, x, y, z, defaultBlock, defaultMeta); return true; } }; } else { - return new IStructureElement() { + return new IStructureElement() { @Override - public boolean check(T t, World world, int x, int y, int z) { + public boolean check(MultiBlock multiBlock, World world, int x, int y, int z) { return block == world.getBlock(x, y, z); } @Override - public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { + public boolean placeBlock(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { world.setBlock(x, y, z, defaultBlock, defaultMeta, 2); return true; } @Override - public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { + public boolean spawnHint(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { TecTech.proxy.hint_particle(world, x, y, z, defaultBlock, defaultMeta); return true; } @@ -485,21 +485,21 @@ public class StructureUtility { } } - public static IStructureElement ofBlock(Block block, int meta) { + public static IStructureElement ofBlock(Block block, int meta) { return ofBlock(block, meta, block, meta); } /** * Same as above but ignores target meta id */ - public static IStructureElement ofBlockAnyMeta(Block block) { + public static IStructureElement ofBlockAnyMeta(Block block) { return ofBlockAnyMeta(block, block, 0); } /** * Same as above but allows to set hint particle render */ - public static IStructureElement ofBlockAnyMeta(Block block,int defaultMeta) { + public static IStructureElement ofBlockAnyMeta(Block block,int defaultMeta) { return ofBlockAnyMeta(block, block, defaultMeta); } @@ -507,46 +507,46 @@ public class StructureUtility { //region adders - public static IStructureElement ofBlockAdder(IBlockAdder iBlockAdder, Block defaultBlock, int defaultMeta) { + public static IStructureElement ofBlockAdder(IBlockAdder iBlockAdder, Block defaultBlock, int defaultMeta) { if (iBlockAdder == null || defaultBlock == null) { throw new IllegalArgumentException(); } if(defaultBlock instanceof ICustomBlockSetting){ - return new IStructureElement() { + return new IStructureElement() { @Override - public boolean check(T t, World world, int x, int y, int z) { + public boolean check(MultiBlock multiBlock, World world, int x, int y, int z) { Block worldBlock = world.getBlock(x, y, z); - return iBlockAdder.apply(t, worldBlock, worldBlock.getDamageValue(world, x, y, z)); + return iBlockAdder.apply(multiBlock, worldBlock, worldBlock.getDamageValue(world, x, y, z)); } @Override - public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { + public boolean placeBlock(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { ((ICustomBlockSetting) defaultBlock).setBlock(world, x, y, z, defaultMeta); return true; } @Override - public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { + public boolean spawnHint(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { TecTech.proxy.hint_particle(world, x, y, z, defaultBlock, defaultMeta); return true; } }; }else { - return new IStructureElement() { + return new IStructureElement() { @Override - public boolean check(T t, World world, int x, int y, int z) { + public boolean check(MultiBlock multiBlock, World world, int x, int y, int z) { Block worldBlock = world.getBlock(x, y, z); - return iBlockAdder.apply(t, worldBlock, worldBlock.getDamageValue(world, x, y, z)); + return iBlockAdder.apply(multiBlock, worldBlock, worldBlock.getDamageValue(world, x, y, z)); } @Override - public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { + public boolean placeBlock(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { world.setBlock(x, y, z, defaultBlock, defaultMeta, 2); return true; } @Override - public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { + public boolean spawnHint(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { TecTech.proxy.hint_particle(world, x, y, z, defaultBlock, defaultMeta); return true; } @@ -554,102 +554,102 @@ public class StructureUtility { } } - public static IStructureElement ofBlockAdder(IBlockAdder iBlockAdder, int dots) { + public static IStructureElement ofBlockAdder(IBlockAdder iBlockAdder, int dots) { return ofBlockAdder(iBlockAdder, sHintCasingsTT, dots - 1); } - public static IStructureElementNoPlacement ofTileAdder(ITileAdder iTileAdder, Block hintBlock, int hintMeta) { + public static IStructureElementNoPlacement ofTileAdder(ITileAdder iTileAdder, Block hintBlock, int hintMeta) { if (iTileAdder == null || hintBlock == null) { throw new IllegalArgumentException(); } - return new IStructureElementNoPlacement() { + return new IStructureElementNoPlacement() { @Override - public boolean check(T t, World world, int x, int y, int z) { + public boolean check(MultiBlock multiBlock, World world, int x, int y, int z) { TileEntity tileEntity = world.getTileEntity(x, y, z); - return tileEntity instanceof IGregTechTileEntity && iTileAdder.apply(t, tileEntity); + return tileEntity instanceof IGregTechTileEntity && iTileAdder.apply(multiBlock, tileEntity); } @Override - public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { + public boolean spawnHint(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { TecTech.proxy.hint_particle(world, x, y, z, hintBlock, hintMeta); return true; } }; } - public static IStructureElementNoPlacement ofHatchAdder(IHatchAdder iHatchAdder, int textureIndex, int dots) { + public static IStructureElementNoPlacement ofHatchAdder(IHatchAdder iHatchAdder, int textureIndex, int dots) { return ofHatchAdder(iHatchAdder, textureIndex, sHintCasingsTT, dots - 1); } - public static IStructureElementNoPlacement ofHatchAdder(IHatchAdder iHatchAdder, int textureIndex, Block hintBlock, int hintMeta) { + public static IStructureElementNoPlacement ofHatchAdder(IHatchAdder iHatchAdder, int textureIndex, Block hintBlock, int hintMeta) { if (iHatchAdder == null || hintBlock == null) { throw new IllegalArgumentException(); } - return new IStructureElementNoPlacement() { + return new IStructureElementNoPlacement() { @Override - public boolean check(T t, World world, int x, int y, int z) { + public boolean check(MultiBlock multiBlock, World world, int x, int y, int z) { TileEntity tileEntity = world.getTileEntity(x, y, z); - return tileEntity instanceof IGregTechTileEntity && iHatchAdder.apply(t, (IGregTechTileEntity) tileEntity, (short) textureIndex); + return tileEntity instanceof IGregTechTileEntity && iHatchAdder.apply(multiBlock, (IGregTechTileEntity) tileEntity, (short) textureIndex); } @Override - public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { + public boolean spawnHint(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { TecTech.proxy.hint_particle(world, x, y, z, hintBlock, hintMeta); return true; } }; } - public static IStructureElement ofHatchAdderOptional(IHatchAdder iHatchAdder, int textureIndex, int dots, Block placeCasing, int placeCasingMeta) { + public static IStructureElement ofHatchAdderOptional(IHatchAdder iHatchAdder, int textureIndex, int dots, Block placeCasing, int placeCasingMeta) { return ofHatchAdderOptional(iHatchAdder, textureIndex, sHintCasingsTT, dots - 1, placeCasing, placeCasingMeta); } - public static IStructureElement ofHatchAdderOptional(IHatchAdder iHatchAdder, int textureIndex, Block hintBlock, int hintMeta, Block placeCasing, int placeCasingMeta) { + public static IStructureElement ofHatchAdderOptional(IHatchAdder iHatchAdder, int textureIndex, Block hintBlock, int hintMeta, Block placeCasing, int placeCasingMeta) { if (iHatchAdder == null || hintBlock == null) { throw new IllegalArgumentException(); } if(placeCasing instanceof ICustomBlockSetting){ - return new IStructureElement() { + return new IStructureElement() { @Override - public boolean check(T t, World world, int x, int y, int z) { + public boolean check(MultiBlock multiBlock, World world, int x, int y, int z) { TileEntity tileEntity = world.getTileEntity(x, y, z); Block worldBlock = world.getBlock(x, y, z); return (tileEntity instanceof IGregTechTileEntity && - iHatchAdder.apply(t, (IGregTechTileEntity) tileEntity, (short) textureIndex)) || + iHatchAdder.apply(multiBlock, (IGregTechTileEntity) tileEntity, (short) textureIndex)) || (worldBlock == placeCasing && worldBlock.getDamageValue(world, x, y, z) == placeCasingMeta); } @Override - public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { + public boolean spawnHint(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { TecTech.proxy.hint_particle(world, x, y, z, hintBlock, hintMeta); return true; } @Override - public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { + public boolean placeBlock(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { ((ICustomBlockSetting) placeCasing).setBlock(world, x, y, z, placeCasingMeta); return true; } }; }else { - return new IStructureElement() { + return new IStructureElement() { @Override - public boolean check(T t, World world, int x, int y, int z) { + public boolean check(MultiBlock multiBlock, World world, int x, int y, int z) { TileEntity tileEntity = world.getTileEntity(x, y, z); Block worldBlock = world.getBlock(x, y, z); return (tileEntity instanceof IGregTechTileEntity && - iHatchAdder.apply(t, (IGregTechTileEntity) tileEntity, (short) textureIndex)) || + iHatchAdder.apply(multiBlock, (IGregTechTileEntity) tileEntity, (short) textureIndex)) || (worldBlock == placeCasing && worldBlock.getDamageValue(world, x, y, z) == placeCasingMeta); } @Override - public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { + public boolean spawnHint(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { TecTech.proxy.hint_particle(world, x, y, z, hintBlock, hintMeta); return true; } @Override - public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { + public boolean placeBlock(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { world.setBlock(x, y, z, placeCasing, placeCasingMeta, 2); return true; } @@ -661,48 +661,48 @@ public class StructureUtility { //region side effects - public static , T> IStructureElement onElementPass(Consumer onCheckPass, B element) { - return new IStructureElement() { + public static IStructureElement onElementPass(Consumer onCheckPass, IStructureElement element) { + return new IStructureElement() { @Override - public boolean check(T t, World world, int x, int y, int z) { - boolean check = element.check(t, world, x, y, z); + public boolean check(MultiBlock multiBlock, World world, int x, int y, int z) { + boolean check = element.check(multiBlock, world, x, y, z); if (check) { - onCheckPass.accept(t); + onCheckPass.accept(multiBlock); } return check; } @Override - public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { - return element.placeBlock(t, world, x, y, z, trigger); + public boolean placeBlock(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { + return element.placeBlock(multiBlock, world, x, y, z, trigger); } @Override - public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { - return element.spawnHint(t, world, x, y, z, trigger); + public boolean spawnHint(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { + return element.spawnHint(multiBlock, world, x, y, z, trigger); } }; } - public static , T> IStructureElement onElementFail(Consumer onFail, B element) { - return new IStructureElement() { + public static IStructureElement onElementFail(Consumer onFail, IStructureElement element) { + return new IStructureElement() { @Override - public boolean check(T t, World world, int x, int y, int z) { - boolean check = element.check(t, world, x, y, z); + public boolean check(MultiBlock multiBlock, World world, int x, int y, int z) { + boolean check = element.check(multiBlock, world, x, y, z); if (!check) { - onFail.accept(t); + onFail.accept(multiBlock); } return check; } @Override - public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { - return element.placeBlock(t, world, x, y, z, trigger); + public boolean placeBlock(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { + return element.placeBlock(multiBlock, world, x, y, z, trigger); } @Override - public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { - return element.spawnHint(t, world, x, y, z, trigger); + public boolean spawnHint(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { + return element.spawnHint(multiBlock, world, x, y, z, trigger); } }; } @@ -714,15 +714,15 @@ public class StructureUtility { * If none does it will finally return false. * * @param elementChain - * @param + * @param * @return */ @SafeVarargs - public static IStructureElementChain ofChain(IStructureElement... elementChain) { + public static IStructureElementChain ofChain(IStructureElement... elementChain) { if (elementChain == null || elementChain.length == 0) { throw new IllegalArgumentException(); } - for (IStructureElement iStructureElement : elementChain) { + for (IStructureElement iStructureElement : elementChain) { if (iStructureElement == null) { throw new IllegalArgumentException(); } @@ -735,317 +735,317 @@ public class StructureUtility { * If none does it will finally return false. * * @param elementChain - * @param + * @param * @return */ @SuppressWarnings("unchecked") - public static IStructureElementChain ofChain(List> elementChain) { + public static IStructureElementChain ofChain(List> elementChain) { return ofChain(elementChain.toArray(new IStructureElement[0])); } //region defer - public static IStructureElementDeferred defer(Supplier> to) { + public static IStructureElementDeferred defer(Supplier> to) { if (to == null) { throw new IllegalArgumentException(); } - return new IStructureElementDeferred() { + return new IStructureElementDeferred() { @Override - public boolean check(T t, World world, int x, int y, int z) { - return to.get().check(t, world, x, y, z); + public boolean check(MultiBlock multiBlock, World world, int x, int y, int z) { + return to.get().check(multiBlock, world, x, y, z); } @Override - public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { - return to.get().placeBlock(t, world, x, y, z, trigger); + public boolean placeBlock(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { + return to.get().placeBlock(multiBlock, world, x, y, z, trigger); } @Override - public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { - return to.get().spawnHint(t, world, x, y, z, trigger); + public boolean spawnHint(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { + return to.get().spawnHint(multiBlock, world, x, y, z, trigger); } }; } - public static IStructureElementDeferred defer(Function> to) { + public static IStructureElementDeferred defer(Function> to) { if (to == null) { throw new IllegalArgumentException(); } - return new IStructureElementDeferred() { + return new IStructureElementDeferred() { @Override - public boolean check(T t, World world, int x, int y, int z) { - return to.apply(t).check(t, world, x, y, z); + public boolean check(MultiBlock multiBlock, World world, int x, int y, int z) { + return to.apply(multiBlock).check(multiBlock, world, x, y, z); } @Override - public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { - return to.apply(t).placeBlock(t, world, x, y, z, trigger); + public boolean placeBlock(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { + return to.apply(multiBlock).placeBlock(multiBlock, world, x, y, z, trigger); } @Override - public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { - return to.apply(t).spawnHint(t, world, x, y, z, trigger); + public boolean spawnHint(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { + return to.apply(multiBlock).spawnHint(multiBlock, world, x, y, z, trigger); } }; } - public static IStructureElementDeferred defer(Function keyExtractor, Map> map) { + public static IStructureElementDeferred defer(Function keyExtractor, Map> map) { if (keyExtractor == null || map == null) { throw new IllegalArgumentException(); } - return new IStructureElementDeferred() { + return new IStructureElementDeferred() { @Override - public boolean check(T t, World world, int x, int y, int z) { - return map.get(keyExtractor.apply(t)).check(t, world, x, y, z); + public boolean check(MultiBlock multiBlock, World world, int x, int y, int z) { + return map.get(keyExtractor.apply(multiBlock)).check(multiBlock, world, x, y, z); } @Override - public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { - return map.get(keyExtractor.apply(t)).placeBlock(t, world, x, y, z, trigger); + public boolean placeBlock(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { + return map.get(keyExtractor.apply(multiBlock)).placeBlock(multiBlock, world, x, y, z, trigger); } @Override - public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { - return map.get(keyExtractor.apply(t)).spawnHint(t, world, x, y, z, trigger); + public boolean spawnHint(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { + return map.get(keyExtractor.apply(multiBlock)).spawnHint(multiBlock, world, x, y, z, trigger); } }; } - public static IStructureElementDeferred defer(Function keyExtractor, Map> map, IStructureElement defaultElem) { + public static IStructureElementDeferred defer(Function keyExtractor, Map> map, IStructureElement defaultElem) { if (keyExtractor == null || map == null) { throw new IllegalArgumentException(); } - return new IStructureElementDeferred() { + return new IStructureElementDeferred() { @Override - public boolean check(T t, World world, int x, int y, int z) { - return map.getOrDefault(keyExtractor.apply(t), defaultElem).check(t, world, x, y, z); + public boolean check(MultiBlock multiBlock, World world, int x, int y, int z) { + return map.getOrDefault(keyExtractor.apply(multiBlock), defaultElem).check(multiBlock, world, x, y, z); } @Override - public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { - return map.getOrDefault(keyExtractor.apply(t), defaultElem).placeBlock(t, world, x, y, z, trigger); + public boolean placeBlock(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { + return map.getOrDefault(keyExtractor.apply(multiBlock), defaultElem).placeBlock(multiBlock, world, x, y, z, trigger); } @Override - public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { - return map.getOrDefault(keyExtractor.apply(t), defaultElem).spawnHint(t, world, x, y, z, trigger); + public boolean spawnHint(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { + return map.getOrDefault(keyExtractor.apply(multiBlock), defaultElem).spawnHint(multiBlock, world, x, y, z, trigger); } }; } @SafeVarargs - public static IStructureElementDeferred defer(Function keyExtractor, IStructureElement... array) { + public static IStructureElementDeferred defer(Function keyExtractor, IStructureElement... array) { if (keyExtractor == null || array == null) { throw new IllegalArgumentException(); } - return new IStructureElementDeferred() { + return new IStructureElementDeferred() { @Override - public boolean check(T t, World world, int x, int y, int z) { - return array[keyExtractor.apply(t)].check(t, world, x, y, z); + public boolean check(MultiBlock multiBlock, World world, int x, int y, int z) { + return array[keyExtractor.apply(multiBlock)].check(multiBlock, world, x, y, z); } @Override - public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { - return array[keyExtractor.apply(t)].placeBlock(t, world, x, y, z, trigger); + public boolean placeBlock(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { + return array[keyExtractor.apply(multiBlock)].placeBlock(multiBlock, world, x, y, z, trigger); } @Override - public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { - return array[keyExtractor.apply(t)].spawnHint(t, world, x, y, z, trigger); + public boolean spawnHint(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { + return array[keyExtractor.apply(multiBlock)].spawnHint(multiBlock, world, x, y, z, trigger); } }; } @SuppressWarnings("unchecked") - public static IStructureElementDeferred defer(Function keyExtractor, List> array) { + public static IStructureElementDeferred defer(Function keyExtractor, List> array) { return defer(keyExtractor, array.toArray(new IStructureElement[0])); } - public static IStructureElementDeferred defer(BiFunction> to) { + public static IStructureElementDeferred defer(BiFunction> to) { if (to == null) { throw new IllegalArgumentException(); } - return new IStructureElementDeferred() { + return new IStructureElementDeferred() { @Override - public boolean check(T t, World world, int x, int y, int z) { - return to.apply(t, null).check(t, world, x, y, z); + public boolean check(MultiBlock multiBlock, World world, int x, int y, int z) { + return to.apply(multiBlock, null).check(multiBlock, world, x, y, z); } @Override - public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { - return to.apply(t, trigger).placeBlock(t, world, x, y, z, trigger); + public boolean placeBlock(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { + return to.apply(multiBlock, trigger).placeBlock(multiBlock, world, x, y, z, trigger); } @Override - public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { - return to.apply(t, trigger).spawnHint(t, world, x, y, z, trigger); + public boolean spawnHint(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { + return to.apply(multiBlock, trigger).spawnHint(multiBlock, world, x, y, z, trigger); } }; } - public static IStructureElementDeferred defer(BiFunction keyExtractor, Map> map) { + public static IStructureElementDeferred defer(BiFunction keyExtractor, Map> map) { if (keyExtractor == null || map == null) { throw new IllegalArgumentException(); } - return new IStructureElementDeferred() { + return new IStructureElementDeferred() { @Override - public boolean check(T t, World world, int x, int y, int z) { - return map.get(keyExtractor.apply(t, null)).check(t, world, x, y, z); + public boolean check(MultiBlock multiBlock, World world, int x, int y, int z) { + return map.get(keyExtractor.apply(multiBlock, null)).check(multiBlock, world, x, y, z); } @Override - public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { - return map.get(keyExtractor.apply(t, trigger)).placeBlock(t, world, x, y, z, trigger); + public boolean placeBlock(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { + return map.get(keyExtractor.apply(multiBlock, trigger)).placeBlock(multiBlock, world, x, y, z, trigger); } @Override - public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { - return map.get(keyExtractor.apply(t, trigger)).spawnHint(t, world, x, y, z, trigger); + public boolean spawnHint(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { + return map.get(keyExtractor.apply(multiBlock, trigger)).spawnHint(multiBlock, world, x, y, z, trigger); } }; } - public static IStructureElementDeferred defer(BiFunction keyExtractor, Map> map, IStructureElement defaultElem) { + public static IStructureElementDeferred defer(BiFunction keyExtractor, Map> map, IStructureElement defaultElem) { if (keyExtractor == null || map == null) { throw new IllegalArgumentException(); } - return new IStructureElementDeferred() { + return new IStructureElementDeferred() { @Override - public boolean check(T t, World world, int x, int y, int z) { - return map.getOrDefault(keyExtractor.apply(t, null), defaultElem).check(t, world, x, y, z); + public boolean check(MultiBlock multiBlock, World world, int x, int y, int z) { + return map.getOrDefault(keyExtractor.apply(multiBlock, null), defaultElem).check(multiBlock, world, x, y, z); } @Override - public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { - return map.getOrDefault(keyExtractor.apply(t, trigger), defaultElem).placeBlock(t, world, x, y, z, trigger); + public boolean placeBlock(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { + return map.getOrDefault(keyExtractor.apply(multiBlock, trigger), defaultElem).placeBlock(multiBlock, world, x, y, z, trigger); } @Override - public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { - return map.getOrDefault(keyExtractor.apply(t, trigger), defaultElem).spawnHint(t, world, x, y, z, trigger); + public boolean spawnHint(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { + return map.getOrDefault(keyExtractor.apply(multiBlock, trigger), defaultElem).spawnHint(multiBlock, world, x, y, z, trigger); } }; } @SafeVarargs - public static IStructureElementDeferred defer(BiFunction keyExtractor, IStructureElement... array) { + public static IStructureElementDeferred defer(BiFunction keyExtractor, IStructureElement... array) { if (keyExtractor == null || array == null) { throw new IllegalArgumentException(); } - return new IStructureElementDeferred() { + return new IStructureElementDeferred() { @Override - public boolean check(T t, World world, int x, int y, int z) { - return array[keyExtractor.apply(t, null)].check(t, world, x, y, z); + public boolean check(MultiBlock multiBlock, World world, int x, int y, int z) { + return array[keyExtractor.apply(multiBlock, null)].check(multiBlock, world, x, y, z); } @Override - public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { - return array[keyExtractor.apply(t, trigger)].placeBlock(t, world, x, y, z, trigger); + public boolean placeBlock(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { + return array[keyExtractor.apply(multiBlock, trigger)].placeBlock(multiBlock, world, x, y, z, trigger); } @Override - public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { - return array[keyExtractor.apply(t, trigger)].spawnHint(t, world, x, y, z, trigger); + public boolean spawnHint(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { + return array[keyExtractor.apply(multiBlock, trigger)].spawnHint(multiBlock, world, x, y, z, trigger); } }; } @SuppressWarnings("unchecked") - public static IStructureElementDeferred defer(BiFunction keyExtractor, List> array) { + public static IStructureElementDeferred defer(BiFunction keyExtractor, List> array) { return defer(keyExtractor, array.toArray(new IStructureElement[0])); } - public static IStructureElementDeferred defer(Function> toCheck, BiFunction> to) { + public static IStructureElementDeferred defer(Function> toCheck, BiFunction> to) { if (to == null) { throw new IllegalArgumentException(); } - return new IStructureElementDeferred() { + return new IStructureElementDeferred() { @Override - public boolean check(T t, World world, int x, int y, int z) { - return toCheck.apply(t).check(t, world, x, y, z); + public boolean check(MultiBlock multiBlock, World world, int x, int y, int z) { + return toCheck.apply(multiBlock).check(multiBlock, world, x, y, z); } @Override - public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { - return to.apply(t, trigger).placeBlock(t, world, x, y, z, trigger); + public boolean placeBlock(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { + return to.apply(multiBlock, trigger).placeBlock(multiBlock, world, x, y, z, trigger); } @Override - public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { - return to.apply(t, trigger).spawnHint(t, world, x, y, z, trigger); + public boolean spawnHint(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { + return to.apply(multiBlock, trigger).spawnHint(multiBlock, world, x, y, z, trigger); } }; } - public static IStructureElementDeferred defer(Function keyExtractorCheck, BiFunction keyExtractor, Map> map) { + public static IStructureElementDeferred defer(Function keyExtractorCheck, BiFunction keyExtractor, Map> map) { if (keyExtractor == null || map == null) { throw new IllegalArgumentException(); } - return new IStructureElementDeferred() { + return new IStructureElementDeferred() { @Override - public boolean check(T t, World world, int x, int y, int z) { - return map.get(keyExtractorCheck.apply(t)).check(t, world, x, y, z); + public boolean check(MultiBlock multiBlock, World world, int x, int y, int z) { + return map.get(keyExtractorCheck.apply(multiBlock)).check(multiBlock, world, x, y, z); } @Override - public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { - return map.get(keyExtractor.apply(t, trigger)).placeBlock(t, world, x, y, z, trigger); + public boolean placeBlock(MultiBlock multiBlock, World world, int x, int y, int z, ItemStack trigger) { + return map.get(keyExtractor.apply(multiBlock, trigger)).placeBlock(multiBlock, world, x, y, z, trigger); }