diff --git a/paper-server/nms-patches/EntityMinecartFurnace.patch b/paper-server/nms-patches/EntityMinecartFurnace.patch new file mode 100644 index 0000000000..af8efb5a43 --- /dev/null +++ b/paper-server/nms-patches/EntityMinecartFurnace.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/server/EntityMinecartFurnace.java ++++ b/net/minecraft/server/EntityMinecartFurnace.java +@@ -3,7 +3,7 @@ + public class EntityMinecartFurnace extends EntityMinecartAbstract { + + private static final DataWatcherObject d = DataWatcher.a(EntityMinecartFurnace.class, DataWatcherRegistry.i); +- private int e; ++ public int e; // CraftBukkit PAIL private -> public, RENAME fuel + public double b; + public double c; + private static final RecipeItemStack f = RecipeItemStack.a(Items.COAL, Items.CHARCOAL); diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartFurnace.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartFurnace.java index b024359c9c..1e8ccde245 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartFurnace.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartFurnace.java @@ -1,5 +1,6 @@ package org.bukkit.craftbukkit.entity; +import com.google.common.base.Preconditions; import net.minecraft.server.EntityMinecartFurnace; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.entity.EntityType; @@ -11,6 +12,22 @@ public class CraftMinecartFurnace extends CraftMinecart implements PoweredMineca super(server, entity); } + @Override + public EntityMinecartFurnace getHandle() { + return (EntityMinecartFurnace) entity; + } + + @Override + public int getFuel() { + return getHandle().e; + } + + @Override + public void setFuel(int fuel) { + Preconditions.checkArgument(fuel >= 0, "ticks cannot be negative"); + getHandle().e = fuel; + } + @Override public String toString() { return "CraftMinecartFurnace";