Skip to content

Commit

Permalink
Misty World support
Browse files Browse the repository at this point in the history
  • Loading branch information
IcarussOne committed Dec 3, 2024
1 parent 406f87c commit de77214
Show file tree
Hide file tree
Showing 33 changed files with 542 additions and 23 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ ___
- Steel
- **IndustrialCraft 2 (Classic and Experimental):**
- Bronze
- **Misty World:**
- Niobium
- **Project Red Exploration:**
- Peridot
- Ruby
Expand Down
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ dependencies {
implementation rfg.deobf('curse.maven:ic2-classic-242942:5800761')
// Immersive Engineering
implementation rfg.deobf('curse.maven:immersive-engineering-231951:2974106')
// Misty World
implementation rfg.deobf('curse.maven:misty-world-unveiled-1104150:5750561')
// Mo' Creatures Extended
implementation rfg.deobf('curse.maven:mo-creatures-extended-867351:5654788')
// Patchouli
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/mod/icarus/balkonsexpansion/BEConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ public class BEConfig {
@Config.Comment("IndustrialCraft 2")
public static IC2Settings ic2_settings = new IC2Settings();

@Config.Comment("Misty World")
public static MistyWorldSettings misty_world_settings = new MistyWorldSettings();

@Config.Comment("Project Red Exploration")
public static ProjectRedSettings project_red_settings = new ProjectRedSettings();

Expand Down Expand Up @@ -84,6 +87,11 @@ public static class ModIntegrationSettings {
@Config.RequiresMcRestart
public boolean IE_INTEGRATION = true;

@Config.Name("Misty World")
@Config.Comment("Enables Misty World integration [default: true]")
@Config.RequiresMcRestart
public boolean MISTY_WORLD_INTEGRATION = true;

@Config.Name("Project Red Exploration")
@Config.Comment("Enables Project Red Exploration integration [default: true]")
@Config.RequiresMcRestart
Expand Down Expand Up @@ -157,6 +165,13 @@ public static class ImmersiveEngineeringSettings {
public boolean IE_STEEL_MATERIAL = true;
}

public static class MistyWorldSettings {
@Config.Name("Material: Niobium (Misty World)")
@Config.Comment("Enables support for the Niobium material from Misty World [default: true]")
@Config.RequiresWorldRestart
public boolean MW_NIOBIUM_MATERIAL = true;
}

public static class ProjectRedSettings {
@Config.Name("Material: Peridot (Project Red)")
@Config.Comment("Enables support for the Peridot material from Project Red [default: true]")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class BalkonsExpansion {
public static final String VERSION = Tags.VERSION;
public static final String ACCEPTED_VERSIONS = "[1.12.2]";
public static final String DEPENDENCIES = "required-after:weaponmod@[1.22.1,);after:patchouli;after:appliedenergistics2;after:betterwithmods;after:defiledlands;after:galacticraftcore;after:galacticraftplanets;" +
"after:ic2;after:immersiveengineering;after:mocreatures@[12.4.3,);after:projectred-exploration;after:railcraft;after:thaumcraft@[1.12.2-6.1.BETA26,);";
"after:ic2;after:immersiveengineering;after:mist;after:mocreatures@[12.4.3,);after:projectred-exploration;after:railcraft;after:thaumcraft@[1.12.2-6.1.BETA26,);";
public static final Logger LOGGER = LogManager.getLogger(NAME);

@Mod.Instance
Expand Down
44 changes: 24 additions & 20 deletions src/main/java/mod/icarus/balkonsexpansion/compat/CompatHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,17 @@

import mod.icarus.balkonsexpansion.BEConfig;
import mod.icarus.balkonsexpansion.BalkonsExpansion;
import mod.icarus.balkonsexpansion.compat.ae2.AE2MaterialColors;
import mod.icarus.balkonsexpansion.compat.ae2.AE2Registration;
import mod.icarus.balkonsexpansion.compat.bwm.BWMMaterialColors;
import mod.icarus.balkonsexpansion.compat.bwm.BWMRegistration;
import mod.icarus.balkonsexpansion.compat.defiledlands.DefiledLandsMaterialColors;
import mod.icarus.balkonsexpansion.compat.defiledlands.DefiledLandsRegistration;
import mod.icarus.balkonsexpansion.compat.galacticraft.GalacticraftMaterialColors;
import mod.icarus.balkonsexpansion.compat.galacticraft.GalacticraftRegistration;
import mod.icarus.balkonsexpansion.compat.ic2classic.IC2ClassicMaterialColors;
import mod.icarus.balkonsexpansion.compat.ic2classic.IC2ClassicRegistration;
import mod.icarus.balkonsexpansion.compat.ic2experimental.IC2ExperimentalMaterialColors;
import mod.icarus.balkonsexpansion.compat.ic2experimental.IC2ExperimentalRegistration;
import mod.icarus.balkonsexpansion.compat.immersiveengineering.IEMaterialColors;
import mod.icarus.balkonsexpansion.compat.immersiveengineering.IERegistration;
import mod.icarus.balkonsexpansion.compat.projectred.ProjectRedMaterialColors;
import mod.icarus.balkonsexpansion.compat.projectred.ProjectRedRegistration;
import mod.icarus.balkonsexpansion.compat.railcraft.RailcraftMaterialColors;
import mod.icarus.balkonsexpansion.compat.railcraft.RailcraftRegistration;
import mod.icarus.balkonsexpansion.compat.thaumcraft.ThaumcraftMaterialColors;
import mod.icarus.balkonsexpansion.compat.thaumcraft.ThaumcraftRegistration;
import mod.icarus.balkonsexpansion.compat.ae2.*;
import mod.icarus.balkonsexpansion.compat.bwm.*;
import mod.icarus.balkonsexpansion.compat.defiledlands.*;
import mod.icarus.balkonsexpansion.compat.galacticraft.*;
import mod.icarus.balkonsexpansion.compat.ic2classic.*;
import mod.icarus.balkonsexpansion.compat.ic2experimental.*;
import mod.icarus.balkonsexpansion.compat.immersiveengineering.*;
import mod.icarus.balkonsexpansion.compat.mistyworld.*;
import mod.icarus.balkonsexpansion.compat.projectred.*;
import mod.icarus.balkonsexpansion.compat.railcraft.*;
import mod.icarus.balkonsexpansion.compat.thaumcraft.*;
import net.minecraft.item.Item;
import net.minecraft.item.crafting.IRecipe;
import net.minecraftforge.event.RegistryEvent;
Expand Down Expand Up @@ -113,6 +104,16 @@ public static void registerItems(RegistryEvent.Register<Item> event) {
}
}

// Misty World
if (Loader.isModLoaded("mist") && BEConfig.mod_integration_settings.MISTY_WORLD_INTEGRATION) {
MistyWorldRegistration.registerItems(event);
MistyWorldMaterialColors.registerMaterialColors();

if (FMLLaunchHandler.side().isClient()) {
MistyWorldRegistration.registerRenderersItem();
}
}

// Project Red
if (Loader.isModLoaded("projectred-exploration") && BEConfig.mod_integration_settings.PROJECT_RED_INTEGRATION) {
ProjectRedRegistration.registerItems(event);
Expand Down Expand Up @@ -167,6 +168,9 @@ public static void registerRecipes(RegistryEvent.Register<IRecipe> event) {
// IndustrialCraft 2 Experimental
if (Loader.isModLoaded("ic2") && !Loader.isModLoaded("ic2-classic-spmod") && BEConfig.mod_integration_settings.IC2_INTEGRATION)
IC2ExperimentalRegistration.registerRecipes(event);
// Misty World
if (Loader.isModLoaded("mist") && BEConfig.mod_integration_settings.MISTY_WORLD_INTEGRATION)
MistyWorldRegistration.registerRecipes(event);
// Project Red
if (Loader.isModLoaded("projectred-exploration") && BEConfig.mod_integration_settings.PROJECT_RED_INTEGRATION)
ProjectRedRegistration.registerRecipes(event);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package mod.icarus.balkonsexpansion.compat.defiledlands;

import mods.railcraft.common.items.RailcraftItems;
import lykrast.defiledlands.common.init.ModItems;
import mod.icarus.balkonsexpansion.BEConfig;
import mod.icarus.balkonsexpansion.BEItemBuilder;
Expand All @@ -9,7 +8,6 @@
import mod.icarus.balkonsexpansion.item.BEItemFlail;
import mod.icarus.balkonsexpansion.item.BEItemMelee;
import mod.icarus.balkonsexpansion.item.BEItemMusket;
import mods.railcraft.common.items.ItemMaterials;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package mod.icarus.balkonsexpansion.compat.mistyworld;

import ckathode.weaponmod.entity.projectile.ICustomProjectileMaterials;
import ckathode.weaponmod.entity.projectile.MaterialRegistry;
import ckathode.weaponmod.item.IItemWeapon;
import net.minecraft.item.ItemStack;
import ru.liahim.mist.init.ModItems;

// Some entities of BWM: Legacy such as flails can change their color, which is what this is used for.
public class MistyWorldMaterialColors {
public static final int MATERIAL_NIOBIUM = ModItems.NIOBIUM_TOOLS.ordinal();

public static void registerMaterialColors() {
MaterialRegistry.registerCustomProjectileMaterial(new ICustomProjectileMaterials() {
@Override
public int[] getAllMaterialIDs() {
return new int[]{MATERIAL_NIOBIUM};
}

@Override
public int getMaterialID(ItemStack itemStack) {
if (itemStack != null && itemStack.getItem() instanceof IItemWeapon) {
IItemWeapon weapon = ((IItemWeapon) itemStack.getItem());

if (weapon.getMeleeComponent() != null) {
if (weapon.getMeleeComponent().weaponMaterial == ModItems.NIOBIUM_TOOLS)
return MATERIAL_NIOBIUM;
}
}

return -1;
}

@Override
public float[] getColorFromMaterialID(int i) {
// The color for the given item tier must be returned as
// {R,G,B}, where MATERIAL_UMBRIUM value is between 0 and 1.
if (i == MATERIAL_NIOBIUM) return new float[]{0.702F, 0.722F, 0.812F};

return null;
}
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
package mod.icarus.balkonsexpansion.compat.mistyworld;

import mod.icarus.balkonsexpansion.BEConfig;
import mod.icarus.balkonsexpansion.BEItemBuilder;
import mod.icarus.balkonsexpansion.BERecipes;
import mod.icarus.balkonsexpansion.BERegistry;
import mod.icarus.balkonsexpansion.item.BEItemFlail;
import mod.icarus.balkonsexpansion.item.BEItemMelee;
import mod.icarus.balkonsexpansion.item.BEItemMusket;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.registries.IForgeRegistry;
import ru.liahim.mist.api.item.MistItems;
import ru.liahim.mist.init.ModItems;

public class MistyWorldRegistration {
public static BEItemMelee battleaxeNiobium;
public static BEItemMelee boomerangNiobium;
public static BEItemMusket bayonetNiobium;
public static BEItemFlail flailNiobium;
public static BEItemMelee halberdNiobium;
public static BEItemMelee katanaNiobium;
public static BEItemMelee knifeNiobium;
public static BEItemMelee spearNiobium;
public static BEItemMelee warhammerNiobium;

public static void registerItems(RegistryEvent.Register<Item> event) {
IForgeRegistry<Item> registry = event.getRegistry();

if (BEConfig.misty_world_settings.MW_NIOBIUM_MATERIAL) {
registry.register(spearNiobium = BEItemBuilder.createCustomSpear("spear.niobium.mw", ModItems.NIOBIUM_TOOLS, -0.15F, 1.0F));
registry.register(halberdNiobium = BEItemBuilder.createCustomHalberd("halberd.niobium.mw", ModItems.NIOBIUM_TOOLS, 0.4F, 1.0F));
registry.register(battleaxeNiobium = BEItemBuilder.createCustomBattleaxe("battleaxe.niobium.mw", ModItems.NIOBIUM_TOOLS, 0.25F, 1.0F));
registry.register(knifeNiobium = BEItemBuilder.createCustomKnife("knife.niobium.mw", ModItems.NIOBIUM_TOOLS, -0.15F));
registry.register(warhammerNiobium = BEItemBuilder.createCustomWarhammer("warhammer.niobium.mw", ModItems.NIOBIUM_TOOLS, 0.55F));
registry.register(flailNiobium = BEItemBuilder.createCustomFlail("flail.niobium.mw", ModItems.NIOBIUM_TOOLS));
registry.register(katanaNiobium = BEItemBuilder.createCustomKatana("katana.niobium.mw", ModItems.NIOBIUM_TOOLS));
registry.register(boomerangNiobium = BEItemBuilder.createCustomBoomerang("boomerang.niobium.mw", ModItems.NIOBIUM_TOOLS, 0.1F));
registry.register(bayonetNiobium = BEItemBuilder.createCustomMusketBayonet("musketbayonet.niobium.mw", ModItems.NIOBIUM_TOOLS, knifeNiobium, -0.15F));
}
}

@SubscribeEvent
public static void registerRecipes(RegistryEvent.Register<IRecipe> event) {
IForgeRegistry<IRecipe> registry = event.getRegistry();

if (BEConfig.misty_world_settings.MW_NIOBIUM_MATERIAL) {
registry.register(BERecipes.registerBattleaxeRecipe(MistItems.NIOBIUM_INGOT, "stickWood", battleaxeNiobium));
registry.register(BERecipes.registerBoomerangRecipe(MistItems.NIOBIUM_INGOT, "plankWood", boomerangNiobium));
registry.register(BERecipes.registerBayonetRecipe(knifeNiobium, bayonetNiobium));
registry.register(BERecipes.registerFlailRecipe(MistItems.NIOBIUM_INGOT, "stickWood", "string", flailNiobium));
registry.register(BERecipes.registerHalberdRecipe(MistItems.NIOBIUM_INGOT, "stickWood", halberdNiobium));
registry.register(BERecipes.registerKatanaRecipe(MistItems.NIOBIUM_INGOT, "stickWood", katanaNiobium));
registry.register(BERecipes.registerKnifeRecipe(MistItems.NIOBIUM_INGOT, "stickWood", knifeNiobium));
registry.register(BERecipes.registerKnifeAltRecipe(MistItems.NIOBIUM_INGOT, "stickWood", knifeNiobium));
registry.register(BERecipes.registerSpearRecipe(MistItems.NIOBIUM_INGOT, "stickWood", spearNiobium));
registry.register(BERecipes.registerWarhammerRecipe(MistItems.NIOBIUM_INGOT, "stickWood", warhammerNiobium));

GameRegistry.addSmelting(new ItemStack(battleaxeNiobium, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(MistItems.NIOBIUM_NUGGET), 0.1F);
GameRegistry.addSmelting(new ItemStack(boomerangNiobium, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(MistItems.NIOBIUM_NUGGET), 0.1F);
GameRegistry.addSmelting(new ItemStack(flailNiobium, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(MistItems.NIOBIUM_NUGGET), 0.1F);
GameRegistry.addSmelting(new ItemStack(halberdNiobium, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(MistItems.NIOBIUM_NUGGET), 0.1F);
GameRegistry.addSmelting(new ItemStack(katanaNiobium, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(MistItems.NIOBIUM_NUGGET), 0.1F);
GameRegistry.addSmelting(new ItemStack(knifeNiobium, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(MistItems.NIOBIUM_NUGGET), 0.1F);
GameRegistry.addSmelting(new ItemStack(spearNiobium, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(MistItems.NIOBIUM_NUGGET), 0.1F);
GameRegistry.addSmelting(new ItemStack(warhammerNiobium, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(MistItems.NIOBIUM_NUGGET), 0.1F);
}
}

@SideOnly(Side.CLIENT)
public static void registerRenderersItem() {
if (BEConfig.misty_world_settings.MW_NIOBIUM_MATERIAL) {
BERegistry.registerWeaponItemModel(battleaxeNiobium);
BERegistry.registerWeaponItemModel(boomerangNiobium);
BERegistry.registerWeaponItemModel(bayonetNiobium);
BERegistry.registerWeaponItemModel(flailNiobium);
BERegistry.registerWeaponItemModel(halberdNiobium);
BERegistry.registerWeaponItemModel(katanaNiobium);
BERegistry.registerWeaponItemModel(knifeNiobium);
BERegistry.registerWeaponItemModel(spearNiobium);
BERegistry.registerWeaponItemModel(warhammerNiobium);
}
}
}
11 changes: 11 additions & 0 deletions src/main/resources/assets/balkonsexpansion/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,17 @@ item.musketbayonet.bronze.ic2e.name=Musket with Bronze Bayonet
item.spear.bronze.ic2e.name=Bronze Spear
item.warhammer.bronze.ic2e.name=Bronze Warhammer

# Misty World
item.battleaxe.niobium.mw.name=Niobium Battleaxe
item.boomerang.niobium.mw.name=Niobium Boomerang
item.flail.niobium.mw.name=Niobium Flail
item.halberd.niobium.mw.name=Niobium Halberd
item.katana.niobium.mw.name=Niobium Katana
item.knife.niobium.mw.name=Niobium Knife
item.musketbayonet.niobium.mw.name=Musket with Niobium Bayonet
item.spear.niobium.mw.name=Niobium Spear
item.warhammer.niobium.mw.name=Niobium Warhammer

# Mo' Creatures Extended
item.battleaxe.ancient_silver.name=Ancient Silver Battleaxe
item.battleaxe.dark_scorpion.name=Dark Scorpion Battleaxe
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "weaponmod:item/handheld_block",
"textures": {
"layer0": "balkonsexpansion:mistyworld/items/battleaxe.niobium"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"parent": "item/handheld",
"textures": {
"layer0": "balkonsexpansion:mistyworld/items/battleaxe.niobium"
},
"overrides": [
{
"predicate": {
"weaponmod:block": 1
},
"model": "balkonsexpansion:item/battleaxe.niobium.mw.block"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"parent": "item/handheld",
"textures": {
"layer0": "balkonsexpansion:mistyworld/items/boomerang.niobium"
},
"overrides": [
{
"predicate": {
"weaponmod:ready-to-throw": 1
},
"model": "balkonsexpansion:item/boomerang.niobium.mw_ready"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "weaponmod:item/handheld_block",
"textures": {
"layer0": "balkonsexpansion:mistyworld/items/boomerang.niobium"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "balkonsexpansion:item/flail.niobium.mw",
"textures": {
"layer0": "weaponmod:items/flail-thrown"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"parent": "weaponmod:item/handheld_rod",
"textures": {
"layer0": "balkonsexpansion:mistyworld/items/flail.niobium"
},
"overrides": [
{
"predicate": {
"weaponmod:thrown": 1
},
"model": "balkonsexpansion:item/flail.niobium.mw-thrown"
}
]
}
Loading

0 comments on commit de77214

Please sign in to comment.