1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00

Merge pull request #545 from Poslovitch/master

Small performance improvement in CargoManager
This commit is contained in:
TheBusyBiscuit 2017-12-21 15:04:12 +01:00 committed by GitHub
commit 03924d2a0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,6 +3,7 @@ package me.mrCookieSlime.Slimefun.api.item_transport;
import java.util.ArrayList;
import java.util.List;
import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem;
import me.mrCookieSlime.Slimefun.Setup.SlimefunManager;
import me.mrCookieSlime.Slimefun.Setup.SlimefunManager.DataType;
@ -194,11 +195,13 @@ public class CargoManager {
String id = BlockStorage.checkID(block);
if (id.equals("CARGO_NODE_OUTPUT")) return true;
Config blockInfo = BlockStorage.getBlockInfo(block); // Store the returned Config instance to avoid heavy calls
BlockMenu menu = BlockStorage.getInventory(block.getLocation());
boolean lore = BlockStorage.getBlockInfo(block, "filter-lore").equals("true");
boolean data = BlockStorage.getBlockInfo(block, "filter-durability").equals("true");
boolean lore = blockInfo.getString("filter-lore").equals("true");
boolean data = blockInfo.getString("filter-durability").equals("true");
if (BlockStorage.getBlockInfo(block, "filter-type").equals("whitelist")) {
if (blockInfo.getString("filter-type").equals("whitelist")) {
List<ItemStack> items = new ArrayList<ItemStack>();
for (int slot: slots) {
ItemStack template = menu.getItemInSlot(slot);