Jump to content

DoorCloser

Members
  • Posts

    178
  • Joined

  • Last visited

Everything posted by DoorCloser

  1. A little bit more explaination ( not bump ). So this code says, that if i use Material.wood, it will spawn my door, but if the Material will be Material.iron, it will spawan Block.doorIron: public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { if (par7 != 1) { return false; } else { ++par5; Block block; if (this.doorMaterial == Material.wood) { block = mod_HalflifeMod.greenDoor; } else { block = Block.doorIron; } if (par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack) && par2EntityPlayer.canPlayerEdit(par4, par5 + 1, par6, par7, par1ItemStack)) { if (!block.canPlaceBlockAt(par3World, par4, par5, par6)) { return false; } else { int i1 = MathHelper.floor_double((double)((par2EntityPlayer.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3; placeDoorBlock(par3World, par4, par5, par6, i1, block); --par1ItemStack.stackSize; return true; } } else { return false; } } } So, my Material is set to wood in the main class: public final static Item greenDoorItem = new ItemGreenDoor(1505, Material.wood).setUnlocalizedName("greenDoor"); But when i spawn this door with Material.wood set on it, it spawns just a basic wooden door, but that block = mod_HalflifeMod.greenDoor; says to spawn greenDoor. When i use Material.iron it actually spawns iron Door, so thats ok. Then i dont know whats wrong with the code. Can you guys help?
  2. I'm creating my custom door. So here is my codes: BlockMyDoor: ItemMyDoor MainClass registry and stuff: That seems ok, but when i spawn my door, it basicly spawns the original wooden door. I think the problem is in Material.wood, but im not sure. Could you guys help?
  3. So, did you understand? Before i add walking animations, while mob is idle he was having arm like this "/" but when i added walking animations, now while he idle, his arms was looks like this "|". Any guesses on how to add walking animations on limb and make that limb rotated how i want
  4. Look. So, on the first pic you see, that i have this code in my ModelMob.class: public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) { super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); this.rightupperleg.rotateAngleX = MathHelper.cos(f * 0.5F) * -1.0F * f1; this.leftupperleg.rotateAngleX = MathHelper.cos(f * 0.5F) * 1.0F * f1; this.rightupperarm.rotateAngleX = MathHelper.cos(f * 0.4F) * -1.2F * f1; this.leftupperarm.rotateAngleX = MathHelper.cos(f * 0.4F) * 1.2F * f1; } So, only rightarm is childed by rightupperarm, so its moving with it. But when i do so: public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) { super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); this.rightupperleg.rotateAngleX = MathHelper.cos(f * 0.5F) * -1.0F * f1; this.leftupperleg.rotateAngleX = MathHelper.cos(f * 0.5F) * 1.0F * f1; this.rightupperarm.rotateAngleX = MathHelper.cos(f * 0.4F) * -1.2F * f1; this.leftupperarm.rotateAngleX = MathHelper.cos(f * 0.4F) * 1.2F * f1; this.rightarm.rotateAngleX = MathHelper.cos(f * 0.5F) * -1.0F * f1; // i just added these this.leftarm.rotateAngleX = MathHelper.cos(f * 0.5F) * 1.0F * f1; // i just added these } ...mob's arms are straight down. So, basicly you see on the first picture, that the both lowerarms ( which is rightarm,leftarm in the code ) are rotated a littlebit( while mob is idle ), but when i set to them animations while walking (rightarm, leftarm), they made not rotated( while mob is idle ) by the X Angle ( because rotateAngleX ), thats on the second picture. I HOPE you understand. http://s17.postimg.org/a9cxmdtyn/2014_02_11_03_12_16.png[/img] http://s17.postimg.org/4ml62ngtr/2014_02_11_03_13_21.png[/img] image share
  5. Thats for the Blocks and Items i guess. What about Mobs?
  6. Ok, so i worked it out. I just needed to put those strings in my main class: LanguageRegistry.instance().addStringLocalization("entity.Guard.name", "Guard");
  7. So, i registered my mob like that: EntityRegistry.registerGlobalEntityID(EntityGuard.class,"Guard", EntityRegistry.findGlobalUniqueEntityId(), 34545, 354439); RenderingRegistry.registerEntityRenderingHandler(EntityGuard.class, new RenderBiped(new ModelBiped(), 0.5F)); EntityRegistry.registerModEntity(EntityGuard.class, "Guard", 7, this, 80, 3, true); EntityRegistry.addSpawn(halflifemod.entity.monster.EntityGuard.class,20,3,8, EnumCreatureType.creature); The name is "Guard", but in game the SpawnEgg named "Spawn entity.Guard.name" How to fix that? I want it only to be "Spawn Guard".
  8. Ok, so there is a strange thing in mob's animations. So, looks like i want my mob to perform walking animations, i do. public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) { super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); this.rightleg.rotateAngleX = MathHelper.cos(f * 0.5F) * -1.0F * f1; this.leftleg.rotateAngleX = MathHelper.cos(f * 0.5F) * 1.0F * f1; this.rightarm.rotateAngleX = MathHelper.cos(f * 0.5F) * -1.0F * f1; this.leftarm.rotateAngleX = MathHelper.cos(f * 0.5F) * 1.0F * f1; } } And it works, but always when i set an animation on any limb, on X angle, the rotation of that limb on X angle is become 0. I know its hard to understand. So let me explain better Here is the part of code of your ModelMob.class leftarm = new ModelRenderer(this, 120, 29); leftarm.addBox(-8F, 5F, -1.8F, 2, 12, 2); leftarm.setRotationPoint(8.5F, 3F, 3F); leftarm.setTextureSize(128, 64); leftarm.mirror = true; setRotation(leftarm, -0.5420432F, 0F, 0F); You see, that setRotation is going on -0.5, so basicly that arm is a littlebit turned in game. But when i use an animation... this.leftarm.rotateAngleX = MathHelper.cos(f * 0.5F) * 1.0F * f1; ... in game, that arm perform animation while mob is walking, but when he is idle, that arm is no more turned. Its now straight down on X angle. So before i set animations it was (-0.5F) in game, after that its (0F). Any ideas on how to fix it?
  9. NVM. I looked to the Slime and worked it out. The Codes are almost the similar, so thanks alot.
  10. How to make my mob bigger without rebuilding it in Techne? So, i tried to use that code in my RenderMob.class: GL11.glPushMatrix(); float scale = 2.0F; GL11.glScalef(scale, scale, scale); That works, but my Minecraft gets damned up. I think that code sucks and i need something another. Here is the whole RenderMob.class file: So, how i can make my mob bigger?
  11. Anybody? What's strange in my problem, that nobody dont know what to do...
  12. I want my mob to perform animations when it is attacking somebody else. Well, for compare IronGolem does it when he attacks. I've tried to use Golem's part of code, but that not works on my mob. So, here is the code, i used from the Golem: ModelMob EntityMob
  13. Well, you mean i can use setSitting? Thats an idea, thanks.
  14. you can use it to check if you already used an apple on the mob. How? Please tell me how it can be used.
  15. I'm using that code. Put it in BlockName.class file.
  16. Hello everybody. I have a little problem in a modding. So basiclly, i've made my mob follow me if i push right click on him with redApple. So it works fine, but i want to change a code a littlebit. I want my mob to stop if i rightclick with apple on him again. So if i rightclick with apple on mob once, he will follow me, if i rightclick another time he will stop. How can i do that? Here is the code: public boolean interact(EntityPlayer par1EntityPlayer) { ItemStack itemstack = par1EntityPlayer.inventory.getCurrentItem(); if (itemstack == null) { this.playSound("scientist.sci_busy", 0.5F, 1.0F); } else if (itemstack.itemID == Item.appleRed.itemID) { this.playSound("scientist.sci_follow", 0.5F, 1.0F); this.setTamed(true); this.setEntityHealth(20); this.setOwner(par1EntityPlayer.username); this.worldObj.setEntityState(this, (byte)7); this.tasks.addTask(7, new EntityAIFollowCalled(this, this.moveSpeed, 3.0F, 0.3F)); this.moveSpeed = 0.3F; } return super.interact(par1EntityPlayer); }
  17. NVM, i've changed the directory like in SoundEvent.class so it works.
  18. Ok, so i've recompiled, reobfustated mod, putted it in my real Minecraft and it works fine, but all my mod sounds are not working. I actually got SoundEvent class which is registering sounds and sounds in resources folder. How can i get it to the game. I had to create a package in eclipse and get all sounds inside it, or what?
  19. I tried some of those. Not worked. Have you got ResourceLocation file? Please send me a code inside of it, ill create a new one.
  20. The import net.minecraft.util.ResourceLocation cannot be resolved Dont really know what to do..
×
×
  • Create New...

Important Information

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