mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 03:35:51 +00:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
f9ab6492ee
@ -211,9 +211,18 @@ public abstract class ProgrammableAndroid extends SlimefunItem {
|
|||||||
boolean allow = reason.equals(UnregisterReason.PLAYER_BREAK) && (BlockStorage.getBlockInfo(b, "owner").equals(p.getUniqueId().toString()) || p.hasPermission("slimefun.android.bypass"));
|
boolean allow = reason.equals(UnregisterReason.PLAYER_BREAK) && (BlockStorage.getBlockInfo(b, "owner").equals(p.getUniqueId().toString()) || p.hasPermission("slimefun.android.bypass"));
|
||||||
|
|
||||||
if (allow) {
|
if (allow) {
|
||||||
if (BlockStorage.getInventory(b).getItemInSlot(43) != null) b.getWorld().dropItemNaturally(b.getLocation(), BlockStorage.getInventory(b).getItemInSlot(43));
|
BlockMenu inv = BlockStorage.getInventory(b);
|
||||||
for (int slot: getOutputSlots()) {
|
if (inv != null) {
|
||||||
if (BlockStorage.getInventory(b).getItemInSlot(slot) != null) b.getWorld().dropItemNaturally(b.getLocation(), BlockStorage.getInventory(b).getItemInSlot(slot));
|
if (inv.getItemInSlot(43) != null) {
|
||||||
|
b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(43));
|
||||||
|
inv.replaceExistingItem(43, null);
|
||||||
|
}
|
||||||
|
for (int slot: getOutputSlots()) {
|
||||||
|
if (inv.getItemInSlot(slot) != null) {
|
||||||
|
b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
||||||
|
inv.replaceExistingItem(slot, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
AndroidStatusHologram.remove(b);
|
AndroidStatusHologram.remove(b);
|
||||||
}
|
}
|
||||||
|
@ -84,10 +84,16 @@ public abstract class AContainer extends SlimefunItem {
|
|||||||
BlockMenu inv = BlockStorage.getInventory(b);
|
BlockMenu inv = BlockStorage.getInventory(b);
|
||||||
if (inv != null) {
|
if (inv != null) {
|
||||||
for (int slot: getInputSlots()) {
|
for (int slot: getInputSlots()) {
|
||||||
if (inv.getItemInSlot(slot) != null) b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
if (inv.getItemInSlot(slot) != null) {
|
||||||
|
b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
||||||
|
inv.replaceExistingItem(slot, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for (int slot: getOutputSlots()) {
|
for (int slot: getOutputSlots()) {
|
||||||
if (inv.getItemInSlot(slot) != null) b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
if (inv.getItemInSlot(slot) != null) {
|
||||||
|
b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
||||||
|
inv.replaceExistingItem(slot, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
progress.remove(b);
|
progress.remove(b);
|
||||||
@ -134,11 +140,20 @@ public abstract class AContainer extends SlimefunItem {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBreak(Player p, Block b, SlimefunItem item, UnregisterReason reason) {
|
public boolean onBreak(Player p, Block b, SlimefunItem item, UnregisterReason reason) {
|
||||||
for (int slot: getInputSlots()) {
|
BlockMenu inv = BlockStorage.getInventory(b);
|
||||||
if (BlockStorage.getInventory(b).getItemInSlot(slot) != null) b.getWorld().dropItemNaturally(b.getLocation(), BlockStorage.getInventory(b).getItemInSlot(slot));
|
if (inv != null) {
|
||||||
}
|
for (int slot: getInputSlots()) {
|
||||||
for (int slot: getOutputSlots()) {
|
if (inv.getItemInSlot(slot) != null) {
|
||||||
if (BlockStorage.getInventory(b).getItemInSlot(slot) != null) b.getWorld().dropItemNaturally(b.getLocation(), BlockStorage.getInventory(b).getItemInSlot(slot));
|
b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
||||||
|
inv.replaceExistingItem(slot, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (int slot: getOutputSlots()) {
|
||||||
|
if (inv.getItemInSlot(slot) != null) {
|
||||||
|
b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
||||||
|
inv.replaceExistingItem(slot, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
processing.remove(b);
|
processing.remove(b);
|
||||||
progress.remove(b);
|
progress.remove(b);
|
||||||
|
@ -68,8 +68,14 @@ public abstract class AFarm extends SlimefunItem {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBreak(Player p, Block b, SlimefunItem item, UnregisterReason reason) {
|
public boolean onBreak(Player p, Block b, SlimefunItem item, UnregisterReason reason) {
|
||||||
for (int slot: getOutputSlots()) {
|
BlockMenu inv = BlockStorage.getInventory(b);
|
||||||
if (BlockStorage.getInventory(b).getItemInSlot(slot) != null) b.getWorld().dropItemNaturally(b.getLocation(), BlockStorage.getInventory(b).getItemInSlot(slot));
|
if (inv != null) {
|
||||||
|
for (int slot: getOutputSlots()) {
|
||||||
|
if (inv.getItemInSlot(slot) != null) {
|
||||||
|
b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
||||||
|
inv.replaceExistingItem(slot, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -111,8 +117,14 @@ public abstract class AFarm extends SlimefunItem {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBreak(Player p, Block b, SlimefunItem item, UnregisterReason reason) {
|
public boolean onBreak(Player p, Block b, SlimefunItem item, UnregisterReason reason) {
|
||||||
for (int slot: getOutputSlots()) {
|
BlockMenu inv = BlockStorage.getInventory(b);
|
||||||
if (BlockStorage.getInventory(b).getItemInSlot(slot) != null) b.getWorld().dropItemNaturally(b.getLocation(), BlockStorage.getInventory(b).getItemInSlot(slot));
|
if (inv != null) {
|
||||||
|
for (int slot: getOutputSlots()) {
|
||||||
|
if (inv.getItemInSlot(slot) != null) {
|
||||||
|
b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
||||||
|
inv.replaceExistingItem(slot, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -88,10 +88,16 @@ public abstract class AGenerator extends SlimefunItem {
|
|||||||
BlockMenu inv = BlockStorage.getInventory(b);
|
BlockMenu inv = BlockStorage.getInventory(b);
|
||||||
if (inv != null) {
|
if (inv != null) {
|
||||||
for (int slot: getInputSlots()) {
|
for (int slot: getInputSlots()) {
|
||||||
if (inv.getItemInSlot(slot) != null) b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
if (inv.getItemInSlot(slot) != null) {
|
||||||
|
b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
||||||
|
inv.replaceExistingItem(slot, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for (int slot: getOutputSlots()) {
|
for (int slot: getOutputSlots()) {
|
||||||
if (inv.getItemInSlot(slot) != null) b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
if (inv.getItemInSlot(slot) != null) {
|
||||||
|
b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
||||||
|
inv.replaceExistingItem(slot, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
progress.remove(b.getLocation());
|
progress.remove(b.getLocation());
|
||||||
@ -141,10 +147,16 @@ public abstract class AGenerator extends SlimefunItem {
|
|||||||
BlockMenu inv = BlockStorage.getInventory(b);
|
BlockMenu inv = BlockStorage.getInventory(b);
|
||||||
if (inv != null) {
|
if (inv != null) {
|
||||||
for (int slot: getInputSlots()) {
|
for (int slot: getInputSlots()) {
|
||||||
if (inv.getItemInSlot(slot) != null) b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
if (inv.getItemInSlot(slot) != null) {
|
||||||
|
b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
||||||
|
inv.replaceExistingItem(slot, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for (int slot: getOutputSlots()) {
|
for (int slot: getOutputSlots()) {
|
||||||
if (inv.getItemInSlot(slot) != null) b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
if (inv.getItemInSlot(slot) != null) {
|
||||||
|
b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
||||||
|
inv.replaceExistingItem(slot, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
progress.remove(b.getLocation());
|
progress.remove(b.getLocation());
|
||||||
|
@ -134,13 +134,22 @@ public abstract class AReactor extends SlimefunItem {
|
|||||||
BlockMenu inv = BlockStorage.getInventory(b);
|
BlockMenu inv = BlockStorage.getInventory(b);
|
||||||
if (inv != null) {
|
if (inv != null) {
|
||||||
for (int slot: getFuelSlots()) {
|
for (int slot: getFuelSlots()) {
|
||||||
if (inv.getItemInSlot(slot) != null) b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
if (inv.getItemInSlot(slot) != null) {
|
||||||
|
b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
||||||
|
inv.replaceExistingItem(slot, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for (int slot: getCoolantSlots()) {
|
for (int slot: getCoolantSlots()) {
|
||||||
if (inv.getItemInSlot(slot) != null) b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
if (inv.getItemInSlot(slot) != null) {
|
||||||
|
b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
||||||
|
inv.replaceExistingItem(slot, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for (int slot: getOutputSlots()) {
|
for (int slot: getOutputSlots()) {
|
||||||
if (inv.getItemInSlot(slot) != null) b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
if (inv.getItemInSlot(slot) != null) {
|
||||||
|
b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
||||||
|
inv.replaceExistingItem(slot, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
progress.remove(b.getLocation());
|
progress.remove(b.getLocation());
|
||||||
|
@ -210,8 +210,14 @@ public class AdvancedCargoOutputNode extends SlimefunItem {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBreak(Player p, Block b, SlimefunItem item, UnregisterReason reason) {
|
public boolean onBreak(Player p, Block b, SlimefunItem item, UnregisterReason reason) {
|
||||||
for (int slot: getInputSlots()) {
|
BlockMenu inv = BlockStorage.getInventory(b);
|
||||||
if (BlockStorage.getInventory(b).getItemInSlot(slot) != null) b.getWorld().dropItemNaturally(b.getLocation(), BlockStorage.getInventory(b).getItemInSlot(slot));
|
if (inv != null) {
|
||||||
|
for (int slot: getInputSlots()) {
|
||||||
|
if (inv.getItemInSlot(slot) != null) {
|
||||||
|
b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
||||||
|
inv.replaceExistingItem(slot, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -70,8 +70,14 @@ public class AnimalGrowthAccelerator extends SlimefunItem {
|
|||||||
@Override
|
@Override
|
||||||
public boolean onBreak(Player p, Block b, SlimefunItem item, UnregisterReason reason) {
|
public boolean onBreak(Player p, Block b, SlimefunItem item, UnregisterReason reason) {
|
||||||
me.mrCookieSlime.Slimefun.holograms.AnimalGrowthAccelerator.getArmorStand(b).remove();
|
me.mrCookieSlime.Slimefun.holograms.AnimalGrowthAccelerator.getArmorStand(b).remove();
|
||||||
for (int slot: getInputSlots()) {
|
BlockMenu inv = BlockStorage.getInventory(b);
|
||||||
if (BlockStorage.getInventory(b).getItemInSlot(slot) != null) b.getWorld().dropItemNaturally(b.getLocation(), BlockStorage.getInventory(b).getItemInSlot(slot));
|
if (inv != null) {
|
||||||
|
for (int slot: getInputSlots()) {
|
||||||
|
if (inv.getItemInSlot(slot) != null) {
|
||||||
|
b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
||||||
|
inv.replaceExistingItem(slot, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -70,8 +70,14 @@ public class AutoBreeder extends SlimefunItem {
|
|||||||
@Override
|
@Override
|
||||||
public boolean onBreak(Player p, Block b, SlimefunItem item, UnregisterReason reason) {
|
public boolean onBreak(Player p, Block b, SlimefunItem item, UnregisterReason reason) {
|
||||||
me.mrCookieSlime.Slimefun.holograms.AutoBreeder.getArmorStand(b).remove();
|
me.mrCookieSlime.Slimefun.holograms.AutoBreeder.getArmorStand(b).remove();
|
||||||
for (int slot: getInputSlots()) {
|
BlockMenu inv = BlockStorage.getInventory(b);
|
||||||
if (BlockStorage.getInventory(b).getItemInSlot(slot) != null) b.getWorld().dropItemNaturally(b.getLocation(), BlockStorage.getInventory(b).getItemInSlot(slot));
|
if (inv != null) {
|
||||||
|
for (int slot: getInputSlots()) {
|
||||||
|
if (inv.getItemInSlot(slot) != null) {
|
||||||
|
b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
||||||
|
inv.replaceExistingItem(slot, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -119,10 +119,16 @@ public abstract class AutomatedCraftingChamber extends SlimefunItem {
|
|||||||
BlockMenu inv = BlockStorage.getInventory(b);
|
BlockMenu inv = BlockStorage.getInventory(b);
|
||||||
if (inv != null) {
|
if (inv != null) {
|
||||||
for (int slot: getInputSlots()) {
|
for (int slot: getInputSlots()) {
|
||||||
if (inv.getItemInSlot(slot) != null) b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
if (inv.getItemInSlot(slot) != null) {
|
||||||
|
b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
||||||
|
inv.replaceExistingItem(slot, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for (int slot: getOutputSlots()) {
|
for (int slot: getOutputSlots()) {
|
||||||
if (inv.getItemInSlot(slot) != null) b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
if (inv.getItemInSlot(slot) != null) {
|
||||||
|
b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
||||||
|
inv.replaceExistingItem(slot, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -105,8 +105,14 @@ public class CargoCraftingNode extends SlimefunItem {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBreak(Player p, Block b, SlimefunItem item, UnregisterReason reason) {
|
public boolean onBreak(Player p, Block b, SlimefunItem item, UnregisterReason reason) {
|
||||||
for (int slot: getInputSlots()) {
|
BlockMenu inv = BlockStorage.getInventory(b);
|
||||||
if (BlockStorage.getInventory(b).getItemInSlot(slot) != null) b.getWorld().dropItemNaturally(b.getLocation(), BlockStorage.getInventory(b).getItemInSlot(slot));
|
if (inv != null) {
|
||||||
|
for (int slot: getInputSlots()) {
|
||||||
|
if (inv.getItemInSlot(slot) != null) {
|
||||||
|
b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
||||||
|
inv.replaceExistingItem(slot, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -236,8 +236,14 @@ public class CargoInputNode extends SlimefunItem {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBreak(Player p, Block b, SlimefunItem item, UnregisterReason reason) {
|
public boolean onBreak(Player p, Block b, SlimefunItem item, UnregisterReason reason) {
|
||||||
for (int slot: getInputSlots()) {
|
BlockMenu inv = BlockStorage.getInventory(b);
|
||||||
if (BlockStorage.getInventory(b).getItemInSlot(slot) != null) b.getWorld().dropItemNaturally(b.getLocation(), BlockStorage.getInventory(b).getItemInSlot(slot));
|
if (inv != null) {
|
||||||
|
for (int slot: getInputSlots()) {
|
||||||
|
if (inv.getItemInSlot(slot) != null) {
|
||||||
|
b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
||||||
|
inv.replaceExistingItem(slot, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -80,8 +80,14 @@ public abstract class CropGrowthAccelerator extends SlimefunItem {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBreak(Player p, Block b, SlimefunItem item, UnregisterReason reason) {
|
public boolean onBreak(Player p, Block b, SlimefunItem item, UnregisterReason reason) {
|
||||||
for (int slot: getInputSlots()) {
|
BlockMenu inv = BlockStorage.getInventory(b);
|
||||||
if (BlockStorage.getInventory(b).getItemInSlot(slot) != null) b.getWorld().dropItemNaturally(b.getLocation(), BlockStorage.getInventory(b).getItemInSlot(slot));
|
if (inv != null) {
|
||||||
|
for (int slot: getInputSlots()) {
|
||||||
|
if (inv.getItemInSlot(slot) != null) {
|
||||||
|
b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
||||||
|
inv.replaceExistingItem(slot, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -102,10 +102,16 @@ public abstract class ElectricSmeltery extends AContainer {
|
|||||||
BlockMenu inv = BlockStorage.getInventory(b);
|
BlockMenu inv = BlockStorage.getInventory(b);
|
||||||
if (inv != null) {
|
if (inv != null) {
|
||||||
for (int slot: getInputSlots()) {
|
for (int slot: getInputSlots()) {
|
||||||
if (inv.getItemInSlot(slot) != null) b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
if (inv.getItemInSlot(slot) != null) {
|
||||||
|
b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
||||||
|
inv.replaceExistingItem(slot, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for (int slot: getOutputSlots()) {
|
for (int slot: getOutputSlots()) {
|
||||||
if (inv.getItemInSlot(slot) != null) b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
if (inv.getItemInSlot(slot) != null) {
|
||||||
|
b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
||||||
|
inv.replaceExistingItem(slot, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
progress.remove(b.getLocation());
|
progress.remove(b.getLocation());
|
||||||
|
@ -81,13 +81,22 @@ public class ReactorAccessPort extends SlimefunItem {
|
|||||||
BlockMenu inv = BlockStorage.getInventory(b);
|
BlockMenu inv = BlockStorage.getInventory(b);
|
||||||
if (inv != null) {
|
if (inv != null) {
|
||||||
for (int slot: getFuelSlots()) {
|
for (int slot: getFuelSlots()) {
|
||||||
if (inv.getItemInSlot(slot) != null) b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
if (inv.getItemInSlot(slot) != null) {
|
||||||
|
b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
||||||
|
inv.replaceExistingItem(slot, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for (int slot: getCoolantSlots()) {
|
for (int slot: getCoolantSlots()) {
|
||||||
if (inv.getItemInSlot(slot) != null) b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
if (inv.getItemInSlot(slot) != null) {
|
||||||
|
b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
||||||
|
inv.replaceExistingItem(slot, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for (int slot: getOutputSlots()) {
|
for (int slot: getOutputSlots()) {
|
||||||
if (inv.getItemInSlot(slot) != null) b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
if (inv.getItemInSlot(slot) != null) {
|
||||||
|
b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
||||||
|
inv.replaceExistingItem(slot, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -130,10 +130,16 @@ public class WitherAssembler extends SlimefunItem {
|
|||||||
BlockMenu inv = BlockStorage.getInventory(b);
|
BlockMenu inv = BlockStorage.getInventory(b);
|
||||||
if (inv != null) {
|
if (inv != null) {
|
||||||
for (int slot: getSoulSandSlots()) {
|
for (int slot: getSoulSandSlots()) {
|
||||||
if (inv.getItemInSlot(slot) != null) b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
if (inv.getItemInSlot(slot) != null) {
|
||||||
|
b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
||||||
|
inv.replaceExistingItem(slot, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for (int slot: getWitherSkullSlots()) {
|
for (int slot: getWitherSkullSlots()) {
|
||||||
if (inv.getItemInSlot(slot) != null) b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
if (inv.getItemInSlot(slot) != null) {
|
||||||
|
b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
||||||
|
inv.replaceExistingItem(slot, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -69,8 +69,14 @@ public class XPCollector extends SlimefunItem {
|
|||||||
@Override
|
@Override
|
||||||
public boolean onBreak(Player p, Block b, SlimefunItem item, UnregisterReason reason) {
|
public boolean onBreak(Player p, Block b, SlimefunItem item, UnregisterReason reason) {
|
||||||
me.mrCookieSlime.Slimefun.holograms.XPCollector.getArmorStand(b).remove();
|
me.mrCookieSlime.Slimefun.holograms.XPCollector.getArmorStand(b).remove();
|
||||||
for (int slot: getOutputSlots()) {
|
BlockMenu inv = BlockStorage.getInventory(b);
|
||||||
if (BlockStorage.getInventory(b).getItemInSlot(slot) != null) b.getWorld().dropItemNaturally(b.getLocation(), BlockStorage.getInventory(b).getItemInSlot(slot));
|
if (inv != null) {
|
||||||
|
for (int slot: getOutputSlots()) {
|
||||||
|
if (inv.getItemInSlot(slot) != null) {
|
||||||
|
b.getWorld().dropItemNaturally(b.getLocation(), inv.getItemInSlot(slot));
|
||||||
|
inv.replaceExistingItem(slot, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user