mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
Add BlockStateMeta#clearBlockState
This commit is contained in:
parent
23ae9d3c49
commit
1d3be17a60
2 changed files with 14 additions and 0 deletions
|
@ -239,6 +239,13 @@ public class CraftMetaBlockState extends CraftMetaItem implements BlockStateMeta
|
|||
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
|
||||
public BlockState getBlockState() {
|
||||
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;
|
||||
}
|
||||
|
||||
// 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) {
|
||||
BlockPos pos = BlockPos.ZERO;
|
||||
Material stateMaterial = CraftMetaShield.shieldToBannerHack(color);
|
||||
|
|
Loading…
Reference in a new issue