aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java532
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/structure/adders/IBlockAdder.java2
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/structure/adders/IHatchAdder.java2
3 files changed, 268 insertions, 268 deletions
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 <T> IStructureElement<T> isAir() {
+ public static <MultiBlock> IStructureElement<MultiBlock> isAir() {
return AIR;
}
@SuppressWarnings("unchecked")
- public static <T> IStructureElement<T> notAir() {
+ public static <MultiBlock> IStructureElement<MultiBlock> 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 <T>
+ * @param <MultiBlock>
* @return
*/
@SuppressWarnings("unchecked")
- public static <T> IStructureElement<T> error() {
+ public static <MultiBlock> IStructureElement<MultiBlock> error() {
return ERROR;
}
@@ -126,19 +126,19 @@ public class StructureUtility {
* Check always returns: true.
*
* @param dots
- * @param <T>
+ * @param <MultiBlock>
* @return
*/
- public static <T> IStructureElementNoPlacement<T> ofHint(int dots) {
+ public static <MultiBlock> IStructureElementNoPlacement<MultiBlock> ofHint(int dots) {
int meta = dots - 1;
- return new IStructureElementNoPlacement<T>() {
+ return new IStructureElementNoPlacement<MultiBlock>() {
@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 <T>
+ * @param <MultiBlock>
* @return
*/
- public static <T> IStructureElementNoPlacement<T> ofHintDeferred(Supplier<IIcon[]> icons) {
- return new IStructureElementNoPlacement<T>() {
+ public static <MultiBlock> IStructureElementNoPlacement<MultiBlock> ofHintDeferred(Supplier<IIcon[]> icons) {
+ return new IStructureElementNoPlacement<MultiBlock>() {
@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 <T>
+ * @param <MultiBlock>
* @return
*/
- public static <T> IStructureElementNoPlacement<T> ofHintDeferred(Supplier<IIcon[]> icons, short[] RGBa) {
- return new IStructureElementNoPlacement<T>() {
+ public static <MultiBlock> IStructureElementNoPlacement<MultiBlock> ofHintDeferred(Supplier<IIcon[]> icons, short[] RGBa) {
+ return new IStructureElementNoPlacement<MultiBlock>() {
@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 <T> IStructureElementNoPlacement<T> ofBlocksFlatHint(Map<Block, Integer> blocsMap, Block hintBlock, int hintMeta) {
+ public static <MultiBlock> IStructureElementNoPlacement<MultiBlock> ofBlocksFlatHint(Map<Block, Integer> blocsMap, Block hintBlock, int hintMeta) {
if (blocsMap == null || blocsMap.isEmpty() || hintBlock == null) {
throw new IllegalArgumentException();
}
- return new IStructureElementNoPlacement<T>() {
+ return new IStructureElementNoPlacement<MultiBlock>() {
@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 <T> IStructureElementNoPlacement<T> ofBlocksMapHint(Map<Block, Set<Integer>> blocsMap, Block hintBlock, int hintMeta) {
+ public static <MultiBlock> IStructureElementNoPlacement<MultiBlock> ofBlocksMapHint(Map<Block, Set<Integer>> 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<T>() {
+ return new IStructureElementNoPlacement<MultiBlock>() {
@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 <T> IStructureElementNoPlacement<T> ofBlockHint(Block block, int meta, Block hintBlock, int hintMeta) {
+ public static <MultiBlock> IStructureElementNoPlacement<MultiBlock> ofBlockHint(Block block, int meta, Block hintBlock, int hintMeta) {
if (block == null || hintBlock == null) {
throw new IllegalArgumentException();
}
- return new IStructureElementNoPlacement<T>() {
+ return new IStructureElementNoPlacement<MultiBlock>() {
@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 <T> IStructureElementNoPlacement<T> ofBlockHint(Block block, int meta) {
+ public static <MultiBlock> IStructureElementNoPlacement<MultiBlock> ofBlockHint(Block block, int meta) {
return ofBlockHint(block, meta, block, meta);
}
- public static <T> IStructureElementNoPlacement<T> ofBlockAdderHint(IBlockAdder<T> iBlockAdder, Block hintBlock, int hintMeta) {
+ public static <MultiBlock> IStructureElementNoPlacement<MultiBlock> ofBlockAdderHint(IBlockAdder<MultiBlock> iBlockAdder, Block hintBlock, int hintMeta) {
if (iBlockAdder == null || hintBlock == null) {
throw new IllegalArgumentException();
}
- return new IStructureElementNoPlacement<T>() {
+ return new IStructureElementNoPlacement<MultiBlock>() {
@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 <T> IStructureElement<T> ofBlocksFlat(Map<Block, Integer> blocsMap, Block defaultBlock, int defaultMeta) {
+ public static <MultiBlock> IStructureElement<MultiBlock> ofBlocksFlat(Map<Block, Integer> blocsMap, Block defaultBlock, int defaultMeta) {
if (blocsMap == null || blocsMap.isEmpty() || defaultBlock == null) {
throw new IllegalArgumentException();
}
if(defaultBlock instanceof ICustomBlockSetting){
- return new IStructureElement<T>() {
+ return new IStructureElement<MultiBlock>() {
@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<T>() {
+ return new IStructureElement<MultiBlock>() {
@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 <T> IStructureElement<T> ofBlocksMap(Map<Block, Set<Integer>> blocsMap, Block defaultBlock, int defaultMeta) {
+ public static <MultiBlock> IStructureElement<MultiBlock> ofBlocksMap(Map<Block, Set<Integer>> 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<T>() {
+ return new IStructureElement<MultiBlock>() {
@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<T>() {
+ return new IStructureElement<MultiBlock>() {
@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 <T> IStructureElement<T> ofBlock(Block block, int meta, Block defaultBlock, int defaultMeta) {
+ public static <MultiBlock> IStructureElement<MultiBlock> ofBlock(Block block, int meta, Block defaultBlock, int defaultMeta) {
if (block == null || defaultBlock == null) {
throw new IllegalArgumentException();
}
if(block instanceof ICustomBlockSetting){
- return new IStructureElement<T>() {
+ return new IStructureElement<MultiBlock>() {
@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<T>() {
+ return new IStructureElement<MultiBlock>() {
@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 <T> IStructureElement<T> ofBlockAnyMeta(Block block, Block defaultBlock, int defaultMeta) {
+ public static <MultiBlock> IStructureElement<MultiBlock> ofBlockAnyMeta(Block block, Block defaultBlock, int defaultMeta) {
if (block == null || defaultBlock == null) {
throw new IllegalArgumentException();
}
if(block instanceof ICustomBlockSetting){
- return new IStructureElement<T>() {
+ return new IStructureElement<MultiBlock>() {
@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<T>() {
+ return new IStructureElement<MultiBlock>() {
@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 <T> IStructureElement<T> ofBlock(Block block, int meta) {
+ public static <MultiBlock> IStructureElement<MultiBlock> ofBlock(Block block, int meta) {
return ofBlock(block, meta, block, meta);
}
/**
* Same as above but ignores target meta id
*/
- public static <T> IStructureElement<T> ofBlockAnyMeta(Block block) {
+ public static <MultiBlock> IStructureElement<MultiBlock> ofBlockAnyMeta(Block block) {
return ofBlockAnyMeta(block, block, 0);
}
/**
* Same as above but allows to set hint particle render
*/
- public static <T> IStructureElement<T> ofBlockAnyMeta(Block block,int defaultMeta) {
+ public static <MultiBlock> IStructureElement<MultiBlock> ofBlockAnyMeta(Block block,int defaultMeta) {
return ofBlockAnyMeta(block, block, defaultMeta);
}
@@ -507,46 +507,46 @@ public class StructureUtility {
//region adders
- public static <T> IStructureElement<T> ofBlockAdder(IBlockAdder<T> iBlockAdder, Block defaultBlock, int defaultMeta) {
+ public static <MultiBlock> IStructureElement<MultiBlock> ofBlockAdder(IBlockAdder<MultiBlock> iBlockAdder, Block defaultBlock, int defaultMeta) {
if (iBlockAdder == null || defaultBlock == null) {
throw new IllegalArgumentException();
}
if(defaultBlock instanceof ICustomBlockSetting){
- return new IStructureElement<T>() {
+ return new IStructureElement<MultiBlock>() {
@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<T>() {
+ return new IStructureElement<MultiBlock>() {
@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 <T> IStructureElement<T> ofBlockAdder(IBlockAdder<T> iBlockAdder, int dots) {
+ public static <MultiBlock> IStructureElement<MultiBlock> ofBlockAdder(IBlockAdder<MultiBlock> iBlockAdder, int dots) {
return ofBlockAdder(iBlockAdder, sHintCasingsTT, dots - 1);
}
- public static <T> IStructureElementNoPlacement<T> ofTileAdder(ITileAdder<T> iTileAdder, Block hintBlock, int hintMeta) {
+ public static <MultiBlock> IStructureElementNoPlacement<MultiBlock> ofTileAdder(ITileAdder<MultiBlock> iTileAdder, Block hintBlock, int hintMeta) {
if (iTileAdder == null || hintBlock == null) {
throw new IllegalArgumentException();
}
- return new IStructureElementNoPlacement<T>() {
+ return new IStructureElementNoPlacement<MultiBlock>() {
@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 <T> IStructureElementNoPlacement<T> ofHatchAdder(IHatchAdder<T> iHatchAdder, int textureIndex, int dots) {
+ public static <MultiBlock> IStructureElementNoPlacement<MultiBlock> ofHatchAdder(IHatchAdder<MultiBlock> iHatchAdder, int textureIndex, int dots) {
return ofHatchAdder(iHatchAdder, textureIndex, sHintCasingsTT, dots - 1);
}
- public static <T> IStructureElementNoPlacement<T> ofHatchAdder(IHatchAdder<T> iHatchAdder, int textureIndex, Block hintBlock, int hintMeta) {
+ public static <MultiBlock> IStructureElementNoPlacement<MultiBlock> ofHatchAdder(IHatchAdder<MultiBlock> iHatchAdder, int textureIndex, Block hintBlock, int hintMeta) {
if (iHatchAdder == null || hintBlock == null) {
throw new IllegalArgumentException();
}
- return new IStructureElementNoPlacement<T>() {
+ return new IStructureElementNoPlacement<MultiBlock>() {
@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 <T> IStructureElement<T> ofHatchAdderOptional(IHatchAdder<T> iHatchAdder, int textureIndex, int dots, Block placeCasing, int placeCasingMeta) {
+ public static <MultiBlock> IStructureElement<MultiBlock> ofHatchAdderOptional(IHatchAdder<MultiBlock> iHatchAdder, int textureIndex, int dots, Block placeCasing, int placeCasingMeta) {
return ofHatchAdderOptional(iHatchAdder, textureIndex, sHintCasingsTT, dots - 1, placeCasing, placeCasingMeta);
}
- public static <T> IStructureElement<T> ofHatchAdderOptional(IHatchAdder<T> iHatchAdder, int textureIndex, Block hintBlock, int hintMeta, Block placeCasing, int placeCasingMeta) {
+ public static <MultiBlock> IStructureElement<MultiBlock> ofHatchAdderOptional(IHatchAdder<MultiBlock> 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<T>() {
+ return new IStructureElement<MultiBlock>() {
@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<T>() {
+ return new IStructureElement<MultiBlock>() {
@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 <B extends IStructureElement<T>, T> IStructureElement<T> onElementPass(Consumer<T> onCheckPass, B element) {
- return new IStructureElement<T>() {
+ public static <MultiBlock> IStructureElement<MultiBlock> onElementPass(Consumer<MultiBlock> onCheckPass, IStructureElement<MultiBlock> element) {
+ return new IStructureElement<MultiBlock>() {
@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 <B extends IStructureElement<T>, T> IStructureElement<T> onElementFail(Consumer<T> onFail, B element) {
- return new IStructureElement<T>() {
+ public static <MultiBlock> IStructureElement<MultiBlock> onElementFail(Consumer<MultiBlock> onFail, IStructureElement<MultiBlock> element) {
+ return new IStructureElement<MultiBloc