Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Snowman/Iron Golem Spawn Eggs conditionally #509

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@

dependencies {
api('com.github.GTNewHorizons:CodeChickenCore:1.3.6:dev')
compileOnly('com.github.GTNewHorizons:Hodgepodge:2.5.39-pre:dev') // TODO: change to proper tag and adjust ItemInfo.addSpawnEggs()
shadowImplementation('org.apache.commons:commons-csv:1.10.0')
}
11 changes: 10 additions & 1 deletion src/main/java/codechicken/nei/api/ItemInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import net.minecraftforge.oredict.OreDictionary;

import com.google.common.collect.ArrayListMultimap;
import com.mitchej123.hodgepodge.config.TweaksConfig;

import codechicken.core.featurehack.GameDataManipulator;
import codechicken.nei.InfiniteStackSizeHandler;
Expand All @@ -64,9 +65,11 @@
import codechicken.nei.search.OreDictionaryFilter;
import codechicken.nei.search.TooltipFilter;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.ModContainer;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.GameRegistry.UniqueIdentifier;
import cpw.mods.fml.common.versioning.DefaultArtifactVersion;

/**
* This is an internal class for storing information about items, to be accessed by the API
Expand Down Expand Up @@ -211,7 +214,7 @@ public String[] header() {
public String[] dump(Block block, int id, String name) {
final Item item = Item.getItemFromBlock(block);
return new String[] { name, Integer.toString(id), Boolean.toString(item != null),
ItemInfo.itemOwners.get(block), block.getClass().getCanonicalName(),
ItemInfo.itemOwners.get(item), block.getClass().getCanonicalName(),
item != null ? EnumChatFormatting.getTextWithoutFormattingCodes(
GuiContainerManager.itemDisplayNameShort(new ItemStack(item))) : "null" };
}
Expand Down Expand Up @@ -458,6 +461,12 @@ else if (item == Items.fishing_rod || item == Items.flint_and_steel || item == I
}

private static void addSpawnEggs() {
if (Loader.isModLoaded("hodgepodge")
&& Loader.instance().getIndexedModList().get("hodgepodge").getProcessedVersion()
.compareTo(new DefaultArtifactVersion("2.5.44")) >= 0
&& TweaksConfig.addModEntityStats) {
return;
}
addEntityEgg(EntitySnowman.class, 0xEEFFFF, 0xffa221);
addEntityEgg(EntityIronGolem.class, 0xC5C2C1, 0xffe1cc);
}
Expand Down
Loading