mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-25 22:34:33 +00:00
Fix crash with BoP integration
This commit is contained in:
1 parent
9af235cc3b
commit
99646e8656
2 files changed
+12
-2
No files matched your search
@@ -76,8 +76,13 @@ public abstract class ItemStackUtil {
|
||||
*
|
||||
* @return The registry name of the item as {@link String}
|
||||
*/
|
||||
@Nullable
|
||||
public static String getItemNameFromRegistryAsString(Item item) {
|
||||
return getItemNameFromRegistry(item).toString();
|
||||
ResourceLocation itemNameFromRegistry = getItemNameFromRegistry(item);
|
||||
if (itemNameFromRegistry == null) {
|
||||
return null;
|
||||
}
|
||||
return itemNameFromRegistry.toString();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -92,6 +97,9 @@ public abstract class ItemStackUtil {
|
||||
}
|
||||
|
||||
String itemStackString = getItemNameFromRegistryAsString(item);
|
||||
if (itemStackString == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
int meta = itemStack.getItemDamage();
|
||||
if (meta != OreDictionary.WILDCARD_VALUE) {
|
||||
|
||||
@@ -105,7 +105,9 @@ public class PluginBiomesOPlenty extends BlankForestryPlugin {
|
||||
for (String key : saplingItemKeys) {
|
||||
Item saplingItem = GameRegistry.findItem(BoP, key);
|
||||
String saplingName = ItemStackUtil.getItemNameFromRegistryAsString(saplingItem);
|
||||
FMLInterModComms.sendMessage(Constants.MOD_ID, "add-farmable-sapling", String.format("farmArboreal@%s.-1", saplingName));
|
||||
if (saplingName != null) {
|
||||
FMLInterModComms.sendMessage(Constants.MOD_ID, "add-farmable-sapling", String.format("farmArboreal@%s.-1", saplingName));
|
||||
}
|
||||
}
|
||||
|
||||
if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.FARMING) && saplings != null && persimmon != null) {
|
||||
|
||||
Reference in new issue
Block a user