mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-18 11:19:28 +00:00
Use block and item registries instead of using delegate directly
allows compatibility with older Forge
This commit is contained in:
1 parent
8eb4afc464
commit
56c06ab6ed
2 files changed
+6
-3
No files matched your search
@@ -22,6 +22,8 @@ import net.minecraft.util.StatCollector;
|
||||
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameData;
|
||||
|
||||
import forestry.api.storage.IBackpackDefinition;
|
||||
|
||||
public class BackpackDefinition implements IBackpackDefinition {
|
||||
@@ -88,7 +90,7 @@ public class BackpackDefinition implements IBackpackDefinition {
|
||||
return;
|
||||
}
|
||||
|
||||
String itemStackString = item.delegate.name();
|
||||
String itemStackString = GameData.getItemRegistry().getNameForObject(item);
|
||||
|
||||
int meta = validItem.getItemDamage();
|
||||
if (meta != OreDictionary.WILDCARD_VALUE) {
|
||||
@@ -174,7 +176,7 @@ public class BackpackDefinition implements IBackpackDefinition {
|
||||
return false;
|
||||
}
|
||||
|
||||
String itemStackStringWild = item.delegate.name();
|
||||
String itemStackStringWild = GameData.getItemRegistry().getNameForObject(item);
|
||||
if (validItemStacks.contains(itemStackStringWild)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user