mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-19 03:49:29 +00:00
quick fix : Redundant Collection operation
This commit is contained in:
1 parent
92e46b123f
commit
e2f185ad35
4 files changed
+6
-11
No files matched your search
@@ -37,11 +37,8 @@ public class DualMaterialToolPart extends DynamicToolPart {
|
||||
|
||||
public int getMaterialID2(ItemStack stack) {
|
||||
if (!stack.hasTagCompound()) return -1;
|
||||
|
||||
int id = stack.getTagCompound().getCompoundTag("DualMat").getInteger("Material2");
|
||||
|
||||
if (TConstructRegistry.toolMaterials.keySet().contains(id)) return id;
|
||||
|
||||
if (TConstructRegistry.toolMaterials.containsKey(id)) return id;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -58,8 +58,7 @@ public class DynamicToolPart extends CraftingItem implements IToolPart {
|
||||
// item meta = material id
|
||||
@Override
|
||||
public int getMaterialID(ItemStack stack) {
|
||||
if (TConstructRegistry.toolMaterials.keySet().contains(stack.getItemDamage())) return stack.getItemDamage();
|
||||
|
||||
if (TConstructRegistry.toolMaterials.containsKey(stack.getItemDamage())) return stack.getItemDamage();
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -134,8 +134,8 @@ public class CastingChannelLogic extends TileEntity implements IFluidHandler {
|
||||
// Move Fluid to Output Tanks
|
||||
Set<ForgeDirection> connected = this.getOutputs().keySet();
|
||||
|
||||
if (connected.contains(ForgeDirection.DOWN)) connected.remove(ForgeDirection.DOWN);
|
||||
if (connected.contains(lastProvider)) connected.remove(lastProvider);
|
||||
connected.remove(ForgeDirection.DOWN);
|
||||
connected.remove(lastProvider);
|
||||
|
||||
int output = Math.min(internalTank.getFluidAmount(), outputMax);
|
||||
int connectedAmount = connected.size();
|
||||
@@ -223,7 +223,7 @@ public class CastingChannelLogic extends TileEntity implements IFluidHandler {
|
||||
*/
|
||||
|
||||
HashMap<ForgeDirection, TileEntity> connected = this.getOutputs();
|
||||
if (connected.containsKey(lastProvider)) connected.remove(lastProvider);
|
||||
connected.remove(lastProvider);
|
||||
if (connected.containsKey(ForgeDirection.DOWN)
|
||||
&& this.internalTank.getFluid() != null) // Prioritizes FluidHandlers below
|
||||
{
|
||||
|
||||
@@ -126,8 +126,7 @@ public class ToolPart extends CraftingItem implements IToolPart {
|
||||
|
||||
@Override
|
||||
public int getMaterialID(ItemStack stack) {
|
||||
if (TConstructRegistry.toolMaterials.keySet().contains(stack.getItemDamage())) return stack.getItemDamage();
|
||||
|
||||
if (TConstructRegistry.toolMaterials.containsKey(stack.getItemDamage())) return stack.getItemDamage();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user