use of net.minecraft.tileentity.TileEntityFlowerPot in project SpongeCommon by SpongePowered.
the class FlowerPotDataProcessor method removeFrom.
@Override
public DataTransactionResult removeFrom(ValueContainer<?> container) {
if (!(container instanceof TileEntityFlowerPot)) {
return DataTransactionResult.failNoData();
}
TileEntityFlowerPot flowerPot = (TileEntityFlowerPot) container;
Optional<ItemStackSnapshot> old = getVal(flowerPot);
if (!old.isPresent()) {
return DataTransactionResult.successNoData();
}
flowerPot.setItemStack(ItemStack.EMPTY);
flowerPot.markDirty();
return DataTransactionResult.successRemove(constructImmutableValue(old.get()));
}
Aggregations