3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-15 19:10:09 +01:00
Paper/patches/server-remapped/0521-Add-entity-liquid-API.patch
Mariell Hoversholm a207d14a0e
Rename all patches to correct numbering scheme
Signed-off-by: Mariell Hoversholm <proximyst@proximyst.com>
2021-06-11 15:46:44 +02:00

76 Zeilen
3.2 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/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index e9a658b11e2b6683831dc3f5bd20be9a7840ed69..aea2457510c75214bbb925307155611e981f115f 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1164,12 +1164,13 @@ public abstract class Entity implements Nameable, CommandSource, net.minecraft.s
return this.wasTouchingWater;
}
- private boolean isInRain() {
+ public boolean isInRain() { // Paper - private -> public
BlockPos blockposition = this.blockPosition();
return this.level.isRainingAt(blockposition) || this.level.isRainingAt(new BlockPos((double) blockposition.getX(), this.getBoundingBox().maxY, (double) blockposition.getZ()));
}
+ public final boolean isInBubbleColumn() { return isInBubbleColumn(); } // Paper - OBFHELPER
private boolean isInBubbleColumn() {
return this.level.getBlockState(this.blockPosition()).is(Blocks.BUBBLE_COLUMN);
}
@@ -1183,6 +1184,7 @@ public abstract class Entity implements Nameable, CommandSource, net.minecraft.s
return this.isInWater() || this.isInRain() || this.isInBubbleColumn();
}
+ public final boolean isInWaterOrBubbleColumn() { return isInWaterOrBubble(); } // Paper - OBFHELPER
public boolean isInWaterOrBubble() {
return this.isInWater() || this.isInBubbleColumn();
}
@@ -1325,6 +1327,7 @@ public abstract class Entity implements Nameable, CommandSource, net.minecraft.s
return this.fluidOnEyes == tag;
}
+ public final boolean isInLava() { return isInLava(); } // Paper - OBFHELPER
public boolean isInLava() {
return !this.firstTick && this.fluidHeight.getDouble(FluidTags.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 76d652386806fd11961611486a1d0a12fe9616a4..deeae62e9926f9435907c68e7d35e7420f5e79dd 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -1135,5 +1135,29 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
public org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason getEntitySpawnReason() {
return getHandle().spawnReason;
}
+
+ 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
}