Jump to content

TPD

Members
  • Posts

    77
  • Joined

  • Last visited

Everything posted by TPD

  1. Ok. So how does the animation system work? Do I have to re-bake my model for every step?
  2. Do you mean attackspeed? You could override getAttributeModifiers in your Item class @Override public Multimap<String, AttributeModifier> getAttributeModifiers(EntityEquipmentSlot equipmentSlot, ItemStack stack) { Multimap<String, AttributeModifier> multimap = super.getAttributeModifiers(equipmentSlot, stack) multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Tool modifier", attackSpeed, 0)); return multimap; }
  3. If you put the item in the off-hand and back in the main-hand the cooldown is back until you switch to a different item (or update the stack somehow else) Is there an event that is thrown when switching items between hands? Also the tooltip of the item now shows 1014 as attackspeed. My second approach is to set the SharedMonsterAttributes.ATTACK_SPEED of the player as high as possible when the item is held because it is used to calculate attack speed of the player (EntityPlayer::getCooledAttackStrength) and then set it back to 4 when a different item is held. This is really hackey and exactly what I wanted to prevent by using the new rendering system but it's better than nothing.
  4. I want to prevent all animations that happen when the left mouse button is pressed. The problem that I can't find a way to prevent the up-and down movement of the item when the item "recharges". The feature was introduced in 1.9 (I think) and is indicated with a little sword below the crosshair. Edit: solved by overriding Item::getAttributeModifiers @Override public Multimap<String, AttributeModifier> getAttributeModifiers(EntityEquipmentSlot slot, ItemStack stack) { Multimap<String, AttributeModifier> multimap = super.getAttributeModifiers(slot, stack); multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Tool modifier", 1024, 0)); return multimap; }
  5. So far I don't even know how to modify the model at all... What I posted before doesn't seem to be it
  6. Ok. How does it work? If I wanted the arm to have the same direction as the head would I do something like this? ModelBiped biped = event.getRenderer().getMainModel(); biped.bipedLeftArm.rotateAngleX = biped.bipedHead.rotateAngleX;
  7. I want the arms of a player to point in the same direction that he/she is looking Do I have to listen for the RenderPlayerEvent.Pre event and then change the mainModel somehow? Also, how is it possible to prevent the "hitting-animation" (pressing left mouse button ingame) for first and thirdperson?
  8. Ok. I found the problem. The rot methods in Matrix4f set m00 and m33 (first element in first row, last element in last row) to 1. I had to first rotate it and then multiply it by 0.1 and finally set m33 back to 1.
  9. That's what I was thinking aswell, but it doesn't seem to make a difference: Matrix4f scale = new Matrix4f( 0.1F, 0, 0, 0, 0, 0.1F, 0, 0, 0, 0, 0.1F, 0, 0, 0, 0, 1 ); transform.mul(scale); Still the same size
  10. This is what my IBakedModel::handlePerspective() method looks like: @Override public Pair<? extends IBakedModel, Matrix4f> handlePerspective(ItemCameraTransforms.TransformType cameraTransformType) { switch (cameraTransformType) { case THIRD_PERSON_RIGHT_HAND: Matrix4f transform = new Matrix4f(); transform.setIdentity(); float degree90 = (float)(Math.PI/2); transform.mul(0.1F); transform.rotX(degree90); transform.rotZ(degree90); transform.rotY(degree90); return Pair.of(this, transform); } return Pair.of(this, null); } The model rotates correctly but its size doesn't change. What am I doing wrong?
  11. I have multiple objects in my wavefront file. Is it possible to get the individual OBJModels?
  12. Oh. It works now The problem was that I baked my OBJModels before the getTextures() method was called. (-> Textures where no avilable during baking) Sorry for not realising this earlier...
  13. I resized the texture and the error went away. The model has still the missing texture
  14. The debugger says it's contained in the textures Set... Also now I get this error: The following other errors were reported for domain flansmod: ------------------------- Problem: broken aspect ratio and not an animation textures/capsule0.png ================================================== What aspect ratio is a texture allowed to have?
  15. I changed the entry in the .mtl file to "map_Kd flansmod:capsule0" and moved the png to textures/ but it's still the same
  16. In the same directory as the .obj and .mtllib files. I also tried to put it in textures/items/ objModel.getMatLib().getMaterialNames() actually contains the material name so it is being loaded.
  17. I already tried PNG. Same result.
  18. newmtl material0 Ka 1.000000 1.000000 1.000000 Kd 1.000000 1.000000 1.000000 Ks 0.000000 0.000000 0.000000 Tr 1.000000 illum 1 Ns 0.000000 map_Kd capsule0.jpg Maybe I have to refer to the mtllib and the jpg in the mtllib like a ResourceLocation? Currently they are all in the same directory
  19. These are the only "errors" i get [13:46:36] [Client thread/INFO] [FML]: OBJModel: A color has already been defined for material 'material0' in 'flansmod:models/item/test1/capsule.mtl'. The color defined by key 'Ks' will not be applied! [13:46:36] [Client thread/INFO] [FML]: OBJLoader.MaterialLibrary: key 'illum' (model: 'flansmod:models/item/test1/capsule.mtl') is not currently supported, skipping [13:46:36] [Client thread/INFO] [FML]: OBJLoader.MaterialLibrary: key 'Ns' (model: 'flansmod:models/item/test1/capsule.mtl') is not currently supported, skipping
  20. In what format does the mtllib entry in the .obj file have to be? I Tried the example from http://paulbourke.net/dataformats/obj/minobj.html but the rendered object just has the "missing" texture (texture is rendered in blender)
  21. Ok. The problem is that I have multiple skins (paintjobs) for models. Is it possible that I just change the OBJModel.Parser::materialLibrary before I call parse() and thereby create Models for each skin-variant?
  22. But where can I specify what Texture should be used?
  23. My main/final model consists out of multiple ModelParts that I load from .obj files. How do I join them into one Model? Should I just return the Quads of all sub-models in the getQuads() method of my baked main model? Also, what does the bakedTextureGetter have to look like when I bake my OBJModels?
  24. I tried to do something similar but it started to become too "hackey" It is indeed annoying. I have to rewrite half of the mod (probably more) that I'm trying to update. But at least that means it will be done properly this time...
  25. I only need it for GUIs. I guess both works in that case
×
×
  • Create New...

Important Information

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