Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 12:30:06 +01:00
SPIGOT-5650: Lectern.setPage(int) causes a NullPointerException
Dieser Commit ist enthalten in:
Ursprung
3075579f61
Commit
bbe3d58efc
@ -89,6 +89,15 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -135,7 +197,7 @@
|
||||||
|
if (j != this.page) {
|
||||||
|
this.page = j;
|
||||||
|
this.update();
|
||||||
|
- BlockLectern.a(this.getWorld(), this.getPosition(), this.getBlock());
|
||||||
|
+ if (this.world != null) BlockLectern.a(this.getWorld(), this.getPosition(), this.getBlock()); // CraftBukkit
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -158,6 +220,32 @@
|
@@ -158,6 +220,32 @@
|
||||||
return itemstack;
|
return itemstack;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package org.bukkit.craftbukkit.block;
|
package org.bukkit.craftbukkit.block;
|
||||||
|
|
||||||
|
import net.minecraft.server.BlockLectern;
|
||||||
import net.minecraft.server.TileEntityLectern;
|
import net.minecraft.server.TileEntityLectern;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
@ -40,4 +41,15 @@ public class CraftLectern extends CraftBlockEntityState<TileEntityLectern> imple
|
|||||||
|
|
||||||
return new CraftInventoryLectern(this.getTileEntity().inventory);
|
return new CraftInventoryLectern(this.getTileEntity().inventory);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean update(boolean force, boolean applyPhysics) {
|
||||||
|
boolean result = super.update(force, applyPhysics);
|
||||||
|
|
||||||
|
if (result && this.isPlaced() && this.getType() == Material.LECTERN) {
|
||||||
|
BlockLectern.a(this.world.getHandle(), this.getPosition(), this.getHandle());
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren