mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
better location for null check
This commit is contained in:
@@ -5,15 +5,24 @@ Subject: [PATCH] Drowning Settings
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 3c5347c0d4b65ced4b942504b1cdb8aab53016a5..5df1d6d15b3b19c6e08e2eeb8f045686a3a32fb3 100644
|
||||
index 3c5347c0d4b65ced4b942504b1cdb8aab53016a5..3a010a01c6cfd5307b1856bb9d70e81cabe45a65 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -525,7 +525,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||
// Spigot end
|
||||
this.entityData = new SynchedEntityData(this);
|
||||
this.entityData.define(Entity.DATA_SHARED_FLAGS_ID, (byte) 0);
|
||||
- this.entityData.define(Entity.DATA_AIR_SUPPLY_ID, this.getMaxAirSupply());
|
||||
+ this.entityData.define(Entity.DATA_AIR_SUPPLY_ID, this.level == null ? 300 : this.getMaxAirSupply()); // Purpur
|
||||
this.entityData.define(Entity.DATA_CUSTOM_NAME_VISIBLE, false);
|
||||
this.entityData.define(Entity.DATA_CUSTOM_NAME, Optional.empty());
|
||||
this.entityData.define(Entity.DATA_SILENT, false);
|
||||
@@ -2968,7 +2968,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||
}
|
||||
|
||||
public int getMaxAirSupply() {
|
||||
- return 300;
|
||||
+ return this.level == null ? 300 : this.level.purpurConfig.drowningAirTicks; // Purpur
|
||||
+ return this.level.purpurConfig.drowningAirTicks; // Purpur
|
||||
}
|
||||
|
||||
public int getAirSupply() {
|
||||
|
||||
Reference in New Issue
Block a user