diff --git a/client/src/main/resources/textures/blocks/mob_spawner.png b/client/src/main/resources/textures/blocks/mob_spawner.png index 7d55217..c248eec 100755 Binary files a/client/src/main/resources/textures/blocks/mob_spawner.png and b/client/src/main/resources/textures/blocks/mob_spawner.png differ diff --git a/common/src/main/java/common/block/tech/BlockMobSpawner.java b/common/src/main/java/common/block/tech/BlockMobSpawner.java index 789d1cc..12399c6 100755 --- a/common/src/main/java/common/block/tech/BlockMobSpawner.java +++ b/common/src/main/java/common/block/tech/BlockMobSpawner.java @@ -1,6 +1,5 @@ package common.block.tech; -import common.model.BlockLayer; import common.tileentity.TileEntity; import common.tileentity.TileEntityMobSpawner; import common.world.World; @@ -9,8 +8,4 @@ public class BlockMobSpawner extends BlockMachine { public TileEntity createNewTileEntity(World world) { return new TileEntityMobSpawner(); } - - public BlockLayer getBlockLayer() { - return BlockLayer.CUTOUT; - } } diff --git a/common/src/main/java/common/init/DispenserRegistry.java b/common/src/main/java/common/init/DispenserRegistry.java index ede321e..db74a2a 100755 --- a/common/src/main/java/common/init/DispenserRegistry.java +++ b/common/src/main/java/common/init/DispenserRegistry.java @@ -138,7 +138,7 @@ public abstract class DispenserRegistry { double d1 = (double)((float)source.getBlockPos().getY() + 0.2F); double d2 = source.getZ() + (double)enumfacing.getFrontOffsetZ(); Entity entity = ItemMonsterPlacer.spawnCreature(source.getWorld(), ((ItemMonsterPlacer)stack.getItem()).getSpawnedId(), - d0, d1, d2); + d0, d1, d2, false); if (entity instanceof EntityLiving && stack.hasDisplayName()) { diff --git a/common/src/main/java/common/item/ItemMonsterPlacer.java b/common/src/main/java/common/item/ItemMonsterPlacer.java index 1cb45c3..c7faf25 100755 --- a/common/src/main/java/common/item/ItemMonsterPlacer.java +++ b/common/src/main/java/common/item/ItemMonsterPlacer.java @@ -91,7 +91,7 @@ public class ItemMonsterPlacer extends Item // int amount = Math.min(stack.stackSize, 128); // for(int z = 0; z < amount; z++) { - Entity entity = spawnCreature(worldIn, this.entityId, (double)pos.getX() + 0.5D, (double)pos.getY() + d0, (double)pos.getZ() + 0.5D); + Entity entity = spawnCreature(worldIn, this.entityId, (double)pos.getX() + 0.5D, (double)pos.getY() + d0, (double)pos.getZ() + 0.5D, false); if (entity != null) { @@ -153,7 +153,7 @@ public class ItemMonsterPlacer extends Item { // int amount = Math.min(itemStackIn.stackSize, 128); // for(int z = 0; z < amount; z++) { - Entity entity = spawnCreature(worldIn, this.entityId, (double)blockpos.getX() + 0.5D, (double)blockpos.getY() + 0.5D, (double)blockpos.getZ() + 0.5D); + Entity entity = spawnCreature(worldIn, this.entityId, (double)blockpos.getX() + 0.5D, (double)blockpos.getY() + 0.5D, (double)blockpos.getZ() + 0.5D, false); if (entity != null) { @@ -184,14 +184,14 @@ public class ItemMonsterPlacer extends Item } } - public static EntityLiving spawnCreature(World worldIn, String entityID, double x, double y, double z) { + public static EntityLiving spawnCreature(World worldIn, String entityID, double x, double y, double z, boolean check) { if (!EntityRegistry.SPAWN_EGGS.containsKey(entityID)) return null; Entity entity = EntityRegistry.createEntityByName(entityID, worldIn); if(!(entity instanceof EntityLiving living)) return null; living.setLocationAndAngles(x, y, z, ExtMath.wrapf(worldIn.rand.floatv() * 360.0F), 0.0F); - if(!living.isNotColliding()) + if(check && !living.isNotColliding()) return null; living.headYaw = living.rotYaw; living.yawOffset = living.rotYaw; diff --git a/common/src/main/java/common/item/ItemNpcSpawner.java b/common/src/main/java/common/item/ItemNpcSpawner.java index 9318d1d..edc04b2 100755 --- a/common/src/main/java/common/item/ItemNpcSpawner.java +++ b/common/src/main/java/common/item/ItemNpcSpawner.java @@ -90,7 +90,7 @@ public class ItemNpcSpawner extends Item // int amount = Math.min(stack.stackSize, 128); // for(int z = 0; z < amount; z++) { - Entity entity = spawnNpc(worldIn, this.spawned, (double)pos.getX() + 0.5D, (double)pos.getY() + d0, (double)pos.getZ() + 0.5D); + Entity entity = spawnNpc(worldIn, this.spawned, (double)pos.getX() + 0.5D, (double)pos.getY() + d0, (double)pos.getZ() + 0.5D, false); if (entity != null) { @@ -144,7 +144,7 @@ public class ItemNpcSpawner extends Item { // int amount = Math.min(itemStackIn.stackSize, 128); // for(int z = 0; z < amount; z++) { - Entity entity = spawnNpc(worldIn, this.spawned, (double)blockpos.getX() + 0.5D, (double)blockpos.getY() + 0.5D, (double)blockpos.getZ() + 0.5D); + Entity entity = spawnNpc(worldIn, this.spawned, (double)blockpos.getX() + 0.5D, (double)blockpos.getY() + 0.5D, (double)blockpos.getZ() + 0.5D, false); if (entity != null) { @@ -170,7 +170,7 @@ public class ItemNpcSpawner extends Item } } - public static EntityNPC spawnNpc(World worldIn, CharacterInfo character, double x, double y, double z) + public static EntityNPC spawnNpc(World worldIn, CharacterInfo character, double x, double y, double z, boolean check) { EntityNPC entity; try { @@ -180,7 +180,7 @@ public class ItemNpcSpawner extends Item throw new RuntimeException(e); } entity.setLocationAndAngles(x, y, z, ExtMath.wrapf(worldIn.rand.floatv() * 360.0F), 0.0F); - if(!entity.isNotColliding()) + if(check && !entity.isNotColliding()) return null; entity.headYaw = entity.rotYaw; entity.yawOffset = entity.rotYaw; diff --git a/common/src/main/java/common/tileentity/TileEntityMobSpawner.java b/common/src/main/java/common/tileentity/TileEntityMobSpawner.java index 2092028..89ff3d4 100755 --- a/common/src/main/java/common/tileentity/TileEntityMobSpawner.java +++ b/common/src/main/java/common/tileentity/TileEntityMobSpawner.java @@ -56,9 +56,9 @@ public class TileEntityMobSpawner extends TileEntityDevice implements ITickable double z = (double)this.pos.getZ() + (this.worldObj.rand.doublev() - this.worldObj.rand.doublev()) * (double)this.spawnRange + 0.5D; EntityLiving entity = null; if(stack.getItem() instanceof ItemMonsterPlacer egg) - entity = ItemMonsterPlacer.spawnCreature(this.worldObj, egg.getSpawnedId(), x, y, z); + entity = ItemMonsterPlacer.spawnCreature(this.worldObj, egg.getSpawnedId(), x, y, z, true); else if(stack.getItem() instanceof ItemNpcSpawner egg) - entity = ItemNpcSpawner.spawnNpc(this.worldObj, egg.getSpawnedChar(), x, y, z); + entity = ItemNpcSpawner.spawnNpc(this.worldObj, egg.getSpawnedChar(), x, y, z, true); if (entity == null) return true; this.decrStackSize(0, 1);