Posted December 29, 20195 yr So I'm trying to override the Players/an Entity model and render a new mob in its place. Everything work except the light mapping for the model. This same thing was used in 1.12, and I have messed with a lot of GL states to try and fix it. But so far no fix. I know a lot has changed in 1.15 with rendering from what I have read. And wonder if there is anything I can actually fix or I just have to wait. Image below. Code below that. Skeleton on the left is my player with the new model rendered over it. Spoiler private static IRenderTypeBuffer Impl = IRenderTypeBuffer.func_228455_a_(new BufferBuilder(256));; @SubscribeEvent public static void renderFakeEntity(RenderLivingEvent.Pre e) { if(e.getEntity() instanceof PlayerEntity) { e.setCanceled(true); //This is just for testing atm. Later will be handled differently SkeletonEntity newentity = new SkeletonEntity(EntityType.SKELETON, e.getEntity().getEntityWorld()); int x = e.getEntity().getPosition().getX(); int y = e.getEntity().getPosition().getY(); int z = e.getEntity().getPosition().getZ(); newentity.setPosition(x, y, z); newentity.rotationYawHead = e.getEntity().rotationYawHead; newentity.rotationYaw = e.getEntity().rotationYaw; newentity.rotationPitch = e.getEntity().rotationPitch; newentity.prevRotationPitch = e.getEntity().prevRotationPitch; newentity.prevRotationYaw = e.getEntity().prevRotationYaw; newentity.prevRotationYawHead = e.getEntity().prevRotationYawHead; newentity.prevRenderYawOffset = e.getEntity().prevRenderYawOffset; newentity.swingProgress = e.getEntity().swingProgress; newentity.limbSwing = e.getEntity().limbSwing; newentity.swingProgressInt = e.getEntity().swingProgressInt; newentity.limbSwingAmount = e.getEntity().limbSwingAmount; newentity.prevLimbSwingAmount = e.getEntity().prevLimbSwingAmount; newentity.setMotion(e.getEntity().getMotion()); newentity.ticksExisted = e.getEntity().ticksExisted; newentity.prevPosX = e.getEntity().prevPosX; newentity.prevPosY = e.getEntity().prevPosY; newentity.prevPosZ = e.getEntity().prevPosZ; newentity.setHeldItem(Hand.MAIN_HAND, e.getEntity().getHeldItemMainhand()); newentity.setCustomNameVisible(true); // Minecraft.getInstance().getRenderManager().func_229085_a_(e.getEntity(), e.getPartialRenderTick()); Minecraft.getInstance().getRenderManager().func_229084_a_(newentity, 0, 0, 0, 0f, 0F,e.getMatrixStack(), Impl, 200); } } The last Integer that is suppose to change the font color (from what I can tell), but seems to change the brightness of the whole model as well, 0 the skeleton is dark, 200-256 is bright. The world light level seems to affect it slightly, but block light levels do not seem to as much. The picture shown above is set with the 200 value. Minecraft.getInstance().getRenderManager().func_229084_a_(newentity, 0, 0, 0, 0f, 0F,e.getMatrixStack(), Impl, 200); Edited December 30, 20195 yr by gendeathrow Better explain the last couple of sentences.
December 29, 20195 yr Author Alright after some searching thru all the function back finally realized that what I had thought was font color was something different. oh well I got the fix here. Hopefully this will help anyone else out with this. If I can remember I update this when the mappings get updated I will. EntityRendererManager rendermanager = Minecraft.getInstance().getRenderManager(); rendermanager.func_229084_a_(newentity, 0, 0, 0, 0f, 0F,e.getMatrixStack(), Impl, rendermanager.func_229085_a_(newentity, e.getPartialRenderTick())); Edited December 29, 20195 yr by gendeathrow
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.