Skip to content

Commit

Permalink
Reorder checks in InventoryManager.isInventoryValid() alphabetically
Browse files Browse the repository at this point in the history
  • Loading branch information
SCP002 committed Jun 24, 2018
1 parent e8ff1d5 commit a6dd50b
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/main/java/scp002/mod/dropoff/inventory/InventoryManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,6 @@ int getMaxAllowedStackSize(IInventory inventory, ItemStack stack) {
private boolean isInventoryValid(InventoryData inventoryData) {
TileEntity entity = inventoryData.getEntities().get(0);

if (entity instanceof TileEntityEnderChest) {
return DropOffConfig.INSTANCE.checkEnderChests;
}

if (entity instanceof TileEntityFurnace) {
return DropOffConfig.INSTANCE.checkFurnaces;
}

if (entity instanceof TileEntityBeacon) {
return DropOffConfig.INSTANCE.checkBeacons;
}
Expand All @@ -145,14 +137,6 @@ private boolean isInventoryValid(InventoryData inventoryData) {
return DropOffConfig.INSTANCE.checkChests;
}

if (entity instanceof TileEntityHopper) {
return DropOffConfig.INSTANCE.checkHoppers;
}

if (entity instanceof TileEntityShulkerBox) {
return DropOffConfig.INSTANCE.checkShulkerBoxes;
}

if (entity instanceof TileEntityDispenser) {
if (entity instanceof TileEntityDropper) {
return DropOffConfig.INSTANCE.checkDroppers;
Expand All @@ -161,6 +145,22 @@ private boolean isInventoryValid(InventoryData inventoryData) {
return DropOffConfig.INSTANCE.checkDispensers;
}

if (entity instanceof TileEntityEnderChest) {
return DropOffConfig.INSTANCE.checkEnderChests;
}

if (entity instanceof TileEntityFurnace) {
return DropOffConfig.INSTANCE.checkFurnaces;
}

if (entity instanceof TileEntityHopper) {
return DropOffConfig.INSTANCE.checkHoppers;
}

if (entity instanceof TileEntityShulkerBox) {
return DropOffConfig.INSTANCE.checkShulkerBoxes;
}

String inventoryName = getItemStackName(inventoryData.getInventory());

return isInventoryNameValid(inventoryName) || DropOffConfig.INSTANCE.dropOffEveryPlace;
Expand Down

0 comments on commit a6dd50b

Please sign in to comment.