Everything posted by Meldexun
-
LivingEquipmentChangeEvent client side
Now I created a MessageHandlerBDDummy class and I'm calling this in my ServerProxy BetterDiving.INSTANCE.registerMessage(MessageHandlerBDDummy.class, MessageBD.class, 0, Side.SERVER); The MessageHandlyerBDDummy class isn't doing something when receiving a packet. And everything seems to work know. Thank you for the help. If there is a better way of solving my issue you can say it.
-
LivingEquipmentChangeEvent client side
Ok, I now registered the Packet in my ClientProxy public class ClientProxy implements CommonProxy { @Override public void init() { BetterDiving.INSTANCE.registerMessage(MessageHandlerBD.class, MessageBD.class, 0, Side.CLIENT); } } But once i switch armor on a server nothing happens and on the server i get this message: Undefined discriminator for message type MessageBD in channel better_diving
-
LivingEquipmentChangeEvent client side
Ok. I feel like that was pretty obvious. Thanks for the help. But I don't know what you mean with that.
-
LivingEquipmentChangeEvent client side
I also thought that the getServerHandler isn't working on client side. But how can I access the Player object on the client side?
-
LivingEquipmentChangeEvent client side
I tried sending a packet and it is recieved on the client. public class MessageHandlerBD implements IMessageHandler<MessageBD, IMessage> { @Override public IMessage onMessage(MessageBD messageBD, MessageContext ctx) { System.out.println("PACKET"); return null; } } But instead of just writing PACKET in the client log, I want to do something with my Capability on the client side. But when i try it the game always is crashing @Override public IMessage onMessage(MessageBD messageBD, MessageContext ctx) { ctx.getServerHandler().player.getCapability(DiveSpeedProvider.DIVESPEED, null).updateDiveSpeed(ctx.getServerHandler().player); return null; }
-
LivingEquipmentChangeEvent client side
I need to execute some code when the player switches his armor. But the LivingEquipmentChangeEvent is only server side and i need to do my stuff client side. So is there a way to run my stuff client side when the LivingEquipmentChangeEvent is fired?
-
[1.12.2] Custom Armor Model with High Resolution Textures
Oh. That was all Thank you for the help. Didn't thought it is that simple.
-
[1.12.2] Custom Armor Model with High Resolution Textures
Then it selects the same part of my texture. The dark blue rectangle(8x12) is selected for the front of my rectangle. It always selects a 8x12 rectangle for the front. I can icrease the size of my complete texture from 64x32 to 128x64 but it still just selects the 8x12 dark blue part.
-
[1.12.2] Custom Armor Model with High Resolution Textures
Hi there, I created my own armor and I made a custom model for my armor. But now I want to have a higher resolution texture on my model. As an example I have a 8x12x4 rectangle and we look at one 8x12 side of this rectangle. Now I want a 16x24 texture rendered on this side. But how can I do this? This is my model class: public class CustomArmorModel extends ModelBiped { ModelRenderer customBodyModel; public CustomArmorModel(float scale) { super(scale, 0, 512, 512); customBodyModel = new ModelRenderer(this, 64, 128); customBodyModel.addBox(0F, 0F, 0F, 8, 12, 4, 0.0f); customBodyModel.setRotationPoint(-4F, 0F, -2F); customBodyModel.setTextureSize(512, 512); customBodyModel.mirror = true; setRotation(customBodyModel, 0F, 0F, 0F); bipedBody.addChild(customBodyModel); } public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) { super.render(entityIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale); setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn); } private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } } I tried making a bigger model and reducing the size by the scale: customBodyModel.addBox(0F, 0F, 0F, 16, 24, 8, -0.5f); But the -0.5f just shrinks the model from every side by 0.5. So I just could shrink a cube by this.
IPS spam blocked by CleanTalk.