mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 05:47:45 +01:00
Add BlockStateMeta#clearBlockState
This commit is contained in:
parent
23ae9d3c49
commit
1d3be17a60
@ -239,6 +239,13 @@ public class CraftMetaBlockState extends CraftMetaItem implements BlockStateMeta
|
|||||||
return this.blockEntityTag != null;
|
return this.blockEntityTag != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Paper start - add method to clear block state
|
||||||
|
@Override
|
||||||
|
public void clearBlockState() {
|
||||||
|
this.blockEntityTag = null;
|
||||||
|
}
|
||||||
|
// Paper end - add method to clear block state
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockState getBlockState() {
|
public BlockState getBlockState() {
|
||||||
return (this.blockEntityTag != null) ? this.blockEntityTag.copy() : CraftMetaBlockState.getBlockState(this.material, null);
|
return (this.blockEntityTag != null) ? this.blockEntityTag.copy() : CraftMetaBlockState.getBlockState(this.material, null);
|
||||||
|
@ -257,6 +257,13 @@ public class CraftMetaShield extends CraftMetaItem implements ShieldMeta, BlockS
|
|||||||
this.banner = (Banner) blockState;
|
this.banner = (Banner) blockState;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Paper start - add method to clear block state
|
||||||
|
@Override
|
||||||
|
public void clearBlockState() {
|
||||||
|
this.banner = null;
|
||||||
|
}
|
||||||
|
// Paper end - add method to clear block state
|
||||||
|
|
||||||
private static Banner getBlockState(DyeColor color) {
|
private static Banner getBlockState(DyeColor color) {
|
||||||
BlockPos pos = BlockPos.ZERO;
|
BlockPos pos = BlockPos.ZERO;
|
||||||
Material stateMaterial = CraftMetaShield.shieldToBannerHack(color);
|
Material stateMaterial = CraftMetaShield.shieldToBannerHack(color);
|
||||||
|
Loading…
Reference in New Issue
Block a user