Skip to content

Commit

Permalink
Fixes progwml6/HungerOverhaul/#99
Browse files Browse the repository at this point in the history
Replaces getWorldTime with getTotalWorldTime which is not dependant on the world's provider.
  • Loading branch information
DarkholmeTenk committed Sep 21, 2015
1 parent b04162f commit 59bbdae
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -107,7 +107,7 @@ else if (growingAge < 0 && rndChild != 0)
}

// Reduced milked value every second
if (IguanaConfig.milkedTimeout > 0 && event.entityLiving instanceof EntityCow && event.entityLiving.worldObj.getWorldTime() % 20 == 0)
if (IguanaConfig.milkedTimeout > 0 && event.entityLiving instanceof EntityCow && event.entityLiving.worldObj.getTotalWorldTime() % 20 == 0)
{
NBTTagCompound tags = event.entityLiving.getEntityData();
if (tags.hasKey("Milked"))
Expand Down Expand Up @@ -333,7 +333,7 @@ public void onPlayerInteraction(PlayerInteractEvent event)
// if RIGHT_CLICK_BLOCK is canceled or useItem == Result.DENY, then
// the right click falls through to RIGHT_CLICK_AIR. To correctly cancel the RIGHT_CLICK_AIR,
// we need to make sure that it is happening on the same tick that the right click was performed
if (event.action == PlayerInteractEvent.Action.RIGHT_CLICK_AIR && lastRightClickCrop == event.world.getWorldTime())
if (event.action == PlayerInteractEvent.Action.RIGHT_CLICK_AIR && lastRightClickCrop == event.world.getTotalWorldTime())
{
event.setCanceled(true);
}
Expand Down Expand Up @@ -413,7 +413,7 @@ else if (clicked instanceof BlockCrops && meta >= 7)

event.world.setBlockMetadataWithNotify(event.x, event.y, event.z, resultingMeta, 2);

lastRightClickCrop = event.world.getWorldTime();
lastRightClickCrop = event.world.getTotalWorldTime();

// hacky workaround:
// if the client deems it is unable to place the block that is held,
Expand Down

0 comments on commit 59bbdae

Please sign in to comment.