mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 03:43:40 +01:00
#757: PoweredMinecart - add getter/setter for fuel
By: Shane Bee <shanebolenback@me.com>
This commit is contained in:
parent
0410e56149
commit
f265542e4f
2 changed files with 28 additions and 0 deletions
11
paper-server/nms-patches/EntityMinecartFurnace.patch
Normal file
11
paper-server/nms-patches/EntityMinecartFurnace.patch
Normal file
|
@ -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<Boolean> 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);
|
|
@ -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";
|
||||
|
|
Loading…
Reference in a new issue