diff --git a/build.properties b/build.properties index 396ef364..cdfcb53f 100644 --- a/build.properties +++ b/build.properties @@ -1,6 +1,6 @@ -minecraft_version=1.7.10 -forge_version=10.13.0.1198 -mod_version=1.15.0 +minecraft_version=1.8 +forge_version=11.14.1.1412 +mod_version=1.16.0 mod_author=BalkondeurAlpha mod_basename=weaponmod mod_builder_tok=gitbuild diff --git a/src/main/java/ckathode/weaponmod/AdvancedExplosion.java b/src/main/java/ckathode/weaponmod/AdvancedExplosion.java index 366748f0..a1b0cdfd 100644 --- a/src/main/java/ckathode/weaponmod/AdvancedExplosion.java +++ b/src/main/java/ckathode/weaponmod/AdvancedExplosion.java @@ -5,29 +5,37 @@ import java.util.Random; import java.util.Set; +import com.google.common.collect.Lists; import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.init.Blocks; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; -import net.minecraft.world.ChunkPosition; +import net.minecraft.util.*; import net.minecraft.world.Explosion; import net.minecraft.world.World; +import net.minecraft.util.EnumParticleTypes; +import org.lwjgl.Sys; public class AdvancedExplosion extends Explosion { public World worldObj; protected boolean blocksCalculated; - - public AdvancedExplosion(World world, Entity entity, double d, double d1, double d2, float f) + protected double explosionX, explosionY, explosionZ; + public float explosionSize; + public List affectedBlockPositions; + public Entity exploder; + + public AdvancedExplosion(World world, Entity exploder, double explosionX, double explosionY, double explosionZ, float explosionSize, boolean isFlaming, boolean isSmoking) { - super(world, entity, d, d1, d2, f); + super(world, exploder, explosionX, explosionY, explosionZ, explosionSize, isFlaming, isSmoking); + this.explosionSize = explosionSize; + this.explosionX = explosionX; + this.explosionY = explosionY; + this.explosionZ = explosionZ; + affectedBlockPositions = Lists.newArrayList(); worldObj = world; } - public void setAffectedBlockPositions(List list) + public void setAffectedBlockPositions(List list) { affectedBlockPositions = list; blocksCalculated = true; @@ -48,8 +56,8 @@ public void doEntityExplosion(DamageSource damagesource) int k0 = MathHelper.floor_double(explosionZ - size - 1.0D); int k1 = MathHelper.floor_double(explosionZ + size + 1.0D); @SuppressWarnings("unchecked") - List list = worldObj.getEntitiesWithinAABBExcludingEntity(exploder, AxisAlignedBB.getBoundingBox(i0, j0, k0, i1, j1, k1)); - Vec3 vec31 = Vec3.createVectorHelper(explosionX, explosionY, explosionZ); + List list = worldObj.getEntitiesWithinAABBExcludingEntity(exploder, AxisAlignedBB.fromBounds(i0, j0, k0, i1, j1, k1)); + Vec3 vec31 = new Vec3(explosionX, explosionY, explosionZ); double dx; double dy; @@ -72,7 +80,7 @@ public void doEntityExplosion(DamageSource damagesource) dx /= d; dy /= d; dz /= d; - double dens = worldObj.getBlockDensity(vec31, entity.boundingBox); + double dens = worldObj.getBlockDensity(vec31, entity.getEntityBoundingBox()); double var36 = (1.0D - dr) * dens; int damage = (int) ((var36 * var36 + var36) / 2.0D * 8.0D * size + 1D); entity.attackEntityFrom(damagesource, damage); @@ -92,20 +100,18 @@ public void doBlockExplosion() } for (int i = affectedBlockPositions.size() - 1; i >= 0; i--) { - ChunkPosition chunkposition = (ChunkPosition) affectedBlockPositions.get(i); - int x = chunkposition.chunkPosX; - int y = chunkposition.chunkPosY; - int z = chunkposition.chunkPosZ; - Block block = worldObj.getBlock(x, y, z); + BlockPos blockposition = (BlockPos) affectedBlockPositions.get(i); + + Block block = worldObj.getBlockState(blockposition).getBlock(); if (block != null) { if (block.canDropFromExplosion(this)) { - block.dropBlockAsItemWithChance(worldObj, x, y, z, worldObj.getBlockMetadata(x, y, z), 1F / explosionSize, 0); + block.dropBlockAsItemWithChance(worldObj, blockposition, worldObj.getBlockState(blockposition), 1F / explosionSize, 0); } - worldObj.setBlock(x, y, z, Blocks.air, 0, 3); - block.onBlockDestroyedByExplosion(worldObj, x, y, z, this); + worldObj.setBlockToAir(blockposition); + block.onBlockDestroyedByExplosion(worldObj, blockposition, this); } } } @@ -115,7 +121,7 @@ public void doParticleExplosion(boolean smallparticles, boolean bigparticles) worldObj.playSoundEffect(explosionX, explosionY, explosionZ, "random.explode", 4F, (1.0F + (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()) * 0.2F) * 0.7F); if (bigparticles) { - worldObj.spawnParticle("hugeexplosion", explosionX, explosionY, explosionZ, 0.0D, 0.0D, 0.0D); + worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_HUGE, explosionX, explosionY, explosionZ, 0.0D, 0.0D, 0.0D); } if (!smallparticles) return; @@ -126,11 +132,11 @@ public void doParticleExplosion(boolean smallparticles, boolean bigparticles) for (int i = affectedBlockPositions.size() - 1; i >= 0; i--) { - ChunkPosition chunkposition = (ChunkPosition) affectedBlockPositions.get(i); - int j = chunkposition.chunkPosX; - int k = chunkposition.chunkPosY; - int l = chunkposition.chunkPosZ; - //int i1 = worldObj.getBlockId(j, k, l); + BlockPos chunkposition = (BlockPos) affectedBlockPositions.get(i); + int j = (int) chunkposition.getX(); + int k = (int) chunkposition.getY(); + int l = (int) chunkposition.getZ(); + //Block i1 = worldObj.getBlockState(new BlockPos(j, k, l)).getBlock(); double px = j + worldObj.rand.nextFloat(); double py = k + worldObj.rand.nextFloat(); double pz = l + worldObj.rand.nextFloat(); @@ -146,8 +152,8 @@ public void doParticleExplosion(boolean smallparticles, boolean bigparticles) dx *= d7; dy *= d7; dz *= d7; - worldObj.spawnParticle("explode", (px + explosionX * 1.0D) / 2D, (py + explosionY * 1.0D) / 2D, (pz + explosionZ * 1.0D) / 2D, dx, dy, dz); - worldObj.spawnParticle("smoke", px, py, pz, dx, dy, dz); + worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_NORMAL, (px + explosionX * 1.0D) / 2D, (py + explosionY * 1.0D) / 2D, (pz + explosionZ * 1.0D) / 2D, dx, dy, dz); + worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, px, py, pz, dx, dy, dz); } } @@ -155,7 +161,7 @@ public void doParticleExplosion(boolean smallparticles, boolean bigparticles) protected void calculateBlockExplosion() { byte maxsize = 16; - Set set = new HashSet(); + Set set = new HashSet(); int i; int j; int k; @@ -182,22 +188,20 @@ protected void calculateBlockExplosion() dx = explosionX; dy = explosionY; dz = explosionZ; - for (float f = 0.3F; strength > 0.0F; strength -= f * 0.75F) { int x = MathHelper.floor_double(dx); int y = MathHelper.floor_double(dy); int z = MathHelper.floor_double(dz); - Block block = worldObj.getBlock(x, y, z); - - if (block != null) + Block block = worldObj.getBlockState(new BlockPos(x, y, z)).getBlock(); + + if (block != Blocks.air) { - strength -= (block.getExplosionResistance(exploder, worldObj, x, y, z, explosionX, explosionY, explosionZ) + 0.3F) * f; + strength -= (block.getExplosionResistance(exploder)+0.3F)*f; } - if (strength > 0.0F) { - set.add(new ChunkPosition(x, y, z)); + set.add(new BlockPos(x, y, z)); } dx += rx * f; diff --git a/src/main/java/ckathode/weaponmod/BalkonsWeaponMod.java b/src/main/java/ckathode/weaponmod/BalkonsWeaponMod.java index 339690d8..0dd6263c 100644 --- a/src/main/java/ckathode/weaponmod/BalkonsWeaponMod.java +++ b/src/main/java/ckathode/weaponmod/BalkonsWeaponMod.java @@ -1,11 +1,17 @@ package ckathode.weaponmod; import net.minecraft.block.BlockDispenser; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.ItemModelMesher; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.fml.common.FMLCommonHandler; +import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.oredict.ShapedOreRecipe; import org.apache.logging.log4j.Logger; @@ -57,28 +63,28 @@ import ckathode.weaponmod.item.RangedCompFlintlock; import ckathode.weaponmod.item.WMItem; import ckathode.weaponmod.network.WMMessagePipeline; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.Mod.Instance; -import cpw.mods.fml.common.SidedProxy; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.registry.EntityRegistry; -import cpw.mods.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.fml.common.Mod.EventHandler; +import net.minecraftforge.fml.common.Mod.Instance; +import net.minecraftforge.fml.common.SidedProxy; +import net.minecraftforge.fml.common.event.FMLInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; +import net.minecraftforge.fml.common.registry.EntityRegistry; +import net.minecraftforge.fml.common.registry.GameRegistry; @Mod(modid = BalkonsWeaponMod.MOD_ID, name = BalkonsWeaponMod.MOD_NAME, version = BalkonsWeaponMod.MOD_VERSION) public class BalkonsWeaponMod { public static final String MOD_ID = "weaponmod"; public static final String MOD_NAME = "Balkon's WeaponMod"; - public static final String MOD_VERSION = "v1.14.3"; + public static final String MOD_VERSION = "v1.16"; @Instance("weaponmod") public static BalkonsWeaponMod instance; public static Logger modLog; - + @SidedProxy(clientSide = "ckathode.weaponmod.WMClientProxy", serverSide = "ckathode.weaponmod.WMCommonProxy") public static WMCommonProxy proxy; @@ -192,7 +198,6 @@ public void preInitMod(FMLPreInitializationEvent event) @EventHandler public void initMod(FMLInitializationEvent event) { - messagePipeline.initalize(); proxy.registerPackets(messagePipeline); proxy.registerEventHandlers(); proxy.registerIcons(); @@ -205,7 +210,6 @@ public void initMod(FMLInitializationEvent event) @EventHandler public void postInitMod(FMLPostInitializationEvent event) { - messagePipeline.postInitialize(); } private void addModItems() diff --git a/src/main/java/ckathode/weaponmod/PhysHelper.java b/src/main/java/ckathode/weaponmod/PhysHelper.java index 5ac6016b..e73a01e8 100644 --- a/src/main/java/ckathode/weaponmod/PhysHelper.java +++ b/src/main/java/ckathode/weaponmod/PhysHelper.java @@ -5,10 +5,11 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.util.DamageSource; import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; import net.minecraft.world.World; import net.minecraft.world.WorldServer; import ckathode.weaponmod.network.MsgExplosion; -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; +import net.minecraftforge.fml.common.network.NetworkRegistry.TargetPoint; public abstract class PhysHelper { @@ -19,7 +20,7 @@ public abstract class PhysHelper public static AdvancedExplosion createStandardExplosion(World world, Entity entity, double d, double d1, double d2, float size) { - AdvancedExplosion explosion = new AdvancedExplosion(world, entity, d, d1, d2, size); + AdvancedExplosion explosion = new AdvancedExplosion(world, entity, d, d1, d2, size, true, true); explosion.doEntityExplosion(); explosion.doBlockExplosion(); explosion.doParticleExplosion(true, true); @@ -29,7 +30,7 @@ public static AdvancedExplosion createStandardExplosion(World world, Entity enti public static AdvancedExplosion createAdvancedExplosion(World world, Entity entity, double d, double d1, double d2, float size, boolean destroyBlocks, boolean spawnSmallParticles, boolean spawnBigParticles) { - AdvancedExplosion explosion = new AdvancedExplosion(world, entity, d, d1, d2, size); + AdvancedExplosion explosion = new AdvancedExplosion(world, entity, d, d1, d2, size, true, true); explosion.doEntityExplosion(); if (destroyBlocks) { @@ -42,7 +43,7 @@ public static AdvancedExplosion createAdvancedExplosion(World world, Entity enti public static AdvancedExplosion createAdvancedExplosion(World world, Entity entity, DamageSource damagesource, double d, double d1, double d2, float size, boolean destroyBlocks, boolean spawnSmallParticles, boolean spawnBigParticles) { - AdvancedExplosion explosion = new AdvancedExplosion(world, entity, d, d1, d2, size); + AdvancedExplosion explosion = new AdvancedExplosion(world, entity, d, d1, d2, size, true, true); explosion.doEntityExplosion(damagesource); if (destroyBlocks) { @@ -55,7 +56,7 @@ public static AdvancedExplosion createAdvancedExplosion(World world, Entity enti public static AdvancedExplosion createAdvancedExplosion(World world, Entity entity, double d, double d1, double d2, float size, boolean destroyBlocks, boolean spawnParticles) { - AdvancedExplosion explosion = new AdvancedExplosion(world, entity, d, d1, d2, size); + AdvancedExplosion explosion = new AdvancedExplosion(world, entity, d, d1, d2, size, true, true); explosion.doEntityExplosion(); if (destroyBlocks) { @@ -71,7 +72,8 @@ private static void sendExplosion(World world, AdvancedExplosion explosion, bool if (world instanceof WorldServer && !world.isRemote) { MsgExplosion msg = new MsgExplosion(explosion, smallparts, bigparts); - BalkonsWeaponMod.instance.messagePipeline.sendToAllAround(msg, new TargetPoint(world.provider.dimensionId, explosion.explosionX, explosion.explosionY, explosion.explosionZ, 64D)); + Vec3 explostion_pos = explosion.getPosition(); + BalkonsWeaponMod.instance.messagePipeline.sendToAllAround(msg, new TargetPoint(world.provider.getDimensionId(), explostion_pos.xCoord, explostion_pos.yCoord, explostion_pos.zCoord, 64D)); } } @@ -116,7 +118,8 @@ public static void knockBack(EntityLivingBase entityliving, EntityLivingBase att public static void prepareKnockbackOnEntity(EntityLivingBase attacker, EntityLivingBase entity) { - knockBackModifier = EnchantmentHelper.getKnockbackModifier(attacker, entity); + //knockBackModifier = EnchantmentHelper.getKnockbackModifier(attacker, entity); + knockBackModifier = EnchantmentHelper.getKnockbackModifier(attacker); if (attacker.isSprinting()) { knockBackModifier++; diff --git a/src/main/java/ckathode/weaponmod/PlayerWeaponData.java b/src/main/java/ckathode/weaponmod/PlayerWeaponData.java index 5f56c586..e2cc9817 100644 --- a/src/main/java/ckathode/weaponmod/PlayerWeaponData.java +++ b/src/main/java/ckathode/weaponmod/PlayerWeaponData.java @@ -49,7 +49,7 @@ private static String getPlayerName(EntityPlayer player) String playername; if (player.getGameProfile() != null) { - playername = player.getCommandSenderName(); + playername = player.getCommandSenderEntity().getName(); } else { playername = "[unknown]"; diff --git a/src/main/java/ckathode/weaponmod/WMClientEventHandler.java b/src/main/java/ckathode/weaponmod/WMClientEventHandler.java index d1b8c40a..d295536a 100644 --- a/src/main/java/ckathode/weaponmod/WMClientEventHandler.java +++ b/src/main/java/ckathode/weaponmod/WMClientEventHandler.java @@ -10,11 +10,11 @@ import ckathode.weaponmod.item.IItemWeapon; import ckathode.weaponmod.item.RangedComponent; import ckathode.weaponmod.network.MsgCannonFire; -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.TickEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import net.minecraftforge.fml.client.FMLClientHandler; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class WMClientEventHandler diff --git a/src/main/java/ckathode/weaponmod/WMClientProxy.java b/src/main/java/ckathode/weaponmod/WMClientProxy.java index 45514193..0fcc879c 100644 --- a/src/main/java/ckathode/weaponmod/WMClientProxy.java +++ b/src/main/java/ckathode/weaponmod/WMClientProxy.java @@ -1,5 +1,13 @@ package ckathode.weaponmod; +import ckathode.weaponmod.item.ItemBlowgunDart; +import ckathode.weaponmod.item.WMItem; +import ckathode.weaponmod.render.*; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.ItemModelMesher; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraftforge.client.MinecraftForgeClient; import net.minecraftforge.common.MinecraftForge; import ckathode.weaponmod.entity.EntityCannon; @@ -16,24 +24,12 @@ import ckathode.weaponmod.entity.projectile.EntityMusketBullet; import ckathode.weaponmod.entity.projectile.EntitySpear; import ckathode.weaponmod.network.WMMessagePipeline; -import ckathode.weaponmod.render.GuiOverlayReloaded; -import ckathode.weaponmod.render.LongItemRenderer; -import ckathode.weaponmod.render.RenderBlowgunDart; -import ckathode.weaponmod.render.RenderBlunderShot; -import ckathode.weaponmod.render.RenderBoomerang; -import ckathode.weaponmod.render.RenderCannon; -import ckathode.weaponmod.render.RenderCannonBall; -import ckathode.weaponmod.render.RenderCrossbowBolt; -import ckathode.weaponmod.render.RenderDummy; -import ckathode.weaponmod.render.RenderDynamite; -import ckathode.weaponmod.render.RenderFlail; -import ckathode.weaponmod.render.RenderJavelin; -import ckathode.weaponmod.render.RenderKnife; -import ckathode.weaponmod.render.RenderMusketBullet; -import ckathode.weaponmod.render.RenderSpear; -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.FMLCommonHandler; +import net.minecraftforge.fml.client.FMLClientHandler; +import net.minecraftforge.fml.client.registry.RenderingRegistry; +import net.minecraftforge.fml.common.FMLCommonHandler; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; +import net.minecraftforge.fml.relauncher.Side; public class WMClientProxy extends WMCommonProxy { @@ -44,7 +40,6 @@ public void registerEventHandlers() WMClientEventHandler eventhandler = new WMClientEventHandler(); FMLCommonHandler.instance().bus().register(eventhandler); MinecraftForge.EVENT_BUS.register(eventhandler); - MinecraftForge.EVENT_BUS.register(new GuiOverlayReloaded(FMLClientHandler.instance().getClient())); } @@ -62,88 +57,173 @@ public void registerIcons() @Override public void registerRenderers(WeaponModConfig config) { - LongItemRenderer longrender = new LongItemRenderer(); - //StabItemRenderer stabrender = new StabItemRenderer(); + ItemModelMesher modelMesher = Minecraft.getMinecraft().getRenderItem().getItemModelMesher(); + RenderManager renderManager = Minecraft.getMinecraft().getRenderManager(); + LongItemRenderer longrender = new LongItemRenderer(); - if (config.isEnabled("halberd")) - { - MinecraftForgeClient.registerItemRenderer(BalkonsWeaponMod.halberdWood, longrender); - MinecraftForgeClient.registerItemRenderer(BalkonsWeaponMod.halberdStone, longrender); - MinecraftForgeClient.registerItemRenderer(BalkonsWeaponMod.halberdSteel, longrender); - MinecraftForgeClient.registerItemRenderer(BalkonsWeaponMod.halberdDiamond, longrender); - MinecraftForgeClient.registerItemRenderer(BalkonsWeaponMod.halberdGold, longrender); - } + if (config.isEnabled("spear")){ + modelMesher.register(BalkonsWeaponMod.spearWood, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.spearWood.getUnlocalizedName().substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.spearStone, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.spearStone.getUnlocalizedName().substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.spearSteel, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.spearSteel.getUnlocalizedName().substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.spearDiamond, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.spearDiamond.getUnlocalizedName().substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.spearGold, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.spearGold.getUnlocalizedName().substring(5), "inventory")); - if (config.isEnabled("knife")) - { - RenderingRegistry.registerEntityRenderingHandler(EntityKnife.class, new RenderKnife()); - /* - MinecraftForgeClient.registerItemRenderer(BalkonsWeaponMod.knifeWood.itemID, stabrender); - MinecraftForgeClient.registerItemRenderer(BalkonsWeaponMod.knifeStone.itemID, stabrender); - MinecraftForgeClient.registerItemRenderer(BalkonsWeaponMod.knifeSteel.itemID, stabrender); - MinecraftForgeClient.registerItemRenderer(BalkonsWeaponMod.knifeDiamond.itemID, stabrender); - MinecraftForgeClient.registerItemRenderer(BalkonsWeaponMod.knifeGold.itemID, stabrender);*/ - } + RenderingRegistry.registerEntityRenderingHandler(EntitySpear.class, new RenderSpear(renderManager)); - if (config.isEnabled("spear")) - { - RenderingRegistry.registerEntityRenderingHandler(EntitySpear.class, new RenderSpear()); + MinecraftForgeClient.registerItemRenderer(BalkonsWeaponMod.spearWood, longrender); + MinecraftForgeClient.registerItemRenderer(BalkonsWeaponMod.spearStone, longrender); + MinecraftForgeClient.registerItemRenderer(BalkonsWeaponMod.spearSteel, longrender); + MinecraftForgeClient.registerItemRenderer(BalkonsWeaponMod.spearDiamond, longrender); + MinecraftForgeClient.registerItemRenderer(BalkonsWeaponMod.spearGold, longrender); + } + if (config.isEnabled("halberd")) { + modelMesher.register(BalkonsWeaponMod.halberdWood, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.halberdWood.getUnlocalizedName().substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.halberdStone, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.halberdStone.getUnlocalizedName().substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.halberdSteel, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.halberdSteel.getUnlocalizedName().substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.halberdDiamond, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.halberdDiamond.getUnlocalizedName().substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.halberdGold, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.halberdGold.getUnlocalizedName().substring(5), "inventory")); - MinecraftForgeClient.registerItemRenderer(BalkonsWeaponMod.spearWood, longrender); - MinecraftForgeClient.registerItemRenderer(BalkonsWeaponMod.spearStone, longrender); - MinecraftForgeClient.registerItemRenderer(BalkonsWeaponMod.spearSteel, longrender); - MinecraftForgeClient.registerItemRenderer(BalkonsWeaponMod.spearDiamond, longrender); - MinecraftForgeClient.registerItemRenderer(BalkonsWeaponMod.spearGold, longrender); - } + MinecraftForgeClient.registerItemRenderer(BalkonsWeaponMod.halberdWood, longrender); + MinecraftForgeClient.registerItemRenderer(BalkonsWeaponMod.halberdStone, longrender); + MinecraftForgeClient.registerItemRenderer(BalkonsWeaponMod.halberdSteel, longrender); + MinecraftForgeClient.registerItemRenderer(BalkonsWeaponMod.halberdDiamond, longrender); + MinecraftForgeClient.registerItemRenderer(BalkonsWeaponMod.halberdGold, longrender); + } + if (config.isEnabled("battleaxe")) { + modelMesher.register(BalkonsWeaponMod.battleaxeWood, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.battleaxeWood.getUnlocalizedName().substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.battleaxeStone, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.battleaxeStone.getUnlocalizedName().substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.battleaxeSteel, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.battleaxeSteel.getUnlocalizedName().substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.battleaxeDiamond, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.battleaxeDiamond.getUnlocalizedName().substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.battleaxeGold, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.battleaxeGold.getUnlocalizedName().substring(5), "inventory")); + } + if (config.isEnabled("knife")){ + modelMesher.register(BalkonsWeaponMod.knifeWood, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.knifeWood.getUnlocalizedName().substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.knifeStone, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.knifeStone.getUnlocalizedName().substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.knifeSteel, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.knifeSteel.getUnlocalizedName().substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.knifeDiamond, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.knifeDiamond.getUnlocalizedName().substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.knifeGold, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.knifeGold.getUnlocalizedName().substring(5), "inventory")); - if (config.isEnabled("javelin")) - { - RenderingRegistry.registerEntityRenderingHandler(EntityJavelin.class, new RenderJavelin()); - MinecraftForgeClient.registerItemRenderer(BalkonsWeaponMod.javelin, longrender); + RenderingRegistry.registerEntityRenderingHandler(EntityKnife.class, new RenderKnife(renderManager)); + } + if (config.isEnabled("warhammer")) { + modelMesher.register(BalkonsWeaponMod.warhammerWood, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.warhammerWood.getUnlocalizedName().substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.warhammerStone, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.warhammerStone.getUnlocalizedName().substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.warhammerSteel, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.warhammerSteel.getUnlocalizedName().substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.warhammerDiamond, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.warhammerDiamond.getUnlocalizedName().substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.warhammerGold, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.warhammerGold.getUnlocalizedName().substring(5), "inventory")); + } + if (config.isEnabled("flail")) + { + modelMesher.register(BalkonsWeaponMod.flailWood, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.flailWood.getUnlocalizedName().substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.flailStone, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.flailStone.getUnlocalizedName().substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.flailSteel, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.flailSteel.getUnlocalizedName().substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.flailDiamond, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.flailDiamond.getUnlocalizedName().substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.flailGold, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.flailGold.getUnlocalizedName().substring(5), "inventory")); + + RenderingRegistry.registerEntityRenderingHandler(EntityFlail.class, new RenderFlail(renderManager)); + } + if (config.isEnabled("katana")) { + modelMesher.register(BalkonsWeaponMod.katanaWood, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.katanaWood.getUnlocalizedName().substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.katanaStone, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.katanaStone.getUnlocalizedName().substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.katanaSteel, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.katanaSteel.getUnlocalizedName().substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.katanaDiamond, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.katanaDiamond.getUnlocalizedName().substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.katanaGold, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.katanaGold.getUnlocalizedName().substring(5), "inventory")); } + if (config.isEnabled("boomerang")) + { + modelMesher.register(BalkonsWeaponMod.boomerangWood, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.boomerangWood.getUnlocalizedName().substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.boomerangStone, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.boomerangStone.getUnlocalizedName().substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.boomerangSteel, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.boomerangSteel.getUnlocalizedName().substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.boomerangDiamond, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.boomerangDiamond.getUnlocalizedName().substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.boomerangGold, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.boomerangGold.getUnlocalizedName().substring(5), "inventory")); - if (config.isEnabled("firerod")) - { - //MinecraftForgeClient.registerItemRenderer(BalkonsWeaponMod.fireRod.itemID, stabrender); + RenderingRegistry.registerEntityRenderingHandler(EntityBoomerang.class, new RenderBoomerang(renderManager)); + } + if (config.isEnabled("firerood")){ + modelMesher.register(BalkonsWeaponMod.fireRod, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.fireRod.getUnlocalizedName().substring(5), "inventory")); + } + if (config.isEnabled("javelin")){ + modelMesher.register(BalkonsWeaponMod.javelin, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.javelin.getUnlocalizedName().substring(5), "inventory")); + + RenderingRegistry.registerEntityRenderingHandler(EntityJavelin.class, new RenderJavelin(renderManager)); + MinecraftForgeClient.registerItemRenderer(BalkonsWeaponMod.javelin, longrender); } + if (config.isEnabled("crossbow")) + { + modelMesher.register(BalkonsWeaponMod.crossbow, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.crossbow.getUnlocalizedName().substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.bolt, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.bolt.getUnlocalizedName().substring(5), "inventory")); + + RenderingRegistry.registerEntityRenderingHandler(EntityCrossbowBolt.class, new RenderCrossbowBolt(renderManager)); + } + if (config.isEnabled("blowgun")) + { + modelMesher.register(BalkonsWeaponMod.blowgun, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.blowgun.getUnlocalizedName().substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.dart, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + ((ItemBlowgunDart) BalkonsWeaponMod.dart).getUnlocalizedName(0).substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.dart, 1, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + ((ItemBlowgunDart) BalkonsWeaponMod.dart).getUnlocalizedName(1).substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.dart, 2, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + ((ItemBlowgunDart) BalkonsWeaponMod.dart).getUnlocalizedName(2).substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.dart, 3, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + ((ItemBlowgunDart) BalkonsWeaponMod.dart).getUnlocalizedName(3).substring(5), "inventory")); + RenderingRegistry.registerEntityRenderingHandler(EntityBlowgunDart.class, new RenderBlowgunDart(renderManager)); + } if (config.isEnabled("musket")) { - RenderingRegistry.registerEntityRenderingHandler(EntityMusketBullet.class, new RenderMusketBullet()); - } - if (config.isEnabled("crossbow")) - { - RenderingRegistry.registerEntityRenderingHandler(EntityCrossbowBolt.class, new RenderCrossbowBolt()); - //MinecraftForgeClient.registerItemRenderer(BalkonsWeaponMod.crossbow.itemID, new CrossbowItemRenderer()); - } - if (config.isEnabled("blowgun")) - { - RenderingRegistry.registerEntityRenderingHandler(EntityBlowgunDart.class, new RenderBlowgunDart()); - } - if (config.isEnabled("dynamite")) - { - RenderingRegistry.registerEntityRenderingHandler(EntityDynamite.class, new RenderDynamite()); - } - if (config.isEnabled("flail")) - { - RenderingRegistry.registerEntityRenderingHandler(EntityFlail.class, new RenderFlail()); - } - if (config.isEnabled("cannon")) - { - RenderingRegistry.registerEntityRenderingHandler(EntityCannon.class, new RenderCannon()); - RenderingRegistry.registerEntityRenderingHandler(EntityCannonBall.class, new RenderCannonBall()); - } - if (config.isEnabled("blunderbuss")) - { - RenderingRegistry.registerEntityRenderingHandler(EntityBlunderShot.class, new RenderBlunderShot()); + if (config.isEnabled("knife")) + { + modelMesher.register(BalkonsWeaponMod.bayonetWood, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.bayonetWood.getUnlocalizedName().substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.bayonetStone, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.bayonetStone.getUnlocalizedName().substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.bayonetSteel, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.bayonetSteel.getUnlocalizedName().substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.bayonetGold, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.bayonetGold.getUnlocalizedName().substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.bayonetDiamond, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.bayonetDiamond.getUnlocalizedName().substring(5), "inventory")); + } + + modelMesher.register(BalkonsWeaponMod.musket, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.musket.getUnlocalizedName().substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.musket_iron_part, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.musket_iron_part.getUnlocalizedName().substring(5), "inventory")); + + RenderingRegistry.registerEntityRenderingHandler(EntityMusketBullet.class, new RenderMusketBullet(renderManager)); } - if (config.isEnabled("dummy")) + if (config.isEnabled("blunderbuss")) + { + modelMesher.register(BalkonsWeaponMod.blunderbuss, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.blunderbuss.getUnlocalizedName().substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.blunder_iron_part, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.blunder_iron_part.getUnlocalizedName().substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.blunderShot, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.blunderShot.getUnlocalizedName().substring(5), "inventory")); + + RenderingRegistry.registerEntityRenderingHandler(EntityBlunderShot.class, new RenderBlunderShot(renderManager)); + } + if (config.isEnabled("flintlock")) + { + modelMesher.register(BalkonsWeaponMod.flintlockPistol, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.flintlockPistol.getUnlocalizedName().substring(5), "inventory")); + } + if (config.isEnabled("dynamite")) + { + modelMesher.register(BalkonsWeaponMod.dynamite, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.dynamite.getUnlocalizedName().substring(5), "inventory")); + + RenderingRegistry.registerEntityRenderingHandler(EntityDynamite.class, new RenderDynamite(renderManager)); + } + if (config.isEnabled("cannon")) + { + modelMesher.register(BalkonsWeaponMod.cannon, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.cannon.getUnlocalizedName().substring(5), "inventory")); + modelMesher.register(BalkonsWeaponMod.cannonBall, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.cannonBall.getUnlocalizedName().substring(5), "inventory")); + + RenderingRegistry.registerEntityRenderingHandler(EntityCannon.class, new RenderCannon(renderManager)); + RenderingRegistry.registerEntityRenderingHandler(EntityCannonBall.class, new RenderCannonBall(renderManager)); + } + if (config.isEnabled("dummy")) + { + modelMesher.register(BalkonsWeaponMod.dummy, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.dummy.getUnlocalizedName().substring(5), "inventory")); + + RenderingRegistry.registerEntityRenderingHandler(EntityDummy.class, new RenderDummy(renderManager)); + } + if (config.isEnabled("musket") || config.isEnabled("blunderbuss")) { - RenderingRegistry.registerEntityRenderingHandler(EntityDummy.class, new RenderDummy()); + modelMesher.register(BalkonsWeaponMod.gunStock, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.gunStock.getUnlocalizedName().substring(5), "inventory")); } - if (config.isEnabled("boomerang")) + if (config.isEnabled("musket") || config.isEnabled("flintlock")) + { + modelMesher.register(BalkonsWeaponMod.musketBullet, 0, new ModelResourceLocation(BalkonsWeaponMod.MOD_ID + ":" + BalkonsWeaponMod.musketBullet.getUnlocalizedName().substring(5), "inventory")); + } + if (config.isEnabled("firerod")) { - RenderingRegistry.registerEntityRenderingHandler(EntityBoomerang.class, new RenderBoomerang()); + //MinecraftForgeClient.registerItemRenderer(BalkonsWeaponMod.fireRod.itemID, stabrender); } } } diff --git a/src/main/java/ckathode/weaponmod/WMCommonEventHandler.java b/src/main/java/ckathode/weaponmod/WMCommonEventHandler.java index ad9d5303..0ac29852 100644 --- a/src/main/java/ckathode/weaponmod/WMCommonEventHandler.java +++ b/src/main/java/ckathode/weaponmod/WMCommonEventHandler.java @@ -2,7 +2,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.event.entity.EntityEvent; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; public class WMCommonEventHandler { diff --git a/src/main/java/ckathode/weaponmod/WMCommonProxy.java b/src/main/java/ckathode/weaponmod/WMCommonProxy.java index 902200a9..3b9ab183 100644 --- a/src/main/java/ckathode/weaponmod/WMCommonProxy.java +++ b/src/main/java/ckathode/weaponmod/WMCommonProxy.java @@ -4,6 +4,7 @@ import ckathode.weaponmod.network.MsgCannonFire; import ckathode.weaponmod.network.MsgExplosion; import ckathode.weaponmod.network.WMMessagePipeline; +import net.minecraftforge.fml.relauncher.Side; public class WMCommonProxy { @@ -14,8 +15,8 @@ public void registerEventHandlers() public void registerPackets(WMMessagePipeline pipeline) { - pipeline.registerPacket(MsgCannonFire.class); - pipeline.registerPacket(MsgExplosion.class); + pipeline.registerMessage(MsgCannonFire.Handler.class, MsgCannonFire.class, 0, Side.SERVER); + pipeline.registerMessage(MsgExplosion.Handler.class, MsgExplosion.class, 1, Side.CLIENT); } public void registerIcons() diff --git a/src/main/java/ckathode/weaponmod/WarhammerExplosion.java b/src/main/java/ckathode/weaponmod/WarhammerExplosion.java index 7aeaa947..47602add 100644 --- a/src/main/java/ckathode/weaponmod/WarhammerExplosion.java +++ b/src/main/java/ckathode/weaponmod/WarhammerExplosion.java @@ -10,9 +10,9 @@ public class WarhammerExplosion extends AdvancedExplosion { - public WarhammerExplosion(World world, Entity entity, double d, double d1, double d2, float f) + public WarhammerExplosion(World world, Entity exploder, double explosionX, double explosionY, double explosionZ, float explosionSize, boolean isFlaming, boolean isSmoking) { - super(world, entity, d, d1, d2, f); + super(world, exploder, explosionX, explosionY, explosionZ, explosionSize, isFlaming, isSmoking); } @Override @@ -26,7 +26,7 @@ public void doEntityExplosion(DamageSource damagesource) int k0 = MathHelper.floor_double(explosionZ - size - 1.0D); int k1 = MathHelper.floor_double(explosionZ + size + 1.0D); @SuppressWarnings("unchecked") - List list = worldObj.getEntitiesWithinAABBExcludingEntity(exploder, AxisAlignedBB.getBoundingBox(i0, j0, k0, i1, j1, k1)); + List list = worldObj.getEntitiesWithinAABBExcludingEntity(exploder, AxisAlignedBB.fromBounds(i0, j0, k0, i1, j1, k1)); double dx; double dy; diff --git a/src/main/java/ckathode/weaponmod/WeaponModAttributes.java b/src/main/java/ckathode/weaponmod/WeaponModAttributes.java index 9d595743..16bfe7af 100644 --- a/src/main/java/ckathode/weaponmod/WeaponModAttributes.java +++ b/src/main/java/ckathode/weaponmod/WeaponModAttributes.java @@ -2,13 +2,14 @@ import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.attributes.BaseAttribute; +import net.minecraft.entity.ai.attributes.IAttribute; import net.minecraft.entity.ai.attributes.RangedAttribute; -public class WeaponModAttributes extends SharedMonsterAttributes +public class WeaponModAttributes { - public static final BaseAttribute IGNORE_ARMOUR_DAMAGE = new RangedAttribute("weaponmod.ignoreArmour", 0D, 0D, Double.MAX_VALUE); - public static final BaseAttribute WEAPON_KNOCKBACK = new RangedAttribute("weaponmod.knockback", 0.4D, 0D, Double.MAX_VALUE); - public static final BaseAttribute ATTACK_SPEED = new RangedAttribute("weaponmod.attackSpeed", 0D, -Double.MAX_VALUE, Double.MAX_VALUE); - public static final BaseAttribute RELOAD_TIME = new RangedAttribute("weaponmod.reloadTime", 0D, 0D, Double.MAX_VALUE); - public static final BaseAttribute WEAPON_REACH = new RangedAttribute("weaponmod.reach", 0D, 0D, Double.MAX_VALUE); + public static final BaseAttribute IGNORE_ARMOUR_DAMAGE = new RangedAttribute((IAttribute)null, "weaponmod.ignoreArmour", 0D, 0D, Double.MAX_VALUE); + public static final BaseAttribute WEAPON_KNOCKBACK = new RangedAttribute((IAttribute)null, "weaponmod.knockback", 0.4D, 0D, Double.MAX_VALUE); + public static final BaseAttribute ATTACK_SPEED = new RangedAttribute((IAttribute)null, "weaponmod.attackSpeed", 0D, -Double.MAX_VALUE, Double.MAX_VALUE); + public static final BaseAttribute RELOAD_TIME = new RangedAttribute((IAttribute)null, "weaponmod.reloadTime", 0D, 0D, Double.MAX_VALUE); + public static final BaseAttribute WEAPON_REACH = new RangedAttribute((IAttribute)null, "weaponmod.reach", 0D, 0D, Double.MAX_VALUE); } diff --git a/src/main/java/ckathode/weaponmod/WeaponModResources.java b/src/main/java/ckathode/weaponmod/WeaponModResources.java index 367e2561..185f24fb 100644 --- a/src/main/java/ckathode/weaponmod/WeaponModResources.java +++ b/src/main/java/ckathode/weaponmod/WeaponModResources.java @@ -1,8 +1,8 @@ package ckathode.weaponmod; import net.minecraft.util.ResourceLocation; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public abstract class WeaponModResources diff --git a/src/main/java/ckathode/weaponmod/entity/EntityCannon.java b/src/main/java/ckathode/weaponmod/entity/EntityCannon.java index 82020938..7ce8a8fd 100644 --- a/src/main/java/ckathode/weaponmod/entity/EntityCannon.java +++ b/src/main/java/ckathode/weaponmod/entity/EntityCannon.java @@ -11,17 +11,14 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EntityDamageSource; -import net.minecraft.util.EntityDamageSourceIndirect; -import net.minecraft.util.MathHelper; +import net.minecraft.util.*; import net.minecraft.world.World; import ckathode.weaponmod.BalkonsWeaponMod; import ckathode.weaponmod.entity.projectile.EntityCannonBall; public class EntityCannon extends EntityBoat { + public double yOffset; public EntityCannon(World world) { super(world); @@ -35,7 +32,7 @@ public EntityCannon(World world) public EntityCannon(World world, double d, double d1, double d2) { this(world); - setPosition(d, d1 + yOffset, d2); + setPosition(d, d1 + getYOffset(), d2); motionX = 0.0D; motionY = 0.0D; motionZ = 0.0D; @@ -58,13 +55,13 @@ protected void entityInit() @Override public AxisAlignedBB getCollisionBox(Entity entity) { - return entity.boundingBox; + return entity.getBoundingBox(); } @Override public AxisAlignedBB getBoundingBox() { - return boundingBox; + return getEntityBoundingBox(); } @Override @@ -202,7 +199,7 @@ public void onEntityUpdate() moveEntity(motionX, motionY, motionZ); @SuppressWarnings("unchecked") - List list = worldObj.getEntitiesWithinAABBExcludingEntity(this, boundingBox.expand(0.2D, 0.0D, 0.2D)); + List list = worldObj.getEntitiesWithinAABBExcludingEntity(this, getBoundingBox().expand(0.2D, 0.0D, 0.2D)); if (list != null && !list.isEmpty()) { for (Entity entity : list) @@ -230,10 +227,10 @@ public void onEntityUpdate() } @Override - protected void fall(float f) + public void fall(float distance, float damageMultiplier) { - super.fall(f); - int i = MathHelper.floor_float(f); + super.fall(distance, damageMultiplier); + int i = MathHelper.floor_float(distance); i *= 2; attackEntityFrom(DamageSource.fall, i); } @@ -280,7 +277,7 @@ public void fireEffects() double d1 = MathHelper.cos(yaw) * -1F; for (int i = 0; i < 20; i++) { - worldObj.spawnParticle("smoke", posX + d + rand.nextDouble() * 0.5D - 0.25D, posY + rand.nextDouble() * 0.5D, posZ + d1 + rand.nextDouble() * 0.5D - 0.25D, rand.nextDouble() * 0.1D - 0.05D, rand.nextDouble() * 0.1D - 0.05D, rand.nextDouble() * 0.1D - 0.05D); + worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, posX + d + rand.nextDouble() * 0.5D - 0.25D, posY + rand.nextDouble() * 0.5D, posZ + d1 + rand.nextDouble() * 0.5D - 0.25D, rand.nextDouble() * 0.1D - 0.05D, rand.nextDouble() * 0.1D - 0.05D, rand.nextDouble() * 0.1D - 0.05D); } if (riddenByEntity != null) @@ -314,12 +311,6 @@ public void updateRiderPosition() } } - @Override - public float getShadowSize() - { - return 1.0F; - } - @Override protected void writeEntityToNBT(NBTTagCompound nbttagcompound) { diff --git a/src/main/java/ckathode/weaponmod/entity/EntityDummy.java b/src/main/java/ckathode/weaponmod/entity/EntityDummy.java index 9fa33473..10aecce7 100644 --- a/src/main/java/ckathode/weaponmod/entity/EntityDummy.java +++ b/src/main/java/ckathode/weaponmod/entity/EntityDummy.java @@ -29,14 +29,13 @@ public EntityDummy(World world) rotationPitch = -20F; setRotation(rotationYaw, rotationPitch); setSize(0.5F, 1.9F); - yOffset = 0.41F; durability = 50; } public EntityDummy(World world, double d, double d1, double d2) { this(world); - setPosition(d, d1 + yOffset, d2); + setPosition(d, d1 + getYOffset(), d2); motionX = 0.0D; motionY = 0.0D; motionZ = 0.0D; @@ -56,13 +55,13 @@ protected void entityInit() @Override public AxisAlignedBB getCollisionBox(Entity entity) { - return entity.boundingBox; + return entity.getBoundingBox(); } @Override public AxisAlignedBB getBoundingBox() { - return boundingBox; + return getEntityBoundingBox(); } @Override @@ -181,7 +180,7 @@ public void onUpdate() moveEntity(0D, motionY, 0D); @SuppressWarnings("unchecked") - List list = worldObj.getEntitiesWithinAABBExcludingEntity(this, boundingBox.expand(0.2D, 0.0D, 0.2D)); + List list = worldObj.getEntitiesWithinAABBExcludingEntity(this, getBoundingBox().expand(0.2D, 0.0D, 0.2D)); if (list != null && list.size() > 0) { for (int j1 = 0; j1 < list.size(); j1++) @@ -196,20 +195,14 @@ public void onUpdate() } @Override - protected void fall(float f) + public void fall(float distance, float damageMultiplier) { - super.fall(f); + super.fall(distance, damageMultiplier); if (!onGround) return; - int i = MathHelper.floor_float(f); + int i = MathHelper.floor_float(distance); attackEntityFrom(DamageSource.fall, i); } - - @Override - public float getShadowSize() - { - return 1.0F; - } - + public void dropAsItem(boolean destroyed) { if (worldObj.isRemote) return; diff --git a/src/main/java/ckathode/weaponmod/entity/projectile/EntityBoomerang.java b/src/main/java/ckathode/weaponmod/entity/projectile/EntityBoomerang.java index 846c8b32..2efd4aa6 100644 --- a/src/main/java/ckathode/weaponmod/entity/projectile/EntityBoomerang.java +++ b/src/main/java/ckathode/weaponmod/entity/projectile/EntityBoomerang.java @@ -5,6 +5,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumFacing; import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; @@ -41,7 +42,6 @@ public EntityBoomerang(World world, EntityLivingBase entityliving, ItemStack ite posY -= 0.1D; posZ -= MathHelper.sin((rotationYaw / 180F) * 3.141593F) * 0.16F; setPosition(posX, posY, posZ); - yOffset = 0.0F; motionX = -MathHelper.sin((rotationYaw / 180F) * 3.141593F) * MathHelper.cos((rotationPitch / 180F) * 3.141593F); motionZ = MathHelper.cos((rotationYaw / 180F) * 3.141593F) * MathHelper.cos((rotationPitch / 180F) * 3.141593F); motionY = -MathHelper.sin((rotationPitch / 180F) * 3.141593F); @@ -177,10 +177,7 @@ public void onEntityHit(Entity entity) @Override public void onGroundHit(MovingObjectPosition mop) { - xTile = mop.blockX; - yTile = mop.blockY; - zTile = mop.blockZ; - inTile = worldObj.getBlock(xTile, yTile, zTile); + inTile = worldObj.getBlockState(mop.getBlockPos()).getBlock(); motionX = (float) (mop.hitVec.xCoord - posX); motionY = (float) (mop.hitVec.yCoord - posY); motionZ = (float) (mop.hitVec.zCoord - posZ); @@ -192,7 +189,7 @@ public void onGroundHit(MovingObjectPosition mop) motionX *= -rand.nextFloat() * 0.5F; motionZ *= -rand.nextFloat() * 0.5F; motionY = rand.nextFloat() * 0.1F; - if (mop.sideHit == 1) + if (mop.sideHit == EnumFacing.UP) { inGround = true; } else @@ -205,7 +202,7 @@ public void onGroundHit(MovingObjectPosition mop) if (inTile != null) { - inTile.onEntityCollidedWithBlock(worldObj, xTile, yTile, zTile, this); + inTile.onEntityCollidedWithBlock(worldObj, mop.getBlockPos(), this); } } diff --git a/src/main/java/ckathode/weaponmod/entity/projectile/EntityCannonBall.java b/src/main/java/ckathode/weaponmod/entity/projectile/EntityCannonBall.java index 7f54da7f..5072f3de 100644 --- a/src/main/java/ckathode/weaponmod/entity/projectile/EntityCannonBall.java +++ b/src/main/java/ckathode/weaponmod/entity/projectile/EntityCannonBall.java @@ -4,6 +4,7 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; @@ -23,7 +24,6 @@ public EntityCannonBall(World world, double d, double d1, double d2) { this(world); setPosition(d, d1, d2); - yOffset = 0.0F; } public EntityCannonBall(World world, EntityCannon entitycannon, boolean superPowered) @@ -42,7 +42,6 @@ public EntityCannonBall(World world, EntityCannon entitycannon, boolean superPow posX -= MathHelper.cos((rotationYaw / 180F) * 3.141593F) * 0.16F; posY -= 0.1D; posZ -= MathHelper.sin((rotationYaw / 180F) * 3.141593F) * 0.16F; - yOffset = 0.0F; motionX = -MathHelper.sin((rotationYaw / 180F) * 3.141593F) * MathHelper.cos((rotationPitch / 180F) * 3.141593F); motionZ = MathHelper.cos((rotationYaw / 180F) * 3.141593F) * MathHelper.cos((rotationPitch / 180F) * 3.141593F); motionY = -MathHelper.sin((rotationPitch / 180F) * 3.141593F); @@ -65,7 +64,7 @@ public void onUpdate() { for (int i1 = 1; i1 < amount; i1++) { - worldObj.spawnParticle("smoke", posX + (motionX * i1) / amount, posY + (motionY * i1) / amount, posZ + (motionZ * i1) / amount, 0.0D, 0.0D, 0.0D); + worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, posX + (motionX * i1) / amount, posY + (motionY * i1) / amount, posZ + (motionZ * i1) / amount, 0.0D, 0.0D, 0.0D); } } } @@ -100,11 +99,7 @@ public void onEntityHit(Entity entity) @Override public void onGroundHit(MovingObjectPosition mop) { - xTile = mop.blockX; - yTile = mop.blockY; - zTile = mop.blockZ; - inTile = worldObj.getBlock(xTile, yTile, zTile); - inData = worldObj.getBlockMetadata(xTile, yTile, zTile); + inTile = worldObj.getBlockState(mop.getBlockPos()).getBlock(); motionX = (float) (mop.hitVec.xCoord - posX); motionY = (float) (mop.hitVec.yCoord - posY); motionZ = (float) (mop.hitVec.zCoord - posZ); @@ -116,7 +111,7 @@ public void onGroundHit(MovingObjectPosition mop) if (inTile != null) { - inTile.onEntityCollidedWithBlock(worldObj, xTile, yTile, zTile, this); + inTile.onEntityCollidedWithBlock(worldObj, mop.getBlockPos(), this); } createCrater(); @@ -145,10 +140,4 @@ public ItemStack getPickupItem() { return new ItemStack(BalkonsWeaponMod.cannonBall, 1); } - - @Override - public float getShadowSize() - { - return 0.5F; - } } diff --git a/src/main/java/ckathode/weaponmod/entity/projectile/EntityDynamite.java b/src/main/java/ckathode/weaponmod/entity/projectile/EntityDynamite.java index 6d9e2a1b..06074e58 100644 --- a/src/main/java/ckathode/weaponmod/entity/projectile/EntityDynamite.java +++ b/src/main/java/ckathode/weaponmod/entity/projectile/EntityDynamite.java @@ -1 +1 @@ -package ckathode.weaponmod.entity.projectile; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.DamageSource; import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; import ckathode.weaponmod.BalkonsWeaponMod; import ckathode.weaponmod.PhysHelper; import ckathode.weaponmod.WeaponDamageSource; public class EntityDynamite extends EntityProjectile { private int explodefuse; private boolean extinguished; public EntityDynamite(World world) { super(world); setPickupMode(NO_PICKUP); extinguished = false; explodefuse = rand.nextInt(30) + 20; } public EntityDynamite(World world, double d, double d1, double d2) { this(world); setPosition(d, d1, d2); } public EntityDynamite(World world, EntityLivingBase entityliving, int i) { this(world); shootingEntity = entityliving; setLocationAndAngles(entityliving.posX, entityliving.posY + entityliving.getEyeHeight(), entityliving.posZ, entityliving.rotationYaw, entityliving.rotationPitch); posX -= MathHelper.cos((rotationYaw / 180F) * 3.141593F) * 0.16F; posY -= 0.1D; posZ -= MathHelper.sin((rotationYaw / 180F) * 3.141593F) * 0.16F; setPosition(posX, posY, posZ); motionX = -MathHelper.sin((rotationYaw / 180F) * 3.141593F) * MathHelper.cos((rotationPitch / 180F) * 3.141593F); motionZ = MathHelper.cos((rotationYaw / 180F) * 3.141593F) * MathHelper.cos((rotationPitch / 180F) * 3.141593F); motionY = -MathHelper.sin((rotationPitch / 180F) * 3.141593F); setThrowableHeading(motionX, motionY, motionZ, 0.7F, 4.0F); explodefuse = i; } @Override protected void entityInit() { } @Override public void onUpdate() { super.onUpdate(); if (!inGround && !beenInGround) { rotationPitch -= 50F; } else { rotationPitch = 180F; } if (isInWater()) if (!extinguished) { extinguished = true; worldObj.playSoundAtEntity(this, "random.fizz", 1.0F, 1.2F / (rand.nextFloat() * 0.2F + 0.9F)); for (int k = 0; k < 8; k++) { float f6 = 0.25F; worldObj.spawnParticle("explode", posX - motionX * f6, posY - motionY * f6, posZ - motionZ * f6, motionX, motionY, motionZ); } } explodefuse--; if (!extinguished) if (explodefuse <= 0) { detonate(); setDead(); } else if (explodefuse > 0) { worldObj.spawnParticle("smoke", posX, posY, posZ, 0.0D, 0.0D, 0.0D); } } @Override public void onEntityHit(Entity entity) { DamageSource damagesource = null; if (shootingEntity == null) { damagesource = WeaponDamageSource.causeProjectileWeaponDamage(this, this); } else { damagesource = WeaponDamageSource.causeProjectileWeaponDamage(this, shootingEntity); } if (entity.attackEntityFrom(damagesource, 1)) { applyEntityHitEffects(entity); playHitSound(); setVelocity(0D, 0D, 0D); ticksInAir = 0; } } @Override public void onGroundHit(MovingObjectPosition mop) { xTile = mop.blockX; yTile = mop.blockY; zTile = mop.blockZ; inTile = worldObj.getBlock(xTile, yTile, zTile); motionX = (float) (mop.hitVec.xCoord - posX); motionY = (float) (mop.hitVec.yCoord - posY); motionZ = (float) (mop.hitVec.zCoord - posZ); float f1 = MathHelper.sqrt_double(motionX * motionX + motionY * motionY + motionZ * motionZ); posX -= (motionX / f1) * 0.05D; posY -= (motionY / f1) * 0.05D; posZ -= (motionZ / f1) * 0.05D; motionX *= -0.2D; motionZ *= -0.2D; if (mop.sideHit == 1) { inGround = true; beenInGround = true; } else { inGround = false; worldObj.playSoundAtEntity(this, "random.fizz", 1.0F, 1.2F / (rand.nextFloat() * 0.2F + 0.9F)); } if (inTile != null) { inTile.onEntityCollidedWithBlock(worldObj, xTile, yTile, zTile, this); } } private void detonate() { if (worldObj.isRemote) return; if (extinguished) if (ticksInGround >= 200 || ticksInAir >= 200) { setDead(); } float f = 2.0F; PhysHelper.createAdvancedExplosion(worldObj, this, posX, posY, posZ, f, BalkonsWeaponMod.instance.modConfig.dynamiteDoesBlockDamage, true); } @Override public boolean aimRotation() { return false; } @Override public int getMaxArrowShake() { return 0; } @Override public ItemStack getPickupItem() { return new ItemStack(BalkonsWeaponMod.dynamite, 1); } @Override public float getShadowSize() { return 0.2F; } @Override public void playHitSound() { worldObj.playSoundAtEntity(this, "random.fizz", 1.0F, 1.2F / (rand.nextFloat() * 0.2F + 0.9F)); } @Override public void writeEntityToNBT(NBTTagCompound nbttagcompound) { super.writeEntityToNBT(nbttagcompound); nbttagcompound.setByte("fuse", (byte) explodefuse); nbttagcompound.setBoolean("off", extinguished); } @Override public void readEntityFromNBT(NBTTagCompound nbttagcompound) { super.readEntityFromNBT(nbttagcompound); explodefuse = nbttagcompound.getByte("fuse"); extinguished = nbttagcompound.getBoolean("off"); } } \ No newline at end of file +package ckathode.weaponmod.entity.projectile; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.*; import net.minecraft.world.World; import ckathode.weaponmod.BalkonsWeaponMod; import ckathode.weaponmod.PhysHelper; import ckathode.weaponmod.WeaponDamageSource; public class EntityDynamite extends EntityProjectile { private int explodefuse; private boolean extinguished; public EntityDynamite(World world) { super(world); setPickupMode(NO_PICKUP); extinguished = false; explodefuse = rand.nextInt(30) + 20; } public EntityDynamite(World world, double d, double d1, double d2) { this(world); setPosition(d, d1, d2); } public EntityDynamite(World world, EntityLivingBase entityliving, int i) { this(world); shootingEntity = entityliving; setLocationAndAngles(entityliving.posX, entityliving.posY + entityliving.getEyeHeight(), entityliving.posZ, entityliving.rotationYaw, entityliving.rotationPitch); posX -= MathHelper.cos((rotationYaw / 180F) * 3.141593F) * 0.16F; posY -= 0.1D; posZ -= MathHelper.sin((rotationYaw / 180F) * 3.141593F) * 0.16F; setPosition(posX, posY, posZ); motionX = -MathHelper.sin((rotationYaw / 180F) * 3.141593F) * MathHelper.cos((rotationPitch / 180F) * 3.141593F); motionZ = MathHelper.cos((rotationYaw / 180F) * 3.141593F) * MathHelper.cos((rotationPitch / 180F) * 3.141593F); motionY = -MathHelper.sin((rotationPitch / 180F) * 3.141593F); setThrowableHeading(motionX, motionY, motionZ, 0.7F, 4.0F); explodefuse = i; } @Override protected void entityInit() { } @Override public void onUpdate() { super.onUpdate(); if (!inGround && !beenInGround) { rotationPitch -= 50F; } else { rotationPitch = 180F; } if (isInWater()) if (!extinguished) { extinguished = true; worldObj.playSoundAtEntity(this, "random.fizz", 1.0F, 1.2F / (rand.nextFloat() * 0.2F + 0.9F)); for (int k = 0; k < 8; k++) { float f6 = 0.25F; worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_NORMAL, posX - motionX * f6, posY - motionY * f6, posZ - motionZ * f6, motionX, motionY, motionZ); } } explodefuse--; if (!extinguished) if (explodefuse <= 0) { detonate(); setDead(); } else if (explodefuse > 0) { worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, posX, posY, posZ, 0.0D, 0.0D, 0.0D); } } @Override public void onEntityHit(Entity entity) { DamageSource damagesource = null; if (shootingEntity == null) { damagesource = WeaponDamageSource.causeProjectileWeaponDamage(this, this); } else { damagesource = WeaponDamageSource.causeProjectileWeaponDamage(this, shootingEntity); } if (entity.attackEntityFrom(damagesource, 1)) { applyEntityHitEffects(entity); playHitSound(); setVelocity(0D, 0D, 0D); ticksInAir = 0; } } @Override public void onGroundHit(MovingObjectPosition mop) { inTile = worldObj.getBlockState(mop.getBlockPos()).getBlock(); motionX = (float) (mop.hitVec.xCoord - posX); motionY = (float) (mop.hitVec.yCoord - posY); motionZ = (float) (mop.hitVec.zCoord - posZ); float f1 = MathHelper.sqrt_double(motionX * motionX + motionY * motionY + motionZ * motionZ); posX -= (motionX / f1) * 0.05D; posY -= (motionY / f1) * 0.05D; posZ -= (motionZ / f1) * 0.05D; motionX *= -0.2D; motionZ *= -0.2D; if (mop.sideHit == EnumFacing.UP) { inGround = true; beenInGround = true; } else { inGround = false; worldObj.playSoundAtEntity(this, "random.fizz", 1.0F, 1.2F / (rand.nextFloat() * 0.2F + 0.9F)); } if (inTile != null) { inTile.onEntityCollidedWithBlock(worldObj, mop.getBlockPos(), this); } } private void detonate() { if (worldObj.isRemote) return; if (extinguished) if (ticksInGround >= 200 || ticksInAir >= 200) { setDead(); } float f = 2.0F; PhysHelper.createAdvancedExplosion(worldObj, this, posX, posY, posZ, f, BalkonsWeaponMod.instance.modConfig.dynamiteDoesBlockDamage, true); } @Override public boolean aimRotation() { return false; } @Override public int getMaxArrowShake() { return 0; } @Override public ItemStack getPickupItem() { return new ItemStack(BalkonsWeaponMod.dynamite, 1); } @Override public void playHitSound() { worldObj.playSoundAtEntity(this, "random.fizz", 1.0F, 1.2F / (rand.nextFloat() * 0.2F + 0.9F)); } @Override public void writeEntityToNBT(NBTTagCompound nbttagcompound) { super.writeEntityToNBT(nbttagcompound); nbttagcompound.setByte("fuse", (byte) explodefuse); nbttagcompound.setBoolean("off", extinguished); } @Override public void readEntityFromNBT(NBTTagCompound nbttagcompound) { super.readEntityFromNBT(nbttagcompound); explodefuse = nbttagcompound.getByte("fuse"); extinguished = nbttagcompound.getBoolean("off"); } } \ No newline at end of file diff --git a/src/main/java/ckathode/weaponmod/entity/projectile/EntityFlail.java b/src/main/java/ckathode/weaponmod/entity/projectile/EntityFlail.java index fc5e2894..f9d5a8db 100644 --- a/src/main/java/ckathode/weaponmod/entity/projectile/EntityFlail.java +++ b/src/main/java/ckathode/weaponmod/entity/projectile/EntityFlail.java @@ -103,7 +103,7 @@ public void returnToOwner(Entity entity, boolean looseFromGround) } double targetPosX = shootingEntity.posX; - double targetPosY = shootingEntity.boundingBox.minY + 0.4F; + double targetPosY = shootingEntity.getEntityBoundingBox().minY + 0.4F; double targetPosZ = shootingEntity.posZ; float f = 27F; @@ -235,10 +235,4 @@ public int getMaxArrowShake() { return 0; } - - @Override - public float getShadowSize() - { - return 0.2F; - } } diff --git a/src/main/java/ckathode/weaponmod/entity/projectile/EntityJavelin.java b/src/main/java/ckathode/weaponmod/entity/projectile/EntityJavelin.java index 1192e2af..9f3f26ed 100644 --- a/src/main/java/ckathode/weaponmod/entity/projectile/EntityJavelin.java +++ b/src/main/java/ckathode/weaponmod/entity/projectile/EntityJavelin.java @@ -33,7 +33,6 @@ public EntityJavelin(World world, EntityLivingBase entityliving, float f) posY -= 0.1D; posZ -= MathHelper.sin((rotationYaw / 180F) * 3.141593F) * 0.16F; setPosition(posX, posY, posZ); - yOffset = 0.0F; motionX = -MathHelper.sin((rotationYaw / 180F) * 3.141593F) * MathHelper.cos((rotationPitch / 180F) * 3.141593F); motionY = -MathHelper.sin((rotationPitch / 180F) * 3.141593F); motionZ = MathHelper.cos((rotationYaw / 180F) * 3.141593F) * MathHelper.cos((rotationPitch / 180F) * 3.141593F); diff --git a/src/main/java/ckathode/weaponmod/entity/projectile/EntityKnife.java b/src/main/java/ckathode/weaponmod/entity/projectile/EntityKnife.java index a8562afb..9905c4e0 100644 --- a/src/main/java/ckathode/weaponmod/entity/projectile/EntityKnife.java +++ b/src/main/java/ckathode/weaponmod/entity/projectile/EntityKnife.java @@ -37,7 +37,6 @@ public EntityKnife(World world, EntityLivingBase entityliving, ItemStack itemsta posY -= 0.1D; posZ -= MathHelper.sin((rotationYaw / 180F) * 3.141593F) * 0.16F; setPosition(posX, posY, posZ); - yOffset = 0.0F; motionX = -MathHelper.sin((rotationYaw / 180F) * 3.141593F) * MathHelper.cos((rotationPitch / 180F) * 3.141593F); motionZ = MathHelper.cos((rotationYaw / 180F) * 3.141593F) * MathHelper.cos((rotationPitch / 180F) * 3.141593F); motionY = -MathHelper.sin((rotationPitch / 180F) * 3.141593F); diff --git a/src/main/java/ckathode/weaponmod/entity/projectile/EntityMaterialProjectile.java b/src/main/java/ckathode/weaponmod/entity/projectile/EntityMaterialProjectile.java index ef0d3f07..92c7d03c 100644 --- a/src/main/java/ckathode/weaponmod/entity/projectile/EntityMaterialProjectile.java +++ b/src/main/java/ckathode/weaponmod/entity/projectile/EntityMaterialProjectile.java @@ -8,8 +8,8 @@ import net.minecraft.util.MathHelper; import net.minecraft.world.World; import ckathode.weaponmod.item.IItemWeapon; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; public abstract class EntityMaterialProjectile extends EntityProjectile { @@ -33,7 +33,7 @@ public float getMeleeHitDamage(Entity entity) { if (shootingEntity instanceof EntityLivingBase && entity instanceof EntityLivingBase) { - return EnchantmentHelper.getEnchantmentModifierLiving((EntityLivingBase) shootingEntity, (EntityLivingBase) entity); + return EnchantmentHelper.func_152377_a(thrownItem, ((EntityLivingBase) shootingEntity).getCreatureAttribute()); } return 0F; } @@ -44,7 +44,7 @@ public void applyEntityHitEffects(Entity entity) super.applyEntityHitEffects(entity); if (shootingEntity instanceof EntityLivingBase && entity instanceof EntityLivingBase) { - int i = EnchantmentHelper.getKnockbackModifier((EntityLivingBase) shootingEntity, (EntityLivingBase) entity); + int i = EnchantmentHelper.getKnockbackModifier((EntityLivingBase) shootingEntity); if (i != 0) { entity.addVelocity(-MathHelper.sin(rotationYaw * (float) Math.PI / 180.0F) * i * 0.5F, 0.1D, MathHelper.cos(rotationYaw * (float) Math.PI / 180.0F) * i * 0.5F); diff --git a/src/main/java/ckathode/weaponmod/entity/projectile/EntityMusketBullet.java b/src/main/java/ckathode/weaponmod/entity/projectile/EntityMusketBullet.java index 2ae2fe3e..d475989c 100644 --- a/src/main/java/ckathode/weaponmod/entity/projectile/EntityMusketBullet.java +++ b/src/main/java/ckathode/weaponmod/entity/projectile/EntityMusketBullet.java @@ -3,6 +3,7 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import ckathode.weaponmod.WeaponDamageSource; @@ -31,7 +32,6 @@ public EntityMusketBullet(World world, EntityLivingBase entityliving, float devi posY -= 0.1D; posZ -= MathHelper.sin((rotationYaw / 180F) * 3.141593F) * 0.16F; setPosition(posX, posY, posZ); - yOffset = 0.0F; motionX = -MathHelper.sin((rotationYaw / 180F) * 3.141593F) * MathHelper.cos((rotationPitch / 180F) * 3.141593F); motionZ = MathHelper.cos((rotationYaw / 180F) * 3.141593F) * MathHelper.cos((rotationPitch / 180F) * 3.141593F); motionY = -MathHelper.sin((rotationPitch / 180F) * 3.141593F); @@ -46,7 +46,7 @@ public void onUpdate() { if (rand.nextInt(4) == 0) { - worldObj.spawnParticle("smoke", posX, posY, posZ, 0.0D, 0.0D, 0.0D); + worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, posX, posY, posZ, 0.0D, 0.0D, 0.0D); } return; } @@ -56,7 +56,7 @@ public void onUpdate() { for (int i1 = 1; i1 < amount; i1++) { - worldObj.spawnParticle("explode", posX + (motionX * i1) / amount, posY + (motionY * i1) / amount, posZ + (motionZ * i1) / amount, 0.0D, 0.0D, 0.0D); + worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_NORMAL, posX + (motionX * i1) / amount, posY + (motionY * i1) / amount, posZ + (motionZ * i1) / amount, 0.0D, 0.0D, 0.0D); } } } diff --git a/src/main/java/ckathode/weaponmod/entity/projectile/EntityProjectile.java b/src/main/java/ckathode/weaponmod/entity/projectile/EntityProjectile.java index 27dad6ee..7c5350ad 100644 --- a/src/main/java/ckathode/weaponmod/entity/projectile/EntityProjectile.java +++ b/src/main/java/ckathode/weaponmod/entity/projectile/EntityProjectile.java @@ -13,15 +13,12 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.play.server.S2BPacketChangeGameState; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.MathHelper; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.Vec3; +import net.minecraft.util.*; import net.minecraft.world.World; import ckathode.weaponmod.BalkonsWeaponMod; -import cpw.mods.fml.common.registry.IThrowableEntity; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import net.minecraftforge.fml.common.registry.IThrowableEntity; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; public abstract class EntityProjectile extends EntityArrow implements IThrowableEntity { @@ -52,7 +49,6 @@ public EntityProjectile(World world) inGround = false; arrowShake = 0; ticksInAir = 0; - yOffset = 0F; pickupMode = NO_PICKUP; extraDamage = 0; @@ -152,12 +148,12 @@ public void onEntityUpdate() prevRotationPitch = rotationPitch = (float) ((Math.atan2(motionY, f) * 180D) / Math.PI); } - Block i = worldObj.getBlock(xTile, yTile, zTile); + Block i = worldObj.getBlockState(new BlockPos(xTile, yTile, zTile)).getBlock(); if (i != null) { - i.setBlockBoundsBasedOnState(worldObj, xTile, yTile, zTile); - AxisAlignedBB axisalignedbb = i.getCollisionBoundingBoxFromPool(worldObj, xTile, yTile, zTile); - if (axisalignedbb != null && axisalignedbb.isVecInside(Vec3.createVectorHelper(posX, posY, posZ))) + i.setBlockBoundsBasedOnState(worldObj, new BlockPos(xTile, yTile, zTile)); + AxisAlignedBB axisalignedbb = i.getCollisionBoundingBox(worldObj, new BlockPos(xTile, yTile, zTile), null); + if (axisalignedbb != null && axisalignedbb.isVecInside(new Vec3(posX, posY, posZ))) { inGround = true; } @@ -170,8 +166,8 @@ public void onEntityUpdate() if (inGround) { - Block j = worldObj.getBlock(xTile, yTile, zTile); - int k = worldObj.getBlockMetadata(xTile, yTile, zTile); + Block j = worldObj.getBlockState(new BlockPos(xTile, yTile, zTile)).getBlock(); + int k = worldObj.getBlockState(new BlockPos(xTile, yTile, zTile)).getBlock().getMetaFromState(worldObj.getBlockState(new BlockPos(xTile, yTile, zTile))); if (j == inTile && k == inData) { ticksInGround++; @@ -194,19 +190,19 @@ public void onEntityUpdate() ticksInAir++; - Vec3 vec3d = Vec3.createVectorHelper(posX, posY, posZ); - Vec3 vec3d1 = Vec3.createVectorHelper(posX + motionX, posY + motionY, posZ + motionZ); - MovingObjectPosition movingobjectposition = worldObj.func_147447_a(vec3d, vec3d1, false, true, false); - vec3d = Vec3.createVectorHelper(posX, posY, posZ); - vec3d1 = Vec3.createVectorHelper(posX + motionX, posY + motionY, posZ + motionZ); + Vec3 vec3d = new Vec3(posX, posY, posZ); + Vec3 vec3d1 = new Vec3(posX + motionX, posY + motionY, posZ + motionZ); + MovingObjectPosition movingobjectposition = worldObj.rayTraceBlocks(vec3d, vec3d1, false, true, false); + vec3d = new Vec3(posX, posY, posZ); + vec3d1 = new Vec3(posX + motionX, posY + motionY, posZ + motionZ); if (movingobjectposition != null) { - vec3d1 = Vec3.createVectorHelper(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord); + vec3d1 = new Vec3(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord); } Entity entity = null; @SuppressWarnings("unchecked") - List list = worldObj.getEntitiesWithinAABBExcludingEntity(this, boundingBox.addCoord(motionX, motionY, motionZ).expand(1.0D, 1.0D, 1.0D)); + List list = worldObj.getEntitiesWithinAABBExcludingEntity(this, getEntityBoundingBox().addCoord(motionX, motionY, motionZ).expand(1.0D, 1.0D, 1.0D)); double d = 0.0D; for (int l = 0; l < list.size(); l++) { @@ -216,7 +212,7 @@ public void onEntityUpdate() continue; } float f4 = 0.3F; - AxisAlignedBB axisalignedbb1 = entity1.boundingBox.expand(f4, f4, f4); + AxisAlignedBB axisalignedbb1 = entity1.getEntityBoundingBox().expand(f4, f4, f4); MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec3d, vec3d1); if (movingobjectposition1 == null) { @@ -250,7 +246,7 @@ public void onEntityUpdate() { for (int i1 = 0; i1 < 2; i1++) { - worldObj.spawnParticle("crit", posX + (motionX * i1) / 4D, posY + (motionY * i1) / 4D, posZ + (motionZ * i1) / 4D, -motionX, -motionY + 0.2D, -motionZ); + worldObj.spawnParticle(EnumParticleTypes.CRIT, posX + (motionX * i1) / 4D, posY + (motionY * i1) / 4D, posZ + (motionZ * i1) / 4D, -motionX, -motionY + 0.2D, -motionZ); } } @@ -282,7 +278,7 @@ public void onEntityUpdate() for (int i1 = 0; i1 < 4; i1++) { float f6 = 0.25F; - worldObj.spawnParticle("bubble", posX - motionX * f6, posY - motionY * f6, posZ - motionZ * f6, motionX, motionY, motionZ); + worldObj.spawnParticle(EnumParticleTypes.WATER_BUBBLE, posX - motionX * f6, posY - motionY * f6, posZ - motionZ * f6, motionX, motionY, motionZ); } res *= 0.80808080F; @@ -292,7 +288,7 @@ public void onEntityUpdate() motionZ *= res; motionY -= grav; setPosition(posX, posY, posZ); - func_145775_I(); + this.worldObj.theProfiler.endSection(); } public void onEntityHit(Entity entity) @@ -332,11 +328,11 @@ public void applyEntityHitEffects(Entity entity) public void onGroundHit(MovingObjectPosition mop) { - xTile = mop.blockX; - yTile = mop.blockY; - zTile = mop.blockZ; - inTile = worldObj.getBlock(xTile, yTile, zTile); - inData = worldObj.getBlockMetadata(xTile, yTile, zTile); + xTile = mop.getBlockPos().getX(); + yTile = mop.getBlockPos().getY(); + zTile = mop.getBlockPos().getZ(); + inTile = worldObj.getBlockState(mop.getBlockPos()).getBlock(); + inData = worldObj.getBlockState(mop.getBlockPos()).getBlock().getMetaFromState(worldObj.getBlockState(mop.getBlockPos())); motionX = mop.hitVec.xCoord - posX; motionY = mop.hitVec.yCoord - posY; motionZ = mop.hitVec.zCoord - posZ; @@ -352,7 +348,7 @@ public void onGroundHit(MovingObjectPosition mop) if (inTile != null) { - inTile.onEntityCollidedWithBlock(worldObj, xTile, yTile, zTile, this); + inTile.onEntityCollidedWithBlock(worldObj, mop.getBlockPos(), this); } } @@ -490,14 +486,6 @@ protected void onItemPickup(EntityPlayer entityplayer) { entityplayer.onItemPickup(this, 1); } - - @Override - @SideOnly(Side.CLIENT) - public float getShadowSize() - { - return 0.0F; - } - @Override protected boolean canTriggerWalking() { diff --git a/src/main/java/ckathode/weaponmod/entity/projectile/EntitySpear.java b/src/main/java/ckathode/weaponmod/entity/projectile/EntitySpear.java index bf7c1c40..408060ee 100644 --- a/src/main/java/ckathode/weaponmod/entity/projectile/EntitySpear.java +++ b/src/main/java/ckathode/weaponmod/entity/projectile/EntitySpear.java @@ -33,7 +33,6 @@ public EntitySpear(World world, EntityLivingBase entityliving, ItemStack itemsta posY -= 0.1D; posZ -= MathHelper.sin((rotationYaw / 180F) * 3.141593F) * 0.16F; setPosition(posX, posY, posZ); - yOffset = 0.0F; motionX = -MathHelper.sin((rotationYaw / 180F) * 3.141593F) * MathHelper.cos((rotationPitch / 180F) * 3.141593F); motionY = -MathHelper.sin((rotationPitch / 180F) * 3.141593F); motionZ = MathHelper.cos((rotationYaw / 180F) * 3.141593F) * MathHelper.cos((rotationPitch / 180F) * 3.141593F); diff --git a/src/main/java/ckathode/weaponmod/entity/projectile/ICustomProjectileMaterials.java b/src/main/java/ckathode/weaponmod/entity/projectile/ICustomProjectileMaterials.java index a4a999e8..24ac3f24 100644 --- a/src/main/java/ckathode/weaponmod/entity/projectile/ICustomProjectileMaterials.java +++ b/src/main/java/ckathode/weaponmod/entity/projectile/ICustomProjectileMaterials.java @@ -1,8 +1,8 @@ package ckathode.weaponmod.entity.projectile; import net.minecraft.item.ItemStack; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; public interface ICustomProjectileMaterials { diff --git a/src/main/java/ckathode/weaponmod/entity/projectile/dispense/DispenseBlunderShot.java b/src/main/java/ckathode/weaponmod/entity/projectile/dispense/DispenseBlunderShot.java index 9b71a105..deca94da 100644 --- a/src/main/java/ckathode/weaponmod/entity/projectile/dispense/DispenseBlunderShot.java +++ b/src/main/java/ckathode/weaponmod/entity/projectile/dispense/DispenseBlunderShot.java @@ -9,6 +9,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; import ckathode.weaponmod.entity.projectile.EntityBlunderShot; +import net.minecraft.util.EnumParticleTypes; public class DispenseBlunderShot extends BehaviorDefaultDispenseItem { @@ -24,7 +25,7 @@ public ItemStack dispenseStack(IBlockSource blocksource, ItemStack itemstack) { EnumFacing face = EnumFacing.getFront(blocksource.getBlockMetadata()); - IPosition pos = BlockDispenser.func_149939_a(blocksource); + IPosition pos = BlockDispenser.getDispensePosition(blocksource); EntityBlunderShot.fireFromDispenser(blocksource.getWorld(), pos.getX() + face.getFrontOffsetX(), pos.getY() + face.getFrontOffsetY(), pos.getZ() + face.getFrontOffsetZ(), face.getFrontOffsetX(), face.getFrontOffsetY(), face.getFrontOffsetZ()); itemstack.splitStack(1); return itemstack; @@ -40,7 +41,7 @@ protected void playDispenseSound(IBlockSource blocksource) protected void spawnDispenseParticles(IBlockSource blocksource, EnumFacing face) { super.spawnDispenseParticles(blocksource, face); - IPosition pos = BlockDispenser.func_149939_a(blocksource); - blocksource.getWorld().spawnParticle("flame", pos.getX() + face.getFrontOffsetX(), pos.getY() + face.getFrontOffsetY(), pos.getZ() + face.getFrontOffsetZ(), 0.0D, 0.0D, 0.0D); + IPosition pos = BlockDispenser.getDispensePosition(blocksource); + blocksource.getWorld().spawnParticle(EnumParticleTypes.FLAME, pos.getX() + face.getFrontOffsetX(), pos.getY() + face.getFrontOffsetY(), pos.getZ() + face.getFrontOffsetZ(), 0.0D, 0.0D, 0.0D); } } diff --git a/src/main/java/ckathode/weaponmod/entity/projectile/dispense/DispenseCannonBall.java b/src/main/java/ckathode/weaponmod/entity/projectile/dispense/DispenseCannonBall.java index 6da4ef85..73f495d5 100644 --- a/src/main/java/ckathode/weaponmod/entity/projectile/dispense/DispenseCannonBall.java +++ b/src/main/java/ckathode/weaponmod/entity/projectile/dispense/DispenseCannonBall.java @@ -12,6 +12,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityDispenser; import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MathHelper; import ckathode.weaponmod.BalkonsWeaponMod; import ckathode.weaponmod.entity.projectile.EntityCannonBall; @@ -33,7 +34,7 @@ public ItemStack dispenseStack(IBlockSource blocksource, ItemStack itemstack) { boolean canfire = false; normalDispense = false; - TileEntity tileentity = blocksource.getWorld().getTileEntity(MathHelper.floor_double(blocksource.getXInt()), MathHelper.floor_double(blocksource.getYInt()), MathHelper.floor_double(blocksource.getZInt())); + TileEntity tileentity = blocksource.getWorld().getTileEntity(blocksource.getBlockPos()); if (tileentity instanceof TileEntityDispenser) { TileEntityDispenser dispenser = ((TileEntityDispenser) tileentity); @@ -64,11 +65,11 @@ public ItemStack dispenseStack(IBlockSource blocksource, ItemStack itemstack) return super.dispenseStack(blocksource, itemstack); } - EnumFacing face = BlockDispenser.func_149937_b(blocksource.getBlockMetadata()); + EnumFacing face = BlockDispenser.getFacing(blocksource.getBlockMetadata()); double xvel = face.getFrontOffsetX() * 1.5D; double yvel = face.getFrontOffsetY() * 1.5D; double zvel = face.getFrontOffsetZ() * 1.5D; - IPosition pos = BlockDispenser.func_149939_a(blocksource); + IPosition pos = BlockDispenser.getDispensePosition(blocksource); EntityCannonBall entitycannonball = new EntityCannonBall(blocksource.getWorld(), pos.getX() + xvel, pos.getY() + yvel, pos.getZ() + zvel); entitycannonball.setThrowableHeading(xvel, yvel + 0.15D, zvel, 2.0F, 2.0F); @@ -95,8 +96,8 @@ protected void spawnDispenseParticles(IBlockSource blocksource, EnumFacing face) super.spawnDispenseParticles(blocksource, face); if (!normalDispense) { - IPosition pos = BlockDispenser.func_149939_a(blocksource); - blocksource.getWorld().spawnParticle("flame", pos.getX() + face.getFrontOffsetX(), pos.getY(), pos.getZ() + face.getFrontOffsetZ(), 0.0D, 0.0D, 0.0D); + IPosition pos = BlockDispenser.getDispensePosition(blocksource); + blocksource.getWorld().spawnParticle(EnumParticleTypes.FLAME, pos.getX() + face.getFrontOffsetX(), pos.getY(), pos.getZ() + face.getFrontOffsetZ(), 0.0D, 0.0D, 0.0D); } } } diff --git a/src/main/java/ckathode/weaponmod/entity/projectile/dispense/DispenseMusketBullet.java b/src/main/java/ckathode/weaponmod/entity/projectile/dispense/DispenseMusketBullet.java index 5c0cde7c..ab76fb4f 100644 --- a/src/main/java/ckathode/weaponmod/entity/projectile/dispense/DispenseMusketBullet.java +++ b/src/main/java/ckathode/weaponmod/entity/projectile/dispense/DispenseMusketBullet.java @@ -5,6 +5,7 @@ import net.minecraft.dispenser.IPosition; import net.minecraft.entity.IProjectile; import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; import net.minecraft.world.World; import ckathode.weaponmod.entity.projectile.EntityMusketBullet; @@ -45,7 +46,7 @@ protected void playDispenseSound(IBlockSource blocksource) protected void spawnDispenseParticles(IBlockSource blocksource, EnumFacing face) { super.spawnDispenseParticles(blocksource, face); - IPosition pos = BlockDispenser.func_149939_a(blocksource); - blocksource.getWorld().spawnParticle("flame", pos.getX() + face.getFrontOffsetX(), pos.getY() + face.getFrontOffsetY(), pos.getZ() + face.getFrontOffsetZ(), 0.0D, 0.2D, 0.0D); + IPosition pos = BlockDispenser.getDispensePosition(blocksource); + blocksource.getWorld().spawnParticle(EnumParticleTypes.FLAME, pos.getX() + face.getFrontOffsetX(), pos.getY() + face.getFrontOffsetY(), pos.getZ() + face.getFrontOffsetZ(), 0.0D, 0.2D, 0.0D); } } diff --git a/src/main/java/ckathode/weaponmod/entity/projectile/dispense/DispenseWeaponProjectile.java b/src/main/java/ckathode/weaponmod/entity/projectile/dispense/DispenseWeaponProjectile.java index 23e945fd..85faa575 100644 --- a/src/main/java/ckathode/weaponmod/entity/projectile/dispense/DispenseWeaponProjectile.java +++ b/src/main/java/ckathode/weaponmod/entity/projectile/dispense/DispenseWeaponProjectile.java @@ -25,8 +25,8 @@ public DispenseWeaponProjectile() public ItemStack dispenseStack(IBlockSource blocksource, ItemStack itemstack) { World world = blocksource.getWorld(); - IPosition pos = BlockDispenser.func_149939_a(blocksource); - EnumFacing face = BlockDispenser.func_149937_b(blocksource.getBlockMetadata()); + IPosition pos = BlockDispenser.getDispensePosition(blocksource); + EnumFacing face = BlockDispenser.getFacing(blocksource.getBlockMetadata()); IProjectile projectile = getProjectileEntity(world, pos, itemstack); projectile.setThrowableHeading(face.getFrontOffsetX(), face.getFrontOffsetY() + getYVel(), face.getFrontOffsetZ(), getVelocity(), getDeviation()); world.spawnEntityInWorld((Entity) projectile); diff --git a/src/main/java/ckathode/weaponmod/item/AbstractWeaponComponent.java b/src/main/java/ckathode/weaponmod/item/AbstractWeaponComponent.java index 8d961d32..21a163f2 100644 --- a/src/main/java/ckathode/weaponmod/item/AbstractWeaponComponent.java +++ b/src/main/java/ckathode/weaponmod/item/AbstractWeaponComponent.java @@ -8,12 +8,13 @@ import net.minecraft.item.EnumAction; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockPos; import net.minecraft.world.World; import com.google.common.collect.Multimap; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; public abstract class AbstractWeaponComponent { @@ -45,7 +46,7 @@ final void setItem(IItemWeapon itemweapon) public abstract boolean canHarvestBlock(Block block); - public abstract boolean onBlockDestroyed(ItemStack itemstack, World world, Block block, int j, int k, int l, EntityLivingBase entityliving); + public abstract boolean onBlockDestroyed(ItemStack itemstack, World world, Block block, BlockPos pos, EntityLivingBase entityliving); public abstract boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker); diff --git a/src/main/java/ckathode/weaponmod/item/DartType.java b/src/main/java/ckathode/weaponmod/item/DartType.java index 1f989c26..311c47c6 100644 --- a/src/main/java/ckathode/weaponmod/item/DartType.java +++ b/src/main/java/ckathode/weaponmod/item/DartType.java @@ -1,11 +1,11 @@ package ckathode.weaponmod.item; +import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; -import net.minecraft.util.IIcon; public class DartType { @@ -36,7 +36,7 @@ public static DartType getDartTypeFromStack(ItemStack itemstack) public Object craftItem; public PotionEffect potionEffect; - public IIcon itemIcon; + public ModelResourceLocation itemModel; public DartType(int id, String typename, Object craftitem, PotionEffect potioneffect) { @@ -46,7 +46,7 @@ public DartType(int id, String typename, Object craftitem, PotionEffect potionef craftItem = craftitem; potionEffect = potioneffect; - itemIcon = null; + itemModel = null; } } diff --git a/src/main/java/ckathode/weaponmod/item/ExtendedReachHelper.java b/src/main/java/ckathode/weaponmod/item/ExtendedReachHelper.java index 5f4adbf6..bdf4eddb 100644 --- a/src/main/java/ckathode/weaponmod/item/ExtendedReachHelper.java +++ b/src/main/java/ckathode/weaponmod/item/ExtendedReachHelper.java @@ -4,12 +4,10 @@ import net.minecraft.client.Minecraft; import net.minecraft.entity.Entity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.Vec3; -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.util.*; +import net.minecraftforge.fml.client.FMLClientHandler; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public abstract class ExtendedReachHelper @@ -25,26 +23,26 @@ public abstract class ExtendedReachHelper public static MovingObjectPosition getMouseOver(float frame, float dist) { MovingObjectPosition mop = null; - if (mc.renderViewEntity != null) + if (mc.getRenderViewEntity() != null) { if (mc.theWorld != null) { double var2 = dist; - mop = mc.renderViewEntity.rayTrace(var2, frame); + mop = mc.getRenderViewEntity().rayTrace(var2, frame); double calcdist = var2; - Vec3 pos = mc.renderViewEntity.getPosition(frame); + BlockPos pos = mc.getRenderViewEntity().getPosition(); var2 = calcdist; if (mop != null) { - calcdist = mop.hitVec.distanceTo(pos); + calcdist = mop.hitVec.distanceTo(new Vec3(pos.getX(), pos.getY(), pos.getZ())); } - Vec3 lookvec = mc.renderViewEntity.getLook(frame); - Vec3 var8 = pos.addVector(lookvec.xCoord * var2, lookvec.yCoord * var2, lookvec.zCoord * var2); + Vec3 lookvec = mc.getRenderViewEntity().getLook(frame); + BlockPos var8 = pos.add(new Vec3i(lookvec.xCoord * var2, lookvec.yCoord * var2, lookvec.zCoord * var2)); Entity pointedEntity = null; float var9 = 1.0F; @SuppressWarnings("unchecked") - List list = mc.theWorld.getEntitiesWithinAABBExcludingEntity(mc.renderViewEntity, mc.renderViewEntity.boundingBox.addCoord(lookvec.xCoord * var2, lookvec.yCoord * var2, lookvec.zCoord * var2).expand(var9, var9, var9)); + List list = mc.theWorld.getEntitiesWithinAABBExcludingEntity(mc.getRenderViewEntity(), mc.getRenderViewEntity().getEntityBoundingBox().addCoord(lookvec.xCoord * var2, lookvec.yCoord * var2, lookvec.zCoord * var2).expand(var9, var9, var9)); double d = calcdist; for (Entity entity : list) @@ -52,10 +50,10 @@ public static MovingObjectPosition getMouseOver(float frame, float dist) if (entity.canBeCollidedWith()) { float bordersize = entity.getCollisionBorderSize(); - AxisAlignedBB aabb = entity.boundingBox.expand(bordersize, bordersize, bordersize); - MovingObjectPosition mop0 = aabb.calculateIntercept(pos, var8); + AxisAlignedBB aabb = entity.getBoundingBox().expand(bordersize, bordersize, bordersize); + MovingObjectPosition mop0 = aabb.calculateIntercept(new Vec3(pos.getX(), pos.getY(), pos.getZ()), new Vec3(var8.getX(), var8.getY(), var8.getZ())); - if (aabb.isVecInside(pos)) + if (aabb.isVecInside(new Vec3(pos.getX(), pos.getY(), pos.getZ()))) { if (0.0D < d || d == 0.0D) { @@ -64,7 +62,7 @@ public static MovingObjectPosition getMouseOver(float frame, float dist) } } else if (mop0 != null) { - double d1 = pos.distanceTo(mop0.hitVec); + double d1 = new Vec3(pos.getX(), pos.getY(), pos.getZ()).distanceTo(mop0.hitVec); if (d1 < d || d == 0.0D) { diff --git a/src/main/java/ckathode/weaponmod/item/ItemBlowgunDart.java b/src/main/java/ckathode/weaponmod/item/ItemBlowgunDart.java index 73926caf..a76526fe 100644 --- a/src/main/java/ckathode/weaponmod/item/ItemBlowgunDart.java +++ b/src/main/java/ckathode/weaponmod/item/ItemBlowgunDart.java @@ -2,7 +2,8 @@ import java.util.List; -import net.minecraft.client.renderer.texture.IIconRegister; +import ckathode.weaponmod.BalkonsWeaponMod; +import net.minecraft.client.resources.model.ModelBakery; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; @@ -10,19 +11,43 @@ import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; public class ItemBlowgunDart extends WMItem { public ItemBlowgunDart(String id) { super(id); + ModelBakery.addVariantName(this, BalkonsWeaponMod.MOD_ID + ":" + id); + ModelBakery.addVariantName(this, BalkonsWeaponMod.MOD_ID + ":" + id + "_hunger"); + ModelBakery.addVariantName(this, BalkonsWeaponMod.MOD_ID + ":" + id + "_slow"); + ModelBakery.addVariantName(this, BalkonsWeaponMod.MOD_ID + ":" + id + "_damage"); setHasSubtypes(true); } - + public String getUnlocalizedName(ItemStack stack) + { + return this.getFullName(stack.getMetadata()); + } + + public String getUnlocalizedName(int metadata) + { + return this.getFullName(metadata); + } + + public String getFullName(int metadata){ + if(metadata == 1){ + return super.getUnlocalizedName() + "_hunger"; + }else if(metadata == 2){ + return super.getUnlocalizedName() + "_slow"; + }else if(metadata == 3){ + return super.getUnlocalizedName() + "_damage"; + } + return super.getUnlocalizedName(); + } + @SuppressWarnings("unchecked") @Override public void getSubItems(Item item, CreativeTabs tab, @SuppressWarnings("rawtypes") List list) @@ -35,26 +60,6 @@ public void getSubItems(Item item, CreativeTabs tab, @SuppressWarnings("rawtypes } } } - - @Override - public IIcon getIconFromDamage(int damage) - { - return (damage >= 0 && damage < DartType.dartTypes.length && DartType.dartTypes[damage] != null) ? DartType.dartTypes[damage].itemIcon : itemIcon; - } - - @Override - public void registerIcons(IIconRegister iconregister) - { - itemIcon = iconregister.registerIcon(getIconString()); - for (DartType type : DartType.dartTypes) - { - if (type != null) - { - type.itemIcon = iconregister.registerIcon("weaponmod:" + type.typeName); - } - } - } - @SuppressWarnings("unchecked") @Override @SideOnly(Side.CLIENT) diff --git a/src/main/java/ckathode/weaponmod/item/ItemCannon.java b/src/main/java/ckathode/weaponmod/item/ItemCannon.java index 525fe905..db87ba46 100644 --- a/src/main/java/ckathode/weaponmod/item/ItemCannon.java +++ b/src/main/java/ckathode/weaponmod/item/ItemCannon.java @@ -3,6 +3,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockPos; import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition.MovingObjectType; @@ -31,9 +32,9 @@ public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer float f1 = entityplayer.prevRotationPitch + (entityplayer.rotationPitch - entityplayer.prevRotationPitch) * f; float f2 = entityplayer.prevRotationYaw + (entityplayer.rotationYaw - entityplayer.prevRotationYaw) * f; double d = entityplayer.prevPosX + (entityplayer.posX - entityplayer.prevPosX) * f; - double d1 = (entityplayer.prevPosY + (entityplayer.posY - entityplayer.prevPosY) * f + 1.6200000000000001D) - entityplayer.yOffset; + double d1 = (entityplayer.prevPosY + (entityplayer.posY - entityplayer.prevPosY) * f + 1.6200000000000001D) - entityplayer.getYOffset(); double d2 = entityplayer.prevPosZ + (entityplayer.posZ - entityplayer.prevPosZ) * f; - Vec3 vec3d = Vec3.createVectorHelper(d, d1, d2); + Vec3 vec3d = new Vec3(d, d1, d2); float f3 = MathHelper.cos(-f2 * 0.01745329F - 3.141593F); float f4 = MathHelper.sin(-f2 * 0.01745329F - 3.141593F); float f5 = -MathHelper.cos(-f1 * 0.01745329F); @@ -48,12 +49,12 @@ public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer { if (movingobjectposition.typeOfHit == MovingObjectType.BLOCK) { - int i = movingobjectposition.blockX; - int j = movingobjectposition.blockY; - int k = movingobjectposition.blockZ; + int i = movingobjectposition.getBlockPos().getX(); + int j = movingobjectposition.getBlockPos().getY(); + int k = movingobjectposition.getBlockPos().getZ(); if (!world.isRemote) { - if (world.getBlock(i, j, k) == Blocks.snow) + if (world.getBlockState(new BlockPos(i, j, k)).getBlock() == Blocks.snow) { j--; } diff --git a/src/main/java/ckathode/weaponmod/item/ItemCrossbow.java b/src/main/java/ckathode/weaponmod/item/ItemCrossbow.java index d71a6b94..60784857 100644 --- a/src/main/java/ckathode/weaponmod/item/ItemCrossbow.java +++ b/src/main/java/ckathode/weaponmod/item/ItemCrossbow.java @@ -1,36 +1,20 @@ package ckathode.weaponmod.item; -import net.minecraft.client.renderer.texture.IIconRegister; +import ckathode.weaponmod.BalkonsWeaponMod; +import net.minecraft.client.resources.model.ModelBakery; +import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; public class ItemCrossbow extends ItemShooter { - public IIcon iconIndexLoaded; + public ModelResourceLocation iconIndexLoaded; public ItemCrossbow(String id, RangedComponent rangedcomponent, MeleeComponent meleecomponent) { super(id, rangedcomponent, meleecomponent); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(ItemStack stack, int renderPass) - { - if (RangedComponent.isReloaded(stack)) - { - return iconIndexLoaded; - } - return super.getIcon(stack, renderPass); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister par1IconRegister) - { - super.registerIcons(par1IconRegister); - iconIndexLoaded = par1IconRegister.registerIcon(getIconString() + "-loaded"); + ModelBakery.addVariantName(this, BalkonsWeaponMod.MOD_ID + ":" + id); + ModelBakery.addVariantName(this, BalkonsWeaponMod.MOD_ID + ":" + id + "-loaded"); } } diff --git a/src/main/java/ckathode/weaponmod/item/ItemDummy.java b/src/main/java/ckathode/weaponmod/item/ItemDummy.java index 8e057be6..8c25f2b9 100644 --- a/src/main/java/ckathode/weaponmod/item/ItemDummy.java +++ b/src/main/java/ckathode/weaponmod/item/ItemDummy.java @@ -3,6 +3,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockPos; import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition.MovingObjectType; @@ -26,9 +27,9 @@ public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer float f1 = entityplayer.prevRotationPitch + (entityplayer.rotationPitch - entityplayer.prevRotationPitch) * f; float f2 = entityplayer.prevRotationYaw + (entityplayer.rotationYaw - entityplayer.prevRotationYaw) * f; double d = entityplayer.prevPosX + (entityplayer.posX - entityplayer.prevPosX) * f; - double d1 = (entityplayer.prevPosY + (entityplayer.posY - entityplayer.prevPosY) * f + 1.62D) - entityplayer.yOffset; + double d1 = (entityplayer.prevPosY + (entityplayer.posY - entityplayer.prevPosY) * f + 1.62D) - entityplayer.getYOffset(); double d2 = entityplayer.prevPosZ + (entityplayer.posZ - entityplayer.prevPosZ) * f; - Vec3 vec3d = Vec3.createVectorHelper(d, d1, d2); + Vec3 vec3d = new Vec3(d, d1, d2); float f3 = MathHelper.cos(-f2 * 0.01745329F - 3.141593F); float f4 = MathHelper.sin(-f2 * 0.01745329F - 3.141593F); float f5 = -MathHelper.cos(-f1 * 0.01745329F); @@ -43,10 +44,10 @@ public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer { if (movingobjectposition.typeOfHit == MovingObjectType.BLOCK) { - int i = movingobjectposition.blockX; - int j = movingobjectposition.blockY; - int k = movingobjectposition.blockZ; - if (world.getBlock(i, j, k) == Blocks.snow) + int i = movingobjectposition.getBlockPos().getX(); + int j = movingobjectposition.getBlockPos().getY(); + int k = movingobjectposition.getBlockPos().getZ(); + if (world.getBlockState(new BlockPos(i, j, k)).getBlock() == Blocks.snow) { j--; } diff --git a/src/main/java/ckathode/weaponmod/item/ItemDynamite.java b/src/main/java/ckathode/weaponmod/item/ItemDynamite.java index 29a35078..6fc3c7d2 100644 --- a/src/main/java/ckathode/weaponmod/item/ItemDynamite.java +++ b/src/main/java/ckathode/weaponmod/item/ItemDynamite.java @@ -4,8 +4,8 @@ import net.minecraft.item.ItemStack; import net.minecraft.world.World; import ckathode.weaponmod.entity.projectile.EntityDynamite; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; public class ItemDynamite extends WMItem { diff --git a/src/main/java/ckathode/weaponmod/item/ItemFlail.java b/src/main/java/ckathode/weaponmod/item/ItemFlail.java index f0954004..e1efffb8 100644 --- a/src/main/java/ckathode/weaponmod/item/ItemFlail.java +++ b/src/main/java/ckathode/weaponmod/item/ItemFlail.java @@ -1,20 +1,19 @@ package ckathode.weaponmod.item; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; import net.minecraft.world.World; import ckathode.weaponmod.PlayerWeaponData; import ckathode.weaponmod.entity.projectile.EntityFlail; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; public class ItemFlail extends WMItem { - public IIcon iconIndexThrown; + public ModelResourceLocation modelResourceLocation; private float flailDamage; public ItemFlail(String id, Item.ToolMaterial toolmaterial) @@ -133,23 +132,4 @@ public float getFlailDamage() { return flailDamage; } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) - { - if (PlayerWeaponData.isFlailThrown(player)) - { - return iconIndexThrown; - } - return super.getIcon(stack, renderPass, player, usingItem, useRemaining); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconregister) - { - super.registerIcons(iconregister); - iconIndexThrown = iconregister.registerIcon("weaponmod:flail-thrown"); - } } diff --git a/src/main/java/ckathode/weaponmod/item/ItemJavelin.java b/src/main/java/ckathode/weaponmod/item/ItemJavelin.java index f3b880ba..072be52c 100644 --- a/src/main/java/ckathode/weaponmod/item/ItemJavelin.java +++ b/src/main/java/ckathode/weaponmod/item/ItemJavelin.java @@ -5,8 +5,8 @@ import net.minecraft.item.ItemStack; import net.minecraft.world.World; import ckathode.weaponmod.entity.projectile.EntityJavelin; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; public class ItemJavelin extends WMItem { @@ -63,7 +63,7 @@ public int getMaxItemUseDuration(ItemStack itemstack) @Override public EnumAction getItemUseAction(ItemStack itemstack) { - return EnumAction.bow; + return EnumAction.BOW; } @Override diff --git a/src/main/java/ckathode/weaponmod/item/ItemMelee.java b/src/main/java/ckathode/weaponmod/item/ItemMelee.java index 6c29497c..d6b2433b 100644 --- a/src/main/java/ckathode/weaponmod/item/ItemMelee.java +++ b/src/main/java/ckathode/weaponmod/item/ItemMelee.java @@ -11,15 +11,16 @@ import net.minecraft.item.EnumAction; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemSword; +import net.minecraft.util.BlockPos; import net.minecraft.world.World; import ckathode.weaponmod.BalkonsWeaponMod; import com.google.common.collect.HashMultimap; import com.google.common.collect.Multimap; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; public class ItemMelee extends ItemSword implements IItemWeapon { @@ -30,7 +31,6 @@ public ItemMelee(String id, MeleeComponent meleecomponent) super((meleecomponent.weaponMaterial == null ? ToolMaterial.WOOD : meleecomponent.weaponMaterial)); GameRegistry.registerItem(this, id, BalkonsWeaponMod.MOD_ID); setUnlocalizedName(id); - setTextureName("weaponmod:" + id); meleeComponent = meleecomponent; meleecomponent.setItem(this); @@ -38,19 +38,19 @@ public ItemMelee(String id, MeleeComponent meleecomponent) } @Override - public float func_150931_i() + public float getDamageVsEntity() { return meleeComponent.getEntityDamageMaterialPart(); } @Override - public float func_150893_a(ItemStack itemstack, Block block) + public float getStrVsBlock(ItemStack itemstack, Block block) { return meleeComponent.getBlockDamage(itemstack, block); } @Override - public boolean func_150897_b(Block block) + public boolean canHarvestBlock(Block block) { return meleeComponent.canHarvestBlock(block); } @@ -62,9 +62,9 @@ public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, Ent } @Override - public boolean onBlockDestroyed(ItemStack itemstack, World world, Block block, int j, int k, int l, EntityLivingBase entityliving) + public boolean onBlockDestroyed(ItemStack itemstack, World world, Block block, BlockPos pos, EntityLivingBase entityliving) { - return meleeComponent.onBlockDestroyed(itemstack, world, block, j, k, l, entityliving); + return meleeComponent.onBlockDestroyed(itemstack, world, block, pos, entityliving); } @Override @@ -133,7 +133,7 @@ public boolean shouldRotateAroundWhenRendering() @Override public final UUID getUUID() { - return field_111210_e; + return itemModifierUUID; } @Override diff --git a/src/main/java/ckathode/weaponmod/item/ItemMusket.java b/src/main/java/ckathode/weaponmod/item/ItemMusket.java index 2d93e8a7..645c73dd 100644 --- a/src/main/java/ckathode/weaponmod/item/ItemMusket.java +++ b/src/main/java/ckathode/weaponmod/item/ItemMusket.java @@ -1,5 +1,6 @@ package ckathode.weaponmod.item; +import net.minecraft.client.resources.model.ModelBakery; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; @@ -46,11 +47,11 @@ public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, Ent if (attacker instanceof EntityPlayer && !((EntityPlayer) attacker).capabilities.isCreativeMode) { EntityPlayer entityplayer = (EntityPlayer) attacker; - if (itemstack.stackTagCompound == null) + if (!itemstack.hasTagCompound()) { - itemstack.stackTagCompound = new NBTTagCompound(); + itemstack.setTagCompound(new NBTTagCompound()); } - int bayonetdamage = itemstack.stackTagCompound.getShort("bayonetDamage") + 1; + int bayonetdamage = itemstack.getTagCompound().getShort("bayonetDamage") + 1; if (bayonetdamage > bayonetDurability) { /* @@ -83,9 +84,9 @@ public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, Ent entityplayer.addStat(StatList.objectBreakStats[id], 1); } bayonetdamage = 0; - itemstack.func_150996_a(BalkonsWeaponMod.musket); + itemstack.setItem(BalkonsWeaponMod.musket); } - itemstack.stackTagCompound.setShort("bayonetDamage", (short) bayonetdamage); + itemstack.getTagCompound().setShort("bayonetDamage", (short) bayonetdamage); } return true; } diff --git a/src/main/java/ckathode/weaponmod/item/ItemShooter.java b/src/main/java/ckathode/weaponmod/item/ItemShooter.java index c5b656bd..24015423 100644 --- a/src/main/java/ckathode/weaponmod/item/ItemShooter.java +++ b/src/main/java/ckathode/weaponmod/item/ItemShooter.java @@ -4,7 +4,6 @@ import java.util.UUID; import net.minecraft.block.Block; -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.ai.attributes.AttributeModifier; @@ -12,15 +11,16 @@ import net.minecraft.item.EnumAction; import net.minecraft.item.ItemBow; import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockPos; import net.minecraft.world.World; import ckathode.weaponmod.BalkonsWeaponMod; import com.google.common.collect.HashMultimap; import com.google.common.collect.Multimap; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; public class ItemShooter extends ItemBow implements IItemWeapon { @@ -34,7 +34,6 @@ public ItemShooter(String id, RangedComponent rangedcomponent, MeleeComponent me super(); GameRegistry.registerItem(this, id, BalkonsWeaponMod.MOD_ID); setUnlocalizedName(id); - setTextureName("weaponmod:" + id); rangedComponent = rangedcomponent; meleeComponent = meleecomponent; @@ -47,13 +46,13 @@ public ItemShooter(String id, RangedComponent rangedcomponent, MeleeComponent me // MELEE PART // @Override - public float func_150893_a(ItemStack itemstack, Block block) + public float getStrVsBlock(ItemStack itemstack, Block block) { return meleeComponent.getBlockDamage(itemstack, block); } @Override - public boolean func_150897_b(Block block) + public boolean canHarvestBlock(Block block) { return meleeComponent.canHarvestBlock(block); } @@ -65,9 +64,9 @@ public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, Ent } @Override - public boolean onBlockDestroyed(ItemStack itemstack, World world, Block block, int j, int k, int l, EntityLivingBase entityliving) + public boolean onBlockDestroyed(ItemStack itemstack, World world, Block block, BlockPos pos, EntityLivingBase entityliving) { - return meleeComponent.onBlockDestroyed(itemstack, world, block, j, k, l, entityliving); + return meleeComponent.onBlockDestroyed(itemstack, world, block, pos, entityliving); } @Override @@ -139,7 +138,7 @@ public boolean shouldRotateAroundWhenRendering() @Override public final UUID getUUID() { - return field_111210_e; + return itemModifierUUID; } @Override @@ -159,14 +158,7 @@ public RangedComponent getRangedComponent() { return rangedComponent; } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconregister) - { - itemIcon = iconregister.registerIcon(getIconString()); - } - + @Override @SideOnly(Side.CLIENT) public boolean isFull3D() diff --git a/src/main/java/ckathode/weaponmod/item/MeleeCompBoomerang.java b/src/main/java/ckathode/weaponmod/item/MeleeCompBoomerang.java index 33d10daa..da79d667 100644 --- a/src/main/java/ckathode/weaponmod/item/MeleeCompBoomerang.java +++ b/src/main/java/ckathode/weaponmod/item/MeleeCompBoomerang.java @@ -67,7 +67,7 @@ public int getMaxItemUseDuration(ItemStack itemstack) @Override public EnumAction getItemUseAction(ItemStack itemstack) { - return EnumAction.block; + return EnumAction.BLOCK; } @Override diff --git a/src/main/java/ckathode/weaponmod/item/MeleeCompFirerod.java b/src/main/java/ckathode/weaponmod/item/MeleeCompFirerod.java index 72a68345..8b542f21 100644 --- a/src/main/java/ckathode/weaponmod/item/MeleeCompFirerod.java +++ b/src/main/java/ckathode/weaponmod/item/MeleeCompFirerod.java @@ -6,6 +6,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MathHelper; import net.minecraft.world.World; @@ -40,11 +41,11 @@ public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boo float particleZ = MathHelper.cos(((entity.rotationYaw + f1) / 180F) * 3.141593F) * MathHelper.cos((entity.rotationPitch / 180F) * 3.141593F) * f; if (weapon.getItemRand().nextInt(5) == 0) { - world.spawnParticle("flame", entity.posX + particleX, entity.posY + particleY, entity.posZ + particleZ, 0.0D, 0.0D, 0.0D); + world.spawnParticle(EnumParticleTypes.FLAME, entity.posX + particleX, entity.posY + particleY, entity.posZ + particleZ, 0.0D, 0.0D, 0.0D); } if (weapon.getItemRand().nextInt(5) == 0) { - world.spawnParticle("smoke", entity.posX + particleX, entity.posY + particleY, entity.posZ + particleZ, 0.0D, 0.0D, 0.0D); + world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, entity.posX + particleX, entity.posY + particleY, entity.posZ + particleZ, 0.0D, 0.0D, 0.0D); } } } diff --git a/src/main/java/ckathode/weaponmod/item/MeleeCompHalberd.java b/src/main/java/ckathode/weaponmod/item/MeleeCompHalberd.java index 96b4fb56..fe920d2f 100644 --- a/src/main/java/ckathode/weaponmod/item/MeleeCompHalberd.java +++ b/src/main/java/ckathode/weaponmod/item/MeleeCompHalberd.java @@ -7,9 +7,9 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import net.minecraftforge.fml.client.FMLClientHandler; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; public class MeleeCompHalberd extends MeleeComponent implements IExtendedReachItem { @@ -53,7 +53,7 @@ public float getKnockBack(ItemStack itemstack, EntityLivingBase entityliving, En @Override public EnumAction getItemUseAction(ItemStack itemstack) { - return EnumAction.none; + return EnumAction.NONE; } @Override diff --git a/src/main/java/ckathode/weaponmod/item/MeleeCompKnife.java b/src/main/java/ckathode/weaponmod/item/MeleeCompKnife.java index 4f9b1cad..1eb1cbaa 100644 --- a/src/main/java/ckathode/weaponmod/item/MeleeCompKnife.java +++ b/src/main/java/ckathode/weaponmod/item/MeleeCompKnife.java @@ -45,7 +45,7 @@ public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer @Override public EnumAction getItemUseAction(ItemStack itemstack) { - return BalkonsWeaponMod.instance.modConfig.canThrowKnife ? EnumAction.none : super.getItemUseAction(itemstack); + return BalkonsWeaponMod.instance.modConfig.canThrowKnife ? EnumAction.NONE : super.getItemUseAction(itemstack); } @Override diff --git a/src/main/java/ckathode/weaponmod/item/MeleeCompNone.java b/src/main/java/ckathode/weaponmod/item/MeleeCompNone.java index 93d67c38..ec9ebf4e 100644 --- a/src/main/java/ckathode/weaponmod/item/MeleeCompNone.java +++ b/src/main/java/ckathode/weaponmod/item/MeleeCompNone.java @@ -7,6 +7,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumAction; import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockPos; import net.minecraft.world.World; import com.google.common.collect.Multimap; @@ -43,7 +44,7 @@ public boolean canHarvestBlock(Block block) } @Override - public boolean onBlockDestroyed(ItemStack itemstack, World world, Block block, int j, int k, int l, EntityLivingBase entityliving) + public boolean onBlockDestroyed(ItemStack itemstack, World world, Block block, BlockPos pos, EntityLivingBase entityliving) { return true; } @@ -80,7 +81,7 @@ public boolean onLeftClickEntity(ItemStack itemstack, EntityPlayer player, Entit @Override public EnumAction getItemUseAction(ItemStack itemstack) { - return EnumAction.none; + return EnumAction.NONE; } @Override diff --git a/src/main/java/ckathode/weaponmod/item/MeleeCompSpear.java b/src/main/java/ckathode/weaponmod/item/MeleeCompSpear.java index 507deb08..4ecc00cf 100644 --- a/src/main/java/ckathode/weaponmod/item/MeleeCompSpear.java +++ b/src/main/java/ckathode/weaponmod/item/MeleeCompSpear.java @@ -46,7 +46,7 @@ public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer @Override public EnumAction getItemUseAction(ItemStack itemstack) { - return BalkonsWeaponMod.instance.modConfig.canThrowSpear ? EnumAction.none : EnumAction.block; + return BalkonsWeaponMod.instance.modConfig.canThrowSpear ? EnumAction.NONE : EnumAction.BLOCK; } @Override diff --git a/src/main/java/ckathode/weaponmod/item/MeleeCompWarhammer.java b/src/main/java/ckathode/weaponmod/item/MeleeCompWarhammer.java index 09361f72..1ae2a1e4 100644 --- a/src/main/java/ckathode/weaponmod/item/MeleeCompWarhammer.java +++ b/src/main/java/ckathode/weaponmod/item/MeleeCompWarhammer.java @@ -43,7 +43,7 @@ protected void superSmash(ItemStack itemstack, World world, EntityPlayer entityp { entityplayer.swingItem(); float f = getEntityDamage() / 2F; - WarhammerExplosion expl = new WarhammerExplosion(world, entityplayer, entityplayer.posX, entityplayer.posY - entityplayer.getEyeHeight(), entityplayer.posZ, f); + WarhammerExplosion expl = new WarhammerExplosion(world, entityplayer, entityplayer.posX, entityplayer.posY - entityplayer.getEyeHeight(), entityplayer.posZ, f, true, true); expl.doEntityExplosion(DamageSource.causePlayerDamage(entityplayer)); expl.doParticleExplosion(true, false); itemstack.damageItem(16, entityplayer); @@ -64,7 +64,7 @@ public boolean isCharged(EntityPlayer entityplayer) @Override public EnumAction getItemUseAction(ItemStack itemstack) { - return EnumAction.bow; + return EnumAction.BOW; } @Override diff --git a/src/main/java/ckathode/weaponmod/item/MeleeComponent.java b/src/main/java/ckathode/weaponmod/item/MeleeComponent.java index f10cf646..74681ed9 100644 --- a/src/main/java/ckathode/weaponmod/item/MeleeComponent.java +++ b/src/main/java/ckathode/weaponmod/item/MeleeComponent.java @@ -12,14 +12,15 @@ import net.minecraft.item.Item; import net.minecraft.item.Item.ToolMaterial; import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockPos; import net.minecraft.world.World; import ckathode.weaponmod.PhysHelper; import ckathode.weaponmod.WeaponModAttributes; import com.google.common.collect.Multimap; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; public class MeleeComponent extends AbstractWeaponComponent { @@ -84,9 +85,9 @@ public boolean canHarvestBlock(Block block) } @Override - public boolean onBlockDestroyed(ItemStack itemstack, World world, Block block, int j, int k, int l, EntityLivingBase entityliving) + public boolean onBlockDestroyed(ItemStack itemstack, World world, Block block, BlockPos pos, EntityLivingBase entityliving) { - if ((meleeSpecs.blockDamage > 1F || canHarvestBlock(block)) && block.getBlockHardness(world, j, k, l) != 0F) + if ((meleeSpecs.blockDamage > 1F || canHarvestBlock(block)) && block.getBlockHardness(world, pos) != 0F) { itemstack.damageItem(meleeSpecs.dmgFromBlock, entityliving); } @@ -160,7 +161,7 @@ public boolean onLeftClickEntity(ItemStack itemstack, EntityPlayer player, Entit @Override public EnumAction getItemUseAction(ItemStack itemstack) { - return EnumAction.block; + return EnumAction.BLOCK; } @Override diff --git a/src/main/java/ckathode/weaponmod/item/RangedCompBlowgun.java b/src/main/java/ckathode/weaponmod/item/RangedCompBlowgun.java index 5c3be9f3..65b516b3 100644 --- a/src/main/java/ckathode/weaponmod/item/RangedCompBlowgun.java +++ b/src/main/java/ckathode/weaponmod/item/RangedCompBlowgun.java @@ -4,6 +4,7 @@ import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import ckathode.weaponmod.BalkonsWeaponMod; @@ -113,7 +114,7 @@ public void effectShoot(World world, double x, double y, double z, float yaw, fl float particleY = -MathHelper.sin((pitch / 180F) * 3.141593F) - 0.1F; float particleZ = MathHelper.cos(((yaw + 23) / 180F) * 3.141593F) * MathHelper.cos((pitch / 180F) * 3.141593F); - world.spawnParticle("explode", x + particleX, y + particleY, z + particleZ, 0.0D, 0.0D, 0.0D); + world.spawnParticle(EnumParticleTypes.EXPLOSION_NORMAL, x + particleX, y + particleY, z + particleZ, 0.0D, 0.0D, 0.0D); } @Override diff --git a/src/main/java/ckathode/weaponmod/item/RangedCompBlunderbuss.java b/src/main/java/ckathode/weaponmod/item/RangedCompBlunderbuss.java index 56b3a2e5..c4fb9c83 100644 --- a/src/main/java/ckathode/weaponmod/item/RangedCompBlunderbuss.java +++ b/src/main/java/ckathode/weaponmod/item/RangedCompBlunderbuss.java @@ -2,6 +2,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import ckathode.weaponmod.ReloadHelper; @@ -59,9 +60,9 @@ public void effectShoot(World world, double x, double y, double z, float yaw, fl for (int i = 0; i < 3; i++) { - world.spawnParticle("smoke", x + particleX, y + particleY, z + particleZ, 0.0D, 0.0D, 0.0D); + world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, x + particleX, y + particleY, z + particleZ, 0.0D, 0.0D, 0.0D); } - world.spawnParticle("flame", x + particleX, y + particleY, z + particleZ, 0.0D, 0.0D, 0.0D); + world.spawnParticle(EnumParticleTypes.FLAME, x + particleX, y + particleY, z + particleZ, 0.0D, 0.0D, 0.0D); } @Override diff --git a/src/main/java/ckathode/weaponmod/item/RangedCompFlintlock.java b/src/main/java/ckathode/weaponmod/item/RangedCompFlintlock.java index 1e304b51..8b521fca 100644 --- a/src/main/java/ckathode/weaponmod/item/RangedCompFlintlock.java +++ b/src/main/java/ckathode/weaponmod/item/RangedCompFlintlock.java @@ -2,6 +2,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import ckathode.weaponmod.ReloadHelper; @@ -72,9 +73,9 @@ public void effectShoot(World world, double x, double y, double z, float yaw, fl for (int i = 0; i < 3; i++) { - world.spawnParticle("smoke", x + particleX, y + particleY, z + particleZ, 0.0D, 0.0D, 0.0D); + world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, x + particleX, y + particleY, z + particleZ, 0.0D, 0.0D, 0.0D); } - world.spawnParticle("flame", x + particleX, y + particleY, z + particleZ, 0.0D, 0.0D, 0.0D); + world.spawnParticle(EnumParticleTypes.FLAME, x + particleX, y + particleY, z + particleZ, 0.0D, 0.0D, 0.0D); } @Override diff --git a/src/main/java/ckathode/weaponmod/item/RangedCompMusket.java b/src/main/java/ckathode/weaponmod/item/RangedCompMusket.java index 6427b2ed..65db6d83 100644 --- a/src/main/java/ckathode/weaponmod/item/RangedCompMusket.java +++ b/src/main/java/ckathode/weaponmod/item/RangedCompMusket.java @@ -2,6 +2,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import ckathode.weaponmod.ReloadHelper; @@ -58,7 +59,7 @@ public void fire(ItemStack itemstack, World world, EntityPlayer entityplayer, in itemstack.damageItem(deltadamage, entityplayer); if (flag) { - int bayonetdamage = itemstack.stackTagCompound == null ? 0 : itemstack.stackTagCompound.getShort("bayonetDamage"); + int bayonetdamage = !itemstack.hasTagCompound() ? 0 : itemstack.getTagCompound().getShort("bayonetDamage"); entityplayer.inventory.addItemStackToInventory(new ItemStack(musket.bayonetItem, 1, bayonetdamage)); } else { @@ -89,9 +90,9 @@ public void effectShoot(World world, double x, double y, double z, float yaw, fl for (int i = 0; i < 3; i++) { - world.spawnParticle("smoke", x + particleX, y + particleY, z + particleZ, 0.0D, 0.0D, 0.0D); + world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, x + particleX, y + particleY, z + particleZ, 0.0D, 0.0D, 0.0D); } - world.spawnParticle("flame", x + particleX, y + particleY, z + particleZ, 0.0D, 0.0D, 0.0D); + world.spawnParticle(EnumParticleTypes.FLAME, x + particleX, y + particleY, z + particleZ, 0.0D, 0.0D, 0.0D); } @Override diff --git a/src/main/java/ckathode/weaponmod/item/RangedComponent.java b/src/main/java/ckathode/weaponmod/item/RangedComponent.java index 1dcbec97..24983ef4 100644 --- a/src/main/java/ckathode/weaponmod/item/RangedComponent.java +++ b/src/main/java/ckathode/weaponmod/item/RangedComponent.java @@ -10,6 +10,7 @@ import net.minecraft.item.EnumAction; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockPos; import net.minecraft.world.World; import ckathode.weaponmod.BalkonsWeaponMod; import ckathode.weaponmod.ReloadHelper; @@ -18,8 +19,8 @@ import com.google.common.collect.Multimap; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; public abstract class RangedComponent extends AbstractWeaponComponent { @@ -84,7 +85,7 @@ public boolean canHarvestBlock(Block block) } @Override - public boolean onBlockDestroyed(ItemStack itemstack, World world, Block block, int j, int k, int l, EntityLivingBase entityliving) + public boolean onBlockDestroyed(ItemStack itemstack, World world, Block block, BlockPos pos, EntityLivingBase entityliving) { return false; } @@ -131,12 +132,12 @@ public EnumAction getItemUseAction(ItemStack itemstack) int state = ReloadHelper.getReloadState(itemstack); if (state == ReloadHelper.STATE_NONE) { - return EnumAction.block; + return EnumAction.BLOCK; } else if (state == ReloadHelper.STATE_READY) { - return EnumAction.bow; + return EnumAction.BOW; } - return EnumAction.none; + return EnumAction.NONE; } @Override diff --git a/src/main/java/ckathode/weaponmod/item/WMItem.java b/src/main/java/ckathode/weaponmod/item/WMItem.java index 131f43be..4f542e5b 100644 --- a/src/main/java/ckathode/weaponmod/item/WMItem.java +++ b/src/main/java/ckathode/weaponmod/item/WMItem.java @@ -3,7 +3,7 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import ckathode.weaponmod.BalkonsWeaponMod; -import cpw.mods.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.common.registry.GameRegistry; public class WMItem extends Item { @@ -11,7 +11,6 @@ public WMItem(String id) { GameRegistry.registerItem(this, id, BalkonsWeaponMod.MOD_ID); setUnlocalizedName(id); - setTextureName("weaponmod:" + id); setCreativeTab(CreativeTabs.tabCombat); } diff --git a/src/main/java/ckathode/weaponmod/network/MsgCannonFire.java b/src/main/java/ckathode/weaponmod/network/MsgCannonFire.java index 4a3d7b6f..fd24d5cb 100644 --- a/src/main/java/ckathode/weaponmod/network/MsgCannonFire.java +++ b/src/main/java/ckathode/weaponmod/network/MsgCannonFire.java @@ -1,52 +1,46 @@ package ckathode.weaponmod.network; +import ckathode.weaponmod.entity.EntityCannon; import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import ckathode.weaponmod.entity.EntityCannon; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class MsgCannonFire extends WMMessage -{ - private int cannonEntityID = 0; - - public MsgCannonFire() - { - } - - public MsgCannonFire(EntityCannon entity) - { - cannonEntityID = entity.getEntityId(); - } - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buf) - { - cannonEntityID = buf.readInt(); - } - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buf) - { - buf.writeInt(cannonEntityID); - } - - @Override - @SideOnly(Side.CLIENT) - public void handleClientSide(EntityPlayer player) - { - } - - @Override - public void handleServerSide(EntityPlayer player) - { - Entity entity = player.worldObj.getEntityByID(cannonEntityID); - if (entity instanceof EntityCannon) - { - ((EntityCannon) entity).fireCannon(); - } - } - +import net.minecraftforge.fml.common.network.ByteBufUtils; +import net.minecraftforge.fml.common.network.simpleimpl.IMessage; +import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; +import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; + +public class MsgCannonFire extends WMMessage { + + private int cannonEntityID = 0; + + public MsgCannonFire() { } + + public MsgCannonFire(EntityCannon entity) { + cannonEntityID = entity.getEntityId(); + } + + @Override + public void fromBytes(ByteBuf buf) { + cannonEntityID = buf.readShort(); + } + + @Override + public void toBytes(ByteBuf buf) { + ByteBufUtils.writeVarShort(buf, cannonEntityID); + } + + public static class Handler implements IMessageHandler { + + @Override + public IMessage onMessage(MsgCannonFire message, MessageContext ctx) { + System.out.println(String.format("Received %s from %s", message.cannonEntityID, ctx.getServerHandler().playerEntity.getDisplayName())); + + Entity entity = ctx.getServerHandler().playerEntity.worldObj.getEntityByID(message.cannonEntityID); + if (entity instanceof EntityCannon) + { + ((EntityCannon) entity).fireCannon(); + } + + return null; + } + } } diff --git a/src/main/java/ckathode/weaponmod/network/MsgExplosion.java b/src/main/java/ckathode/weaponmod/network/MsgExplosion.java index 34994b3b..fbdee8c3 100644 --- a/src/main/java/ckathode/weaponmod/network/MsgExplosion.java +++ b/src/main/java/ckathode/weaponmod/network/MsgExplosion.java @@ -1,44 +1,47 @@ package ckathode.weaponmod.network; +import ckathode.weaponmod.entity.EntityCannon; import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; import java.util.ArrayList; import java.util.List; +import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.ChunkPosition; +import net.minecraft.util.BlockPos; +import net.minecraft.util.Vec3; import net.minecraft.world.World; import ckathode.weaponmod.AdvancedExplosion; -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import net.minecraftforge.fml.client.FMLClientHandler; +import net.minecraftforge.fml.common.network.simpleimpl.IMessage; +import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; +import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; -public class MsgExplosion extends WMMessage -{ +public class MsgExplosion extends WMMessage { private double x, y, z; private float size; - private List blocks; + private List blocks; private boolean smallParticles, bigParticles; + public MsgExplosion() { } + @SuppressWarnings("unchecked") public MsgExplosion(AdvancedExplosion explosion, boolean smallparts, boolean bigparts) { - x = explosion.explosionX; - y = explosion.explosionY; - z = explosion.explosionZ; + x = explosion.getPosition().xCoord; + y = explosion.getPosition().yCoord; + z = explosion.getPosition().zCoord; size = explosion.explosionSize; blocks = explosion.affectedBlockPositions; smallParticles = smallparts; bigParticles = bigparts; } - public MsgExplosion() - { - } - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buf) + public void fromBytes(ByteBuf buf) { x = buf.readDouble(); y = buf.readDouble(); @@ -48,18 +51,18 @@ public void decodeInto(ChannelHandlerContext ctx, ByteBuf buf) bigParticles = buf.readBoolean(); int size = buf.readInt(); - blocks = new ArrayList(size); + blocks = new ArrayList(size); for (int i = 0; i < size; i++) { int ix = buf.readByte() + (int) x; int iy = buf.readByte() + (int) y; int iz = buf.readByte() + (int) z; - blocks.add(new ChunkPosition(ix, iy, iz)); + blocks.add(new BlockPos(ix, iy, iz)); } } @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buf) + public void toBytes(ByteBuf buf) { buf.writeDouble(x); buf.writeDouble(y); @@ -72,28 +75,26 @@ public void encodeInto(ChannelHandlerContext ctx, ByteBuf buf) buf.writeInt(n); for (int i = 0; i < n; i++) { - ChunkPosition pos = blocks.get(i); - int dx = pos.chunkPosX - (int) x; - int dy = pos.chunkPosY - (int) y; - int dz = pos.chunkPosZ - (int) z; + BlockPos pos = blocks.get(i); + int dx = (int) pos.getX() - (int) x; + int dy = (int) pos.getY() - (int) y; + int dz = (int) pos.getZ() - (int) z; buf.writeByte(dx); buf.writeByte(dy); buf.writeByte(dz); } } - @Override - @SideOnly(Side.CLIENT) - public void handleClientSide(EntityPlayer player) - { - World world = FMLClientHandler.instance().getWorldClient(); - AdvancedExplosion expl = new AdvancedExplosion(world, null, x, y, z, size); - expl.setAffectedBlockPositions(blocks); - expl.doParticleExplosion(smallParticles, bigParticles); - } + public static class Handler implements IMessageHandler { - @Override - public void handleServerSide(EntityPlayer player) - { + @Override + public IMessage onMessage(MsgExplosion message, MessageContext ctx) { + World world = FMLClientHandler.instance().getWorldClient(); + AdvancedExplosion expl = new AdvancedExplosion(world, null, message.x, message.y, message.z, message.size, true, true); + expl.setAffectedBlockPositions(message.blocks); + expl.doParticleExplosion(message.smallParticles, message.bigParticles); + + return null; + } } } diff --git a/src/main/java/ckathode/weaponmod/network/WMMessage.java b/src/main/java/ckathode/weaponmod/network/WMMessage.java index 75c4b504..f81fdce7 100644 --- a/src/main/java/ckathode/weaponmod/network/WMMessage.java +++ b/src/main/java/ckathode/weaponmod/network/WMMessage.java @@ -3,17 +3,13 @@ import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; import net.minecraft.entity.player.EntityPlayer; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import net.minecraftforge.fml.common.network.simpleimpl.IMessage; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; -public abstract class WMMessage +public abstract class WMMessage implements IMessage { - public abstract void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer); + public abstract void fromBytes(ByteBuf buffer); - public abstract void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer); - - @SideOnly(Side.CLIENT) - public abstract void handleClientSide(EntityPlayer player); - - public abstract void handleServerSide(EntityPlayer player); + public abstract void toBytes(ByteBuf buffer); } diff --git a/src/main/java/ckathode/weaponmod/network/WMMessagePipeline.java b/src/main/java/ckathode/weaponmod/network/WMMessagePipeline.java index 8697c22d..510ca318 100644 --- a/src/main/java/ckathode/weaponmod/network/WMMessagePipeline.java +++ b/src/main/java/ckathode/weaponmod/network/WMMessagePipeline.java @@ -1,238 +1,10 @@ package ckathode.weaponmod.network; -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; -import io.netty.channel.ChannelHandler; -import io.netty.channel.ChannelHandlerContext; -import io.netty.handler.codec.MessageToMessageCodec; +import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper; +import net.minecraftforge.fml.relauncher.Side; -import java.util.Collections; -import java.util.Comparator; -import java.util.EnumMap; -import java.util.LinkedList; -import java.util.List; - -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.network.INetHandler; -import net.minecraft.network.NetHandlerPlayServer; -import ckathode.weaponmod.BalkonsWeaponMod; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.network.FMLEmbeddedChannel; -import cpw.mods.fml.common.network.FMLOutboundHandler; -import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.common.network.internal.FMLProxyPacket; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Packet pipeline class. Directs all registered packet data to be handled by the packets themselves. - * - * @author sirgingalot some code from: cpw - */ -@ChannelHandler.Sharable -public class WMMessagePipeline extends MessageToMessageCodec -{ - private EnumMap channels; - private LinkedList> packets = new LinkedList>(); - private boolean isPostInitialized = false; - - /** - * Register your packet with the pipeline. Discriminators are automatically set. - * - * @param class0 - * the class to register - * - * @return whether registration was successful. Failure may occur if 256 packets have been registered or if the registry already contains this packet - */ - public boolean registerPacket(Class class0) - { - if (packets.size() > 256) - { - BalkonsWeaponMod.modLog.error("More than 256 packets registered"); - return false; - } - - if (packets.contains(class0)) - { - BalkonsWeaponMod.modLog.warn("Packet already registered"); - return false; - } - - if (isPostInitialized) - { - BalkonsWeaponMod.modLog.error("Already post-initialized"); - return false; - } - - packets.add(class0); - return true; - } - - @Override - protected void encode(ChannelHandlerContext ctx, WMMessage msg, List out) throws Exception - { - ByteBuf buffer = Unpooled.buffer(); - Class clazz = msg.getClass(); - if (!packets.contains(msg.getClass())) - { - throw new NullPointerException("No Packet Registered for: " + msg.getClass().getCanonicalName()); - } - - byte discriminator = (byte) packets.indexOf(clazz); - buffer.writeByte(discriminator); - msg.encodeInto(ctx, buffer); - FMLProxyPacket proxyPacket = new FMLProxyPacket(buffer, ctx.channel().attr(NetworkRegistry.FML_CHANNEL).get()); - out.add(proxyPacket); - } - - @Override - protected void decode(ChannelHandlerContext ctx, FMLProxyPacket msg, List out) throws Exception - { - ByteBuf payload = msg.payload(); - byte discriminator = payload.readByte(); - Class clazz = packets.get(discriminator); - if (clazz == null) - { - throw new NullPointerException("No packet registered for discriminator: " + discriminator); - } - - WMMessage pkt = clazz.newInstance(); - pkt.decodeInto(ctx, payload.slice()); - - EntityPlayer player; - switch (FMLCommonHandler.instance().getEffectiveSide()) - { - case CLIENT: - player = getClientPlayer(); - pkt.handleClientSide(player); - break; - - case SERVER: - INetHandler netHandler = ctx.channel().attr(NetworkRegistry.NET_HANDLER).get(); - player = ((NetHandlerPlayServer) netHandler).playerEntity; - pkt.handleServerSide(player); - break; - - default: - } - - out.add(pkt); - } - - public void initalize() - { - channels = NetworkRegistry.INSTANCE.newChannel("WeaponMod", this); - } - - public void postInitialize() - { - if (isPostInitialized) - { - return; - } - - isPostInitialized = true; - Collections.sort(packets, new Comparator>() - { - - @Override - public int compare(Class clazz1, Class clazz2) - { - int com = String.CASE_INSENSITIVE_ORDER.compare(clazz1.getCanonicalName(), clazz2.getCanonicalName()); - if (com == 0) - { - com = clazz1.getCanonicalName().compareTo(clazz2.getCanonicalName()); - } - - return com; - } - }); - } - - @SideOnly(Side.CLIENT) - private EntityPlayer getClientPlayer() - { - return Minecraft.getMinecraft().thePlayer; - } - - /** - * Send this message to everyone. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message - * The message to send - */ - public void sendToAll(WMMessage message) - { - channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.ALL); - channels.get(Side.SERVER).writeAndFlush(message); - } - - /** - * Send this message to the specified player. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message - * The message to send - * @param player - * The player to send it to - */ - public void sendTo(WMMessage message, EntityPlayerMP player) - { - channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.PLAYER); - channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(player); - channels.get(Side.SERVER).writeAndFlush(message); - } - - /** - * Send this message to everyone within a certain range of a point. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message - * The message to send - * @param point - * The {@link cpw.mods.fml.common.network.NetworkRegistry.TargetPoint} around which to send - */ - public void sendToAllAround(WMMessage message, NetworkRegistry.TargetPoint point) - { - channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.ALLAROUNDPOINT); - channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(point); - channels.get(Side.SERVER).writeAndFlush(message); - } - - /** - * Send this message to everyone within the supplied dimension. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message - * The message to send - * @param dimensionId - * The dimension id to target - */ - public void sendToDimension(WMMessage message, int dimensionId) - { - channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.DIMENSION); - channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(dimensionId); - channels.get(Side.SERVER).writeAndFlush(message); - } - - /** - * Send this message to the server. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message - * The message to send - */ - public void sendToServer(WMMessage message) - { - channels.get(Side.CLIENT).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.TOSERVER); - channels.get(Side.CLIENT).writeAndFlush(message); - } +public class WMMessagePipeline extends SimpleNetworkWrapper{ + public WMMessagePipeline(){ + super("WeaponMod"); + }; } diff --git a/src/main/java/ckathode/weaponmod/render/GuiOverlayReloaded.java b/src/main/java/ckathode/weaponmod/render/GuiOverlayReloaded.java index 9a875d9f..97b55d6b 100644 --- a/src/main/java/ckathode/weaponmod/render/GuiOverlayReloaded.java +++ b/src/main/java/ckathode/weaponmod/render/GuiOverlayReloaded.java @@ -11,9 +11,9 @@ import ckathode.weaponmod.item.IItemWeapon; import ckathode.weaponmod.item.RangedComponent; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class GuiOverlayReloaded extends Gui diff --git a/src/main/java/ckathode/weaponmod/render/LongItemRenderer.java b/src/main/java/ckathode/weaponmod/render/LongItemRenderer.java index 960696f0..3c2c1e17 100644 --- a/src/main/java/ckathode/weaponmod/render/LongItemRenderer.java +++ b/src/main/java/ckathode/weaponmod/render/LongItemRenderer.java @@ -3,12 +3,11 @@ import net.minecraft.client.renderer.Tessellator; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; import org.lwjgl.opengl.GL11; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class LongItemRenderer extends WeaponItemRenderer @@ -16,16 +15,14 @@ public class LongItemRenderer extends WeaponItemRenderer @Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { - Tessellator tess = Tessellator.instance; + Tessellator tess = Tessellator.getInstance(); EntityLivingBase entityliving = (EntityLivingBase) data[1]; - IIcon icon = entityliving.getItemIcon(item, 0); GL11.glTranslatef(-0.5F, -0.5F, 0F); GL11.glScalef(2F, 2F, 1.4F); float t = 0.0625F; - renderItemIn2D(tess, icon.getMaxU(), icon.getMinV(), icon.getMinU(), icon.getMaxV(), icon.getIconWidth() * 16, icon.getIconHeight() * 16, t); renderEnchantEffect(tess, item, 256, 256, t); } } diff --git a/src/main/java/ckathode/weaponmod/render/RenderBlowgunDart.java b/src/main/java/ckathode/weaponmod/render/RenderBlowgunDart.java index 48df5406..3095a649 100644 --- a/src/main/java/ckathode/weaponmod/render/RenderBlowgunDart.java +++ b/src/main/java/ckathode/weaponmod/render/RenderBlowgunDart.java @@ -1,7 +1,9 @@ package ckathode.weaponmod.render; import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.entity.Entity; import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; @@ -13,6 +15,10 @@ public class RenderBlowgunDart extends Render { + public RenderBlowgunDart(RenderManager renderManager) { + super(renderManager); + } + public void renderBlowgunDart(EntityBlowgunDart entityarrow, double d, double d1, double d2, float f, float f1) { bindEntityTexture(entityarrow); @@ -20,7 +26,8 @@ public void renderBlowgunDart(EntityBlowgunDart entityarrow, double d, double d1 GL11.glTranslatef((float) d, (float) d1, (float) d2); GL11.glRotatef((entityarrow.prevRotationYaw + (entityarrow.rotationYaw - entityarrow.prevRotationYaw) * f1) - 90F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(entityarrow.prevRotationPitch + (entityarrow.rotationPitch - entityarrow.prevRotationPitch) * f1, 0.0F, 0.0F, 1.0F); - Tessellator tessellator = Tessellator.instance; + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); int i = 0; float f2 = 0.0F; float f3 = 0.5F; @@ -42,28 +49,28 @@ public void renderBlowgunDart(EntityBlowgunDart entityarrow, double d, double d1 GL11.glScalef(f10, f10, f10); GL11.glTranslatef(-4F, 0.0F, 0.0F); GL11.glNormal3f(f10, 0.0F, 0.0F); - tessellator.startDrawingQuads(); - tessellator.addVertexWithUV(-3D, -2D, -2D, f6, f8); - tessellator.addVertexWithUV(-3D, -2D, 2D, f7, f8); - tessellator.addVertexWithUV(-3D, 2D, 2D, f7, f9); - tessellator.addVertexWithUV(-3D, 2D, -2D, f6, f9); + worldrenderer.startDrawingQuads(); + worldrenderer.addVertexWithUV(-3D, -2D, -2D, f6, f8); + worldrenderer.addVertexWithUV(-3D, -2D, 2D, f7, f8); + worldrenderer.addVertexWithUV(-3D, 2D, 2D, f7, f9); + worldrenderer.addVertexWithUV(-3D, 2D, -2D, f6, f9); tessellator.draw(); GL11.glNormal3f(-f10, 0.0F, 0.0F); - tessellator.startDrawingQuads(); - tessellator.addVertexWithUV(-3D, 2D, -2D, f6, f8); - tessellator.addVertexWithUV(-3D, 2D, 2D, f7, f8); - tessellator.addVertexWithUV(-3D, -2D, 2D, f7, f9); - tessellator.addVertexWithUV(-3D, -2D, -2D, f6, f9); + worldrenderer.startDrawingQuads(); + worldrenderer.addVertexWithUV(-3D, 2D, -2D, f6, f8); + worldrenderer.addVertexWithUV(-3D, 2D, 2D, f7, f8); + worldrenderer.addVertexWithUV(-3D, -2D, 2D, f7, f9); + worldrenderer.addVertexWithUV(-3D, -2D, -2D, f6, f9); tessellator.draw(); for (int j = 0; j < 4; j++) { GL11.glRotatef(90F, 1.0F, 0.0F, 0.0F); GL11.glNormal3f(0.0F, 0.0F, f10); - tessellator.startDrawingQuads(); - tessellator.addVertexWithUV(-4D, -2D, 0.0D, f2, f4); - tessellator.addVertexWithUV(4D, -2D, 0.0D, f3, f4); - tessellator.addVertexWithUV(4D, 2D, 0.0D, f3, f5); - tessellator.addVertexWithUV(-4D, 2D, 0.0D, f2, f5); + worldrenderer.startDrawingQuads(); + worldrenderer.addVertexWithUV(-4D, -2D, 0.0D, f2, f4); + worldrenderer.addVertexWithUV(4D, -2D, 0.0D, f3, f4); + worldrenderer.addVertexWithUV(4D, 2D, 0.0D, f3, f5); + worldrenderer.addVertexWithUV(-4D, 2D, 0.0D, f2, f5); tessellator.draw(); } diff --git a/src/main/java/ckathode/weaponmod/render/RenderBlunderShot.java b/src/main/java/ckathode/weaponmod/render/RenderBlunderShot.java index a0297cac..6c88059e 100644 --- a/src/main/java/ckathode/weaponmod/render/RenderBlunderShot.java +++ b/src/main/java/ckathode/weaponmod/render/RenderBlunderShot.java @@ -1,7 +1,9 @@ package ckathode.weaponmod.render; import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.entity.Entity; import net.minecraft.util.ResourceLocation; @@ -12,40 +14,46 @@ public class RenderBlunderShot extends Render { + public RenderBlunderShot(RenderManager renderManager) { + super(renderManager); + } + public void renderBlunderShot(EntityBlunderShot entityarrow, double d, double d1, double d2, float f, float f1) { bindEntityTexture(entityarrow); GL11.glPushMatrix(); GL11.glTranslatef((float) d, (float) d1, (float) d2); - Tessellator tessellator = Tessellator.instance; + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldRenderer = tessellator.getWorldRenderer(); + float f2 = 0.0F; float f3 = 5F / 16F; float f10 = 0.05625F; GL11.glEnable(32826 /*GL_RESCALE_NORMAL_EXT*/); GL11.glScalef(0.04F, 0.04F, 0.04F); GL11.glNormal3f(f10, 0.0F, 0.0F); - tessellator.startDrawingQuads(); - tessellator.addVertexWithUV(0D, -1D, -1D, f2, f2); - tessellator.addVertexWithUV(0D, -1D, 1D, f3, f2); - tessellator.addVertexWithUV(0D, 1D, 1D, f3, f3); - tessellator.addVertexWithUV(0D, 1D, -1D, f2, f3); + worldRenderer.startDrawingQuads(); + worldRenderer.addVertexWithUV(0D, -1D, -1D, f2, f2); + worldRenderer.addVertexWithUV(0D, -1D, 1D, f3, f2); + worldRenderer.addVertexWithUV(0D, 1D, 1D, f3, f3); + worldRenderer.addVertexWithUV(0D, 1D, -1D, f2, f3); tessellator.draw(); GL11.glNormal3f(-f10, 0.0F, 0.0F); - tessellator.startDrawingQuads(); - tessellator.addVertexWithUV(0D, 1D, -1D, f2, f2); - tessellator.addVertexWithUV(0D, 1D, 1D, f3, f2); - tessellator.addVertexWithUV(0D, -1D, 1D, f3, f3); - tessellator.addVertexWithUV(0D, -1D, -1D, f2, f3); + worldRenderer.startDrawingQuads(); + worldRenderer.addVertexWithUV(0D, 1D, -1D, f2, f2); + worldRenderer.addVertexWithUV(0D, 1D, 1D, f3, f2); + worldRenderer.addVertexWithUV(0D, -1D, 1D, f3, f3); + worldRenderer.addVertexWithUV(0D, -1D, -1D, f2, f3); tessellator.draw(); for (int j = 0; j < 4; j++) { GL11.glRotatef(90F, 1.0F, 0.0F, 0.0F); GL11.glNormal3f(0.0F, 0.0F, f10); - tessellator.startDrawingQuads(); - tessellator.addVertexWithUV(-1D, -1D, 0.0D, f2, f2); - tessellator.addVertexWithUV(1D, -1D, 0.0D, f3, f2); - tessellator.addVertexWithUV(1D, 1D, 0.0D, f3, f3); - tessellator.addVertexWithUV(-1D, 1D, 0.0D, f2, f3); + worldRenderer.startDrawingQuads(); + worldRenderer.addVertexWithUV(-1D, -1D, 0.0D, f2, f2); + worldRenderer.addVertexWithUV(1D, -1D, 0.0D, f3, f2); + worldRenderer.addVertexWithUV(1D, 1D, 0.0D, f3, f3); + worldRenderer.addVertexWithUV(-1D, 1D, 0.0D, f2, f3); tessellator.draw(); } @@ -59,10 +67,10 @@ public void renderBlunderShot(EntityBlunderShot entityarrow, double d, double d1 GL11.glColor4f(1F, 1F, 0.8F, 1F); GL11.glLineWidth(1.0F); - tessellator.startDrawing(GL11.GL_LINES); + worldRenderer.startDrawing(GL11.GL_LINES); { - tessellator.addVertex(entityarrow.posX, entityarrow.posY, entityarrow.posZ); - tessellator.addVertex(entityarrow.prevPosX, entityarrow.prevPosY, entityarrow.prevPosZ); + worldRenderer.addVertex(entityarrow.posX, entityarrow.posY, entityarrow.posZ); + worldRenderer.addVertex(entityarrow.prevPosX, entityarrow.prevPosY, entityarrow.prevPosZ); } tessellator.draw(); diff --git a/src/main/java/ckathode/weaponmod/render/RenderBoomerang.java b/src/main/java/ckathode/weaponmod/render/RenderBoomerang.java index 6153456b..d1494bfa 100644 --- a/src/main/java/ckathode/weaponmod/render/RenderBoomerang.java +++ b/src/main/java/ckathode/weaponmod/render/RenderBoomerang.java @@ -1,7 +1,9 @@ package ckathode.weaponmod.render; import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.entity.Entity; import net.minecraft.util.ResourceLocation; @@ -12,6 +14,10 @@ public class RenderBoomerang extends Render { + public RenderBoomerang(RenderManager renderManager) { + super(renderManager); + } + private void renderBoomerang(EntityBoomerang entityarrow, double d, double d1, double d2, float f, float f1) { bindEntityTexture(entityarrow); @@ -19,8 +25,9 @@ private void renderBoomerang(EntityBoomerang entityarrow, double d, double d1, d GL11.glTranslatef((float) d, (float) d1, (float) d2); GL11.glRotatef(entityarrow.prevRotationPitch + (entityarrow.rotationPitch - entityarrow.prevRotationPitch) * f1, 0.0F, 0.0F, 1.0F); GL11.glRotatef((entityarrow.prevRotationYaw + (entityarrow.rotationYaw - entityarrow.prevRotationYaw) * f1) - 90F, 0.0F, 1.0F, 0.0F); - Tessellator tess = Tessellator.instance; - + Tessellator tess = Tessellator.getInstance(); + WorldRenderer worldRenderer = tess.getWorldRenderer(); + int mat = entityarrow.getWeaponMaterialId(); float[] color = entityarrow.getMaterialColor(); float ft0 = 0.0F; @@ -38,72 +45,72 @@ private void renderBoomerang(EntityBoomerang entityarrow, double d, double d1, d GL11.glTranslatef(-0.5F, 0F, -0.5F); GL11.glColor3f(1F, 1F, 1F); GL11.glNormal3f(0F, 1F, 0F); - tess.startDrawingQuads(); - tess.setColorOpaque_F(1F, 1F, 1F); - tess.addVertexWithUV(0D, 0D, 1D, ft1, ft0); - tess.addVertexWithUV(1D, 0D, 1D, ft0, ft0); - tess.addVertexWithUV(1D, 0D, 0D, ft0, ft1); - tess.addVertexWithUV(0D, 0D, 0D, ft1, ft1); + worldRenderer.startDrawingQuads(); + worldRenderer.setColorOpaque_F(1F, 1F, 1F); + worldRenderer.addVertexWithUV(0D, 0D, 1D, ft1, ft0); + worldRenderer.addVertexWithUV(1D, 0D, 1D, ft0, ft0); + worldRenderer.addVertexWithUV(1D, 0D, 0D, ft0, ft1); + worldRenderer.addVertexWithUV(0D, 0D, 0D, ft1, ft1); if (mat != 0) { - tess.setColorOpaque_F(color[0], color[1], color[2]); - tess.addVertexWithUV(0D, 0D, 1D, ft2, ft0); - tess.addVertexWithUV(1D, 0D, 1D, ft1, ft0); - tess.addVertexWithUV(1D, 0D, 0D, ft1, ft1); - tess.addVertexWithUV(0D, 0D, 0D, ft2, ft1); + worldRenderer.setColorOpaque_F(color[0], color[1], color[2]); + worldRenderer.addVertexWithUV(0D, 0D, 1D, ft2, ft0); + worldRenderer.addVertexWithUV(1D, 0D, 1D, ft1, ft0); + worldRenderer.addVertexWithUV(1D, 0D, 0D, ft1, ft1); + worldRenderer.addVertexWithUV(0D, 0D, 0D, ft2, ft1); } tess.draw(); GL11.glNormal3f(0F, -1F, 0F); - tess.startDrawingQuads(); - tess.setColorOpaque_F(1F, 1F, 1F); - tess.addVertexWithUV(1D, 0D, 0D, ft0, ft1); - tess.addVertexWithUV(1D, 0D, 1D, ft1, ft1); - tess.addVertexWithUV(0D, 0D, 1D, ft1, ft0); - tess.addVertexWithUV(0D, 0D, 0D, ft0, ft0); + worldRenderer.startDrawingQuads(); + worldRenderer.setColorOpaque_F(1F, 1F, 1F); + worldRenderer.addVertexWithUV(1D, 0D, 0D, ft0, ft1); + worldRenderer.addVertexWithUV(1D, 0D, 1D, ft1, ft1); + worldRenderer.addVertexWithUV(0D, 0D, 1D, ft1, ft0); + worldRenderer.addVertexWithUV(0D, 0D, 0D, ft0, ft0); if (mat != 0) { - tess.setColorOpaque_F(color[0], color[1], color[2]); - tess.addVertexWithUV(1D, 0D, 0D, ft1, ft1); - tess.addVertexWithUV(1D, 0D, 1D, ft2, ft1); - tess.addVertexWithUV(0D, 0D, 1D, ft2, ft0); - tess.addVertexWithUV(0D, 0D, 0D, ft1, ft0); + worldRenderer.setColorOpaque_F(color[0], color[1], color[2]); + worldRenderer.addVertexWithUV(1D, 0D, 0D, ft1, ft1); + worldRenderer.addVertexWithUV(1D, 0D, 1D, ft2, ft1); + worldRenderer.addVertexWithUV(0D, 0D, 1D, ft2, ft0); + worldRenderer.addVertexWithUV(0D, 0D, 0D, ft1, ft0); } tess.draw(); float sqrt2 = (float) Math.sqrt(2); GL11.glDisable(GL11.GL_CULL_FACE); GL11.glNormal3f(-sqrt2, 0F, sqrt2); - tess.startDrawingQuads(); - tess.setColorOpaque_F(1F, 1F, 1F); - tess.addVertexWithUV(f2, -fh, f4, ft1, ft3); - tess.addVertexWithUV(f2, fh, f4, ft1, ft4); - tess.addVertexWithUV(f3, fh, f4, ft0, ft4); - tess.addVertexWithUV(f3, -fh, f4, ft0, ft3); + worldRenderer.startDrawingQuads(); + worldRenderer.setColorOpaque_F(1F, 1F, 1F); + worldRenderer.addVertexWithUV(f2, -fh, f4, ft1, ft3); + worldRenderer.addVertexWithUV(f2, fh, f4, ft1, ft4); + worldRenderer.addVertexWithUV(f3, fh, f4, ft0, ft4); + worldRenderer.addVertexWithUV(f3, -fh, f4, ft0, ft3); if (mat != 0) { - tess.setColorOpaque_F(color[0], color[1], color[2]); - tess.addVertexWithUV(f2, -fh, f4, ft2, ft3); - tess.addVertexWithUV(f2, fh, f4, ft2, ft4); - tess.addVertexWithUV(f3, fh, f4, ft1, ft4); - tess.addVertexWithUV(f3, -fh, f4, ft1, ft3); + worldRenderer.setColorOpaque_F(color[0], color[1], color[2]); + worldRenderer.addVertexWithUV(f2, -fh, f4, ft2, ft3); + worldRenderer.addVertexWithUV(f2, fh, f4, ft2, ft4); + worldRenderer.addVertexWithUV(f3, fh, f4, ft1, ft4); + worldRenderer.addVertexWithUV(f3, -fh, f4, ft1, ft3); } - tess.setColorOpaque_F(1F, 1F, 1F); - tess.addVertexWithUV(f2, -fh, f4, ft1, ft3); - tess.addVertexWithUV(f2, fh, f4, ft1, ft4); - tess.addVertexWithUV(f2, fh, f2, ft0, ft4); - tess.addVertexWithUV(f2, -fh, f2, ft0, ft3); + worldRenderer.setColorOpaque_F(1F, 1F, 1F); + worldRenderer.addVertexWithUV(f2, -fh, f4, ft1, ft3); + worldRenderer.addVertexWithUV(f2, fh, f4, ft1, ft4); + worldRenderer.addVertexWithUV(f2, fh, f2, ft0, ft4); + worldRenderer.addVertexWithUV(f2, -fh, f2, ft0, ft3); if (mat != 0) { - tess.setColorOpaque_F(color[0], color[1], color[2]); - tess.addVertexWithUV(f2, -fh, f4, ft2, ft3); - tess.addVertexWithUV(f2, fh, f4, ft2, ft4); - tess.addVertexWithUV(f2, fh, f2, ft1, ft4); - tess.addVertexWithUV(f2, -fh, f2, ft1, ft3); + worldRenderer.setColorOpaque_F(color[0], color[1], color[2]); + worldRenderer.addVertexWithUV(f2, -fh, f4, ft2, ft3); + worldRenderer.addVertexWithUV(f2, fh, f4, ft2, ft4); + worldRenderer.addVertexWithUV(f2, fh, f2, ft1, ft4); + worldRenderer.addVertexWithUV(f2, -fh, f2, ft1, ft3); } tess.draw(); GL11.glEnable(GL11.GL_CULL_FACE); diff --git a/src/main/java/ckathode/weaponmod/render/RenderCannon.java b/src/main/java/ckathode/weaponmod/render/RenderCannon.java index a185b082..e5b9e80d 100644 --- a/src/main/java/ckathode/weaponmod/render/RenderCannon.java +++ b/src/main/java/ckathode/weaponmod/render/RenderCannon.java @@ -1,6 +1,7 @@ package ckathode.weaponmod.render; import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.entity.Entity; import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; @@ -16,8 +17,9 @@ public class RenderCannon extends Render protected ModelCannonBarrel modelBarrel; protected ModelCannonStandard modelStandard; - public RenderCannon() + public RenderCannon(RenderManager renderManager) { + super(renderManager); shadowSize = 1.0F; modelCannon = new ModelCannon(); modelBarrel = new ModelCannonBarrel(); @@ -26,6 +28,7 @@ public RenderCannon() private void renderCannon(EntityCannon entitycannon, double d, double d1, double d2, float f, float f1) { + d1=d1+entitycannon.yOffset; GL11.glPushMatrix(); float rot = entitycannon.prevRotationPitch + (entitycannon.rotationPitch - entitycannon.prevRotationPitch) * f1; diff --git a/src/main/java/ckathode/weaponmod/render/RenderCannonBall.java b/src/main/java/ckathode/weaponmod/render/RenderCannonBall.java index 12a861e4..66b6a17f 100644 --- a/src/main/java/ckathode/weaponmod/render/RenderCannonBall.java +++ b/src/main/java/ckathode/weaponmod/render/RenderCannonBall.java @@ -1,7 +1,9 @@ package ckathode.weaponmod.render; import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.entity.Entity; import net.minecraft.util.ResourceLocation; @@ -12,14 +14,15 @@ public class RenderCannonBall extends Render { - public RenderCannonBall() - { + public RenderCannonBall(RenderManager renderManager) { + super(renderManager); shadowSize = 0.5F; } public void renderCannonBall(EntityCannonBall entitycannonball, double d, double d1, double d2, float f, float f1) { - Tessellator tessellator = Tessellator.instance; + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldRenderer = tessellator.getWorldRenderer(); GL11.glPushMatrix(); bindEntityTexture(entitycannonball); GL11.glTranslatef((float) d, (float) d1, (float) d2); @@ -27,36 +30,36 @@ public void renderCannonBall(EntityCannonBall entitycannonball, double d, double GL11.glScalef(-1F, -1F, 1.0F); GL11.glScalef(0.7F, 0.7F, 0.7F); GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F); - tessellator.startDrawingQuads(); - tessellator.addVertexWithUV(-0.5F, +0.5F, -0.5F, 0F, 1F); - tessellator.addVertexWithUV(+0.5F, +0.5F, -0.5F, 1F, 1F); - tessellator.addVertexWithUV(+0.5F, -0.5F, -0.5F, 1F, 0F); - tessellator.addVertexWithUV(-0.5F, -0.5F, -0.5F, 0F, 0F); + worldRenderer.startDrawingQuads(); + worldRenderer.addVertexWithUV(-0.5F, +0.5F, -0.5F, 0F, 1F); + worldRenderer.addVertexWithUV(+0.5F, +0.5F, -0.5F, 1F, 1F); + worldRenderer.addVertexWithUV(+0.5F, -0.5F, -0.5F, 1F, 0F); + worldRenderer.addVertexWithUV(-0.5F, -0.5F, -0.5F, 0F, 0F); - tessellator.addVertexWithUV(-0.5F, -0.5F, +0.5F, 0F, 0F); - tessellator.addVertexWithUV(+0.5F, -0.5F, +0.5F, 1F, 0F); - tessellator.addVertexWithUV(+0.5F, +0.5F, +0.5F, 1F, 1F); - tessellator.addVertexWithUV(-0.5F, +0.5F, +0.5F, 0F, 1F); + worldRenderer.addVertexWithUV(-0.5F, -0.5F, +0.5F, 0F, 0F); + worldRenderer.addVertexWithUV(+0.5F, -0.5F, +0.5F, 1F, 0F); + worldRenderer.addVertexWithUV(+0.5F, +0.5F, +0.5F, 1F, 1F); + worldRenderer.addVertexWithUV(-0.5F, +0.5F, +0.5F, 0F, 1F); - tessellator.addVertexWithUV(-0.5F, -0.5F, -0.5F, 0F, 0F); - tessellator.addVertexWithUV(+0.5F, -0.5F, -0.5F, 1F, 0F); - tessellator.addVertexWithUV(+0.5F, -0.5F, +0.5F, 1F, 1F); - tessellator.addVertexWithUV(-0.5F, -0.5F, +0.5F, 0F, 1F); + worldRenderer.addVertexWithUV(-0.5F, -0.5F, -0.5F, 0F, 0F); + worldRenderer.addVertexWithUV(+0.5F, -0.5F, -0.5F, 1F, 0F); + worldRenderer.addVertexWithUV(+0.5F, -0.5F, +0.5F, 1F, 1F); + worldRenderer.addVertexWithUV(-0.5F, -0.5F, +0.5F, 0F, 1F); - tessellator.addVertexWithUV(-0.5F, +0.5F, +0.5F, 0F, 1F); - tessellator.addVertexWithUV(+0.5F, +0.5F, +0.5F, 1F, 1F); - tessellator.addVertexWithUV(+0.5F, +0.5F, -0.5F, 1F, 0F); - tessellator.addVertexWithUV(-0.5F, +0.5F, -0.5F, 0F, 0F); + worldRenderer.addVertexWithUV(-0.5F, +0.5F, +0.5F, 0F, 1F); + worldRenderer.addVertexWithUV(+0.5F, +0.5F, +0.5F, 1F, 1F); + worldRenderer.addVertexWithUV(+0.5F, +0.5F, -0.5F, 1F, 0F); + worldRenderer.addVertexWithUV(-0.5F, +0.5F, -0.5F, 0F, 0F); - tessellator.addVertexWithUV(-0.5F, -0.5F, +0.5F, 0F, 0F); - tessellator.addVertexWithUV(-0.5F, +0.5F, +0.5F, 1F, 0F); - tessellator.addVertexWithUV(-0.5F, +0.5F, -0.5F, 1F, 1F); - tessellator.addVertexWithUV(-0.5F, -0.5F, -0.5F, 0F, 1F); + worldRenderer.addVertexWithUV(-0.5F, -0.5F, +0.5F, 0F, 0F); + worldRenderer.addVertexWithUV(-0.5F, +0.5F, +0.5F, 1F, 0F); + worldRenderer.addVertexWithUV(-0.5F, +0.5F, -0.5F, 1F, 1F); + worldRenderer.addVertexWithUV(-0.5F, -0.5F, -0.5F, 0F, 1F); - tessellator.addVertexWithUV(+0.5F, -0.5F, -0.5F, 0F, 0F); - tessellator.addVertexWithUV(+0.5F, +0.5F, -0.5F, 1F, 0F); - tessellator.addVertexWithUV(+0.5F, +0.5F, +0.5F, 1F, 1F); - tessellator.addVertexWithUV(+0.5F, -0.5F, +0.5F, 0F, 1F); + worldRenderer.addVertexWithUV(+0.5F, -0.5F, -0.5F, 0F, 0F); + worldRenderer.addVertexWithUV(+0.5F, +0.5F, -0.5F, 1F, 0F); + worldRenderer.addVertexWithUV(+0.5F, +0.5F, +0.5F, 1F, 1F); + worldRenderer.addVertexWithUV(+0.5F, -0.5F, +0.5F, 0F, 1F); tessellator.draw(); GL11.glPopMatrix(); } diff --git a/src/main/java/ckathode/weaponmod/render/RenderCrossbowBolt.java b/src/main/java/ckathode/weaponmod/render/RenderCrossbowBolt.java index 30bdeb51..1c337b5a 100644 --- a/src/main/java/ckathode/weaponmod/render/RenderCrossbowBolt.java +++ b/src/main/java/ckathode/weaponmod/render/RenderCrossbowBolt.java @@ -1,7 +1,9 @@ package ckathode.weaponmod.render; import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.entity.Entity; import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; @@ -13,6 +15,10 @@ public class RenderCrossbowBolt extends Render { + public RenderCrossbowBolt(RenderManager renderManager) { + super(renderManager); + } + public void renderCrossbowBolt(EntityCrossbowBolt entityarrow, double d, double d1, double d2, float f, float f1) { bindEntityTexture(entityarrow); @@ -20,7 +26,8 @@ public void renderCrossbowBolt(EntityCrossbowBolt entityarrow, double d, double GL11.glTranslatef((float) d, (float) d1, (float) d2); GL11.glRotatef((entityarrow.prevRotationYaw + (entityarrow.rotationYaw - entityarrow.prevRotationYaw) * f1) - 90F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(entityarrow.prevRotationPitch + (entityarrow.rotationPitch - entityarrow.prevRotationPitch) * f1, 0.0F, 0.0F, 1.0F); - Tessellator tessellator = Tessellator.instance; + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); int i = 0; float f2 = 0.0F; float f3 = 0.5F; @@ -42,28 +49,28 @@ public void renderCrossbowBolt(EntityCrossbowBolt entityarrow, double d, double GL11.glScalef(f10, f10, f10); GL11.glTranslatef(-4F, 0.0F, 0.0F); GL11.glNormal3f(f10, 0.0F, 0.0F); - tessellator.startDrawingQuads(); - tessellator.addVertexWithUV(-4D, -2D, -2D, f6, f8); - tessellator.addVertexWithUV(-4D, -2D, 2D, f7, f8); - tessellator.addVertexWithUV(-4D, 2D, 2D, f7, f9); - tessellator.addVertexWithUV(-4D, 2D, -2D, f6, f9); + worldrenderer.startDrawingQuads(); + worldrenderer.addVertexWithUV(-4D, -2D, -2D, f6, f8); + worldrenderer.addVertexWithUV(-4D, -2D, 2D, f7, f8); + worldrenderer.addVertexWithUV(-4D, 2D, 2D, f7, f9); + worldrenderer.addVertexWithUV(-4D, 2D, -2D, f6, f9); tessellator.draw(); GL11.glNormal3f(-f10, 0.0F, 0.0F); - tessellator.startDrawingQuads(); - tessellator.addVertexWithUV(-4D, 2D, -2D, f6, f8); - tessellator.addVertexWithUV(-4D, 2D, 2D, f7, f8); - tessellator.addVertexWithUV(-4D, -2D, 2D, f7, f9); - tessellator.addVertexWithUV(-4D, -2D, -2D, f6, f9); + worldrenderer.startDrawingQuads(); + worldrenderer.addVertexWithUV(-4D, 2D, -2D, f6, f8); + worldrenderer.addVertexWithUV(-4D, 2D, 2D, f7, f8); + worldrenderer.addVertexWithUV(-4D, -2D, 2D, f7, f9); + worldrenderer.addVertexWithUV(-4D, -2D, -2D, f6, f9); tessellator.draw(); for (int j = 0; j < 4; j++) { GL11.glRotatef(90F, 1.0F, 0.0F, 0.0F); GL11.glNormal3f(0.0F, 0.0F, f10); - tessellator.startDrawingQuads(); - tessellator.addVertexWithUV(-5D, -2D, 0.0D, f2, f4); - tessellator.addVertexWithUV(5D, -2D, 0.0D, f3, f4); - tessellator.addVertexWithUV(5D, 2D, 0.0D, f3, f5); - tessellator.addVertexWithUV(-5D, 2D, 0.0D, f2, f5); + worldrenderer.startDrawingQuads(); + worldrenderer.addVertexWithUV(-5D, -2D, 0.0D, f2, f4); + worldrenderer.addVertexWithUV(5D, -2D, 0.0D, f3, f4); + worldrenderer.addVertexWithUV(5D, 2D, 0.0D, f3, f5); + worldrenderer.addVertexWithUV(-5D, 2D, 0.0D, f2, f5); tessellator.draw(); } diff --git a/src/main/java/ckathode/weaponmod/render/RenderDummy.java b/src/main/java/ckathode/weaponmod/render/RenderDummy.java index 23e98732..529d2ad9 100644 --- a/src/main/java/ckathode/weaponmod/render/RenderDummy.java +++ b/src/main/java/ckathode/weaponmod/render/RenderDummy.java @@ -1,6 +1,7 @@ package ckathode.weaponmod.render; import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.entity.Entity; import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; @@ -13,15 +14,16 @@ public class RenderDummy extends Render { private ModelDummy modelDummy; - - public RenderDummy() - { + + public RenderDummy(RenderManager renderManager) { + super(renderManager); shadowSize = 1.0F; modelDummy = new ModelDummy(); } - + public void renderDummy(EntityDummy entitydummy, double d, double d1, double d2, float f, float f1) { + d1=d1+0.41F; GL11.glPushMatrix(); GL11.glTranslatef((float) d, (float) d1 - 0.4F, (float) d2); GL11.glRotatef(180F - f, 0.0F, 1.0F, 0.0F); diff --git a/src/main/java/ckathode/weaponmod/render/RenderDynamite.java b/src/main/java/ckathode/weaponmod/render/RenderDynamite.java index 241bbd88..008ec456 100644 --- a/src/main/java/ckathode/weaponmod/render/RenderDynamite.java +++ b/src/main/java/ckathode/weaponmod/render/RenderDynamite.java @@ -1,7 +1,9 @@ package ckathode.weaponmod.render; import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.entity.Entity; import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; @@ -13,6 +15,10 @@ public class RenderDynamite extends Render { + public RenderDynamite(RenderManager renderManager) { + super(renderManager); + } + public void renderDynamite(EntityDynamite entityarrow, double d, double d1, double d2, float f, float f1) { bindEntityTexture(entityarrow); @@ -20,7 +26,8 @@ public void renderDynamite(EntityDynamite entityarrow, double d, double d1, doub GL11.glTranslatef((float) d, (float) d1, (float) d2); GL11.glRotatef(entityarrow.rotationYaw + 90F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(entityarrow.prevRotationPitch + (entityarrow.rotationPitch - entityarrow.prevRotationPitch) * f1, 0.0F, 0.0F, 1.0F); - Tessellator tessellator = Tessellator.instance; + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); int i = 0; float f2 = 0.0F; float f3 = 0.5F; @@ -42,28 +49,28 @@ public void renderDynamite(EntityDynamite entityarrow, double d, double d1, doub GL11.glScalef(f10, f10, f10); GL11.glTranslatef(-4F, 0.0F, 0.0F); GL11.glNormal3f(f10, 0.0F, 0.0F); - tessellator.startDrawingQuads(); - tessellator.addVertexWithUV(-7D, -2D, -2D, f6, f8); - tessellator.addVertexWithUV(-7D, -2D, 2D, f7, f8); - tessellator.addVertexWithUV(-7D, 2D, 2D, f7, f9); - tessellator.addVertexWithUV(-7D, 2D, -2D, f6, f9); + worldrenderer.startDrawingQuads(); + worldrenderer.addVertexWithUV(-7D, -2D, -2D, f6, f8); + worldrenderer.addVertexWithUV(-7D, -2D, 2D, f7, f8); + worldrenderer.addVertexWithUV(-7D, 2D, 2D, f7, f9); + worldrenderer.addVertexWithUV(-7D, 2D, -2D, f6, f9); tessellator.draw(); GL11.glNormal3f(-f10, 0.0F, 0.0F); - tessellator.startDrawingQuads(); - tessellator.addVertexWithUV(-7D, 2D, -2D, f6, f8); - tessellator.addVertexWithUV(-7D, 2D, 2D, f7, f8); - tessellator.addVertexWithUV(-7D, -2D, 2D, f7, f9); - tessellator.addVertexWithUV(-7D, -2D, -2D, f6, f9); + worldrenderer.startDrawingQuads(); + worldrenderer.addVertexWithUV(-7D, 2D, -2D, f6, f8); + worldrenderer.addVertexWithUV(-7D, 2D, 2D, f7, f8); + worldrenderer.addVertexWithUV(-7D, -2D, 2D, f7, f9); + worldrenderer.addVertexWithUV(-7D, -2D, -2D, f6, f9); tessellator.draw(); for (int j = 0; j < 4; j++) { GL11.glRotatef(90F, 1.0F, 0.0F, 0.0F); GL11.glNormal3f(0.0F, 0.0F, f10); - tessellator.startDrawingQuads(); - tessellator.addVertexWithUV(-8D, -2D, 0.0D, f2, f4); - tessellator.addVertexWithUV(8D, -2D, 0.0D, f3, f4); - tessellator.addVertexWithUV(8D, 2D, 0.0D, f3, f5); - tessellator.addVertexWithUV(-8D, 2D, 0.0D, f2, f5); + worldrenderer.startDrawingQuads(); + worldrenderer.addVertexWithUV(-8D, -2D, 0.0D, f2, f4); + worldrenderer.addVertexWithUV(8D, -2D, 0.0D, f3, f4); + worldrenderer.addVertexWithUV(8D, 2D, 0.0D, f3, f5); + worldrenderer.addVertexWithUV(-8D, 2D, 0.0D, f2, f5); tessellator.draw(); } diff --git a/src/main/java/ckathode/weaponmod/render/RenderFlail.java b/src/main/java/ckathode/weaponmod/render/RenderFlail.java index 5d4fe7ed..11d1bde7 100644 --- a/src/main/java/ckathode/weaponmod/render/RenderFlail.java +++ b/src/main/java/ckathode/weaponmod/render/RenderFlail.java @@ -1,7 +1,9 @@ package ckathode.weaponmod.render; import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.util.MathHelper; @@ -15,6 +17,10 @@ public class RenderFlail extends Render { + public RenderFlail(RenderManager renderManager) { + super(renderManager); + } + public void renderFlail(EntityFlail entityarrow, double d, double d1, double d2, float f, float f1) { bindEntityTexture(entityarrow); @@ -22,7 +28,8 @@ public void renderFlail(EntityFlail entityarrow, double d, double d1, double d2, GL11.glTranslatef((float) d, (float) d1, (float) d2); GL11.glRotatef((entityarrow.prevRotationYaw + (entityarrow.rotationYaw - entityarrow.prevRotationYaw) * f1) - 90F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(entityarrow.prevRotationPitch + (entityarrow.rotationPitch - entityarrow.prevRotationPitch) * f1, 0.0F, 0.0F, 1.0F); - Tessellator tessellator = Tessellator.instance; + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); // ===============FLAIL BALL=============== float[] color = entityarrow.getMaterialColor(); @@ -49,28 +56,28 @@ public void renderFlail(EntityFlail entityarrow, double d, double d1, double d2, GL11.glScalef(f10, f10, f10); GL11.glTranslatef(-4F, 0.0F, 0.0F); GL11.glNormal3f(f10, 0.0F, 0.0F); - tessellator.startDrawingQuads(); - tessellator.addVertexWithUV(1.5D, -2D, -2D, f6, f8); - tessellator.addVertexWithUV(1.5D, -2D, 2D, f7, f8); - tessellator.addVertexWithUV(1.5D, 2D, 2D, f7, f9); - tessellator.addVertexWithUV(1.5D, 2D, -2D, f6, f9); + worldrenderer.startDrawingQuads(); + worldrenderer.addVertexWithUV(1.5D, -2D, -2D, f6, f8); + worldrenderer.addVertexWithUV(1.5D, -2D, 2D, f7, f8); + worldrenderer.addVertexWithUV(1.5D, 2D, 2D, f7, f9); + worldrenderer.addVertexWithUV(1.5D, 2D, -2D, f6, f9); tessellator.draw(); GL11.glNormal3f(-f10, 0.0F, 0.0F); - tessellator.startDrawingQuads(); - tessellator.addVertexWithUV(1.5D, 2D, -2D, f6, f8); - tessellator.addVertexWithUV(1.5D, 2D, 2D, f7, f8); - tessellator.addVertexWithUV(1.5D, -2D, 2D, f7, f9); - tessellator.addVertexWithUV(1.5D, -2D, -2D, f6, f9); + worldrenderer.startDrawingQuads(); + worldrenderer.addVertexWithUV(1.5D, 2D, -2D, f6, f8); + worldrenderer.addVertexWithUV(1.5D, 2D, 2D, f7, f8); + worldrenderer.addVertexWithUV(1.5D, -2D, 2D, f7, f9); + worldrenderer.addVertexWithUV(1.5D, -2D, -2D, f6, f9); tessellator.draw(); for (int j = 0; j < 4; j++) { GL11.glRotatef(90F, 1.0F, 0.0F, 0.0F); GL11.glNormal3f(0.0F, 0.0F, f10); - tessellator.startDrawingQuads(); - tessellator.addVertexWithUV(-8D, -2D, 0.0D, f2, f4); - tessellator.addVertexWithUV(8D, -2D, 0.0D, f3, f4); - tessellator.addVertexWithUV(8D, 2D, 0.0D, f3, f5); - tessellator.addVertexWithUV(-8D, 2D, 0.0D, f2, f5); + worldrenderer.startDrawingQuads(); + worldrenderer.addVertexWithUV(-8D, -2D, 0.0D, f2, f4); + worldrenderer.addVertexWithUV(8D, -2D, 0.0D, f3, f4); + worldrenderer.addVertexWithUV(8D, 2D, 0.0D, f3, f5); + worldrenderer.addVertexWithUV(-8D, 2D, 0.0D, f2, f5); tessellator.draw(); } @@ -93,12 +100,12 @@ public void renderFlail(EntityFlail entityarrow, double d, double d1, double d2, float f19 = 0.5F; // 8 GL11.glRotatef(180F - renderManager.playerViewY, 0.0F, 1.0F, 0.0F); GL11.glRotatef(-renderManager.playerViewX, 1.0F, 0.0F, 0.0F); - tessellator.startDrawingQuads(); - tessellator.setNormal(0.0F, 1.0F, 0.0F); - tessellator.addVertexWithUV(0.0F - f18, 0.0F - f19, 0.0D, f13, f16); - tessellator.addVertexWithUV(f17 - f18, 0.0F - f19, 0.0D, f14, f16); - tessellator.addVertexWithUV(f17 - f18, 1.0F - f19, 0.0D, f14, f15); - tessellator.addVertexWithUV(0.0F - f18, 1.0F - f19, 0.0D, f13, f15); + worldrenderer.startDrawingQuads(); + worldrenderer.setNormal(0.0F, 1.0F, 0.0F); + worldrenderer.addVertexWithUV(0.0F - f18, 0.0F - f19, 0.0D, f13, f16); + worldrenderer.addVertexWithUV(f17 - f18, 0.0F - f19, 0.0D, f14, f16); + worldrenderer.addVertexWithUV(f17 - f18, 1.0F - f19, 0.0D, f14, f15); + worldrenderer.addVertexWithUV(0.0F - f18, 1.0F - f19, 0.0D, f13, f15); tessellator.draw(); GL11.glDisable(32826 /* GL_RESCALE_NORMAL_EXT */); GL11.glPopMatrix(); @@ -106,11 +113,11 @@ public void renderFlail(EntityFlail entityarrow, double d, double d1, double d2, { float f22 = ((EntityLivingBase) entityarrow.shootingEntity).getSwingProgress(f1); // 11 float f23 = MathHelper.sin(MathHelper.sqrt_float(f22) * 3.141593F); // 12 - Vec3 vec3d = Vec3.createVectorHelper(-0.5D, 0.03D, 0.8D); - vec3d.rotateAroundX((-(entityarrow.shootingEntity.prevRotationPitch + (entityarrow.shootingEntity.rotationPitch - entityarrow.shootingEntity.prevRotationPitch) * f1) * 3.141593F) / 180F); - vec3d.rotateAroundY((-(entityarrow.shootingEntity.prevRotationYaw + (entityarrow.shootingEntity.rotationYaw - entityarrow.shootingEntity.prevRotationYaw) * f1) * 3.141593F) / 180F); - vec3d.rotateAroundY(f23 * 0.5F); - vec3d.rotateAroundX(-f23 * 0.7F); + Vec3 vec3d = new Vec3(-0.5D, 0.03D, 0.8D); + vec3d.rotatePitch((-(entityarrow.shootingEntity.prevRotationPitch + (entityarrow.shootingEntity.rotationPitch - entityarrow.shootingEntity.prevRotationPitch) * f1) * 3.141593F) / 180F); + vec3d.rotateYaw((-(entityarrow.shootingEntity.prevRotationYaw + (entityarrow.shootingEntity.rotationYaw - entityarrow.shootingEntity.prevRotationYaw) * f1) * 3.141593F) / 180F); + vec3d.rotateYaw(f23 * 0.5F); + vec3d.rotatePitch(-f23 * 0.7F); double d7 = entityarrow.shootingEntity.prevPosX + (entityarrow.shootingEntity.posX - entityarrow.shootingEntity.prevPosX) * f1 + vec3d.xCoord; double d8 = entityarrow.shootingEntity.prevPosY + (entityarrow.shootingEntity.posY - entityarrow.shootingEntity.prevPosY) * f1 + vec3d.yCoord; double d9 = entityarrow.shootingEntity.prevPosZ + (entityarrow.shootingEntity.posZ - entityarrow.shootingEntity.prevPosZ) * f1 + vec3d.zCoord; @@ -131,13 +138,13 @@ public void renderFlail(EntityFlail entityarrow, double d, double d1, double d2, double d15 = (float) (d9 - d12); GL11.glDisable(3553 /* GL_TEXTURE_2D */); GL11.glDisable(2896 /* GL_LIGHTING */); - tessellator.startDrawing(GL11.GL_LINE_STRIP); - tessellator.setColorOpaque_I(0); + worldrenderer.startDrawing(GL11.GL_LINE_STRIP); + worldrenderer.setColorOpaque_I(0); int j = 16; for (int k = 0; k <= j; k++) { float f24 = (float) k / (float) j; - tessellator.addVertex(d + d13 * f24, d1 + d14 * (f24 * f24 + f24) * 0.5D + 0.25D, d2 + d15 * f24); + worldrenderer.addVertex(d + d13 * f24, d1 + d14 * (f24 * f24 + f24) * 0.5D + 0.25D, d2 + d15 * f24); } tessellator.draw(); diff --git a/src/main/java/ckathode/weaponmod/render/RenderJavelin.java b/src/main/java/ckathode/weaponmod/render/RenderJavelin.java index c68f45b2..7ecca86c 100644 --- a/src/main/java/ckathode/weaponmod/render/RenderJavelin.java +++ b/src/main/java/ckathode/weaponmod/render/RenderJavelin.java @@ -1,7 +1,9 @@ package ckathode.weaponmod.render; import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.entity.Entity; import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; @@ -13,6 +15,10 @@ public class RenderJavelin extends Render { + public RenderJavelin(RenderManager renderManager) { + super(renderManager); + } + public void renderJavelin(EntityJavelin entityarrow, double d, double d1, double d2, float f, float f1) { bindEntityTexture(entityarrow); @@ -20,7 +26,8 @@ public void renderJavelin(EntityJavelin entityarrow, double d, double d1, double GL11.glTranslatef((float) d, (float) d1, (float) d2); GL11.glRotatef((entityarrow.prevRotationYaw + (entityarrow.rotationYaw - entityarrow.prevRotationYaw) * f1) - 90F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(entityarrow.prevRotationPitch + (entityarrow.rotationPitch - entityarrow.prevRotationPitch) * f1, 0.0F, 0.0F, 1.0F); - Tessellator tess = Tessellator.instance; + Tessellator tess = Tessellator.getInstance(); + WorldRenderer worldrenderer = tess.getWorldRenderer(); int i = 0; float f2 = 0.0F; float f3 = 1.0F; @@ -45,31 +52,31 @@ public void renderJavelin(EntityJavelin entityarrow, double d, double d1, double GL11.glScalef(f10, f10, f10); GL11.glTranslatef(-4F, 0.0F, 0.0F); GL11.glNormal3f(f10, 0.0F, 0.0F); - tess.startDrawingQuads(); - tess.addVertexWithUV(-length, -2D, -2D, f6, f8); - tess.addVertexWithUV(-length, -2D, 2D, f7, f8); - tess.addVertexWithUV(-length, 2D, 2D, f7, f9); - tess.addVertexWithUV(-length, 2D, -2D, f6, f9); + worldrenderer.startDrawingQuads(); + worldrenderer.addVertexWithUV(-length, -2D, -2D, f6, f8); + worldrenderer.addVertexWithUV(-length, -2D, 2D, f7, f8); + worldrenderer.addVertexWithUV(-length, 2D, 2D, f7, f9); + worldrenderer.addVertexWithUV(-length, 2D, -2D, f6, f9); tess.draw(); GL11.glNormal3f(-f10, 0F, 0F); - tess.startDrawingQuads(); - tess.addVertexWithUV(-length, 2D, -2D, f6, f8); - tess.addVertexWithUV(-length, 2D, 2D, f7, f8); - tess.addVertexWithUV(-length, -2D, 2D, f7, f9); - tess.addVertexWithUV(-length, -2D, -2D, f6, f9); + worldrenderer.startDrawingQuads(); + worldrenderer.addVertexWithUV(-length, 2D, -2D, f6, f8); + worldrenderer.addVertexWithUV(-length, 2D, 2D, f7, f8); + worldrenderer.addVertexWithUV(-length, -2D, 2D, f7, f9); + worldrenderer.addVertexWithUV(-length, -2D, -2D, f6, f9); tess.draw(); for (int j = 0; j < 4; j++) { GL11.glRotatef(90F, 1.0F, 0.0F, 0.0F); GL11.glNormal3f(0.0F, 0.0F, f10); - tess.startDrawingQuads(); - tess.setColorOpaque_F(1F, 1F, 1F); - tess.addVertexWithUV(-length, -2D, 0.0D, f2, f4); - tess.addVertexWithUV(length, -2D, 0.0D, f3, f4); - tess.addVertexWithUV(length, 2D, 0.0D, f3, f5); - tess.addVertexWithUV(-length, 2D, 0.0D, f2, f5); + worldrenderer.startDrawingQuads(); + worldrenderer.setColorOpaque_F(1F, 1F, 1F); + worldrenderer.addVertexWithUV(-length, -2D, 0.0D, f2, f4); + worldrenderer.addVertexWithUV(length, -2D, 0.0D, f3, f4); + worldrenderer.addVertexWithUV(length, 2D, 0.0D, f3, f5); + worldrenderer.addVertexWithUV(-length, 2D, 0.0D, f2, f5); tess.draw(); } diff --git a/src/main/java/ckathode/weaponmod/render/RenderKnife.java b/src/main/java/ckathode/weaponmod/render/RenderKnife.java index a244c905..c90fb95d 100644 --- a/src/main/java/ckathode/weaponmod/render/RenderKnife.java +++ b/src/main/java/ckathode/weaponmod/render/RenderKnife.java @@ -1,7 +1,9 @@ package ckathode.weaponmod.render; import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.entity.Entity; import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; @@ -13,6 +15,10 @@ public class RenderKnife extends Render { + public RenderKnife(RenderManager renderManager) { + super(renderManager); + } + public void renderKnife(EntityKnife entityarrow, double d, double d1, double d2, float f, float f1) { bindEntityTexture(entityarrow); @@ -21,7 +27,8 @@ public void renderKnife(EntityKnife entityarrow, double d, double d1, double d2, GL11.glTranslatef((float) d, (float) d1, (float) d2); GL11.glRotatef((entityarrow.prevRotationYaw + (entityarrow.rotationYaw - entityarrow.prevRotationYaw) * f1) - 90F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(entityarrow.prevRotationPitch + (entityarrow.rotationPitch - entityarrow.prevRotationPitch) * f1, 0.0F, 0.0F, 1.0F); - Tessellator tess = Tessellator.instance; + Tessellator tess = Tessellator.getInstance(); + WorldRenderer worldrenderer = tess.getWorldRenderer(); float[] color = entityarrow.getMaterialColor(); int i = 0; float f2 = 0.0F; @@ -46,40 +53,40 @@ public void renderKnife(EntityKnife entityarrow, double d, double d1, double d2, GL11.glScalef(f10, f10, f10); GL11.glTranslatef(-4F, 0.0F, 0.0F); GL11.glNormal3f(f10, 0.0F, 0.0F); - tess.startDrawingQuads(); + worldrenderer.startDrawingQuads(); { - tess.addVertexWithUV(-7D, -2D, -2D, f6, f8); - tess.addVertexWithUV(-7D, -2D, 2D, f7, f8); - tess.addVertexWithUV(-7D, 2D, 2D, f7, f9); - tess.addVertexWithUV(-7D, 2D, -2D, f6, f9); + worldrenderer.addVertexWithUV(-7D, -2D, -2D, f6, f8); + worldrenderer.addVertexWithUV(-7D, -2D, 2D, f7, f8); + worldrenderer.addVertexWithUV(-7D, 2D, 2D, f7, f9); + worldrenderer.addVertexWithUV(-7D, 2D, -2D, f6, f9); } tess.draw(); GL11.glNormal3f(-f10, 0.0F, 0.0F); - tess.startDrawingQuads(); + worldrenderer.startDrawingQuads(); { - tess.addVertexWithUV(-7D, 2D, -2D, f6, f8); - tess.addVertexWithUV(-7D, 2D, 2D, f7, f8); - tess.addVertexWithUV(-7D, -2D, 2D, f7, f9); - tess.addVertexWithUV(-7D, -2D, -2D, f6, f9); + worldrenderer.addVertexWithUV(-7D, 2D, -2D, f6, f8); + worldrenderer.addVertexWithUV(-7D, 2D, 2D, f7, f8); + worldrenderer.addVertexWithUV(-7D, -2D, 2D, f7, f9); + worldrenderer.addVertexWithUV(-7D, -2D, -2D, f6, f9); } tess.draw(); for (int j = 0; j < 4; j++) { GL11.glRotatef(90F, 1.0F, 0.0F, 0.0F); GL11.glNormal3f(0.0F, 0.0F, f10); - tess.startDrawingQuads(); + worldrenderer.startDrawingQuads(); { - tess.setColorOpaque_F(1F, 1F, 1F); - tess.addVertexWithUV(-8D, -2D, 0.0D, f2, f4); - tess.addVertexWithUV(8D, -2D, 0.0D, f3, f4); - tess.addVertexWithUV(8D, 2D, 0.0D, f3, f5); - tess.addVertexWithUV(-8D, 2D, 0.0D, f2, f5); + worldrenderer.setColorOpaque_F(1F, 1F, 1F); + worldrenderer.addVertexWithUV(-8D, -2D, 0.0D, f2, f4); + worldrenderer.addVertexWithUV(8D, -2D, 0.0D, f3, f4); + worldrenderer.addVertexWithUV(8D, 2D, 0.0D, f3, f5); + worldrenderer.addVertexWithUV(-8D, 2D, 0.0D, f2, f5); - tess.setColorOpaque_F(color[0], color[1], color[2]); - tess.addVertexWithUV(-8D, -2D, 0.0D, f2, f13); - tess.addVertexWithUV(8D, -2D, 0.0D, f3, f13); - tess.addVertexWithUV(8D, 2D, 0.0D, f3, f14); - tess.addVertexWithUV(-8D, 2D, 0.0D, f2, f14); + worldrenderer.setColorOpaque_F(color[0], color[1], color[2]); + worldrenderer.addVertexWithUV(-8D, -2D, 0.0D, f2, f13); + worldrenderer.addVertexWithUV(8D, -2D, 0.0D, f3, f13); + worldrenderer.addVertexWithUV(8D, 2D, 0.0D, f3, f14); + worldrenderer.addVertexWithUV(-8D, 2D, 0.0D, f2, f14); } tess.draw(); } diff --git a/src/main/java/ckathode/weaponmod/render/RenderMusketBullet.java b/src/main/java/ckathode/weaponmod/render/RenderMusketBullet.java index cfbadfa0..f948f9dc 100644 --- a/src/main/java/ckathode/weaponmod/render/RenderMusketBullet.java +++ b/src/main/java/ckathode/weaponmod/render/RenderMusketBullet.java @@ -1 +1 @@ -package ckathode.weaponmod.render; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.Render; import net.minecraft.entity.Entity; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; import ckathode.weaponmod.WeaponModResources; import ckathode.weaponmod.entity.projectile.EntityMusketBullet; public class RenderMusketBullet extends Render { public void renderMusketBullet(EntityMusketBullet entityarrow, double d, double d1, double d2, float f, float f1) { bindEntityTexture(entityarrow); GL11.glPushMatrix(); GL11.glTranslatef((float) d, (float) d1, (float) d2); Tessellator tessellator = Tessellator.instance; float f2 = 0.0F; float f3 = 5F / 16F; float f10 = 0.05625F; GL11.glEnable(32826 /*GL_RESCALE_NORMAL_EXT*/); GL11.glScalef(0.07F, 0.07F, 0.07F); GL11.glNormal3f(f10, 0.0F, 0.0F); tessellator.startDrawingQuads(); tessellator.addVertexWithUV(0D, -1D, -1D, f2, f2); tessellator.addVertexWithUV(0D, -1D, 1D, f3, f2); tessellator.addVertexWithUV(0D, 1D, 1D, f3, f3); tessellator.addVertexWithUV(0D, 1D, -1D, f2, f3); tessellator.draw(); GL11.glNormal3f(-f10, 0.0F, 0.0F); tessellator.startDrawingQuads(); tessellator.addVertexWithUV(0D, 1D, -1D, f2, f2); tessellator.addVertexWithUV(0D, 1D, 1D, f3, f2); tessellator.addVertexWithUV(0D, -1D, 1D, f3, f3); tessellator.addVertexWithUV(0D, -1D, -1D, f2, f3); tessellator.draw(); for (int j = 0; j < 4; j++) { GL11.glRotatef(90F, 1.0F, 0.0F, 0.0F); GL11.glNormal3f(0.0F, 0.0F, f10); tessellator.startDrawingQuads(); tessellator.addVertexWithUV(-1D, -1D, 0.0D, f2, f2); tessellator.addVertexWithUV(1D, -1D, 0.0D, f3, f2); tessellator.addVertexWithUV(1D, 1D, 0.0D, f3, f3); tessellator.addVertexWithUV(-1D, 1D, 0.0D, f2, f3); tessellator.draw(); } GL11.glDisable(32826 /*GL_RESCALE_NORMAL_EXT*/); GL11.glPopMatrix(); } @Override public void doRender(Entity entity, double d, double d1, double d2, float f, float f1) { renderMusketBullet((EntityMusketBullet) entity, d, d1, d2, f, f1); } @Override protected ResourceLocation getEntityTexture(Entity entity) { return WeaponModResources.Textures.BULLET; } } \ No newline at end of file +package ckathode.weaponmod.render; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.WorldRenderer; import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.entity.Entity; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; import ckathode.weaponmod.WeaponModResources; import ckathode.weaponmod.entity.projectile.EntityMusketBullet; public class RenderMusketBullet extends Render { public RenderMusketBullet(RenderManager renderManager) { super(renderManager); } public void renderMusketBullet(EntityMusketBullet entityarrow, double d, double d1, double d2, float f, float f1) { bindEntityTexture(entityarrow); GL11.glPushMatrix(); GL11.glTranslatef((float) d, (float) d1, (float) d2); Tessellator tessellator = Tessellator.getInstance(); WorldRenderer worldrenderer = tessellator.getWorldRenderer(); float f2 = 0.0F; float f3 = 5F / 16F; float f10 = 0.05625F; GL11.glEnable(32826 /*GL_RESCALE_NORMAL_EXT*/); GL11.glScalef(0.07F, 0.07F, 0.07F); GL11.glNormal3f(f10, 0.0F, 0.0F); worldrenderer.startDrawingQuads(); worldrenderer.addVertexWithUV(0D, -1D, -1D, f2, f2); worldrenderer.addVertexWithUV(0D, -1D, 1D, f3, f2); worldrenderer.addVertexWithUV(0D, 1D, 1D, f3, f3); worldrenderer.addVertexWithUV(0D, 1D, -1D, f2, f3); tessellator.draw(); GL11.glNormal3f(-f10, 0.0F, 0.0F); worldrenderer.startDrawingQuads(); worldrenderer.addVertexWithUV(0D, 1D, -1D, f2, f2); worldrenderer.addVertexWithUV(0D, 1D, 1D, f3, f2); worldrenderer.addVertexWithUV(0D, -1D, 1D, f3, f3); worldrenderer.addVertexWithUV(0D, -1D, -1D, f2, f3); tessellator.draw(); for (int j = 0; j < 4; j++) { GL11.glRotatef(90F, 1.0F, 0.0F, 0.0F); GL11.glNormal3f(0.0F, 0.0F, f10); worldrenderer.startDrawingQuads(); worldrenderer.addVertexWithUV(-1D, -1D, 0.0D, f2, f2); worldrenderer.addVertexWithUV(1D, -1D, 0.0D, f3, f2); worldrenderer.addVertexWithUV(1D, 1D, 0.0D, f3, f3); worldrenderer.addVertexWithUV(-1D, 1D, 0.0D, f2, f3); tessellator.draw(); } GL11.glDisable(32826 /*GL_RESCALE_NORMAL_EXT*/); GL11.glPopMatrix(); } @Override public void doRender(Entity entity, double d, double d1, double d2, float f, float f1) { renderMusketBullet((EntityMusketBullet) entity, d, d1, d2, f, f1); } @Override protected ResourceLocation getEntityTexture(Entity entity) { return WeaponModResources.Textures.BULLET; } } \ No newline at end of file diff --git a/src/main/java/ckathode/weaponmod/render/RenderSpear.java b/src/main/java/ckathode/weaponmod/render/RenderSpear.java index a9ba082a..0a6e30df 100644 --- a/src/main/java/ckathode/weaponmod/render/RenderSpear.java +++ b/src/main/java/ckathode/weaponmod/render/RenderSpear.java @@ -1,7 +1,9 @@ package ckathode.weaponmod.render; import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.entity.Entity; import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; @@ -13,6 +15,10 @@ public class RenderSpear extends Render { + public RenderSpear(RenderManager renderManager) { + super(renderManager); + } + public void renderSpear(EntitySpear entityarrow, double d, double d1, double d2, float f, float f1) { bindEntityTexture(entityarrow); @@ -20,7 +26,8 @@ public void renderSpear(EntitySpear entityarrow, double d, double d1, double d2, GL11.glTranslatef((float) d, (float) d1, (float) d2); GL11.glRotatef((entityarrow.prevRotationYaw + (entityarrow.rotationYaw - entityarrow.prevRotationYaw) * f1) - 90F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(entityarrow.prevRotationPitch + (entityarrow.rotationPitch - entityarrow.prevRotationPitch) * f1, 0.0F, 0.0F, 1.0F); - Tessellator tess = Tessellator.instance; + Tessellator tess = Tessellator.getInstance(); + WorldRenderer worldrenderer = tess.getWorldRenderer(); float[] color = entityarrow.getMaterialColor(); int i = 0; @@ -49,22 +56,22 @@ public void renderSpear(EntitySpear entityarrow, double d, double d1, double d2, GL11.glScalef(f10, f10, f10); GL11.glTranslatef(-4F, 0.0F, 0.0F); GL11.glNormal3f(f10, 0.0F, 0.0F); - tess.startDrawingQuads(); + worldrenderer.startDrawingQuads(); { - tess.addVertexWithUV(-length, -2D, -2D, f6, f8); - tess.addVertexWithUV(-length, -2D, 2D, f7, f8); - tess.addVertexWithUV(-length, 2D, 2D, f7, f9); - tess.addVertexWithUV(-length, 2D, -2D, f6, f9); + worldrenderer.addVertexWithUV(-length, -2D, -2D, f6, f8); + worldrenderer.addVertexWithUV(-length, -2D, 2D, f7, f8); + worldrenderer.addVertexWithUV(-length, 2D, 2D, f7, f9); + worldrenderer.addVertexWithUV(-length, 2D, -2D, f6, f9); } tess.draw(); GL11.glNormal3f(-f10, 0F, 0F); - tess.startDrawingQuads(); + worldrenderer.startDrawingQuads(); { - tess.addVertexWithUV(-length, 2D, -2D, f6, f8); - tess.addVertexWithUV(-length, 2D, 2D, f7, f8); - tess.addVertexWithUV(-length, -2D, 2D, f7, f9); - tess.addVertexWithUV(-length, -2D, -2D, f6, f9); + worldrenderer.addVertexWithUV(-length, 2D, -2D, f6, f8); + worldrenderer.addVertexWithUV(-length, 2D, 2D, f7, f8); + worldrenderer.addVertexWithUV(-length, -2D, 2D, f7, f9); + worldrenderer.addVertexWithUV(-length, -2D, -2D, f6, f9); } tess.draw(); @@ -72,19 +79,19 @@ public void renderSpear(EntitySpear entityarrow, double d, double d1, double d2, { GL11.glRotatef(90F, 1.0F, 0.0F, 0.0F); GL11.glNormal3f(0.0F, 0.0F, f10); - tess.startDrawingQuads(); + worldrenderer.startDrawingQuads(); { - tess.setColorOpaque_F(1F, 1F, 1F); - tess.addVertexWithUV(-length, -2D, 0.0D, f2, f4); - tess.addVertexWithUV(length, -2D, 0.0D, f3, f4); - tess.addVertexWithUV(length, 2D, 0.0D, f3, f5); - tess.addVertexWithUV(-length, 2D, 0.0D, f2, f5); - - tess.setColorOpaque_F(color[0], color[1], color[2]); - tess.addVertexWithUV(-length, -2D, 0.0D, f2, f13); - tess.addVertexWithUV(length, -2D, 0.0D, f3, f13); - tess.addVertexWithUV(length, 2D, 0.0D, f3, f14); - tess.addVertexWithUV(-length, 2D, 0.0D, f2, f14); + worldrenderer.setColorOpaque_F(1F, 1F, 1F); + worldrenderer.addVertexWithUV(-length, -2D, 0.0D, f2, f4); + worldrenderer.addVertexWithUV(length, -2D, 0.0D, f3, f4); + worldrenderer.addVertexWithUV(length, 2D, 0.0D, f3, f5); + worldrenderer.addVertexWithUV(-length, 2D, 0.0D, f2, f5); + + worldrenderer.setColorOpaque_F(color[0], color[1], color[2]); + worldrenderer.addVertexWithUV(-length, -2D, 0.0D, f2, f13); + worldrenderer.addVertexWithUV(length, -2D, 0.0D, f3, f13); + worldrenderer.addVertexWithUV(length, 2D, 0.0D, f3, f14); + worldrenderer.addVertexWithUV(-length, 2D, 0.0D, f2, f14); } tess.draw(); } diff --git a/src/main/java/ckathode/weaponmod/render/WeaponItemRenderer.java b/src/main/java/ckathode/weaponmod/render/WeaponItemRenderer.java index 1fa5baf4..a560481a 100644 --- a/src/main/java/ckathode/weaponmod/render/WeaponItemRenderer.java +++ b/src/main/java/ckathode/weaponmod/render/WeaponItemRenderer.java @@ -2,17 +2,17 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; import net.minecraftforge.client.IItemRenderer; import org.lwjgl.opengl.GL11; import ckathode.weaponmod.WeaponModResources; -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import net.minecraftforge.fml.client.FMLClientHandler; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class WeaponItemRenderer implements IItemRenderer @@ -39,36 +39,35 @@ public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRe @Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { - Tessellator tess = Tessellator.instance; - + Tessellator tess = Tessellator.getInstance(); + EntityLivingBase entityliving = (EntityLivingBase) data[1]; - IIcon icon = entityliving.getItemIcon(item, 0); float t = 0.0625F; - renderItemIn2D(tess, icon.getMaxU(), icon.getMinV(), icon.getMinU(), icon.getMaxV(), icon.getIconWidth(), icon.getIconHeight(), t); renderEnchantEffect(tess, item, 256, 256, t); } protected void renderItemIn2D(Tessellator tess, float texU0, float texV0, float texU1, float texV1, int iconwidth, int iconheight, float thickness) { - tess.startDrawingQuads(); - tess.setNormal(0.0F, 0.0F, 1.0F); - tess.addVertexWithUV(0.0D, 0.0D, 0.0D, texU0, texV1); - tess.addVertexWithUV(1.0D, 0.0D, 0.0D, texU1, texV1); - tess.addVertexWithUV(1.0D, 1.0D, 0.0D, texU1, texV0); - tess.addVertexWithUV(0.0D, 1.0D, 0.0D, texU0, texV0); - //tess.draw(); - //tess.startDrawingQuads(); - tess.setNormal(0.0F, 0.0F, -1.0F); - tess.addVertexWithUV(0.0D, 1.0D, (0.0F - thickness), texU0, texV0); - tess.addVertexWithUV(1.0D, 1.0D, (0.0F - thickness), texU1, texV0); - tess.addVertexWithUV(1.0D, 0.0D, (0.0F - thickness), texU1, texV1); - tess.addVertexWithUV(0.0D, 0.0D, (0.0F - thickness), texU0, texV1); - //tess.draw(); + WorldRenderer worldrenderer = tess.getWorldRenderer(); + worldrenderer.startDrawingQuads(); + worldrenderer.setNormal(0.0F, 0.0F, 1.0F); + worldrenderer.addVertexWithUV(0.0D, 0.0D, 0.0D, texU0, texV1); + worldrenderer.addVertexWithUV(1.0D, 0.0D, 0.0D, texU1, texV1); + worldrenderer.addVertexWithUV(1.0D, 1.0D, 0.0D, texU1, texV0); + worldrenderer.addVertexWithUV(0.0D, 1.0D, 0.0D, texU0, texV0); + //worldrenderer.draw(); + //worldrenderer.startDrawingQuads(); + worldrenderer.setNormal(0.0F, 0.0F, -1.0F); + worldrenderer.addVertexWithUV(0.0D, 1.0D, (0.0F - thickness), texU0, texV0); + worldrenderer.addVertexWithUV(1.0D, 1.0D, (0.0F - thickness), texU1, texV0); + worldrenderer.addVertexWithUV(1.0D, 0.0D, (0.0F - thickness), texU1, texV1); + worldrenderer.addVertexWithUV(0.0D, 0.0D, (0.0F - thickness), texU0, texV1); + //worldrenderer.draw(); float f5 = iconwidth * (texU0 - texU1); float f6 = iconheight * (texV1 - texV0); - //tess.startDrawingQuads(); - tess.setNormal(-1.0F, 0.0F, 0.0F); + //worldrenderer.startDrawingQuads(); + worldrenderer.setNormal(-1.0F, 0.0F, 0.0F); int k; float f7; float f8; @@ -77,15 +76,15 @@ protected void renderItemIn2D(Tessellator tess, float texU0, float texV0, float { f7 = k / f5; f8 = texU0 + (texU1 - texU0) * f7 - 0.5F / iconwidth; - tess.addVertexWithUV(f7, 0.0D, (0.0F - thickness), f8, texV1); - tess.addVertexWithUV(f7, 0.0D, 0.0D, f8, texV1); - tess.addVertexWithUV(f7, 1.0D, 0.0D, f8, texV0); - tess.addVertexWithUV(f7, 1.0D, (0.0F - thickness), f8, texV0); + worldrenderer.addVertexWithUV(f7, 0.0D, (0.0F - thickness), f8, texV1); + worldrenderer.addVertexWithUV(f7, 0.0D, 0.0D, f8, texV1); + worldrenderer.addVertexWithUV(f7, 1.0D, 0.0D, f8, texV0); + worldrenderer.addVertexWithUV(f7, 1.0D, (0.0F - thickness), f8, texV0); } - //tess.draw(); - //tess.startDrawingQuads(); - tess.setNormal(1.0F, 0.0F, 0.0F); + //worldrenderer.draw(); + //worldrenderer.startDrawingQuads(); + worldrenderer.setNormal(1.0F, 0.0F, 0.0F); float f9; for (k = 0; k < f5; ++k) @@ -93,39 +92,39 @@ protected void renderItemIn2D(Tessellator tess, float texU0, float texV0, float f7 = k / f5; f8 = texU0 + (texU1 - texU0) * f7 - 0.5F / iconwidth; f9 = f7 + 1.0F / f5; - tess.addVertexWithUV(f9, 1.0D, (0.0F - thickness), f8, texV0); - tess.addVertexWithUV(f9, 1.0D, 0.0D, f8, texV0); - tess.addVertexWithUV(f9, 0.0D, 0.0D, f8, texV1); - tess.addVertexWithUV(f9, 0.0D, (0.0F - thickness), f8, texV1); + worldrenderer.addVertexWithUV(f9, 1.0D, (0.0F - thickness), f8, texV0); + worldrenderer.addVertexWithUV(f9, 1.0D, 0.0D, f8, texV0); + worldrenderer.addVertexWithUV(f9, 0.0D, 0.0D, f8, texV1); + worldrenderer.addVertexWithUV(f9, 0.0D, (0.0F - thickness), f8, texV1); } - //tess.draw(); - //tess.startDrawingQuads(); - tess.setNormal(0.0F, 1.0F, 0.0F); + //worldrenderer.draw(); + //worldrenderer.startDrawingQuads(); + worldrenderer.setNormal(0.0F, 1.0F, 0.0F); for (k = 0; k < f6; ++k) { f7 = k / f6; f8 = texV1 + (texV0 - texV1) * f7 - 0.5F / iconheight; f9 = f7 + 1.0F / f6; - tess.addVertexWithUV(0.0D, f9, 0.0D, texU0, f8); - tess.addVertexWithUV(1.0D, f9, 0.0D, texU1, f8); - tess.addVertexWithUV(1.0D, f9, (0.0F - thickness), texU1, f8); - tess.addVertexWithUV(0.0D, f9, (0.0F - thickness), texU0, f8); + worldrenderer.addVertexWithUV(0.0D, f9, 0.0D, texU0, f8); + worldrenderer.addVertexWithUV(1.0D, f9, 0.0D, texU1, f8); + worldrenderer.addVertexWithUV(1.0D, f9, (0.0F - thickness), texU1, f8); + worldrenderer.addVertexWithUV(0.0D, f9, (0.0F - thickness), texU0, f8); } - //tess.draw(); - //tess.startDrawingQuads(); - tess.setNormal(0.0F, -1.0F, 0.0F); + //worldrenderer.draw(); + //worldrenderer.startDrawingQuads(); + worldrenderer.setNormal(0.0F, -1.0F, 0.0F); for (k = 0; k < f6; ++k) { f7 = k / f6; f8 = texV1 + (texV0 - texV1) * f7 - 0.5F / iconheight; - tess.addVertexWithUV(1.0D, f7, 0.0D, texU1, f8); - tess.addVertexWithUV(0.0D, f7, 0.0D, texU0, f8); - tess.addVertexWithUV(0.0D, f7, (0.0F - thickness), texU0, f8); - tess.addVertexWithUV(1.0D, f7, (0.0F - thickness), texU1, f8); + worldrenderer.addVertexWithUV(1.0D, f7, 0.0D, texU1, f8); + worldrenderer.addVertexWithUV(0.0D, f7, 0.0D, texU0, f8); + worldrenderer.addVertexWithUV(0.0D, f7, (0.0F - thickness), texU0, f8); + worldrenderer.addVertexWithUV(1.0D, f7, (0.0F - thickness), texU1, f8); } tess.draw(); @@ -133,7 +132,7 @@ protected void renderItemIn2D(Tessellator tess, float texU0, float texV0, float protected void renderEnchantEffect(Tessellator tess, ItemStack item, int iconwidth, int iconheight, float thickness) { - if (item != null && item.hasEffect(0)) + if (item != null && item.hasEffect()) { GL11.glDepthFunc(GL11.GL_EQUAL); GL11.glDisable(GL11.GL_LIGHTING); diff --git a/src/main/resources/assets/weaponmod/lang/de_DE.lang b/src/main/resources/assets/weaponmod/lang/de_DE.lang index f489ced8..354eee31 100644 --- a/src/main/resources/assets/weaponmod/lang/de_DE.lang +++ b/src/main/resources/assets/weaponmod/lang/de_DE.lang @@ -48,6 +48,9 @@ item.bolt.name=Armbrustbolzen item.blowgun.name=Blasrohr item.dart.name=Vergifteter Pfeil +item.dart_hunger.name=Vergifteter Pfeil +item.dart_slow.name=Vergifteter Pfeil +item.dart_damage.name=Vergifteter Pfeil item.dynamite.name=Dynamit diff --git a/src/main/resources/assets/weaponmod/lang/en_PT.lang b/src/main/resources/assets/weaponmod/lang/en_PT.lang index 61f14fab..baceefb1 100644 --- a/src/main/resources/assets/weaponmod/lang/en_PT.lang +++ b/src/main/resources/assets/weaponmod/lang/en_PT.lang @@ -53,6 +53,9 @@ item.bolt.name=Pistol o' Lassies' Bullet item.blowgun.name=Blowgun item.dart.name=Arrow o' Scurvy +item.dart_hunger.name=Arrow o' Scurvy +item.dart_slow.name=Arrow o' Scurvy +item.dart_damage.name=Arrow o' Scurvy item.dynamite.name=Hand Granadoe @@ -79,4 +82,4 @@ item.katana.wood.name=Handsome Cutlass o' Timber item.katana.stone.name=Handsome Cutlass o' Rock item.katana.iron.name=Handsome Cutlass o' Metal item.katana.diamond.name=Handsome Bejeweled Cutlass -item.katana.gold.name=Handsome Golden Cutlass \ No newline at end of file +item.katana.gold.name=Handsome Golden Cutlass diff --git a/src/main/resources/assets/weaponmod/lang/en_UK.lang b/src/main/resources/assets/weaponmod/lang/en_UK.lang index 1c28eb44..126e2bf1 100644 --- a/src/main/resources/assets/weaponmod/lang/en_UK.lang +++ b/src/main/resources/assets/weaponmod/lang/en_UK.lang @@ -53,6 +53,9 @@ item.bolt.name=Crossbow Bolt item.blowgun.name=Blowgun item.dart.name=Poisonous Dart +item.dart_hunger.name=Poisonous Dart +item.dart_slow.name=Poisonous Dart +item.dart_damage.name=Poisonous Dart item.dynamite.name=Dynamite @@ -87,4 +90,4 @@ attribute.name.weaponmod.ignoreArmour=Ignore Armour attribute.name.weaponmod.knockback=Knockback attribute.name.weaponmod.attackSpeed=Attack Speed attribute.name.weaponmod.reloadTime=Reload Time -attribute.name.weaponmod.reach=Reach \ No newline at end of file +attribute.name.weaponmod.reach=Reach diff --git a/src/main/resources/assets/weaponmod/lang/en_US.lang b/src/main/resources/assets/weaponmod/lang/en_US.lang index 3406ae30..5883c8f6 100644 --- a/src/main/resources/assets/weaponmod/lang/en_US.lang +++ b/src/main/resources/assets/weaponmod/lang/en_US.lang @@ -53,6 +53,9 @@ item.bolt.name=Crossbow Bolt item.blowgun.name=Blowgun item.dart.name=Poisonous Dart +item.dart_hunger.name=Poisonous Dart +item.dart_slow.name=Poisonous Dart +item.dart_damage.name=Poisonous Dart item.dynamite.name=Dynamite @@ -87,4 +90,4 @@ attribute.name.weaponmod.ignoreArmour=Ignore Armor attribute.name.weaponmod.knockback=Knockback attribute.name.weaponmod.attackSpeed=Attack Speed attribute.name.weaponmod.reloadTime=Reload Time -attribute.name.weaponmod.reach=Reach \ No newline at end of file +attribute.name.weaponmod.reach=Reach diff --git a/src/main/resources/assets/weaponmod/lang/es_ES.lang b/src/main/resources/assets/weaponmod/lang/es_ES.lang index 36e1902a..836a7f0a 100644 --- a/src/main/resources/assets/weaponmod/lang/es_ES.lang +++ b/src/main/resources/assets/weaponmod/lang/es_ES.lang @@ -50,6 +50,9 @@ item.bolt.name=Flecha de Ballesta item.blowgun.name=Cerbatana item.dart.name=Dardo Venenoso +item.dart_hunger.name=Dardo Venenoso +item.dart_slow.name=Dardo Venenoso +item.dart_damage.name=Dardo Venenoso item.dynamite.name=Dinamita diff --git a/src/main/resources/assets/weaponmod/lang/fr_CA.lang b/src/main/resources/assets/weaponmod/lang/fr_CA.lang index ba3754ca..74fa9306 100644 --- a/src/main/resources/assets/weaponmod/lang/fr_CA.lang +++ b/src/main/resources/assets/weaponmod/lang/fr_CA.lang @@ -50,6 +50,9 @@ item.bolt.name=Carreau d'arbalete item.blowgun.name=Sarbacane item.dart.name=Dart toxique +item.dart_hunger.name=Dart toxique +item.dart_slow.name=Dart toxique +item.dart_damage.name=Dart toxique item.dynamite.name=Dynamite diff --git a/src/main/resources/assets/weaponmod/lang/fr_FR.lang b/src/main/resources/assets/weaponmod/lang/fr_FR.lang index 98dfe63c..d9a55639 100644 --- a/src/main/resources/assets/weaponmod/lang/fr_FR.lang +++ b/src/main/resources/assets/weaponmod/lang/fr_FR.lang @@ -50,6 +50,9 @@ item.bolt.name=Carreau d'arbalete item.blowgun.name=Sarbacane item.dart.name=Dart toxique +item.dart_hunger.name=Dart toxique +item.dart_slow.name=Dart toxique +item.dart_damage.name=Dart toxique item.dynamite.name=Dynamite diff --git a/src/main/resources/assets/weaponmod/lang/it_IT.lang b/src/main/resources/assets/weaponmod/lang/it_IT.lang index 32c81c03..54e6a12f 100644 --- a/src/main/resources/assets/weaponmod/lang/it_IT.lang +++ b/src/main/resources/assets/weaponmod/lang/it_IT.lang @@ -48,6 +48,9 @@ item.bolt.name=Dardo per balestra item.blowgun.name=Cerbottana item.dart.name=Dardo avvelenato +item.dart_hunger.name=Dardo avvelenato +item.dart_slow.name=Dardo avvelenato +item.dart_damage.name=Dardo avvelenato item.dynamite.name=Dinamite diff --git a/src/main/resources/assets/weaponmod/lang/ja_JP.lang b/src/main/resources/assets/weaponmod/lang/ja_JP.lang index cf07eae1..ecd68c21 100644 --- a/src/main/resources/assets/weaponmod/lang/ja_JP.lang +++ b/src/main/resources/assets/weaponmod/lang/ja_JP.lang @@ -53,6 +53,9 @@ item.bolt.name=太矢 item.blowgun.name=吹き矢筒 item.dart.name=毒矢 +item.dart_hunger.name=毒矢 +item.dart_slow.name=毒矢 +item.dart_damage.name=毒矢 item.dynamite.name=ダイナマイト diff --git a/src/main/resources/assets/weaponmod/lang/nl_NL.lang b/src/main/resources/assets/weaponmod/lang/nl_NL.lang index f1ecd5dd..2122a65b 100644 --- a/src/main/resources/assets/weaponmod/lang/nl_NL.lang +++ b/src/main/resources/assets/weaponmod/lang/nl_NL.lang @@ -53,6 +53,9 @@ item.bolt.name=Kruisboogpijl item.blowgun.name=Blaaspijp item.dart.name=Giftig dartpijltje +item.dart_hunger.name=Giftig dartpijltje +item.dart_slow.name=Giftig dartpijltje +item.dart_damage.name=Giftig dartpijltje item.dynamite.name=Dynamiet @@ -87,4 +90,4 @@ attribute.name.weaponmod.ignoreArmour=Negeer pantser attribute.name.weaponmod.knockback=Terugslag attribute.name.weaponmod.attackSpeed=Aanvalssnelheid attribute.name.weaponmod.reloadTime=Herlaadtijd -attribute.name.weaponmod.reach=Bereik \ No newline at end of file +attribute.name.weaponmod.reach=Bereik diff --git a/src/main/resources/assets/weaponmod/lang/pl_PL.lang b/src/main/resources/assets/weaponmod/lang/pl_PL.lang new file mode 100644 index 00000000..f919b1b3 --- /dev/null +++ b/src/main/resources/assets/weaponmod/lang/pl_PL.lang @@ -0,0 +1,93 @@ +#Balkon's WeaponMod language file pl_PL + +item.spear.wood.name=Drewniana włócznia +item.spear.stone.name=Kamienna włócznia +item.spear.iron.name=Żelazna włócznia +item.spear.diamond.name=Diamentowa włócznia +item.spear.gold.name=Złota włócznia + +item.halberd.wood.name=Drewniana halabarda +item.halberd.stone.name=Kamienna halabarda +item.halberd.iron.name=Żelazna halabarda +item.halberd.diamond.name=Diamentowa halabarda +item.halberd.gold.name=Złota halabarda + +item.battleaxe.wood.name=Drewniany topór +item.battleaxe.stone.name=Kamienny topór +item.battleaxe.iron.name=Żelazny topór +item.battleaxe.diamond.name=Diamentowy topór +item.battleaxe.gold.name=Złoty topór + +item.warhammer.wood.name=Drewniany młot bojowy +item.warhammer.stone.name=Kamienny młot bojowy +item.warhammer.iron.name=Żelazny młot bojowy +item.warhammer.diamond.name=Diamentowy młot bojowy +item.warhammer.gold.name=Złoty młot bojowy + +item.knife.wood.name=Drewniany nóż +item.knife.stone.name=Kamienny nóż +item.knife.iron.name=Żelazny nóż +item.knife.diamond.name=Diamentowy nóż +item.knife.gold.name=Złoty nóż + +item.flail.wood.name=Drewniany masłak +item.flail.stone.name=Kamienny masłak +item.flail.iron.name=Żelazny masłak +item.flail.diamond.name=Diamentowy masłak +item.flail.gold.name=Złoty masłak + +item.javelin.name=Oszczep + +item.musket.name=Muszkiet +item.musketbayonet.name=Muszkiet z bagnetem +item.musketbayonet.wood.name=Muszkiet z drewnianym bagnetem +item.musketbayonet.stone.name=Muszkiet z kamiennym bagnetem +item.musketbayonet.iron.name=Muszkiet z żelaznym bagnetem +item.musketbayonet.diamond.name=Muszkiet z diamentowym bagnetem +item.musketbayonet.gold.name=Muszkiet z złotym bagnetem +item.musket-ironpart.name=Lufa do muszkietu +item.bullet.name=Ładunek do muszkietu + +item.crossbow.name=Kusza +item.bolt.name=Bełt + +item.blowgun.name=Dmuchawka +item.dart.name=Zatruta strzała +item.dart_hunger.name=Zatruta strzała +item.dart_slow.name=Zatruta strzała +item.dart_damage.name=Zatruta strzała + +item.dynamite.name=Dynamit + +item.firerod.name=Płonący kij + +item.cannon.name=Armata +item.cannonball.name=Kula armatnia + +item.blunderbuss.name=Gardłacz +item.blunder-ironpart.name=Lufa do gardłacza +item.shot.name=Śrut + +item.dummy.name=Manekin treningowy + +item.gun-stock.name=Kolba + +item.boomerang.wood.name=Drewniany bumerang +item.boomerang.stone.name=Kamienny bumerang +item.boomerang.iron.name=Żelazny bumerang +item.boomerang.diamond.name=Diamentowy bumerang +item.boomerang.gold.name=Złoty bumerang + +item.katana.wood.name=Drewniana katana +item.katana.stone.name=Kamienna katana +item.katana.iron.name=Żelazna katana +item.katana.diamond.name=Diamentowa katana +item.katana.gold.name=Złota katana + +item.flintlock.name=Pistolet skałkowy + +attribute.name.weaponmod.ignoreArmour=Penetracja pancerza +attribute.name.weaponmod.knockback=Odrzut +attribute.name.weaponmod.attackSpeed=Szybkość Ataku +attribute.name.weaponmod.reloadTime=Czas Przeładowania +attribute.name.weaponmod.reach=Zasięg diff --git a/src/main/resources/assets/weaponmod/lang/pt_BR.lang b/src/main/resources/assets/weaponmod/lang/pt_BR.lang index 6a1ad854..63a5bf7d 100644 --- a/src/main/resources/assets/weaponmod/lang/pt_BR.lang +++ b/src/main/resources/assets/weaponmod/lang/pt_BR.lang @@ -53,6 +53,9 @@ item.bolt.name=Flecha de Besta item.blowgun.name=Zarabatana item.dart.name=Dardo Envenenado +item.dart_hunger.name=Dardo Envenenado +item.dart_slow.name=Dardo Envenenado +item.dart_damage.name=Dardo Envenenado item.dynamite.name=Dinamite diff --git a/src/main/resources/assets/weaponmod/lang/ru_RU.lang b/src/main/resources/assets/weaponmod/lang/ru_RU.lang index 9e851c64..f037d14b 100644 --- a/src/main/resources/assets/weaponmod/lang/ru_RU.lang +++ b/src/main/resources/assets/weaponmod/lang/ru_RU.lang @@ -53,6 +53,9 @@ item.bolt.name=\u0410\u0440\u0431\u0430\u043B\u0435\u0442\u043D\u044B\u0439 \u04 item.blowgun.name=\u0414\u0443\u0445\u043E\u0432\u0430\u044F \u0442\u0440\u0443\u0431\u043A\u0430 item.dart.name=\u041E\u0442\u0440\u0430\u0432\u043B\u0435\u043D\u043D\u044B\u0439 \u0434\u0440\u043E\u0442\u0438\u043A +item.dart_hunger.name=\u041E\u0442\u0440\u0430\u0432\u043B\u0435\u043D\u043D\u044B\u0439 \u0434\u0440\u043E\u0442\u0438\u043A +item.dart_slow.name=\u041E\u0442\u0440\u0430\u0432\u043B\u0435\u043D\u043D\u044B\u0439 \u0434\u0440\u043E\u0442\u0438\u043A +item.dart_damage.name=\u041E\u0442\u0440\u0430\u0432\u043B\u0435\u043D\u043D\u044B\u0439 \u0434\u0440\u043E\u0442\u0438\u043A item.dynamite.name=\u0414\u0438\u043D\u0430\u043C\u0438\u0442\u043D\u0430\u044F \u0448\u0430\u0448\u043A\u0430 @@ -87,4 +90,4 @@ attribute.name.weaponmod.ignoreArmour=\u0418\u0433\u043D\u043E\u0440\u0438\u0440 attribute.name.weaponmod.knockback=\u041E\u0442\u0442\u0430\u043B\u043A\u0438\u0432\u0430\u043D\u0438\u0435 attribute.name.weaponmod.attackSpeed=\u0421\u043A\u043E\u0440\u043E\u0441\u0442\u044C \u0430\u0442\u0430\u043A\u0438 attribute.name.weaponmod.reloadTime=\u0412\u0440\u0435\u043C\u044F \u043F\u0435\u0440\u0435\u0437\u0430\u0440\u044F\u0434\u043A\u0438 -attribute.name.weaponmod.reach=\u0420\u0430\u0437\u043C\u0430\u0445 \ No newline at end of file +attribute.name.weaponmod.reach=\u0420\u0430\u0437\u043C\u0430\u0445 diff --git a/src/main/resources/assets/weaponmod/lang/zh_CN.lang b/src/main/resources/assets/weaponmod/lang/zh_CN.lang index 3d5bc703..3b6ae1d1 100644 --- a/src/main/resources/assets/weaponmod/lang/zh_CN.lang +++ b/src/main/resources/assets/weaponmod/lang/zh_CN.lang @@ -53,6 +53,9 @@ item.bolt.name=弩箭 item.blowgun.name=吹筒 item.dart.name=毒镖 +item.dart_hunger.name=毒镖 +item.dart_slow.name=毒镖 +item.dart_damage.name=毒镖 item.dynamite.name=投掷炸药 diff --git a/src/main/resources/assets/weaponmod/lang/zh_TW.lang b/src/main/resources/assets/weaponmod/lang/zh_TW.lang index 365a253a..7557b060 100644 --- a/src/main/resources/assets/weaponmod/lang/zh_TW.lang +++ b/src/main/resources/assets/weaponmod/lang/zh_TW.lang @@ -53,6 +53,9 @@ item.bolt.name=弩箭 item.blowgun.name=吹筒 item.dart.name=毒鏢 +item.dart_hunger.name=毒鏢 +item.dart_slow.name=毒鏢 +item.dart_damage.name=毒鏢 item.dynamite.name=投擲炸藥 diff --git a/src/main/resources/assets/weaponmod/models/item/JSON.py b/src/main/resources/assets/weaponmod/models/item/JSON.py new file mode 100644 index 00000000..e9d6da8e --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/JSON.py @@ -0,0 +1,35 @@ +items = "battleaxe.diamond.png;boomerang.stone.png;dynamite.png;halberd.iron.png;knife.iron.png;shot.png;\ +battleaxe.gold.png;boomerang.wood.png;firerod.png;halberd.stone.png;knife.stone.png;spear.diamond.png;\ +battleaxe.iron.png;bullet.png;flail.diamond.png;halberd.wood.png;knife.wood.png;spear.gold.png;\ +battleaxe.stone.png;cannonball.png;flail.gold.png;javelin.png;long_weapons.png;spear.iron.png;\ +battleaxe.wood.png;cannon.png;flail.iron.png;jd-gui.cfg;musketbayonet.diamond.png;spear.stone.png;\ +blowgun.png;crossbow-loaded.png;flail.stone.png;katana.diamond.png;musketbayonet.gold.png;spear.wood.png;\ +blunderbuss.png;crossbow.png;flail-thrown.png;katana.gold.png;musketbayonet.iron.png;warhammer.diamond.png;\ +blunder-ironpart.png;dart_damage.png;flail.wood.png;katana.iron.png;musketbayonet.png;warhammer.gold.png;\ +bolt.png;dart_hunger.png;flintlock.png;katana.stone.png;musketbayonet.stone.png;warhammer.iron.png;\ +boomerang.diamond.png;dart.png;gun-stock.png;katana.wood.png;musketbayonet.wood.png;warhammer.stone.png;\ +boomerang.gold.png;dart_slow.png;halberd.diamond.png;knife.diamond.png;musket-ironpart.png;warhammer.wood.png;\ +boomerang.iron.png;dummy.png;halberd.gold.png;knife.gold.png;musket.png".split(";") + +for i in items: + template = '''{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/'''+i[:-4]+'''" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +}''' + plik = open(i[:-4]+".json", 'w') + plik.write(template) + plik.close() diff --git a/src/main/resources/assets/weaponmod/models/item/battleaxe.diamond.json b/src/main/resources/assets/weaponmod/models/item/battleaxe.diamond.json new file mode 100644 index 00000000..0796c896 --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/battleaxe.diamond.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/battleaxe.diamond" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/battleaxe.gold.json b/src/main/resources/assets/weaponmod/models/item/battleaxe.gold.json new file mode 100644 index 00000000..89876329 --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/battleaxe.gold.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/battleaxe.gold" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/battleaxe.iron.json b/src/main/resources/assets/weaponmod/models/item/battleaxe.iron.json new file mode 100644 index 00000000..461ee6b3 --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/battleaxe.iron.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/battleaxe.iron" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/battleaxe.stone.json b/src/main/resources/assets/weaponmod/models/item/battleaxe.stone.json new file mode 100644 index 00000000..5ed20e9b --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/battleaxe.stone.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/battleaxe.stone" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/battleaxe.wood.json b/src/main/resources/assets/weaponmod/models/item/battleaxe.wood.json new file mode 100644 index 00000000..903c1b5d --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/battleaxe.wood.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/battleaxe.wood" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/blowgun.json b/src/main/resources/assets/weaponmod/models/item/blowgun.json new file mode 100644 index 00000000..0f1ee316 --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/blowgun.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/blowgun" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/blunder-ironpart.json b/src/main/resources/assets/weaponmod/models/item/blunder-ironpart.json new file mode 100644 index 00000000..e2e62d43 --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/blunder-ironpart.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/blunder-ironpart" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/blunderbuss.json b/src/main/resources/assets/weaponmod/models/item/blunderbuss.json new file mode 100644 index 00000000..9cff9453 --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/blunderbuss.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/blunderbuss" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/bolt.json b/src/main/resources/assets/weaponmod/models/item/bolt.json new file mode 100644 index 00000000..2c622b86 --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/bolt.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/bolt" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/boomerang.diamond.json b/src/main/resources/assets/weaponmod/models/item/boomerang.diamond.json new file mode 100644 index 00000000..568667a6 --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/boomerang.diamond.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/boomerang.diamond" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/boomerang.gold.json b/src/main/resources/assets/weaponmod/models/item/boomerang.gold.json new file mode 100644 index 00000000..27e57c0c --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/boomerang.gold.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/boomerang.gold" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/boomerang.iron.json b/src/main/resources/assets/weaponmod/models/item/boomerang.iron.json new file mode 100644 index 00000000..9c9edb94 --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/boomerang.iron.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/boomerang.iron" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/boomerang.stone.json b/src/main/resources/assets/weaponmod/models/item/boomerang.stone.json new file mode 100644 index 00000000..bcb7989f --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/boomerang.stone.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/boomerang.stone" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/boomerang.wood.json b/src/main/resources/assets/weaponmod/models/item/boomerang.wood.json new file mode 100644 index 00000000..bea71710 --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/boomerang.wood.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/boomerang.wood" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/bullet.json b/src/main/resources/assets/weaponmod/models/item/bullet.json new file mode 100644 index 00000000..67d0f235 --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/bullet.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/bullet" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/cannon.json b/src/main/resources/assets/weaponmod/models/item/cannon.json new file mode 100644 index 00000000..0a0b90e6 --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/cannon.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/cannon" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/cannonball.json b/src/main/resources/assets/weaponmod/models/item/cannonball.json new file mode 100644 index 00000000..adb52b9e --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/cannonball.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/cannonball" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/crossbow-loaded.json b/src/main/resources/assets/weaponmod/models/item/crossbow-loaded.json new file mode 100644 index 00000000..19eb4644 --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/crossbow-loaded.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/crossbow-loaded" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/crossbow.json b/src/main/resources/assets/weaponmod/models/item/crossbow.json new file mode 100644 index 00000000..e5af2024 --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/crossbow.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/crossbow" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/dart.json b/src/main/resources/assets/weaponmod/models/item/dart.json new file mode 100644 index 00000000..2d39131f --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/dart.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/dart" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/dart_damage.json b/src/main/resources/assets/weaponmod/models/item/dart_damage.json new file mode 100644 index 00000000..1e0ebbea --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/dart_damage.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/dart_damage" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/dart_hunger.json b/src/main/resources/assets/weaponmod/models/item/dart_hunger.json new file mode 100644 index 00000000..f7fa2c47 --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/dart_hunger.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/dart_hunger" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/dart_slow.json b/src/main/resources/assets/weaponmod/models/item/dart_slow.json new file mode 100644 index 00000000..d5ef815d --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/dart_slow.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/dart_slow" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/dummy.json b/src/main/resources/assets/weaponmod/models/item/dummy.json new file mode 100644 index 00000000..75184dfc --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/dummy.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/dummy" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/dynamite.json b/src/main/resources/assets/weaponmod/models/item/dynamite.json new file mode 100644 index 00000000..1dfb8f57 --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/dynamite.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/dynamite" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/firerod.json b/src/main/resources/assets/weaponmod/models/item/firerod.json new file mode 100644 index 00000000..b11c02ea --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/firerod.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/firerod" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/flail-thrown.json b/src/main/resources/assets/weaponmod/models/item/flail-thrown.json new file mode 100644 index 00000000..92849fd4 --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/flail-thrown.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/flail-thrown" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/flail.diamond.json b/src/main/resources/assets/weaponmod/models/item/flail.diamond.json new file mode 100644 index 00000000..90fbc437 --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/flail.diamond.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/flail.diamond" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/flail.gold.json b/src/main/resources/assets/weaponmod/models/item/flail.gold.json new file mode 100644 index 00000000..a8e82ed2 --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/flail.gold.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/flail.gold" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/flail.iron.json b/src/main/resources/assets/weaponmod/models/item/flail.iron.json new file mode 100644 index 00000000..ed6b9565 --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/flail.iron.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/flail.iron" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/flail.stone.json b/src/main/resources/assets/weaponmod/models/item/flail.stone.json new file mode 100644 index 00000000..971711f6 --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/flail.stone.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/flail.stone" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/flail.wood.json b/src/main/resources/assets/weaponmod/models/item/flail.wood.json new file mode 100644 index 00000000..31ade9c0 --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/flail.wood.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/flail.wood" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/flintlock.json b/src/main/resources/assets/weaponmod/models/item/flintlock.json new file mode 100644 index 00000000..fd53aeef --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/flintlock.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/flintlock" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/gun-stock.json b/src/main/resources/assets/weaponmod/models/item/gun-stock.json new file mode 100644 index 00000000..013ab190 --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/gun-stock.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/gun-stock" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/halberd.diamond.json b/src/main/resources/assets/weaponmod/models/item/halberd.diamond.json new file mode 100644 index 00000000..2e1d474a --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/halberd.diamond.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/halberd.diamond" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/halberd.gold.json b/src/main/resources/assets/weaponmod/models/item/halberd.gold.json new file mode 100644 index 00000000..0064a38f --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/halberd.gold.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/halberd.gold" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/halberd.iron.json b/src/main/resources/assets/weaponmod/models/item/halberd.iron.json new file mode 100644 index 00000000..57663a38 --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/halberd.iron.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/halberd.iron" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/halberd.stone.json b/src/main/resources/assets/weaponmod/models/item/halberd.stone.json new file mode 100644 index 00000000..56a6367c --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/halberd.stone.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/halberd.stone" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/halberd.wood.json b/src/main/resources/assets/weaponmod/models/item/halberd.wood.json new file mode 100644 index 00000000..57df16df --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/halberd.wood.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/halberd.wood" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/javelin.json b/src/main/resources/assets/weaponmod/models/item/javelin.json new file mode 100644 index 00000000..93caf8fa --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/javelin.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/javelin" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/jd-gui.json b/src/main/resources/assets/weaponmod/models/item/jd-gui.json new file mode 100644 index 00000000..5fc9b9de --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/jd-gui.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/jd-gui" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/katana.diamond.json b/src/main/resources/assets/weaponmod/models/item/katana.diamond.json new file mode 100644 index 00000000..295fb34c --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/katana.diamond.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/katana.diamond" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/katana.gold.json b/src/main/resources/assets/weaponmod/models/item/katana.gold.json new file mode 100644 index 00000000..71908a94 --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/katana.gold.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/katana.gold" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/katana.iron.json b/src/main/resources/assets/weaponmod/models/item/katana.iron.json new file mode 100644 index 00000000..f6924d7c --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/katana.iron.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/katana.iron" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/katana.stone.json b/src/main/resources/assets/weaponmod/models/item/katana.stone.json new file mode 100644 index 00000000..a000c0eb --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/katana.stone.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/katana.stone" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/katana.wood.json b/src/main/resources/assets/weaponmod/models/item/katana.wood.json new file mode 100644 index 00000000..4c3d339f --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/katana.wood.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/katana.wood" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/knife.diamond.json b/src/main/resources/assets/weaponmod/models/item/knife.diamond.json new file mode 100644 index 00000000..a7f606bc --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/knife.diamond.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/knife.diamond" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/knife.gold.json b/src/main/resources/assets/weaponmod/models/item/knife.gold.json new file mode 100644 index 00000000..541fa941 --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/knife.gold.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/knife.gold" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/knife.iron.json b/src/main/resources/assets/weaponmod/models/item/knife.iron.json new file mode 100644 index 00000000..afea52bb --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/knife.iron.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/knife.iron" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/knife.stone.json b/src/main/resources/assets/weaponmod/models/item/knife.stone.json new file mode 100644 index 00000000..27e95f24 --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/knife.stone.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/knife.stone" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/knife.wood.json b/src/main/resources/assets/weaponmod/models/item/knife.wood.json new file mode 100644 index 00000000..ddd566e4 --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/knife.wood.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/knife.wood" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/long_weapons.json b/src/main/resources/assets/weaponmod/models/item/long_weapons.json new file mode 100644 index 00000000..b0fd2c66 --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/long_weapons.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/long_weapons" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/musket-ironpart.json b/src/main/resources/assets/weaponmod/models/item/musket-ironpart.json new file mode 100644 index 00000000..d2c6c8f6 --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/musket-ironpart.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/musket-ironpart" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/musket.json b/src/main/resources/assets/weaponmod/models/item/musket.json new file mode 100644 index 00000000..2349dfca --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/musket.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/musket" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/musketbayonet.diamond.json b/src/main/resources/assets/weaponmod/models/item/musketbayonet.diamond.json new file mode 100644 index 00000000..56cffba6 --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/musketbayonet.diamond.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/musketbayonet.diamond" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/musketbayonet.gold.json b/src/main/resources/assets/weaponmod/models/item/musketbayonet.gold.json new file mode 100644 index 00000000..36e76be1 --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/musketbayonet.gold.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/musketbayonet.gold" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/musketbayonet.iron.json b/src/main/resources/assets/weaponmod/models/item/musketbayonet.iron.json new file mode 100644 index 00000000..baaae375 --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/musketbayonet.iron.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/musketbayonet.iron" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/musketbayonet.json b/src/main/resources/assets/weaponmod/models/item/musketbayonet.json new file mode 100644 index 00000000..4428a6ca --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/musketbayonet.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/musketbayonet" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/musketbayonet.stone.json b/src/main/resources/assets/weaponmod/models/item/musketbayonet.stone.json new file mode 100644 index 00000000..b7c61e05 --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/musketbayonet.stone.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/musketbayonet.stone" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/musketbayonet.wood.json b/src/main/resources/assets/weaponmod/models/item/musketbayonet.wood.json new file mode 100644 index 00000000..ab3dbd24 --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/musketbayonet.wood.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/musketbayonet.wood" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/shot.json b/src/main/resources/assets/weaponmod/models/item/shot.json new file mode 100644 index 00000000..576a8b8a --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/shot.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/shot" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/spear.diamond.json b/src/main/resources/assets/weaponmod/models/item/spear.diamond.json new file mode 100644 index 00000000..0f28a511 --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/spear.diamond.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/spear.diamond" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/spear.gold.json b/src/main/resources/assets/weaponmod/models/item/spear.gold.json new file mode 100644 index 00000000..9eb3748c --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/spear.gold.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/spear.gold" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/spear.iron.json b/src/main/resources/assets/weaponmod/models/item/spear.iron.json new file mode 100644 index 00000000..e6495871 --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/spear.iron.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/spear.iron" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/spear.stone.json b/src/main/resources/assets/weaponmod/models/item/spear.stone.json new file mode 100644 index 00000000..49aa4e8c --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/spear.stone.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/spear.stone" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/spear.wood.json b/src/main/resources/assets/weaponmod/models/item/spear.wood.json new file mode 100644 index 00000000..c64a9112 --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/spear.wood.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/spear.wood" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/warhammer.diamond.json b/src/main/resources/assets/weaponmod/models/item/warhammer.diamond.json new file mode 100644 index 00000000..22b0ae37 --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/warhammer.diamond.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/warhammer.diamond" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/warhammer.gold.json b/src/main/resources/assets/weaponmod/models/item/warhammer.gold.json new file mode 100644 index 00000000..f5b1f211 --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/warhammer.gold.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/warhammer.gold" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/warhammer.iron.json b/src/main/resources/assets/weaponmod/models/item/warhammer.iron.json new file mode 100644 index 00000000..f1f9b6cd --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/warhammer.iron.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/warhammer.iron" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/warhammer.stone.json b/src/main/resources/assets/weaponmod/models/item/warhammer.stone.json new file mode 100644 index 00000000..e3c4d6cb --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/warhammer.stone.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/warhammer.stone" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/weaponmod/models/item/warhammer.wood.json b/src/main/resources/assets/weaponmod/models/item/warhammer.wood.json new file mode 100644 index 00000000..acda1cb5 --- /dev/null +++ b/src/main/resources/assets/weaponmod/models/item/warhammer.wood.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "weaponmod:items/warhammer.wood" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index 52c48592..08c24e72 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -3,8 +3,8 @@ "modid": "weaponmod", "name": "Balkon's WeaponMod", "description": "Throw a spear in a zombie's head!\nCut a skeleton in half with your brand new halberd!\nShoot some slimes in pieces with an old musket!\nAnd more!", - "version": "1.14.3", - "mcversion": "1.7.10", + "version": "1.16.0", + "mcversion": "1.8", "logoFile": "/bwm_logo.png", "url": "www.minecraftforum.net/topic/211517-bwm", "updateUrl": "",