Jump to content

NovaViper

Forge Modder
  • Posts

    1061
  • Joined

  • Last visited

Everything posted by NovaViper

  1. And overriding that onEntityCollide method made me teleport to the correct dimension! Thanks for helping me solve that part of the problem. But now I must deal with the main one, why isn't the portal being activated
  2. Huh, didn't know that, let me convert my 1.7.10 code over to 1.8 and put that override in and i'll post my result
  3. There's several problems with it: the portal isn't being activated, and when I manunally get the portal block, it teleports me to the Nether instead of the correct dimension. Also on Github, look around in the 1.7.10 code, I completely scratched out the portal use and changed some things that you will find not making any sense with 1.8 https://github.com/NovaViper/ZeroQuest/tree/master/1.7.10-src/common/zeroquest/dimension https://github.com/NovaViper/ZeroQuest/tree/master/1.7.10-src/common/zeroquest/block/portal
  4. It's under block/portal but here it is incase you can't find it package common.zeroquest.block.portal; import java.util.Random; import common.zeroquest.ModBlocks; import common.zeroquest.ZeroQuest; import net.minecraft.block.Block; import net.minecraft.block.BlockPortal; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyEnum; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; import net.minecraft.server.MinecraftServer; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumParticleTypes; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fml.common.FMLCommonHandler; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public class BlockPortalNillax extends BlockPortal{ public BlockPortalNillax() { super(); this.setStepSound(soundTypeGlass); } @Override public int getLightValue(IBlockAccess world, BlockPos pos){ return 14; } @Override public void onEntityCollidedWithBlock(World world, BlockPos pos, Entity entity){ if(entity.ridingEntity == null && entity.riddenByEntity == null && entity instanceof EntityPlayerMP){ EntityPlayerMP player = (EntityPlayerMP) entity; FMLCommonHandler.instance().getMinecraftServerInstance(); MinecraftServer server = MinecraftServer.getServer(); if(player.timeUntilPortal > 0){ player.timeUntilPortal = 10; }else if(player.dimension != ZeroQuest.NillaxID){ player.timeUntilPortal = 10; player.mcServer.getConfigurationManager().transferPlayerToDimension(player, ZeroQuest.NillaxID, new TeleporterNillax(server.worldServerForDimension(ZeroQuest.NillaxID), false)); }else{ player.timeUntilPortal = 10; player.mcServer.getConfigurationManager().transferPlayerToDimension(player, 0, new TeleporterNillax(server.worldServerForDimension(0), false)); } } } @Override public boolean func_176548_d(World par1World, BlockPos blockPos) //func_176548_d { byte b0 = 0; byte b1 = 0; int par2= blockPos.getX(); int par3= blockPos.getY(); int par4= blockPos.getZ(); if (par1World.getBlockState(new BlockPos(par2 - 1, par3, par4)).getBlock() == ModBlocks.darkaxStone || par1World.getBlockState(new BlockPos(par2 + 1, par3, par4)).getBlock() == ModBlocks.darkaxStone) { b0 = 1; } if (par1World.getBlockState(new BlockPos(par2, par3, par4 - 1)).getBlock() == ModBlocks.darkaxStone || par1World.getBlockState(new BlockPos(par2, par3, par4 + 1)).getBlock() == ModBlocks.darkaxStone) { b1 = 1; } if (b0 == b1) { return false; } else { if (par1World.isAirBlock(new BlockPos(par2 - b0, par3, par4 - b1))) { par2 -= b0; par4 -= b1; } int l; int i1; for (l = -1; l <= 2; ++l) { for (i1 = -1; i1 <= 3; ++i1) { boolean flag = l == -1 || l == 2 || i1 == -1 || i1 == 3; if (l != -1 && l != 2 || i1 != -1 && i1 != 3) { Block j1 = par1World.getBlockState(new BlockPos(par2 + b0 * l, par3 + i1, par4 + b1 * l)).getBlock(); boolean isAirBlock = par1World.isAirBlock(new BlockPos(par2 + b0 * l, par3 + i1, par4 + b1 * l)); if (flag) { if (j1 != ModBlocks.darkaxStone) { return false; } } else if (!isAirBlock && j1 != ModBlocks.darkFire) { return false; } } } } for (l = 0; l < 2; ++l) { for (i1 = 0; i1 < 3; ++i1) { par1World.setBlockState(new BlockPos(par2 + b0 * l, par3 + i1, par4 + b1 * l), ModBlocks.portalDarkax.getDefaultState()); } } return true; } } @Override public void randomDisplayTick(World worldIn, BlockPos pos, IBlockState state, Random rand) { int par2= pos.getX(); int par3= pos.getY(); int par4= pos.getZ(); if (rand.nextInt(100) == 0) { worldIn.playSound((double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, "portal.portal", 0.5F, rand.nextFloat() * 0.4F + 0.8F, false); } for (int i = 0; i < 4; ++i) { double d0 = (double)((float)pos.getX() + rand.nextFloat()); double d1 = (double)((float)pos.getY() + rand.nextFloat()); double d2 = (double)((float)pos.getZ() + rand.nextFloat()); double d3 = ((double)rand.nextFloat() - 0.5D) * 0.5D; double d4 = ((double)rand.nextFloat() - 0.5D) * 0.5D; double d5 = ((double)rand.nextFloat() - 0.5D) * 0.5D; int j = rand.nextInt(2) * 2 - 1; if (worldIn.getBlockState(pos.west()).getBlock() != this && worldIn.getBlockState(pos.east()).getBlock() != this) { d0 = (double)pos.getX() + 0.5D + 0.25D * (double)j; d3 = (double)(rand.nextFloat() * 2.0F * (float)j); } else { d2 = (double)pos.getZ() + 0.5D + 0.25D * (double)j; d5 = (double)(rand.nextFloat() * 2.0F * (float)j); } worldIn.spawnParticle(EnumParticleTypes.PORTAL, d0, d1, d2, d3, d4, d5, new int[0]); } } @Override public void onNeighborBlockChange(World par1World, BlockPos blockPos, IBlockState state, Block neighborBlock) { byte b0 = 0; byte b1 = 1; int par2= blockPos.getX(); int par3= blockPos.getY(); int par4= blockPos.getZ(); if (par1World.getBlockState(new BlockPos(par2 - 1, par3, par4)) == this || par1World.getBlockState(new BlockPos(par2 + 1, par3, par4)) == this) { b0 = 1; b1 = 0; } int i1; for (i1 = par3; par1World.getBlockState(new BlockPos(par2, i1 - 1, par4)) == this; --i1) { ; } if (par1World.getBlockState(new BlockPos(par2, i1 - 1, par4)) != ModBlocks.darkaxStone) { par1World.setBlockToAir(new BlockPos(par2, par3, par4)); } else { int j1; for (j1 = 1; j1 < 4 && par1World.getBlockState(new BlockPos(par2, i1 + j1, par4)) == this; ++j1) { ; } if (j1 == 3 && par1World.getBlockState(new BlockPos(par2, i1 + j1, par4)) == ModBlocks.darkaxStone) { boolean flag = par1World.getBlockState(new BlockPos(par2 - 1, par3, par4)) == this || par1World.getBlockState(new BlockPos(par2 + 1, par3, par4)) == this; boolean flag1 = par1World.getBlockState(new BlockPos(par2, par3, par4 - 1)) == this || par1World.getBlockState(new BlockPos(par2, par3, par4 + 1)) == this; if (flag && flag1) { par1World.setBlockToAir(new BlockPos(par2, par3, par4)); } else { if ((par1World.getBlockState(new BlockPos(par2 + b0, par3, par4 + b1)) != ModBlocks.darkaxStone || par1World.getBlockState(new BlockPos(par2 - b0, par3, par4 - b1)) != this) && (par1World.getBlockState(new BlockPos(par2 - b0, par3, par4 - b1)) != ModBlocks.darkaxStone || par1World.getBlockState(new BlockPos(par2 + b0, par3, par4 + b1)) != this)) { par1World.setBlockToAir(new BlockPos(par2, par3, par4)); } } } else { par1World.setBlockToAir(new BlockPos(par2, par3, par4)); } } } }
  5. Ok, I'm asking everyone who is modding 1.8 if you have made any kind of rewrite of to your custom portals and dimensions AND has had success with getting them to work correctly. If anyone has, please respond to this or PM and show me your code or at least explain how you fixed it. I WILL give them full credit to the code also. If you need to see my code, it is on Github with latest changes: https://github.com/NovaViper/ZeroQuest/tree/master/src/main
  6. Hey, I still can't figure out why the boolean is getting stuck at true
  7. Sorry for taking so long to respond, I was trying to fix a memory leak with my packets. But yeah, it's still a little choppy but not as bad now with the new code. Also I'm having trouble toggling the sprinting. Whenever I press the key that tells it to sprint, it sprints but the animation gets stuck sprinting and it seems to be the boolean getting fixed on true Packet package common.zeroquest.network.imessage; import io.netty.buffer.ByteBuf; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; 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 common.zeroquest.entity.EntityZertumEntity; public class ZertumSprint implements IMessage{ public int entityId; public ZertumSprint(){} public ZertumSprint(int entityId) { this.entityId = entityId; } @Override public void fromBytes(ByteBuf buf) { entityId = buf.readInt(); } @Override public void toBytes(ByteBuf buf) { buf.writeInt(this.entityId); } public static class Handler implements IMessageHandler<ZertumSprint, IMessage> { public Handler(){} @Override public IMessage onMessage(ZertumSprint message, MessageContext ctx) { Entity target = ctx.getServerHandler().playerEntity.worldObj.getEntityByID(message.entityId); if(!(target instanceof EntityZertumEntity)) return null; EntityZertumEntity dog = (EntityZertumEntity)target; if(dog.riddenByEntity != null) dog.setDashing(true); return message; } } } KeyState package common.zeroquest.core.handlers; import java.util.HashMap; import net.minecraft.client.Minecraft; import net.minecraft.client.settings.KeyBinding; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.fml.client.FMLClientHandler; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent; import net.minecraftforge.fml.common.gameevent.TickEvent.Phase; import org.lwjgl.input.Keyboard; import common.zeroquest.ModItems; import common.zeroquest.entity.EntityJakan; import common.zeroquest.entity.EntityKortor; import common.zeroquest.entity.EntityZertumEntity; import common.zeroquest.network.PacketHandler; import common.zeroquest.network.imessage.JakanJump; import common.zeroquest.network.imessage.KortorJump; import common.zeroquest.network.imessage.SealCommand; import common.zeroquest.network.imessage.ZertumJump; import common.zeroquest.network.imessage.ZertumSprint; /** * @author ProPercivalalb **/ public class KeyStateHandler { public static final KeyBinding come = new KeyBinding("zeroquest.key.come", Keyboard.KEY_W, "key.categories.zeroquest"); public static final KeyBinding stay = new KeyBinding("zeroquest.key.stay", Keyboard.KEY_S, "key.categories.zeroquest"); public static final KeyBinding ok = new KeyBinding("zeroquest.key.ok", Keyboard.KEY_D, "key.categories.zeroquest"); public static final KeyBinding heel = new KeyBinding("zeroquest.key.heel", Keyboard.KEY_A, "key.categories.zeroquest"); public static final KeyBinding sprint = new KeyBinding("zeroquest.key.sprint", Keyboard.KEY_Z, "key.categories.zeroquest"); public static final KeyBinding[] keyBindings = new KeyBinding[] {come, stay, ok, heel, sprint, Minecraft.getMinecraft().gameSettings.keyBindJump}; private HashMap<KeyBinding, Boolean> keyState = new HashMap<KeyBinding, Boolean>(); private Minecraft mc = Minecraft.getMinecraft(); @SubscribeEvent public void keyEvent(ClientTickEvent event) { this.keyTick(event.phase == Phase.END); } private void keyTick(boolean tickEnd) { for(KeyBinding kb : keyBindings) { if(kb.isKeyDown()) { if (!tickEnd && (!this.keyState.containsKey(kb) || !this.keyState.get(kb))) { this.keyState.put(kb, true); //Key Pressed EntityPlayer player = FMLClientHandler.instance().getClientPlayerEntity(); if(kb == mc.gameSettings.keyBindJump) { if(player.ridingEntity instanceof EntityZertumEntity && mc.currentScreen == null) { EntityZertumEntity dog = (EntityZertumEntity)player.ridingEntity; PacketHandler.sendToServer(new ZertumJump(dog.getEntityId())); } else if(player.ridingEntity instanceof EntityJakan && mc.currentScreen == null) { EntityJakan dog = (EntityJakan)player.ridingEntity; PacketHandler.sendToServer(new JakanJump(dog.getEntityId())); } else if(player.ridingEntity instanceof EntityKortor && mc.currentScreen == null) { EntityKortor dog = (EntityKortor)player.ridingEntity; PacketHandler.sendToServer(new KortorJump(dog.getEntityId())); } } else if(kb == sprint) { if(player.ridingEntity instanceof EntityZertumEntity && mc.currentScreen == null) { EntityZertumEntity dog = (EntityZertumEntity)player.ridingEntity; PacketHandler.sendToServer(new ZertumSprint(dog.getEntityId())); } } else if(FMLClientHandler.instance().getClient().inGameHasFocus && player != null && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == ModItems.commandSeal) { int command = -1; if(kb == come) { command = 1; } else if(kb == stay) { command = 2; } else if(kb == ok) { command = 3; } else if(kb == heel) { command = 4; } if(command != -1) PacketHandler.sendToServer(new SealCommand(command)); } } else if(!tickEnd) { //Key Released } } else { this.keyState.put(kb, false); } } } } Model package common.zeroquest.client.renderer.entity.model; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.util.MathHelper; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import org.lwjgl.opengl.GL11; import common.zeroquest.entity.EntityZertumEntity; @SideOnly(Side.CLIENT) public class ModelZertum extends ModelBase { //fields ModelRenderer Nose; ModelRenderer Ear2; ModelRenderer Ear1; ModelRenderer Head; ModelRenderer LeftHindLeg1; ModelRenderer LeftHindLeg2; ModelRenderer LeftHindLeg3; ModelRenderer RightHindLeg1; ModelRenderer RightHindLeg2; ModelRenderer RightHindLeg3; ModelRenderer Mane1; ModelRenderer RightLeg; ModelRenderer LeftLeg; ModelRenderer Tail1; ModelRenderer Tail2; ModelRenderer Tail3; ModelRenderer Mane2; ModelRenderer Torso; ModelRenderer Neck; ModelRenderer Pad1; ModelRenderer Pad2; ModelRenderer Pad3; ModelRenderer Pad4; ModelRenderer PadPart1; ModelRenderer PadPart2; ModelRenderer Rope1; ModelRenderer Metal1; ModelRenderer Rope2; ModelRenderer Metal2; ModelRenderer Seat1; ModelRenderer Seat2; private float rightFemur = -0.2974289F; private float leftFemur = -0.2974289F; private float rightTibia = 0.8205006F; private float leftTibia = 0.8205006F; private float rightMetatarus = -0.5205006F; private float leftMetatarus = -0.5205006F; private float mane2StartingRotation = -0.34653F; private float vertebrae = -0.6015813F; //Evolved Model\\ ModelRenderer Throat; ModelRenderer UpSection; ModelRenderer MidSection; ModelRenderer Pelvis; ModelRenderer TailPart1; ModelRenderer TailPart2; ModelRenderer TailPart3; ModelRenderer LeftHumerus; ModelRenderer LeftRadius; ModelRenderer LeftFClawRPart1; ModelRenderer LeftFClawRPart2; ModelRenderer LeftFClawMPart1; ModelRenderer LeftFClawMPart2; ModelRenderer LeftFClawLPart1; ModelRenderer LeftFClawLPart2; ModelRenderer RightHumerus; ModelRenderer RightRadius; ModelRenderer RightFClawRPart1; ModelRenderer RightFClawRPart2; ModelRenderer RightFClawMPart1; ModelRenderer RightFClawMPart2; ModelRenderer RightFClawLPart1; ModelRenderer RightFClawLPart2; ModelRenderer LeftFemur; ModelRenderer LeftTibia; ModelRenderer LeftMetatarsus; ModelRenderer LeftClawRPart1; ModelRenderer LeftClawRPart2; ModelRenderer LeftClawLPart1; ModelRenderer LeftClawLPart2; ModelRenderer LeftClawMPart1; ModelRenderer LeftClawMPart2; ModelRenderer RightFemur; ModelRenderer RightTibia; ModelRenderer RightMetatarsus; ModelRenderer RightClawRPart1; ModelRenderer RightClawRPart2; ModelRenderer RightClawMPart1; ModelRenderer RightClawMPart2; ModelRenderer RightClawLPart1; ModelRenderer RightClawLPart2; ModelRenderer RightEarPart1; ModelRenderer LeftBottomJaw; ModelRenderer RightEarPart2; ModelRenderer BottomJawPart1; ModelRenderer RightEarPart3; ModelRenderer BottomJawPart2; ModelRenderer LeftEarPart1; ModelRenderer BottomJawCenter; ModelRenderer LeftEarPart2; ModelRenderer LeftTopTeeth; ModelRenderer LeftEarPart3; ModelRenderer LeftTopJaw; ModelRenderer LeftBottomTeeth; ModelRenderer RightTopTeeth; ModelRenderer RightBottomTeeth; ModelRenderer TopJawPart1; ModelRenderer TopJawPart2; ModelRenderer TopJawCenter; ModelRenderer RightTopJaw; ModelRenderer RightBottomJaw; ModelRenderer EPad1; ModelRenderer EPad2; ModelRenderer EPad3; ModelRenderer EPad4; ModelRenderer EPadPart1; ModelRenderer EPadPart2; ModelRenderer ERope1; ModelRenderer EMetal1; ModelRenderer ERope2; ModelRenderer EMetal2; ModelRenderer ESeat1; ModelRenderer ESeat2; // create an animation cycle // for movement based animations you need to measure distance moved // and perform number of cycles per block distance moved. protected double distanceMovedTotal = 0.0D; // don't make this too large or animations will be skipped protected static final double CYCLES_PER_BLOCK = 1.3D; protected int cycleIndex = 0; protected float[][] undulationCycle = new float[][] { {-32, -27, -22, -18, -15, -12, -9, -6, -3, 0, 3, 6, 9, 12, 15, 18, 22, 27, 32, 27, 22, 18, 15, 12, 9, 6, 3, 0, -3, -6, -9, -12, -15, -18, -22, -27, -32}, {0, 3, 6, 9, 12, 15, 18, 22, 27, 32, 27, 22, 18, 15, 12, 9, 6, 3, 0, -3, -6, -9, -12, -15, -18, -22, -27, -32}, {-32, -27, -22, -18, -15, -12, -9, -6, -3, 0, 3, 6, 9, 12, 15, 18, 22, 27, 32, 27, 22, 18, 15, 12, 9, 6, 3, 0, -3, -6, -9, -12, -15, -18, -22, -27, -32}, {0, 3, 6, 9, 12, 15, 18, 22, 27, 32, 27, 22, 18, 15, 12, 9, 6, 3, 0, -3, -6, -9, -12, -15, -18, -22, -27, -32}, }; public ModelZertum() { textureWidth = 256; textureHeight = 128; Nose = new ModelRenderer(this, 25, 27); Nose.addBox(-1.5F, 0F, -3F, 3, 3, 4); Nose.setRotationPoint(0F, 2.5F, -15F); setRotation(Nose, 0F, 0F, 0F); Ear2 = new ModelRenderer(this, 40, 28); Ear2.addBox(-1F, -3F, 0F, 2, 3, 1); Ear2.setRotationPoint(2F, -0.5F, -10.5F); setRotation(Ear2, 0F, 0F, 0F); Ear1 = new ModelRenderer(this, 40, 28); Ear1.addBox(-1F, -3F, 0F, 2, 3, 1); Ear1.setRotationPoint(-2F, -0.5F, -10.5F); setRotation(Ear1, 0F, 0F, 0F); Head = new ModelRenderer(this, 25, 15); Head.addBox(-3F, -0.5F, -14F, 6, 6, 5); Head.setRotationPoint(-0.5F, 6F, -3F); setRotation(Head, 0F, 0F, 0F); LeftHindLeg1 = new ModelRenderer(this, 11, 18); LeftHindLeg1.addBox(-1F, 0F, -1F, 2, 5, 3); LeftHindLeg1.setRotationPoint(1.5F, 13F, 5F); setRotation(LeftHindLeg1, -0.2974289F, 0F, 0F); LeftHindLeg2 = new ModelRenderer(this, 3, 44); LeftHindLeg2.addBox(-1F, 0F, -1F, 2, 4, 2); LeftHindLeg2.setRotationPoint(0F, 4.3F, -0.3F); setRotation(LeftHindLeg2, leftTibia, 0F, 0F); LeftHindLeg3 = new ModelRenderer(this, 0, 51); LeftHindLeg3.addBox(-1F, 0F, -1F, 2, 4, 2); LeftHindLeg3.setRotationPoint(0F, 3.55F, 0.2F); setRotation(LeftHindLeg3, leftMetatarus, 0F, 0F); RightHindLeg1 = new ModelRenderer(this, 11, 31); RightHindLeg1.addBox(-1F, 0F, -1F, 2, 5, 3); RightHindLeg1.setRotationPoint(-2.5F, 13F, 5F); setRotation(RightHindLeg1, -0.2974289F, 0F, 0F); RightHindLeg2 = new ModelRenderer(this, 3, 44); RightHindLeg2.addBox(-1F, 0F, -1F, 2, 4, 2); RightHindLeg2.setRotationPoint(0F, 4.3F, -0.3F); setRotation(RightHindLeg2, rightTibia, 0F, 0F); RightHindLeg3 = new ModelRenderer(this, 9, 51); RightHindLeg3.addBox(-1F, 0F, -1F, 2, 4, 2); RightHindLeg3.setRotationPoint(0F, 3.55F, 0.2F); setRotation(RightHindLeg3, rightMetatarus, 0F, 0F); Mane1 = new ModelRenderer(this, 43, 0); Mane1.addBox(-3F, -3F, -3F, 6, 6, 7); Mane1.setRotationPoint(-0.5F, 14F, -3F); setRotation(Mane1, 1.496439F, 0F, 0F); Neck = new ModelRenderer(this, 0, 0); Neck.addBox(-2.5F, -12F, -4F, 4, 7, 4); Neck.setRotationPoint(0.5F, 0F, 0F); setRotation(Neck, -0.6015813F, 0F, 0F); Mane2 = new ModelRenderer(this, 18, 0); Mane2.addBox(-2.5F, -7F, -3.6F, 5, 6, 7); Mane2.setRotationPoint(0F, 0F, 0F); setRotation(Mane2, -0.34653F, 0F, 0F); RightLeg = new ModelRenderer(this, 0, 30); RightLeg.addBox(-1F, 0F, -1F, 2, 10, 2); RightLeg.setRotationPoint(-3F, 14F, -4F); setRotation(RightLeg, 0F, 0F, 0F); LeftLeg = new ModelRenderer(this, 0, 16); LeftLeg.addBox(-1F, 0F, -1F, 2, 10, 2); LeftLeg.setRotationPoint(2F, 14F, -4F); setRotation(LeftLeg, 0F, 0F, 0F); Tail1 = new ModelRenderer(this, 91, 0); Tail1.addBox(-1.5F, 0F, -1F, 4, 8, 4); Tail1.setRotationPoint(-1F, 14.3F, 6F); setRotation(Tail1, 1.315962F, 0F, 0F); Tail2 = new ModelRenderer(this, 110, 0); Tail2.addBox(-1.5F, 0F, -1F, 3, 8, 3); Tail2.setRotationPoint(0.5F, 6F, 0.5F); setRotation(Tail2, -0.041605F, 0F, 0F); Tail3 = new ModelRenderer(this, 110, 13); Tail3.addBox(-1F, 0F, -1F, 2, 8, 2); Tail3.setRotationPoint(0F, 6.5F, 0.5F); setRotation(Tail3, 0.001605F, 0F, 0F); Torso = new ModelRenderer(this, 69, 0); Torso.addBox(-2.5F, -3F, -3F, 5, 9, 5); Torso.setRotationPoint(-0.5F, 12.5F, 1F); setRotation(Torso, 1.496439F, 0F, 0F); //Saddle\\ Pad1 = new ModelRenderer(this, 110, 32); Pad1.addBox(-2F, 0F, 0F, 4, 1, 1); Pad1.setRotationPoint(-0.5F, 9.3F, -2.5F); setRotation(Pad1, -0.0650564F, 0F, 0F); Pad2 = new ModelRenderer(this, 110, 35); Pad2.addBox(-3F, 0F, 0F, 6, 1, 2); Pad2.setRotationPoint(-0.5F, 9.4F, -1.5F); setRotation(Pad2, -0.0743572F, 0F, 0F); Pad3 = new ModelRenderer(this, 110, 39); Pad3.addBox(-2F, 0F, 0F, 5, 1, 4); Pad3.setRotationPoint(-1F, 9.5F, 0.2F); setRotation(Pad3, -0.0650564F, 0F, 0F); Pad4 = new ModelRenderer(this, 110, 48); Pad4.addBox(-1.5F, 0F, 0F, 3, 1, 1); Pad4.setRotationPoint(-0.5F, 9.8F, 4.1F); setRotation(Pad4, -0.0650564F, 0F, 0F); PadPart1 = new ModelRenderer(this, 110, 29); PadPart1.addBox(-0.5F, 0F, 0F, 1, 1, 1); PadPart1.setRotationPoint(1F, 9.23F, -3.5F); setRotation(PadPart1, -0.0650564F, 0F, 0F); PadPart2 = new ModelRenderer(this, 110, 29); PadPart2.addBox(-0.5F, 0F, 0F, 1, 1, 1); PadPart2.setRotationPoint(-2F, 9.2F, -3.5F); setRotation(PadPart2, -0.0650564F, 0F, 0F); Rope1 = new ModelRenderer(this, 105, 32); Rope1.addBox(0F, 0F, -0.5F, 1, 4, 1); Rope1.setRotationPoint(1.8F, 9.6F, 0F); setRotation(Rope1, 0F, 0F, 0F); Metal1 = new ModelRenderer(this, 102, 39); Metal1.addBox(0F, 0F, -1F, 1, 1, 2); Metal1.setRotationPoint(1.8F, 13.6F, 0F); setRotation(Metal1, 0F, 0F, 0F); Rope2 = new ModelRenderer(this, 105, 32); Rope2.addBox(-1F, 0F, -0.5F, 1, 4, 1); Rope2.setRotationPoint(-2.8F, 9.6F, 0F); setRotation(Rope2, 0F, 0F, 0F); Metal2 = new ModelRenderer(this, 102, 39); Metal2.addBox(0F, 0F, -1F, 1, 1, 2); Metal2.setRotationPoint(-3.8F, 13.6F, 0F); setRotation(Metal2, 0F, 0F, 0F); Seat1 = new ModelRenderer(this, 100, 45); Seat1.addBox(-1F, 0F, 0F, 2, 1, 1); Seat1.setRotationPoint(-0.5F, 8.7F, -1.5F); setRotation(Seat1, -0.0650484F, 0F, 0F); Seat2 = new ModelRenderer(this, 100, 49); Seat2.addBox(-2F, 0F, 0F, 4, 1, 1); Seat2.setRotationPoint(-0.5F, 9F, 3.2F); setRotation(Seat2, -0.0650484F, 0F, 0F); Head.addChild(Nose); Head.addChild(Ear1); Head.addChild(Ear2); LeftHindLeg1.addChild(LeftHindLeg2); RightHindLeg1.addChild(RightHindLeg2); LeftHindLeg2.addChild(LeftHindLeg3); RightHindLeg2.addChild(RightHindLeg3); Mane1.addChild(Mane2); Mane1.addChild(Neck); Tail1.addChild(Tail2); Tail2.addChild(Tail3); //Ears\\ RightEarPart1 = new ModelRenderer(this, 18, 60); RightEarPart1.addBox(-1F, -1F, -1F, 1, 1, 4); RightEarPart1.setRotationPoint(-1.5F, 1.5F, -5F); RightEarPart1.setTextureSize(256, 128); setRotation(RightEarPart1, 0.0346075F, -0.3346075F, 0F); RightEarPart2 = new ModelRenderer(this, 15, 66); RightEarPart2.addBox(-1F, -1F, 0F, 2, 2, 6); RightEarPart2.setRotationPoint(-0.5F, -0.5F, 0F); RightEarPart2.setTextureSize(256, 128); setRotation(RightEarPart2, 0.3346075F, -0.0346075F, 0F); RightEarPart3 = new ModelRenderer(this, 16, 75); RightEarPart3.addBox(-0.5F, -0.5F, 0F, 1, 1, 6); RightEarPart3.setRotationPoint(-0.5F, 0F, 4F); RightEarPart3.setTextureSize(256, 128); setRotation(RightEarPart3, 0.0346075F, 0.4115358F, 0.0743572F); LeftEarPart1 = new ModelRenderer(this, 18, 60); LeftEarPart1.addBox(-1F, -1F, -1F, 1, 1, 4); LeftEarPart1.setRotationPoint(3.5F, 1.5F, -5F); LeftEarPart1.setTextureSize(256, 128); setRotation(LeftEarPart1, 0.3346075F, 0.3346145F, 0F); LeftEarPart2 = new ModelRenderer(this, 15, 66); LeftEarPart2.addBox(-1F, -1F, 0F, 2, 2, 6); LeftEarPart2.setRotationPoint(-0.5F, -0.5F, 0F); LeftEarPart2.setTextureSize(256, 128); setRotation(LeftEarPart2, 0.0346075F, 0.0346145F, 0F); LeftEarPart3 = new ModelRenderer(this, 16, 75); LeftEarPart3.addBox(-0.5F, -0.5F, 0F, 1, 1, 6); LeftEarPart3.setRotationPoint(0.5F, 0F, 4F); LeftEarPart3.setTextureSize(256, 128); setRotation(LeftEarPart3, 0.0346145F, -0.411544F, -0.074351F); Throat = new ModelRenderer(this, 0, 0); Throat.addBox(-2F, -3F, -9F, 6, 5, 6); Throat.setRotationPoint(-1F, 7.7F, -11F); Throat.setTextureOffset(256, 128); setRotation(Throat, -0.2288904F, 0F, 0F); UpSection = new ModelRenderer(this, 25, 0); UpSection.addBox(-2F, -2.5F, -9F, 7, 7, ; UpSection.setRotationPoint(-1.5F, 7F, -6F); UpSection.setTextureSize(256, 128); setRotation(UpSection, -0.1917118F, 0F, 0F); MidSection = new ModelRenderer(this, 56, 0); MidSection.addBox(-2F, -2.5F, 0F, 6, 6, 9); MidSection.setRotationPoint(-1F, 7.5F, -8F); MidSection.setTextureSize(256, 128); setRotation(MidSection, -0.0429974F, 0F, 0F); Pelvis = new ModelRenderer(this, 87, 0); Pelvis.addBox(-2F, -2.5F, 0F, 6, 6, 7); Pelvis.setRotationPoint(-1F, 7.8F, 0F); Pelvis.setTextureSize(256, 128); setRotation(Pelvis, 0F, 0F, 0F); TailPart1 = new ModelRenderer(this, 114, 0); TailPart1.addBox(-1F, -1F, 0F, 2, 2, 11); TailPart1.setRotationPoint(0F, 7F, 6F); TailPart1.setTextureOffset(256, 128); setRotation(TailPart1, -0.3346075F, 0F, 0F); TailPart2 = new ModelRenderer(this, 141, 0); TailPart2.addBox(-1F, -1F, 0F, 2, 2, 11); TailPart2.setRotationPoint(0F, -0.2F, 10F); TailPart2.setTextureSize(256, 128); setRotation(TailPart2, -0.3948578F, 0F, 0F); TailPart3 = new ModelRenderer(this, 168, 0); TailPart3.addBox(-1F, -1F, 0F, 2, 2, 11); TailPart3.setRotationPoint(0F, 0F, 10.8F); TailPart3.setTextureSize(256, 128); setRotation(TailPart3, 0.2974289F, 0F, 0F); LeftHumerus = new ModelRenderer(this, 39, 16); LeftHumerus.addBox(0F, 0F, 0F, 3, 10, 4); LeftHumerus.setRotationPoint(1.5F, 4.7F, -12F); LeftHumerus.setTextureSize(256, 128); setRotation(LeftHumerus, 0.3869765F, 0F, 0F); LeftRadius = new ModelRenderer(this, 71, 16); LeftRadius.addBox(0F, 0F, 0F, 3, 11, 4); LeftRadius.setRotationPoint(0F, 8.0F, 0.45F); LeftRadius.setTextureSize(256, 128); setRotation(LeftRadius, -0.3869765F, 0F, 0F); LeftFClawRPart1 = new ModelRenderer(this, 0, 58); LeftFClawRPart1.addBox(-0.5F, 0F, -1F, 1, 1, 1); LeftFClawRPart1.setRotationPoint(0F, 9.7F, 0F); LeftFClawRPart1.setTextureSize(256, 128); setRotation(LeftFClawRPart1, 0F, 0.5159687F, 0F); LeftFClawRPart2 = new ModelRenderer(this, 5, 58); LeftFClawRPart2.addBox(-0.5F, -1F, -3.4F, 1, 1, 3); LeftFClawRPart2.setRotationPoint(0F, 0F, 0F); LeftFClawRPart2.setTextureSize(256, 128); setRotation(LeftFClawRPart2, 1.16093F, 0.0259717F, 0F); LeftFClawMPart1 = new ModelRenderer(this, 0, 58); LeftFClawMPart1.addBox(-0.5F, 0F, -1F, 1, 1, 1); LeftFClawMPart1.setRotationPoint(1.5F, 9.7F, 0F); LeftFClawMPart1.setTextureSize(256, 128); setRotation(LeftFClawMPart1, 0F, 0F, 0F); LeftFClawMPart2 = new ModelRenderer(this, 5, 58); LeftFClawMPart2.addBox(-0.5F, -1F, -3.4F, 1, 1, 3); LeftFClawMPart2.setRotationPoint(0F, 0F, 0F); LeftFClawMPart2.setTextureSize(256, 128); setRotation(LeftFClawMPart2, 1.16093F, 0F, 0F); LeftFClawLPart1 = new ModelRenderer(this, 0, 58); LeftFClawLPart1.addBox(-0.5F, 0F, -1F, 1, 1, 1); LeftFClawLPart1.setRotationPoint(3F, 9.7F, 0F); LeftFClawLPart1.setTextureSize(256, 128); setRotation(LeftFClawLPart1, 0F, -0.5159717F, 0F); LeftFClawLPart2 = new ModelRenderer(this, 5, 58); LeftFClawLPart2.addBox(-0.5F, -1F, -3.4F, 1, 1, 3); LeftFClawLPart2.setRotationPoint(0F, 0F, 0F); LeftFClawLPart2.setTextureSize(256, 128); setRotation(LeftFClawLPart2, 1.16093F, -0.0059717F, 0F); RightHumerus = new ModelRenderer(this, 55, 16); RightHumerus.addBox(-3F, 0F, 0F, 3, 10, 4); RightHumerus.setRotationPoint(-1.5F, 4.7F, -12F); RightHumerus.setTextureSize(256, 128); setRotation(RightHumerus, 0.3869765F, 0F, 0F); RightRadius = new ModelRenderer(this, 71, 16); RightRadius.addBox(-3F, 0F, 0F, 3, 11, 4); RightRadius.setRotationPoint(0F, 8.0F, 0.45F); RightRadius.setTextureSize(256, 128); setRotation(RightRadius, -0.3869765F, 0F, 0F); RightFClawRPart1 = new ModelRenderer(this, 0, 58); RightFClawRPart1.addBox(-0.5F, 0F, -1F, 1, 1, 1); RightFClawRPart1.setRotationPoint(-3F, 9.7F, 0F); RightFClawRPart1.setTextureSize(256, 128); setRotation(RightFClawRPart1, 0F, 0.5159687F, 0F); RightFClawRPart2 = new ModelRenderer(this, 5, 58); RightFClawRPart2.addBox(-0.5F, -1F, -3.4F, 1, 1, 3); RightFClawRPart2.setRotationPoint(0F, 0F, 0F); RightFClawRPart2.setTextureSize(256, 128); setRotation(RightFClawRPart2, 1.16093F, 0.0259717F, 0F); RightFClawMPart1 = new ModelRenderer(this, 0, 58); RightFClawMPart1.addBox(-0.5F, 0F, -1F, 1, 1, 1); RightFClawMPart1.setRotationPoint(-1.5F, 9.7F, 0F); RightFClawMPart1.setTextureSize(256, 128); setRotation(RightFClawMPart1, 0F, 0F, 0F); RightFClawMPart2 = new ModelRenderer(this, 5, 58); RightFClawMPart2.addBox(-0.5F, -1F, -3.4F, 1, 1, 3); RightFClawMPart2.setRotationPoint(0F, 0F, 0F); RightFClawMPart2.setTextureSize(256, 128); setRotation(RightFClawMPart2, 1.16093F, 0F, 0F); RightFClawLPart1 = new ModelRenderer(this, 0, 58); RightFClawLPart1.addBox(-0.5F, 0F, -1F, 1, 1, 1); RightFClawLPart1.setRotationPoint(0F, 9.7F, 0F); RightFClawLPart1.setTextureSize(256, 128); setRotation(RightFClawLPart1, 0F, -0.5159717F, 0F); RightFClawLPart2 = new ModelRenderer(this, 5, 58); RightFClawLPart2.addBox(-0.5F, -1F, -3.4F, 1, 1, 3); RightFClawLPart2.setRotationPoint(0F, 0F, 0F); RightFClawLPart2.setTextureSize(256, 128); setRotation(RightFClawLPart2, 1.16093F, -0.0059717F, 0F); LeftFemur = new ModelRenderer(this, 19, 16); LeftFemur.addBox(0F, 0F, 0F, 3, 8, 6); LeftFemur.setRotationPoint(1.5F, 5.7F, 0F); LeftFemur.setTextureSize(256, 128); setRotation(LeftFemur, 0F, 0F, 0F); LeftTibia = new ModelRenderer(this, 0, 31); LeftTibia.addBox(0F, 0F, 0F, 3, 3, 9); LeftTibia.setRotationPoint(0F, 7.7F, 0F); LeftTibia.setTextureSize(256, 128); setRotation(LeftTibia, 0F, 0F, 0F); LeftMetatarsus = new ModelRenderer(this, 0, 44); LeftMetatarsus.addBox(0F, 0F, 0F, 3, 10, 3); LeftMetatarsus.setRotationPoint(0F, -0.02F, 8F); LeftMetatarsus.setTextureSize(256, 128); setRotation(LeftMetatarsus, -0.1289922F, 0F, 0F); LeftClawRPart1 = new ModelRenderer(this, 0, 58); LeftClawRPart1.addBox(-0.5F, 0F, -1F, 1, 1, 1); LeftClawRPart1.setRotationPoint(0F, 9F, 0F); LeftClawRPart1.setTextureSize(256, 128); setRotation(LeftClawRPart1, 0F, 0.5159687F, 0F); LeftClawRPart2 = new ModelRenderer(this, 5, 58); LeftClawRPart2.addBox(-0.5F, -1F, -3.4F, 1, 1, 3); LeftClawRPart2.setRotationPoint(0F, 0F, 0F); LeftClawRPart2.setTextureSize(256, 128); setRotation(LeftClawRPart2, 1.16093F, -0.0259717F, 0F); LeftClawMPart1 = new ModelRenderer(this, 0, 58); LeftClawMPart1.addBox(-0.5F, 0F, -1F, 1, 1, 1); LeftClawMPart1.setRotationPoint(1.5F, 9F, 0F); LeftClawMPart1.setTextureSize(256, 128); setRotation(LeftClawMPart1, 0F, 0F, 0F); LeftClawMPart2 = new ModelRenderer(this, 5, 58); LeftClawMPart2.addBox(-0.5F, -1F, -3.4F, 1, 1, 3); LeftClawMPart2.setRotationPoint(0F, 0F, 0F); LeftClawMPart2.setTextureSize(256, 128); setRotation(LeftClawMPart2, 1.16093F, 0F, 0F); LeftClawLPart1 = new ModelRenderer(this, 0, 58); LeftClawLPart1.addBox(-0.5F, 0F, -1F, 1, 1, 1); LeftClawLPart1.setRotationPoint(3F, 9F, 0F); LeftClawLPart1.setTextureSize(256, 128); setRotation(LeftClawLPart1, 0F, -0.5159717F, 0F); LeftClawLPart2 = new ModelRenderer(this, 5, 58); LeftClawLPart2.addBox(-0.5F, -1F, -3.4F, 1, 1, 3); LeftClawLPart2.setRotationPoint(0F, 0F, 0F); LeftClawLPart2.setTextureSize(256, 128); setRotation(LeftClawLPart2, 1.16093F, 0.0059717F, 0F); RightFemur = new ModelRenderer(this, 0, 16); RightFemur.addBox(-2F, 0F, 0F, 3, 8, 6); RightFemur.setRotationPoint(-2.5F, 5.7F, 0F); RightFemur.setTextureSize(256, 128); setRotation(RightFemur, 0F, 0F, 0F); RightTibia = new ModelRenderer(this, 0, 31); RightTibia.addBox(-2F, 0F, 0F, 3, 3, 9); RightTibia.setRotationPoint(0F, 7.7F, 0F); RightTibia.setTextureSize(256, 128); setRotation(RightTibia, 0F, 0F, 0F); RightMetatarsus = new ModelRenderer(this, 0, 44); RightMetatarsus.addBox(-2F, 0F, 0F, 3, 10, 3); RightMetatarsus.setRotationPoint(0F, -0.02F, 8F); RightMetatarsus.setTextureSize(256, 128); setRotation(RightMetatarsus, -0.1289922F, 0F, 0F); RightClawRPart1 = new ModelRenderer(this, 0, 58); RightClawRPart1.addBox(-0.5F, 0F, -1F, 1, 1, 1); RightClawRPart1.setRotationPoint(-2F, 9F, 0F); RightClawRPart1.setTextureSize(256, 128); setRotation(RightClawRPart1, 0F, 0.5159687F, 0F); RightClawRPart2 = new ModelRenderer(this, 5, 58); RightClawRPart2.addBox(-0.5F, -1F, -3.4F, 1, 1, 3); RightClawRPart2.setRotationPoint(0F, 0F, 0F); RightClawRPart2.setTextureSize(256, 128); setRotation(RightClawRPart2, 1.16093F, -0.0259717F, 0F); RightClawMPart1 = new ModelRenderer(this, 0, 58); RightClawMPart1.addBox(-0.5F, 0F, -1F, 1, 1, 1); RightClawMPart1.setRotationPoint(-0.5F, 9F, 0F); RightClawMPart1.setTextureSize(256, 128); setRotation(RightClawMPart1, 0F, 0F, 0F); RightClawMPart2 = new ModelRenderer(this, 5, 58); RightClawMPart2.addBox(-0.5F, -1F, -3.4F, 1, 1, 3); RightClawMPart2.setRotationPoint(0F, 0F, 0F); RightClawMPart2.setTextureSize(256, 128); setRotation(RightClawMPart2, 1.16093F, 0F, 0F); RightClawLPart1 = new ModelRenderer(this, 0, 58); RightClawLPart1.addBox(-0.5F, 0F, -1F, 1, 1, 1); RightClawLPart1.setRotationPoint(1F, 9F, 0F); RightClawLPart1.setTextureSize(256, 128); setRotation(RightClawLPart1, 0F, -0.5159717F, 0F); RightClawLPart2 = new ModelRenderer(this, 5, 58); RightClawLPart2.addBox(-0.5F, -1F, -3.4F, 1, 1, 3); RightClawLPart2.setRotationPoint(0F, 0F, 0F); RightClawLPart2.setTextureSize(256, 128); setRotation(RightClawLPart2, 1.16093F, 0.0059717F, 0F); //Top Jaw\\ TopJawCenter = new ModelRenderer(this, 56, 38); TopJawCenter.addBox(-0.5F, 0F, -7.4F, 2, 1, ; TopJawCenter.setRotationPoint(0.5F, -2.5F, -9F); TopJawCenter.setTextureSize(256, 128); setRotation(TopJawCenter, 0.2288904F, 0F, 0F); LeftTopJaw = new ModelRenderer(this, 39, 50); LeftTopJaw.addBox(0F, 0F, -9F, 1, 2, 9); LeftTopJaw.setRotationPoint(3F, 0F, 0F); LeftTopJaw.setTextureSize(256, 128); setRotation(LeftTopJaw, 0F, 0.3346075F, 0F); LeftTopTeeth = new ModelRenderer(this, 61, 50); LeftTopTeeth.addBox(0.5F, 0F, -9.3F, 0, 1, 5); LeftTopTeeth.setRotationPoint(0F, 2F, 0F); LeftTopTeeth.setTextureSize(256, 128); setRotation(LeftTopTeeth, 0F, -0.0346145F, 0F); RightTopJaw = new ModelRenderer(this, 39, 63); RightTopJaw.addBox(-1F, 0F, -9F, 1, 2, 9); RightTopJaw.setRotationPoint(-2F, 0F, 0F); RightTopJaw.setTextureSize(256, 128); setRotation(RightTopJaw, 0F, -0.3346075F, 0F); RightTopTeeth = new ModelRenderer(this, 61, 50); RightTopTeeth.addBox(-0.5F, 0F, -9.3F, 0, 1, 5); RightTopTeeth.setRotationPoint(0F, 2F, 0F); RightTopTeeth.setTextureSize(256, 128); setRotation(RightTopTeeth, 0F, 0.0346075F, 0F); TopJawPart1 = new ModelRenderer(this, 38, 40); TopJawPart1.addBox(-1F, 0F, -5.7F, 2, 1, 6); TopJawPart1.setRotationPoint(-1F, 0F, 0F); TopJawPart1.setTextureSize(256, 128); setRotation(TopJawPart1, 0F, -0.3346075F, 0F); TopJawPart2 = new ModelRenderer(this, 38, 40); TopJawPart2.addBox(-1F, 0F, -5.7F, 2, 1, 6); TopJawPart2.setRotationPoint(2F, 0F, 0F); TopJawPart2.setTextureSize(256, 128); setRotation(TopJawPart2, 0F, 0.3346145F, 0F); //BottomJaw\\ BottomJawCenter = new ModelRenderer(this, 0, 109); BottomJawCenter.addBox(-0.5F, 0F, -7.2F, 2, 1, ; BottomJawCenter.setRotationPoint(0.5F, 1.5F, -8F); BottomJawCenter.setTextureSize(256, 128); setRotation(BottomJawCenter, 0.2288904F, 0F, 0F); LeftBottomJaw = new ModelRenderer(this, 0, 84); LeftBottomJaw.addBox(0F, 0F, -9F, 1, 2, 9); LeftBottomJaw.setRotationPoint(3F, -1.1F, 0F); LeftBottomJaw.setTextureSize(256, 128); setRotation(LeftBottomJaw, 0F, 0.3346075F, 0F); LeftBottomTeeth = new ModelRenderer(this, 21, 93); LeftBottomTeeth.addBox(0.5F, 0F, -9.3F, 0, 1, 5); LeftBottomTeeth.setRotationPoint(0.5F, -1.2F, 0F); LeftBottomTeeth.setTextureSize(256, 128); setRotation(LeftBottomTeeth, 0, 0.0346145F, 0F); RightBottomJaw = new ModelRenderer(this, 0, 97); RightBottomJaw.addBox(-1F, 0F, -9F, 1, 2, 9); RightBottomJaw.setRotationPoint(-2F, -1.1F, 0F); RightBottomJaw.setTextureSize(256, 128); setRotation(RightBottomJaw, 0, -0.3346075F, 0F); RightBottomTeeth = new ModelRenderer(this, 21, 93); RightBottomTeeth.addBox(-0.5F, 0F, -9.3F, 0, 1, 5); RightBottomTeeth.setRotationPoint(-0.5F,-1.2F, 0F); RightBottomTeeth.setTextureSize(256, 128); setRotation(RightBottomTeeth, 0, -0.0346075F, 0F); BottomJawPart1 = new ModelRenderer(this, 21, 84); BottomJawPart1.addBox(-1F, 0F, -6.5F, 2, 1, 7); BottomJawPart1.setRotationPoint(-1F, 0F, 0F); BottomJawPart1.setTextureSize(256, 128); setRotation(BottomJawPart1, 0, -0.3346075F, 0F); BottomJawPart2 = new ModelRenderer(this, 21, 84); BottomJawPart2.addBox(-1F, 0F, -6.5F, 2, 1, 7); BottomJawPart2.setRotationPoint(2F, 0F, 0F); BottomJawPart2.setTextureSize(256, 128); setRotation(BottomJawPart2, 0, 0.3346075F, 0F); EPad1 = new ModelRenderer(this, 110, 32); EPad1.addBox(-2F, 0F, 0F, 4, 1, 1); EPad1.setRotationPoint(0F, 4.5F, -5.5F); EPad1.setTextureSize(256, 128); setRotation(EPad1, 0F, 0F, 0F); EPad2 = new ModelRenderer(this, 110, 35); EPad2.addBox(-3F, 0F, 0F, 6, 1, 2); EPad2.setRotationPoint(0F, 4.5F, -4.5F); EPad2.setTextureSize(256, 128); setRotation(EPad2, 0F, 0F, 0F); EPad3 = new ModelRenderer(this, 110, 39); EPad3.addBox(-2F, 0F, 0F, 5, 1, 4); EPad3.setRotationPoint(-0.5F, 4.5F, -2.8F); EPad3.setTextureSize(256, 128); setRotation(EPad3, 0F, 0F, 0F); EPad4 = new ModelRenderer(this, 110, 48); EPad4.addBox(-1.5F, 0F, 0F, 3, 1, 1); EPad4.setRotationPoint(0F, 4.5F, 1.1F); EPad4.setTextureSize(256, 128); setRotation(EPad4, 0F, 0F, 0F); EPadPart1 = new ModelRenderer(this, 110, 29); EPadPart1.addBox(-0.5F, 0F, 0F, 1, 1, 1); EPadPart1.setRotationPoint(1.5F, 4.5F, -6.5F); EPadPart1.setTextureSize(256, 128); setRotation(EPadPart1, 0F, 0F, 0F); EPadPart2 = new ModelRenderer(this, 110, 29); EPadPart2.addBox(-0.5F, 0F, 0F, 1, 1, 1); EPadPart2.setRotationPoint(-1.5F, 4.5F, -6.5F); EPadPart2.setTextureSize(256, 128); EPadPart2.mirror = true; setRotation(EPadPart2, 0F, 0F, 0F); ERope1 = new ModelRenderer(this, 105, 32); ERope1.addBox(0F, 0F, -0.5F, 1, 6, 1); ERope1.setRotationPoint(2.8F, 4.6F, -3F); ERope1.setTextureSize(256, 128); setRotation(ERope1, 0F, 0F, 0F); EMetal1 = new ModelRenderer(this, 102, 41); EMetal1.addBox(0F, 0F, -1F, 1, 1, 2); EMetal1.setRotationPoint(2.8F, 10.6F, -3F); EMetal1.setTextureSize(256, 128); setRotation(EMetal1, 0F, 0F, 0F); ERope2 = new ModelRenderer(this, 105, 32); ERope2.addBox(-1F, 0F, -0.5F, 1, 6, 1); ERope2.setRotationPoint(-2.8F, 4.6F, -3F); ERope2.setTextureSize(256, 128); setRotation(ERope2, 0F, 0F, 0F); EMetal2 = new ModelRenderer(this, 102, 41); EMetal2.addBox(-1F, 0F, -1F, 1, 1, 2); EMetal2.setRotationPoint(-2.8F, 10.6F, -3F); EMetal2.setTextureSize(256, 128); setRotation(EMetal2, 0F, 0F, 0F); ESeat1 = new ModelRenderer(this, 100, 45); ESeat1.addBox(-1F, 0F, 0F, 2, 1, 1); ESeat1.setRotationPoint(0F, 4F, -4.5F); ESeat1.setTextureSize(256, 128); setRotation(ESeat1, 0F, 0F, 0F); ESeat2 = new ModelRenderer(this, 100, 49); ESeat2.addBox(-2F, 0F, 0F, 4, 1, 1); ESeat2.setRotationPoint(0F, 4F, 0.2F); ESeat2.setTextureSize(256, 128); setRotation(ESeat2, 0F, 0F, 0F); //Head\\ this.Throat.addChild(TopJawCenter); this.Throat.addChild(BottomJawCenter); this.TopJawCenter.addChild(LeftEarPart1); this.TopJawCenter.addChild(RightEarPart1); this.TopJawCenter.addChild(TopJawPart1); this.TopJawCenter.addChild(TopJawPart2); this.TopJawCenter.addChild(LeftTopJaw); this.TopJawCenter.addChild(RightTopJaw); this.LeftTopJaw.addChild(LeftTopTeeth); this.RightTopJaw.addChild(RightTopTeeth); this.LeftEarPart1.addChild(LeftEarPart2); this.LeftEarPart2.addChild(LeftEarPart3); this.BottomJawCenter.addChild(BottomJawPart1); this.BottomJawCenter.addChild(BottomJawPart2); this.BottomJawCenter.addChild(LeftBottomJaw); this.BottomJawCenter.addChild(RightBottomJaw); this.LeftBottomJaw.addChild(LeftBottomTeeth); this.RightBottomJaw.addChild(RightBottomTeeth); this.RightEarPart1.addChild(RightEarPart2); this.RightEarPart2.addChild(RightEarPart3); //Front Legs\\ this.LeftHumerus.addChild(LeftRadius); this.LeftRadius.addChild(LeftFClawLPart1); this.LeftRadius.addChild(LeftFClawMPart1); this.LeftRadius.addChild(LeftFClawRPart1); this.LeftFClawLPart1.addChild(LeftFClawLPart2); this.LeftFClawMPart1.addChild(LeftFClawMPart2); this.LeftFClawRPart1.addChild(LeftFClawRPart2); this.RightHumerus.addChild(RightRadius); this.RightRadius.addChild(RightFClawLPart1); this.RightRadius.addChild(RightFClawMPart1); this.RightRadius.addChild(RightFClawRPart1); this.RightFClawLPart1.addChild(RightFClawLPart2); this.RightFClawMPart1.addChild(RightFClawMPart2); this.RightFClawRPart1.addChild(RightFClawRPart2); //Back Legs\\\ this.LeftFemur.addChild(LeftTibia); this.LeftTibia.addChild(LeftMetatarsus); this.LeftMetatarsus.addChild(LeftClawLPart1); this.LeftMetatarsus.addChild(LeftClawMPart1); this.LeftMetatarsus.addChild(LeftClawRPart1); this.LeftClawLPart1.addChild(LeftClawLPart2); this.LeftClawMPart1.addChild(LeftClawMPart2); this.LeftClawRPart1.addChild(LeftClawRPart2); this.RightFemur.addChild(RightTibia); this.RightTibia.addChild(RightMetatarsus); this.RightMetatarsus.addChild(RightClawLPart1); this.RightMetatarsus.addChild(RightClawMPart1); this.RightMetatarsus.addChild(RightClawRPart1); this.RightClawLPart1.addChild(RightClawLPart2); this.RightClawMPart1.addChild(RightClawMPart2); this.RightClawRPart1.addChild(RightClawRPart2); //Tail\\ this.TailPart1.addChild(TailPart2); this.TailPart2.addChild(TailPart3); } @Override public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { EntityZertumEntity entityzertum = (EntityZertumEntity)par1Entity; boolean flag = entityzertum.isSaddled(); super.render(par1Entity, par2, par3, par4, par5, par6, par7); this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); if(!entityzertum.hasEvolved()){ if (this.isChild) { float f6 = 2.0F; GL11.glPushMatrix(); GL11.glTranslatef(0.0F, 5.0F * par7, 6.0F * par7); Head.render(par7); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glScalef(1.0F / f6, 1.0F / f6, 1.0F / f6); GL11.glTranslatef(0.0F, 24.0F * par7, 0.0F); LeftHindLeg1.render(par7); RightHindLeg1.render(par7); Mane1.render(par7); RightLeg.render(par7); LeftLeg.render(par7); Tail1.render(par7); Torso.render(par7); GL11.glPopMatrix(); } else { GL11.glPushMatrix(); GL11.glScalef(1.5F, 1.5F, 1.5F); GL11.glTranslatef(0.0F, -0.5F, 0.0F); Head.render(par7); LeftHindLeg1.render(par7); RightHindLeg1.render(par7); Mane1.render(par7); RightLeg.render(par7); LeftLeg.render(par7); Tail1.render(par7); Torso.render(par7); GL11.glPopMatrix(); if(flag){ GL11.glPushMatrix(); GL11.glScalef(1.5F, 1.5F, 1.5F); GL11.glTranslatef(0.0F, -0.5F, 0.0F); Pad1.render(par7); Pad2.render(par7); Pad3.render(par7); Pad4.render(par7); PadPart1.render(par7); PadPart2.render(par7); Rope1.render(par7); Metal1.render(par7); Rope2.render(par7); Metal2.render(par7); Seat1.render(par7); Seat2.render(par7); GL11.glPopMatrix(); } } }else if(entityzertum.hasEvolved()){ if (this.isChild) { float f6 = 2.0F; GL11.glPushMatrix(); GL11.glTranslatef(0.0F, 5.0F * par7, 6.0F * par7); Throat.render(par7); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glScalef(1.0F / f6, 1.0F / f6, 1.0F / f6); GL11.glTranslatef(0.0F, 24.0F * par7, 0.0F); UpSection.render(par7); MidSection.render(par7); Pelvis.render(par7); TailPart1.render(par7); LeftHumerus.render(par7); RightHumerus.render(par7); LeftFemur.render(par7); RightFemur.render(par7); GL11.glPopMatrix(); } else { Throat.render(par7); UpSection.render(par7); MidSection.render(par7); Pelvis.render(par7); TailPart1.render(par7); LeftHumerus.render(par7); RightHumerus.render(par7); LeftFemur.render(par7); RightFemur.render(par7); } if(flag){ EPad1.render(par7); EPad2.render(par7); EPad3.render(par7); EPad4.render(par7); EPadPart1.render(par7); EPadPart2.render(par7); ERope1.render(par7); EMetal1.render(par7); ERope2.render(par7); EMetal2.render(par7); ESeat1.render(par7); ESeat2.render(par7); } } } /** * Used for easily adding entity-dependent animations. The second and third float params here are the same second * and third as in the setRotationAngles method. */ @Override public void setLivingAnimations(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) { EntityZertumEntity entityzertum = (EntityZertumEntity)par1EntityLivingBase; float f11 = entityzertum.func_110201_q(par4); if (entityzertum.isAngry()) { this.Ear1.rotateAngleX = -0.5948578F; this.Ear2.rotateAngleX = -0.5948578F; }else if (entityzertum.getHealth() <=10){ this.Ear1.rotateAngleX = -0.9948578F; this.Ear2.rotateAngleX = -0.9948578F; }else{ this.Ear1.rotateAngleX = 0.0F; this.Ear2.rotateAngleX = 0.0F; } if(!entityzertum.hasEvolved()){ if (entityzertum.isSitting()) //TODO { LeftHindLeg1.setRotationPoint(1.5F, 18F, 5F); LeftHindLeg1.rotateAngleX = -2.082003F; LeftHindLeg2.setRotationPoint(0F, 4F, 1.2F); LeftHindLeg2.rotateAngleX = 2.6205006F; LeftHindLeg3.setRotationPoint(0F, 3.55F, 0.2F); LeftHindLeg3.rotateAngleX = -0.5205006F; RightHindLeg1.setRotationPoint(-2.5F, 18F, 5F); RightHindLeg1.rotateAngleX = -2.082003F; RightHindLeg2.setRotationPoint(0F, 4F, 1.2F); RightHindLeg2.rotateAngleX = 2.6205006F; RightHindLeg3.setRotationPoint(0F, 3.55F, 0.2F); RightHindLeg3.rotateAngleX = -0.5205006F; Torso.setRotationPoint(-0.5F, 14F, 1F); Torso.rotateAngleX = 0.9759358F; Tail1.setRotationPoint(-1F, 18.5F, 5F); Tail1.rotateAngleX = 1.167248F; Tail2.rotateAngleX = 0.315962F; Tail3.rotateAngleX = 0.23333F; //Saddle\\ Pad1.setRotationPoint(-0.5F, 9.7F, -1.5F); setRotation(Pad1, -0.288128F, 0F, 0F); Pad2.setRotationPoint(-0.5F, 10F, -0.5F); setRotation(Pad2, -0.3346075F, 0F, 0F); Pad3.setRotationPoint(-1F, 10.7F, 1.4F); setRotation(Pad3, -0.5855569F, 0F, 0F); Pad4.setRotationPoint(-0.5F, 12.9F, 4.7F); setRotation(Pad4, -0.5948648F, 0F, 0F); PadPart1.setRotationPoint(1F, 9.6F, -2.4F); setRotation(PadPart1, -0.3624853F, 0F, 0F); PadPart2.setRotationPoint(-2F, 9.6F, -2.4F); setRotation(PadPart2, -0.3624874F, 0F, 0F); Rope1.setRotationPoint(1.8F, 10.6F, 1F); setRotation(Rope1, -0.3346075F, 0F, 0F); Metal1.setRotationPoint(1.8F, 14.2F, -0.3F); setRotation(Metal1, -0.3346145F, 0F, 0F); Rope2.setRotationPoint(-2.8F, 10.6F, 1F); setRotation(Rope2, -0.3346145F, 0F, 0F); Metal2.setRotationPoint(-3.8F, 13.6F, 0F); setRotation(Metal2, -0.3346145F, 0F, 0F); Seat1.setRotationPoint(-0.5F, 11.6F, 4.3F); setRotation(Seat1, -0.5483867F, 0F, 0F); Seat2.setRotationPoint(-0.5F, 8.9F, -1.2F); setRotation(Seat2, -0.2881364F, 0F, 0F); } else { LeftHindLeg1.setRotationPoint(1.5F, 13F, 5F); LeftHindLeg1.rotateAngleX = -0.2974289F; LeftHindLeg2.setRotationPoint(0F, 4.3F, -0.3F); LeftHindLeg2.rotateAngleX = leftTibia; LeftHindLeg3.setRotationPoint(0F, 3.55F, 0.2F); LeftHindLeg3.rotateAngleX = leftMetatarus; RightHindLeg1.setRotationPoint(-2.5F, 13F, 5F); RightHindLeg1.rotateAngleX = -0.2974289F; RightHindLeg2.setRotationPoint(0F, 4.3F, -0.3F); RightHindLeg2.rotateAngleX = rightTibia; RightHindLeg3.setRotationPoint(0F, 3.55F, 0.2F); RightHindLeg3.rotateAngleX = rightMetatarus; Torso.setRotationPoint(-0.5F, 12.5F, 1F); Torso.rotateAngleX = 1.496439F; Tail1.setRotationPoint(-1F, 14.3F, 6F); Tail1.rotateAngleX = 1.315962F; Tail2.setRotationPoint(0.5F, 6F, 0.5F); Tail2.rotateAngleX = -0.041605F; Tail3.setRotationPoint(0F, 6.5F, 0.5F); Tail3.rotateAngleX = 0.001605F; //Saddle\\ TODO Pad1.setRotationPoint(-0.5F, 9.3F, -2.5F); setRotation(Pad1, -0.0650564F, 0F, 0F); Pad2.setRotationPoint(-0.5F, 9.4F, -1.5F); setRotation(Pad2, -0.0743572F, 0F, 0F); Pad3.setRotationPoint(-1F, 9.5F, 0.2F); setRotation(Pad3, -0.0650564F, 0F, 0F); Pad4.setRotationPoint(-0.5F, 9.8F, 4.1F); setRotation(Pad4, -0.0650564F, 0F, 0F); PadPart1.setRotationPoint(1F, 9.23F, -3.5F); setRotation(PadPart1, -0.0650564F, 0F, 0F); PadPart2.setRotationPoint(-2F, 9.2F, -3.5F); setRotation(PadPart2, -0.0650564F, 0F, 0F); Rope1.setRotationPoint(1.8F, 9.6F, 0F); setRotation(Rope1, 0F, 0F, 0F); Metal1.setRotationPoint(1.8F, 13.6F, 0F); setRotation(Metal1, 0F, 0F, 0F); Rope2.setRotationPoint(-2.8F, 9.6F, 0F); setRotation(Rope2, 0F, 0F, 0F); Metal2.setRotationPoint(-3.8F, 13.6F, 0F); setRotation(Metal2, 0F, 0F, 0F); Seat1.setRotationPoint(-0.5F, 8.7F, -1.5F); setRotation(Seat1, -0.0650484F, 0F, 0F); Seat2.setRotationPoint(-0.5F, 9F, 3.2F); setRotation(Seat2, -0.0650484F, 0F, 0F); this.RightHindLeg1.rotateAngleX = rightFemur + MathHelper.cos(par2 * 0.4662F) * 1.4F * par3; this.LeftHindLeg1.rotateAngleX = leftFemur + MathHelper.cos(par2 * 0.4662F + (float)Math.PI) * 1.4F * par3; this.RightLeg.rotateAngleX = MathHelper.cos(par2 * 0.4662F + (float)Math.PI) * 1.4F * par3; this.LeftLeg.rotateAngleX = MathHelper.cos(par2 * 0.4662F) * 1.4F * par3; } }else if(entityzertum.hasEvolved()){ if (entityzertum.isSitting()) //TODO { MidSection.setRotationPoint(-1F, 7.5F, -8F); setRotation(MidSection, -0.3032477F, 0F, 0F); Pelvis.setRotationPoint(-1F, 9.8F, -1F); setRotation(Pelvis, -0.2974289F, 0F, 0F); TailPart1.setRotationPoint(0F, 11F, 6F); setRotation(TailPart1, -0.3346075F, 0F, 0F); TailPart2.setRotationPoint(0F, -0.2F, 10F); setRotation(TailPart2, -0.3948578F, 0F, 0F); TailPart3.setRotationPoint(0F, 0F, 10.8F); setRotation(TailPart3, 0.2974289F, 0F, 0F); LeftFemur.setRotationPoint(1.5F, 6.7F, 0F); LeftFemur.rotateAngleX = -0.3892433F; LeftTibia.setRotationPoint(0F, 7.5F, -0.2F); setRotation(LeftTibia, 0.3892433F, 0F, 0F); LeftMetatarsus.setRotationPoint(0F, 0F, 7.5F); setRotation(LeftMetatarsus, -0.1289922F, 0F, 0F); LeftClawRPart1.setRotationPoint(0F, 8.5F, 0F); setRotation(LeftClawRPart1, 0F, 0.5159687F, 0F); LeftClawRPart2.setRotationPoint(0F, 0F, 0F); setRotation(LeftClawRPart2, 1.16093F, -0.0259717F, 0F); LeftClawMPart1.setRotationPoint(1.5F, 8.5F, 0F); setRotation(LeftClawMPart1, 0F, 0F, 0F); LeftClawMPart2.setRotationPoint(0F, 0F, 0F); setRotation(LeftClawMPart2, 1.16093F, 0F, 0F); LeftClawLPart1.setRotationPoint(3F, 8.5F, 0F); setRotation(LeftClawLPart1, 0F, -0.5159717F, 0F); LeftClawLPart2.setRotationPoint(0F, 0F, 0F); setRotation(LeftClawLPart2, 1.16093F, 0.0059717F, 0F); RightFemur.setRotationPoint(-2.5F, 6.7F, 0F); RightFemur.rotateAngleX = -0.3892433F; RightTibia.setRotationPoint(0F, 7.5F, -0.2F); setRotation(RightTibia, 0.3892433F, 0F, 0F); RightMetatarsus.setRotationPoint(0F, 0F, 7.5F); setRotation(RightMetatarsus, -0.1289922F, 0F, 0F); RightClawRPart1.setRotationPoint(-2F, 8.5F, 0F); setRotation(RightClawRPart1, 0F, 0.5159687F, 0F); RightClawRPart2.setRotationPoint(0F, 0F, 0F); setRotation(RightClawRPart2, 1.16093F, -0.0259717F, 0F); RightClawMPart1.setRotationPoint(-0.5F, 8.5F, 0F); setRotation(RightClawMPart1, 0F, 0F, 0F); RightClawMPart2.setRotationPoint(0F, 0F, 0F); setRotation(RightClawMPart2, 1.16093F, 0F, 0F); RightClawLPart1.setRotationPoint(1F, 8.5F, 0F); setRotation(RightClawLPart1, 0F, -0.5159717F, 0F); RightClawLPart2.setRotationPoint(0F, 0F, 0F); setRotation(RightClawLPart2, 1.16093F, 0.0059717F, 0F); EPad1.setRotationPoint(0F, 4.7F, -5.5F); setRotation(EPad1, -0.2230717F, 0F, 0F); EPad2.setRotationPoint(0F, 5F, -4.5F); setRotation(EPad2, -0.2230717F, 0F, 0F); EPad3.setRotationPoint(-0.5F, 5.4F, -2.8F); setRotation(EPad3, -0.3346075F, 0F, 0F); EPad4.setRotationPoint(0F, 6.7F, 0.8F); setRotation(EPad4, -0.3346075F, 0F, 0F); EPadPart1.setRotationPoint(1.5F, 4.5F, -6.5F); setRotation(EPadPart1, -0.2230717F, 0F, 0F); EPadPart2.setRotationPoint(-1.5F, 4.5F, -6.5F); setRotation(EPadPart2, -0.2230717F, 0F, 0F); ERope1.setRotationPoint(2.8F, 5.6F, -3F); setRotation(ERope1, 0F, 0F, 0F); EMetal1.setRotationPoint(2.8F, 11.6F, -3F); setRotation(EMetal1, 0F, 0F, 0F); ERope2.setRotationPoint(-2.8F, 5.6F, -3F); setRotation(ERope2, 0F, 0F, 0F); EMetal2.setRotationPoint(-2.8F, 11.6F, -3F); setRotation(EMetal2, 0F, 0F, 0F); ESeat1.setRotationPoint(0F, 4.4F, -4.5F); setRotation(ESeat1, -0.2230717F, 0F, 0F); ESeat2.setRotationPoint(0F, 5.9F, 0.2F); setRotation(ESeat2, -0.3346075F, 0F, 0F); }else{ MidSection.setRotationPoint(-1F, 7.5F, -8F); setRotation(MidSection, -0.0429974F, 0F, 0F); Pelvis.setRotationPoint(-1F, 7.8F, 0F); setRotation(Pelvis, 0F, 0F, 0F); TailPart1.setRotationPoint(0F, 7F, 6F); setRotation(TailPart1, -0.3346075F, 0F, 0F); TailPart2.setRotationPoint(0F, -0.2F, 10F); setRotation(TailPart2, -0.3948578F, 0F, 0F); TailPart3.setRotationPoint(0F, 0F, 10.8F); setRotation(TailPart3, 0.2974289F, 0F, 0F); LeftFemur.setRotationPoint(1.5F, 5.7F, 0F); setRotation(LeftFemur, 0F, 0F, 0F); LeftTibia.setRotationPoint(0F, 7.7F, 0F); setRotation(LeftTibia, 0F, 0F, 0F); LeftMetatarsus.setRotationPoint(0F, -0.02F, 8F); setRotation(LeftMetatarsus, -0.1289922F, 0F, 0F); LeftClawRPart1.setRotationPoint(0F, 9F, 0F); setRotation(LeftClawRPart1, 0F, 0.5159687F, 0F); LeftClawRPart2.setRotationPoint(0F, 0F, 0F); setRotation(LeftClawRPart2, 1.16093F, -0.0259717F, 0F); LeftClawMPart1.setRotationPoint(1.5F, 9F, 0F); setRotation(LeftClawMPart1, 0F, 0F, 0F); LeftClawMPart2.setRotationPoint(0F, 0F, 0F); setRotation(LeftClawMPart2, 1.16093F, 0F, 0F); LeftClawLPart1.setRotationPoint(3F, 9F, 0F); setRotation(LeftClawLPart1, 0F, -0.5159717F, 0F); LeftClawLPart2.setRotationPoint(0F, 0F, 0F); setRotation(LeftClawLPart2, 1.16093F, 0.0059717F, 0F); RightFemur.setRotationPoint(-2.5F, 5.7F, 0F); RightFemur.rotateAngleX = 0F; RightTibia.setRotationPoint(0F, 7.7F, 0F); setRotation(RightTibia, 0F, 0F, 0F); RightMetatarsus.setRotationPoint(0F, -0.02F, 8F); setRotation(RightMetatarsus, -0.1289922F, 0F, 0F); RightClawRPart1.setRotationPoint(-2F, 9F, 0F); setRotation(RightClawRPart1, 0F, 0.5159687F, 0F); RightClawRPart2.setRotationPoint(0F, 0F, 0F); setRotation(RightClawRPart2, 1.16093F, -0.0259717F, 0F); RightClawMPart1.setRotationPoint(-0.5F, 9F, 0F); setRotation(RightClawMPart1, 0F, 0F, 0F); RightClawMPart2.setRotationPoint(0F, 0F, 0F); setRotation(RightClawMPart2, 1.16093F, 0F, 0F); RightClawLPart1.setRotationPoint(1F, 9F, 0F); setRotation(RightClawLPart1, 0F, -0.5159717F, 0F); RightClawLPart2.setRotationPoint(0F, 0F, 0F); setRotation(RightClawLPart2, 1.16093F, 0.0059717F, 0F); //Saddle\\ EPad1.setRotationPoint(0F, 4.5F, -5.5F); setRotation(EPad1, 0F, 0F, 0F); EPad2.setRotationPoint(0F, 4.5F, -4.5F); setRotation(EPad2, 0F, 0F, 0F); EPad3.setRotationPoint(-0.5F, 4.5F, -2.8F); setRotation(EPad3, 0F, 0F, 0F); EPad4.setRotationPoint(0F, 4.5F, 1.1F); setRotation(EPad4, 0F, 0F, 0F); EPadPart1.setRotationPoint(1.5F, 4.5F, -6.5F); setRotation(EPadPart1, 0F, 0F, 0F); EPadPart2.setRotationPoint(-1.5F, 4.5F, -6.5F); setRotation(EPadPart2, 0F, 0F, 0F); ERope1.setRotationPoint(2.8F, 4.6F, -3F); setRotation(ERope1, 0F, 0F, 0F); EMetal1.setRotationPoint(2.8F, 10.6F, -3F); setRotation(EMetal1, 0F, 0F, 0F); ERope2.setRotationPoint(-2.8F, 4.6F, -3F); setRotation(ERope2, 0F, 0F, 0F); EMetal2.setRotationPoint(-2.8F, 10.6F, -3F); setRotation(EMetal2, 0F, 0F, 0F); ESeat1.setRotationPoint(0F, 4F, -4.5F); setRotation(ESeat1, 0F, 0F, 0F); ESeat2.setRotationPoint(0F, 4F, 0.2F); setRotation(ESeat2, 0F, 0F, 0F); System.out.println("Is Dashing = " + entityzertum.isDashing()); if(entityzertum.isDashing()){ updateDistanceMovedTotal(par1EntityLivingBase); cycleIndex = (int) ((getDistanceMovedTotal(par1EntityLivingBase)*CYCLES_PER_BLOCK)%undulationCycle.length); //System.out.println("ModelZertum setRotationAngles(), distanceMoved ="+getDistanceMovedTotal(par7Entity)+", cycleIndex ="+cycleIndex); LeftFemur.rotateAngleX = degToRad(undulationCycle[0][cycleIndex]) ; RightFemur.rotateAngleX = degToRad(undulationCycle[1][cycleIndex]) ; LeftHumerus.rotateAngleX = degToRad(undulationCycle[2][cycleIndex]) ; RightHumerus.rotateAngleX = degToRad(undulationCycle[3][cycleIndex]) ; }else{ this.RightHumerus.rotateAngleX = 0.3869765F + MathHelper.cos(par2 * 0.4962F) * 0.5F * par3; this.LeftHumerus.rotateAngleX = 0.3869765F + MathHelper.cos(par2 * 0.3962F + (float)Math.PI) * 0.5F * par3; this.RightFemur.rotateAngleX = MathHelper.cos(par2 * 0.4062F) * 0.5F * par3; this.LeftFemur.rotateAngleX = MathHelper.cos(par2 * 0.3362F + (float)Math.PI) * 0.5F * par3; } } } this.Head.rotateAngleZ = entityzertum.getInterestedAngle(par4) + entityzertum.getShakeAngle(par4, 0.0F); this.Mane1.rotateAngleZ = entityzertum.getShakeAngle(par4, -0.08F); this.Torso.rotateAngleZ = entityzertum.getShakeAngle(par4, -0.16F); this.Tail1.rotateAngleZ = entityzertum.getShakeAngle(par4, -0.32F); this.TopJawCenter.rotateAngleX = 0.2288904F - 0.45707964F * f11; this.BottomJawCenter.rotateAngleX = 0.2288904F + 0.45707964F * f11; } private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } @Override public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); this.Head.rotateAngleX = par5 / (280F / (float)Math.PI); this.Head.rotateAngleY = par4 / (180F / (float)Math.PI); this.Neck.rotateAngleX = vertebrae + par5 / (280F / (float)Math.PI); this.Mane2.rotateAngleX = mane2StartingRotation + par5 / (280F / (float)Math.PI); this.Mane1.rotateAngleY = par4 / (180F / (float)Math.PI); } protected void updateDistanceMovedTotal(Entity parEntity) { distanceMovedTotal += parEntity.getDistance(parEntity.prevPosX, parEntity.prevPosY, parEntity.prevPosZ); } protected double getDistanceMovedTotal(Entity parEntity) { return (distanceMovedTotal); } protected float degToRad(float degrees) { return degrees * (float)Math.PI / 180 ; } } Entity File package common.zeroquest.entity; import java.util.HashMap; import java.util.Map; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.EntityAIAttackOnCollide; import net.minecraft.entity.ai.EntityAIHurtByTarget; import net.minecraft.entity.ai.EntityAILeapAtTarget; import net.minecraft.entity.ai.EntityAILookIdle; import net.minecraft.entity.ai.EntityAIMate; import net.minecraft.entity.ai.EntityAISit; import net.minecraft.entity.ai.EntityAISwimming; import net.minecraft.entity.ai.EntityAIWander; import net.minecraft.entity.ai.EntityAIWatchClosest; import net.minecraft.entity.monster.EntityCreeper; import net.minecraft.entity.monster.EntityGhast; import net.minecraft.entity.monster.EntityZombie; import net.minecraft.entity.passive.EntityAnimal; import net.minecraft.entity.passive.EntityHorse; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.init.Items; import net.minecraft.item.EnumDyeColor; import net.minecraft.item.Item; import net.minecraft.item.ItemBow; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemSword; import net.minecraft.item.ItemTool; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.pathfinding.PathNavigateGround; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.util.BlockPos; import net.minecraft.util.DamageSource; import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import common.zeroquest.ModAchievements; import common.zeroquest.ModItems; import common.zeroquest.entity.ai.EntityAIFetchBone; import common.zeroquest.entity.ai.EntityAIFollowOwner; import common.zeroquest.entity.ai.EntityAIModeAttackTarget; import common.zeroquest.entity.ai.EntityAIOwnerHurtByTarget; import common.zeroquest.entity.ai.EntityAIOwnerHurtTarget; import common.zeroquest.entity.ai.EntityAIRoundUp; import common.zeroquest.entity.ai.EntityCustomAIBeg; import common.zeroquest.entity.util.CoordUtil; import common.zeroquest.entity.util.LevelUtil; import common.zeroquest.entity.util.ModeUtil; import common.zeroquest.entity.util.TalentHelper; import common.zeroquest.entity.util.TalentUtil; import common.zeroquest.inventory.InventoryPack; import common.zeroquest.lib.Constants; import common.zeroquest.lib.Sound; public abstract class EntityZertumEntity extends EntityCustomTameable { public float headRotationCourse; public float headRotationCourseOld; public boolean isWet; public boolean isShaking; public float timeWolfIsShaking; public float prevTimeWolfIsShaking; private int hungerTick; private int prevHungerTick; private int healingTick; private int prevHealingTick; private int regenerationTick; private int prevRegenerationTick; public TalentUtil talents; public LevelUtil levels; public ModeUtil mode; public CoordUtil coords; public Map<String, Object> objects; private boolean hasBone; private float mouthOpenness; private float prevMouthOpenness; public int field_110278_bp; public int field_110279_bq; private String field_110286_bQ; private int openMouthCounter; public static final double maxHealth = 25; public static final double attackDamage = 6; public static final double speed = 0.30000001192092896; public static final double maxHealthTamed = 35; public static final double attackDamageTamed = 8; public static final double maxHealthBaby = 10; public static final double attackDamageBaby = 2; public static final double maxHealthEvo = 25; public static final double attackDamageEvo = 6; public static final double speedEvo = 0.30000001192092896; protected EntityAILeapAtTarget aiLeap = new EntityAILeapAtTarget(this, 0.4F); public EntityAIWatchClosest aiStareAtPlayer = new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F); public EntityAIWatchClosest aiGlareAtCreeper = new EntityAIWatchClosest(this, EntityCreeper.class, this.talents.getLevel("creeperspotter") * 6); public EntityAIFetchBone aiFetchBone; // data value IDs TODO /**DO NOT CHANGE!**/ public static final int INDEX_TAME = 16; public static final int INDEX_COLLAR = 19; public static final int INDEX_SADDLE = 20; public static final int INDEX_EVOLVE = 25; public static final int INDEX_MOUTH = 29; public static final int INDEX_DASH = 30; public EntityZertumEntity(World worldIn) { super(worldIn); this.objects = new HashMap<String, Object>(); this.setSize(0.6F, 1.5F); ((PathNavigateGround)this.getNavigator()).func_179690_a(true); this.tasks.addTask(1, new EntityAISwimming(this)); this.tasks.addTask(2, this.aiSit); this.tasks.addTask(3, this.aiLeap); 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(6, this.aiFetchBone = new EntityAIFetchBone(this, 1.0D, 0.5F, 20.0F)); this.tasks.addTask(7, new EntityAIMate(this, 1.0D)); this.tasks.addTask(8, new EntityAIWander(this, 1.0D)); this.tasks.addTask(9, new EntityCustomAIBeg(this, 8.0F)); this.tasks.addTask(10, aiStareAtPlayer); this.tasks.addTask(10, new EntityAILookIdle(this)); this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); this.targetTasks.addTask(3, new EntityAIModeAttackTarget(this)); this.targetTasks.addTask(4, new EntityAIHurtByTarget(this, true)); this.setTamed(false); this.setEvolved(false); this.inventory = new InventoryPack(this); this.targetTasks.addTask(6, new EntityAIRoundUp(this, EntityAnimal.class, 0, false)); TalentHelper.onClassCreation(this); } @Override protected void applyEntityAttributes() { super.applyEntityAttributes(); this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxHealth); this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(attackDamage); this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(speed); this.updateEntityAttributes(); } public void updateEntityAttributes() { if (this.isTamed()) { this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxHealthTamed + this.effectiveLevel()); this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(attackDamageTamed); if(this.isDashing()){ this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(speed + 0.2); } } else if (this.isChild()) { this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxHealthBaby); this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(attackDamageBaby); } else if(this.hasEvolved()){ this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxHealthEvo); this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(attackDamageEvo); this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(speedEvo); if(this.isDashing()){ this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(speedEvo + 0.2); } } } /** * Sets the active target the Task system uses for tracking */ @Override 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); } } @Override public String getName() { String name = this.getDogName(); if(name != "") return name; return super.getName(); } @Override @SideOnly(Side.CLIENT) public boolean getAlwaysRenderNameTagForRender() { return true; } @Override protected void entityInit() { super.entityInit(); this.talents = new TalentUtil(this); this.levels = new LevelUtil(this); this.mode = new ModeUtil(this); this.coords = new CoordUtil(this); this.dataWatcher.addObject(INDEX_COLLAR, new Byte((byte)EnumDyeColor.RED.getMetadata())); //Collar this.dataWatcher.addObject(INDEX_SADDLE, Byte.valueOf((byte)0)); //Saddle this.dataWatcher.addObject(21, new String("")); //Dog Name this.dataWatcher.addObject(22, new String("")); //Talent Data this.dataWatcher.addObject(23, new Integer(60)); //Dog Hunger this.dataWatcher.addObject(24, new String("0:0")); //Level Data this.dataWatcher.addObject(INDEX_EVOLVE, Byte.valueOf((byte)0)); //Evolution this.dataWatcher.addObject(26, new Integer(0)); //Obey Others this.dataWatcher.addObject(27, new Integer(0)); //Dog Mode this.dataWatcher.addObject(28, "-1:-1:-1:-1:-1:-1"); //Dog Mode this.dataWatcher.addObject(INDEX_MOUTH, Integer.valueOf(0)); //Mouth this.dataWatcher.addObject(INDEX_DASH, Byte.valueOf((byte)0)); //Dash } @Override public void writeEntityToNBT(NBTTagCompound tagCompound) { super.writeEntityToNBT(tagCompound); tagCompound.setBoolean("Angry", this.isAngry()); tagCompound.setByte("CollarColor", (byte)this.getCollarColor().getDyeDamage()); tagCompound.setBoolean("Saddle", this.isSaddled()); tagCompound.setBoolean("Evolve", this.hasEvolved()); tagCompound.setBoolean("Dash", this.isDashing()); tagCompound.setString("version", Constants.version); tagCompound.setString("dogName", this.getDogName()); tagCompound.setInteger("dogHunger", this.getDogHunger()); tagCompound.setBoolean("willObey", this.willObeyOthers()); this.talents.writeTalentsToNBT(tagCompound); this.levels.writeTalentsToNBT(tagCompound); this.mode.writeToNBT(tagCompound); this.coords.writeToNBT(tagCompound); TalentHelper.writeToNBT(this, tagCompound); } @Override public void readEntityFromNBT(NBTTagCompound tagCompound) { super.readEntityFromNBT(tagCompound); this.setAngry(tagCompound.getBoolean("Angry")); this.setSaddled(tagCompound.getBoolean("Saddle")); this.setEvolved(tagCompound.getBoolean("Evolve")); this.setDashing(tagCompound.getBoolean("Dash")); if (tagCompound.hasKey("CollarColor", 99)) { this.setCollarColor(EnumDyeColor.byDyeDamage(tagCompound.getByte("CollarColor"))); } String lastVersion = tagCompound.getString("version"); this.setDogName(tagCompound.getString("dogName")); this.setDogHunger(tagCompound.getInteger("dogHunger")); this.setWillObeyOthers(tagCompound.getBoolean("willObey")); this.talents.readTalentsFromNBT(tagCompound); this.levels.readTalentsFromNBT(tagCompound); this.mode.readFromNBT(tagCompound); this.coords.readFromNBT(tagCompound); TalentHelper.readFromNBT(this, tagCompound); } @Override protected void playStepSound(BlockPos p_180429_1_, Block p_180429_2_) { this.playSound("mob.wolf.step", 0.15F, 1.0F); } /** * Returns the sound this mob makes while it's alive. */ @Override protected String getLivingSound() { this.openMouth(); String sound = TalentHelper.getLivingSound(this); if(!"".equals(sound)) return sound; return this.isAngry() ? "mob.wolf.growl" : this.wantToHowl ? Sound.ZertumHowl : (this.rand.nextInt(3) == 0 ? (this.isTamed() && this.getHealth() <= 10.0F ? "mob.wolf.whine" : "mob.wolf.panting") : "mob.wolf.bark"); } /** * Returns the sound this mob makes when it is hurt. */ @Override protected String getHurtSound() { this.openMouth(); return "mob.wolf.hurt"; } /** * Returns the sound this mob makes on death. */ @Override protected String getDeathSound() { this.openMouth(); return "mob.wolf.death"; } /** * Returns the volume for the sounds this mob makes. */ @Override public float getSoundVolume() { return 0.5F; } /** * Get number of ticks, at least during which the living entity will be silent. */ @Override public int getTalkInterval() { if((Boolean)this.objects.get("canseecreeper") == true){ return 40; }else if(this.wantToHowl){ return 150; }else if(this.getHealth() <=10){ return 20; }else{ return 200; } } /** * Returns the item ID for the item the mob drops on death. */ @Override protected void dropFewItems(boolean par1, int par2) { rare = rand.nextInt(20); { if (this.isBurning()) { this.dropItem(ModItems.zertumMeatCooked, 1); } else if (rare <= 12) { this.dropItem(ModItems.zertumMeatRaw, 1); } if(rare <= 6 && !this.isTamed()) { this.dropItem(ModItems.nileGrain, 1); } if (this.isSaddled()) { this.dropItem(Items.saddle, 1); } else { } } } /** * 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. */ @Override public void onLivingUpdate() //TODO { super.onLivingUpdate(); if (isServer() && this.isWet && !this.isShaking && !this.hasPath() && this.onGround) { this.isShaking = true; this.timeWolfIsShaking = 0.0F; this.prevTimeWolfIsShaking = 0.0F; this.worldObj.setEntityState(this, (byte); } if(Constants.IS_HUNGER_ON) { this.prevHungerTick = this.hungerTick; if (this.riddenByEntity == null && !this.isSitting() /*&& !this.mode.isMode(EnumMode.WANDERING) && !this.level.isDireDog() || worldObj.getWorldInfo().getWorldTime() % 2L == 0L */) this.hungerTick += 1; this.hungerTick += TalentHelper.onHungerTick(this, this.hungerTick - this.prevHungerTick); if (this.hungerTick > 400) { this.setDogHunger(this.getDogHunger() - 1); this.hungerTick -= 400; } } if(Constants.DEF_HEALING == true && !this.isChild() && this.getHealth() <=10 && this.isTamed()) { this.addPotionEffect(new PotionEffect(Potion.regeneration.id, 200)); } if(this.getHealth() != 1) { this.prevHealingTick = this.healingTick; this.healingTick += this.nourishment(); if (this.healingTick >= 6000) { if (this.getHealth() < this.getMaxHealth()) this.setHealth(this.getHealth() + 1); this.healingTick = 0; } } if(this.getDogHunger() == 0 && this.worldObj.getWorldInfo().getWorldTime() % 100L == 0L && this.getHealth() > 1) { this.attackEntityFrom(DamageSource.generic, 1); //this.fleeingTick = 0; } if (isServer() && this.getAttackTarget() == null && this.isAngry()) { this.setAngry(false); } if(Constants.DEF_HOWL == true){ if (this.worldObj.isDaytime() && isServer()) //TODO { wantToHowl = false; } else if(isServer() && (this.isChild() || this.isChild())) { wantToHowl = true; } } TalentHelper.onLivingUpdate(this); } /** * Called to update the entity's position/logic. */ @Override public void onUpdate() { super.onUpdate(); if (this.openMouthCounter > 0 && ++this.openMouthCounter > 30) //TODO { this.openMouthCounter = 0; this.setHorseWatchableBoolean(128, false); } this.prevMouthOpenness = this.mouthOpenness; if (this.getHorseWatchableBoolean(128)) { this.mouthOpenness += (1.0F - this.mouthOpenness) * 0.7F + 0.05F; if (this.mouthOpenness > 1.0F) { this.mouthOpenness = 1.0F; } } else { this.mouthOpenness += (0.0F - this.mouthOpenness) * 0.7F - 0.05F; if (this.mouthOpenness < 0.0F) { this.mouthOpenness = 0.0F; } } this.headRotationCourseOld = this.headRotationCourse; if (this.func_70922_bv()) { this.headRotationCourse += (1.0F - this.headRotationCourse) * 0.4F; } else { this.headRotationCourse += (0.0F - this.headRotationCourse) * 0.4F; } if (this.isWet()) { this.isWet = true; this.isShaking = false; this.timeWolfIsShaking = 0.0F; this.prevTimeWolfIsShaking = 0.0F; } else if ((this.isWet || this.isShaking) && this.isShaking) { 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) { if(this.rand.nextInt(15) < this.talents.getLevel("fishing") * 2) { if(this.rand.nextInt(15) < this.talents.getLevel("fire") * 2 && this instanceof EntityRedZertum) { if(!this.worldObj.isRemote) { dropItem(Items.cooked_fish, 1); } } else { if(!this.worldObj.isRemote) { dropItem(Items.fish, 1); } } } this.isWet = false; this.isShaking = false; this.prevTimeWolfIsShaking = 0.0F; this.timeWolfIsShaking = 0.0F; } if (this.timeWolfIsShaking > 0.4F) { float f = (float)this.getEntityBoundingBox().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(EnumParticleTypes.WATER_SPLASH, this.posX + (double)f1, (double)(f + 0.8F), this.posZ + (double)f2, this.motionX, this.motionY, this.motionZ, new int[0]); } } } if(this.isTamed()) { EntityPlayer player = (EntityPlayer)this.getOwner(); if(player != null) { float distanceToOwner = player.getDistanceToEntity(this); if (distanceToOwner <= 2F && this.hasBone()) { if(!this.worldObj.isRemote) { this.entityDropItem(new ItemStack(ModItems.toy, 1, 1), 0.0F); } this.setHasBone(false); } } } TalentHelper.onUpdate(this); } @Override public void moveEntityWithHeading(float strafe, float forward) { if (this.riddenByEntity instanceof EntityPlayer) { this.prevRotationYaw = this.rotationYaw = this.riddenByEntity.rotationYaw; this.rotationPitch = this.riddenByEntity.rotationPitch * 0.5F; this.setRotation(this.rotationYaw, this.rotationPitch); this.rotationYawHead = this.renderYawOffset = this.rotationYaw; strafe = ((EntityPlayer)this.riddenByEntity).moveStrafing * 0.5F; forward = ((EntityPlayer)this.riddenByEntity).moveForward; if (forward <= 0.0F) forward *= 0.25F; if (this.onGround) { if (forward > 0.0F) { float f2 = MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F); float f3 = MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F); this.motionX += (double)(-0.4F * f2 * 0.15F); // May change this.motionZ += (double)(0.4F * f3 * 0.15F); } } this.stepHeight = 1.0F; this.jumpMovementFactor = this.getAIMoveSpeed() * 0.2F; if (!this.worldObj.isRemote) { this.setAIMoveSpeed((float)this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue() / 4); super.moveEntityWithHeading(strafe, forward); } if (this.onGround) { //this.jumpPower = 0.0F; // this.setHorseJumping(false); } this.prevLimbSwingAmount = this.limbSwingAmount; double d0 = this.posX - this.prevPosX; double d1 = this.posZ - this.prevPosZ; float f4 = MathHelper.sqrt_double(d0 * d0 + d1 * d1) * 4.0F; if (f4 > 1.0F) f4 = 1.0F; this.limbSwingAmount += (f4 - this.limbSwingAmount) * 0.4F; this.limbSwing += this.limbSwingAmount; } else { this.stepHeight = 0.5F; this.jumpMovementFactor = 0.02F; super.moveEntityWithHeading(strafe, forward); } } @Override public float getAIMoveSpeed() { double speed = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue(); speed += TalentHelper.addToMoveSpeed(this); if((!(this.getAttackTarget() instanceof EntityZertumEntity) && !(this.getAttackTarget() instanceof EntityPlayer)) || this.riddenByEntity instanceof EntityPlayer) if (this.levels.getLevel() == 110 && this.hasEvolved()) speed += 1.0D; if(this.riddenByEntity instanceof EntityPlayer) speed /= 4; return (float)speed; } @Override public void fall(float distance, float damageMultiplier) { if (distance > 1.0F) { this.playSound("game.neutral.hurt.fall.small", 0.4F, 1.0F); } int i = MathHelper.ceiling_float_int(((distance * 0.5F - 3.0F) - TalentHelper.fallProtection(this)) * damageMultiplier); if (i > 0 && !TalentHelper.isImmuneToFalls(this)) { this.attackEntityFrom(DamageSource.fall, (float)i); if (this.riddenByEntity != null) { this.riddenByEntity.attackEntityFrom(DamageSource.fall, (float)i); } Block block = this.worldObj.getBlockState(new BlockPos(this.posX, this.posY - 0.2D - (double)this.prevRotationYaw, this.posZ)).getBlock(); if (block.getMaterial() != Material.air && !this.isSilent()) { Block.SoundType soundtype = block.stepSound; this.worldObj.playSoundAtEntity(this, soundtype.getStepSound(), soundtype.getVolume() * 0.5F, soundtype.getFrequency() * 0.75F); } } } @SideOnly(Side.CLIENT) public boolean isWolfWet() { return this.isWet; } @SideOnly(Side.CLIENT) public float getShadingWhileWet(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; } @SideOnly(Side.CLIENT) public float getInterestedAngle(float p_70917_1_) { return (this.headRotationCourseOld + (this.headRotationCourse - this.headRotationCourseOld) * p_70917_1_) * 0.15F * (float)Math.PI; } public float getEyeHeight() { return this.height * 0.8F; } public int getVerticalFaceSpeed() { return this.isSitting() ? 20 : super.getVerticalFaceSpeed(); } @Override public boolean attackEntityFrom(DamageSource damageSource, float damage) { if (this.isEntityInvulnerable(damageSource)) return false; else { if(!TalentHelper.attackEntityFrom(this, damageSource, damage)) return false; Entity entity = damageSource.getEntity(); this.aiSit.setSitting(false); if (entity != null && !(entity instanceof EntityPlayer) && !(entity instanceof EntityArrow)) damage = (damage + 1.0F) / 2.0F; return super.attackEntityFrom(damageSource, damage); } } @Override public boolean attackEntityAsMob(Entity entity) { if(!TalentHelper.shouldDamageMob(this, entity)) return false; int damage = (int)(4 + (this.effectiveLevel() + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).getBaseValue()) / 2); damage = TalentHelper.attackEntityAsMob(this, entity, damage); if (entity instanceof EntityZombie) ((EntityZombie)entity).setAttackTarget(this); return entity.attackEntityFrom(DamageSource.causeMobDamage(this), (float)damage); } /** * Called when the mob's health reaches 0. */ @Override //TODO public void onDeath(DamageSource par1DamageSource) { super.onDeath(par1DamageSource); if (par1DamageSource.getEntity() instanceof EntityPlayer) { EntityPlayer entityplayer = (EntityPlayer)par1DamageSource.getEntity(); { entityplayer.triggerAchievement(ModAchievements.ZertKill); this.dropChestItems(); } } } protected boolean isMovementBlocked() { return this.isPlayerSleeping() || this.ridingEntity != null || this.riddenByEntity instanceof EntityPlayer || super.isMovementBlocked(); } @Override public double getYOffset() { return this.ridingEntity instanceof EntityPlayer ? 0.5D : 0.0D; } @Override public boolean isPotionApplicable(PotionEffect potionEffect) { if (this.getHealth() <= 1) return false; if(!TalentHelper.isPostionApplicable(this, potionEffect)) return false; return true; } @Override public void setFire(int amount) { if(TalentHelper.setFire(this, amount)) super.setFire(amount); } public int foodValue(ItemStack stack) { if(stack == null || stack.getItem() == null) return 0; int foodValue = 0; Item item = stack.getItem(); if(stack.getItem() != Items.rotten_flesh && item instanceof ItemFood) { ItemFood itemfood = (ItemFood)item; if (itemfood.isWolfsFavoriteMeat()) foodValue = 40; } foodValue = TalentHelper.changeFoodValue(this, stack, foodValue); return foodValue; } public int masterOrder() { int order = 0; EntityPlayer player = (EntityPlayer)this.getOwner(); if (player != null) { float distanceAway = player.getDistanceToEntity(this); ItemStack itemstack = player.inventory.getCurrentItem(); if (itemstack != null && (itemstack.getItem() instanceof ItemTool) && distanceAway <= 20F) order = 1; if (itemstack != null && ((itemstack.getItem() instanceof ItemSword) || (itemstack.getItem() instanceof ItemBow))) order = 2; if (itemstack != null && itemstack.getItem() == Items.wheat) order = 3; } return order; } @Override public boolean isPlayerSleeping() { return false; } @Override public boolean canBreatheUnderwater() { return TalentHelper.canBreatheUnderwater(this); } public boolean canInteract(EntityPlayer player) { return this.isOwner(player) || this.willObeyOthers(); } public int nourishment() { int amount = 0; if (this.getDogHunger() > 0) { amount = 40 + 4 * (this.effectiveLevel() + 1); if (isSitting() && this.talents.getLevel("rapidregen") == 5) { amount += 20 + 2 * (this.effectiveLevel() + 1); } if (!this.isSitting()) { amount *= 5 + this.talents.getLevel("rapidregen"); amount /= 10; } } return amount; } public int effectiveLevel() { return (this.levels.getLevel()) / 2; } public String getDogName() { return this.dataWatcher.getWatchableObjectString(21); } public void setDogName(String var1) { this.dataWatcher.updateObject(21, var1); } public void setWillObeyOthers(boolean flag) { this.dataWatcher.updateObject(26, flag ? 1 : 0); } public boolean willObeyOthers() { return this.dataWatcher.getWatchableObjectInt(26) != 0; } public int points() { return this.levels.getLevel() + (this.getGrowingAge() < 0 ? 0 : 20); } public int spendablePoints() { return this.points() - this.usedPoints(); } public int usedPoints() { return TalentHelper.getUsedPoints(this); } public int deductive(int par1) { byte byte0 = 0; switch(par1) { case 1: return 1; case 2: return 2; case 3: return 4; case 4: return 6; case 5: return 8; default: return 0; } } public int getDogHunger() { return this.dataWatcher.getWatchableObjectInt(23); } public void setDogHunger(int par1) { this.dataWatcher.updateObject(23, MathHelper.clamp_int(par1, 0, 100)); } @Override public boolean func_142018_a(EntityLivingBase entityToAttack, EntityLivingBase owner) { if(TalentHelper.canAttackEntity(this, entityToAttack)) return true; if (!(entityToAttack instanceof EntityCreeper) && !(entityToAttack instanceof EntityGhast)) { if (entityToAttack instanceof EntityZertumEntity) { EntityZertumEntity entityDog = (EntityZertumEntity)entityToAttack; if (entityDog.isTamed() && entityDog.getOwner() == owner) return false; } return entityToAttack instanceof EntityPlayer && owner instanceof EntityPlayer && !((EntityPlayer)owner).canAttackPlayer((EntityPlayer)entityToAttack) ? false : !(entityToAttack instanceof EntityHorse) || !((EntityHorse)entityToAttack).isTame(); } else { return false; } } @Override public boolean canAttackClass(Class p_70686_1_) { if(TalentHelper.canAttackClass(this, p_70686_1_)) return true; return super.canAttackClass(p_70686_1_); } public void setHasBone(boolean hasBone) { this.hasBone = hasBone; } public boolean hasBone() { return this.hasBone; } /** * Gets the pitch of living sounds in living entities. */ @Override protected float getPitch() { if(!this.isChild()) return super.getSoundPitch(); else{ return super.getSoundPitch() * 1; } } @SideOnly(Side.CLIENT) public void handleHealthUpdate(byte p_70103_1_) { if (p_70103_1_ == { this.isShaking = true; this.timeWolfIsShaking = 0.0F; this.prevTimeWolfIsShaking = 0.0F; } else { super.handleHealthUpdate(p_70103_1_); } } /** * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on * the animal type) */ public boolean isBreedingItem(ItemStack itemstack) { return itemstack == null ? false : itemstack.getItem() == ModItems.dogTreat; } public int getMaxSpawnedInChunk() { return 8; } public boolean isAngry() { return (this.dataWatcher.getWatchableObjectByte(INDEX_TAME) & 2) != 0; } public void setAngry(boolean p_70916_1_) { byte b0 = this.dataWatcher.getWatchableObjectByte(INDEX_TAME); if (p_70916_1_) { this.dataWatcher.updateObject(INDEX_TAME, Byte.valueOf((byte)(b0 | 2))); } else { this.dataWatcher.updateObject(INDEX_TAME, Byte.valueOf((byte)(b0 & -3))); } } public EnumDyeColor getCollarColor() { return EnumDyeColor.byDyeDamage(this.dataWatcher.getWatchableObjectByte(INDEX_COLLAR) & 15); } public void setCollarColor(EnumDyeColor collarcolor) { this.dataWatcher.updateObject(INDEX_COLLAR, Byte.valueOf((byte)(collarcolor.getDyeDamage() & 15))); } public boolean isSaddled() { return (this.dataWatcher.getWatchableObjectByte(INDEX_SADDLE) & 1) != 0; } public void setSaddled(boolean p_70900_1_) { if (p_70900_1_) { this.dataWatcher.updateObject(INDEX_SADDLE, Byte.valueOf((byte)1)); } else { this.dataWatcher.updateObject(INDEX_SADDLE, Byte.valueOf((byte)0)); } } public boolean hasEvolved() //TODO { return (this.dataWatcher.getWatchableObjectByte(INDEX_EVOLVE) & 1) != 0; } public void setEvolved(boolean p_70900_1_) { if (p_70900_1_) { this.dataWatcher.updateObject(INDEX_EVOLVE, Byte.valueOf((byte)1)); } else { this.dataWatcher.updateObject(INDEX_EVOLVE, Byte.valueOf((byte)0)); } } private boolean getHorseWatchableBoolean(int p_110233_1_) //TODO { return (this.dataWatcher.getWatchableObjectInt(INDEX_MOUTH) & p_110233_1_) != 0; } private void setHorseWatchableBoolean(int p_110208_1_, boolean p_110208_2_) { int j = this.dataWatcher.getWatchableObjectInt(INDEX_MOUTH); if (p_110208_2_) { this.dataWatcher.updateObject(INDEX_MOUTH, Integer.valueOf(j | p_110208_1_)); } else { this.dataWatcher.updateObject(INDEX_MOUTH, Integer.valueOf(j & ~p_110208_1_)); } } @SideOnly(Side.CLIENT) public float func_110201_q(float p_110201_1_) { return this.prevMouthOpenness + (this.mouthOpenness - this.prevMouthOpenness) * p_110201_1_; } public void openMouth() { if (isServer()) { this.openMouthCounter = 1; this.setHorseWatchableBoolean(128, true); } } public boolean isDashing() //TODO { return (this.dataWatcher.getWatchableObjectByte(INDEX_DASH) & 1) != 0; } public void setDashing(boolean p_70900_1_) { if (p_70900_1_) { this.dataWatcher.updateObject(INDEX_DASH, Byte.valueOf((byte)1)); } else { this.dataWatcher.updateObject(INDEX_DASH, Byte.valueOf((byte)0)); } } /** * Determines if an entity can be despawned, used on idle far away entities */ protected boolean canDespawn() { return !this.isTamed() && this.ticksExisted > 2400; } public boolean allowLeashing() { return !this.isAngry() && super.allowLeashing(); } }
  8. Nvm, I somehow fixed the bug, now it jumps. And thanks for your help!
  9. And the Jakan Code package common.zeroquest.entity; import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.material.Material; 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.EntityAIAttackOnCollide; import net.minecraft.entity.ai.EntityAIFollowOwner; import net.minecraft.entity.ai.EntityAIHurtByTarget; import net.minecraft.entity.ai.EntityAILeapAtTarget; import net.minecraft.entity.ai.EntityAILookIdle; import net.minecraft.entity.ai.EntityAIMate; import net.minecraft.entity.ai.EntityAINearestAttackableTarget; import net.minecraft.entity.ai.EntityAIOwnerHurtByTarget; import net.minecraft.entity.ai.EntityAIOwnerHurtTarget; import net.minecraft.entity.ai.EntityAISwimming; import net.minecraft.entity.ai.EntityAITargetNonTamed; import net.minecraft.entity.ai.EntityAIWander; import net.minecraft.entity.ai.EntityAIWatchClosest; import net.minecraft.entity.monster.EntityCreeper; import net.minecraft.entity.monster.EntitySkeleton; import net.minecraft.entity.passive.EntityAnimal; import net.minecraft.entity.passive.EntityCow; import net.minecraft.entity.passive.EntityPig; import net.minecraft.entity.passive.EntitySheep; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.init.Items; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.pathfinding.PathNavigateGround; import net.minecraft.potion.PotionEffect; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraft.util.DamageSource; import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import com.google.common.base.Predicate; import common.zeroquest.ModAchievements; import common.zeroquest.ModItems; import common.zeroquest.ZeroQuest; import common.zeroquest.core.proxy.CommonProxy; import common.zeroquest.inventory.InventoryPack; import common.zeroquest.lib.Constants; import common.zeroquest.lib.Sound; import common.zeroquest.util.ItemUtils; public class EntityJakan extends EntityCustomTameable /*implements IRangedAttackMob*/ { public static final double maxHealth = 50; public static final double attackDamage = 6; public static final double speed = 0.30000001192092896; public static final double maxHealthTamed = 60; public static final double attackDamageTamed = 8; public static final double maxHealthBaby = 10; public static final double attackDamageBaby = 2; // data value IDs TODO /**DO NOT CHANGE!**/ public static final int INDEX_TAME = 16; public static final int INDEX_SADDLE = 19; public EntityJakan(World worldIn) { super(worldIn); this.setSize(2.6F, 2.6F); this.isImmuneToFire = true; ((PathNavigateGround)this.getNavigator()).func_179690_a(true); 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(6, new EntityAIMate(this, 1.0D)); this.tasks.addTask(7, new EntityAIWander(this, 1.0D)); this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); this.tasks.addTask(9, new EntityAILookIdle(this)); this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true, new Class[0])); this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntityAnimal.class, false, new Predicate() { private static final String __OBFID = "CL_00002229"; public boolean func_180094_a(Entity p_180094_1_) { return p_180094_1_ instanceof EntitySheep || p_180094_1_ instanceof EntityPig || p_180094_1_ instanceof EntityCow; } public boolean apply(Object p_apply_1_) { return this.func_180094_a((Entity)p_apply_1_); } })); this.setTamed(false); this.inventory = new InventoryPack(this); } @Override protected void applyEntityAttributes() { super.applyEntityAttributes(); this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxHealth); this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(attackDamage); this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(speed); if (this.isTamed()) { this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxHealthTamed); this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(attackDamageTamed); } else if (this.isChild()) { this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxHealthBaby); this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(attackDamageBaby); } } /** * Sets the active target the Task system uses for tracking */ @Override 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); } } @Override protected void entityInit() { super.entityInit(); this.dataWatcher.addObject(INDEX_SADDLE, Byte.valueOf((byte)0)); } @Override protected void playStepSound(BlockPos p_180429_1_, Block p_180429_2_) { if (inWater) { // no sounds for underwater action } else if (this.isChild()) { // play default step sound for babies super.playStepSound(p_180429_1_, p_180429_2_); } else { // play stomping for bigger dragons worldObj.playSoundAtEntity(this, Sound.Step, 0.15F, 1.0F); } } @Override public void writeEntityToNBT(NBTTagCompound tagCompound) { super.writeEntityToNBT(tagCompound); tagCompound.setBoolean("Angry", this.isAngry()); tagCompound.setBoolean("Saddle", this.getSaddled()); } @Override public void readEntityFromNBT(NBTTagCompound tagCompund) { super.readEntityFromNBT(tagCompund); this.setAngry(tagCompund.getBoolean("Angry")); this.setSaddled(tagCompund.getBoolean("Saddle")); } /** * Returns the sound this mob makes while it's alive. */ @Override protected String getLivingSound() { return this.canSeeCreeper ? Sound.JakanGrowl : this.isAngry() ? Sound.JakanSnarl : this.getHealth() <=10 ? Sound.JakanWhine : (this.rand.nextInt(3) == 0 ? (Sound.JakanBreathe) : Sound.JakanRoar); } @Override public void playLivingSound() { String sound = getLivingSound(); if (sound == null) { return; } if (!this.isChild()) { float volume = getSoundVolume() * 1.0f; float pitch = getSoundPitch(); this.playSound(sound, volume, pitch); }else{ float volume = getSoundVolume() * 1.0f; float pitch = getSoundPitch() * 2; this.playSound(sound, volume, pitch); } } /** * Returns the sound this mob makes when it is hurt. */ @Override protected String getHurtSound() { return "mob.enderdragon.hit"; } /** * Returns the sound this mob makes on death. */ @Override protected String getDeathSound() { return Sound.JakanDeath; } /** * Get number of ticks, at least during which the living entity will be silent. */ @Override public int getTalkInterval() { if(this.canSeeCreeper){ return 40; }else if(this.getHealth() <=10){ return 20; }else{ return 200; } } /** * Returns the item ID for the item the mob drops on death. */ @Override protected void dropFewItems(boolean par1, int par2) { rare = rand.nextInt(20); { if (this.isBurning()) { this.dropItem(ModItems.jakanMeatCooked, 1); } else if (rare <= 12) { this.dropItem(ModItems.jakanMeatRaw, 1); } if(rare <= 6 && !this.isTamed()) { this.dropItem(ModItems.nileGrain, 1); } if (this.getSaddled()) { this.dropItem(Items.saddle, 1); } else { } } } /** * 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. */ @Override public void onLivingUpdate() //TODO { super.onLivingUpdate(); if (isServer() && this.getAttackTarget() == null && this.isAngry()) { this.setAngry(false); } if(Constants.DEF_HEALING == true && !this.isChild() && this.getHealth() <=10 && this.isTamed()) { this.addPotionEffect(new PotionEffect(10, 200)); } //Dying if(this.getHealth() <=10 && this.isTamed()){ //TODO double d0 = this.rand.nextGaussian() * 0.04D; double d1 = this.rand.nextGaussian() * 0.04D; double d2 = this.rand.nextGaussian() * 0.04D; worldObj.spawnParticle(EnumParticleTypes.SPELL_WITCH, this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, d0, d1, d2); } if (this.getAttackTarget() == null && isTamed() && 15 > 0) { List list1 = worldObj.getEntitiesWithinAABB(EntityCreeper.class, AxisAlignedBB.fromBounds(posX, posY, posZ, posX + 1.0D, posY + 1.0D, posZ + 1.0D).expand(sniffRange(), 4D, sniffRange())); if (!list1.isEmpty() && !isSitting() && this.getHealth() > 1 && !this.isChild()) { canSeeCreeper = true; } else { canSeeCreeper = false; } } } public float getEyeHeight() { return this.height * 0.8F; } public int getVerticalFaceSpeed() { return this.isSitting() ? 20 : super.getVerticalFaceSpeed(); } /** * Called when the entity is attacked. */ @Override public boolean attackEntityFrom(DamageSource source, float amount) { if (this.isEntityInvulnerable(source)) { return false; } else { Entity entity = source.getEntity(); this.aiSit.setSitting(false); if (entity != null && !(entity instanceof EntityPlayer) && !(entity instanceof EntityArrow)) { amount = (amount + 1.0F) / 2.0F; } return super.attackEntityFrom(source, amount); } } public boolean attackEntityAsMob(Entity par1Entity) { float damage = (float)this.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue(); int i = 0; int critChance = 5; critChance += 2; if (rand.nextInt(6) < critChance) { //TODO damage += (damage + 3) / 2; double d0 = this.rand.nextGaussian() * 0.02D; double d1 = this.rand.nextGaussian() * 0.02D; double d2 = this.rand.nextGaussian() * 0.02D; worldObj.spawnParticle(EnumParticleTypes.CRIT, this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, d0, d1, d2); } boolean flag = par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), damage); if (flag) { if (i > 0) { par1Entity.addVelocity((double)(-MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F) * (float)i * 0.5F), 0.1D, (double)(MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F) * (float)i * 0.5F)); this.motionX *= 0.6D; this.motionZ *= 0.6D; } float volume = getSoundVolume() * 0.7f; float pitch = getPitch(); worldObj.playSoundAtEntity(this, "random.eat", volume, pitch); } return flag; } /** * 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 par1EntityPlayer) { ItemStack itemstack = par1EntityPlayer.inventory.getCurrentItem(); if (this.isTamed()) { if (itemstack != null) { if (itemstack.getItem() instanceof ItemFood) { ItemFood itemfood = null; if(getHealthRelative() < 1) { itemfood = (ItemFood) ItemUtils.consumeEquipped(par1EntityPlayer, Items.fish, Items.porkchop, Items.beef, Items.chicken, Items.rabbit, Items.mutton, Items.cooked_porkchop, Items.cooked_beef, Items.cooked_chicken, Items.cooked_fish, Items.cooked_rabbit, Items.cooked_mutton, ModItems.jakanMeatRaw, ModItems.jakanMeatCooked, ModItems.zertumMeatRaw, ModItems.zertumMeatCooked, ModItems.vitoidFruit); if (itemfood != null) { float volume = getSoundVolume() * 1.0f; float pitch = getPitch(); worldObj.playSoundAtEntity(this, "random.eat", volume, pitch); this.heal((float)itemfood.getHealAmount(itemstack)); } return true; } } else if(!this.isChild() && ItemUtils.hasEquipped(par1EntityPlayer, Items.saddle)) //TODO { this.setSaddled(true); } else if(itemstack.getItem() == Items.stick && canInteract(par1EntityPlayer)) //TODO { if(isServer()){ par1EntityPlayer.openGui(ZeroQuest.instance, CommonProxy.PetPack, this.worldObj, this.getEntityId(), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)); this.worldObj.playSoundEffect(this.posX, this.posY + 0.5D, this.posZ, "random.chestopen", 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); return true; } } else if (isServer() && this.getSaddled() && !this.isChild() && this.riddenByEntity == null && par1EntityPlayer.ridingEntity == null && !par1EntityPlayer.onGround && !ItemUtils.hasEquippedUsable(par1EntityPlayer) || par1EntityPlayer.getHeldItem() == null) { this.getSitAI().setSitting(false); this.setSitting(false); par1EntityPlayer.mountEntity(this); par1EntityPlayer.triggerAchievement(ModAchievements.MountUp); } } if (canInteract(par1EntityPlayer) && isServer() && !this.isBreedingItem(itemstack)) { this.aiSit.setSitting(!this.isSitting()); this.isJumping = false; this.navigator.clearPathEntity(); this.setAttackTarget((EntityLivingBase)null); } } else if (ItemUtils.consumeEquipped(par1EntityPlayer, ModItems.nileBone) && !this.isAngry()) { if (isServer()) { tamedFor(par1EntityPlayer, rand.nextInt(3) == 0); } return true; } return super.interact(par1EntityPlayer); } @Override public void moveEntityWithHeading(float strafe, float forward) { if (this.riddenByEntity instanceof EntityPlayer) { this.prevRotationYaw = this.rotationYaw = this.riddenByEntity.rotationYaw; this.rotationPitch = this.riddenByEntity.rotationPitch * 0.5F; this.setRotation(this.rotationYaw, this.rotationPitch); this.rotationYawHead = this.renderYawOffset = this.rotationYaw; strafe = ((EntityPlayer)this.riddenByEntity).moveStrafing * 0.5F; forward = ((EntityPlayer)this.riddenByEntity).moveForward; if (forward <= 0.0F) forward *= 0.25F; if (this.onGround) { if (forward > 0.0F) { float f2 = MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F); float f3 = MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F); this.motionX += (double)(-0.4F * f2 * 0.15F); // May change this.motionZ += (double)(0.4F * f3 * 0.15F); } } this.stepHeight = 1.0F; this.jumpMovementFactor = this.getAIMoveSpeed() * 0.2F; if (!this.worldObj.isRemote) { this.setAIMoveSpeed((float)this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue() / 4); super.moveEntityWithHeading(strafe, forward); } if (this.onGround) { //this.jumpPower = 0.0F; // this.setHorseJumping(false); } this.prevLimbSwingAmount = this.limbSwingAmount; double d0 = this.posX - this.prevPosX; double d1 = this.posZ - this.prevPosZ; float f4 = MathHelper.sqrt_double(d0 * d0 + d1 * d1) * 4.0F; if (f4 > 1.0F) f4 = 1.0F; this.limbSwingAmount += (f4 - this.limbSwingAmount) * 0.4F; this.limbSwing += this.limbSwingAmount; } else { this.stepHeight = 0.5F; this.jumpMovementFactor = 0.02F; super.moveEntityWithHeading(strafe, forward); } } @Override public void fall(float distance, float damageMultiplier) { if (distance > 1.0F) { this.playSound(Sound.Land, 0.4F, 1.0F); } int i = MathHelper.ceiling_float_int((distance * 0.5F - 3.0F) * damageMultiplier); if (i > 0) { this.attackEntityFrom(DamageSource.fall, (float)i); if (this.riddenByEntity != null) { this.riddenByEntity.attackEntityFrom(DamageSource.fall, (float)i); } Block block = this.worldObj.getBlockState(new BlockPos(this.posX, this.posY - 0.2D - (double)this.prevRotationYaw, this.posZ)).getBlock(); if (block.getMaterial() != Material.air && !this.isSilent()) { Block.SoundType soundtype = block.stepSound; this.worldObj.playSoundAtEntity(this, soundtype.getStepSound(), soundtype.getVolume() * 0.5F, soundtype.getFrequency() * 0.75F); } } } @Override public float getAIMoveSpeed() { double speed = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue(); speed += 0.2; if((!(this.getAttackTarget() instanceof EntityJakan) && !(this.getAttackTarget() instanceof EntityPlayer)) || this.riddenByEntity instanceof EntityPlayer) speed /= 4; return (float)speed; } /** * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on * the animal type) */ public boolean isBreedingItem(ItemStack itemstack) { return itemstack == null ? false : itemstack.getItem() == ModItems.vitoidFruit; } public int getMaxSpawnedInChunk() { return 8; } public boolean isAngry() { return (this.dataWatcher.getWatchableObjectByte(INDEX_TAME) & 2) != 0; } public void setAngry(boolean p_70916_1_) { byte b0 = this.dataWatcher.getWatchableObjectByte(INDEX_TAME); if (p_70916_1_) { this.dataWatcher.updateObject(INDEX_TAME, Byte.valueOf((byte)(b0 | 2))); } else { this.dataWatcher.updateObject(INDEX_TAME, Byte.valueOf((byte)(b0 & -3))); } } public boolean getSaddled() { return (this.dataWatcher.getWatchableObjectByte(INDEX_SADDLE) & 1) != 0; } public void setSaddled(boolean p_70900_1_) { if (p_70900_1_) { this.dataWatcher.updateObject(INDEX_SADDLE, Byte.valueOf((byte)1)); } else { this.dataWatcher.updateObject(INDEX_SADDLE, Byte.valueOf((byte)0)); } } public EntityJakan createChild(EntityAgeable p_90011_1_) { EntityJakan entityJakan = new EntityJakan(this.worldObj); String s = this.getOwnerId(); if (s != null && s.trim().length() > 0) { entityJakan.setOwnerId(s); entityJakan.setTamed(true); } return entityJakan; } /** * Returns true if the mob is currently able to mate with the specified mob. */ public boolean canMateWith(EntityAnimal p_70878_1_) { if (p_70878_1_ == this) { return false; } else if (!this.isTamed()) { return false; } else if (!(p_70878_1_ instanceof EntityJakan)) { return false; } else { EntityJakan entitywolf = (EntityJakan)p_70878_1_; return !entitywolf.isTamed() ? false : (entitywolf.isSitting() ? false : this.isInLove() && entitywolf.isInLove()); } } /** * Determines if an entity can be despawned, used on idle far away entities */ protected boolean canDespawn() { return !this.isTamed() && this.ticksExisted > 2400; } public boolean allowLeashing() { return !this.isAngry() && super.allowLeashing(); } }
  10. Oh wait... I noticed that the JakanJump isn't working. And by not working I mean the entity isn't jumping, but the Zertums are here is the code package common.zeroquest.network.imessage; import common.zeroquest.ZeroQuest; import common.zeroquest.entity.EntityJakan; import io.netty.buffer.ByteBuf; import net.minecraft.entity.Entity; import net.minecraft.potion.Potion; 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 JakanJump implements IMessage{ public int entityId; public JakanJump(){} public JakanJump(int entityId) { this.entityId = entityId; } @Override public void fromBytes(ByteBuf buf) { entityId = buf.readInt(); } @Override public void toBytes(ByteBuf buf) { buf.writeInt(this.entityId); } public static class Handler implements IMessageHandler<JakanJump, IMessage> { public Handler(){} @Override public IMessage onMessage(JakanJump message, MessageContext ctx) { Entity target = ctx.getServerHandler().playerEntity; if(!(target instanceof EntityJakan)) return null; EntityJakan dog = (EntityJakan)target; if(dog.onGround) { dog.motionY = 2F * 2 * 0.1F; if(dog.isPotionActive(Potion.jump)) dog.motionY += (double)((float)(dog.getActivePotionEffect(Potion.jump).getAmplifier() + 3) * 0.1F); dog.isAirBorne = true; } return message; } } }
  11. Yep, that did the trick, after cleaning up and fixing up my code, it works now. Thanks guys!
  12. *facepalm* Welp.. I feel stupid. Thanks for that tip
  13. Since the IMessage packets doesn't have an option where I can get the player, I get the one thats on my proxy
  14. Hold on a second, I have to set up a new worktable for eclipse, I accidentally deleted something major in the worktable and now it's not running the client or server at all.
  15. I'm trying to send the packets to the server similar to the old packets. My mod needs the packets sent over to the server to be able to work correctly
  16. What I do know so far that the name, mode, and obey (I think since I haven't acutally gotten to test it), packet works on the server. The jump and command seal ones are unknown to where they work on.
  17. The problem is, parts of the methods inside the packets ONLY go to the server or client the rest goes to either the server or client, when I try switching the sides, it works a little bit but then it halts altogether. For instance, the command seal in general doesn't work, I try sending it to client, then to server, but it does not force the entity I made to sit.
  18. It doesn't look like that this new one works with the code.. because especially since the old packets look like were being pushed through either client and server universal (basically, a handler in the old packets automatically registered the packets so I don't know what parts works on server and what works on client)
  19. Thats the thing, NOTHING is responding, I try the items, the creature never responds like it did originally with the old packets. I input text in the gui I have (it's suppose to show up over the entity's head) but they do not show up.
  20. Now none of the packets are working package common.zeroquest.core.handlers; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraftforge.fml.common.network.NetworkRegistry; import net.minecraftforge.fml.common.network.simpleimpl.IMessage; import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper; import net.minecraftforge.fml.relauncher.Side; import common.zeroquest.lib.Constants; import common.zeroquest.network.packet.JakanJump; import common.zeroquest.network.packet.SealCommand; import common.zeroquest.network.packet.ZertumJump; import common.zeroquest.network.packet.ZertumMode; import common.zeroquest.network.packet.ZertumName; import common.zeroquest.network.packet.ZertumObey; import common.zeroquest.network.packet.ZertumTalents; /** * * This class will house the SimpleNetworkWrapper instance, which I will name 'dispatcher', * as well as give us a logical place from which to register our packets. These two things * could be done anywhere, however, even in your Main class, but I will be adding other * functionality (see below) that gives this class a bit more utility. * * While unnecessary, I'm going to turn this class into a 'wrapper' for SimpleNetworkWrapper * so that instead of writing "PacketDispatcher.dispatcher.{method}" I can simply write * "PacketDispatcher.{method}" All this does is make it quicker to type and slightly shorter; * if you do not care about that, then make the 'dispatcher' field public instead of private, * or, if you do not want to add a new class just for one field and one static method that * you could put anywhere, feel free to put them wherever. * * For further convenience, I have also added two extra sendToAllAround methods: one which * takes an EntityPlayer and one which takes coordinates. * */ public class PacketHandler { // a simple counter will allow us to get rid of 'magic' numbers used during packet registration private static byte packetId = 0; /** * The SimpleNetworkWrapper instance is used both to register and send packets. * Since I will be adding wrapper methods, this field is private, but you should * make it public if you plan on using it directly. */ private static final SimpleNetworkWrapper dispatcher = NetworkRegistry.INSTANCE.newSimpleChannel(Constants.channel); /** * Call this during pre-init or loading and register all of your packets (messages) here */ public static final void registerPackets() { // Using an incrementing field instead of hard-coded numerals, I don't need to think // about what number comes next or if I missed on should I ever rearrange the order // of registration (for instance, if you wanted to alphabetize them... yeah...) // It's even easier if you create a convenient 'registerMessage' method: PacketHandler.registerMessage(ZertumJump.Handler.class, ZertumJump.class, Side.CLIENT); PacketHandler.registerMessage(SealCommand.Handler.class, SealCommand.class, Side.CLIENT); PacketHandler.registerMessage(ZertumObey.Handler.class, ZertumObey.class, Side.CLIENT); PacketHandler.registerMessage(JakanJump.Handler.class, JakanJump.class, Side.CLIENT); PacketHandler.registerMessage(ZertumName.Handler.class, ZertumName.class, Side.CLIENT); PacketHandler.registerMessage(ZertumMode.Handler.class, ZertumMode.class, Side.CLIENT); PacketHandler.registerMessage(ZertumTalents.Handler.class, ZertumTalents.class, Side.CLIENT); // If you don't want to make a 'registerMessage' method, you can do it directly: //PacketDispatcher.dispatcher.registerMessage(OpenGuiMessage.OpenGuiMessageHandler.class, OpenGuiMessage.class, packetId++, Side.SERVER); //PacketDispatcher.dispatcher.registerMessage(SyncPlayerPropsMessage.SyncPlayerPropsMessageHandler.class, SyncPlayerPropsMessage.class, packetId++, Side.CLIENT); } /** * Registers a message and message handler */ private static final void registerMessage(Class handlerClass, Class messageClass, Side side) { PacketHandler.dispatcher.registerMessage(handlerClass, messageClass, packetId++, side); //PacketHandler.dispatcher.registerMessage(handlerClass, messageClass, packetId++, side); } //========================================================// // The following methods are the 'wrapper' methods; again, // this just makes sending a message slightly more compact // and is purely a matter of stylistic preference //========================================================// /** * Send this message to the specified player. * See {@link SimpleNetworkWrapper#sendTo(IMessage, EntityPlayerMP)} */ public static final void sendTo(IMessage message, EntityPlayerMP player) { PacketHandler.dispatcher.sendTo(message, player); } /** * Send this message to everyone within a certain range of a point. * See {@link SimpleNetworkWrapper#sendToDimension(IMessage, NetworkRegistry.TargetPoint)} */ public static final void sendToAllAround(IMessage message, NetworkRegistry.TargetPoint point) { PacketHandler.dispatcher.sendToAllAround(message, point); } /** * Sends a message to everyone within a certain range of the coordinates in the same dimension. */ public static final void sendToAllAround(IMessage message, int dimension, double x, double y, double z, double range) { PacketHandler.sendToAllAround(message, new NetworkRegistry.TargetPoint(dimension, x, y, z, range)); } /** * Sends a message to everyone within a certain range of the player provided. */ public static final void sendToAllAround(IMessage message, EntityPlayer player, double range) { PacketHandler.sendToAllAround(message, player.worldObj.provider.getDimensionId(), player.posX, player.posY, player.posZ, range); } /** * Send this message to everyone within the supplied dimension. * See {@link SimpleNetworkWrapper#sendToDimension(IMessage, int)} */ public static final void sendToDimension(IMessage message, int dimensionId) { PacketHandler.dispatcher.sendToDimension(message, dimensionId); } /** * Send this message to the server. * See {@link SimpleNetworkWrapper#sendToServer(IMessage)} */ public static final void sendToServer(IMessage message) { PacketHandler.dispatcher.sendToServer(message); } }
  21. Now I'm crashing [15:13:59] [main/INFO] [GradleStart]: Extra: [] [15:14:00] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --assetsDir, C:/Users/NovaPC/.gradle/caches/minecraft/assets, --assetIndex, 1.8, --accessToken, {REDACTED}, --version, 1.8, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.GradleStartCommon$GradleStartTweaker] [15:14:00] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker [15:14:00] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker [15:14:00] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.GradleStartCommon$GradleStartTweaker [15:14:00] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker [15:14:00] [main/INFO] [FML]: Forge Mod Loader version 8.0.42.1338 for Minecraft 1.8 loading [15:14:00] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_25, running on Windows 7:amd64:6.1, installed at C:\Program Files\Java\jre1.8.0_25 [15:14:00] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation [15:14:00] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.GradleStartCommon$GradleStartTweaker [15:14:00] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin [15:14:00] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin [15:14:00] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker [15:14:00] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker [15:14:00] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker [15:14:00] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker [15:14:00] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper [15:14:00] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work! [15:14:04] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing [15:14:04] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper [15:14:04] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker [15:14:05] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker [15:14:05] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker [15:14:05] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main} [15:14:10] [Client thread/INFO]: Setting user: Player722 [15:14:15] [Client thread/INFO]: LWJGL Version: 2.9.1 [15:14:17] [Client thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization [15:14:17] [Client thread/INFO] [FML]: MinecraftForge v11.14.1.1338 Initialized [15:14:17] [Client thread/INFO] [FML]: Replaced 204 ore recipies [15:14:17] [Client thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization [15:14:17] [Client thread/INFO] [FML]: Searching C:\Users\NovaPC\Desktop\ModStuff\Code1.8\eclipse\mods for mods [15:14:20] [Client thread/INFO] [FML]: Forge Mod Loader has identified 4 mods to load [15:14:21] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, zero_quest] at CLIENT [15:14:21] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, zero_quest] at SERVER [15:14:22] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Zero Quest [15:14:22] [Client thread/INFO] [FML]: Processing ObjectHolder annotations [15:14:22] [Client thread/INFO] [FML]: Found 384 ObjectHolder annotations [15:14:22] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0 [15:14:22] [Client thread/INFO] [Zero Quest]: -----PRE-CONTENT LOAD INITATING----- [15:14:22] [Client thread/INFO] [Zero Quest]: Loading Main Stuff... [15:14:22] [Client thread/INFO] [Zero Quest]: Load Stuff Loaded Successfully! [15:14:22] [Client thread/INFO] [Zero Quest]: -----PRE-CONTENT LOAD FINISHED----- [15:14:22] [Client thread/INFO] [FML]: Applying holder lookups [15:14:22] [Client thread/INFO] [FML]: Holder lookups applied [15:14:22] [sound Library Loader/INFO]: Starting up SoundSystem... [15:14:23] [Thread-7/INFO]: Initializing LWJGL OpenAL [15:14:23] [Thread-7/INFO]: (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org) [15:14:23] [Thread-7/INFO]: OpenAL initialized. [15:14:23] [sound Library Loader/INFO]: Sound engine started [15:14:28] [Client thread/INFO]: Created: 512x512 textures-atlas [15:14:29] [Client thread/ERROR] [FML]: Fatal errors were detected during the transition from INITIALIZATION to POSTINITIALIZATION. Loading cannot continue [15:14:29] [Client thread/ERROR] [FML]: mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized FML{8.0.42.1338} [Forge Mod Loader] (forgeSrc-1.8-11.14.1.1338.jar) Unloaded->Constructed->Pre-initialized->Initialized Forge{11.14.1.1338} [Minecraft Forge] (forgeSrc-1.8-11.14.1.1338.jar) Unloaded->Constructed->Pre-initialized->Initialized zero_quest{v1.6.0} [Zero Quest] (bin) Unloaded->Constructed->Pre-initialized->Errored [15:14:29] [Client thread/ERROR] [FML]: The following problems were captured during this phase [15:14:29] [Client thread/ERROR] [FML]: Caught exception from zero_quest java.lang.IllegalArgumentException: Duplicate handler name: common.zeroquest.network.packet.ZertumJump$Handler at io.netty.channel.DefaultChannelPipeline.checkDuplicateName(DefaultChannelPipeline.java:898) ~[netty-all-4.0.15.Final.jar:4.0.15.Final] at io.netty.channel.DefaultChannelPipeline.addAfter(DefaultChannelPipeline.java:191) ~[netty-all-4.0.15.Final.jar:4.0.15.Final] at io.netty.channel.DefaultChannelPipeline.addAfter(DefaultChannelPipeline.java:183) ~[netty-all-4.0.15.Final.jar:4.0.15.Final] at net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper.addClientHandlerAfter(SimpleNetworkWrapper.java:153) ~[forgeSrc-1.8-11.14.1.1338.jar:?] at net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper.registerMessage(SimpleNetworkWrapper.java:140) ~[forgeSrc-1.8-11.14.1.1338.jar:?] at net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper.registerMessage(SimpleNetworkWrapper.java:106) ~[forgeSrc-1.8-11.14.1.1338.jar:?] at common.zeroquest.core.handlers.PacketHandler.registerMessage(PacketHandler.java:75) ~[bin/:?] at common.zeroquest.core.handlers.PacketHandler.registerPackets(PacketHandler.java:57) ~[bin/:?] at common.zeroquest.ZeroQuest.load(ZeroQuest.java:86) ~[bin/:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_25] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_25] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_25] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_25] at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:518) ~[forgeSrc-1.8-11.14.1.1338.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_25] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_25] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_25] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_25] at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?] at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?] at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:208) ~[forgeSrc-1.8-11.14.1.1338.jar:?] at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:187) ~[forgeSrc-1.8-11.14.1.1338.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_25] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_25] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_25] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_25] at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?] at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?] at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:118) [LoadController.class:?] at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:692) [Loader.class:?] at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:291) [FMLClientHandler.class:?] at net.minecraft.client.Minecraft.startGame(Minecraft.java:521) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:356) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:117) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_25] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_25] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_25] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_25] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.11.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.11.jar:?] at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?] at GradleStart.main(Unknown Source) [start/:?] [15:14:30] [Client thread/INFO] [sTDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:660]: ---- Minecraft Crash Report ---- // There are four lights! Time: 3/31/15 3:14 PM Description: Initializing game java.lang.IllegalArgumentException: Duplicate handler name: common.zeroquest.network.packet.ZertumJump$Handler at io.netty.channel.DefaultChannelPipeline.checkDuplicateName(DefaultChannelPipeline.java:898) at io.netty.channel.DefaultChannelPipeline.addAfter(DefaultChannelPipeline.java:191) at io.netty.channel.DefaultChannelPipeline.addAfter(DefaultChannelPipeline.java:183) at net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper.addClientHandlerAfter(SimpleNetworkWrapper.java:153) at net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper.registerMessage(SimpleNetworkWrapper.java:140) at net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper.registerMessage(SimpleNetworkWrapper.java:106) at common.zeroquest.core.handlers.PacketHandler.registerMessage(PacketHandler.java:75) at common.zeroquest.core.handlers.PacketHandler.registerPackets(PacketHandler.java:57) at common.zeroquest.ZeroQuest.load(ZeroQuest.java:86) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:518) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:208) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:187) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:118) at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:692) at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:291) at net.minecraft.client.Minecraft.startGame(Minecraft.java:521) at net.minecraft.client.Minecraft.run(Minecraft.java:356) at net.minecraft.client.main.Main.main(Main.java:117) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) at GradleStart.main(Unknown Source) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at io.netty.channel.DefaultChannelPipeline.checkDuplicateName(DefaultChannelPipeline.java:898) at io.netty.channel.DefaultChannelPipeline.addAfter(DefaultChannelPipeline.java:191) at io.netty.channel.DefaultChannelPipeline.addAfter(DefaultChannelPipeline.java:183) at net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper.addClientHandlerAfter(SimpleNetworkWrapper.java:153) at net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper.registerMessage(SimpleNetworkWrapper.java:140) at net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper.registerMessage(SimpleNetworkWrapper.java:106) at common.zeroquest.core.handlers.PacketHandler.registerMessage(PacketHandler.java:75) at common.zeroquest.core.handlers.PacketHandler.registerPackets(PacketHandler.java:57) at common.zeroquest.ZeroQuest.load(ZeroQuest.java:86) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:518) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:208) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:187) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:118) at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:692) at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:291) at net.minecraft.client.Minecraft.startGame(Minecraft.java:521) -- Initialization -- Details: Stacktrace: at net.minecraft.client.Minecraft.run(Minecraft.java:356) at net.minecraft.client.main.Main.main(Main.java:117) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) at GradleStart.main(Unknown Source) -- System Details -- Details: Minecraft Version: 1.8 Operating System: Windows 7 (amd64) version 6.1 Java Version: 1.8.0_25, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 729311128 bytes (695 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v9.10 FML v8.0.42.1338 Minecraft Forge 11.14.1.1338 4 mods loaded, 4 mods active mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized FML{8.0.42.1338} [Forge Mod Loader] (forgeSrc-1.8-11.14.1.1338.jar) Unloaded->Constructed->Pre-initialized->Initialized Forge{11.14.1.1338} [Minecraft Forge] (forgeSrc-1.8-11.14.1.1338.jar) Unloaded->Constructed->Pre-initialized->Initialized zero_quest{v1.6.0} [Zero Quest] (bin) Unloaded->Constructed->Pre-initialized->Errored Loaded coremods (and transformers): Launched Version: 1.8 LWJGL: 2.9.1 OpenGL: AMD Radeon(TM) HD 6620G GL version 4.1.11156 Compatibility Profile Context, ATI Technologies Inc. GL Caps: Using GL 1.3 multitexturing. Using GL 1.3 texture combiners. Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported. Shaders are available because OpenGL 2.1 is supported. VBOs are available because OpenGL 1.5 is supported. Using VBOs: No Is Modded: Definitely; Client brand changed to 'fml,forge' Type: Client (map_client.txt) Resource Packs: [] Current Language: English (US) Profiler Position: N/A (disabled) [15:14:30] [Client thread/INFO] [sTDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:660]: #@!@# Game crashed! Crash report saved to: #@!@# C:\Users\NovaPC\Desktop\ModStuff\Code1.8\eclipse\.\crash-reports\crash-2015-03-31_15.14.30-client.txt AL lib: (EE) alc_cleanup: 1 device not closed Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release CommandSeal package common.zeroquest.network.packet; import io.netty.buffer.ByteBuf; import java.util.List; import net.minecraft.client.Minecraft; import net.minecraft.client.multiplayer.WorldClient; import net.minecraft.entity.EntityLivingBase; 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.world.World; 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 common.zeroquest.ModItems; import common.zeroquest.ZeroQuest; import common.zeroquest.core.helper.ChatHelper; import common.zeroquest.entity.EntityZertumEntity; import common.zeroquest.entity.util.ModeUtil.EnumMode; public class SealCommand implements IMessage{ public int commandId; public SealCommand(){} public SealCommand(int commandId) { this.commandId = commandId; } @Override public void fromBytes(ByteBuf buf) { commandId = buf.readInt(); } @Override public void toBytes(ByteBuf buf) { buf.writeInt(this.commandId); } public static class Handler implements IMessageHandler<SealCommand, IMessage> { public Handler(){} @Override public IMessage onMessage(final SealCommand message, MessageContext ctx) { Minecraft minecraft = Minecraft.getMinecraft(); final WorldClient worldClient = minecraft.theWorld; minecraft.addScheduledTask(new Runnable() { public void run() { processMessage(worldClient, message); } }); return null; } } public static void processMessage(final WorldClient worldClient, SealCommand message){ EntityPlayer player = ZeroQuest.proxy.getClientPlayer(); World world = player.worldObj; ItemStack stack = player.getCurrentEquippedItem(); if(stack == null) return; if(stack.getItem() == ModItems.commandSeal) { if(message.commandId == 1) { world.playSoundAtEntity(player, "random.bow", 0.5F, 0.4F / (world.rand.nextFloat() * 0.4F + 0.8F)); boolean isDog = false; List nearEnts = world.getEntitiesWithinAABBExcludingEntity(player, player.getEntityBoundingBox().expand(20D, 20D, 20D)); for (Object o : nearEnts) { if (o instanceof EntityZertumEntity) { EntityZertumEntity dog = (EntityZertumEntity)o; if(dog.canInteract(player)) { dog.getSitAI().setSitting(false); dog.getNavigator().clearPathEntity(); dog.setAttackTarget((EntityLivingBase)null); if(dog.mode.isMode(EnumMode.WANDERING)) { dog.mode.setMode(EnumMode.DOCILE); } isDog = true; } } } if(isDog) { player.addChatMessage(ChatHelper.getChatComponentTranslation("command.come")); } } else if(message.commandId == 2) { world.playSoundAtEntity(player, "random.bow", 0.5F, 0.4F / (world.rand.nextFloat() * 0.4F + 0.8F)); boolean isDog = false; List nearEnts = world.getEntitiesWithinAABBExcludingEntity(player, player.getEntityBoundingBox().expand(20D, 20D, 20D)); for (Object o : nearEnts) { if (o instanceof EntityZertumEntity) { EntityZertumEntity dog = (EntityZertumEntity)o; if(dog.canInteract(player)) { dog.getSitAI().setSitting(true); dog.getNavigator().clearPathEntity(); dog.setAttackTarget((EntityLivingBase)null); if(dog.mode.isMode(EnumMode.WANDERING)) { dog.mode.setMode(EnumMode.DOCILE); } isDog = true; } } } if(isDog) { player.addChatMessage(ChatHelper.getChatComponentTranslation("command.stay")); } } else if(message.commandId == 3) { world.playSoundAtEntity(player, "random.bow", 0.5F, 0.4F / (world.rand.nextFloat() * 0.4F + 0.8F)); boolean isDog = false; List nearEnts = world.getEntitiesWithinAABBExcludingEntity(player, player.getEntityBoundingBox().expand(20D, 20D, 20D)); for (Object o : nearEnts) { if (o instanceof EntityZertumEntity) { EntityZertumEntity dog = (EntityZertumEntity)o; if(dog.canInteract(player)) { if(dog.getMaxHealth() / 2 >= dog.getHealth()) { dog.getSitAI().setSitting(true); dog.getNavigator().clearPathEntity(); dog.setAttackTarget((EntityLivingBase)null); } else { dog.getSitAI().setSitting(false); dog.getNavigator().clearPathEntity(); dog.setAttackTarget((EntityLivingBase)null); } isDog = true; } } } if(isDog) { player.addChatMessage(ChatHelper.getChatComponentTranslation("command.ok")); } } else if(message.commandId == 4) { world.playSoundAtEntity(player, "random.bow", 0.5F, 0.4F / (world.rand.nextFloat() * 0.4F + 0.8F)); boolean isDog = false; List nearEnts = world.getEntitiesWithinAABBExcludingEntity(player, player.getEntityBoundingBox().expand(20D, 20D, 20D)); for (Object o : nearEnts) { if(o instanceof EntityZertumEntity) { EntityZertumEntity dog = (EntityZertumEntity)o; if(dog.canInteract(player) && !dog.isSitting() && !dog.mode.isMode(EnumMode.WANDERING)) { int i = MathHelper.floor_double(player.posX) - 2; int j = MathHelper.floor_double(player.posZ) - 2; int k = MathHelper.floor_double(player.getEntityBoundingBox().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(world, new BlockPos(i + l, k - 1, j + i1)) && !world.getBlockState(new BlockPos(i + l, k, j + i1)).getBlock().isFullBlock() && !world.getBlockState(new BlockPos(i + l, k + 1, j + i1)).getBlock().isFullBlock() && world.getBlockState(new BlockPos(i + l, k + 1, j + i1)) != Blocks.flowing_lava && world.getBlockState(new BlockPos(i + l, k + 1, j + i1)) != Blocks.lava) { dog.setLocationAndAngles((float)(i + l) + 0.5F, k, (float)(j + i1) + 0.5F, dog.rotationYaw, dog.rotationPitch); } } } isDog = true; } } } if(isDog) { player.addChatMessage(ChatHelper.getChatComponentTranslation("command.heel")); } } } } } PacketHandler package common.zeroquest.core.handlers; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraftforge.fml.common.network.NetworkRegistry; import net.minecraftforge.fml.common.network.simpleimpl.IMessage; import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper; import net.minecraftforge.fml.relauncher.Side; import common.zeroquest.lib.Constants; import common.zeroquest.network.packet.JakanJump; import common.zeroquest.network.packet.SealCommand; import common.zeroquest.network.packet.ZertumJump; import common.zeroquest.network.packet.ZertumMode; import common.zeroquest.network.packet.ZertumName; import common.zeroquest.network.packet.ZertumObey; import common.zeroquest.network.packet.ZertumTalents; /** * * This class will house the SimpleNetworkWrapper instance, which I will name 'dispatcher', * as well as give us a logical place from which to register our packets. These two things * could be done anywhere, however, even in your Main class, but I will be adding other * functionality (see below) that gives this class a bit more utility. * * While unnecessary, I'm going to turn this class into a 'wrapper' for SimpleNetworkWrapper * so that instead of writing "PacketDispatcher.dispatcher.{method}" I can simply write * "PacketDispatcher.{method}" All this does is make it quicker to type and slightly shorter; * if you do not care about that, then make the 'dispatcher' field public instead of private, * or, if you do not want to add a new class just for one field and one static method that * you could put anywhere, feel free to put them wherever. * * For further convenience, I have also added two extra sendToAllAround methods: one which * takes an EntityPlayer and one which takes coordinates. * */ public class PacketHandler { // a simple counter will allow us to get rid of 'magic' numbers used during packet registration private static byte packetId = 0; /** * The SimpleNetworkWrapper instance is used both to register and send packets. * Since I will be adding wrapper methods, this field is private, but you should * make it public if you plan on using it directly. */ private static final SimpleNetworkWrapper dispatcher = NetworkRegistry.INSTANCE.newSimpleChannel(Constants.channel); /** * Call this during pre-init or loading and register all of your packets (messages) here */ public static final void registerPackets() { // Using an incrementing field instead of hard-coded numerals, I don't need to think // about what number comes next or if I missed on should I ever rearrange the order // of registration (for instance, if you wanted to alphabetize them... yeah...) // It's even easier if you create a convenient 'registerMessage' method: PacketHandler.registerMessage(ZertumJump.Handler.class, ZertumJump.class, Side.CLIENT); PacketHandler.registerMessage(SealCommand.Handler.class, SealCommand.class, Side.CLIENT); PacketHandler.registerMessage(ZertumObey.Handler.class, ZertumObey.class, Side.CLIENT); PacketHandler.registerMessage(JakanJump.Handler.class, JakanJump.class, Side.CLIENT); PacketHandler.registerMessage(ZertumName.Handler.class, ZertumName.class, Side.CLIENT); PacketHandler.registerMessage(ZertumMode.Handler.class, ZertumMode.class, Side.CLIENT); PacketHandler.registerMessage(ZertumTalents.Handler.class, ZertumTalents.class, Side.CLIENT); // If you don't want to make a 'registerMessage' method, you can do it directly: //PacketDispatcher.dispatcher.registerMessage(OpenGuiMessage.OpenGuiMessageHandler.class, OpenGuiMessage.class, packetId++, Side.SERVER); //PacketDispatcher.dispatcher.registerMessage(SyncPlayerPropsMessage.SyncPlayerPropsMessageHandler.class, SyncPlayerPropsMessage.class, packetId++, Side.CLIENT); } /** * Registers a message and message handler */ private static final void registerMessage(Class handlerClass, Class messageClass, Side side) { PacketHandler.dispatcher.registerMessage(handlerClass, messageClass, packetId++, side); PacketHandler.dispatcher.registerMessage(handlerClass, messageClass, packetId++, side); } //========================================================// // The following methods are the 'wrapper' methods; again, // this just makes sending a message slightly more compact // and is purely a matter of stylistic preference //========================================================// /** * Send this message to the specified player. * See {@link SimpleNetworkWrapper#sendTo(IMessage, EntityPlayerMP)} */ public static final void sendTo(IMessage message, EntityPlayerMP player) { PacketHandler.dispatcher.sendTo(message, player); } /** * Send this message to everyone within a certain range of a point. * See {@link SimpleNetworkWrapper#sendToDimension(IMessage, NetworkRegistry.TargetPoint)} */ public static final void sendToAllAround(IMessage message, NetworkRegistry.TargetPoint point) { PacketHandler.dispatcher.sendToAllAround(message, point); } /** * Sends a message to everyone within a certain range of the coordinates in the same dimension. */ public static final void sendToAllAround(IMessage message, int dimension, double x, double y, double z, double range) { PacketHandler.sendToAllAround(message, new NetworkRegistry.TargetPoint(dimension, x, y, z, range)); } /** * Sends a message to everyone within a certain range of the player provided. */ public static final void sendToAllAround(IMessage message, EntityPlayer player, double range) { PacketHandler.sendToAllAround(message, player.worldObj.provider.getDimensionId(), player.posX, player.posY, player.posZ, range); } /** * Send this message to everyone within the supplied dimension. * See {@link SimpleNetworkWrapper#sendToDimension(IMessage, int)} */ public static final void sendToDimension(IMessage message, int dimensionId) { PacketHandler.dispatcher.sendToDimension(message, dimensionId); } /** * Send this message to the server. * See {@link SimpleNetworkWrapper#sendToServer(IMessage)} */ public static final void sendToServer(IMessage message) { PacketHandler.dispatcher.sendToServer(message); } }
  22. I can't use the method with EntityPlayer, I can only use it on EntityPlayerMP but the code requires the use of EntityPlayer
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.