fly command allowing anyone to fly might not work not sure

This commit is contained in:
2026-09-20 05:26:42 +01:00
parent 830633222a
commit ee56a07278
14 changed files with 61 additions and 3 deletions
@@ -29,6 +29,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
private ItemStack[] bN = new ItemStack[]{null, null, null, null, null};
private int bO = 0;
public boolean h;
public boolean flightAllowed;
public EntityPlayer(MinecraftServer minecraftserver, World world, String s, ItemInWorldManager iteminworldmanager) {
super(world);
@@ -65,6 +66,18 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public org.bukkit.Location compassTarget;
// CraftBukkit end
@Override
public void a(NBTTagCompound nbttagcompound) {
super.a(nbttagcompound);
this.flightAllowed = nbttagcompound.m("FlightAllowed");
}
@Override
public void b(NBTTagCompound nbttagcompound) {
super.b(nbttagcompound);
nbttagcompound.a("FlightAllowed", this.flightAllowed);
}
public void spawnIn(World world) {
super.spawnIn(world);
// CraftBukkit - world fallback code, either respawn location or global spawn
@@ -425,7 +425,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
AxisAlignedBB axisalignedbb = this.player.boundingBox.clone().b((double) f4, (double) f4, (double) f4).a(0.0D, -0.55D, 0.0D);
if (!this.minecraftServer.allowFlight && !worldserver.b(axisalignedbb)) {
if (!this.minecraftServer.allowFlight && !this.player.flightAllowed && !worldserver.b(axisalignedbb)) {
if (d6 >= -0.03125D) {
++this.h;
if (this.h > 80) {