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 a config toggle for showing JEI info for the capturing enchantment #1374

Merged
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public class SpawnerModule {
public static int spawnerSilkLevel = 1;
public static int spawnerSilkDamage = 100;
public static Set<ResourceLocation> bannedMobs = new HashSet<>();
public static boolean enableCapturingEnchantmentJeiInfo = true;

@SubscribeEvent
public void setup(FMLCommonSetupEvent e) {
Expand Down Expand Up @@ -150,6 +151,7 @@ public void reload(ApotheosisReloadEvent e) {
SpawnerModule.LOG.error("Invalid entry {} detected in the spawner banned mobs list.", s);
ex.printStackTrace();
}
enableCapturingEnchantmentJeiInfo = config.getBoolean("Enable Capturing Enchantment JEI Info", "general", true, "Whether to show info regarding the capturing enchantment in the JEI information for spawn eggs.");
if (e == null && config.hasChanged()) config.save();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,11 @@ else if (SpawnerModule.spawnerSilkLevel == 0) {
}
else reg.addIngredientInfo(new ItemStack(Blocks.SPAWNER), VanillaTypes.ITEM_STACK,
Component.translatable("info.apotheosis.spawner", ((MutableComponent) Enchantments.SILK_TOUCH.getFullname(SpawnerModule.spawnerSilkLevel)).withStyle(ChatFormatting.DARK_BLUE).getString()));
for (Item i : ForgeRegistries.ITEMS) {
if (i instanceof SpawnEggItem) reg.addIngredientInfo(new ItemStack(i), VanillaTypes.ITEM_STACK, Component.translatable("info.apotheosis.capturing"));
if (SpawnerModule.enableCapturingEnchantmentJeiInfo) {
for (Item i : ForgeRegistries.ITEMS) {
if (i instanceof SpawnEggItem)
reg.addIngredientInfo(new ItemStack(i), VanillaTypes.ITEM_STACK, Component.translatable("info.apotheosis.capturing"));
}
}
}

Expand Down