Redo item/block registering

This commit is contained in:
Arcaratus committed 2015-05-27 18:02:09 -04:00
1 parent 22d5902218
commit b7feb8de01
41 files changed
+1376 -234

No files matched your search

@@ -1,5 +1,6 @@
package com.arc.bloodarsenal;
import com.arc.bloodarsenal.entity.ModEntities;
import com.arc.bloodarsenal.entity.ModLivingDropsEvent;
import com.arc.bloodarsenal.gui.GuiHandler;
import com.arc.bloodarsenal.items.ModItems;
@@ -80,11 +81,11 @@ public class BloodArsenal
BloodArsenalConfig.init(new File(event.getModConfigurationDirectory(), "BloodArsenal.cfg"));
ModBlocks.init();
ModBlocks.registerBlocksInPre();
ModBlocks.registerTileEntities();
ModItems.init();
ModItems.registerItems();
ModEntities.init();
Potion[] potionTypes;
@@ -2,11 +2,13 @@ package com.arc.bloodarsenal;
import com.arc.bloodarsenal.block.ModBlocks;
import com.arc.bloodarsenal.entity.EntityBloodTNT;
import com.arc.bloodarsenal.entity.mob.EntityBloodHound;
import com.arc.bloodarsenal.entity.projectile.EntityBloodBall;
import com.arc.bloodarsenal.entity.projectile.EntityGatlingProjectile;
import com.arc.bloodarsenal.items.ModItems;
import com.arc.bloodarsenal.misc.VersionChecker;
import com.arc.bloodarsenal.renderer.block.*;
import com.arc.bloodarsenal.renderer.entity.RenderEntityBloodHound;
import com.arc.bloodarsenal.renderer.item.ItemRenderGatling;
import com.arc.bloodarsenal.renderer.item.RenderBow;
import com.arc.bloodarsenal.renderer.projectile.RenderEntityGatlingProjectile;
@@ -17,6 +19,7 @@ import com.arc.bloodarsenal.tileentity.TilePortableAltar;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
import net.minecraft.client.model.ModelWolf;
import net.minecraft.client.renderer.entity.RenderSnowball;
import net.minecraft.client.renderer.entity.RenderTNTPrimed;
import net.minecraft.item.ItemBlock;
@@ -43,11 +46,13 @@ public class ClientProxy extends CommonProxy
RenderingRegistry.registerEntityRenderingHandler(EntityGatlingProjectile.class, new RenderEntityGatlingProjectile());
RenderingRegistry.registerEntityRenderingHandler(EntityBloodTNT.class, new RenderTNTPrimed());
RenderingRegistry.registerEntityRenderingHandler(EntityBloodBall.class, new RenderSnowball(ModItems.blood_ball));
RenderingRegistry.registerEntityRenderingHandler(EntityBloodHound.class, new RenderEntityBloodHound(new ModelWolf(), new ModelWolf(), 0.5F));
RenderingRegistry.registerBlockHandler(new RenderTileLifeInfuser());
RenderingRegistry.registerBlockHandler(RenderingRegistry.getNextAvailableRenderId(), new RenderTileLifeInfuser());
ClientRegistry.bindTileEntitySpecialRenderer(TilePortableAltar.class, new TilePortableAltarRenderer());
ClientRegistry.bindTileEntitySpecialRenderer(TileLifeInfuser.class, new TileLifeInfuserRenderer());
ShaderHelper.initShaders();
}
@@ -1,6 +1,7 @@
package com.arc.bloodarsenal;
import com.arc.bloodarsenal.entity.EntityBloodTNT;
import com.arc.bloodarsenal.entity.mob.EntityBloodHound;
import com.arc.bloodarsenal.entity.projectile.EntityBloodBall;
import com.arc.bloodarsenal.entity.projectile.EntityGatlingProjectile;
import cpw.mods.fml.common.registry.EntityRegistry;
@@ -18,10 +19,6 @@ public class CommonProxy
//Absolutely nothing
}
public void registerEntities()
{
}
public void registerEvents()
{
}
@@ -31,15 +28,12 @@ public class CommonProxy
return null;
}
public void registerTileEntities()
{
}
public void registerEntityTrackers()
{
EntityRegistry.registerModEntity(EntityGatlingProjectile.class, "gatlingProjectile", 0, BloodArsenal.instance, 128, 5, true);
EntityRegistry.registerModEntity(EntityBloodTNT.class, "bloodTNT", 1, BloodArsenal.instance, 64, 5, true);
EntityRegistry.registerModEntity(EntityBloodBall.class, "bloodBall", 2, BloodArsenal.instance, 128, 5, true);
EntityRegistry.registerModEntity(EntityBloodHound.class, "BloodHound", 3, BloodArsenal.instance, 96, 3, true);
}
public void initRendering()
@@ -26,7 +26,6 @@ public class BlockBloodCake extends Block
public BlockBloodCake()
{
super(Material.cake);
setBlockName("blood_cake");
}
@Override
@@ -1,6 +1,5 @@
package com.arc.bloodarsenal.block;
import com.arc.bloodarsenal.BloodArsenal;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.world.IBlockAccess;
@@ -10,9 +9,6 @@ public class BlockBloodInfusedDiamond extends Block
public BlockBloodInfusedDiamond()
{
super(Material.iron);
setBlockName("blood_infused_diamond_block");
setBlockTextureName("BloodArsenal:blood_infused_diamond_block");
setCreativeTab(BloodArsenal.BA_TAB);
setHardness(10.0F);
setResistance(12.0F);
setStepSound(soundTypeMetal);
@@ -1,6 +1,5 @@
package com.arc.bloodarsenal.block;
import com.arc.bloodarsenal.BloodArsenal;
import com.arc.bloodarsenal.items.ModItems;
import net.minecraft.block.BlockGlowstone;
import net.minecraft.block.material.Material;
@@ -13,9 +12,6 @@ public class BlockBloodInfusedGlowstone extends BlockGlowstone
public BlockBloodInfusedGlowstone()
{
super(Material.glass);
setBlockName("blood_infused_glowstone");
setBlockTextureName("BloodArsenal:blood_infused_glowstone");
setCreativeTab(BloodArsenal.BA_TAB);
setHardness(0.5F);
setResistance(0.75F);
setStepSound(soundTypeGlass);
@@ -1,6 +1,5 @@
package com.arc.bloodarsenal.block;
import com.arc.bloodarsenal.BloodArsenal;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
@@ -9,9 +8,6 @@ public class BlockBloodInfusedPlanks extends Block
public BlockBloodInfusedPlanks()
{
super(Material.wood);
setBlockName("blood_infused_planks");
setBlockTextureName("BloodArsenal:blood_infused_planks");
setCreativeTab(BloodArsenal.BA_TAB);
setHardness(3.0F);
setResistance(6.0F);
setStepSound(soundTypeWood);
@@ -1,6 +1,5 @@
package com.arc.bloodarsenal.block;
import com.arc.bloodarsenal.BloodArsenal;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.BlockRotatedPillar;
@@ -16,8 +15,6 @@ public class BlockBloodInfusedWood extends BlockRotatedPillar
public BlockBloodInfusedWood()
{
super(Material.wood);
setBlockName("blood_infused_wood");
setCreativeTab(BloodArsenal.BA_TAB);
setHardness(3.0F);
setResistance(6.0F);
setStepSound(soundTypeWood);
@@ -1,6 +1,5 @@
package com.arc.bloodarsenal.block;
import com.arc.bloodarsenal.BloodArsenal;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
@@ -9,9 +8,6 @@ public class BlockBloodLamp extends Block
public BlockBloodLamp()
{
super(Material.iron);
setBlockName("blood_lamp");
setBlockTextureName("BloodArsenal:blood_lamp");
setCreativeTab(BloodArsenal.BA_TAB);
setStepSound(soundTypePiston);
setHardness(5.0F);
setResistance(6.0F);
@@ -1,6 +1,5 @@
package com.arc.bloodarsenal.block;
import com.arc.bloodarsenal.BloodArsenal;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.BlockBreakable;
@@ -14,8 +13,6 @@ public class BlockBloodStainedGlass extends BlockBreakable
public BlockBloodStainedGlass()
{
super("blood_stained_glass", Material.glass, false);
setBlockName("blood_stained_glass");
setCreativeTab(BloodArsenal.BA_TAB);
setHardness(1.0F);
setResistance(4.0F);
setStepSound(soundTypeGlass);
@@ -1,6 +1,5 @@
package com.arc.bloodarsenal.block;
import com.arc.bloodarsenal.BloodArsenal;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
@@ -26,9 +25,7 @@ public class BlockBloodStainedIce extends BlockBreakable
{
super("blood_stained_ice", Material.ice, false);
slipperiness = 0.99F;
setBlockName("blood_stained_ice");
setTickRandomly(true);
setCreativeTab(BloodArsenal.BA_TAB);
setLightOpacity(3);
setHardness(1.0F);
setResistance(2.0F);
@@ -1,6 +1,5 @@
package com.arc.bloodarsenal.block;
import com.arc.bloodarsenal.BloodArsenal;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
@@ -12,9 +11,6 @@ public class BlockBloodStainedPackedIce extends Block
{
super(Material.packedIce);
slipperiness = 0.99F;
setBlockName("blood_stained_ice_packed");
setBlockTextureName("BloodArsenal:blood_stained_ice_packed");
setCreativeTab(BloodArsenal.BA_TAB);
setHardness(1.0F);
setResistance(3.0F);
setStepSound(soundTypeGlass);
@@ -1,6 +1,5 @@
package com.arc.bloodarsenal.block;
import com.arc.bloodarsenal.BloodArsenal;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
@@ -24,8 +23,6 @@ public class BlockBloodStone extends Block
public BlockBloodStone()
{
super(Material.iron);
setBlockName("blood_stone");
setCreativeTab(BloodArsenal.BA_TAB);
setHardness(2.0F);
setResistance(5.0F);
setStepSound(soundTypePiston);
@@ -1,6 +1,5 @@
package com.arc.bloodarsenal.block;
import com.arc.bloodarsenal.BloodArsenal;
import com.arc.bloodarsenal.entity.EntityBloodTNT;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -28,8 +27,6 @@ public class BlockBloodTNT extends Block
public BlockBloodTNT()
{
super(Material.tnt);
setBlockName("blood_tnt");
setCreativeTab(BloodArsenal.BA_TAB);
setHardness(0.0F);
setStepSound(soundTypeGrass);
}
@@ -1,6 +1,5 @@
package com.arc.bloodarsenal.block;
import com.arc.bloodarsenal.BloodArsenal;
import net.minecraft.block.BlockTorch;
public class BlockBloodTorch extends BlockTorch
@@ -8,9 +7,6 @@ public class BlockBloodTorch extends BlockTorch
public BlockBloodTorch()
{
super();
setBlockName("blood_torch");
setBlockTextureName("BloodArsenal:blood_torch");
setCreativeTab(BloodArsenal.BA_TAB);
setHardness(0.0F);
setLightLevel(0.9375F);
setStepSound(soundTypeWood);
@@ -25,8 +25,6 @@ public class BlockBurnedString extends Block
{
super(Material.circuits);
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.15625F, 1.0F);
setBlockName("block_burned_string");
setBlockTextureName("BloodArsenal:block_burned_string");
setTickRandomly(true);
}
@@ -3,11 +3,9 @@ package com.arc.bloodarsenal.block;
import WayofTime.alchemicalWizardry.api.rituals.Rituals;
import WayofTime.alchemicalWizardry.common.block.BlockMasterStone;
import WayofTime.alchemicalWizardry.common.items.ActivationCrystal;
import com.arc.bloodarsenal.BloodArsenal;
import com.arc.bloodarsenal.tileentity.TileCompactedMRS;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@@ -16,7 +14,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.Explosion;
import net.minecraft.world.World;
@@ -30,7 +27,6 @@ public class BlockCompactedMRS extends BlockMasterStone
super();
setBlockName("compacted_mrs");
setBlockTextureName("BloodArsenal:compacted_mrs");
setCreativeTab(BloodArsenal.BA_TAB);
setHardness(4.0F);
setResistance(7.5F);
}
@@ -11,7 +11,6 @@ import WayofTime.alchemicalWizardry.common.bloodAltarUpgrade.AltarUpgradeCompone
import WayofTime.alchemicalWizardry.common.bloodAltarUpgrade.UpgradedAltars;
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone;
import com.arc.bloodarsenal.BloodArsenal;
import com.arc.bloodarsenal.tileentity.TileCompactedMRS;
import com.arc.bloodarsenal.tileentity.TileCompacter;
import com.arc.bloodarsenal.tileentity.TilePortableAltar;
@@ -60,9 +59,6 @@ public class BlockCompacter extends BlockContainer
public BlockCompacter()
{
super(Material.iron);
setBlockName("compacter");
setBlockTextureName("BloodArsenal:compacter");
setCreativeTab(BloodArsenal.BA_TAB);
setHardness(8.0F);
setResistance(5.0F);
setStepSound(soundTypeMetal);
@@ -1,9 +1,7 @@
package com.arc.bloodarsenal.block;
import com.arc.bloodarsenal.BloodArsenal;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
import net.minecraft.world.IBlockAccess;
public class BlockInfusedIron extends Block
@@ -11,9 +9,6 @@ public class BlockInfusedIron extends Block
public BlockInfusedIron()
{
super(Material.iron);
setBlockName("blood_infused_iron_block");
setBlockTextureName("BloodArsenal:blood_infused_iron_block");
setCreativeTab(BloodArsenal.BA_TAB);
setHardness(7.5F);
setResistance(5.0F);
setStepSound(soundTypeMetal);
@@ -2,9 +2,7 @@ package com.arc.bloodarsenal.block;
import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb;
import WayofTime.alchemicalWizardry.common.items.EnergyBattery;
import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfHolding;
import com.arc.bloodarsenal.BloodArsenal;
import com.arc.bloodarsenal.tileentity.TileLPMaterializer;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
@@ -26,9 +24,6 @@ public class BlockLPMaterializer extends BlockContainer
public BlockLPMaterializer()
{
super(Material.iron);
setBlockName("lp_materializer");
setBlockTextureName("BloodArsenal:lp_materializer");
setCreativeTab(BloodArsenal.BA_TAB);
setHardness(7.0F);
setResistance(14.0F);
}
@@ -1,13 +1,12 @@
package com.arc.bloodarsenal.block;
import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb;
import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfHolding;
import com.arc.bloodarsenal.BloodArsenal;
import com.arc.bloodarsenal.tileentity.TileLifeInfuser;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
@@ -25,8 +24,6 @@ public class BlockLifeInfuser extends BlockContainer
public BlockLifeInfuser()
{
super(Material.iron);
setBlockName("life_infuser");
setCreativeTab(BloodArsenal.BA_TAB);
setHardness(6.0F);
setResistance(12.0F);
setStepSound(soundTypePiston);
@@ -192,8 +189,7 @@ public class BlockLifeInfuser extends BlockContainer
}
@Override
public boolean hasTileEntity()
{
return true;
public void registerBlockIcons(IIconRegister par1IconRegister) {
// NO-OP
}
}
@@ -4,7 +4,6 @@ import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.api.items.IAltarManipulator;
import WayofTime.alchemicalWizardry.common.items.EnergyBattery;
import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfHolding;
import com.arc.bloodarsenal.BloodArsenal;
import com.arc.bloodarsenal.tileentity.TilePortableAltar;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -41,7 +40,6 @@ public class BlockPortableAltar extends BlockContainer
super(Material.rock);
setHardness(7.0F);
setResistance(10.0F);
setCreativeTab(BloodArsenal.BA_TAB);
setBlockName("portable_altar");
setStepSound(soundTypePiston);
}
@@ -1,11 +1,13 @@
package com.arc.bloodarsenal.block;
import com.arc.bloodarsenal.BloodArsenal;
import com.arc.bloodarsenal.items.block.BloodStoneBlock;
import com.arc.bloodarsenal.items.block.CompactedMRSBlock;
import com.arc.bloodarsenal.items.block.PortableAltarBlock;
import com.arc.bloodarsenal.tileentity.*;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.block.Block;
import net.minecraft.item.ItemBlock;
public class ModBlocks
{
@@ -31,48 +33,25 @@ public class ModBlocks
public static void init()
{
blood_stone = new BlockBloodStone();
blood_tnt = new BlockBloodTNT();
blood_stained_glass = new BlockBloodStainedGlass();
blood_infused_wood = new BlockBloodInfusedWood();
blood_infused_planks = new BlockBloodInfusedPlanks();
blood_stained_ice = new BlockBloodStainedIce();
blood_stained_ice_packed = new BlockBloodStainedPackedIce();
blood_infused_iron_block = new BlockInfusedIron();
blood_cake = new BlockBloodCake();
blood_torch = new BlockBloodTorch();
blood_infused_glowstone = new BlockBloodInfusedGlowstone();
blood_lamp = new BlockBloodLamp();
blood_infused_diamond_block = new BlockBloodInfusedDiamond();
portable_altar = new BlockPortableAltar();
life_infuser = new BlockLifeInfuser();
compacter = new BlockCompacter();
lp_materializer = new BlockLPMaterializer();
compacted_mrs = new BlockCompactedMRS();
block_burned_string = new BlockBurnedString();
}
public static void registerBlocksInPre()
{
GameRegistry.registerBlock(blood_stone, BloodStoneBlock.class, "BloodArsenal" + ModBlocks.blood_stone.getUnlocalizedName().substring(5));
GameRegistry.registerBlock(blood_tnt, "blood_tnt");
GameRegistry.registerBlock(blood_stained_glass, "blood_stained_glass");
GameRegistry.registerBlock(blood_infused_wood, "blood_infused_wood");
GameRegistry.registerBlock(blood_infused_planks, "blood_infused_planks");
GameRegistry.registerBlock(blood_stained_ice, "blood_stained_ice");
GameRegistry.registerBlock(blood_stained_ice_packed, "blood_stained_ice_packed");
GameRegistry.registerBlock(blood_infused_iron_block, "blood_infused_iron_block");
GameRegistry.registerBlock(blood_cake, "blood_cake");
GameRegistry.registerBlock(blood_torch, "blood_torch");
GameRegistry.registerBlock(blood_infused_glowstone, "blood_infused_glowstone");
GameRegistry.registerBlock(blood_lamp, "blood_lamp");
GameRegistry.registerBlock(blood_infused_diamond_block, "blood_infused_diamond_block");
GameRegistry.registerBlock(portable_altar, PortableAltarBlock.class, "BloodArsenal" + ModBlocks.portable_altar.getUnlocalizedName());
GameRegistry.registerBlock(life_infuser, "life_infuser");
GameRegistry.registerBlock(compacter, "compacter");
GameRegistry.registerBlock(lp_materializer, "lp_materializer");
GameRegistry.registerBlock(compacted_mrs, CompactedMRSBlock.class, "BloodArsenal" + ModBlocks.compacted_mrs.getUnlocalizedName());
GameRegistry.registerBlock(block_burned_string, "block_burned_string");
blood_stone = registerBlock(new BlockBloodStone(), BloodStoneBlock.class, "blood_stone");
blood_tnt = registerBlock(new BlockBloodTNT(), "blood_tnt");
blood_stained_glass = registerBlock(new BlockBloodStainedGlass(), "blood_stained_glass");
blood_infused_wood = registerBlock(new BlockBloodInfusedWood(), "blood_infused_wood");
blood_infused_planks = registerBlock(new BlockBloodInfusedPlanks(), "blood_infused_planks");
blood_stained_ice = registerBlock(new BlockBloodStainedIce(), "blood_stained_ice");
blood_stained_ice_packed = registerBlock(new BlockBloodStainedPackedIce(), "blood_stained_ice_packed");
blood_infused_iron_block = registerBlock(new BlockInfusedIron(), "blood_infused_iron_block");
blood_cake = registerBlock(new BlockBloodCake(), "blood_cake");
blood_torch = registerBlock(new BlockBloodTorch(), "blood_torch");
blood_infused_glowstone = registerBlock(new BlockBloodInfusedGlowstone(), "blood_infused_glowstone");
blood_lamp = registerBlock(new BlockBloodLamp(), "blood_lamp");
blood_infused_diamond_block = registerBlock(new BlockBloodInfusedDiamond(), "blood_infused_diamond_block");
portable_altar = (BlockPortableAltar) registerBlock(new BlockPortableAltar(), PortableAltarBlock.class, "portable_altar");
life_infuser = registerBlock(new BlockLifeInfuser(), "life_infuser");
compacter = registerBlock(new BlockCompacter(), "compacter");
lp_materializer = registerBlock(new BlockLPMaterializer(), "lp_materializer");
compacted_mrs = registerBlock(new BlockCompactedMRS(), CompactedMRSBlock.class, "compacted_mrs");
block_burned_string = registerBlock(new BlockBurnedString(), "block_burned_string");
}
public static void registerTileEntities()
@@ -83,4 +62,24 @@ public class ModBlocks
GameRegistry.registerTileEntity(TileLPMaterializer.class, "lp_materializer");
GameRegistry.registerTileEntity(TileCompactedMRS.class, "compacted_mrs");
}
public static Block registerBlock(Block block, String unlocalizedName)
{
block.setBlockName(unlocalizedName);
block.setBlockTextureName(BloodArsenal.MODID + ":" + unlocalizedName);
if (!(block instanceof BlockBloodCake || block instanceof BlockBurnedString))
{
block.setCreativeTab(BloodArsenal.BA_TAB);
}
GameRegistry.registerBlock(block, unlocalizedName);
return block;
}
public static Block registerBlock(Block block, Class<? extends ItemBlock> itemBlockClass, String name)
{
block.setCreativeTab(BloodArsenal.BA_TAB);
GameRegistry.registerBlock(block, itemBlockClass, name);
return block;
}
}
@@ -0,0 +1,15 @@
package com.arc.bloodarsenal.entity;
import com.arc.bloodarsenal.BloodArsenal;
import com.arc.bloodarsenal.entity.mob.EntityBloodHound;
import cpw.mods.fml.common.registry.EntityRegistry;
public class ModEntities
{
public static void init()
{
int id = 0;
}
}
@@ -0,0 +1,156 @@
package com.arc.bloodarsenal.entity.ai;
import net.minecraft.entity.EntityCreature;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.pathfinding.PathEntity;
import net.minecraft.pathfinding.PathPoint;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
public class AIAttackOnCollide extends EntityAIBase
{
World worldObj;
EntityCreature attacker;
int attackTick;
double speedTowardsTarget;
boolean longMemory;
PathEntity entityPathEntity;
Class classTarget;
private int field_75445_i;
private double field_151497_i;
private double field_151495_j;
private double field_151496_k;
private int failedPathFindingPenalty;
public AIAttackOnCollide(EntityCreature p_i1635_1_, Class p_i1635_2_, double p_i1635_3_, boolean p_i1635_5_)
{
this(p_i1635_1_, p_i1635_3_, p_i1635_5_);
this.classTarget = p_i1635_2_;
}
public AIAttackOnCollide(EntityCreature p_i1636_1_, double p_i1636_2_, boolean p_i1636_4_)
{
this.attacker = p_i1636_1_;
this.worldObj = p_i1636_1_.worldObj;
this.speedTowardsTarget = p_i1636_2_;
this.longMemory = p_i1636_4_;
this.setMutexBits(3);
}
@Override
public boolean shouldExecute()
{
EntityLivingBase entitylivingbase = this.attacker.getAttackTarget();
if (entitylivingbase == null)
{
return false;
}
else if (!entitylivingbase.isEntityAlive())
{
return false;
}
else if (this.classTarget != null && !this.classTarget.isAssignableFrom(entitylivingbase.getClass()))
{
return false;
}
else
{
if (-- this.field_75445_i <= 0)
{
this.entityPathEntity = this.attacker.getNavigator().getPathToEntityLiving(entitylivingbase);
this.field_75445_i = 4 + this.attacker.getRNG().nextInt(7);
return this.entityPathEntity != null;
}
else
{
return true;
}
}
}
@Override
public boolean continueExecuting()
{
EntityLivingBase entitylivingbase = this.attacker.getAttackTarget();
return entitylivingbase != null && entitylivingbase.isEntityAlive() && (!this.longMemory ? !this.attacker.getNavigator().noPath() : this.attacker.isWithinHomeDistance(MathHelper.floor_double(entitylivingbase.posX), MathHelper.floor_double(entitylivingbase.posY), MathHelper.floor_double(entitylivingbase.posZ)));
}
@Override
public void startExecuting()
{
this.attacker.getNavigator().setPath(this.entityPathEntity, this.speedTowardsTarget);
this.field_75445_i = 0;
}
@Override
public void resetTask()
{
this.attacker.getNavigator().clearPathEntity();
}
@Override
public void updateTask()
{
EntityLivingBase entitylivingbase = this.attacker.getAttackTarget();
this.attacker.getLookHelper().setLookPositionWithEntity(entitylivingbase, 30.0F, 30.0F);
double d0 = this.attacker.getDistanceSq(entitylivingbase.posX, entitylivingbase.boundingBox.minY, entitylivingbase.posZ);
double d1 = (double)(this.attacker.width * 2.0F * this.attacker.width * 2.0F + entitylivingbase.width);
--this.field_75445_i;
if ((this.longMemory || this.attacker.getEntitySenses().canSee(entitylivingbase)) && this.field_75445_i <= 0 && (this.field_151497_i == 0.0D && this.field_151495_j == 0.0D && this.field_151496_k == 0.0D || entitylivingbase.getDistanceSq(this.field_151497_i, this.field_151495_j, this.field_151496_k) >= 1.0D || this.attacker.getRNG().nextFloat() < 0.05F))
{
this.field_151497_i = entitylivingbase.posX;
this.field_151495_j = entitylivingbase.boundingBox.minY;
this.field_151496_k = entitylivingbase.posZ;
this.field_75445_i = failedPathFindingPenalty + 4 + this.attacker.getRNG().nextInt(7);
if (this.attacker.getNavigator().getPath() != null)
{
PathPoint finalPathPoint = this.attacker.getNavigator().getPath().getFinalPathPoint();
if (finalPathPoint != null && entitylivingbase.getDistanceSq(finalPathPoint.xCoord, finalPathPoint.yCoord, finalPathPoint.zCoord) < 1)
{
failedPathFindingPenalty = 0;
}
else
{
failedPathFindingPenalty += 10;
}
}
else
{
failedPathFindingPenalty += 10;
}
if (d0 > 1024.0D)
{
this.field_75445_i += 10;
}
else if (d0 > 256.0D)
{
this.field_75445_i += 5;
}
if (!this.attacker.getNavigator().tryMoveToEntityLiving(entitylivingbase, this.speedTowardsTarget))
{
this.field_75445_i += 15;
}
}
this.attackTick = Math.max(this.attackTick - 1, 0);
if (d0 <= d1 && this.attackTick <= 20)
{
this.attackTick = 20;
if (this.attacker.getHeldItem() != null)
{
this.attacker.swingItem();
}
this.attacker.attackEntityAsMob(entitylivingbase);
}
}
}
@@ -0,0 +1,128 @@
package com.arc.bloodarsenal.entity.ai;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.entity.passive.EntityTameable;
import net.minecraft.pathfinding.PathNavigate;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
public class AIFollowOwner extends EntityAIBase
{
private EntityTameable thePet;
private EntityLivingBase theOwner;
World theWorld;
private double field_75336_f;
private PathNavigate petPathfinder;
private int field_75343_h;
float maxDist;
float minDist;
private boolean field_75344_i;
public AIFollowOwner(EntityTameable p_i1625_1_, double p_i1625_2_, float p_i1625_4_, float p_i1625_5_)
{
this.thePet = p_i1625_1_;
this.theWorld = p_i1625_1_.worldObj;
this.field_75336_f = p_i1625_2_;
this.petPathfinder = p_i1625_1_.getNavigator();
this.minDist = p_i1625_4_;
this.maxDist = p_i1625_5_;
this.setMutexBits(3);
}
/**
* Returns whether the EntityAIBase should begin execution.
*/
public boolean shouldExecute()
{
EntityLivingBase entitylivingbase = this.thePet.getOwner();
if (entitylivingbase == null)
{
return false;
}
else if (this.thePet.isSitting())
{
return false;
}
else if (this.thePet.getDistanceSqToEntity(entitylivingbase) < (double)(this.minDist * this.minDist))
{
return false;
}
else
{
this.theOwner = entitylivingbase;
return true;
}
}
/**
* Returns whether an in-progress EntityAIBase should continue executing
*/
public boolean continueExecuting()
{
return !this.petPathfinder.noPath() && this.thePet.getDistanceSqToEntity(this.theOwner) > (double)(this.maxDist * this.maxDist) && !this.thePet.isSitting();
}
/**
* Execute a one shot task or start executing a continuous task
*/
public void startExecuting()
{
this.field_75343_h = 0;
this.field_75344_i = this.thePet.getNavigator().getAvoidsWater();
this.thePet.getNavigator().setAvoidsWater(false);
}
/**
* Resets the task
*/
public void resetTask()
{
this.theOwner = null;
this.petPathfinder.clearPathEntity();
this.thePet.getNavigator().setAvoidsWater(this.field_75344_i);
}
/**
* Updates the task
*/
public void updateTask()
{
this.thePet.getLookHelper().setLookPositionWithEntity(this.theOwner, 10.0F, (float)this.thePet.getVerticalFaceSpeed());
if (!this.thePet.isSitting())
{
if (--this.field_75343_h <= 0)
{
this.field_75343_h = 10;
if (!this.petPathfinder.tryMoveToEntityLiving(this.theOwner, this.field_75336_f))
{
if (!this.thePet.getLeashed())
{
if (this.thePet.getDistanceSqToEntity(this.theOwner) >= 144.0D)
{
int i = MathHelper.floor_double(this.theOwner.posX) - 2;
int j = MathHelper.floor_double(this.theOwner.posZ) - 2;
int k = MathHelper.floor_double(this.theOwner.boundingBox.minY);
for (int l = 0; l <= 4; ++l)
{
for (int i1 = 0; i1 <= 4; ++i1)
{
if ((l < 1 || i1 < 1 || l > 3 || i1 > 3) && World.doesBlockHaveSolidTopSurface(this.theWorld, i + l, k - 1, j + i1) && !this.theWorld.getBlock(i + l, k, j + i1).isNormalCube() && !this.theWorld.getBlock(i + l, k + 1, j + i1).isNormalCube())
{
this.thePet.setLocationAndAngles((double)((float)(i + l) + 0.5F), (double)k, (double)((float)(j + i1) + 0.5F), this.thePet.rotationYaw, this.thePet.rotationPitch);
this.petPathfinder.clearPathEntity();
return;
}
}
}
}
}
}
}
}
}
}
@@ -0,0 +1,58 @@
package com.arc.bloodarsenal.entity.ai;
import net.minecraft.entity.EntityCreature;
import net.minecraft.entity.ai.EntityAITarget;
import net.minecraft.util.AxisAlignedBB;
import java.util.Iterator;
import java.util.List;
public class AIHurtByTarget extends EntityAITarget
{
boolean entityCallsForHelp;
private int field_142052_b;
public AIHurtByTarget(EntityCreature p_i1660_1_, boolean p_i1660_2_)
{
super(p_i1660_1_, false);
this.entityCallsForHelp = p_i1660_2_;
this.setMutexBits(1);
}
/**
* Returns whether the EntityAIBase should begin execution.
*/
public boolean shouldExecute()
{
int i = this.taskOwner.func_142015_aE();
return i != this.field_142052_b && this.isSuitableTarget(this.taskOwner.getAITarget(), false);
}
/**
* Execute a one shot task or start executing a continuous task
*/
public void startExecuting()
{
this.taskOwner.setAttackTarget(this.taskOwner.getAITarget());
this.field_142052_b = this.taskOwner.func_142015_aE();
if (this.entityCallsForHelp)
{
double d0 = this.getTargetDistance();
List list = this.taskOwner.worldObj.getEntitiesWithinAABB(this.taskOwner.getClass(), AxisAlignedBB.getBoundingBox(this.taskOwner.posX, this.taskOwner.posY, this.taskOwner.posZ, this.taskOwner.posX + 1.0D, this.taskOwner.posY + 1.0D, this.taskOwner.posZ + 1.0D).expand(d0, 10.0D, d0));
Iterator iterator = list.iterator();
while (iterator.hasNext())
{
EntityCreature entitycreature = (EntityCreature)iterator.next();
if (this.taskOwner != entitycreature && entitycreature.getAttackTarget() == null && !entitycreature.isOnSameTeam(this.taskOwner.getAITarget()))
{
entitycreature.setAttackTarget(this.taskOwner.getAITarget());
}
}
}
super.startExecuting();
}
}
@@ -0,0 +1,52 @@
package com.arc.bloodarsenal.entity.ai;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.util.MathHelper;
public class AILeapAtTarget extends EntityAIBase
{
EntityLiving leaper;
EntityLivingBase leapTarget;
float leapMotionY;
public AILeapAtTarget(EntityLiving entity, float leapMotionY)
{
this.leaper = entity;
this.leapMotionY = leapMotionY;
setMutexBits(5);
}
@Override
public boolean shouldExecute()
{
this.leapTarget = this.leaper.getAttackTarget();
if (this.leapTarget == null)
{
return false;
}
else
{
double d0 = this.leaper.getDistanceSqToEntity(this.leapTarget);
return d0 >= 4.0D && d0 <= 16.0D && this.leaper.onGround && this.leaper.getRNG().nextInt(5) == 0;
}
}
@Override
public boolean continueExecuting()
{
return !this.leaper.onGround;
}
public void startExecuting()
{
double d0 = this.leapTarget.posX - this.leaper.posX;
double d1 = this.leapTarget.posZ - this.leaper.posZ;
float f = MathHelper.sqrt_double(d0 * d0 + d1 * d1);
this.leaper.motionX += d0 / (double)f * 0.5D * 0.800000011920929D + this.leaper.motionX * 0.20000000298023224D;
this.leaper.motionZ += d1 / (double)f * 0.5D * 0.800000011920929D + this.leaper.motionZ * 0.20000000298023224D;
this.leaper.motionY = (double)this.leapMotionY;
}
}
@@ -0,0 +1,61 @@
package com.arc.bloodarsenal.entity.ai;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.ai.EntityAITarget;
import net.minecraft.entity.passive.EntityTameable;
public class AIOwnerHurtByTarget extends EntityAITarget
{
EntityTameable theDefendingTameable;
EntityLivingBase theOwnerAttacker;
private int field_142051_e;
public AIOwnerHurtByTarget(EntityTameable p_i1667_1_)
{
super(p_i1667_1_, false);
this.theDefendingTameable = p_i1667_1_;
this.setMutexBits(1);
}
/**
* Returns whether the EntityAIBase should begin execution.
*/
public boolean shouldExecute()
{
if (!this.theDefendingTameable.isTamed())
{
return false;
}
else
{
EntityLivingBase entitylivingbase = this.theDefendingTameable.getOwner();
if (entitylivingbase == null)
{
return false;
}
else
{
this.theOwnerAttacker = entitylivingbase.getAITarget();
int i = entitylivingbase.func_142015_aE();
return i != this.field_142051_e && this.isSuitableTarget(this.theOwnerAttacker, false) && this.theDefendingTameable.func_142018_a(this.theOwnerAttacker, entitylivingbase);
}
}
}
/**
* Execute a one shot task or start executing a continuous task
*/
public void startExecuting()
{
this.taskOwner.setAttackTarget(this.theOwnerAttacker);
EntityLivingBase entitylivingbase = this.theDefendingTameable.getOwner();
if (entitylivingbase != null)
{
this.field_142051_e = entitylivingbase.func_142015_aE();
}
super.startExecuting();
}
}
@@ -0,0 +1,61 @@
package com.arc.bloodarsenal.entity.ai;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.ai.EntityAITarget;
import net.minecraft.entity.passive.EntityTameable;
public class AIOwnerHurtTarget extends EntityAITarget
{
EntityTameable theEntityTameable;
EntityLivingBase theTarget;
private int field_142050_e;
public AIOwnerHurtTarget(EntityTameable p_i1668_1_)
{
super(p_i1668_1_, false);
this.theEntityTameable = p_i1668_1_;
this.setMutexBits(1);
}
/**
* Returns whether the EntityAIBase should begin execution.
*/
public boolean shouldExecute()
{
if (!this.theEntityTameable.isTamed())
{
return false;
}
else
{
EntityLivingBase entitylivingbase = this.theEntityTameable.getOwner();
if (entitylivingbase == null)
{
return false;
}
else
{
this.theTarget = entitylivingbase.getLastAttacker();
int i = entitylivingbase.getLastAttackerTime();
return i != this.field_142050_e && this.isSuitableTarget(this.theTarget, false) && this.theEntityTameable.func_142018_a(this.theTarget, entitylivingbase);
}
}
}
/**
* Execute a one shot task or start executing a continuous task
*/
public void startExecuting()
{
this.taskOwner.setAttackTarget(this.theTarget);
EntityLivingBase entitylivingbase = this.theEntityTameable.getOwner();
if (entitylivingbase != null)
{
this.field_142050_e = entitylivingbase.getLastAttackerTime();
}
super.startExecuting();
}
}
@@ -0,0 +1,509 @@
package com.arc.bloodarsenal.entity.mob;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.BlockColored;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityAgeable;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.*;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.monster.EntityGhast;
import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.entity.passive.EntityHorse;
import net.minecraft.entity.passive.EntityTameable;
import net.minecraft.entity.passive.EntityWolf;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.pathfinding.PathEntity;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
public class EntityBloodHound extends EntityTameable
{
private float field_70926_e;
private float field_70924_f;
/** true is the wolf is wet else false */
private boolean isShaking;
private boolean field_70928_h;
/** This time increases while wolf is shaking and emitting water particles. */
private float timeWolfIsShaking;
private float prevTimeWolfIsShaking;
public EntityBloodHound(World world)
{
super(world);
setSize(0.9F, 1.2F);
this.tasks.addTask(1, new EntityAISwimming(this));
this.tasks.addTask(2, this.aiSit);
this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F));
this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0D, true));
this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F));
this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this));
this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this));
this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true));
this.setTamed(true);
}
protected void applyEntityAttributes()
{
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30000001192092896D);
if (this.isTamed())
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(20.0D);
}
else
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(8.0D);
}
}
/**
* Returns true if the newer Entity AI code should be run
*/
public boolean isAIEnabled()
{
return true;
}
/**
* Sets the active target the Task system uses for tracking
*/
public void setAttackTarget(EntityLivingBase p_70624_1_)
{
super.setAttackTarget(p_70624_1_);
if (p_70624_1_ == null)
{
this.setAngry(false);
}
else if (!this.isTamed())
{
this.setAngry(true);
}
}
/**
* main AI tick function, replaces updateEntityActionState
*/
protected void updateAITick()
{
this.dataWatcher.updateObject(18, this.getHealth());
}
protected void entityInit()
{
super.entityInit();
this.dataWatcher.addObject(18, this.getHealth());
this.dataWatcher.addObject(19, 0);
this.dataWatcher.addObject(20, BlockColored.func_150032_b(1));
}
protected void func_145780_a(int p_145780_1_, int p_145780_2_, int p_145780_3_, Block p_145780_4_)
{
this.playSound("mob.wolf.step", 0.15F, 1.0F);
}
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(NBTTagCompound p_70014_1_)
{
super.writeEntityToNBT(p_70014_1_);
p_70014_1_.setBoolean("Angry", this.isAngry());
}
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(NBTTagCompound p_70037_1_)
{
super.readEntityFromNBT(p_70037_1_);
this.setAngry(p_70037_1_.getBoolean("Angry"));
}
/**
* Returns the sound this mob makes while it's alive.
*/
protected String getLivingSound()
{
return this.isAngry() ? "mob.wolf.growl" : (this.rand.nextInt(3) == 0 ? (this.isTamed() && this.dataWatcher.getWatchableObjectFloat(18) < 10.0F ? "mob.wolf.whine" : "mob.wolf.panting") : "mob.wolf.bark");
}
/**
* Returns the sound this mob makes when it is hurt.
*/
protected String getHurtSound()
{
return "mob.wolf.hurt";
}
/**
* Returns the sound this mob makes on death.
*/
protected String getDeathSound()
{
return "mob.wolf.death";
}
/**
* Returns the volume for the sounds this mob makes.
*/
protected float getSoundVolume()
{
return 0.4F;
}
protected Item getDropItem()
{
return Item.getItemById(-1);
}
/**
* Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons
* use this to react to sunlight and start to burn.
*/
public void onLivingUpdate()
{
super.onLivingUpdate();
if (!this.worldObj.isRemote && this.isShaking && !this.field_70928_h && !this.hasPath() && this.onGround)
{
this.field_70928_h = true;
this.timeWolfIsShaking = 0.0F;
this.prevTimeWolfIsShaking = 0.0F;
this.worldObj.setEntityState(this, (byte)8);
}
}
/**
* Called to update the entity's position/logic.
*/
public void onUpdate()
{
super.onUpdate();
this.field_70924_f = this.field_70926_e;
if (this.func_70922_bv())
{
this.field_70926_e += (1.0F - this.field_70926_e) * 0.4F;
}
else
{
this.field_70926_e += (0.0F - this.field_70926_e) * 0.4F;
}
if (this.func_70922_bv())
{
this.numTicksToChaseTarget = 10;
}
if (this.isWet())
{
this.isShaking = true;
this.field_70928_h = false;
this.timeWolfIsShaking = 0.0F;
this.prevTimeWolfIsShaking = 0.0F;
}
else if ((this.isShaking || this.field_70928_h) && this.field_70928_h)
{
if (this.timeWolfIsShaking == 0.0F)
{
this.playSound("mob.wolf.shake", this.getSoundVolume(), (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);
}
this.prevTimeWolfIsShaking = this.timeWolfIsShaking;
this.timeWolfIsShaking += 0.05F;
if (this.prevTimeWolfIsShaking >= 2.0F)
{
this.isShaking = false;
this.field_70928_h = false;
this.prevTimeWolfIsShaking = 0.0F;
this.timeWolfIsShaking = 0.0F;
}
if (this.timeWolfIsShaking > 0.4F)
{
float f = (float)this.boundingBox.minY;
int i = (int)(MathHelper.sin((this.timeWolfIsShaking - 0.4F) * (float) Math.PI) * 7.0F);
for (int j = 0; j < i; ++j)
{
float f1 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width * 0.5F;
float f2 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width * 0.5F;
this.worldObj.spawnParticle("splash", this.posX + (double)f1, (double)(f + 0.8F), this.posZ + (double)f2, this.motionX, this.motionY, this.motionZ);
}
}
}
}
@SideOnly(Side.CLIENT)
public boolean getWolfShaking()
{
return this.isShaking;
}
/**
* Used when calculating the amount of shading to apply while the wolf is shaking.
*/
@SideOnly(Side.CLIENT)
public float getShadingWhileShaking(float p_70915_1_)
{
return 0.75F + (this.prevTimeWolfIsShaking + (this.timeWolfIsShaking - this.prevTimeWolfIsShaking) * p_70915_1_) / 2.0F * 0.25F;
}
@SideOnly(Side.CLIENT)
public float getShakeAngle(float p_70923_1_, float p_70923_2_)
{
float f2 = (this.prevTimeWolfIsShaking + (this.timeWolfIsShaking - this.prevTimeWolfIsShaking) * p_70923_1_ + p_70923_2_) / 1.8F;
if (f2 < 0.0F)
{
f2 = 0.0F;
}
else if (f2 > 1.0F)
{
f2 = 1.0F;
}
return MathHelper.sin(f2 * (float)Math.PI) * MathHelper.sin(f2 * (float)Math.PI * 11.0F) * 0.15F * (float)Math.PI;
}
public float getEyeHeight()
{
return this.height * 0.8F;
}
@SideOnly(Side.CLIENT)
public float getInterestedAngle(float p_70917_1_)
{
return (this.field_70924_f + (this.field_70926_e - this.field_70924_f) * p_70917_1_) * 0.15F * (float)Math.PI;
}
/**
* The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently
* use in wolves.
*/
public int getVerticalFaceSpeed()
{
return this.isSitting() ? 20 : super.getVerticalFaceSpeed();
}
/**
* Called when the entity is attacked.
*/
public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_)
{
if (this.isEntityInvulnerable())
{
return false;
}
else
{
Entity entity = p_70097_1_.getEntity();
this.aiSit.setSitting(false);
if (entity != null && !(entity instanceof EntityPlayer) && !(entity instanceof EntityArrow))
{
p_70097_2_ = (p_70097_2_ + 1.0F) / 2.0F;
}
return super.attackEntityFrom(p_70097_1_, p_70097_2_);
}
}
public boolean attackEntityAsMob(Entity p_70652_1_)
{
int i = this.isTamed() ? 4 : 2;
return p_70652_1_.attackEntityFrom(DamageSource.causeMobDamage(this), (float)i);
}
/**
* Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig.
*/
public boolean interact(EntityPlayer p_70085_1_)
{
ItemStack itemstack = p_70085_1_.inventory.getCurrentItem();
if (this.isTamed())
{
if (itemstack != null)
{
if (itemstack.getItem() instanceof ItemFood)
{
ItemFood itemfood = (ItemFood)itemstack.getItem();
if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < 20.0F)
{
if (!p_70085_1_.capabilities.isCreativeMode)
{
--itemstack.stackSize;
}
this.heal((float)itemfood.func_150905_g(itemstack));
if (itemstack.stackSize <= 0)
{
p_70085_1_.inventory.setInventorySlotContents(p_70085_1_.inventory.currentItem, null);
}
return true;
}
}
}
if (this.func_152114_e(p_70085_1_) && !this.worldObj.isRemote && !this.isBreedingItem(itemstack))
{
this.aiSit.setSitting(!this.isSitting());
this.isJumping = false;
this.setPathToEntity(null);
this.setTarget(null);
this.setAttackTarget(null);
}
}
else if (itemstack != null && itemstack.getItem() == Items.bone && !this.isAngry())
{
if (!p_70085_1_.capabilities.isCreativeMode)
{
--itemstack.stackSize;
}
if (itemstack.stackSize <= 0)
{
p_70085_1_.inventory.setInventorySlotContents(p_70085_1_.inventory.currentItem, null);
}
if (!this.worldObj.isRemote)
{
if (this.rand.nextInt(3) == 0)
{
this.setTamed(true);
this.setPathToEntity(null);
this.setAttackTarget(null);
this.aiSit.setSitting(true);
this.setHealth(20.0F);
this.func_152115_b(p_70085_1_.getUniqueID().toString());
this.playTameEffect(true);
this.worldObj.setEntityState(this, (byte)7);
}
else
{
this.playTameEffect(false);
this.worldObj.setEntityState(this, (byte)6);
}
}
return true;
}
return super.interact(p_70085_1_);
}
@SideOnly(Side.CLIENT)
public void handleHealthUpdate(byte p_70103_1_)
{
if (p_70103_1_ == 8)
{
this.field_70928_h = true;
this.timeWolfIsShaking = 0.0F;
this.prevTimeWolfIsShaking = 0.0F;
}
else
{
super.handleHealthUpdate(p_70103_1_);
}
}
@SideOnly(Side.CLIENT)
public float getTailRotation()
{
return this.isAngry() ? 1.5393804F : (this.isTamed() ? (0.55F - (20.0F - this.dataWatcher.getWatchableObjectFloat(18)) * 0.02F) * (float)Math.PI : ((float)Math.PI / 5F));
}
/**
* Will return how many at most can spawn in a chunk at once.
*/
public int getMaxSpawnedInChunk()
{
return 8;
}
/**
* Determines whether this wolf is angry or not.
*/
public boolean isAngry()
{
return (this.dataWatcher.getWatchableObjectByte(16) & 2) != 0;
}
/**
* Sets whether this wolf is angry or not.
*/
public void setAngry(boolean p_70916_1_)
{
byte b0 = this.dataWatcher.getWatchableObjectByte(16);
if (p_70916_1_)
{
this.dataWatcher.updateObject(16, b0 | 2);
}
else
{
this.dataWatcher.updateObject(16, b0 & -3);
}
}
public boolean func_70922_bv()
{
return this.dataWatcher.getWatchableObjectByte(19) == 1;
}
/**
* Determines if an entity can be despawned, used on idle far away entities
*/
protected boolean canDespawn()
{
return !this.isTamed() && this.ticksExisted > 2400;
}
public boolean func_142018_a(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_)
{
if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast))
{
if (p_142018_1_ instanceof EntityWolf)
{
EntityWolf entitywolf = (EntityWolf)p_142018_1_;
if (entitywolf.isTamed() && entitywolf.getOwner() == p_142018_2_)
{
return false;
}
}
return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer)p_142018_2_).canAttackPlayer((EntityPlayer)p_142018_1_) ? false : !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse)p_142018_1_).isTame();
}
else
{
return false;
}
}
public EntityWolf createChild(EntityAgeable p_90011_1_)
{
EntityWolf entitywolf = new EntityWolf(this.worldObj);
return entitywolf;
}
}
@@ -23,13 +23,13 @@ public class ItemBloodArsenal extends Item
public ItemBloodArsenal()
{
super();
setCreativeTab(BloodArsenal.BA_TAB);
// setCreativeTab(BloodArsenal.BA_TAB);
}
@Override
/* @Override
public void registerIcons(IIconRegister iconRegister)
{
/* icons = new IIcon[ITEM_NAMES.length];
icons = new IIcon[ITEM_NAMES.length];
for (int i = 0; i < ITEM_NAMES.length; ++i)
{
@@ -46,8 +46,8 @@ public class ItemBloodArsenal extends Item
}
*/
String unlocalizedName = this.getUnlocalizedName().replaceAll("item.", "");
itemIcon = iconRegister.registerIcon(BloodArsenal.MODID + ":" + unlocalizedName);
// String unlocalizedName = this.getUnlocalizedName().replaceAll("item.", "");
// itemIcon = iconRegister.registerIcon(BloodArsenal.MODID + ":" + unlocalizedName);
/* if (this.equals(ModItems.amorphic_catalyst))
itemIcon = iconRegister.registerIcon("BloodArsenal:amorphic_catalyst");
@@ -71,9 +71,9 @@ public class ItemBloodArsenal extends Item
itemIcon = iconRegister.registerIcon("BloodArsenal:blood_burned_string");
else if (this.equals(ModItems.glass_shard))
itemIcon = iconRegister.registerIcon("BloodArsenal:glass_shard");
*/
}
}
*/
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
@@ -68,107 +68,59 @@ public class ModItems
public static void init()
{
bound_bow = new BoundBow();
blood_orange = new ItemBloodOrange();
blood_infused_pickaxe_wood = new InfusedWoodPickaxe();
blood_infused_axe_wood = new InfusedWoodAxe();
blood_infused_shovel_wood = new InfusedWoodShovel();
blood_infused_sword_wood = new InfusedWoodSword();
amorphic_catalyst = new ItemBloodArsenal().setUnlocalizedName("amorphic_catalyst");
blood_infused_stick = new ItemBloodArsenal().setUnlocalizedName("blood_infused_stick");
bound_sickle = new BoundSickle(AlchemicalWizardry.bloodBoundToolMaterial);
blood_infused_pickaxe_iron = new InfusedIronPickaxe();
blood_infused_axe_iron = new InfusedIronAxe();
blood_infused_shovel_iron = new InfusedIronShovel();
blood_infused_sword_iron = new InfusedIronSword();
blood_infused_iron = new ItemBloodArsenal().setUnlocalizedName("blood_infused_iron");
bound_shears = new BoundShears();
blood_diamond = new InfusedDiamond().setUnlocalizedName("blood_diamond");
blood_infused_diamond_unactive = new InfusedDiamond().setUnlocalizedName("blood_infused_diamond_unactive");
blood_infused_diamond_active = new InfusedDiamond().setUnlocalizedName("blood_infused_diamond_active");
blood_infused_diamond_bound = new InfusedDiamond().setUnlocalizedName("blood_infused_diamond_bound");
blood_infused_pickaxe_diamond = new InfusedDiamondPickaxe();
blood_infused_axe_diamond = new InfusedDiamondAxe();
blood_infused_shovel_diamond = new InfusedDiamondShovel();
blood_infused_sword_diamond = new InfusedDiamondSword();
heart = new ItemBloodArsenal().setUnlocalizedName("heart");
soul_fragment = new ItemBloodArsenal().setUnlocalizedName("soul_fragment");
bound_igniter = new BoundIgniter();
soul_booster = new ItemSoulBooster();
soul_nullifier = new ItemSoulNullifier();
blood_cookie = new ItemBloodCookie();
orange_juice = new ItemBloodArsenal().setUnlocalizedName("orange_juice");
juice_and_cookies = new ItemJuiceAndCookies();
item_blood_cake = new ItemReed(ModBlocks.blood_cake).setUnlocalizedName("item_blood_cake").setTextureName("BloodArsenal:item_blood_cake").setCreativeTab(BloodArsenal.BA_TAB);
vampire_cape = new VampireCostume(1).setUnlocalizedName("vampire_cape");
vampire_greaves = new VampireCostume(2).setUnlocalizedName("vampire_greaves");
vampire_boots = new VampireCostume(3).setUnlocalizedName("vampire_boots");
energy_gatling = new EnergyGatling();
sigil_of_swimming = new SigilSwimming();
sigil_of_ender = new SigilEnder();
blood_infused_glowstone_dust = new ItemBloodArsenal().setUnlocalizedName("blood_infused_glowstone_dust");
sigil_of_divinity = new SigilDivinity();
blood_ball = new ItemBloodBall();
wolf_hide = new ItemBloodArsenal().setUnlocalizedName("wolf_hide");
blood_money = new ItemBloodMoney();
blood_burned_string = new ItemReed(ModBlocks.block_burned_string).setUnlocalizedName("blood_burned_string").setTextureName("BloodArsenal:blood_burned_string").setCreativeTab(BloodArsenal.BA_TAB);
bound_bow = registerItem(new BoundBow(), "bound_bow");
blood_orange = registerItem(new ItemBloodOrange(), "blood_orange");
blood_infused_pickaxe_wood = registerItem(new InfusedWoodPickaxe(), "blood_infused_pickaxe_wood");
blood_infused_axe_wood = registerItem(new InfusedWoodAxe(), "blood_infused_axe_wood");
blood_infused_shovel_wood = registerItem(new InfusedWoodShovel(), "blood_infused_shovel_wood");
blood_infused_sword_wood = registerItem(new InfusedWoodSword(), "blood_infused_sword_wood");
amorphic_catalyst = registerItem(new ItemBloodArsenal(), "amorphic_catalyst");
blood_infused_stick = registerItem(new ItemBloodArsenal(), "blood_infused_stick");
bound_sickle = registerItem(new BoundSickle(AlchemicalWizardry.bloodBoundToolMaterial), "bound_sickle");
blood_infused_pickaxe_iron = registerItem(new InfusedIronPickaxe(), "blood_infused_pickaxe_iron");
blood_infused_axe_iron = registerItem(new InfusedIronAxe(), "blood_infused_axe_iron");
blood_infused_shovel_iron = registerItem(new InfusedIronShovel(), "blood_infused_shovel_iron");
blood_infused_sword_iron = registerItem(new InfusedIronSword(), "blood_infused_sword_iron");
blood_infused_iron = registerItem(new ItemBloodArsenal(), "blood_infused_iron");
bound_shears = registerItem(new BoundShears(), "bound_shears");
blood_diamond = registerItem(new ItemBloodArsenal(), "blood_diamond");
blood_infused_diamond_unactive = registerItem(new InfusedDiamond(), "blood_infused_diamond_unactive");
blood_infused_diamond_active = registerItem(new InfusedDiamond(), "blood_infused_diamond_active");
blood_infused_diamond_bound = registerItem(new InfusedDiamond(), "blood_infused_diamond_bound");
blood_infused_pickaxe_diamond = registerItem(new InfusedDiamondPickaxe(), "blood_infused_pickaxe_diamond");
blood_infused_axe_diamond = registerItem(new InfusedDiamondAxe(), "blood_infused_axe_diamond");
blood_infused_shovel_diamond = registerItem(new InfusedDiamondShovel(), "blood_infused_shovel_diamond");
blood_infused_sword_diamond = registerItem(new InfusedDiamondSword(), "blood_infused_sword_diamond");
heart = registerItem(new ItemBloodArsenal(), "heart");
soul_fragment = registerItem(new ItemBloodArsenal(), "soul_fragment");
bound_igniter = registerItem(new BoundIgniter(), "bound_flint_and_steel");
soul_booster = registerItem(new ItemSoulBooster(), "soul_booster");
soul_nullifier = registerItem(new ItemSoulNullifier(), "soul_nullifier");
blood_cookie = registerItem(new ItemBloodCookie(), "blood_cookie");
orange_juice = registerItem(new ItemBloodArsenal(), "orange_juice");
juice_and_cookies = registerItem(new ItemJuiceAndCookies(), "juice_and_cookies");
item_blood_cake = registerItem(new ItemReed(ModBlocks.blood_cake), "item_blood_cake");
vampire_cape = registerItem(new VampireCostume(1), "vampire_cape");
vampire_greaves = registerItem(new VampireCostume(2), "vampire_greaves");
vampire_boots = registerItem(new VampireCostume(3), "vampire_boots");
energy_gatling = registerItem(new EnergyGatling(), "energy_gatling");
sigil_of_swimming = registerItem(new SigilSwimming(), "sigil_of_swimming");
sigil_of_ender = registerItem(new SigilEnder(), "sigil_of_ender");
blood_infused_glowstone_dust = registerItem(new ItemBloodArsenal(), "blood_infused_glowstone_dust");
sigil_of_divinity = registerItem(new SigilDivinity(), "sigil_of_divinity");
blood_ball = registerItem(new ItemBloodBall(), "blood_ball");
wolf_hide = registerItem(new ItemBloodArsenal(), "wolf_hide");
blood_money = registerItem(new ItemBloodMoney(), "blood_money");
blood_burned_string = registerItem(new ItemReed(ModBlocks.block_burned_string), "blood_burned_string");
glass_shard = registerItem(new ItemBloodArsenal(), "glass_shard");
vampire_ring = new VampireRing();
self_sacrifice_amulet = new SelfSacrificeAmulet();
sacrifice_amulet = new SacrificeAmulet();
glass_shard = new ItemBloodArsenal().setUnlocalizedName("glass_shard");
empowered_sacrifice_amulet = new EmpoweredSacrificeAmulet();
empowered_self_sacrifice_amulet = new EmpoweredSelfSacrificeAmulet();
}
public static void registerItems()
{
GameRegistry.registerItem(bound_bow, "bound_bow");
GameRegistry.registerItem(blood_orange, "blood_orange");
GameRegistry.registerItem(blood_infused_pickaxe_wood, "blood_infused_pickaxe_wood");
GameRegistry.registerItem(blood_infused_axe_wood, "blood_infused_axe_wood");
GameRegistry.registerItem(blood_infused_shovel_wood, "blood_infused_shovel_wood");
GameRegistry.registerItem(blood_infused_sword_wood, "blood_infused_sword_wood");
GameRegistry.registerItem(amorphic_catalyst, "amorphic_catalyst");
GameRegistry.registerItem(blood_infused_stick, "blood_infused_stick");
GameRegistry.registerItem(bound_sickle, "bound_sickle");
GameRegistry.registerItem(blood_infused_pickaxe_iron, "blood_infused_pickaxe_iron");
GameRegistry.registerItem(blood_infused_axe_iron, "blood_infused_axe_iron");
GameRegistry.registerItem(blood_infused_shovel_iron, "blood_infused_shovel_iron");
GameRegistry.registerItem(blood_infused_sword_iron, "blood_infused_sword_iron");
GameRegistry.registerItem(blood_infused_iron, "blood_infused_iron");
GameRegistry.registerItem(bound_shears, "bound_shears");
GameRegistry.registerItem(blood_diamond, "blood_diamond");
GameRegistry.registerItem(blood_infused_diamond_unactive, "blood_infused_diamond_unactive");
GameRegistry.registerItem(blood_infused_diamond_active, "blood_infused_diamond_active");
GameRegistry.registerItem(blood_infused_diamond_bound, "blood_infused_diamond_bound");
GameRegistry.registerItem(blood_infused_pickaxe_diamond, "blood_infused_pickaxe_diamond");
GameRegistry.registerItem(blood_infused_axe_diamond, "blood_infused_axe_diamond");
GameRegistry.registerItem(blood_infused_shovel_diamond, "blood_infused_shovel_diamond");
GameRegistry.registerItem(blood_infused_sword_diamond, "blood_infused_sword_diamond");
GameRegistry.registerItem(heart, "heart");
GameRegistry.registerItem(soul_fragment, "soul_fragment");
GameRegistry.registerItem(item_blood_cake, "item_blood_cake");
GameRegistry.registerItem(bound_igniter, "bound_flint_and_steel");
GameRegistry.registerItem(soul_booster, "soul_booster");
GameRegistry.registerItem(soul_nullifier, "soul_nullfier");
GameRegistry.registerItem(blood_cookie, "blood_cookie");
GameRegistry.registerItem(orange_juice, "orange_juice");
GameRegistry.registerItem(juice_and_cookies, "juice_and_cookies");
GameRegistry.registerItem(vampire_cape, "vampire_cape");
GameRegistry.registerItem(vampire_greaves, "vampire_greaves");
GameRegistry.registerItem(vampire_boots, "vampire_boots");
GameRegistry.registerItem(energy_gatling, "energy_gatling");
GameRegistry.registerItem(sigil_of_swimming, "sigil_of_swimming");
GameRegistry.registerItem(sigil_of_ender, "sigil_of_ender");
GameRegistry.registerItem(blood_infused_glowstone_dust, "blood_infused_glowstone_dust");
GameRegistry.registerItem(sigil_of_divinity, "sigil_of_divinity");
GameRegistry.registerItem(blood_ball, "blood_ball");
GameRegistry.registerItem(wolf_hide, "wolf_hide");
GameRegistry.registerItem(blood_money, "blood_money");
GameRegistry.registerItem(blood_burned_string, "blood_burned_string");
GameRegistry.registerItem(glass_shard, "glass_shard");
}
public static void registerBaubles()
{
GameRegistry.registerItem(vampire_ring, "vampire_ring");
@@ -177,4 +129,13 @@ public class ModItems
GameRegistry.registerItem(empowered_self_sacrifice_amulet, "empowered_self_sacrifice_amulet");
GameRegistry.registerItem(empowered_sacrifice_amulet, "empowered_sacrifice_amulet");
}
public static Item registerItem(Item item, String unlocalizedName)
{
item.setUnlocalizedName(unlocalizedName);
item.setTextureName(BloodArsenal.MODID + ":" + unlocalizedName);
item.setCreativeTab(BloodArsenal.BA_TAB);
GameRegistry.registerItem(item, unlocalizedName);
return item;
}
}
@@ -43,7 +43,7 @@ public class BloodStoneBlock extends ItemBlock
name = "blood_stone";
}
return getUnlocalizedName() + "." + name;
return "tile." + name;
}
@Override
@@ -0,0 +1,21 @@
package com.arc.bloodarsenal.items.tinkers;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
import tconstruct.library.crafting.ModifyBuilder;
public class BloodArsenalModifiers
{
public static void init()
{
}
public static void initModifiers()
{
int craftingConstant = OreDictionary.WILDCARD_VALUE;
ItemStack masterOrb = new ItemStack(WayofTime.alchemicalWizardry.ModItems.masterBloodOrb, 1, craftingConstant);
ModifyBuilder.registerModifier(new ModSoulbound());
}
}
@@ -0,0 +1,97 @@
package com.arc.bloodarsenal.items.tinkers;
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import tconstruct.library.modifier.IModifyable;
import tconstruct.library.modifier.ItemModifier;
import tconstruct.library.tools.ToolCore;
import tconstruct.modifiers.tools.ModBoolean;
import tconstruct.modifiers.tools.ModInteger;
import java.util.ArrayList;
public class ModSoulbound extends ModBoolean
{
public ArrayList<ItemStack> orbs = new ArrayList<ItemStack>();
public int modifiersRequired = 1;
public ModSoulbound()
{
super(new ItemStack[0], 20, "Soulbound", "\u00a74", "Soulbound");
}
@Override
public boolean matches (ItemStack[] input, ItemStack tool)
{
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
String[] traits = ((IModifyable)tool.getItem()).getTraits();
for(String trait : traits)
if("ammo".equals(trait))
return false;
ItemStack foundOrb = null;
for (ItemStack stack : input)
for (ItemStack battery : orbs)
{
if (stack == null)
continue;
if (stack.getItem() != battery.getItem())
continue;
if (!(stack.getItem() instanceof IBloodOrb))
continue;
if (foundOrb != null)
return false;
foundOrb = stack;
}
if (foundOrb == null)
return false;
// otherwise check if we have enough modfiers
else if (tags.getInteger("Modifiers") < modifiersRequired)
return false;
// all requirements satisfied!
return true;
}
@Override
public void modify (ItemStack[] input, ItemStack tool)
{
NBTTagCompound tags = tool.getTagCompound();
// update modifiers (only applies if it's not an upgrade)
if (!tags.hasKey(key))
{
int modifiers = tags.getCompoundTag("InfiTool").getInteger("Modifiers");
modifiers -= modifiersRequired;
tags.getCompoundTag("InfiTool").setInteger("Modifiers", modifiers);
addModifierTip(tool, "\u00a74");
}
tags.getCompoundTag("InfiTool").setBoolean(key, true);
// find the battery in the input
ItemStack inputBattery = null;
for (ItemStack stack : input)
for (ItemStack battery : orbs)
{
if (stack == null)
continue;
if (stack.getItem() != battery.getItem())
continue;
if (!(stack.getItem() instanceof IBloodOrb))
continue;
// we're guaranteed to only find one battery because more are prevented above
inputBattery = stack;
}
tags.setString("Owner", "");
tags.setInteger(key, 1);
}
}
@@ -3,6 +3,7 @@ package com.arc.bloodarsenal.items.tool;
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import com.arc.bloodarsenal.BloodArsenal;
import com.arc.bloodarsenal.entity.mob.EntityBloodHound;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
@@ -230,6 +231,11 @@ public class BoundShears extends ItemShears implements IBindable
return par1ItemStack;
}
if (!par2World.isRemote)
{
par2World.spawnEntityInWorld(new EntityBloodHound(par2World));
}
return par1ItemStack;
}
@@ -0,0 +1,84 @@
package com.arc.bloodarsenal.renderer.entity;
import com.arc.bloodarsenal.entity.mob.EntityBloodHound;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.passive.EntitySheep;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
public class RenderEntityBloodHound extends RenderLiving
{
private static final ResourceLocation wolfTextures = new ResourceLocation("textures/entity/wolf/wolf.png");
private static final ResourceLocation tamedWolfTextures = new ResourceLocation("textures/entity/wolf/wolf_tame.png");
private static final ResourceLocation anrgyWolfTextures = new ResourceLocation("textures/entity/wolf/wolf_angry.png");
public RenderEntityBloodHound(ModelBase p_i1269_1_, ModelBase p_i1269_2_, float p_i1269_3_)
{
super(p_i1269_1_, p_i1269_3_);
this.setRenderPassModel(p_i1269_2_);
}
/**
* Defines what float the third param in setRotationAngles of ModelBase is
*/
protected float handleRotationFloat(EntityBloodHound p_77044_1_, float p_77044_2_)
{
return p_77044_1_.getTailRotation();
}
/**
* Queries whether should render the specified pass or not.
*/
protected int shouldRenderPass(EntityBloodHound p_77032_1_, int p_77032_2_, float p_77032_3_)
{
if (p_77032_2_ == 0 && p_77032_1_.getWolfShaking())
{
float f1 = p_77032_1_.getBrightness(p_77032_3_) * p_77032_1_.getShadingWhileShaking(p_77032_3_);
this.bindTexture(wolfTextures);
GL11.glColor3f(f1, f1, f1);
return 1;
}
else
{
return -1;
}
}
/**
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
*/
protected ResourceLocation getEntityTexture(EntityBloodHound p_110775_1_)
{
return p_110775_1_.isTamed() ? tamedWolfTextures : (p_110775_1_.isAngry() ? anrgyWolfTextures : wolfTextures);
}
/**
* Queries whether should render the specified pass or not.
*/
protected int shouldRenderPass(EntityLivingBase p_77032_1_, int p_77032_2_, float p_77032_3_)
{
return this.shouldRenderPass((EntityBloodHound)p_77032_1_, p_77032_2_, p_77032_3_);
}
/**
* Defines what float the third param in setRotationAngles of ModelBase is
*/
protected float handleRotationFloat(EntityLivingBase p_77044_1_, float p_77044_2_)
{
return this.handleRotationFloat((EntityBloodHound)p_77044_1_, p_77044_2_);
}
/**
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
*/
protected ResourceLocation getEntityTexture(Entity p_110775_1_)
{
return this.getEntityTexture((EntityBloodHound)p_110775_1_);
}
}