diff --git a/src/main/java/com/hbm/blocks/generic/BlockChain.java b/src/main/java/com/hbm/blocks/generic/BlockChain.java index c76eeeeef..ef78009eb 100644 --- a/src/main/java/com/hbm/blocks/generic/BlockChain.java +++ b/src/main/java/com/hbm/blocks/generic/BlockChain.java @@ -7,6 +7,7 @@ import static net.minecraftforge.common.util.ForgeDirection.WEST; import com.hbm.lib.RefStrings; +import com.hbm.world.gen.nbt.INBTBlockTransformable; import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -20,23 +21,23 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -public class BlockChain extends Block { +public class BlockChain extends Block implements INBTBlockTransformable { @SideOnly(Side.CLIENT) private IIcon iconEnd; - + public BlockChain(Material mat) { super(mat); } - + public boolean isOpaqueCube() { return false; } - + public boolean renderAsNormalBlock() { return false; } - + public static int renderID = RenderingRegistry.getNextAvailableRenderId(); public int getRenderType() { @@ -47,7 +48,7 @@ public class BlockChain extends Block { public boolean isLadder(IBlockAccess world, int x, int y, int z, EntityLivingBase entity) { return true; } - + @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconRegister) { @@ -60,14 +61,14 @@ public class BlockChain extends Block { if(world.isSideSolid(x, y - 1, z, ForgeDirection.UP, false) || (world.getBlock(x, y - 1, z) == this && world.getBlockMetadata(x, y, z) == world.getBlockMetadata(x, y - 1, z))) return this.blockIcon; - + return this.iconEnd; } - + public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) { return null; } - + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) { func_149797_b(world.getBlockMetadata(x, y, z)); @@ -76,11 +77,11 @@ public class BlockChain extends Block { } public void func_149797_b(int meta) { - + float f = 0.125F; - + if(meta == 0) { - + this.minX = 3 * f; this.minY = 0; this.minZ = 3 * f; @@ -109,24 +110,24 @@ public class BlockChain extends Block { this.setBlockBounds(0.0F, 0.0F, 3 * f, f, 1.0F, 5 * f); } } - + @SideOnly(Side.CLIENT) public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, int y, int z) { this.setBlockBoundsBasedOnState(world, x, y, z); return super.getSelectedBoundingBoxFromPool(world, x, y, z); } - + public boolean canPlaceBlockAt(World world, int x, int y, int z) { - + if(world.isSideSolid(x, y + 1, z, ForgeDirection.DOWN) || world.getBlock(x, y + 1, z) == this) return true; - + return world.isSideSolid(x - 1, y, z, EAST ) || world.isSideSolid(x + 1, y, z, WEST ) || world.isSideSolid(x, y, z - 1, SOUTH) || world.isSideSolid(x, y, z + 1, NORTH); } - + public int onBlockPlaced(World world, int x, int y, int z, int side, float p_149660_6_, float p_149660_7_, float p_149660_8_, int meta) { int j1 = meta; @@ -142,12 +143,12 @@ public class BlockChain extends Block { if(side == 5 && world.isSideSolid(x - 1, y, z, EAST)) j1 = 5; - + if(j1 == 0) { - + if(world.getBlock(x, y + 1, z) == this) return world.getBlockMetadata(x, y + 1, z); - + if(world.isSideSolid(x, y + 1, z, ForgeDirection.DOWN)) return 0; } @@ -155,30 +156,30 @@ public class BlockChain extends Block { if(j1 == 0) { if(world.isSideSolid(x, y, z + 1, NORTH)) j1 = 2; - + if(world.isSideSolid(x, y, z - 1, SOUTH)) j1 = 3; - + if(world.isSideSolid(x + 1, y, z, WEST)) j1 = 4; - + if(world.isSideSolid(x - 1, y, z, EAST)) j1 = 5; } return j1; } - + public void onNeighborBlockChange(World world, int x, int y, int z, Block block) { - + int l = world.getBlockMetadata(x, y, z); boolean flag = false; - + if(world.getBlock(x, y + 1, z) == this && world.getBlockMetadata(x, y, z) == world.getBlockMetadata(x, y + 1, z)) { super.onNeighborBlockChange(world, x, y, z, block); return; } - + if(world.isSideSolid(x, y + 1, z, ForgeDirection.DOWN) && world.getBlockMetadata(x, y, z) == 0) { super.onNeighborBlockChange(world, x, y, z, block); return; @@ -201,4 +202,12 @@ public class BlockChain extends Block { super.onNeighborBlockChange(world, x, y, z, block); } + + @Override + public int transformMeta(int meta, int coordBaseMode) { + if (coordBaseMode == 0) return meta; + if (meta == 0) return meta; + if (meta == 1) return meta; + return INBTBlockTransformable.transformMetaDeco(meta, coordBaseMode); + } } diff --git a/src/main/java/com/hbm/blocks/network/BlockCableGauge.java b/src/main/java/com/hbm/blocks/network/BlockCableGauge.java index 2e7048be3..12d0133ac 100644 --- a/src/main/java/com/hbm/blocks/network/BlockCableGauge.java +++ b/src/main/java/com/hbm/blocks/network/BlockCableGauge.java @@ -13,6 +13,7 @@ import com.hbm.tileentity.network.TileEntityCableBaseNT; import com.hbm.util.BobMathUtil; import com.hbm.util.i18n.I18nUtil; +import com.hbm.world.gen.nbt.INBTBlockTransformable; import cpw.mods.fml.common.Optional; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -37,7 +38,7 @@ import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre; import java.util.ArrayList; import java.util.List; -public class BlockCableGauge extends BlockContainer implements IBlockMultiPass, ILookOverlay, ITooltipProvider { +public class BlockCableGauge extends BlockContainer implements IBlockMultiPass, INBTBlockTransformable, ILookOverlay, ITooltipProvider { @SideOnly(Side.CLIENT) protected IIcon overlayGauge; @@ -84,6 +85,11 @@ public class BlockCableGauge extends BlockContainer implements IBlockMultiPass, this.addStandardInfo(stack, player, list, ext); } + @Override + public int transformMeta(int meta, int coordBaseMode) { + return INBTBlockTransformable.transformMetaDeco(meta, coordBaseMode); + } + @Override public void printHook(Pre event, World world, int x, int y, int z) { @@ -178,5 +184,6 @@ public class BlockCableGauge extends BlockContainer implements IBlockMultiPass, if((PREFIX_VALUE + "deltasecond").equals(name)) return "" + deltaLastSecond; return null; } + } } diff --git a/src/main/java/com/hbm/blocks/network/FluidDuctGauge.java b/src/main/java/com/hbm/blocks/network/FluidDuctGauge.java index 5e9e0b483..8c427a370 100644 --- a/src/main/java/com/hbm/blocks/network/FluidDuctGauge.java +++ b/src/main/java/com/hbm/blocks/network/FluidDuctGauge.java @@ -13,6 +13,7 @@ import com.hbm.render.block.RenderBlockMultipass; import com.hbm.tileentity.network.TileEntityPipeBaseNT; import com.hbm.util.i18n.I18nUtil; +import com.hbm.world.gen.nbt.INBTBlockTransformable; import cpw.mods.fml.common.Optional; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -37,7 +38,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Locale; -public class FluidDuctGauge extends FluidDuctBase implements IBlockMultiPass, ILookOverlay, ITooltipProvider { +public class FluidDuctGauge extends FluidDuctBase implements IBlockMultiPass, INBTBlockTransformable, ILookOverlay, ITooltipProvider { @SideOnly(Side.CLIENT) protected IIcon overlay; @SideOnly(Side.CLIENT) protected IIcon overlayGauge; @@ -108,6 +109,11 @@ public class FluidDuctGauge extends FluidDuctBase implements IBlockMultiPass, IL return IBlockMultiPass.getRenderType(); } + @Override + public int transformMeta(int meta, int coordBaseMode) { + return INBTBlockTransformable.transformMetaDeco(meta, coordBaseMode); + } + @Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")}) public static class TileEntityPipeGauge extends TileEntityPipeBaseNT implements SimpleComponent, CompatHandler.OCComponent, IRORValueProvider { diff --git a/src/main/java/com/hbm/main/StructureManager.java b/src/main/java/com/hbm/main/StructureManager.java index 3e16f4011..a5f70b5cb 100644 --- a/src/main/java/com/hbm/main/StructureManager.java +++ b/src/main/java/com/hbm/main/StructureManager.java @@ -83,6 +83,8 @@ public class StructureManager { public static final NBTStructure plane1 = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/crashed_plane_1.nbt")); public static final NBTStructure plane2 = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/crashed_plane_2.nbt")); + public static final NBTStructure factory = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/factory.nbt")); + public static final NBTStructure spire = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/spire.nbt")); // public static final NBTStructure test_rot = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/test-rot.nbt")); diff --git a/src/main/java/com/hbm/util/MobUtil.java b/src/main/java/com/hbm/util/MobUtil.java index 8779c1ed2..c9d103684 100644 --- a/src/main/java/com/hbm/util/MobUtil.java +++ b/src/main/java/com/hbm/util/MobUtil.java @@ -23,6 +23,14 @@ public class MobUtil { /**Unlike the above two, the Double is interpreted as minimum soot level, instead of armor slot **/ public static HashMap> slotPoolGuns = new HashMap<>(); + //slop pools + public static Map> slotPoolGunsTier1 = new HashMap<>(); + public static Map> slotPoolGunsTier2 = new HashMap<>(); + public static Map> slotPoolGunsTier3 = new HashMap<>(); + public static Map> slotPoolMasks = new HashMap<>(); + public static Map> slotPoolHelms = new HashMap<>(); + public static Map> slotPoolTierArmor = new HashMap<>(); + public static Map> slotPoolMelee = new HashMap<>(); public static void intializeMobPools(){ slotPoolCommon.put(4, createSlotPool(8000, new Object[][]{ //new slots, smooth, brushed, no wrinkles // old slots, wrinkled, rusty, not smooth @@ -111,6 +119,72 @@ public class MobUtil { {ModItems.wrench, 20} })); + //For action block + slotPoolGunsTier1.put(0, createSlotPool(0, new Object[][]{ + {ModItems.gun_light_revolver, 16}, {ModItems.gun_greasegun, 8}, {ModItems.gun_maresleg, 2} + })); + + slotPoolGunsTier2.put(0, createSlotPool(0, new Object[][]{ + {ModItems.gun_uzi, 10}, {ModItems.gun_maresleg, 8}, {ModItems.gun_henry, 12}, {ModItems.gun_heavy_revolver, 4}, {ModItems.gun_flaregun, 4}, {ModItems.gun_carbine, 4} + })); + + slotPoolGunsTier3.put(0, createSlotPool(0, new Object[][]{ + {ModItems.gun_uzi, 25}, {ModItems.gun_spas12, 20}, {ModItems.gun_carbine, 20}, {ModItems.gun_g3, 10}, {ModItems.gun_am180, 5}, {ModItems.gun_stg77, 5} + })); + + slotPoolMasks.put(4, createSlotPool(0, new Object[][]{ + {ModItems.gas_mask_m65, 16}, {ModItems.gas_mask_mono, 8}, {ModItems.robes_helmet, 32}, {ModItems.no9, 16}, + {ModItems.rag_piss, 4}, {ModItems.goggles, 12} + })); + + slotPoolHelms.put(4, createSlotPool(0, new Object[][]{ + {ModItems.gas_mask_m65, 16}, {ModItems.gas_mask_olde, 12}, {ModItems.mask_of_infamy, 8}, + {ModItems.gas_mask_mono, 8}, {ModItems.robes_helmet, 32}, {ModItems.no9, 16}, + {ModItems.cobalt_helmet, 2}, {ModItems.hat, 1}, {ModItems.alloy_helmet, 2}, + {ModItems.titanium_helmet, 4}, {ModItems.steel_helmet, 8} + })); + + slotPoolTierArmor.put(4, createSlotPool(new Object[][]{ + {ModItems.gas_mask_m65, 20}, + {ModItems.gas_mask_olde, 15}, + {ModItems.steel_helmet, 25}, + {ModItems.titanium_helmet, 15}, + {ModItems.alloy_helmet, 10}, + })); + + slotPoolTierArmor.put(3, createSlotPool(new Object[][]{ + {ModItems.steel_plate, 30}, + {ModItems.titanium_plate, 20}, + {ModItems.alloy_plate, 15}, + {ModItems.cobalt_plate, 5}, + {ModItems.starmetal_plate, 5} + })); + + slotPoolTierArmor.put(2, createSlotPool(new Object[][]{ + {ModItems.steel_legs, 30}, + {ModItems.titanium_legs, 20}, + {ModItems.alloy_legs, 15}, + {ModItems.cobalt_legs, 5}, + {ModItems.zirconium_legs, 5} + })); + + slotPoolTierArmor.put(1, createSlotPool(new Object[][]{ + {ModItems.steel_boots, 30}, + {ModItems.robes_boots, 25}, + {ModItems.titanium_boots, 20}, + {ModItems.alloy_boots, 15}, + {ModItems.hazmat_boots, 10}, + {ModItems.cobalt_boots, 5}, + })); + + slotPoolMelee.put(0, createSlotPool(2000, new Object[][]{ + {ModItems.pipe_lead, 40}, {ModItems.crowbar, 35}, {ModItems.wrench, 30}, + {ModItems.steel_sword, 25}, {ModItems.titanium_sword, 20}, + {ModItems.reer_graar, 20}, {ModItems.stopsign, 15}, + {ModItems.lead_gavel, 12}, {ModItems.wrench_flipped, 10}, + {ModItems.sopsign, 8}, {ModItems.chernobylsign, 8} + })); + slotPoolAdvRanged = new HashMap<>(slotPoolAdv); slotPoolAdvRanged.remove(0); diff --git a/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java b/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java index 742cc3e4c..4e61206ff 100644 --- a/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java +++ b/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java @@ -128,7 +128,7 @@ public class NTMWorldGenerator implements IWorldGenerator { structure = new JigsawPiece("crashed_plane_2", StructureManager.plane2, -8); spawnWeight = 50; }}); - + NBTStructure.registerStructure(0, new SpawnCondition("desert_shack_1") {{ canSpawn = biome -> biome == BiomeGenBase.desert; structure = new JigsawPiece("desert_shack_1", StructureManager.desert_shack_1, -7); @@ -188,22 +188,22 @@ public class NTMWorldGenerator implements IWorldGenerator { NBTStructure.registerStructure(0, new SpawnCondition("ruin6") {{ canSpawn = biome -> !invalidBiomes.contains(biome) && biome.canSpawnLightningBolt(); structure = new JigsawPiece("NTMRuinsF", StructureManager.ntmruinsF, -1) {{conformToTerrain = true;}}; - spawnWeight = 50; + spawnWeight = 35; }}); NBTStructure.registerStructure(0, new SpawnCondition("ruin7") {{ canSpawn = biome -> !invalidBiomes.contains(biome) && biome.canSpawnLightningBolt(); structure = new JigsawPiece("NTMRuinsG", StructureManager.ntmruinsG, -1) {{conformToTerrain = true;}}; - spawnWeight = 50; + spawnWeight = 35; }}); NBTStructure.registerStructure(0, new SpawnCondition("ruin8") {{ canSpawn = biome -> !invalidBiomes.contains(biome) && biome.canSpawnLightningBolt(); structure = new JigsawPiece("NTMRuinsH", StructureManager.ntmruinsH, -1) {{conformToTerrain = true;}}; - spawnWeight = 50; + spawnWeight = 35; }}); NBTStructure.registerStructure(0, new SpawnCondition("ruin9") {{ canSpawn = biome -> !invalidBiomes.contains(biome) && biome.canSpawnLightningBolt(); structure = new JigsawPiece("NTMRuinsI", StructureManager.ntmruinsI, -1) {{conformToTerrain = true;}}; - spawnWeight = 50; + spawnWeight = 35; }}); NBTStructure.registerStructure(0, new SpawnCondition("ruin10") {{ canSpawn = biome -> !invalidBiomes.contains(biome) && biome.canSpawnLightningBolt(); @@ -215,6 +215,11 @@ public class NTMWorldGenerator implements IWorldGenerator { structure = new JigsawPiece("radio_house", StructureManager.radio_house, -6); spawnWeight = 30; }}); + NBTStructure.registerStructure(0, new SpawnCondition("factory") {{ + canSpawn = flatbiomes::contains; + structure = new JigsawPiece("factory", StructureManager.factory, -6); + spawnWeight = 30; + }}); NBTStructure.registerNullWeight(0, 2, biome -> biome == BiomeGenBase.plains); NBTStructure.registerNullWeight(0, 4, oceanBiomes::contains); diff --git a/src/main/java/com/hbm/world/gen/util/LogicBlockActions.java b/src/main/java/com/hbm/world/gen/util/LogicBlockActions.java index af2c41356..7e5b8df3e 100644 --- a/src/main/java/com/hbm/world/gen/util/LogicBlockActions.java +++ b/src/main/java/com/hbm/world/gen/util/LogicBlockActions.java @@ -18,6 +18,7 @@ import com.hbm.world.WorldUtil; import net.minecraft.block.Block; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.entity.monster.EntitySkeleton; import net.minecraft.entity.monster.EntityZombie; import net.minecraft.init.Blocks; import net.minecraft.inventory.IInventory; @@ -111,8 +112,8 @@ public class LogicBlockActions { } } } - world.setBlock(x, y, z, ModBlocks.block_steel); - + world.setBlock(x, y, z, Blocks.air); +// world.setBlock(x, y, z, ModBlocks.block_steel); this is useless }; public static Consumer FODDER_WAVE = (tile) -> { @@ -134,6 +135,89 @@ public class LogicBlockActions { } }; + public static Consumer SKELETON_GUN_TIER_1 = (tile) -> { + World world = tile.getWorldObj(); + int x = tile.xCoord; + int y = tile.yCoord; + int z = tile.zCoord; + if (tile.phase == 1) { + Vec3NT vec = new Vec3NT(0, 0, 0); + EntitySkeleton mob = new EntitySkeleton(world); + mob.setPositionAndRotation(x, y, z, 0, 0); + MobUtil.assignItemsToEntity(mob, MobUtil.slotPoolGunsTier1, new Random()); + MobUtil.assignItemsToEntity(mob, MobUtil.slotPoolMasks, new Random()); + MobUtil.assignItemsToEntity(mob, MobUtil.slotPoolRanged, new Random()); + world.spawnEntityInWorld(mob); + world.setBlock(x, y, z, Blocks.air); + } + }; + + public static Consumer SKELETON_GUN_TIER_2 = (tile) -> { + World world = tile.getWorldObj(); + int x = tile.xCoord; + int y = tile.yCoord; + int z = tile.zCoord; + if (tile.phase == 1) { + Vec3NT vec = new Vec3NT(0, 0, 0); + EntitySkeleton mob = new EntitySkeleton(world); + mob.setPositionAndRotation(x, y, z, 0, 0); + MobUtil.assignItemsToEntity(mob, MobUtil.slotPoolGunsTier2, new Random()); + MobUtil.assignItemsToEntity(mob, MobUtil.slotPoolMasks, new Random()); + MobUtil.assignItemsToEntity(mob, MobUtil.slotPoolTierArmor, new Random()); + world.spawnEntityInWorld(mob); + world.setBlock(x, y, z, Blocks.air); + } + }; + + public static Consumer SKELETON_GUN_TIER_3 = (tile) -> { + World world = tile.getWorldObj(); + int x = tile.xCoord; + int y = tile.yCoord; + int z = tile.zCoord; + if (tile.phase == 1) { + Vec3NT vec = new Vec3NT(0, 0, 0); + EntitySkeleton mob = new EntitySkeleton(world); + mob.setPositionAndRotation(x, y, z, 0, 0); + MobUtil.assignItemsToEntity(mob, MobUtil.slotPoolGunsTier3, new Random()); + MobUtil.assignItemsToEntity(mob, MobUtil.slotPoolMasks, new Random()); + MobUtil.assignItemsToEntity(mob, MobUtil.slotPoolAdvRanged, new Random()); + world.spawnEntityInWorld(mob); + world.setBlock(x, y, z, Blocks.air); + } + }; + + public static Consumer ZOMBIE_TIER_1 = (tile) -> { + World world = tile.getWorldObj(); + int x = tile.xCoord; + int y = tile.yCoord; + int z = tile.zCoord; + if (tile.phase == 1) { + Vec3NT vec = new Vec3NT(0, 0, 0); + EntityZombie mob = new EntityZombie(world); + mob.setPositionAndRotation(x, y, z, 0, 0); + MobUtil.assignItemsToEntity(mob, MobUtil.slotPoolMelee, new Random()); + MobUtil.assignItemsToEntity(mob, MobUtil.slotPoolTierArmor, new Random()); + world.spawnEntityInWorld(mob); + world.setBlock(x, y, z, Blocks.air); + } + }; + + public static Consumer ZOMBIE_TIER_2 = (tile) -> { + World world = tile.getWorldObj(); + int x = tile.xCoord; + int y = tile.yCoord; + int z = tile.zCoord; + if (tile.phase == 1) { + Vec3NT vec = new Vec3NT(0, 0, 0); + EntityZombie mob = new EntityZombie(world); + mob.setPositionAndRotation(x, y, z, 0, 0); + MobUtil.assignItemsToEntity(mob, MobUtil.slotPoolTierArmor, new Random()); + MobUtil.assignItemsToEntity(mob, MobUtil.slotPoolMelee, new Random()); + world.spawnEntityInWorld(mob); + world.setBlock(x, y, z, Blocks.air); + } + }; + public static Consumer PUZZLE_TEST = (tile) -> { World world = tile.getWorldObj(); int x = tile.xCoord; @@ -261,8 +345,14 @@ public class LogicBlockActions { actions.put("PUZZLE_TEST", PUZZLE_TEST); actions.put("MISSILE_STRIKE", MISSILE_STRIKE); actions.put("IRRADIATE_ENTITIES_AOE", RAD_CONTAINMENT_SYSTEM); + + //Mob Block Actions + actions.put("SKELETON_GUN_TIER_1", SKELETON_GUN_TIER_1); + actions.put("SKELETON_GUN_TIER_2", SKELETON_GUN_TIER_2); + actions.put("SKELETON_GUN_TIER_3", SKELETON_GUN_TIER_3); + + actions.put("ZOMBIE_TIER_1", ZOMBIE_TIER_1); + actions.put("ZOMBIE_TIER_2", ZOMBIE_TIER_2); } - - } diff --git a/src/main/java/com/hbm/world/gen/util/LogicBlockConditions.java b/src/main/java/com/hbm/world/gen/util/LogicBlockConditions.java index b51b96c23..f3eec59bb 100644 --- a/src/main/java/com/hbm/world/gen/util/LogicBlockConditions.java +++ b/src/main/java/com/hbm/world/gen/util/LogicBlockConditions.java @@ -51,6 +51,14 @@ public class LogicBlockConditions { return !world.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y - 2, z + 1).expand(5, 5, 5)).isEmpty(); }; + public static Function PLAYER_CUBE_25 = (tile) -> { + World world = tile.getWorldObj(); + int x = tile.xCoord; + int y = tile.yCoord; + int z = tile.zCoord; + return !world.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y - 2, z + 1).expand(25, 25, 25)).isEmpty(); + }; + public static Function REDSTONE = (tile) -> { World world = tile.getWorldObj(); int x = tile.xCoord; @@ -90,6 +98,7 @@ public class LogicBlockConditions { conditions.put("EMPTY", EMPTY); conditions.put("ABERRATOR", ABERRATOR); conditions.put("PLAYER_CUBE_5", PLAYER_CUBE_5); + conditions.put("PLAYER_CUBE_25", PLAYER_CUBE_25); conditions.put("REDSTONE", REDSTONE); conditions.put("PUZZLE_TEST", PUZZLE_TEST); } diff --git a/src/main/resources/assets/hbm/structures/factory.nbt b/src/main/resources/assets/hbm/structures/factory.nbt new file mode 100644 index 000000000..792df3c1e Binary files /dev/null and b/src/main/resources/assets/hbm/structures/factory.nbt differ