use of net.minecraft.block.BlockJukebox.TileEntityJukebox in project SpongeCommon by SpongePowered.
the class JukeboxDataProcessor method removeFrom.
@Override
public DataTransactionResult removeFrom(ValueContainer<?> container) {
if (!(container instanceof BlockJukebox.TileEntityJukebox)) {
return DataTransactionResult.failNoData();
}
BlockJukebox.TileEntityJukebox jukebox = (TileEntityJukebox) container;
Optional<ItemStackSnapshot> old = getVal(jukebox);
if (!old.isPresent()) {
return DataTransactionResult.successNoData();
}
if (remove(jukebox)) {
return DataTransactionResult.successRemove(constructImmutableValue(old.get()));
}
return DataTransactionResult.builder().result(DataTransactionResult.Type.ERROR).build();
}
Aggregations