Posted March 27, 20178 yr i have a what to you might seem like a very noob java question but i cant figure it out. I want a system that makes a random texture, i based this on the entityid (i hope i did it correctly lol) and reduces that to 4 textures, medical0 medical1 medical2 medical3 In resourcelocation i want to combine medical with texture2 (texture 2 is an int variable) to generate ranom numbers but it just tells minecraft that the resourcelocation is medicaltexture2.png.... what did i do wrong? public int getMobid() { return mobid; } private int texture(int number) { int texture2 = (mobid % 10); while (texture2 >= 4) { texture2 = (texture2 % 3); } return texture2; } @SideOnly(Side.CLIENT) public void registerRenderers() { RenderLiving customRender = new RenderLiving(Minecraft.getMinecraft().getRenderManager(), new medical.ModelNew(), 0) { protected ResourceLocation getEntityTexture(Entity par1Entity) { return new ResourceLocation("medical" + "texture2" + ".png"); } }; RenderingRegistry.registerEntityRenderingHandler(medical.Entitymedical.class, customRender); } Edited March 27, 20178 yr by alexschopbarteld
March 27, 20178 yr Author So how do i code this, someone told me to code an algorithm based on uuid.getmostsignificantbits but that isnt recognised by eclipse, can you help me?
March 27, 20178 yr Author int id = (int) (uuid.getMostSignificantBits() ^ uuid.getLeastSignificantBits()) % {2}; eeh this doesnt work, can you make an example?
March 27, 20178 yr Author for some reason eclipse doesnt know what to do with uuid do i use the java.UTIL.uuid? if i got this what do i do next? int id = (int) (uuid.getMostSignificantBits() ^ uuid.getLeastSignificantBits() % 2);
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.