mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-19 19:49:54 +00:00
Fix #933 Fix Ore Dictionary registration for Fruits
This commit is contained in:
1 parent
8824585282
commit
1f82c216a8
3 files changed
+9
-9
No files matched your search
@@ -33,7 +33,7 @@ public class ItemFruit extends ItemForestryFood {
|
||||
CHERRY("cropCherry"), WALNUT("cropWalnut"), CHESTNUT("cropChestnut"), LEMON("cropLemon"), PLUM("cropPlum"), DATES("cropDate"), PAPAYA("cropPapaya");//, COCONUT("cropCoconut");
|
||||
public static final EnumFruit[] VALUES = values();
|
||||
|
||||
final String oreDict;
|
||||
private final String oreDict;
|
||||
|
||||
EnumFruit(String oreDict) {
|
||||
this.oreDict = oreDict;
|
||||
@@ -59,19 +59,16 @@ public class ItemFruit extends ItemForestryFood {
|
||||
public ItemStack getStack(int qty) {
|
||||
return ForestryItem.fruits.getItemStack(qty, ordinal());
|
||||
}
|
||||
|
||||
public String getOreDict() {
|
||||
return oreDict;
|
||||
}
|
||||
}
|
||||
|
||||
public ItemFruit() {
|
||||
super(1, 0.2f);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
registerOreDictionary();
|
||||
}
|
||||
|
||||
private void registerOreDictionary() {
|
||||
for (EnumFruit def : EnumFruit.values()) {
|
||||
OreDictionary.registerOre(def.oreDict, new ItemStack(this, 1, def.ordinal()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -282,6 +282,9 @@ public class PluginCore extends ForestryPlugin {
|
||||
|
||||
// FRUITS
|
||||
ForestryItem.fruits.registerItem(new ItemFruit(), "fruits");
|
||||
for (ItemFruit.EnumFruit def : ItemFruit.EnumFruit.values()) {
|
||||
OreDictionary.registerOre(def.getOreDict(), def.getStack());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user