Update upstream B/CB/S

This commit is contained in:
Zach Brown 2017-01-20 05:21:44 -06:00
parent f37dddfe3e
commit b0348aea3e
8 changed files with 19 additions and 68 deletions

View file

@ -9,8 +9,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/entity/Arrow.java
+++ b/src/main/java/org/bukkit/entity/Arrow.java
@@ -0,0 +0,0 @@ public interface Arrow extends Projectile {
*/
public void setCritical(boolean critical);
CREATIVE_ONLY
}
+ // Paper start
+ /**
@ -20,16 +20,25 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * <b>not</b> fired from a bow with the infinity enchantment.</p>
+ *
+ * @return The pickup rule
+ * @deprecated Use {@link Arrow#getPickupStatus()} as an upstream compatible replacement for this function
+ */
+ PickupRule getPickupRule();
+ @Deprecated
+ default PickupRule getPickupRule() {
+ return PickupRule.valueOf(this.getPickupStatus().name());
+ }
+
+ /**
+ * Set the rule for which players can pickup this arrow as an item.
+ *
+ * @param rule The pickup rule
+ * @deprecated Use {@link Arrow#setPickupStatus(PickupStatus)} with {@link PickupStatus} as an upstream compatible replacement for this function
+ */
+ void setPickupRule(PickupRule rule);
+ @Deprecated
+ default void setPickupRule(PickupRule rule) {
+ this.setPickupStatus(PickupStatus.valueOf(rule.name()));
+ }
+
+ @Deprecated
+ enum PickupRule {
+ DISALLOWED,
+ ALLOWED,

View file

@ -1,56 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jedediah Smith <jedediah@silencegreys.com>
Date: Fri, 4 Mar 2016 03:16:11 -0500
Subject: [PATCH] Arrow pickup rule API
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java
@@ -0,0 +0,0 @@ public class CraftArrow extends AbstractProjectile implements Arrow {
getHandle().shooter = ((CraftLivingEntity) shooter).getHandle();
}
+ // Paper start
+ @Override
+ public PickupRule getPickupRule() {
+ return convertPickupRule(this.getHandle().fromPlayer);
+ }
+
+ @Override
+ public void setPickupRule(PickupRule rule) {
+ this.getHandle().fromPlayer = convertPickupRule(rule);
+ }
+
+ public static PickupRule convertPickupRule(EntityArrow.PickupStatus nms) {
+ switch (nms) {
+ case DISALLOWED:
+ return PickupRule.DISALLOWED;
+ case ALLOWED:
+ return PickupRule.ALLOWED;
+ case CREATIVE_ONLY:
+ return PickupRule.CREATIVE_ONLY;
+ default:
+ throw new IllegalStateException();
+ }
+ }
+
+ public static EntityArrow.PickupStatus convertPickupRule(PickupRule bukkit) {
+ switch (bukkit) {
+ case DISALLOWED:
+ return EntityArrow.PickupStatus.DISALLOWED;
+ case ALLOWED:
+ return EntityArrow.PickupStatus.ALLOWED;
+ case CREATIVE_ONLY:
+ return EntityArrow.PickupStatus.CREATIVE_ONLY;
+ default:
+ throw new IllegalStateException();
+ }
+ }
+ // Paper end
+
// Spigot start
private final Arrow.Spigot spigot = new Arrow.Spigot()
{
--

View file

@ -16,6 +16,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (entity.bB() != this) {
throw new IllegalStateException("Use x.startRiding(y), not y.addPassenger(x)");
} else {
--
2.9.3 (Apple Git-75)
--

View file

@ -7,7 +7,7 @@ Saving players async is extremely dangerous. This will force it to main
the same way we handle async chunk loads.
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 2f527f6ce..6a1e4f0f6 100644
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -0,0 +0,0 @@ public abstract class PlayerList {

View file

@ -713,7 +713,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public CraftHopper(final Block block) {
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftShulkerBox.java b/src/main/java/org/bukkit/craftbukkit/block/CraftShulkerBox.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
index 8a7ce92b..02f56bc 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftShulkerBox.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftShulkerBox.java
@@ -0,0 +0,0 @@

@ -1 +1 @@
Subproject commit 39c5d6b4a11b3e7c2eeb12a8bae5495f95ccc247
Subproject commit 4bef447a073792a0858dc49e33593acb1c1948f5

@ -1 +1 @@
Subproject commit 775f1e1f7f5783860ccb16feaf8c0cc53a6f9c18
Subproject commit 4d3bf2015504897fc69af2a209d4c8bbe217394d

@ -1 +1 @@
Subproject commit 7d78b81e398e61a69a774f05f427c24f0debd4fd
Subproject commit b32c8f871b2da575c1d9e9fa0532ba3e7e2eaa54