For some reason getTotalWorldTime isn't incrementing client-side in some cases when the doDaylightCycle is off, so replace them with alternatives wherever possible

What's really weird is sometimes it works just fine, even in client-side stuff
This commit is contained in:
Electroblob77
2020-06-18 16:20:10 +01:00
parent bfd7f6e5a5
commit f7f9190227
4 changed files with 9 additions and 9 deletions
@@ -147,7 +147,7 @@ public class BlockThorns extends BlockBush implements ITileEntityProvider {
}
}
if(world.getTotalWorldTime() % 20 == 0) target.attackEntityFrom(source, Spells.forest_of_thorns.getProperty(Spell.DAMAGE).floatValue());
if(target.ticksExisted % 20 == 0) target.attackEntityFrom(source, Spells.forest_of_thorns.getProperty(Spell.DAMAGE).floatValue());
return true;
}
@@ -174,8 +174,7 @@ public class BlockThorns extends BlockBush implements ITileEntityProvider {
@SubscribeEvent
public static void onLeftClickBlockEvent(PlayerInteractEvent.LeftClickBlock event){
if(!event.getWorld().isRemote && event.getWorld().getTotalWorldTime() % 20 == 0
&& event.getWorld().getBlockState(event.getPos()).getBlock() == WizardryBlocks.thorns){
if(!event.getWorld().isRemote && event.getWorld().getBlockState(event.getPos()).getBlock() == WizardryBlocks.thorns){
applyThornDamage(event.getWorld(), event.getPos(), event.getEntity());
}
}