geforkt von Mirrors/Paper
API to get Material from Boats and Minecarts
== AT == public net.minecraft.world.entity.vehicle.AbstractBoat getDropItem()Lnet/minecraft/world/item/Item;
Dieser Commit ist enthalten in:
Ursprung
119c616ab9
Commit
38ea31d1cb
@ -121,16 +121,15 @@
|
|||||||
double d0 = entity.getX() - this.getX();
|
double d0 = entity.getX() - this.getX();
|
||||||
double d1 = entity.getZ() - this.getZ();
|
double d1 = entity.getZ() - this.getZ();
|
||||||
double d2 = d0 * d0 + d1 * d1;
|
double d2 = d0 * d0 + d1 * d1;
|
||||||
@@ -644,5 +694,27 @@
|
@@ -645,4 +695,27 @@
|
||||||
|
|
||||||
public boolean isFurnace() {
|
public boolean isFurnace() {
|
||||||
return false;
|
return false;
|
||||||
+ }
|
}
|
||||||
+
|
+
|
||||||
+ // CraftBukkit start - Methods for getting and setting flying and derailed velocity modifiers
|
+ // CraftBukkit start - Methods for getting and setting flying and derailed velocity modifiers
|
||||||
+ public Vector getFlyingVelocityMod() {
|
+ public Vector getFlyingVelocityMod() {
|
||||||
+ return new Vector(this.flyingX, this.flyingY, this.flyingZ);
|
+ return new Vector(this.flyingX, this.flyingY, this.flyingZ);
|
||||||
}
|
+ }
|
||||||
+
|
+
|
||||||
+ public void setFlyingVelocityMod(Vector flying) {
|
+ public void setFlyingVelocityMod(Vector flying) {
|
||||||
+ this.flyingX = flying.getX();
|
+ this.flyingX = flying.getX();
|
||||||
@ -148,4 +147,5 @@
|
|||||||
+ this.derailedZ = derailed.getZ();
|
+ this.derailedZ = derailed.getZ();
|
||||||
+ }
|
+ }
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
|
+ public net.minecraft.world.item.Item publicGetDropItem() { return getDropItem(); } // Paper - api to get boat and minecart material - expose public drop item
|
||||||
}
|
}
|
||||||
|
@ -78,6 +78,13 @@ public abstract class CraftBoat extends CraftVehicle implements Boat {
|
|||||||
this.getHandle().landBoats = workOnLand;
|
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
|
@Override
|
||||||
public Status getStatus() {
|
public Status getStatus() {
|
||||||
return CraftBoat.boatStatusFromNms(this.getHandle().status);
|
return CraftBoat.boatStatusFromNms(this.getHandle().status);
|
||||||
|
@ -4,6 +4,7 @@ import net.minecraft.server.level.ServerLevel;
|
|||||||
import net.minecraft.world.entity.vehicle.AbstractMinecart;
|
import net.minecraft.world.entity.vehicle.AbstractMinecart;
|
||||||
import net.minecraft.world.level.block.Blocks;
|
import net.minecraft.world.level.block.Blocks;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
|
import org.bukkit.Material; // Paper
|
||||||
import org.bukkit.block.data.BlockData;
|
import org.bukkit.block.data.BlockData;
|
||||||
import org.bukkit.craftbukkit.CraftServer;
|
import org.bukkit.craftbukkit.CraftServer;
|
||||||
import org.bukkit.craftbukkit.block.data.CraftBlockData;
|
import org.bukkit.craftbukkit.block.data.CraftBlockData;
|
||||||
@ -69,6 +70,13 @@ public abstract class CraftMinecart extends CraftVehicle implements Minecart {
|
|||||||
this.getHandle().setDerailedVelocityMod(derailed);
|
this.getHandle().setDerailedVelocityMod(derailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Paper start
|
||||||
|
@Override
|
||||||
|
public Material getMinecartMaterial() {
|
||||||
|
return CraftMagicNumbers.getMaterial(this.getHandle().publicGetDropItem());
|
||||||
|
}
|
||||||
|
// Paper end
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AbstractMinecart getHandle() {
|
public AbstractMinecart getHandle() {
|
||||||
return (AbstractMinecart) this.entity;
|
return (AbstractMinecart) this.entity;
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren