aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0550-Additional-Block-Material-API-s.patch
diff options
context:
space:
mode:
authorOwen <[email protected]>2022-03-11 15:13:46 -0500
committerGitHub <[email protected]>2022-03-11 21:13:46 +0100
commitea1efef1164aa7653119eb4be000749930e5b4da (patch)
tree104968ec407cf897e14388b14d2bf397844c8279 /patches/server/0550-Additional-Block-Material-API-s.patch
parent1790528a6104c7c801e02a6f6d2ec0dda70e2af9 (diff)
downloadPaper-ea1efef1164aa7653119eb4be000749930e5b4da.tar.gz
Paper-ea1efef1164aa7653119eb4be000749930e5b4da.zip
Remove Patches (#7541)
Diffstat (limited to 'patches/server/0550-Additional-Block-Material-API-s.patch')
-rw-r--r--patches/server/0550-Additional-Block-Material-API-s.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/patches/server/0550-Additional-Block-Material-API-s.patch b/patches/server/0550-Additional-Block-Material-API-s.patch
new file mode 100644
index 0000000000..8d23c9d902
--- /dev/null
+++ b/patches/server/0550-Additional-Block-Material-API-s.patch
@@ -0,0 +1,40 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Aikar <[email protected]>
+Date: Wed, 30 Dec 2020 19:43:01 -0500
+Subject: [PATCH] Additional Block Material API's
+
+Faster version for isSolid() that utilizes NMS's state for isSolid instead of the slower
+process to do this in the Bukkit API
+
+Adds API for buildable, replaceable, burnable too.
+
+diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
+index 437daff6408357a4a19420422100914b3308b465..0be0ddcb8ea184683c1d0c619a932f3b03064941 100644
+--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
++++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
+@@ -456,6 +456,25 @@ public class CraftBlock implements Block {
+ return this.getNMS().getMaterial().isLiquid();
+ }
+
++ // Paper start
++ @Override
++ public boolean isBuildable() {
++ return getNMS().getMaterial().isSolid(); // This is in fact isSolid, despite the fact that isSolid below returns blocksMotion
++ }
++ @Override
++ public boolean isBurnable() {
++ return getNMS().getMaterial().isFlammable();
++ }
++ @Override
++ public boolean isReplaceable() {
++ return getNMS().getMaterial().isReplaceable();
++ }
++ @Override
++ public boolean isSolid() {
++ return getNMS().getMaterial().blocksMotion();
++ }
++ // Paper end
++
+ @Override
+ public PistonMoveReaction getPistonMoveReaction() {
+ return PistonMoveReaction.getById(this.getNMS().getPistonPushReaction().ordinal());