From 0189c176dfad8a991d74370d88263d30c40b9474 Mon Sep 17 00:00:00 2001 From: Mohammad-Ali Minaie Date: Sun, 25 Jun 2017 16:29:51 -0400 Subject: [PATCH] prepping for update --- 1.11/To-Dos.md | 2 +- .../forgecraft/compat/ModDictionary.java | 4 +++ .../primal/forgecraft/init/ModCrafting.java | 11 ++++---- .../nmd/primal/forgecraft/init/ModItems.java | 24 ++++++++--------- .../forgecraft/items/weapons/CustomSword.java | 27 ++++++++++++++++++- .../assets/forgecraft/lang/en_us.lang | 1 + ...ironsword.json => wroughtirongladius.json} | 0 7 files changed, 50 insertions(+), 19 deletions(-) rename 1.11/src/main/resources/assets/forgecraft/models/item/{ironsword.json => wroughtirongladius.json} (100%) diff --git a/1.11/To-Dos.md b/1.11/To-Dos.md index facdca8a..0ea36d23 100644 --- a/1.11/To-Dos.md +++ b/1.11/To-Dos.md @@ -6,7 +6,7 @@ To-Dos *** Current Feature *** - [x] BlockBreaker Support for copper dust and tin dust - [x] picking up raw bronze crucible returns some other shit -- [ ] Tool breaking should return tool head +- [x] Tool breaking should return tool head *** Feature Musket *** - [ ] Create powder charge item (copper, charcoal, gunpowder) diff --git a/1.11/src/main/java/nmd/primal/forgecraft/compat/ModDictionary.java b/1.11/src/main/java/nmd/primal/forgecraft/compat/ModDictionary.java index 1bf06672..e9452451 100644 --- a/1.11/src/main/java/nmd/primal/forgecraft/compat/ModDictionary.java +++ b/1.11/src/main/java/nmd/primal/forgecraft/compat/ModDictionary.java @@ -21,6 +21,10 @@ public class ModDictionary {/*************************************************** //OreDictionary.registerOre("clayball", Items.CLAY_BALL); OreDictionary.registerOre("ingotIron", ModBlocks.ironball); OreDictionary.registerOre("nuggetIron", ModBlocks.ironchunk); + OreDictionary.registerOre("ingotIron", ModBlocks.ironcleanball); + OreDictionary.registerOre("nuggetIron", ModBlocks.ironcleanchunk); + OreDictionary.registerOre("ingotSteel", ModBlocks.steelball); + OreDictionary.registerOre("nuggetSteel", ModBlocks.steelchunk); diff --git a/1.11/src/main/java/nmd/primal/forgecraft/init/ModCrafting.java b/1.11/src/main/java/nmd/primal/forgecraft/init/ModCrafting.java index 688f411d..b44027a0 100644 --- a/1.11/src/main/java/nmd/primal/forgecraft/init/ModCrafting.java +++ b/1.11/src/main/java/nmd/primal/forgecraft/init/ModCrafting.java @@ -929,11 +929,12 @@ public class ModCrafting { empty,empty,hotChunk,empty,empty, empty,hotChunk,hotChunk,hotChunk,empty, empty,empty,hotChunk,empty,empty }, - new ItemStack(ModItems.ironsword, 1), + new ItemStack(ModItems.wroughtirongladius, 1), "null" ); /*** Temp Clean Iron Sword ***/ - AnvilCrafting.addRecipe( + //TODO uncomment this + /*AnvilCrafting.addRecipe( new String[] { empty,empty,empty,empty,empty, empty,empty,hotCleanChunk,empty,empty, @@ -942,9 +943,9 @@ public class ModCrafting { empty,empty,hotCleanChunk,empty,empty }, new ItemStack(ModItems.cleanironsword, 1), "null" - ); + );*/ /*** Temp Steel Sword ***/ - AnvilCrafting.addRecipe( + /*AnvilCrafting.addRecipe( new String[] { empty,empty,empty,empty,empty, empty,empty,hotSteelChunk,empty,empty, @@ -953,7 +954,7 @@ public class ModCrafting { empty,empty,hotSteelChunk,empty,empty }, new ItemStack(ModItems.steelsword, 1), "null" - ); + );*/ /*** Flaked emerald ***/ AnvilCrafting.addRecipe( diff --git a/1.11/src/main/java/nmd/primal/forgecraft/init/ModItems.java b/1.11/src/main/java/nmd/primal/forgecraft/init/ModItems.java index 377bfb57..0c1c89e2 100644 --- a/1.11/src/main/java/nmd/primal/forgecraft/init/ModItems.java +++ b/1.11/src/main/java/nmd/primal/forgecraft/init/ModItems.java @@ -103,10 +103,10 @@ public class ModItems { public static Item wootzhoe; public static Item bronzegladius; - public static Item ironsword; - public static Item cleanironsword; - public static Item steelsword; - public static Item wootzsword; + public static Item wroughtirongladius; + //public static Item cleanironsword; + //public static Item steelsword; + //public static Item wootzsword; public static Item wroughtironshield; //public static Item cleanironshield; @@ -195,11 +195,11 @@ public class ModItems { /********** WEAPONS **********/ - bronzegladius = new CustomSword("bronzegladius", PrimalMaterials.TOOL_BRONZE); - ironsword = new CustomSword("ironsword", PrimalMaterials.TOOL_WROUGHT_IRON); - cleanironsword = new CustomSword("ironsword", PrimalMaterials.TOOL_CLEAN_IRON); - steelsword = new CustomSword("ironsword", PrimalMaterials.TOOL_BASIC_STEEL); - wootzsword = new CustomSword("ironsword", PrimalMaterials.TOOL_WOOTZ_STEEL); + bronzegladius = new CustomSword("bronzegladius", PrimalMaterials.TOOL_BRONZE, 5D, 1D); + wroughtirongladius = new CustomSword("wroughtirongladius", PrimalMaterials.TOOL_WROUGHT_IRON, 4.5D, 3D); + //cleanironsword = new CustomSword("ironsword", PrimalMaterials.TOOL_CLEAN_IRON); + //steelsword = new CustomSword("ironsword", PrimalMaterials.TOOL_BASIC_STEEL); + //wootzsword = new CustomSword("ironsword", PrimalMaterials.TOOL_WOOTZ_STEEL); wroughtironshield = new CustomShield("wroughtironshield", PrimalMaterials.TOOL_WROUGHT_IRON); @@ -304,9 +304,9 @@ public class ModItems { /********** WEAPONS **********/ - GameRegistry.register(ironsword); + GameRegistry.register(wroughtirongladius); GameRegistry.register(bronzegladius); - GameRegistry.register(wroughtironshield); + //GameRegistry.register(wroughtironshield); //GameRegistry.register(matchlockmusket); //GameRegistry.register(forgingmanual); @@ -395,7 +395,7 @@ public class ModItems { /********** WEAPONS **********/ - registerRender(ironsword); + registerRender(wroughtirongladius); registerRender(wroughtironshield); //registerRender(forgingmanual); //registerRender(matchlockmusket); diff --git a/1.11/src/main/java/nmd/primal/forgecraft/items/weapons/CustomSword.java b/1.11/src/main/java/nmd/primal/forgecraft/items/weapons/CustomSword.java index ee740f39..b1c90a6f 100644 --- a/1.11/src/main/java/nmd/primal/forgecraft/items/weapons/CustomSword.java +++ b/1.11/src/main/java/nmd/primal/forgecraft/items/weapons/CustomSword.java @@ -1,5 +1,10 @@ package nmd.primal.forgecraft.items.weapons; +import com.google.common.collect.HashMultimap; +import com.google.common.collect.Multimap; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemSword; @@ -7,18 +12,24 @@ import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import nmd.primal.forgecraft.ModInfo; +import java.util.DoubleSummaryStatistics; + /** * Created by mminaie on 3/23/17. */ public class CustomSword extends ItemSword { - public CustomSword(String name, Item.ToolMaterial material) { + private double attack, speed; + + public CustomSword(String name, Item.ToolMaterial material, double attackDamage, double attackSpeed) { super(material); this.setUnlocalizedName(name); this.setRegistryName(name); this.setCreativeTab(ModInfo.TAB_FORGECRAFT); this.setMaxStackSize(1); this.setNoRepair(); + this.attack = attackDamage; + this.speed = attackSpeed; } @@ -40,4 +51,18 @@ public class CustomSword extends ItemSword { return 0; } + @Override + public Multimap getItemAttributeModifiers(EntityEquipmentSlot equipmentSlot) + { + Multimap multimap = HashMultimap.create(); + + if (equipmentSlot == EntityEquipmentSlot.MAINHAND) + { + multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", this.attack, 0)); + multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", -this.speed, 0)); + } + + return multimap; + } + } diff --git a/1.11/src/main/resources/assets/forgecraft/lang/en_us.lang b/1.11/src/main/resources/assets/forgecraft/lang/en_us.lang index 8ea31af1..52ecb7a4 100644 --- a/1.11/src/main/resources/assets/forgecraft/lang/en_us.lang +++ b/1.11/src/main/resources/assets/forgecraft/lang/en_us.lang @@ -97,6 +97,7 @@ item.cast_pickaxe.name=Pickaxe Cast item.cast_shovel.name=Shovel Cast item.cast_hoe.name=Hoe Cast item.bronzegladius.name=Bronze Gladius +item.wroughtirongladius.name=Wrought Iron Gladius item.ironingothot.name=Hot Iron Ingot item.ironchunkhot.name=Hot Iron Chunk diff --git a/1.11/src/main/resources/assets/forgecraft/models/item/ironsword.json b/1.11/src/main/resources/assets/forgecraft/models/item/wroughtirongladius.json similarity index 100% rename from 1.11/src/main/resources/assets/forgecraft/models/item/ironsword.json rename to 1.11/src/main/resources/assets/forgecraft/models/item/wroughtirongladius.json