Move constants
This commit is contained in:
@@ -9,7 +9,6 @@ import refinedstorage.api.autocrafting.ICraftingTask;
|
||||
import refinedstorage.api.network.GridPullFlags;
|
||||
import refinedstorage.api.network.IGridHandler;
|
||||
import refinedstorage.api.network.INetworkMaster;
|
||||
import refinedstorage.item.ItemWirelessGrid;
|
||||
|
||||
public class GridHandler implements IGridHandler {
|
||||
public static final int MAX_CRAFTING_PER_REQUEST = 500;
|
||||
@@ -75,7 +74,7 @@ public class GridHandler implements IGridHandler {
|
||||
player.updateHeldItem();
|
||||
}
|
||||
|
||||
network.getWirelessGridHandler().drainEnergy(player, ItemWirelessGrid.USAGE_PULL);
|
||||
network.getWirelessGridHandler().drainEnergy(player, WirelessGridHandler.USAGE_PULL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,7 +108,7 @@ public class GridHandler implements IGridHandler {
|
||||
|
||||
player.updateHeldItem();
|
||||
|
||||
network.getWirelessGridHandler().drainEnergy(player, ItemWirelessGrid.USAGE_PUSH);
|
||||
network.getWirelessGridHandler().drainEnergy(player, WirelessGridHandler.USAGE_PUSH);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -20,6 +20,10 @@ import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
public class WirelessGridHandler implements IWirelessGridHandler {
|
||||
public static final int USAGE_OPEN = 30;
|
||||
public static final int USAGE_PULL = 3;
|
||||
public static final int USAGE_PUSH = 3;
|
||||
|
||||
private INetworkMaster network;
|
||||
|
||||
private List<WirelessGridConsumer> consumers = new ArrayList<WirelessGridConsumer>();
|
||||
@@ -40,7 +44,10 @@ public class WirelessGridHandler implements IWirelessGridHandler {
|
||||
WirelessGridConsumer consumer = it.next();
|
||||
|
||||
if (!RefinedStorageUtils.compareStack(consumer.getWirelessGrid(), consumer.getPlayer().getHeldItem(consumer.getHand()))) {
|
||||
consumer.getPlayer().closeScreen(); // This will call onContainerClosed on the Container and remove it from the list
|
||||
/**
|
||||
* This will call {@link net.minecraft.inventory.Container#onContainerClosed(EntityPlayer)} so the consumer is removed from the list.
|
||||
*/
|
||||
consumer.getPlayer().closeScreen();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -59,7 +66,7 @@ public class WirelessGridHandler implements IWirelessGridHandler {
|
||||
|
||||
network.sendStorageToClient((EntityPlayerMP) player);
|
||||
|
||||
drainEnergy(player, ItemWirelessGrid.USAGE_OPEN);
|
||||
drainEnergy(player, USAGE_OPEN);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -26,10 +26,6 @@ public class ItemWirelessGrid extends ItemEnergyContainer {
|
||||
public static final int TYPE_NORMAL = 0;
|
||||
public static final int TYPE_CREATIVE = 1;
|
||||
|
||||
public static final int USAGE_OPEN = 30;
|
||||
public static final int USAGE_PULL = 3;
|
||||
public static final int USAGE_PUSH = 3;
|
||||
|
||||
public static final String NBT_SORTING_TYPE = "SortingType";
|
||||
public static final String NBT_SORTING_DIRECTION = "SortingDirection";
|
||||
public static final String NBT_SEARCH_BOX_MODE = "SearchBoxMode";
|
||||
|
||||
Reference in New Issue
Block a user