aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0533-Add-entity-liquid-API.patch
blob: a13b0a6a3997ba3d31d89a3c1fefa227a1186c31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
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 fcb3d3adae52fd70e856344a727a344cf78cfce3..9c4b02d776f8b99c6703c8dfc5d9fac0702bbe80 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -1117,12 +1117,13 @@ 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(blockposition.a(0.0D, (double) this.size.height, 0.0D));
     }
 
+    public boolean isInBubbleColumn() { return k(); } // Paper - OBFHELPER
     private boolean k() {
         return this.world.getType(this.getChunkCoordinates()).a(Blocks.BUBBLE_COLUMN);
     }
@@ -1136,6 +1137,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
         return this.isInWater() || this.isInRain() || this.k();
     }
 
+    public boolean isInWaterOrBubbleColumn() { return aD(); } // Paper - OBFHELPER
     public boolean aD() {
         return this.isInWater() || this.k();
     }
@@ -1286,6 +1288,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
         this.inLava = true;
     }
 
+    public boolean isInLava() { return aN(); } // Paper - OBFHELPER
     public boolean aN() {
         return this.inLava;
     }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index a525a9e29f46c889a10d8c9fb70d8389fc204226..d1df4e5799de4bf0a1fcc6940e2498374cd3db9d 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -1087,5 +1087,33 @@ 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
 }