1
0
Fork 0
mirror of https://github.com/PaperMC/Paper.git synced 2025-03-23 23:39:34 +01:00

Add null check to level ref in Entity constructor ()

This commit is contained in:
Dylan 2025-03-03 08:46:20 -08:00 committed by GitHub
parent 1d5e5a57e9
commit 8de7e356fa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -192,7 +192,7 @@
this.entityData = builder.build();
this.setPos(0.0, 0.0, 0.0);
this.eyeHeight = this.dimensions.eyeHeight();
+ this.despawnTime = type == EntityType.PLAYER ? -1 : level.paperConfig().entities.spawning.despawnTime.getOrDefault(type, io.papermc.paper.configuration.type.number.IntOr.Disabled.DISABLED).or(-1); // Paper - entity despawn time limit
+ this.despawnTime = level == null || type == EntityType.PLAYER ? -1 : level.paperConfig().entities.spawning.despawnTime.getOrDefault(type, io.papermc.paper.configuration.type.number.IntOr.Disabled.DISABLED).or(-1); // Paper - entity despawn time limit
}
public boolean isColliding(BlockPos pos, BlockState state) {