frizkie Posted November 18, 2012 Posted November 18, 2012 Title, pretty much. Here's the problem: http://youtu.be/XD66dr26gmo Quote
HoBoS_TaCo Posted November 18, 2012 Posted November 18, 2012 Have you looked how vanilla leaves do it? Otherwise you could just check the graphics settings on each block tick and change the texture accordingly. Quote
frizkie Posted November 18, 2012 Author Posted November 18, 2012 At the moment I do check graphics settings on each tick and change it - which is why when I force the blocks to update they change. I change the graphics type on the leaves but they dont reflect the changes until the block has been updated Quote
HoBoS_TaCo Posted November 18, 2012 Posted November 18, 2012 I don't have access to the Minecraft source right now so I can't check if what i'm saying is going to work. Right now it seems that your block checks for an update on each block update (which seems to occur when the block is moved or a adjacent block is modified), rather than on each game tick. Are you using a separate tick handler or are you using the onUpdate() or similar method in your block class? Quote
GhostSnyperRecon Posted November 18, 2012 Posted November 18, 2012 you need to have them change on tick, here's what i used when i made my leaves: package <your package> import java.util.EnumSet; import net.minecraft.client.Minecraft; import net.minecraft.src.GuiScreen; import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.common.ITickHandler; import cpw.mods.fml.common.TickType; public class ClientTickHandler implements ITickHandler { @Override public void tickStart(EnumSet<TickType> type, Object... tickData) {} @Override public void tickEnd(EnumSet<TickType> type, Object... tickData) { if (type.equals(EnumSet.of(TickType.RENDER))) { onRenderTick(); } else if (type.equals(EnumSet.of(TickType.CLIENT))) { GuiScreen guiscreen = Minecraft.getMinecraft().currentScreen; if (guiscreen != null) { onTickInGUI(guiscreen); } else { onTickInGame(); } } } @Override public EnumSet<TickType> ticks() { return EnumSet.of(TickType.RENDER, TickType.CLIENT); // In my testing only RENDER, CLIENT, & PLAYER did anything on the client side. // Read 'cpw.mods.fml.common.TickType.java' for a full list and description of available types } @Override public String getLabel() { return null; } private void onRenderTick() { if(Minecraft.getMinecraft().theWorld != null) { <Your Block>.setGraphicsLevel(Minecraft.getMinecraft().gameSettings.fancyGraphics); } } public void onTickInGUI(GuiScreen guiscreen) { if(Minecraft.getMinecraft().theWorld != null) { <Your Block>.setGraphicsLevel(Minecraft.getMinecraft().gameSettings.fancyGraphics); } } public void onTickInGame() { if(Minecraft.getMinecraft().theWorld != null) { <Your Block>.setGraphicsLevel(Minecraft.getMinecraft().gameSettings.fancyGraphics); } } } this will make them change as soon as you change the graphics from fast to fancy and visa versa Quote
Recommended Posts
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.