mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-25 14:34:28 +00:00
Fixes #1538 and minor performance improvements
This commit is contained in:
1 parent
6072a1e56e
commit
e658c41746
2 files changed
+6
-5
No files matched your search
@@ -2,7 +2,9 @@ package crazypants.enderio.config;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
@@ -273,7 +275,7 @@ public final class Config {
|
||||
"Railcraft:tool.steel.hoe",
|
||||
"TConstruct:mattock"
|
||||
};
|
||||
public static ItemStack[] farmHoes = new ItemStack[0];
|
||||
public static Set<ItemStack> farmHoes = new HashSet<ItemStack>();
|
||||
|
||||
public static int magnetPowerUsePerSecondRF = 1;
|
||||
public static int magnetPowerCapacityRF = 100000;
|
||||
@@ -1123,10 +1125,10 @@ public final class Config {
|
||||
}
|
||||
|
||||
public static void postInit() {
|
||||
farmHoes = new ItemStack[hoeStrings.length];
|
||||
for (int i = 0; i < Config.hoeStrings.length; i++) {
|
||||
String[] data = hoeStrings[i].split(":");
|
||||
farmHoes[i] = GameRegistry.findItemStack(data[0], data[1], 1);
|
||||
ItemStack hoe = GameRegistry.findItemStack(data[0], data[1], 1);
|
||||
if (hoe!=null) farmHoes.add(hoe);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ public class TileFarmStation extends AbstractPoweredTaskEntity {
|
||||
HOE {
|
||||
boolean match(ItemStack item) {
|
||||
for (ItemStack stack : Config.farmHoes) {
|
||||
if (stack != null && OreDictionary.itemMatches(item, stack, false)) {
|
||||
if (stack.getItem() == item.getItem()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -57,7 +57,6 @@ public class TileFarmStation extends AbstractPoweredTaskEntity {
|
||||
if (item == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return match(item);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user