diff --git a/src/main/java/makeo/gadomancy/common/CommonProxy.java b/src/main/java/makeo/gadomancy/common/CommonProxy.java index 5d3d8b1..b49b668 100644 --- a/src/main/java/makeo/gadomancy/common/CommonProxy.java +++ b/src/main/java/makeo/gadomancy/common/CommonProxy.java @@ -69,8 +69,6 @@ public class CommonProxy implements IGuiHandler { FMLCommonHandler.instance().bus().register(worldEventHandler); MinecraftForge.EVENT_BUS.register(new EventHandlerEntity()); - AuraEffects.AER.getTickInterval(); //initalize AuraEffects - RegisteredEnchantments.init(); RegisteredRecipes.init(); @@ -85,6 +83,7 @@ public class CommonProxy implements IGuiHandler { public void postInitalize() { RegisteredPotions.init(); + AuraEffects.AER.getTickInterval(); //initalize AuraEffects RegisteredResearches.init(); RegisteredIntegrations.init(); diff --git a/src/main/java/makeo/gadomancy/common/aura/AuraEffects.java b/src/main/java/makeo/gadomancy/common/aura/AuraEffects.java index 13c0a9e..f5a763e 100644 --- a/src/main/java/makeo/gadomancy/common/aura/AuraEffects.java +++ b/src/main/java/makeo/gadomancy/common/aura/AuraEffects.java @@ -464,6 +464,7 @@ public class AuraEffects { mob.setCurrentItemOrArmor(i, null); } + int timeout = 40; int totalCount = (world.rand.nextInt(3) == 0 ? 1 : 0) + 2; do { int slot = mob.getEquipmentInSlot(0) == null ? 0 : (mob.getEquipmentInSlot(4) == null ? 4 : (world.rand.nextInt(3)+1)); @@ -476,13 +477,17 @@ public class AuraEffects { mob.setEquipmentDropChance(slot, 0); } } - } while (totalCount > 0); - mob.addPotionEffect(new PotionEffect(Potion.invisibility.getId(), MiscUtils.ticksForMinutes(60*24*365), 1, true)); + timeout--; + } while (totalCount > 0 && timeout > 0); - ChunkCoordinates pos = new ChunkCoordinates((int) mob.posX, (int) mob.posY, (int) mob.posZ); - pos = iterateDown(pos, world); - mob.setPosition(pos.posX + 0.5, pos.posY, pos.posZ + 0.5); - world.spawnEntityInWorld(mob); + if(timeout > 0) { + mob.addPotionEffect(new PotionEffect(Potion.invisibility.getId(), MiscUtils.ticksForMinutes(60*24*365), 1, true)); + + ChunkCoordinates pos = new ChunkCoordinates((int) mob.posX, (int) mob.posY, (int) mob.posZ); + pos = iterateDown(pos, world); + mob.setPosition(pos.posX + 0.5, pos.posY, pos.posZ + 0.5); + world.spawnEntityInWorld(mob); + } } } }.register(Aspect.SOUL);