mirror of
https://github.com/GTNewHorizons/ForbiddenMagic.git
synced 2026-11-19 11:49:12 +00:00
Fix Collar of Pain lagging upon using /kill (#15)
Co-authored-by: koolkrafter5 <[email protected]>
This commit is contained in:
1 parent
58d74cbcdc
commit
8b0863b572
1 file changed
+3
-2
@@ -512,7 +512,7 @@ public class FMEventHandler {
|
||||
EntityPlayer player = (EntityPlayer) event.entityLiving;
|
||||
ItemStack amulet = BaublesApi.getBaubles(player).getStackInSlot(0);
|
||||
if (amulet != null && amulet.getItem() == ForbiddenItems.subCollar) {
|
||||
int doses = 3 * (int) event.ammount;
|
||||
int doses = 3 * (int) Math.min(event.ammount, event.entityLiving.getHealth());
|
||||
if (event.source.getEntity() != null && event.source.getEntity() instanceof EntityPlayer) {
|
||||
EntityPlayer dom = (EntityPlayer) event.source.getEntity();
|
||||
int chance = 1;
|
||||
@@ -527,8 +527,9 @@ public class FMEventHandler {
|
||||
ent.motionZ += (player.worldObj.rand.nextFloat() - player.worldObj.rand.nextFloat()) * 0.1F;
|
||||
}
|
||||
}
|
||||
ItemSubCollar collar = ((ItemSubCollar) ForbiddenItems.subCollar);
|
||||
for (int x = 0; x < doses; x++) {
|
||||
((ItemSubCollar) ForbiddenItems.subCollar).addVis(amulet, primals[randy.nextInt(6)], 1, true);
|
||||
collar.addVis(amulet, primals[randy.nextInt(6)], 1, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user