1
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:
VoidAngel 2018-04-29 10:27:40 -07:00
commit f9ab6492ee
16 changed files with 170 additions and 44 deletions

View File

@ -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"));
if (allow) {
if (BlockStorage.getInventory(b).getItemInSlot(43) != null) b.getWorld().dropItemNaturally(b.getLocation(), BlockStorage.getInventory(b).getItemInSlot(43));
for (int slot: getOutputSlots()) {
if (BlockStorage.getInventory(b).getItemInSlot(slot) != null) b.getWorld().dropItemNaturally(b.getLocation(), BlockStorage.getInventory(b).getItemInSlot(slot));
BlockMenu inv = BlockStorage.getInventory(b);
if (inv != null) {
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);
}

View File

@ -84,10 +84,16 @@ public abstract class AContainer extends SlimefunItem {
BlockMenu inv = BlockStorage.getInventory(b);
if (inv != null) {
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()) {
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);
@ -134,11 +140,20 @@ public abstract class AContainer extends SlimefunItem {
@Override
public boolean onBreak(Player p, Block b, SlimefunItem item, UnregisterReason reason) {
for (int slot: getInputSlots()) {
if (BlockStorage.getInventory(b).getItemInSlot(slot) != null) b.getWorld().dropItemNaturally(b.getLocation(), BlockStorage.getInventory(b).getItemInSlot(slot));
}
for (int slot: getOutputSlots()) {
if (BlockStorage.getInventory(b).getItemInSlot(slot) != null) b.getWorld().dropItemNaturally(b.getLocation(), BlockStorage.getInventory(b).getItemInSlot(slot));
BlockMenu inv = BlockStorage.getInventory(b);
if (inv != null) {
for (int slot: getInputSlots()) {
if (inv.getItemInSlot(slot) != null) {
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);
progress.remove(b);

View File

@ -68,8 +68,14 @@ public abstract class AFarm extends SlimefunItem {
@Override
public boolean onBreak(Player p, Block b, SlimefunItem item, UnregisterReason reason) {
for (int slot: getOutputSlots()) {
if (BlockStorage.getInventory(b).getItemInSlot(slot) != null) b.getWorld().dropItemNaturally(b.getLocation(), BlockStorage.getInventory(b).getItemInSlot(slot));
BlockMenu inv = BlockStorage.getInventory(b);
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;
}
@ -111,8 +117,14 @@ public abstract class AFarm extends SlimefunItem {
@Override
public boolean onBreak(Player p, Block b, SlimefunItem item, UnregisterReason reason) {
for (int slot: getOutputSlots()) {
if (BlockStorage.getInventory(b).getItemInSlot(slot) != null) b.getWorld().dropItemNaturally(b.getLocation(), BlockStorage.getInventory(b).getItemInSlot(slot));
BlockMenu inv = BlockStorage.getInventory(b);
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;
}

View File

@ -88,10 +88,16 @@ public abstract class AGenerator extends SlimefunItem {
BlockMenu inv = BlockStorage.getInventory(b);
if (inv != null) {
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()) {
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());
@ -141,10 +147,16 @@ public abstract class AGenerator extends SlimefunItem {
BlockMenu inv = BlockStorage.getInventory(b);
if (inv != null) {
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()) {
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());

View File

@ -134,13 +134,22 @@ public abstract class AReactor extends SlimefunItem {
BlockMenu inv = BlockStorage.getInventory(b);
if (inv != null) {
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()) {
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()) {
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());

View File

@ -210,8 +210,14 @@ public class AdvancedCargoOutputNode extends SlimefunItem {
@Override
public boolean onBreak(Player p, Block b, SlimefunItem item, UnregisterReason reason) {
for (int slot: getInputSlots()) {
if (BlockStorage.getInventory(b).getItemInSlot(slot) != null) b.getWorld().dropItemNaturally(b.getLocation(), BlockStorage.getInventory(b).getItemInSlot(slot));
BlockMenu inv = BlockStorage.getInventory(b);
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;
}

View File

@ -70,8 +70,14 @@ public class AnimalGrowthAccelerator extends SlimefunItem {
@Override
public boolean onBreak(Player p, Block b, SlimefunItem item, UnregisterReason reason) {
me.mrCookieSlime.Slimefun.holograms.AnimalGrowthAccelerator.getArmorStand(b).remove();
for (int slot: getInputSlots()) {
if (BlockStorage.getInventory(b).getItemInSlot(slot) != null) b.getWorld().dropItemNaturally(b.getLocation(), BlockStorage.getInventory(b).getItemInSlot(slot));
BlockMenu inv = BlockStorage.getInventory(b);
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;
}

View File

@ -70,8 +70,14 @@ public class AutoBreeder extends SlimefunItem {
@Override
public boolean onBreak(Player p, Block b, SlimefunItem item, UnregisterReason reason) {
me.mrCookieSlime.Slimefun.holograms.AutoBreeder.getArmorStand(b).remove();
for (int slot: getInputSlots()) {
if (BlockStorage.getInventory(b).getItemInSlot(slot) != null) b.getWorld().dropItemNaturally(b.getLocation(), BlockStorage.getInventory(b).getItemInSlot(slot));
BlockMenu inv = BlockStorage.getInventory(b);
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;
}

View File

@ -119,10 +119,16 @@ public abstract class AutomatedCraftingChamber extends SlimefunItem {
BlockMenu inv = BlockStorage.getInventory(b);
if (inv != null) {
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()) {
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;

View File

@ -105,8 +105,14 @@ public class CargoCraftingNode extends SlimefunItem {
@Override
public boolean onBreak(Player p, Block b, SlimefunItem item, UnregisterReason reason) {
for (int slot: getInputSlots()) {
if (BlockStorage.getInventory(b).getItemInSlot(slot) != null) b.getWorld().dropItemNaturally(b.getLocation(), BlockStorage.getInventory(b).getItemInSlot(slot));
BlockMenu inv = BlockStorage.getInventory(b);
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;
}

View File

@ -236,8 +236,14 @@ public class CargoInputNode extends SlimefunItem {
@Override
public boolean onBreak(Player p, Block b, SlimefunItem item, UnregisterReason reason) {
for (int slot: getInputSlots()) {
if (BlockStorage.getInventory(b).getItemInSlot(slot) != null) b.getWorld().dropItemNaturally(b.getLocation(), BlockStorage.getInventory(b).getItemInSlot(slot));
BlockMenu inv = BlockStorage.getInventory(b);
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;
}

View File

@ -80,8 +80,14 @@ public abstract class CropGrowthAccelerator extends SlimefunItem {
@Override
public boolean onBreak(Player p, Block b, SlimefunItem item, UnregisterReason reason) {
for (int slot: getInputSlots()) {
if (BlockStorage.getInventory(b).getItemInSlot(slot) != null) b.getWorld().dropItemNaturally(b.getLocation(), BlockStorage.getInventory(b).getItemInSlot(slot));
BlockMenu inv = BlockStorage.getInventory(b);
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;
}

View File

@ -102,10 +102,16 @@ public abstract class ElectricSmeltery extends AContainer {
BlockMenu inv = BlockStorage.getInventory(b);
if (inv != null) {
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()) {
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());

View File

@ -81,13 +81,22 @@ public class ReactorAccessPort extends SlimefunItem {
BlockMenu inv = BlockStorage.getInventory(b);
if (inv != null) {
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()) {
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()) {
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;

View File

@ -130,10 +130,16 @@ public class WitherAssembler extends SlimefunItem {
BlockMenu inv = BlockStorage.getInventory(b);
if (inv != null) {
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()) {
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;

View File

@ -69,8 +69,14 @@ public class XPCollector extends SlimefunItem {
@Override
public boolean onBreak(Player p, Block b, SlimefunItem item, UnregisterReason reason) {
me.mrCookieSlime.Slimefun.holograms.XPCollector.getArmorStand(b).remove();
for (int slot: getOutputSlots()) {
if (BlockStorage.getInventory(b).getItemInSlot(slot) != null) b.getWorld().dropItemNaturally(b.getLocation(), BlockStorage.getInventory(b).getItemInSlot(slot));
BlockMenu inv = BlockStorage.getInventory(b);
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;
}