mirror of
https://github.com/PaperMC/Paper.git
synced 2025-05-19 13:40:24 -07:00
Add null check to level ref in Entity constructor (#12218)
This commit is contained in:
parent
1d5e5a57e9
commit
8de7e356fa
@ -192,7 +192,7 @@
|
|||||||
this.entityData = builder.build();
|
this.entityData = builder.build();
|
||||||
this.setPos(0.0, 0.0, 0.0);
|
this.setPos(0.0, 0.0, 0.0);
|
||||||
this.eyeHeight = this.dimensions.eyeHeight();
|
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) {
|
public boolean isColliding(BlockPos pos, BlockState state) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user