diff --git a/src/main/java/tconstruct/weaponry/client/renderer/AmmoItemRenderer.java b/src/main/java/tconstruct/client/AmmoItemRenderer.java similarity index 95% rename from src/main/java/tconstruct/weaponry/client/renderer/AmmoItemRenderer.java rename to src/main/java/tconstruct/client/AmmoItemRenderer.java index e40ab1f4..13d048c6 100644 --- a/src/main/java/tconstruct/weaponry/client/renderer/AmmoItemRenderer.java +++ b/src/main/java/tconstruct/client/AmmoItemRenderer.java @@ -1,6 +1,6 @@ -package tconstruct.weaponry.client.renderer; +package tconstruct.client; -import tconstruct.weaponry.library.weaponry.IAmmo; +import tconstruct.library.weaponry.IAmmo; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.item.ItemStack; diff --git a/src/main/java/tconstruct/weaponry/client/renderer/FlexibleToolRenderer.java b/src/main/java/tconstruct/client/FlexibleToolRenderer.java similarity index 99% rename from src/main/java/tconstruct/weaponry/client/renderer/FlexibleToolRenderer.java rename to src/main/java/tconstruct/client/FlexibleToolRenderer.java index 68f83922..9b0a737f 100644 --- a/src/main/java/tconstruct/weaponry/client/renderer/FlexibleToolRenderer.java +++ b/src/main/java/tconstruct/client/FlexibleToolRenderer.java @@ -1,4 +1,4 @@ -package tconstruct.weaponry.client.renderer; +package tconstruct.client; import net.minecraft.client.renderer.Tessellator; import net.minecraft.entity.Entity; diff --git a/src/main/java/tconstruct/weaponry/client/IconFlipped.java b/src/main/java/tconstruct/client/IconFlipped.java similarity index 94% rename from src/main/java/tconstruct/weaponry/client/IconFlipped.java rename to src/main/java/tconstruct/client/IconFlipped.java index 230c786d..64e14e08 100644 --- a/src/main/java/tconstruct/weaponry/client/IconFlipped.java +++ b/src/main/java/tconstruct/client/IconFlipped.java @@ -1,4 +1,4 @@ -package tconstruct.weaponry.client; +package tconstruct.client; import net.minecraft.util.IIcon; diff --git a/src/main/java/tconstruct/library/TConstructRegistry.java b/src/main/java/tconstruct/library/TConstructRegistry.java index 554b032b..df402c1c 100644 --- a/src/main/java/tconstruct/library/TConstructRegistry.java +++ b/src/main/java/tconstruct/library/TConstructRegistry.java @@ -26,6 +26,7 @@ public class TConstructRegistry public static TConstructCreativeTab materialTab; public static TConstructCreativeTab blockTab; public static TConstructCreativeTab equipableTab; + public static TConstructCreativeTab weaponryTab; /* Items */ diff --git a/src/main/java/tconstruct/weaponry/entity/ProjectileBase.java b/src/main/java/tconstruct/library/entity/ProjectileBase.java similarity index 99% rename from src/main/java/tconstruct/weaponry/entity/ProjectileBase.java rename to src/main/java/tconstruct/library/entity/ProjectileBase.java index 51e2ae8a..2f6e6aea 100644 --- a/src/main/java/tconstruct/weaponry/entity/ProjectileBase.java +++ b/src/main/java/tconstruct/library/entity/ProjectileBase.java @@ -1,7 +1,7 @@ -package tconstruct.weaponry.entity; +package tconstruct.library.entity; -import tconstruct.weaponry.library.weaponry.AmmoItem; -import tconstruct.weaponry.util.Reference; +import tconstruct.library.weaponry.AmmoItem; +import tconstruct.util.Reference; import cpw.mods.fml.common.network.ByteBufUtils; import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData; import io.netty.buffer.ByteBuf; diff --git a/src/main/java/tconstruct/weaponry/items/DualMaterialToolPart.java b/src/main/java/tconstruct/library/tools/DualMaterialToolPart.java similarity index 95% rename from src/main/java/tconstruct/weaponry/items/DualMaterialToolPart.java rename to src/main/java/tconstruct/library/tools/DualMaterialToolPart.java index d80efa72..995a246a 100644 --- a/src/main/java/tconstruct/weaponry/items/DualMaterialToolPart.java +++ b/src/main/java/tconstruct/library/tools/DualMaterialToolPart.java @@ -1,7 +1,5 @@ -package tconstruct.weaponry.items; +package tconstruct.library.tools; -import tconstruct.weaponry.TinkerWeaponry; -import tconstruct.weaponry.util.Reference; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; @@ -19,7 +17,7 @@ import tconstruct.util.config.PHConstruct; import java.util.List; import java.util.Map; -public class DualMaterialToolPart extends WeaponryToolPart { +public class DualMaterialToolPart extends DynamicToolPart { public IIcon defaultIcon2; public IIcon[] icons2; diff --git a/src/main/java/tconstruct/weaponry/library/util/PiercingArrowDamage.java b/src/main/java/tconstruct/library/util/PiercingArrowDamage.java similarity index 90% rename from src/main/java/tconstruct/weaponry/library/util/PiercingArrowDamage.java rename to src/main/java/tconstruct/library/util/PiercingArrowDamage.java index e68c919e..0ed99108 100644 --- a/src/main/java/tconstruct/weaponry/library/util/PiercingArrowDamage.java +++ b/src/main/java/tconstruct/library/util/PiercingArrowDamage.java @@ -1,4 +1,4 @@ -package tconstruct.weaponry.library.util; +package tconstruct.library.util; import net.minecraft.entity.Entity; import net.minecraft.util.EntityDamageSourceIndirect; diff --git a/src/main/java/tconstruct/weaponry/library/weaponry/AmmoItem.java b/src/main/java/tconstruct/library/weaponry/AmmoItem.java similarity index 92% rename from src/main/java/tconstruct/weaponry/library/weaponry/AmmoItem.java rename to src/main/java/tconstruct/library/weaponry/AmmoItem.java index 555d4b35..1ba90102 100644 --- a/src/main/java/tconstruct/weaponry/library/weaponry/AmmoItem.java +++ b/src/main/java/tconstruct/library/weaponry/AmmoItem.java @@ -1,7 +1,8 @@ -package tconstruct.weaponry.library.weaponry; +package tconstruct.library.weaponry; +import tconstruct.library.TConstructRegistry; import tconstruct.weaponry.TinkerWeaponry; -import tconstruct.weaponry.util.Reference; +import tconstruct.util.Reference; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -11,8 +12,7 @@ import tconstruct.library.tools.ToolCore; public abstract class AmmoItem extends ToolCore implements IAmmo { public AmmoItem(int baseDamage, String name) { super(baseDamage); - this.setUnlocalizedName(Reference.prefix(name)); - this.setCreativeTab(TinkerWeaponry.creativeTab); + this.setCreativeTab(TConstructRegistry.weaponryTab); } @Override @@ -110,9 +110,4 @@ public abstract class AmmoItem extends ToolCore implements IAmmo { // ammo doesn't hurt on smacking stuff with it return false; } - - @Override - public String getDefaultTexturePath() { - return Reference.RESOURCE + ":" + getDefaultFolder(); - } } diff --git a/src/main/java/tconstruct/weaponry/library/weaponry/AmmoWeapon.java b/src/main/java/tconstruct/library/weaponry/AmmoWeapon.java similarity index 99% rename from src/main/java/tconstruct/weaponry/library/weaponry/AmmoWeapon.java rename to src/main/java/tconstruct/library/weaponry/AmmoWeapon.java index 9bfadf08..24eb1e65 100644 --- a/src/main/java/tconstruct/weaponry/library/weaponry/AmmoWeapon.java +++ b/src/main/java/tconstruct/library/weaponry/AmmoWeapon.java @@ -1,4 +1,4 @@ -package tconstruct.weaponry.library.weaponry; +package tconstruct.library.weaponry; import tconstruct.weaponry.client.CrosshairType; import cpw.mods.fml.relauncher.Side; diff --git a/src/main/java/tconstruct/weaponry/library/weaponry/ArrowShaftMaterial.java b/src/main/java/tconstruct/library/weaponry/ArrowShaftMaterial.java similarity index 96% rename from src/main/java/tconstruct/weaponry/library/weaponry/ArrowShaftMaterial.java rename to src/main/java/tconstruct/library/weaponry/ArrowShaftMaterial.java index 23745dd0..b83da4a9 100644 --- a/src/main/java/tconstruct/weaponry/library/weaponry/ArrowShaftMaterial.java +++ b/src/main/java/tconstruct/library/weaponry/ArrowShaftMaterial.java @@ -1,4 +1,4 @@ -package tconstruct.weaponry.library.weaponry; +package tconstruct.library.weaponry; import tconstruct.weaponry.TinkerWeaponry; import net.minecraft.item.Item; diff --git a/src/main/java/tconstruct/weaponry/library/weaponry/BowBaseAmmo.java b/src/main/java/tconstruct/library/weaponry/BowBaseAmmo.java similarity index 99% rename from src/main/java/tconstruct/weaponry/library/weaponry/BowBaseAmmo.java rename to src/main/java/tconstruct/library/weaponry/BowBaseAmmo.java index af99fcfd..7d286b59 100644 --- a/src/main/java/tconstruct/weaponry/library/weaponry/BowBaseAmmo.java +++ b/src/main/java/tconstruct/library/weaponry/BowBaseAmmo.java @@ -1,4 +1,4 @@ -package tconstruct.weaponry.library.weaponry; +package tconstruct.library.weaponry; import tconstruct.weaponry.ammo.ArrowAmmo; import tconstruct.weaponry.entity.ArrowEntity; diff --git a/src/main/java/tconstruct/weaponry/library/weaponry/IAccuracy.java b/src/main/java/tconstruct/library/weaponry/IAccuracy.java similarity index 86% rename from src/main/java/tconstruct/weaponry/library/weaponry/IAccuracy.java rename to src/main/java/tconstruct/library/weaponry/IAccuracy.java index ee93370b..07bae711 100644 --- a/src/main/java/tconstruct/weaponry/library/weaponry/IAccuracy.java +++ b/src/main/java/tconstruct/library/weaponry/IAccuracy.java @@ -1,4 +1,4 @@ -package tconstruct.weaponry.library.weaponry; +package tconstruct.library.weaponry; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; diff --git a/src/main/java/tconstruct/weaponry/library/weaponry/IAmmo.java b/src/main/java/tconstruct/library/weaponry/IAmmo.java similarity index 96% rename from src/main/java/tconstruct/weaponry/library/weaponry/IAmmo.java rename to src/main/java/tconstruct/library/weaponry/IAmmo.java index 441b2bf9..5ed123e8 100644 --- a/src/main/java/tconstruct/weaponry/library/weaponry/IAmmo.java +++ b/src/main/java/tconstruct/library/weaponry/IAmmo.java @@ -1,4 +1,4 @@ -package tconstruct.weaponry.library.weaponry; +package tconstruct.library.weaponry; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; diff --git a/src/main/java/tconstruct/weaponry/library/weaponry/IWindup.java b/src/main/java/tconstruct/library/weaponry/IWindup.java similarity index 94% rename from src/main/java/tconstruct/weaponry/library/weaponry/IWindup.java rename to src/main/java/tconstruct/library/weaponry/IWindup.java index 417a253e..31a6ae23 100644 --- a/src/main/java/tconstruct/weaponry/library/weaponry/IWindup.java +++ b/src/main/java/tconstruct/library/weaponry/IWindup.java @@ -1,4 +1,4 @@ -package tconstruct.weaponry.library.weaponry; +package tconstruct.library.weaponry; import tconstruct.weaponry.client.CrosshairType; import net.minecraft.entity.player.EntityPlayer; diff --git a/src/main/java/tconstruct/weaponry/library/weaponry/ProjectileWeapon.java b/src/main/java/tconstruct/library/weaponry/ProjectileWeapon.java similarity index 97% rename from src/main/java/tconstruct/weaponry/library/weaponry/ProjectileWeapon.java rename to src/main/java/tconstruct/library/weaponry/ProjectileWeapon.java index 478c2c8c..22d0a831 100644 --- a/src/main/java/tconstruct/weaponry/library/weaponry/ProjectileWeapon.java +++ b/src/main/java/tconstruct/library/weaponry/ProjectileWeapon.java @@ -1,8 +1,9 @@ -package tconstruct.weaponry.library.weaponry; +package tconstruct.library.weaponry; +import tconstruct.library.TConstructRegistry; import tconstruct.weaponry.TinkerWeaponry; import tconstruct.weaponry.client.CrosshairType; -import tconstruct.weaponry.util.Reference; +import tconstruct.util.Reference; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; @@ -29,8 +30,8 @@ import java.util.Map; public abstract class ProjectileWeapon extends ToolCore implements IAccuracy, IWindup { public ProjectileWeapon(int baseDamage, String name) { super(baseDamage); - this.setUnlocalizedName(Reference.prefix(name)); - this.setCreativeTab(TinkerWeaponry.creativeTab); + + this.setCreativeTab(TConstructRegistry.weaponryTab); } @SideOnly(Side.CLIENT) @@ -211,11 +212,6 @@ public abstract class ProjectileWeapon extends ToolCore implements IAccuracy, IW // todo: animated effects - @Override - public String getDefaultTexturePath() { - return Reference.RESOURCE + ":" + getDefaultFolder(); - } - /** * return true if the current renderpass should use animations. * 0 == handle diff --git a/src/main/java/tconstruct/weaponry/util/Reference.java b/src/main/java/tconstruct/util/Reference.java similarity index 55% rename from src/main/java/tconstruct/weaponry/util/Reference.java rename to src/main/java/tconstruct/util/Reference.java index 731ce9ec..769a6c9a 100644 --- a/src/main/java/tconstruct/weaponry/util/Reference.java +++ b/src/main/java/tconstruct/util/Reference.java @@ -1,11 +1,12 @@ -package tconstruct.weaponry.util; +package tconstruct.util; + +import tconstruct.TConstruct; public final class Reference { private Reference() {} - public static final String MOD_ID = "tinkersweaponry"; - public static final String MOD_NAME = "Tinker's Weaponry"; - public static final String TCON_MOD_ID = "TConstruct"; + public static final String MOD_ID = TConstruct.modID; + public static final String MOD_NAME = "Tinkers' Construct"; public static final String RESOURCE = MOD_ID.toLowerCase(); @@ -13,5 +14,5 @@ public final class Reference { { return String.format("%s:%s", RESOURCE, res); } - public static String prefix(String name) { return String.format("tcon.weaponry.%s", name);} + public static String prefix(String name) { return String.format("tconstruct.%s", name);} } diff --git a/src/main/java/tconstruct/weaponry/TinkerWeaponry.java b/src/main/java/tconstruct/weaponry/TinkerWeaponry.java index 35bd2392..2e9096f8 100644 --- a/src/main/java/tconstruct/weaponry/TinkerWeaponry.java +++ b/src/main/java/tconstruct/weaponry/TinkerWeaponry.java @@ -1,7 +1,6 @@ package tconstruct.weaponry; -import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; @@ -12,6 +11,7 @@ import mantle.pulsar.pulse.Pulse; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; @@ -19,6 +19,7 @@ import tconstruct.TConstruct; import tconstruct.library.TConstructCreativeTab; import tconstruct.library.TConstructRegistry; import tconstruct.library.crafting.*; +import tconstruct.library.tools.DynamicToolPart; import tconstruct.library.tools.ToolCore; import tconstruct.library.util.IPattern; import tconstruct.library.util.IToolPart; @@ -27,13 +28,12 @@ import tconstruct.tools.TinkerTools; import tconstruct.tools.items.Pattern; import tconstruct.weaponry.ammo.ArrowAmmo; import tconstruct.weaponry.ammo.BoltAmmo; -import tconstruct.weaponry.items.DualMaterialToolPart; +import tconstruct.library.tools.DualMaterialToolPart; import tconstruct.weaponry.items.WeaponryPattern; -import tconstruct.weaponry.items.WeaponryToolPart; -import tconstruct.weaponry.library.weaponry.AmmoItem; -import tconstruct.weaponry.library.weaponry.AmmoWeapon; -import tconstruct.weaponry.library.weaponry.ArrowShaftMaterial; -import tconstruct.weaponry.library.weaponry.ProjectileWeapon; +import tconstruct.library.weaponry.AmmoItem; +import tconstruct.library.weaponry.AmmoWeapon; +import tconstruct.library.weaponry.ArrowShaftMaterial; +import tconstruct.library.weaponry.ProjectileWeapon; import tconstruct.weaponry.weapons.*; import java.util.Map; @@ -48,7 +48,6 @@ public class TinkerWeaponry { public static WeaponryCommonProxy proxy; // Throwing Weapons - public static ToolCore throwArrow; public static AmmoWeapon shuriken; public static AmmoWeapon throwingknife; public static AmmoWeapon javelin; @@ -62,11 +61,11 @@ public class TinkerWeaponry { public static AmmoItem boltAmmo; // Tool Parts - public static WeaponryToolPart partShuriken; - public static WeaponryToolPart partArrowShaft; // not craftable, used internally - public static WeaponryToolPart partBowLimb; - public static WeaponryToolPart partCrossbowLimb; - public static WeaponryToolPart partCrossbowBody; + public static DynamicToolPart partShuriken; + public static DynamicToolPart partArrowShaft; // not craftable, used internally + public static DynamicToolPart partBowLimb; + public static DynamicToolPart partCrossbowLimb; + public static DynamicToolPart partCrossbowBody; public static DualMaterialToolPart partBolt; // patterns/casts @@ -106,15 +105,14 @@ public class TinkerWeaponry { private void registerItems() { // create tool part - partShuriken = new WeaponryToolPart("_shuriken", "Shuriken"); - partArrowShaft = new WeaponryToolPart("_arrow_shaft", "Shaft"); - partBowLimb = new WeaponryToolPart("_bow_limb", "BowLimb"); - partCrossbowLimb = new WeaponryToolPart("_crossbow_limb", "CrossbowLimb"); - partCrossbowBody = new WeaponryToolPart("_crossbow_body", "CrossbowBody"); + partShuriken = new DynamicToolPart("_shuriken", "Shuriken"); + partArrowShaft = new DynamicToolPart("_arrow_shaft", "Shaft"); + partBowLimb = new DynamicToolPart("_bow_limb", "BowLimb"); + partCrossbowLimb = new DynamicToolPart("_crossbow_limb", "CrossbowLimb"); + partCrossbowBody = new DynamicToolPart("_crossbow_body", "CrossbowBody"); partBolt = new DualMaterialToolPart("_bolt", "Bolt"); // create throwing weapons - throwArrow = new ThrowArrowItem(); shuriken = new Shuriken(); throwingknife = new ThrowingKnife(); javelin = new Javelin(); @@ -136,7 +134,6 @@ public class TinkerWeaponry { GameRegistry.registerItem(partCrossbowBody, "CrossbowBodyPart"); GameRegistry.registerItem(partBolt, "BoltPart"); // register throwing weapons - GameRegistry.registerItem(throwArrow, "ThrowArrow"); GameRegistry.registerItem(shuriken, "Shuriken"); GameRegistry.registerItem(throwingknife, "ThrowingKnife"); GameRegistry.registerItem(javelin, "Javelin"); @@ -308,4 +305,18 @@ public class TinkerWeaponry { } } } + + private void setupCreativeTab() + { + ItemStack tool = new ItemStack(TinkerWeaponry.longbow, 1, 0); + + NBTTagCompound compound = new NBTTagCompound(); + compound.setTag("InfiTool", new NBTTagCompound()); + compound.getCompoundTag("InfiTool").setInteger("RenderHead", 0); + compound.getCompoundTag("InfiTool").setInteger("RenderHandle", 0); + compound.getCompoundTag("InfiTool").setInteger("RenderAccessory", 0); + tool.setTagCompound(compound); + + TConstructRegistry.weaponryTab.init(tool); + } } diff --git a/src/main/java/tconstruct/weaponry/WeaponryClientProxy.java b/src/main/java/tconstruct/weaponry/WeaponryClientProxy.java index 6588cd56..0cbd3c4c 100644 --- a/src/main/java/tconstruct/weaponry/WeaponryClientProxy.java +++ b/src/main/java/tconstruct/weaponry/WeaponryClientProxy.java @@ -1,15 +1,17 @@ package tconstruct.weaponry; +import tconstruct.client.AmmoItemRenderer; +import tconstruct.library.entity.ProjectileBase; import tconstruct.weaponry.client.AmmoSlotHandler; import tconstruct.weaponry.client.CrosshairHandler; import tconstruct.weaponry.client.RenderEventHandler; -import tconstruct.weaponry.client.entityrenderer.ArrowEntityRenderer; -import tconstruct.weaponry.client.entityrenderer.JavelinEntityRenderer; -import tconstruct.weaponry.client.entityrenderer.ProjectileBaseRenderer; -import tconstruct.weaponry.client.entityrenderer.ShurikenEntityRenderer; -import tconstruct.weaponry.client.renderer.*; +import tconstruct.weaponry.client.entity.ArrowEntityRenderer; +import tconstruct.weaponry.client.entity.JavelinEntityRenderer; +import tconstruct.weaponry.client.entity.ProjectileBaseRenderer; +import tconstruct.weaponry.client.entity.ShurikenEntityRenderer; +import tconstruct.weaponry.client.item.*; import tconstruct.weaponry.entity.*; -import tconstruct.weaponry.util.Reference; +import tconstruct.util.Reference; import cpw.mods.fml.client.registry.RenderingRegistry; import net.minecraft.item.ItemStack; import net.minecraftforge.client.MinecraftForgeClient; @@ -40,7 +42,6 @@ public class WeaponryClientProxy extends WeaponryCommonProxy { private void registerRenderers() { renderer = new AmmoItemRenderer(); - MinecraftForgeClient.registerItemRenderer(TinkerWeaponry.throwArrow, renderer); MinecraftForgeClient.registerItemRenderer(TinkerWeaponry.shuriken, renderer); MinecraftForgeClient.registerItemRenderer(TinkerWeaponry.throwingknife, new ThrowingKnifeRenderer()); MinecraftForgeClient.registerItemRenderer(TinkerWeaponry.javelin, new JavelinRenderer()); diff --git a/src/main/java/tconstruct/weaponry/WeaponryHandler.java b/src/main/java/tconstruct/weaponry/WeaponryHandler.java index 5c8b56ab..219a3b9f 100644 --- a/src/main/java/tconstruct/weaponry/WeaponryHandler.java +++ b/src/main/java/tconstruct/weaponry/WeaponryHandler.java @@ -2,11 +2,11 @@ package tconstruct.weaponry; import tconstruct.weaponry.ammo.ArrowAmmo; import tconstruct.weaponry.ammo.BoltAmmo; -import tconstruct.weaponry.items.DualMaterialToolPart; -import tconstruct.weaponry.library.weaponry.ArrowShaftMaterial; -import tconstruct.weaponry.library.weaponry.BowBaseAmmo; -import tconstruct.weaponry.library.weaponry.ProjectileWeapon; -import tconstruct.weaponry.library.weaponry.IAmmo; +import tconstruct.library.tools.DualMaterialToolPart; +import tconstruct.library.weaponry.ArrowShaftMaterial; +import tconstruct.library.weaponry.BowBaseAmmo; +import tconstruct.library.weaponry.ProjectileWeapon; +import tconstruct.library.weaponry.IAmmo; import tconstruct.weaponry.weapons.Crossbow; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import net.minecraft.item.Item; diff --git a/src/main/java/tconstruct/weaponry/ammo/ArrowAmmo.java b/src/main/java/tconstruct/weaponry/ammo/ArrowAmmo.java index e68e47cf..aae00f51 100644 --- a/src/main/java/tconstruct/weaponry/ammo/ArrowAmmo.java +++ b/src/main/java/tconstruct/weaponry/ammo/ArrowAmmo.java @@ -2,8 +2,8 @@ package tconstruct.weaponry.ammo; import tconstruct.TConstruct; import tconstruct.weaponry.TinkerWeaponry; -import tconstruct.weaponry.library.weaponry.AmmoItem; -import tconstruct.weaponry.util.Reference; +import tconstruct.library.weaponry.AmmoItem; +import tconstruct.util.Reference; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -49,11 +49,6 @@ public class ArrowAmmo extends AmmoItem { return "arrow"; } - @Override - public String getDefaultTexturePath() { - return Reference.RESOURCE + ":" + getDefaultFolder(); - } - @Override public void registerPartPaths (int index, String[] location) { diff --git a/src/main/java/tconstruct/weaponry/ammo/BoltAmmo.java b/src/main/java/tconstruct/weaponry/ammo/BoltAmmo.java index 4d75989c..297d4e7e 100644 --- a/src/main/java/tconstruct/weaponry/ammo/BoltAmmo.java +++ b/src/main/java/tconstruct/weaponry/ammo/BoltAmmo.java @@ -1,8 +1,8 @@ package tconstruct.weaponry.ammo; import tconstruct.weaponry.TinkerWeaponry; -import tconstruct.weaponry.items.DualMaterialToolPart; -import tconstruct.weaponry.library.weaponry.AmmoItem; +import tconstruct.library.tools.DualMaterialToolPart; +import tconstruct.library.weaponry.AmmoItem; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import tconstruct.library.crafting.ToolBuilder; diff --git a/src/main/java/tconstruct/weaponry/client/AmmoSlotHandler.java b/src/main/java/tconstruct/weaponry/client/AmmoSlotHandler.java index 1b1d3ba3..a36f6f4a 100644 --- a/src/main/java/tconstruct/weaponry/client/AmmoSlotHandler.java +++ b/src/main/java/tconstruct/weaponry/client/AmmoSlotHandler.java @@ -1,6 +1,6 @@ package tconstruct.weaponry.client; -import tconstruct.weaponry.library.weaponry.ProjectileWeapon; +import tconstruct.library.weaponry.ProjectileWeapon; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; diff --git a/src/main/java/tconstruct/weaponry/client/CrosshairHandler.java b/src/main/java/tconstruct/weaponry/client/CrosshairHandler.java index 6fe04498..df1d26ce 100644 --- a/src/main/java/tconstruct/weaponry/client/CrosshairHandler.java +++ b/src/main/java/tconstruct/weaponry/client/CrosshairHandler.java @@ -1,7 +1,7 @@ package tconstruct.weaponry.client; -import tconstruct.weaponry.util.Reference; -import tconstruct.weaponry.library.weaponry.IWindup; +import tconstruct.util.Reference; +import tconstruct.library.weaponry.IWindup; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.OpenGlHelper; diff --git a/src/main/java/tconstruct/weaponry/client/RenderEventHandler.java b/src/main/java/tconstruct/weaponry/client/RenderEventHandler.java index d68656fe..200ab7fa 100644 --- a/src/main/java/tconstruct/weaponry/client/RenderEventHandler.java +++ b/src/main/java/tconstruct/weaponry/client/RenderEventHandler.java @@ -1,8 +1,8 @@ package tconstruct.weaponry.client; import tconstruct.weaponry.TinkerWeaponry; -import tconstruct.weaponry.library.weaponry.BowBaseAmmo; -import tconstruct.weaponry.library.weaponry.IWindup; +import tconstruct.library.weaponry.BowBaseAmmo; +import tconstruct.library.weaponry.IWindup; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import net.minecraft.item.ItemStack; import net.minecraftforge.client.event.FOVUpdateEvent; diff --git a/src/main/java/tconstruct/weaponry/client/entityrenderer/ArrowEntityRenderer.java b/src/main/java/tconstruct/weaponry/client/entity/ArrowEntityRenderer.java similarity index 96% rename from src/main/java/tconstruct/weaponry/client/entityrenderer/ArrowEntityRenderer.java rename to src/main/java/tconstruct/weaponry/client/entity/ArrowEntityRenderer.java index f0098ba4..066675d7 100644 --- a/src/main/java/tconstruct/weaponry/client/entityrenderer/ArrowEntityRenderer.java +++ b/src/main/java/tconstruct/weaponry/client/entity/ArrowEntityRenderer.java @@ -1,4 +1,4 @@ -package tconstruct.weaponry.client.entityrenderer; +package tconstruct.weaponry.client.entity; import tconstruct.weaponry.entity.ArrowEntity; import org.lwjgl.opengl.GL11; diff --git a/src/main/java/tconstruct/weaponry/client/entityrenderer/JavelinEntityRenderer.java b/src/main/java/tconstruct/weaponry/client/entity/JavelinEntityRenderer.java similarity index 94% rename from src/main/java/tconstruct/weaponry/client/entityrenderer/JavelinEntityRenderer.java rename to src/main/java/tconstruct/weaponry/client/entity/JavelinEntityRenderer.java index b328e60e..796e4a0f 100644 --- a/src/main/java/tconstruct/weaponry/client/entityrenderer/JavelinEntityRenderer.java +++ b/src/main/java/tconstruct/weaponry/client/entity/JavelinEntityRenderer.java @@ -1,4 +1,4 @@ -package tconstruct.weaponry.client.entityrenderer; +package tconstruct.weaponry.client.entity; import tconstruct.weaponry.entity.JavelinEntity; import org.lwjgl.opengl.GL11; diff --git a/src/main/java/tconstruct/weaponry/client/entityrenderer/ProjectileBaseRenderer.java b/src/main/java/tconstruct/weaponry/client/entity/ProjectileBaseRenderer.java similarity index 95% rename from src/main/java/tconstruct/weaponry/client/entityrenderer/ProjectileBaseRenderer.java rename to src/main/java/tconstruct/weaponry/client/entity/ProjectileBaseRenderer.java index a4cc34ae..02f77bec 100644 --- a/src/main/java/tconstruct/weaponry/client/entityrenderer/ProjectileBaseRenderer.java +++ b/src/main/java/tconstruct/weaponry/client/entity/ProjectileBaseRenderer.java @@ -1,7 +1,7 @@ -package tconstruct.weaponry.client.entityrenderer; +package tconstruct.weaponry.client.entity; -import tconstruct.weaponry.client.renderer.FlexibleToolRenderer; -import tconstruct.weaponry.entity.ProjectileBase; +import tconstruct.client.FlexibleToolRenderer; +import tconstruct.library.entity.ProjectileBase; import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.entity.Entity; diff --git a/src/main/java/tconstruct/weaponry/client/entityrenderer/ShurikenEntityRenderer.java b/src/main/java/tconstruct/weaponry/client/entity/ShurikenEntityRenderer.java similarity index 94% rename from src/main/java/tconstruct/weaponry/client/entityrenderer/ShurikenEntityRenderer.java rename to src/main/java/tconstruct/weaponry/client/entity/ShurikenEntityRenderer.java index e085e1c7..ff6ed7c4 100644 --- a/src/main/java/tconstruct/weaponry/client/entityrenderer/ShurikenEntityRenderer.java +++ b/src/main/java/tconstruct/weaponry/client/entity/ShurikenEntityRenderer.java @@ -1,4 +1,4 @@ -package tconstruct.weaponry.client.entityrenderer; +package tconstruct.weaponry.client.entity; import tconstruct.weaponry.entity.ShurikenEntity; import org.lwjgl.opengl.GL11; diff --git a/src/main/java/tconstruct/weaponry/client/renderer/BowRenderer.java b/src/main/java/tconstruct/weaponry/client/item/BowRenderer.java similarity index 96% rename from src/main/java/tconstruct/weaponry/client/renderer/BowRenderer.java rename to src/main/java/tconstruct/weaponry/client/item/BowRenderer.java index bec766b7..6c3d9181 100644 --- a/src/main/java/tconstruct/weaponry/client/renderer/BowRenderer.java +++ b/src/main/java/tconstruct/weaponry/client/item/BowRenderer.java @@ -1,10 +1,11 @@ -package tconstruct.weaponry.client.renderer; +package tconstruct.weaponry.client.item; +import tconstruct.client.FlexibleToolRenderer; import tconstruct.weaponry.TinkerWeaponry; import tconstruct.weaponry.ammo.ArrowAmmo; import tconstruct.weaponry.entity.ArrowEntity; -import tconstruct.weaponry.library.weaponry.ProjectileWeapon; -import tconstruct.weaponry.library.weaponry.IWindup; +import tconstruct.library.weaponry.ProjectileWeapon; +import tconstruct.library.weaponry.IWindup; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.RenderManager; diff --git a/src/main/java/tconstruct/weaponry/client/renderer/CrossbowRenderer.java b/src/main/java/tconstruct/weaponry/client/item/CrossbowRenderer.java similarity index 96% rename from src/main/java/tconstruct/weaponry/client/renderer/CrossbowRenderer.java rename to src/main/java/tconstruct/weaponry/client/item/CrossbowRenderer.java index 1fc398fe..315ef543 100644 --- a/src/main/java/tconstruct/weaponry/client/renderer/CrossbowRenderer.java +++ b/src/main/java/tconstruct/weaponry/client/item/CrossbowRenderer.java @@ -1,5 +1,6 @@ -package tconstruct.weaponry.client.renderer; +package tconstruct.weaponry.client.item; +import tconstruct.client.FlexibleToolRenderer; import tconstruct.weaponry.entity.ArrowEntity; import tconstruct.weaponry.entity.BoltEntity; import tconstruct.weaponry.weapons.Crossbow; diff --git a/src/main/java/tconstruct/weaponry/client/renderer/JavelinRenderer.java b/src/main/java/tconstruct/weaponry/client/item/JavelinRenderer.java similarity index 84% rename from src/main/java/tconstruct/weaponry/client/renderer/JavelinRenderer.java rename to src/main/java/tconstruct/weaponry/client/item/JavelinRenderer.java index 2f10315d..e2b231eb 100644 --- a/src/main/java/tconstruct/weaponry/client/renderer/JavelinRenderer.java +++ b/src/main/java/tconstruct/weaponry/client/item/JavelinRenderer.java @@ -1,6 +1,7 @@ -package tconstruct.weaponry.client.renderer; +package tconstruct.weaponry.client.item; -import tconstruct.weaponry.library.weaponry.IWindup; +import tconstruct.client.AmmoItemRenderer; +import tconstruct.library.weaponry.IWindup; import net.minecraft.client.Minecraft; import net.minecraft.item.ItemStack; import org.lwjgl.opengl.GL11; diff --git a/src/main/java/tconstruct/weaponry/client/renderer/ThrowingKnifeRenderer.java b/src/main/java/tconstruct/weaponry/client/item/ThrowingKnifeRenderer.java similarity index 95% rename from src/main/java/tconstruct/weaponry/client/renderer/ThrowingKnifeRenderer.java rename to src/main/java/tconstruct/weaponry/client/item/ThrowingKnifeRenderer.java index f8583b1d..41f5bb7a 100644 --- a/src/main/java/tconstruct/weaponry/client/renderer/ThrowingKnifeRenderer.java +++ b/src/main/java/tconstruct/weaponry/client/item/ThrowingKnifeRenderer.java @@ -1,6 +1,7 @@ -package tconstruct.weaponry.client.renderer; +package tconstruct.weaponry.client.item; -import tconstruct.weaponry.library.weaponry.IWindup; +import tconstruct.client.AmmoItemRenderer; +import tconstruct.library.weaponry.IWindup; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.entity.RenderPlayer; diff --git a/src/main/java/tconstruct/weaponry/entity/ArrowEntity.java b/src/main/java/tconstruct/weaponry/entity/ArrowEntity.java index 562e35fb..e8c8264d 100644 --- a/src/main/java/tconstruct/weaponry/entity/ArrowEntity.java +++ b/src/main/java/tconstruct/weaponry/entity/ArrowEntity.java @@ -1,9 +1,7 @@ package tconstruct.weaponry.entity; -import tconstruct.weaponry.library.util.PiercingArrowDamage; -import cpw.mods.fml.common.network.ByteBufUtils; -import io.netty.buffer.ByteBuf; -import net.minecraft.client.Minecraft; +import tconstruct.library.entity.ProjectileBase; +import tconstruct.library.util.PiercingArrowDamage; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -12,7 +10,6 @@ import net.minecraft.util.DamageSource; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; import tconstruct.TConstruct; -import tconstruct.library.tools.AbilityHelper; import tconstruct.library.tools.ToolCore; public class ArrowEntity extends ProjectileBase { diff --git a/src/main/java/tconstruct/weaponry/entity/JavelinEntity.java b/src/main/java/tconstruct/weaponry/entity/JavelinEntity.java index 3a3547e2..81a96c78 100644 --- a/src/main/java/tconstruct/weaponry/entity/JavelinEntity.java +++ b/src/main/java/tconstruct/weaponry/entity/JavelinEntity.java @@ -1,5 +1,6 @@ package tconstruct.weaponry.entity; +import tconstruct.library.entity.ProjectileBase; import tconstruct.weaponry.TinkerWeaponry; import io.netty.buffer.ByteBuf; import net.minecraft.entity.player.EntityPlayer; diff --git a/src/main/java/tconstruct/weaponry/entity/ShurikenEntity.java b/src/main/java/tconstruct/weaponry/entity/ShurikenEntity.java index 02f3f5d9..4675fbf1 100644 --- a/src/main/java/tconstruct/weaponry/entity/ShurikenEntity.java +++ b/src/main/java/tconstruct/weaponry/entity/ShurikenEntity.java @@ -1,5 +1,6 @@ package tconstruct.weaponry.entity; +import tconstruct.library.entity.ProjectileBase; import tconstruct.weaponry.TinkerWeaponry; import io.netty.buffer.ByteBuf; import net.minecraft.entity.player.EntityPlayer; diff --git a/src/main/java/tconstruct/weaponry/entity/ThrowingKnifeEntity.java b/src/main/java/tconstruct/weaponry/entity/ThrowingKnifeEntity.java index 3226f6b7..e0768e0c 100644 --- a/src/main/java/tconstruct/weaponry/entity/ThrowingKnifeEntity.java +++ b/src/main/java/tconstruct/weaponry/entity/ThrowingKnifeEntity.java @@ -1,5 +1,6 @@ package tconstruct.weaponry.entity; +import tconstruct.library.entity.ProjectileBase; import tconstruct.weaponry.TinkerWeaponry; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; diff --git a/src/main/java/tconstruct/weaponry/items/CustomToolPart.java b/src/main/java/tconstruct/weaponry/items/CustomToolPart.java deleted file mode 100644 index 7a01cbb6..00000000 --- a/src/main/java/tconstruct/weaponry/items/CustomToolPart.java +++ /dev/null @@ -1,26 +0,0 @@ -package tconstruct.weaponry.items; - -import net.minecraft.item.ItemStack; -import tconstruct.TConstruct; -import tconstruct.library.TConstructRegistry; -import tconstruct.library.tools.CustomMaterial; -import tconstruct.library.tools.DynamicToolPart; - -public class CustomToolPart extends WeaponryToolPart { - private final Class customMat; - - public CustomToolPart(String texture, String name, Class customMatClass) { - super(texture, name); - - this.customMat = customMatClass; - } - - @Override - public int getMaterialID (ItemStack stack) - { - if(TConstructRegistry.getCustomMaterial(stack.getItemDamage(), customMat) != null) - return stack.getItemDamage(); - - return -1; - } -} diff --git a/src/main/java/tconstruct/weaponry/items/WeaponryPattern.java b/src/main/java/tconstruct/weaponry/items/WeaponryPattern.java index c72e77e8..9de1b572 100644 --- a/src/main/java/tconstruct/weaponry/items/WeaponryPattern.java +++ b/src/main/java/tconstruct/weaponry/items/WeaponryPattern.java @@ -1,11 +1,9 @@ package tconstruct.weaponry.items; -import tconstruct.weaponry.util.Reference; +import tconstruct.util.Reference; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import tconstruct.library.TConstructRegistry; -import tconstruct.library.crafting.PatternBuilder; import tconstruct.tools.items.Pattern; import java.util.List; @@ -15,7 +13,6 @@ public class WeaponryPattern extends Pattern { public WeaponryPattern(String patternType, String name) { super(patternName, getPatternNames(patternName, patternType), "patterns/"); - this.modTexPrefix = Reference.RESOURCE; this.setUnlocalizedName(Reference.prefix(name)); } diff --git a/src/main/java/tconstruct/weaponry/items/WeaponryToolPart.java b/src/main/java/tconstruct/weaponry/items/WeaponryToolPart.java deleted file mode 100644 index c5c100ae..00000000 --- a/src/main/java/tconstruct/weaponry/items/WeaponryToolPart.java +++ /dev/null @@ -1,14 +0,0 @@ -package tconstruct.weaponry.items; - -import tconstruct.weaponry.TinkerWeaponry; -import tconstruct.weaponry.util.Reference; -import tconstruct.library.tools.DynamicToolPart; - -public class WeaponryToolPart extends DynamicToolPart { - public WeaponryToolPart(String textureType, String name) { - super(textureType, name, Reference.RESOURCE); - - this.setUnlocalizedName(Reference.prefix(name)); - this.setCreativeTab(TinkerWeaponry.creativeTab); - } -} diff --git a/src/main/java/tconstruct/weaponry/util/Config.java b/src/main/java/tconstruct/weaponry/util/Config.java deleted file mode 100644 index c01a3430..00000000 --- a/src/main/java/tconstruct/weaponry/util/Config.java +++ /dev/null @@ -1,4 +0,0 @@ -package tconstruct.weaponry.util; - -public class Config { -} diff --git a/src/main/java/tconstruct/weaponry/weapons/Crossbow.java b/src/main/java/tconstruct/weaponry/weapons/Crossbow.java index 398b1c3b..c5bfaf2e 100644 --- a/src/main/java/tconstruct/weaponry/weapons/Crossbow.java +++ b/src/main/java/tconstruct/weaponry/weapons/Crossbow.java @@ -3,10 +3,10 @@ package tconstruct.weaponry.weapons; import tconstruct.weaponry.TinkerWeaponry; import tconstruct.weaponry.ammo.BoltAmmo; import tconstruct.weaponry.entity.BoltEntity; -import tconstruct.weaponry.library.weaponry.AmmoItem; -import tconstruct.weaponry.library.weaponry.ProjectileWeapon; -import tconstruct.weaponry.util.Reference; -import tconstruct.weaponry.library.weaponry.IAmmo; +import tconstruct.library.weaponry.AmmoItem; +import tconstruct.library.weaponry.ProjectileWeapon; +import tconstruct.util.Reference; +import tconstruct.library.weaponry.IAmmo; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityArrow; diff --git a/src/main/java/tconstruct/weaponry/weapons/Javelin.java b/src/main/java/tconstruct/weaponry/weapons/Javelin.java index f30c028a..7b9ef448 100644 --- a/src/main/java/tconstruct/weaponry/weapons/Javelin.java +++ b/src/main/java/tconstruct/weaponry/weapons/Javelin.java @@ -1,7 +1,7 @@ package tconstruct.weaponry.weapons; import tconstruct.weaponry.entity.JavelinEntity; -import tconstruct.weaponry.library.weaponry.AmmoWeapon; +import tconstruct.library.weaponry.AmmoWeapon; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; diff --git a/src/main/java/tconstruct/weaponry/weapons/LongBow.java b/src/main/java/tconstruct/weaponry/weapons/LongBow.java index 9ffbd7a8..88ef29e5 100644 --- a/src/main/java/tconstruct/weaponry/weapons/LongBow.java +++ b/src/main/java/tconstruct/weaponry/weapons/LongBow.java @@ -2,7 +2,7 @@ package tconstruct.weaponry.weapons; import tconstruct.weaponry.TinkerWeaponry; import tconstruct.weaponry.ammo.ArrowAmmo; -import tconstruct.weaponry.library.weaponry.BowBaseAmmo; +import tconstruct.library.weaponry.BowBaseAmmo; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; diff --git a/src/main/java/tconstruct/weaponry/weapons/ShortBow.java b/src/main/java/tconstruct/weaponry/weapons/ShortBow.java index a96182a9..fa5a61d4 100644 --- a/src/main/java/tconstruct/weaponry/weapons/ShortBow.java +++ b/src/main/java/tconstruct/weaponry/weapons/ShortBow.java @@ -2,7 +2,7 @@ package tconstruct.weaponry.weapons; import tconstruct.weaponry.TinkerWeaponry; import tconstruct.weaponry.ammo.ArrowAmmo; -import tconstruct.weaponry.library.weaponry.BowBaseAmmo; +import tconstruct.library.weaponry.BowBaseAmmo; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; diff --git a/src/main/java/tconstruct/weaponry/weapons/Shuriken.java b/src/main/java/tconstruct/weaponry/weapons/Shuriken.java index 46810518..143ef074 100644 --- a/src/main/java/tconstruct/weaponry/weapons/Shuriken.java +++ b/src/main/java/tconstruct/weaponry/weapons/Shuriken.java @@ -2,9 +2,9 @@ package tconstruct.weaponry.weapons; import tconstruct.weaponry.TinkerWeaponry; import tconstruct.weaponry.client.CrosshairType; -import tconstruct.weaponry.client.IconFlipped; +import tconstruct.client.IconFlipped; import tconstruct.weaponry.entity.ShurikenEntity; -import tconstruct.weaponry.library.weaponry.AmmoWeapon; +import tconstruct.library.weaponry.AmmoWeapon; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; diff --git a/src/main/java/tconstruct/weaponry/weapons/ThrowArrow.java b/src/main/java/tconstruct/weaponry/weapons/ThrowArrow.java deleted file mode 100644 index 3e225d08..00000000 --- a/src/main/java/tconstruct/weaponry/weapons/ThrowArrow.java +++ /dev/null @@ -1,92 +0,0 @@ -package tconstruct.weaponry.weapons; - -import tconstruct.weaponry.entity.ArrowEntity; -import tconstruct.weaponry.library.weaponry.AmmoWeapon; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import tconstruct.tools.TinkerTools; - -public class ThrowArrow extends AmmoWeapon { - public ThrowArrow() { - super(1, "ThrowArrow"); - - headIcons = TinkerTools.arrow.headIcons; - handleIcons = TinkerTools.arrow.handleIcons; - accessoryIcons = TinkerTools.arrow.accessoryIcons; - extraIcons = TinkerTools.arrow.extraIcons; - } - - @Override - public String getIconSuffix (int partType) - { - switch (partType) - { - case 0: - return "_arrow_head"; - case 1: - return ""; // Doesn't break - case 2: - return "_arrow_shaft"; - case 3: - case 4: - return "_arrow_fletching"; - default: - return ""; - } - } - - @Override - public String getEffectSuffix () - { - return "_arrow_effect"; - } - - @Override - public String getDefaultFolder () - { - return "arrow"; - } - - @Override - public int getPartAmount() { - return 4; - } - - @Override - public Item getHeadItem () - { - return TinkerTools.arrowhead; - } - - @Override - public Item getAccessoryItem () - { - return TinkerTools.fletching; - } - - @Override - public Item getExtraItem () - { - return TinkerTools.fletching; - } - - @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { - ItemStack reference = stack.copy(); - reference.stackSize = 1; - Entity projectile = new ArrowEntity(world, player, 1.9f, 0f, reference); - - if(!world.isRemote) - world.spawnEntityInWorld(projectile); - - return stack; - } - - @Override - protected Entity createProjectile(ItemStack reference, World world, EntityPlayer player, float accuracy) { - return new ArrowEntity(world, player, 1.0f, accuracy, reference); - } -} diff --git a/src/main/java/tconstruct/weaponry/weapons/ThrowArrowItem.java b/src/main/java/tconstruct/weaponry/weapons/ThrowArrowItem.java deleted file mode 100644 index 1384f15d..00000000 --- a/src/main/java/tconstruct/weaponry/weapons/ThrowArrowItem.java +++ /dev/null @@ -1,128 +0,0 @@ -package tconstruct.weaponry.weapons; - -import tconstruct.weaponry.entity.ArrowEntity; -import tconstruct.weaponry.util.Reference; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityArrow; -import net.minecraft.item.EnumAction; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import tconstruct.library.crafting.ToolBuilder; -import tconstruct.library.tools.Weapon; -import tconstruct.tools.TinkerTools; - -import java.util.List; - -public class ThrowArrowItem extends Weapon { - public ThrowArrowItem() { - super(1); - this.setUnlocalizedName(Reference.prefix("ThrowArrow")); - - headIcons = TinkerTools.arrow.headIcons; - handleIcons = TinkerTools.arrow.handleIcons; - accessoryIcons = TinkerTools.arrow.accessoryIcons; - extraIcons = TinkerTools.arrow.extraIcons; - } - - @Override - public ItemStack onItemRightClick (ItemStack itemstack, World world, EntityPlayer player) - { - ItemStack stack = itemstack.copy(); - if (!world.isRemote) - { - EntityArrow arrow = new ArrowEntity(world, player, 1.0f, 1.0f, stack); - world.spawnEntityInWorld(arrow); - } - - return itemstack; - } - - @Override - public String getIconSuffix (int partType) - { - switch (partType) - { - case 0: - return "_arrow_head"; - case 1: - return ""; // Doesn't break - case 2: - return "_arrow_shaft"; - case 3: - return "_arrow_fletching"; - default: - return ""; - } - } - - @Override - public String getEffectSuffix () - { - return "_arrow_effect"; - } - - @Override - public String getDefaultFolder () - { - return "arrow"; - } - - @Override - public void registerPartPaths (int index, String[] location) - { - headStrings.put(index, location[0]); - handleStrings.put(index, location[2]); - } - - @Override - public void registerAlternatePartPaths (int index, String[] location) - { - accessoryStrings.put(index, location[3]); - } - - @Override - public Item getHeadItem () - { - return TinkerTools.arrowhead; - } - - @Override - public Item getAccessoryItem () - { - return TinkerTools.fletching; - } - - @Override - public EnumAction getItemUseAction (ItemStack par1ItemStack) - { - return EnumAction.bow; - } - - @Override - public String[] getTraits () - { - return new String[] { "weapon", "throwing" }; - } - - @Override - public void getSubItems (Item id, CreativeTabs tab, List list) - { - ItemStack toolMine = new ItemStack(this); - - Item accessory = getAccessoryItem(); - ItemStack accessoryStack = accessory != null ? new ItemStack(getAccessoryItem(), 1, 0) : null; - Item extra = getExtraItem(); - ItemStack extraStack = extra != null ? new ItemStack(extra, 1, 0) : null; - ItemStack tool = ToolBuilder.instance.buildTool(new ItemStack(getHeadItem(), 1, 3), new ItemStack(getHandleItem(), 1, 0), accessoryStack, extraStack, ""); - if (tool != null) - { - tool.stackSize = 1; - tool.getTagCompound().getCompoundTag("InfiTool").setBoolean("Built", true); - - toolMine.setTagCompound(tool.getTagCompound()); - list.add(toolMine); - } - } -} diff --git a/src/main/java/tconstruct/weaponry/weapons/ThrowingKnife.java b/src/main/java/tconstruct/weaponry/weapons/ThrowingKnife.java index 7bfde93a..ea3a6af5 100644 --- a/src/main/java/tconstruct/weaponry/weapons/ThrowingKnife.java +++ b/src/main/java/tconstruct/weaponry/weapons/ThrowingKnife.java @@ -2,7 +2,7 @@ package tconstruct.weaponry.weapons; import tconstruct.weaponry.client.CrosshairType; import tconstruct.weaponry.entity.ThrowingKnifeEntity; -import tconstruct.weaponry.library.weaponry.AmmoWeapon; +import tconstruct.library.weaponry.AmmoWeapon; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.entity.Entity;