mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-19 11:49:14 +00:00
Cleanup
This commit is contained in:
1 parent
26ff21f446
commit
2f6969e141
14 files changed
+2
-120
No files matched your search
@@ -311,7 +311,6 @@ public abstract class TileForestry extends TileEntity implements INetworkedEntit
|
||||
/* NAME */
|
||||
/**
|
||||
* Gets the tile's unlocalized name, based on the block at the location of this entity (client-only).
|
||||
* @return
|
||||
*/
|
||||
public String getUnlocalizedName() {
|
||||
String blockUnlocalizedName = getBlockType().getUnlocalizedName().replace("tile.for.", "");
|
||||
|
||||
@@ -97,7 +97,7 @@ public class GuiTextBox extends GuiTextField {
|
||||
drawRect(startX, startY, startX + this.width, startY + this.height, -16777216);
|
||||
}
|
||||
|
||||
int textColour = isFocused() ? this.enabledColor : this.disabledColor;
|
||||
int textColour = isFocused() ? enabledColor : disabledColor;
|
||||
|
||||
drawScrolledSplitString(getCursoredText(), startX + 2, startY + 2, width - 4, textColour);
|
||||
}
|
||||
|
||||
@@ -37,8 +37,6 @@ public class LedgerManager {
|
||||
|
||||
/**
|
||||
* Inserts a ledger into the next-to-last position.
|
||||
*
|
||||
* @param ledger
|
||||
*/
|
||||
public void insert(Ledger ledger) {
|
||||
this.ledgers.add(ledgers.size() - 1, ledger);
|
||||
|
||||
@@ -250,9 +250,6 @@ public abstract class InvTools {
|
||||
|
||||
/**
|
||||
* Counts the number of items.
|
||||
*
|
||||
* @param inv
|
||||
* @return
|
||||
*/
|
||||
public static int countItems(IInventory inv) {
|
||||
int count = 0;
|
||||
@@ -290,10 +287,6 @@ public abstract class InvTools {
|
||||
* Counts the number of items that match the filter. Ignores
|
||||
* ISpecialInventory and ISidedInventory, and bypasses InventoryMapper to
|
||||
* count from the base IInventory.
|
||||
*
|
||||
* @param inv
|
||||
* @param filters
|
||||
* @return
|
||||
*/
|
||||
public static int countItems(IInventory inv, ItemStack... filters) {
|
||||
if (inv instanceof InventoryMapper)
|
||||
@@ -369,9 +362,6 @@ public abstract class InvTools {
|
||||
|
||||
/**
|
||||
* Attempts to move a single item from one inventory to another.
|
||||
*
|
||||
* @param source
|
||||
* @param dest
|
||||
* @return null if nothing was moved, the stack moved otherwise
|
||||
*/
|
||||
public static ItemStack moveOneItem(IInventory source, IInventory dest) {
|
||||
@@ -380,9 +370,6 @@ public abstract class InvTools {
|
||||
|
||||
/**
|
||||
* Attempts to move a single item from one inventory to another.
|
||||
*
|
||||
* @param source
|
||||
* @param dest
|
||||
* @param filters an ItemStack[] to match against
|
||||
* @return null if nothing was moved, the stack moved otherwise
|
||||
*/
|
||||
@@ -392,9 +379,6 @@ public abstract class InvTools {
|
||||
|
||||
/**
|
||||
* Attempts to move a single item from one inventory to another.
|
||||
*
|
||||
* @param source
|
||||
* @param dest
|
||||
* @param filter an IItemType to match against
|
||||
* @return null if nothing was moved, the stack moved otherwise
|
||||
*/
|
||||
@@ -405,11 +389,6 @@ public abstract class InvTools {
|
||||
|
||||
/**
|
||||
* Attempts to move one item from a collection of inventories.
|
||||
*
|
||||
* @param sources
|
||||
* @param dest
|
||||
* @param filters
|
||||
* @return
|
||||
*/
|
||||
public static ItemStack moveOneItem(Iterable<IInventory> sources, IInventory dest, ItemStack... filters) {
|
||||
for (IInventory inv : sources) {
|
||||
@@ -422,11 +401,6 @@ public abstract class InvTools {
|
||||
|
||||
/**
|
||||
* Attempts to move one item from a collection of inventories.
|
||||
*
|
||||
* @param sources
|
||||
* @param dest
|
||||
* @param filter
|
||||
* @return
|
||||
*/
|
||||
public static ItemStack moveOneItem(Iterable<IInventory> sources, IInventory dest, IStackFilter filter) {
|
||||
for (IInventory inv : sources) {
|
||||
@@ -439,11 +413,6 @@ public abstract class InvTools {
|
||||
|
||||
/**
|
||||
* Attempts to move one item to a collection of inventories.
|
||||
*
|
||||
* @param source
|
||||
* @param destinations
|
||||
* @param filters
|
||||
* @return
|
||||
*/
|
||||
public static ItemStack moveOneItem(IInventory source, Iterable<IInventory> destinations, ItemStack... filters) {
|
||||
for (IInventory dest : destinations) {
|
||||
@@ -459,8 +428,6 @@ public abstract class InvTools {
|
||||
*
|
||||
* Will not move any items in the filter.
|
||||
*
|
||||
* @param source
|
||||
* @param dest
|
||||
* @param filters an ItemStack[] to exclude
|
||||
* @return null if nothing was moved, the stack moved otherwise
|
||||
*/
|
||||
@@ -470,11 +437,6 @@ public abstract class InvTools {
|
||||
|
||||
/**
|
||||
* Attempts to move one item from a collection of inventories.
|
||||
*
|
||||
* @param sources
|
||||
* @param dest
|
||||
* @param filters
|
||||
* @return
|
||||
*/
|
||||
public static ItemStack moveOneItemExcept(Iterable<IInventory> sources, IInventory dest, ItemStack... filters) {
|
||||
for (IInventory inv : sources) {
|
||||
@@ -487,11 +449,6 @@ public abstract class InvTools {
|
||||
|
||||
/**
|
||||
* Attempts to move one item to a collection of inventories.
|
||||
*
|
||||
* @param source
|
||||
* @param destinations
|
||||
* @param filters
|
||||
* @return
|
||||
*/
|
||||
public static ItemStack moveOneItemExcept(IInventory source, Iterable<IInventory> destinations, ItemStack... filters) {
|
||||
for (IInventory dest : destinations) {
|
||||
@@ -610,10 +567,6 @@ public abstract class InvTools {
|
||||
|
||||
/**
|
||||
* Returns true if the item is equal to any one of several possible matches.
|
||||
*
|
||||
* @param stack
|
||||
* @param matches
|
||||
* @return
|
||||
*/
|
||||
public static boolean isItemEqual(ItemStack stack, ItemStack... matches) {
|
||||
for (ItemStack match : matches) {
|
||||
@@ -625,10 +578,6 @@ public abstract class InvTools {
|
||||
|
||||
/**
|
||||
* Returns true if the item is equal to any one of several possible matches.
|
||||
*
|
||||
* @param stack
|
||||
* @param matches
|
||||
* @return
|
||||
*/
|
||||
public static boolean isItemEqual(ItemStack stack, Collection<ItemStack> matches) {
|
||||
for (ItemStack match : matches) {
|
||||
@@ -704,10 +653,6 @@ public abstract class InvTools {
|
||||
/**
|
||||
* Removes a up to numItems worth of items from the inventory, not caring
|
||||
* about what the items are.
|
||||
*
|
||||
* @param inv
|
||||
* @param numItems
|
||||
* @return
|
||||
*/
|
||||
public static ItemStack[] removeItems(IInventory inv, int numItems) {
|
||||
PlainInventory output = new PlainInventory(27, "temp");
|
||||
|
||||
@@ -113,12 +113,6 @@ public class InventoryAdapter implements IInventory, ISidedInventory, INBTTagabl
|
||||
|
||||
/**
|
||||
* Tries to add a stack to the specified slot range.
|
||||
*
|
||||
* @param stack
|
||||
* @param startSlot
|
||||
* @param slots
|
||||
* @param all
|
||||
* @return
|
||||
*/
|
||||
public boolean tryAddStack(ItemStack stack, int startSlot, int slots, boolean all) {
|
||||
return tryAddStack(stack, startSlot, slots, all, true);
|
||||
@@ -237,15 +231,6 @@ public class InventoryAdapter implements IInventory, ISidedInventory, INBTTagabl
|
||||
* Removes the exact items first if they exist, and then removes crafting equivalents.
|
||||
* If the inventory doesn't have all the required items, returns false without removing anything.
|
||||
* If stowContainer is true, items with containers will have their container stowed.
|
||||
* @param count
|
||||
* @param set
|
||||
* @param firstSlotIndex
|
||||
* @param slotCount
|
||||
* @param player
|
||||
* @param stowContainer
|
||||
* @param oreDictionary
|
||||
* @param craftingTools
|
||||
* @return
|
||||
*/
|
||||
public boolean removeSets(int count, ItemStack[] set, int firstSlotIndex, int slotCount, EntityPlayer player, boolean stowContainer, boolean oreDictionary, boolean craftingTools) {
|
||||
|
||||
|
||||
@@ -48,8 +48,6 @@ public class InventoryManipulator {
|
||||
|
||||
/**
|
||||
* Attempt to add the stack to the inventory.
|
||||
*
|
||||
* @param stack
|
||||
* @return The remainder
|
||||
*/
|
||||
public ItemStack addStack(ItemStack stack) {
|
||||
@@ -103,10 +101,7 @@ public class InventoryManipulator {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param slot
|
||||
* @param stack
|
||||
* @param available Amount we can move
|
||||
* @param doAdd
|
||||
* @return Return the number of items moved.
|
||||
*/
|
||||
private int addToSlot(IInvSlot slot, ItemStack stack, int available, boolean doAdd) {
|
||||
|
||||
@@ -167,7 +167,6 @@ public class ShapedRecipeCustom implements IDescriptiveRecipe {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param resource
|
||||
* @return true if resource is a valid ingredient in this recipe.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
|
||||
@@ -33,10 +33,6 @@ public class StackUtils {
|
||||
|
||||
/**
|
||||
* Compares item id, damage and NBT. Accepts wildcard damage.
|
||||
*
|
||||
* @param lhs
|
||||
* @param rhs
|
||||
* @return
|
||||
*/
|
||||
public static boolean isIdenticalItem(ItemStack lhs, ItemStack rhs) {
|
||||
if (lhs == null || rhs == null)
|
||||
@@ -150,9 +146,6 @@ public class StackUtils {
|
||||
|
||||
/**
|
||||
* Merges the giving stack into the receiving stack as far as possible
|
||||
*
|
||||
* @param giver
|
||||
* @param receptor
|
||||
*/
|
||||
public static void mergeStacks(ItemStack giver, ItemStack receptor) {
|
||||
if (receptor.stackSize >= 64)
|
||||
@@ -200,11 +193,7 @@ public class StackUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param stacks
|
||||
* @param maxCountedPerStack The maximum stacksize counted in a single
|
||||
* stack. -1 for unlimited.
|
||||
* @return
|
||||
* @param maxCountedPerStack The maximum stacksize counted in a single stack. -1 for unlimited.
|
||||
*/
|
||||
public static ItemStack[] condenseStacks(ItemStack[] stacks, int maxCountedPerStack, boolean craftingEquivalency) {
|
||||
ArrayList<ItemStack> condensed = new ArrayList<ItemStack>();
|
||||
@@ -238,10 +227,6 @@ public class StackUtils {
|
||||
|
||||
/**
|
||||
* Counts how many full sets are contained in the passed stock
|
||||
*
|
||||
* @param set
|
||||
* @param stock
|
||||
* @return
|
||||
*/
|
||||
public static int containsSets(ItemStack[] set, ItemStack[] stock) {
|
||||
return containsSets(set, stock, false, false);
|
||||
@@ -249,10 +234,6 @@ public class StackUtils {
|
||||
|
||||
/**
|
||||
* Counts how many full sets are contained in the passed stock
|
||||
*
|
||||
* @param set
|
||||
* @param stock
|
||||
* @return
|
||||
*/
|
||||
public static int containsSets(ItemStack[] set, ItemStack[] stock, boolean oreDictionary, boolean craftingTools) {
|
||||
int count = 0;
|
||||
@@ -307,11 +288,6 @@ public class StackUtils {
|
||||
|
||||
/**
|
||||
* Compare two item stacks for crafting equivalency.
|
||||
*
|
||||
* @param base
|
||||
* @param comparison
|
||||
* @param oreDictionary
|
||||
* @return
|
||||
*/
|
||||
public static boolean isCraftingEquivalent(ItemStack base, ItemStack comparison, boolean oreDictionary, boolean craftingTools) {
|
||||
if (isCraftingEquivalent(base, comparison))
|
||||
|
||||
@@ -87,9 +87,6 @@ public class MachineBottler extends TilePowered implements ISidedInventory, ILiq
|
||||
public static final ArrayList<MachineBottler.Recipe> recipes = new ArrayList<MachineBottler.Recipe>();
|
||||
|
||||
/**
|
||||
*
|
||||
* @param res
|
||||
* @param empty
|
||||
* @return Recipe matching both res and empty, null if none
|
||||
*/
|
||||
public static Recipe findMatchingRecipe(FluidStack res, ItemStack empty) {
|
||||
@@ -116,8 +113,6 @@ public class MachineBottler extends TilePowered implements ISidedInventory, ILiq
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param res
|
||||
* @return true if any recipe has a matching input
|
||||
*/
|
||||
public static boolean isInput(FluidStack res) {
|
||||
@@ -228,7 +223,6 @@ public class MachineBottler extends TilePowered implements ISidedInventory, ILiq
|
||||
|
||||
if (energyManager.getTotalEnergyStored() == 0) {
|
||||
setErrorState(EnumErrorCode.NOPOWER);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -210,7 +210,6 @@ public class MachineCentrifuge extends TilePowered implements ISidedInventory {
|
||||
|
||||
if (energyManager.getTotalEnergyStored() == 0) {
|
||||
setErrorState(EnumErrorCode.NOPOWER);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -357,9 +357,6 @@ public class MachineFermenter extends TilePowered implements ISidedInventory, IL
|
||||
|
||||
/**
|
||||
* Returns the burnTime an item of the passed ItemStack provides
|
||||
*
|
||||
* @param item
|
||||
* @return
|
||||
*/
|
||||
private int determineFuelValue(ItemStack item) {
|
||||
if (item == null)
|
||||
|
||||
@@ -242,7 +242,6 @@ public class MachineSqueezer extends TilePowered implements ISidedInventory, ILi
|
||||
|
||||
if (energyManager.getTotalEnergyStored() == 0) {
|
||||
setErrorState(EnumErrorCode.NOPOWER);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -188,7 +188,6 @@ public class MachineStill extends TilePowered implements ISidedInventory, ILiqui
|
||||
|
||||
if (energyManager.getTotalEnergyStored() == 0) {
|
||||
setErrorState(EnumErrorCode.NOPOWER);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -57,9 +57,6 @@ public class PickupHandlerStorage implements IPickupHandler {
|
||||
/**
|
||||
* This tops off existing stacks in the player's inventory. That way you can keep f.e. a stack of dirt or cobblestone in your inventory which gets refreshed
|
||||
* constantly by picked up items.
|
||||
*
|
||||
* @param player
|
||||
* @param itemstack
|
||||
*/
|
||||
private void topOffPlayerInventory(EntityPlayer player, ItemStack itemstack) {
|
||||
|
||||
|
||||
Reference in new issue
Block a user