Jump to content

[1.8.9] Animation only updates when opening GUI


Laseph

Recommended Posts

I have this animation setup in the special renderer and it checks for changes in some variables to see if it should render it. But it only begins to render the animation when opening the GUI. I am sending the variables with a message and I'm also marking the block for update. I've searched around but i can't find the problem.

Link to comment
Share on other sites

Show your rendering code

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.

Link to comment
Share on other sites

Here it is.  :D

@SideOnly(Side.CLIENT)
public class RendererWashingTable extends TileEntitySpecialRenderer<TileEntityWashingTable>
{
private static final ResourceLocation WATER_TEXTURE = new ResourceLocation("textures/blocks/water_still.png");

public void renderTileEntityAt(TileEntityWashingTable tileEntity, double x, double y, double z, float f, int destroyStage)
{
	GL11.glPushMatrix();
        GL11.glTranslated((float)x + 0.5f,  y, (float)z + 0.5f);
        GL11.glScaled(0.5f, 0.5f, 0.5f);
        this.bindTexture(WATER_TEXTURE);
        renderWater(tileEntity);
        GL11.glPopMatrix();
}

public void renderWater(TileEntityWashingTable tileEntityWashingTable)
    {
	int deviceWashTime = tileEntityWashingTable.getDeviceWashTime();
	int waterAvailable = tileEntityWashingTable.getWaterAvailable();

	if(deviceWashTime > 0)
    	{			
    	final double[] beginVertices = {0.75, 2};
    	final double[] midVertices = {0.75, 1.875};
    	final double[] endVertices = {0.125, 1.5};
    	
    	double x ;
    	double y ;
    	
    	double a = (endVertices[1]-midVertices[1]/endVertices[0]-midVertices[0]);
    	double b = (endVertices[0]*midVertices[1]-endVertices[1]*midVertices[0]/endVertices[0]-midVertices[0]);
    	
    	double washScale = (100 - (double)tileEntityWashingTable.getDeviceWashTime())/ 100;
    	
    	double height = beginVertices[1] - endVertices[1];
    	
    	y = beginVertices[1] - (height * washScale);
    	
    	if(y <= midVertices[1] && y >= endVertices[1])
    	{
    		x = Math.abs((y-b)/a);
    	}
    	else
    	{
    		x = beginVertices[0];	
    	}
        
    	RenderHelper.disableStandardItemLighting();
    	
    	GL11.glEnable(GL11.GL_BLEND);
    	GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    	
    	GL11.glBegin(GL11.GL_TRIANGLES);
    		GL11.glTexCoord2d(0, 0);
			GL11.glVertex3d(x, y, x);
			GL11.glTexCoord2d(0, 0.0234375);
    			GL11.glVertex3d(x, y, -x);
    			GL11.glTexCoord2d(0.75, 0);
    			GL11.glVertex3d(-x, y, x);
    			GL11.glTexCoord2d(0.75, 0);
    			GL11.glVertex3d(-x, y, x);
    			GL11.glTexCoord2d(0, 0.0234375);
    			GL11.glVertex3d(x, y, -x);
    			GL11.glTexCoord2d(0.75, 0.0234375);
    			GL11.glVertex3d(-x, y, -x);
    			
    			GL11.glTexCoord2d(0, 0);
    			GL11.glVertex3d(0.125, 1.5, 0.125);
    			GL11.glTexCoord2d(0.125, 0);
    			GL11.glVertex3d(-0.125, 1.5, 0.125);
    			GL11.glTexCoord2d(0, 0.03125);
    			GL11.glVertex3d(0.125, 0.125, 0.125);
    			GL11.glTexCoord2d(0, 0.03125);
    			GL11.glVertex3d(0.125, 0.125, 0.125);
    			GL11.glTexCoord2d(0.125, 0);
    			GL11.glVertex3d(-0.125, 1.5, 0.125);
    			GL11.glTexCoord2d(0.125, 0.03125);
    			GL11.glVertex3d(-0.125, 0.125, 0.125);
    			
    			GL11.glTexCoord2d(0, 0);
    			GL11.glVertex3d(0.125, 1.5, 0.125);
    			GL11.glTexCoord2d(0, 0.03125);
    			GL11.glVertex3d(0.125, 0.125, 0.125);
    			GL11.glTexCoord2d(0.125, 0);
    			GL11.glVertex3d(0.125, 1.5, -0.125);
    			GL11.glTexCoord2d(0, 0.03125);
    			GL11.glVertex3d(0.125, 0.125, 0.125);
    			GL11.glTexCoord2d(0.125, 0.03125);
    			GL11.glVertex3d(0.125, 0.125, -0.125);
    			GL11.glTexCoord2d(0.125, 0);
    			GL11.glVertex3d(0.125, 1.5, -0.125);
    			
    			GL11.glTexCoord2d(0, 0);
    			GL11.glVertex3d(-0.125, 1.5, -0.125);
    			GL11.glTexCoord2d(0.125, 0);
    			GL11.glVertex3d(0.125, 1.5, -0.125);
    			GL11.glTexCoord2d(0, 0.03125);
    			GL11.glVertex3d(-0.125, 0.125, -0.125);
    			GL11.glTexCoord2d(0, 0.03125);
    			GL11.glVertex3d(-0.125, 0.125, -0.125);
    			GL11.glTexCoord2d(0.125, 0);
    			GL11.glVertex3d(0.125, 1.5, -0.125);
    			GL11.glTexCoord2d(0.125, 0.03125);
    			GL11.glVertex3d(0.125, 0.125, -0.125);
    			
    			GL11.glTexCoord2d(0, 0);
    			GL11.glVertex3d(-0.125, 1.5, -0.125);
    			GL11.glTexCoord2d(0, 0.03125);
    			GL11.glVertex3d(-0.125, 0.125, -0.125);
    			GL11.glTexCoord2d(0.125, 0);
    			GL11.glVertex3d(-0.125, 1.5, 0.125);
    			GL11.glTexCoord2d(0, 0.03125);
    			GL11.glVertex3d(-0.125, 0.125, -0.125);
    			GL11.glTexCoord2d(0.125, 0.03125);
    			GL11.glVertex3d(-0.125, 0.125, 0.125);
    			GL11.glTexCoord2d(0.125, 0);
    			GL11.glVertex3d(-0.125, 1.5, 0.125);
    			
    		GL11.glTexCoord2d(0, 0);
			GL11.glVertex3d(0.625, 0.125+(height * washScale) , 0.625);
			GL11.glTexCoord2d(0, 0.01953125);
    			GL11.glVertex3d(0.625, 0.125+(height * washScale), -0.625);
    			GL11.glTexCoord2d(0.625, 0);
    			GL11.glVertex3d(-0.625, 0.125+(height * washScale), 0.625);
    			GL11.glTexCoord2d(0.625, 0);
    			GL11.glVertex3d(-0.625, 0.125+(height * washScale), 0.625);
    			GL11.glTexCoord2d(0, 0.01953125);
    			GL11.glVertex3d(0.625, 0.125+(height * washScale), -0.625);
    			GL11.glTexCoord2d(0.625, 0.01953125);
    			GL11.glVertex3d(-0.625, 0.125+(height * washScale), -0.625);
    		GL11.glEnd();
    		
    		GL11.glDisable(GL11.GL_BLEND);
    		
    		RenderHelper.enableStandardItemLighting();
    	}

	if(waterAvailable == 3)
	{
		RenderHelper.disableStandardItemLighting();
    	
    	GL11.glEnable(GL11.GL_BLEND);
    	GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    	
    	GL11.glBegin(GL11.GL_TRIANGLES);
    		GL11.glTexCoord2d(0, 0);
			GL11.glVertex3d(0.625, 0.625, 0.625);
			GL11.glTexCoord2d(0, 0.01953125);
			GL11.glVertex3d(0.625, 0.625, -0.625);
			GL11.glTexCoord2d(0.625, 0);
			GL11.glVertex3d(-0.625, 0.625, 0.625);
			GL11.glTexCoord2d(0.625, 0);
			GL11.glVertex3d(-0.625, 0.625, 0.625);
			GL11.glTexCoord2d(0, 0.01953125);
			GL11.glVertex3d(0.625, 0.625, -0.625);
			GL11.glTexCoord2d(0.625, 0.01953125);
			GL11.glVertex3d(-0.625, 0.625, -0.625);
		GL11.glEnd();

		GL11.glDisable(GL11.GL_BLEND);

		RenderHelper.enableStandardItemLighting();
	}
    }
}

