Skip to content

Commit 8de7e35

Browse files
authored
Add null check to level ref in Entity constructor (#12218)
1 parent 1d5e5a5 commit 8de7e35

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

paper-server/patches/sources/net/minecraft/world/entity/Entity.java.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@
192192
this.entityData = builder.build();
193193
this.setPos(0.0, 0.0, 0.0);
194194
this.eyeHeight = this.dimensions.eyeHeight();
195-
+ 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
195+
+ 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
196196
}
197197

198198
public boolean isColliding(BlockPos pos, BlockState state) {

0 commit comments

Comments
 (0)