Posted May 27, 201510 yr Hello. public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side){ return FMLClientHandler.instance().getClientPlayerEntity().capabilities.isCreativeMode ? super.getIcon(world, x, y, z, side) : iconEmpty; } Block texture changes only when I update the blocks in the chunk (destroy, put etc). How to make it so that when the player was of creative mode texture change immediately?
May 28, 201510 yr Author Thanks! public class TextureBarrier extends TextureAtlasSprite{ public TextureBarrier(String name){ super(name); } public void updateAnimation(){ if(!framesTextureData.isEmpty()){ Minecraft minecraft = Minecraft.getMinecraft(); int prevFrameCount; if(minecraft.thePlayer != null && minecraft.thePlayer.capabilities.isCreativeMode){ prevFrameCount = 0; }else{ prevFrameCount = 1; } if(prevFrameCount != frameCounter){ frameCounter = prevFrameCount; TextureUtil.uploadTextureMipmap((int[][])framesTextureData.get(frameCounter), width, height, originX, originY, false, false); } } } } Solved.
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.