Jump to content

matsuokisho

Members
  • Posts

    3
  • Joined

  • Last visited

matsuokisho's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Sorry my mistake, the previous code was not working. Here is a new one, there are also no errors and it doesn’t change anything, I tried to add a layer through AddLayers, but it seems to me that I indicated the wrong values, I did not understand what values to indicate there. ModEventClientBusEvents MyPlayerLayer MyPlayerRenderer debug.log
  2. The way you change the skin doesn't matter to me. I redid the code so that it renders a new skin, there are also no errors and nothing changes. public class MyPlayerLayer extends LayerRenderer<PlayerEntity, PlayerModel<PlayerEntity>> { public MyPlayerLayer(IEntityRenderer<PlayerEntity, PlayerModel<PlayerEntity>> entityRenderer) { super(entityRenderer); } @Override public void render(MatrixStack matrixStack, IRenderTypeBuffer buffer, int light, PlayerEntity player, float limbAngle, float limbDistance, float tickDelta, float customAngle, float headYaw, float headPitch) { PlayerModel<PlayerEntity> model = getParentModel(); renderCutoutModel(model, new ResourceLocation("tutorialmod:textures/entity/player_layer.png"), matrixStack, buffer, light, player, 1, 1, 1, tickDelta, 1, 1, 1, 1); } } public class MyPlayerRenderer extends LivingRenderer<PlayerEntity, PlayerModel<PlayerEntity>> { public MyPlayerRenderer(EntityRendererManager rendererManager) { super(rendererManager, new PlayerModel<>(0.0f, false), 0.5f); addLayer(new MyPlayerLayer(this)); } @Override public ResourceLocation getTextureLocation(PlayerEntity entity) { return new ResourceLocation("tutorialmod:textures/entity/player.png"); } } RenderingRegistry.registerEntityRenderingHandler(EntityType.PLAYER, (RenderFactory) MyPlayerRenderer::new);
  3. Ultimate Goal: Change the skin of the player on the server, but for now I just want to change the skin locally. There are no errors in my code, but the skin does not change. My code: private void onClientSetup(final FMLClientSetupEvent event) { ResourceLocation skinLocation = new ResourceLocation(TutorialMod.MOD_ID, "textures/entity/raccoon/raccoon.png"); Property textureProperty = new Property("textures", skinLocation.toString()); GameProfile gp = Minecraft.getInstance().getUser().getGameProfile(); gp.getProperties().removeAll("textures"); gp.getProperties().put("textures", textureProperty); SkinManager skinManager = Minecraft.getInstance().getSkinManager(); skinManager.registerSkins(gp, (type, location, profileTexture) -> {}, true); }
×
×
  • Create New...

Important Information

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