-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
406f87c
commit de77214
Showing
33 changed files
with
542 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
src/main/java/mod/icarus/balkonsexpansion/compat/mistyworld/MistyWorldMaterialColors.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
}); | ||
} | ||
} |
91 changes: 91 additions & 0 deletions
91
src/main/java/mod/icarus/balkonsexpansion/compat/mistyworld/MistyWorldRegistration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/balkonsexpansion/models/item/battleaxe.niobium.mw.block.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/resources/assets/balkonsexpansion/models/item/battleaxe.niobium.mw.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
] | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/resources/assets/balkonsexpansion/models/item/boomerang.niobium.mw.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
] | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/balkonsexpansion/models/item/boomerang.niobium.mw_ready.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/balkonsexpansion/models/item/flail.niobium.mw-thrown.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/resources/assets/balkonsexpansion/models/item/flail.niobium.mw.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
] | ||
} |
Oops, something went wrong.