use of io.github.thebusybiscuit.slimefun4.implementation.handlers.SimpleBlockBreakHandler in project Slimefun4 by Slimefun.
the class AncientPedestal method onBreak.
@Nonnull
private BlockBreakHandler onBreak() {
return new SimpleBlockBreakHandler() {
@Override
public void onBlockBreak(@Nonnull Block b) {
Optional<Item> entity = getPlacedItem(b);
if (entity.isPresent()) {
Item stack = entity.get();
if (stack.isValid()) {
stack.removeMetadata("no_pickup", Slimefun.instance());
b.getWorld().dropItem(b.getLocation(), getOriginalItemStack(stack));
stack.remove();
}
}
}
};
}
use of io.github.thebusybiscuit.slimefun4.implementation.handlers.SimpleBlockBreakHandler in project Slimefun4 by Slimefun.
the class GEOMiner method onBlockBreak.
@Nonnull
private BlockBreakHandler onBlockBreak() {
return new SimpleBlockBreakHandler() {
@Override
public void onBlockBreak(@Nonnull Block b) {
removeHologram(b);
BlockMenu inv = BlockStorage.getInventory(b);
if (inv != null) {
inv.dropItems(b.getLocation(), OUTPUT_SLOTS);
}
processor.endOperation(b);
}
};
}
use of io.github.thebusybiscuit.slimefun4.implementation.handlers.SimpleBlockBreakHandler in project Slimefun4 by Slimefun.
the class AGenerator method onBlockBreak.
@Nonnull
protected BlockBreakHandler onBlockBreak() {
return new SimpleBlockBreakHandler() {
@Override
public void onBlockBreak(Block b) {
BlockMenu inv = BlockStorage.getInventory(b);
if (inv != null) {
inv.dropItems(b.getLocation(), getInputSlots());
inv.dropItems(b.getLocation(), getOutputSlots());
}
processor.endOperation(b);
}
};
}
use of io.github.thebusybiscuit.slimefun4.implementation.handlers.SimpleBlockBreakHandler in project DynaTech by ProfElements.
the class AMachineGenerator method onBreak.
private BlockBreakHandler onBreak() {
return new SimpleBlockBreakHandler() {
@Override
public void onBlockBreak(Block b) {
BlockMenu inv = BlockStorage.getInventory(b);
if (inv != null) {
inv.dropItems(b.getLocation(), getInputSlots());
inv.dropItems(b.getLocation(), getOutputSlots());
}
processing.remove(b);
progress.remove(b);
}
};
}
use of io.github.thebusybiscuit.slimefun4.implementation.handlers.SimpleBlockBreakHandler in project BedrockTechnology by CTimet.
the class BektAContainerOneSlot method onBlockBreak.
protected BlockBreakHandler onBlockBreak() {
return new SimpleBlockBreakHandler() {
@Override
public void onBlockBreak(Block b) {
BlockMenu inv = BlockStorage.getInventory(b);
if (inv != null) {
// inv.dropItems(b.getLocation(), getInputSlots());
inv.dropItems(b.getLocation(), getOutputSlots());
}
processor.endOperation(b);
}
};
}
Aggregations