mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 12:27:59 +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;
|
||||
}
|
||||
|
||||
// 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 New Issue
Block a user