mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-22 05:02:39 +00:00
Lots of integration. Graphics n stuff. Items. Everything.
This commit is contained in:
1 parent
4bb32da4c8
commit
0bdf31912b
48 files changed
+119
-384
No files matched your search
+2
-2
@@ -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;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package tconstruct.weaponry.client.renderer;
|
||||
package tconstruct.client;
|
||||
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.entity.Entity;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package tconstruct.weaponry.client;
|
||||
package tconstruct.client;
|
||||
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
@@ -26,6 +26,7 @@ public class TConstructRegistry
|
||||
public static TConstructCreativeTab materialTab;
|
||||
public static TConstructCreativeTab blockTab;
|
||||
public static TConstructCreativeTab equipableTab;
|
||||
public static TConstructCreativeTab weaponryTab;
|
||||
|
||||
/* Items */
|
||||
|
||||
|
||||
+3
-3
@@ -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;
|
||||
+2
-4
@@ -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;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package tconstruct.weaponry.library.util;
|
||||
package tconstruct.library.util;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.EntityDamageSourceIndirect;
|
||||
+4
-9
@@ -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();
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package tconstruct.weaponry.library.weaponry;
|
||||
package tconstruct.library.weaponry;
|
||||
|
||||
import tconstruct.weaponry.client.CrosshairType;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package tconstruct.weaponry.library.weaponry;
|
||||
package tconstruct.library.weaponry;
|
||||
|
||||
import tconstruct.weaponry.TinkerWeaponry;
|
||||
import net.minecraft.item.Item;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package tconstruct.weaponry.library.weaponry;
|
||||
package tconstruct.library.weaponry;
|
||||
|
||||
import tconstruct.weaponry.ammo.ArrowAmmo;
|
||||
import tconstruct.weaponry.entity.ArrowEntity;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package tconstruct.weaponry.library.weaponry;
|
||||
package tconstruct.library.weaponry;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package tconstruct.weaponry.library.weaponry;
|
||||
package tconstruct.library.weaponry;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package tconstruct.weaponry.library.weaponry;
|
||||
package tconstruct.library.weaponry;
|
||||
|
||||
import tconstruct.weaponry.client.CrosshairType;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
+5
-9
@@ -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
|
||||
+6
-5
@@ -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);}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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());
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package tconstruct.weaponry.client.entityrenderer;
|
||||
package tconstruct.weaponry.client.entity;
|
||||
|
||||
import tconstruct.weaponry.entity.ArrowEntity;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package tconstruct.weaponry.client.entityrenderer;
|
||||
package tconstruct.weaponry.client.entity;
|
||||
|
||||
import tconstruct.weaponry.entity.JavelinEntity;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
+3
-3
@@ -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;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package tconstruct.weaponry.client.entityrenderer;
|
||||
package tconstruct.weaponry.client.entity;
|
||||
|
||||
import tconstruct.weaponry.entity.ShurikenEntity;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
+4
-3
@@ -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;
|
||||
+2
-1
@@ -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;
|
||||
+3
-2
@@ -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;
|
||||
+3
-2
@@ -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;
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<? extends CustomMaterial> customMat;
|
||||
|
||||
public CustomToolPart(String texture, String name, Class<? extends CustomMaterial> 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;
|
||||
}
|
||||
}
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
package tconstruct.weaponry.util;
|
||||
|
||||
public class Config {
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user