PaperMC/Spigot-Server-Patches/0527-Add-entity-liquid-API.patch
Daniel Ennis c97ce029e9
1.16.2 Release (#4123)
PaperMC believes that 1.16.2 is now ready for general release as we fixed the main issue plagueing the 1.16.x release, the MapLike data conversion issues.

Until now, it was not safe for a server to convert a world to 1.16.2 without data conversion issues around villages and potentially other things. If you did, those MapLike errors meant something went wrong.

This is now resolved.

Big thanks to all those that helped, notably @BillyGalbreath and @Proximyst who did large parts of the update process with me.

Please as always, backup your worlds and test before updating to 1.16.2!

If you update to 1.16.2, there is no going back to an older build than this.

---------------------------------

Co-authored-by: William Blake Galbreath <Blake.Galbreath@GMail.com>
Co-authored-by: Mariell Hoversholm <proximyst@proximyst.com>
Co-authored-by: krolik-exe <69214078+krolik-exe@users.noreply.github.com>
Co-authored-by: BillyGalbreath <BillyGalbreath@users.noreply.github.com>
Co-authored-by: stonar96 <minecraft.stonar96@gmail.com>
Co-authored-by: Shane Freeder <theboyetronic@gmail.com>
Co-authored-by: Jason <jasonpenilla2@me.com>
Co-authored-by: kashike <kashike@vq.lc>
Co-authored-by: Aurora <21148213+aurorasmiles@users.noreply.github.com>
Co-authored-by: KennyTV <kennytv@t-online.de>
Co-authored-by: commandblockguy <commandblockguy1@gmail.com>
Co-authored-by: DigitalRegent <misterwener@gmail.com>
Co-authored-by: ishland <ishlandmc@yeah.net>
2020-08-24 22:40:19 -04:00

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 ad521f95aba0e82e3280351419ad23acfa283f9a..97e61dae7927d7da18fcb23d9e4bf639234af4a5 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -1076,12 +1076,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(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);
}
@@ -1095,6 +1096,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
return this.isInWater() || this.isInRain() || this.k();
}
+ public final boolean isInWaterOrBubbleColumn() { return aG(); } // Paper - OBFHELPER
public boolean aG() {
return this.isInWater() || this.k();
}
@@ -1237,6 +1239,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
return this.O == tag;
}
+ public final boolean isInLava() { return aP(); } // Paper - OBFHELPER
public boolean aP() {
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 26376c995102753fcd298b1eea6e195bae238d65..b1fdc5737d332c6210d57793468da1eda8f8b9d2 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -1093,5 +1093,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
}