Posted October 25, 20195 yr When I hold an item in my hand, the model's texture which I want to be transparent becomes solid. Is there any way to fix this? (Having the texture transparent and rendering it with an alpha of 1.0F has the same result as having it solid and rendering it with a lower alpha) Layer code: @OnlyIn(Dist.CLIENT) public class LayerSusanoo extends LayerRenderer<AbstractClientPlayerEntity, PlayerModel<AbstractClientPlayerEntity>> { public LayerSusanoo( IEntityRenderer<AbstractClientPlayerEntity, PlayerModel<AbstractClientPlayerEntity>> entityRendererIn) { super(entityRendererIn); } private static final ResourceLocation cage = new ResourceLocation(Main.modid, "textures/layers/player/susanoo/cage.png"); @Override public void render(AbstractClientPlayerEntity entityIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) { IPlayerKgCap kgcap = PlayerKgCapStorage.getCapability(entityIn); IPlayerAnimCap animcap = PlayerAnimCapStorage.getCapability(entityIn); if (kgcap.getSusanooActive()) { if (kgcap.getSusanooSize() == 1) { GlStateManager.pushMatrix(); ModelSusanooCage modelSusanooCage = new ModelSusanooCage(); GL11.glColor4f(kgcap.getSusanooColorR()/255F, kgcap.getSusanooColorG()/255F, kgcap.getSusanooColorB()/255F, 0.2F); this.bindTexture(cage); modelSusanooCage.isSitting = this.getEntityModel().isSitting; modelSusanooCage.isChild = this.getEntityModel().isChild; modelSusanooCage.setLivingAnimations(entityIn, limbSwing, limbSwingAmount, partialTicks); modelSusanooCage.render(entityIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale); GlStateManager.popMatrix(); } } } @Override public boolean shouldCombineTextures() { return false; } } Edited October 26, 20195 yr by FlashHUN marked as solved
October 26, 20195 yr Your code never enables alpha. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
October 26, 20195 yr 8 hours ago, FlashHUN said: Is there any way to fix this? As Draco said you need to enable alpha via the GLStateManager in your code then disable it after your code runs. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
October 26, 20195 yr Author 9 hours ago, Draco18s said: Your code never enables alpha. 4 hours ago, Animefan8888 said: As Draco said you need to enable alpha via the GLStateManager in your code then disable it after your code runs. Ah, thank you guys! That solved it.
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.