geforkt von Mirrors/Paper
SPIGOT-5482: Structure Block setUsageMode encounters NullpointerException
Dieser Commit ist enthalten in:
Ursprung
82322fe06c
Commit
edcb0a4b6a
11
nms-patches/TileEntityStructure.patch
Normale Datei
11
nms-patches/TileEntityStructure.patch
Normale Datei
@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/server/TileEntityStructure.java
|
||||
+++ b/net/minecraft/server/TileEntityStructure.java
|
||||
@@ -18,7 +18,7 @@
|
||||
public BlockPosition size;
|
||||
public EnumBlockMirror mirror;
|
||||
public EnumBlockRotation rotation;
|
||||
- private BlockPropertyStructureMode usageMode;
|
||||
+ public BlockPropertyStructureMode usageMode;
|
||||
public boolean ignoreEntities;
|
||||
private boolean powered;
|
||||
public boolean showAir;
|
@ -105,7 +105,7 @@ public class CraftStructureBlock extends CraftBlockEntityState<TileEntityStructu
|
||||
|
||||
@Override
|
||||
public void setUsageMode(UsageMode mode) {
|
||||
getSnapshot().setUsageMode(BlockPropertyStructureMode.valueOf(mode.name()));
|
||||
getSnapshot().usageMode = BlockPropertyStructureMode.valueOf(mode.name());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -177,6 +177,14 @@ public class CraftStructureBlock extends CraftBlockEntityState<TileEntityStructu
|
||||
return getSnapshot().metadata;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void applyTo(TileEntityStructure tileEntity) {
|
||||
super.applyTo(tileEntity);
|
||||
|
||||
// Ensure block type is correct
|
||||
tileEntity.setUsageMode(tileEntity.getUsageMode());
|
||||
}
|
||||
|
||||
private static boolean isBetween(int num, int min, int max) {
|
||||
return num >= min && num <= max;
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren