-
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
dde17a2
commit 7d2a42d
Showing
24 changed files
with
532 additions
and
22 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
...n/java/mod/emt/balkonsexpansion/compat/ic2experimental/IC2ExperimentalMaterialColors.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.emt.balkonsexpansion.compat.ic2experimental; | ||
|
||
import ckathode.weaponmod.entity.projectile.ICustomProjectileMaterials; | ||
import ckathode.weaponmod.entity.projectile.MaterialRegistry; | ||
import ckathode.weaponmod.item.IItemWeapon; | ||
import net.minecraft.item.Item.ToolMaterial; | ||
import net.minecraft.item.ItemStack; | ||
|
||
// Some entities of BWM: Legacy such as flails can change their color, which is what this is used for. | ||
public class IC2ExperimentalMaterialColors { | ||
public static final int MATERIAL_BRONZE = ToolMaterial.valueOf("IC2_BRONZE").ordinal(); | ||
|
||
public static void registerMaterialColors() { | ||
MaterialRegistry.registerCustomProjectileMaterial(new ICustomProjectileMaterials() { | ||
@Override | ||
public int[] getAllMaterialIDs() { | ||
return new int[]{MATERIAL_BRONZE}; | ||
} | ||
|
||
@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 == ToolMaterial.valueOf("IC2_BRONZE")) | ||
return MATERIAL_BRONZE; | ||
} | ||
} | ||
|
||
return -1; | ||
} | ||
|
||
@Override | ||
public float[] getColorFromMaterialID(int i) { | ||
// The color for the given item tier must be returned as | ||
// {R,G,B}, where each value is between 0 and 1. | ||
if (i == MATERIAL_BRONZE) return new float[]{0.78F, 0.345F, 0.173F}; | ||
|
||
return null; | ||
} | ||
}); | ||
} | ||
} |
80 changes: 80 additions & 0 deletions
80
...ain/java/mod/emt/balkonsexpansion/compat/ic2experimental/IC2ExperimentalRegistration.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,80 @@ | ||
package mod.emt.balkonsexpansion.compat.ic2experimental; | ||
|
||
import mod.emt.balkonsexpansion.BEConfig; | ||
import mod.emt.balkonsexpansion.BEItemBuilder; | ||
import mod.emt.balkonsexpansion.BERecipes; | ||
import mod.emt.balkonsexpansion.BERegistry; | ||
import mod.emt.balkonsexpansion.item.BEItemFlail; | ||
import mod.emt.balkonsexpansion.item.BEItemMelee; | ||
import mod.emt.balkonsexpansion.item.BEItemMusket; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.item.Item.ToolMaterial; | ||
import net.minecraft.item.crafting.IRecipe; | ||
import net.minecraftforge.event.RegistryEvent; | ||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; | ||
import net.minecraftforge.fml.relauncher.Side; | ||
import net.minecraftforge.fml.relauncher.SideOnly; | ||
import net.minecraftforge.registries.IForgeRegistry; | ||
|
||
public class IC2ExperimentalRegistration { | ||
public static BEItemMelee battleaxeBronze; | ||
public static BEItemMelee boomerangBronze; | ||
public static BEItemMusket bayonetBronze; | ||
public static BEItemFlail flailBronze; | ||
public static BEItemMelee halberdBronze; | ||
public static BEItemMelee katanaBronze; | ||
public static BEItemMelee knifeBronze; | ||
public static BEItemMelee spearBronze; | ||
public static BEItemMelee warhammerBronze; | ||
|
||
public static void registerItems(RegistryEvent.Register<Item> event) { | ||
IForgeRegistry<Item> registry = event.getRegistry(); | ||
|
||
if (BEConfig.ic2_settings.IC2_BRONZE_MATERIAL) { | ||
registry.register(spearBronze = BEItemBuilder.createCustomSpear("spear.bronze.ic2e", ToolMaterial.valueOf("IC2_BRONZE"), -0.15F, 1.0F)); | ||
registry.register(halberdBronze = BEItemBuilder.createCustomHalberd("halberd.bronze.ic2e", ToolMaterial.valueOf("IC2_BRONZE"), 0.4F, 1.0F)); | ||
registry.register(battleaxeBronze = BEItemBuilder.createCustomBattleaxe("battleaxe.bronze.ic2e", ToolMaterial.valueOf("IC2_BRONZE"), 0.25F, 1.0F)); | ||
registry.register(knifeBronze = BEItemBuilder.createCustomKnife("knife.bronze.ic2e", ToolMaterial.valueOf("IC2_BRONZE"), -0.15F)); | ||
registry.register(warhammerBronze = BEItemBuilder.createCustomWarhammer("warhammer.bronze.ic2e", ToolMaterial.valueOf("IC2_BRONZE"), 0.55F)); | ||
registry.register(flailBronze = BEItemBuilder.createCustomFlail("flail.bronze.ic2e", ToolMaterial.valueOf("IC2_BRONZE"))); | ||
registry.register(katanaBronze = BEItemBuilder.createCustomKatana("katana.bronze.ic2e", ToolMaterial.valueOf("IC2_BRONZE"))); | ||
registry.register(boomerangBronze = BEItemBuilder.createCustomBoomerang("boomerang.bronze.ic2e", ToolMaterial.valueOf("IC2_BRONZE"), 0.1F)); | ||
registry.register(bayonetBronze = BEItemBuilder.createCustomMusketBayonet("musketbayonet.bronze.ic2e", ToolMaterial.valueOf("IC2_BRONZE"), knifeBronze, -0.15F)); | ||
} | ||
} | ||
|
||
@SubscribeEvent | ||
public static void registerRecipes(RegistryEvent.Register<IRecipe> event) { | ||
IForgeRegistry<IRecipe> registry = event.getRegistry(); | ||
|
||
if (BEConfig.ic2_settings.IC2_BRONZE_MATERIAL) { | ||
registry.register(BERecipes.registerBattleaxeRecipe("ingotBronze", "stickWood", battleaxeBronze)); | ||
registry.register(BERecipes.registerBoomerangRecipe("ingotBronze", "plankWood", boomerangBronze)); | ||
registry.register(BERecipes.registerBayonetRecipe(knifeBronze, bayonetBronze)); | ||
registry.register(BERecipes.registerFlailRecipe("ingotBronze", "stickWood", "string", flailBronze)); | ||
registry.register(BERecipes.registerHalberdRecipe("ingotBronze", "stickWood", halberdBronze)); | ||
registry.register(BERecipes.registerKatanaRecipe("ingotBronze", "stickWood", katanaBronze)); | ||
registry.register(BERecipes.registerKnifeRecipe("ingotBronze", "stickWood", knifeBronze)); | ||
registry.register(BERecipes.registerKnifeAltRecipe("ingotBronze", "stickWood", knifeBronze)); | ||
registry.register(BERecipes.registerSpearRecipe("ingotBronze", "stickWood", spearBronze)); | ||
registry.register(BERecipes.registerWarhammerRecipe("ingotBronze", "stickWood", warhammerBronze)); | ||
} | ||
|
||
// IC2 Classic tools have no smelting recipes so none needs to be added. | ||
} | ||
|
||
@SideOnly(Side.CLIENT) | ||
public static void registerRenderersItem() { | ||
if (BEConfig.ic2_settings.IC2_BRONZE_MATERIAL) { | ||
BERegistry.registerWeaponItemModel(battleaxeBronze); | ||
BERegistry.registerWeaponItemModel(boomerangBronze); | ||
BERegistry.registerWeaponItemModel(bayonetBronze); | ||
BERegistry.registerWeaponItemModel(flailBronze); | ||
BERegistry.registerWeaponItemModel(halberdBronze); | ||
BERegistry.registerWeaponItemModel(katanaBronze); | ||
BERegistry.registerWeaponItemModel(knifeBronze); | ||
BERegistry.registerWeaponItemModel(spearBronze); | ||
BERegistry.registerWeaponItemModel(warhammerBronze); | ||
} | ||
} | ||
} |
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.bronze.ic2e.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:ic2/items/battleaxe.bronze" | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/resources/assets/balkonsexpansion/models/item/battleaxe.bronze.ic2e.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:ic2/items/battleaxe.bronze" | ||
}, | ||
"overrides": [ | ||
{ | ||
"predicate": { | ||
"weaponmod:block": 1 | ||
}, | ||
"model": "balkonsexpansion:item/battleaxe.bronze.ic2e.block" | ||
} | ||
] | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/resources/assets/balkonsexpansion/models/item/boomerang.bronze.ic2e.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:ic2/items/boomerang.bronze" | ||
}, | ||
"overrides": [ | ||
{ | ||
"predicate": { | ||
"weaponmod:ready-to-throw": 1 | ||
}, | ||
"model": "balkonsexpansion:item/boomerang.bronze.ic2e_ready" | ||
} | ||
] | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/balkonsexpansion/models/item/boomerang.bronze.ic2e_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:ic2/items/boomerang.bronze" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/balkonsexpansion/models/item/flail.bronze.ic2e-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.bronze.ic2e", | ||
"textures": { | ||
"layer0": "weaponmod:items/flail-thrown" | ||
} | ||
} |
Oops, something went wrong.