mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
6f4fbe1c89
Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 30885166 Update to Minecraft 1.16.4 CraftBukkit Changes: 3af81c71 Update to Minecraft 1.16.4 Spigot Changes: f011ca24 Update to Minecraft 1.16.4 Co-authored-by: Mariell Hoversholm <proximyst@proximyst.com>
79 lines
3.1 KiB
Diff
79 lines
3.1 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
|
Date: Thu, 2 Jul 2020 18:11:43 -0500
|
|
Subject: [PATCH] Add entity liquid API
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/Entity.java
|
|
+++ b/src/main/java/net/minecraft/server/Entity.java
|
|
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
|
return this.inWater;
|
|
}
|
|
|
|
- private boolean isInRain() {
|
|
+ public boolean isInRain() { // Paper - private -> public
|
|
BlockPosition blockposition = this.getChunkCoordinates();
|
|
|
|
return this.world.isRainingAt(blockposition) || this.world.isRainingAt(new BlockPosition((double) blockposition.getX(), this.getBoundingBox().maxY, (double) blockposition.getZ()));
|
|
}
|
|
|
|
+ public final boolean isInBubbleColumn() { return k(); } // Paper - OBFHELPER
|
|
private boolean k() {
|
|
return this.world.getType(this.getChunkCoordinates()).a(Blocks.BUBBLE_COLUMN);
|
|
}
|
|
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
|
return this.isInWater() || this.isInRain() || this.k();
|
|
}
|
|
|
|
+ public final boolean isInWaterOrBubbleColumn() { return aH(); } // Paper - OBFHELPER
|
|
public boolean aH() {
|
|
return this.isInWater() || this.k();
|
|
}
|
|
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
|
return this.O == tag;
|
|
}
|
|
|
|
+ public final boolean isInLava() { return aQ(); } // Paper - OBFHELPER
|
|
public boolean aQ() {
|
|
return !this.justCreated && this.M.getDouble(TagsFluid.LAVA) > 0.0D;
|
|
}
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
|
@@ -0,0 +0,0 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
|
public org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason getEntitySpawnReason() {
|
|
return getHandle().spawnReason;
|
|
}
|
|
+
|
|
+ public boolean isInWater() {
|
|
+ return getHandle().isInWater();
|
|
+ }
|
|
+
|
|
+ public boolean isInRain() {
|
|
+ return getHandle().isInRain();
|
|
+ }
|
|
+
|
|
+ public boolean isInBubbleColumn() {
|
|
+ return getHandle().isInBubbleColumn();
|
|
+ }
|
|
+
|
|
+ public boolean isInWaterOrRain() {
|
|
+ return getHandle().isInWaterOrRain();
|
|
+ }
|
|
+
|
|
+ public boolean isInWaterOrBubbleColumn() {
|
|
+ return getHandle().isInWaterOrBubbleColumn();
|
|
+ }
|
|
+
|
|
+ public boolean isInWaterOrRainOrBubbleColumn() {
|
|
+ return getHandle().isInWaterOrRainOrBubble();
|
|
+ }
|
|
+
|
|
+ public boolean isInLava() {
|
|
+ return getHandle().isInLava();
|
|
+ }
|
|
// Paper end
|
|
}
|