use of org.spongepowered.common.accessor.world.level.block.JukeboxBlockAccessor in project SpongeCommon by SpongePowered.
the class JukeboxBlockEntityMixin_API method eject.
@SuppressWarnings("deprecation")
@Override
public void eject() {
final BlockState block = this.level.getBlockState(this.shadow$getBlockPos());
if (block.getBlock() == Blocks.JUKEBOX) {
((JukeboxBlockAccessor) block.getBlock()).invoker$dropRecording(this.level, this.shadow$getBlockPos());
this.level.setBlock(this.shadow$getBlockPos(), block.setValue(JukeboxBlock.HAS_RECORD, false), Constants.BlockChangeFlags.NOTIFY_CLIENTS);
}
}
Aggregations