Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separate armor into its own module, rename features module to melter,…
… separate bucket cast to just commons Makes it easier to deal with modules here instead of them feeling just tacked on
- Loading branch information
1 parent
7b2535f
commit c8c42ee
Showing
50 changed files
with
292 additions
and
313 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
23 changes: 23 additions & 0 deletions
23
src/main/java/knightminer/tcomplement/armor/ArmorClientProxy.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,23 @@ | ||
package knightminer.tcomplement.armor; | ||
|
||
import static slimeknights.tconstruct.common.ModelRegisterUtil.registerItemModel; | ||
|
||
import knightminer.tcomplement.common.ClientProxy; | ||
import net.minecraftforge.client.event.ModelRegistryEvent; | ||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; | ||
|
||
public class ArmorClientProxy extends ClientProxy { | ||
@SubscribeEvent | ||
public void registerModels(ModelRegistryEvent event) { | ||
// armor | ||
registerItemModel(ModuleArmor.manyullynHelmet); | ||
registerItemModel(ModuleArmor.manyullynChestplate); | ||
registerItemModel(ModuleArmor.manyullynLeggings); | ||
registerItemModel(ModuleArmor.manyullynBoots); | ||
|
||
registerItemModel(ModuleArmor.knightSlimeHelmet); | ||
registerItemModel(ModuleArmor.knightSlimeChestplate); | ||
registerItemModel(ModuleArmor.knightSlimeLeggings); | ||
registerItemModel(ModuleArmor.knightSlimeBoots); | ||
} | ||
} |
94 changes: 94 additions & 0 deletions
94
src/main/java/knightminer/tcomplement/armor/ModuleArmor.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,94 @@ | ||
package knightminer.tcomplement.armor; | ||
|
||
import com.google.common.eventbus.Subscribe; | ||
|
||
import knightminer.tcomplement.armor.items.ItemArmorBase; | ||
import knightminer.tcomplement.armor.items.ItemKnightSlimeArmor; | ||
import knightminer.tcomplement.common.CommonProxy; | ||
import knightminer.tcomplement.common.ModIds; | ||
import knightminer.tcomplement.common.PulseBase; | ||
import knightminer.tcomplement.library.Util; | ||
import net.minecraft.init.SoundEvents; | ||
import net.minecraft.inventory.EntityEquipmentSlot; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.item.ItemArmor.ArmorMaterial; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraftforge.common.MinecraftForge; | ||
import net.minecraftforge.common.util.EnumHelper; | ||
import net.minecraftforge.event.RegistryEvent.Register; | ||
import net.minecraftforge.fml.common.SidedProxy; | ||
import net.minecraftforge.fml.common.event.FMLInitializationEvent; | ||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; | ||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; | ||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; | ||
import net.minecraftforge.fml.common.registry.GameRegistry; | ||
import net.minecraftforge.registries.IForgeRegistry; | ||
import slimeknights.mantle.pulsar.pulse.Pulse; | ||
|
||
@Pulse(id = ModuleArmor.pulseID, description = "Adds KnightSlime and Manyullyn vanilla style armors") | ||
public class ModuleArmor extends PulseBase { | ||
public static final String pulseID = "ModuleArmor"; | ||
|
||
@SidedProxy(clientSide = "knightminer.tcomplement.armor.ArmorClientProxy", serverSide = "knightminer.tcomplement.common.CommonProxy") | ||
public static CommonProxy proxy; | ||
|
||
// armor | ||
public static ArmorMaterial manyullynArmor; | ||
public static Item manyullynHelmet; | ||
public static Item manyullynChestplate; | ||
public static Item manyullynLeggings; | ||
public static Item manyullynBoots; | ||
|
||
public static ArmorMaterial knightSlimeArmor; | ||
public static Item knightSlimeHelmet; | ||
public static Item knightSlimeChestplate; | ||
public static Item knightSlimeLeggings; | ||
public static Item knightSlimeBoots; | ||
|
||
@Subscribe | ||
public void preInit(FMLPreInitializationEvent event) { | ||
manyullynArmor = EnumHelper.addArmorMaterial(Util.prefix("manyullyn"), Util.resource("manyullyn"), | ||
15, new int[]{3, 6, 8, 3}, 7, SoundEvents.ITEM_ARMOR_EQUIP_IRON, 3.0F); | ||
knightSlimeArmor = EnumHelper.addArmorMaterial(Util.prefix("knightslime"), Util.resource("knightslime"), | ||
12, new int[]{2, 5, 6, 2}, 4, SoundEvents.BLOCK_SLIME_PLACE, 1.0F); | ||
|
||
proxy.preInit(); | ||
} | ||
|
||
@SubscribeEvent | ||
public void registerItems(Register<Item> event) { | ||
IForgeRegistry<Item> r = event.getRegistry(); | ||
|
||
// manyullyn armor | ||
manyullynHelmet = registerItem(r, new ItemArmorBase(manyullynArmor, EntityEquipmentSlot.HEAD), "manyullyn_helmet"); | ||
manyullynChestplate = registerItem(r, new ItemArmorBase(manyullynArmor, EntityEquipmentSlot.CHEST), "manyullyn_chestplate"); | ||
manyullynLeggings = registerItem(r, new ItemArmorBase(manyullynArmor, EntityEquipmentSlot.LEGS), "manyullyn_leggings"); | ||
manyullynBoots = registerItem(r, new ItemArmorBase(manyullynArmor, EntityEquipmentSlot.FEET), "manyullyn_boots"); | ||
ItemStack manyullyn = GameRegistry.makeItemStack(ModIds.TConstruct.ingots, ModIds.TConstruct.manyullynMeta, 1, null); | ||
if(!manyullyn.isEmpty()) { | ||
manyullynArmor.setRepairItem(manyullyn); | ||
} | ||
|
||
// knight slime armor | ||
knightSlimeHelmet = registerItem(r, new ItemKnightSlimeArmor(EntityEquipmentSlot.HEAD), "knightslime_helmet"); | ||
knightSlimeChestplate = registerItem(r, new ItemKnightSlimeArmor(EntityEquipmentSlot.CHEST), "knightslime_chestplate"); | ||
knightSlimeLeggings = registerItem(r, new ItemKnightSlimeArmor(EntityEquipmentSlot.LEGS), "knightslime_leggings"); | ||
knightSlimeBoots = registerItem(r, new ItemKnightSlimeArmor(EntityEquipmentSlot.FEET), "knightslime_boots"); | ||
ItemStack knightSlime = GameRegistry.makeItemStack(ModIds.TConstruct.ingots, ModIds.TConstruct.knightSlimeMeta, 1, null); | ||
if(!knightSlime.isEmpty()) { | ||
knightSlimeArmor.setRepairItem(knightSlime); | ||
} | ||
} | ||
|
||
@Subscribe | ||
public void init(FMLInitializationEvent event) { | ||
proxy.init(); | ||
} | ||
|
||
@Subscribe | ||
public void postInit(FMLPostInitializationEvent event) { | ||
MinecraftForge.EVENT_BUS.register(ItemKnightSlimeArmor.class); | ||
|
||
proxy.postInit(); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...mplement/feature/items/ItemArmorBase.java → ...complement/armor/items/ItemArmorBase.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
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
4 changes: 2 additions & 2 deletions
4
src/main/java/knightminer/tcomplement/common/TCompNetwork.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
4 changes: 2 additions & 2 deletions
4
src/main/java/knightminer/tcomplement/library/tanks/MelterTank.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
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
Oops, something went wrong.