diff --git a/paper-server/patches/sources/net/minecraft/world/entity/vehicle/AbstractMinecart.java.patch b/paper-server/patches/sources/net/minecraft/world/entity/vehicle/AbstractMinecart.java.patch index e375a60860..a22e8138be 100644 --- a/paper-server/patches/sources/net/minecraft/world/entity/vehicle/AbstractMinecart.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/entity/vehicle/AbstractMinecart.java.patch @@ -121,16 +121,15 @@ double d0 = entity.getX() - this.getX(); double d1 = entity.getZ() - this.getZ(); double d2 = d0 * d0 + d1 * d1; -@@ -644,5 +694,27 @@ - +@@ -645,4 +695,27 @@ public boolean isFurnace() { return false; -+ } + } + + // CraftBukkit start - Methods for getting and setting flying and derailed velocity modifiers + public Vector getFlyingVelocityMod() { + return new Vector(this.flyingX, this.flyingY, this.flyingZ); - } ++ } + + public void setFlyingVelocityMod(Vector flying) { + this.flyingX = flying.getX(); @@ -148,4 +147,5 @@ + this.derailedZ = derailed.getZ(); + } + // CraftBukkit end ++ public net.minecraft.world.item.Item publicGetDropItem() { return getDropItem(); } // Paper - api to get boat and minecart material - expose public drop item } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java index c101d01b55..5d51a49228 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java @@ -78,6 +78,13 @@ public abstract class CraftBoat extends CraftVehicle implements Boat { this.getHandle().landBoats = workOnLand; } + // Paper start + @Override + public org.bukkit.Material getBoatMaterial() { + return org.bukkit.craftbukkit.util.CraftMagicNumbers.getMaterial(this.getHandle().getDropItem()); + } + // Paper end + @Override public Status getStatus() { return CraftBoat.boatStatusFromNms(this.getHandle().status); diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecart.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecart.java index c4db7c00c6..e02ecbdc15 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecart.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecart.java @@ -4,6 +4,7 @@ import net.minecraft.server.level.ServerLevel; import net.minecraft.world.entity.vehicle.AbstractMinecart; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.state.BlockState; +import org.bukkit.Material; // Paper import org.bukkit.block.data.BlockData; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.block.data.CraftBlockData; @@ -69,6 +70,13 @@ public abstract class CraftMinecart extends CraftVehicle implements Minecart { this.getHandle().setDerailedVelocityMod(derailed); } + // Paper start + @Override + public Material getMinecartMaterial() { + return CraftMagicNumbers.getMaterial(this.getHandle().publicGetDropItem()); + } + // Paper end + @Override public AbstractMinecart getHandle() { return (AbstractMinecart) this.entity;