Paper/Spigot-Server-Patches/0046-Add-ArmorStand-Marker-NBT-API.patch

53 Zeilen
1.9 KiB
Diff

2015-06-06 19:15:22 +02:00
From 9c14cfeecf183a246c29017b115a14bcdb05f2b5 Mon Sep 17 00:00:00 2001
2015-05-04 00:47:28 +02:00
From: Anonymoose <MrAnonHimself@anon.life>
Date: Sun, 3 May 2015 17:44:20 -0500
Subject: [PATCH] Add ArmorStand Marker NBT API
diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java
2015-06-06 19:15:22 +02:00
index a0ad85b..bbf313d 100644
2015-05-04 00:47:28 +02:00
--- a/src/main/java/net/minecraft/server/EntityArmorStand.java
+++ b/src/main/java/net/minecraft/server/EntityArmorStand.java
2015-06-06 19:15:22 +02:00
@@ -646,7 +646,7 @@ public class EntityArmorStand extends EntityLiving {
2015-05-04 00:47:28 +02:00
return (this.datawatcher.getByte(10) & 8) != 0;
}
- private void n(boolean flag) {
+ public void n(boolean flag) { // PaperSpigot - private -> public, setSmallBoundingBox (Marker) NBT
byte b0 = this.datawatcher.getByte(10);
if (flag) {
2015-06-06 19:15:22 +02:00
@@ -658,7 +658,7 @@ public class EntityArmorStand extends EntityLiving {
2015-05-04 00:47:28 +02:00
this.datawatcher.watch(10, Byte.valueOf(b0));
}
- public boolean s() {
+ public boolean s() { // PaperSpigot - isSmallBoundingBox
return (this.datawatcher.getByte(10) & 16) != 0;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
index 741b765..591c5a1 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
@@ -204,4 +204,16 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand {
(float) Math.toDegrees(old.getZ())
);
}
+
+ // PaperSpigot start - Implement bounding box (Marker) API
+ @Override
+ public boolean isSmallBoundingBox() {
+ return getHandle().s();
+ }
+
+ @Override
+ public void setSmallBoundingBox(boolean small) {
+ getHandle().n(small);
+ }
+ // PaperSpigot end
}
--
2015-06-06 19:15:22 +02:00
2.4.2.windows.1
2015-05-04 00:47:28 +02:00