offset item frame ticking

This commit is contained in:
kickash32 2019-07-30 03:17:16 +05:00
parent a89e4e6ae3
commit 0198ee9c8a

View File

@ -10,7 +10,7 @@
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
@@ -15,8 +12,19 @@
@@ -15,13 +12,24 @@
import net.minecraft.world.level.Explosion;
import net.minecraft.world.level.GameRules;
import net.minecraft.world.level.Level;
@ -30,6 +30,12 @@
public abstract class BlockAttachedEntity extends Entity {
private static final Logger LOGGER = LogUtils.getLogger();
- private int checkInterval;
+ private int checkInterval; { this.checkInterval = this.getId() % this.level().spigotConfig.hangingTickFrequency; } // Paper - Perf: offset item frame ticking
protected BlockPos pos;
protected BlockAttachedEntity(EntityType<? extends BlockAttachedEntity> type, Level world) {
@@ -41,10 +49,28 @@
if (world instanceof ServerLevel worldserver) {