Posted November 14, 201410 yr I am making a furnace that will produce power, called a 'power furnace.' I would like to have the textures update based on whether the furnace is burning or not. To do this, i used metadata. 0-3 directionals off, 4-7 directionals on However, when I place fuel in the tile entity, the textures on the x axis start to flicker, and the the front texture, no matter what side. They seem to be changing metadata and my console proves it. Although the furnace should be burning, the metadata output i coded in shows 0 most of the time, sometimes jumping to 3, back to 0, sometimes to 7, back to 0, and then sometime to 11. It shouldnt be going that high. TileEntity: https://github.com/KeeganDeathman/LabStuff/blob/master/java/keegan/LabStuff/tileentity/TileEntityPowerFurnace.java BlockPowerFurnace: https://github.com/KeeganDeathman/LabStuff/blob/master/java/keegan/LabStuff/blocks/BlockPowerFurnace.java It shouldn't be doing this, should it? [shadow=gray,left][glow=red,2,300]KEEGAN[/glow][/shadow]
November 14, 201410 yr Author the burn time if-else chain is because i do not think you can have a case for >0, if you can, IDK. Also no switch statements for booleans. [shadow=gray,left][glow=red,2,300]KEEGAN[/glow][/shadow]
November 14, 201410 yr Switch statements have a "default" case which handles all cases you don't explicitly specify. int number; ... switch (number) { case 0: // do thing given number == 0 break; case 1: // do thing given number ==1 break; default: // do thing for all unspecified cases break; }
November 14, 201410 yr Author I guess it might have helped some, but there was no noticeable difference when I restricted the operations of updateEntity to just the server. I'd also like to pint out the following: side1 is the top/bottom texture as well as the default side2 is the sides and back texture side3 is the front when off side3On is the front while on The textures facing east and west will flicker between their correct state(except the front, which should be side3On, but shows side3, but that may be a problem with the burnTime) and side1. If the side3 is facing north it flickers between side3 and side3On If the side3 is facing south, it flickers between side3 and side2, and the back flickers between side2 and side1 MrCaracal thank you. I will update my code. disesiben07 I will try that [shadow=gray,left][glow=red,2,300]KEEGAN[/glow][/shadow]
November 14, 201410 yr Author diesienben07 regarding your latest post, I have updated the code regarding that, if it detects more fuel it sets it back to true in the same tick. Swapping out the if-else chains with switch statements seems to have stopped the flickering, but now the burn time is acting odd. The console shows the bt increasing and decreasing appropriately. However, the fuel is eaten up automatically, and the gui counter and the textures both indicate 0. [shadow=gray,left][glow=red,2,300]KEEGAN[/glow][/shadow]
November 14, 201410 yr Author Had a feeling you'd say that. Updated [shadow=gray,left][glow=red,2,300]KEEGAN[/glow][/shadow]
November 14, 201410 yr Author I dont have that source linked. Do you? Either way, the getIconOff and getIconOn are different, in the terms of which metadata is being checked. [shadow=gray,left][glow=red,2,300]KEEGAN[/glow][/shadow]
November 14, 201410 yr Author Regarding the source, tell me how to do that. Regarding the icons. Yep, just saw that. Thing is when i switched back to if-else from switch statements in the TE, it started flickering again. [shadow=gray,left][glow=red,2,300]KEEGAN[/glow][/shadow]
November 14, 201410 yr Author Shut up i figured the source out. Google! After MrCaracal explained default. I ended up changing it back due to thinking that was a problem, but I may just change it back. [shadow=gray,left][glow=red,2,300]KEEGAN[/glow][/shadow]
November 14, 201410 yr Author Okay so for the container I would guess I need to sync the server's tile entity with the client's tile entity? I found these two... public void addCraftingToCrafters(ICrafting p_75132_1_) { super.addCraftingToCrafters(p_75132_1_); p_75132_1_.sendProgressBarUpdate(this, 0, this.tileFurnace.furnaceCookTime); p_75132_1_.sendProgressBarUpdate(this, 1, this.tileFurnace.furnaceBurnTime); p_75132_1_.sendProgressBarUpdate(this, 2, this.tileFurnace.currentItemBurnTime); } @SideOnly(Side.CLIENT) public void updateProgressBar(int p_75137_1_, int p_75137_2_) { if (p_75137_1_ == 0) { this.tileFurnace.furnaceCookTime = p_75137_2_; } if (p_75137_1_ == 1) { this.tileFurnace.furnaceBurnTime = p_75137_2_; } if (p_75137_1_ == 2) { this.tileFurnace.currentItemBurnTime = p_75137_2_; } } Would I use these to make my gui get the proper burn time, or am I grasping at non-existent hooks. [shadow=gray,left][glow=red,2,300]KEEGAN[/glow][/shadow]
November 14, 201410 yr Author I am wondering how I would get it to continousley update, I have it working, but you get whatever the burnTime was at the opening of the gui. [shadow=gray,left][glow=red,2,300]KEEGAN[/glow][/shadow]
November 14, 201410 yr Author Everything works! Thanks for all your help! [shadow=gray,left][glow=red,2,300]KEEGAN[/glow][/shadow]
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.