Link to comment
Share on other sites

I bet the value returned by getDeviceWashTime() is only calculated server side and synced south detectAndSemdChanges()

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.

Link to comment
Share on other sites

Found the problem, i am still really confused. I changed a value on the client side only in onBlockActivated when i do it for both it works. But i don't know why it doesn't want to sync when server side only or client side only because i send a message when updating.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I cant craft any of the epic fight mod weapons. I try using the recipes in the crafting table but nothing is working. and when i click on the epic fight weapon in jei there is no recipe at all.
    • Oklahoma Nation Cowboys at Youngstown Country PenguinsYoungstown, Ohio; Wednesday, 7 p.m. EDTBOTTOM LINE: The Youngstown Region Penguins facial area the Oklahoma Country Cowboys within the Countrywide Invitation Penguins include absent 15-5 versus Horizon League rivals, with a 9-4 history within non-meeting participate in. Youngstown Region is 1-2 inside online games resolved as a result of considerably less than 4 facts. The Cowboys are 8-10 in just Massive 12 engage in. Oklahoma Region ranks 9th within just the Large 12 taking pictures 31.1% towards 3-stage wide PERFORMERS: Dwayne Cohill is averaging 17.8 details and 4.8 helps for the Penguins. Adrian Nelson is averaging 17.1 info higher than the remaining 10 game titles for Youngstown Thompson is averaging 11.7 details for the Cowboys. Caleb Asberry is averaging 13.1 facts about the very last 10 video games for Oklahoma last 10 Video games: Penguins: 7-3 Zeke Zaragoza Jersey, averaging 79.7 info, 33.4 rebounds, 14.8 helps, 5.3 steals and 2.7 blocks for each video game despite the fact that capturing 48.1% versus the marketplace. Their rivals incorporate averaged 72.4 details for every : 4-6, averaging 66.4 specifics, 33.1 rebounds, 11.1 helps Jake Henry Jersey, 4.9 steals and 3.6 blocks for each sport even though taking pictures 41.3% towards the sector. Their rivals consist of averaged 72.0 info. The made this tale making use of technological innovation delivered by means of Information and facts Skrive and info against Sportradar. Cowboys Shop
    • Oklahoma Nation Cowboys at Youngstown Country PenguinsYoungstown, Ohio; Wednesday, 7 p.m. EDTBOTTOM LINE: The Youngstown Region Penguins facial area the Oklahoma Country Cowboys within the Countrywide Invitation Penguins include absent 15-5 versus Horizon League rivals, with a 9-4 history within non-meeting participate in. Youngstown Region is 1-2 inside online games resolved as a result of considerably less than 4 facts. The Cowboys are 8-10 in just Massive 12 engage in. Oklahoma Region ranks 9th within just the Large 12 taking pictures 31.1% towards 3-stage wide PERFORMERS: Dwayne Cohill is averaging 17.8 details and 4.8 helps for the Penguins. Adrian Nelson is averaging 17.1 info higher than the remaining 10 game titles for Youngstown Thompson is averaging 11.7 details for the Cowboys. Caleb Asberry is averaging 13.1 facts about the very last 10 video games for Oklahoma last 10 Video games: Penguins: 7-3 Zeke Zaragoza Jersey, averaging 79.7 info, 33.4 rebounds, 14.8 helps, 5.3 steals and 2.7 blocks for each video game despite the fact that capturing 48.1% versus the marketplace. Their rivals incorporate averaged 72.4 details for every : 4-6, averaging 66.4 specifics, 33.1 rebounds, 11.1 helps Jake Henry Jersey, 4.9 steals and 3.6 blocks for each sport even though taking pictures 41.3% towards the sector. Their rivals consist of averaged 72.0 info. The made this tale making use of technological innovation delivered by means of Information and facts Skrive and info against Sportradar. Cowboys Shop
    • DUTA89 agen slot online terbaik dan sering memberikan kemenangan kepada setiap member yang deposit diatas 50k dengan tidak klaim bonus sepeser pun.   Link daftar : https://heylink.me/DUTA89OFFICIAL/  
    • Hello All! Started a MC Eternal 1.6.2.2 server on Shockbyte hosting. The only other mod I added was betterfarmland v0.0.8BETA. Server is 16GB and Shockbyte wont tell me how many CPU cores i have.  We are having problems now when players log in it seems to crash the server. At other times it seems fine and we can have 3 people playing for hours at a time. Usually always when it does crash it is when someone logs in. Crash Reports Below. To the person who can post the fix I will reward $100 via Paypal.   ---- Minecraft Crash Report ---- // This is a token for 1 free hug. Redeem at your nearest Mojangsta: [~~HUG~~] Time: 2024-09-19 21:04:58 UTC Description: Exception in server tick loop java.lang.StackOverflowError     at net.minecraft.advancements.PlayerAdvancements.hasCompletedChildrenOrSelf(PlayerAdvancements.java:451)     at net.minecraft.advancements.PlayerAdvancements.shouldBeVisible(PlayerAdvancements.java:419)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:385)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.P  
  • Topics

×
×
  • Create New...

Important Information

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