Jump to content

[1.11.2] Tile Entity Block Texture Not Updating When Property Changes


Recommended Posts

Posted

Hey there forum,

Having some serious issues with getting my block to update its texture when a property is changed - as far as I can tell, i've implemented every single bit of code suggested, and should have a working implementation, and yet for some reason it refuses to work correctly.

 

This gist contains all of the relevant code, along with the blockstate file for the block I'm having trouble with.

 

While the BlockGrinder seems to receive the appropriate property update (with the F3 menu representing state as "grinder_on" when the conditions are met and seamlessly switching to "grinder_off" when they're not), the texture of the block only updates if I press F3+A to reload the chunks.

Any ideas what I could be screwing up?

Posted (edited)

Why are you extending BlockContainer?  You don't need this, it fucks everything else up and stop using it.

This does dick and as such you shouldn't even be extending BlockContainer at all, even if that class had value (which it doesn't):

public TileEntity createNewTileEntity(World worldIn, int meta) {
    return null;
}

Seriously. WTF.  Unless you meant for it to be abstract like the rest of the class...

Why do you create your own FACING property? Why not using the one from BlockDirectional or BlockHorizontal?

As for textures based on properties inside a TE, you need to sync the TE state to the client:

https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/farming/entities/TileEntityTanner.java#L95-L98

Edited by Draco18s

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.

Posted (edited)
  Quote

Why are you extending BlockContainer?

Expand  

Well, shit. Looks like I didn't get the memo. (I haven't worked on a mod since 1.7, so I'm still working on old knowledge from that and other sources, so I'm not exactly the brightest when it comes to all of it).

I'll remove that garbage, and see what else I can do.

 

  Quote
public TileEntity createNewTileEntity(World worldIn, int meta) {
    return null;
}
Expand  


I can't handle how moronic I can be - sorry if this was a waste of your time.
 

  Quote

Why do you create your own FACING property? Why not using the one from BlockDirectional or BlockHorizontal?

Expand  

Because I'm pretty fucking stupid and totally didn't look for an implementation before doing it myself. Also gonna change this.

Edited by CalmBit
More hot garbage
Posted (edited)

Ok, so I made the requested "no shit" improvements and added the extra two methods detailed in file you linked for TE state syncing (didn't realize there were four separate methods, but alright). Should have all other syncing measures in place.

The TE's update now has the following (mirrored from the file, essentially):
 

        if(wasActive != isActive) {
            this.world.markBlockRangeForRenderUpdate(this.pos, this.pos);
            this.world.notifyBlockUpdate(this.pos, this.world.getBlockState(this.pos), this.world.getBlockState(this.pos), 3);
            this.world.scheduleBlockUpdate(this.pos, this.getBlockType(), 0, 0);
            this.markDirty();
        }

 

Still not having any luck on the texture updating. The code's definitely being called when it needs to be (tested in debugger), and all other TE sync methods should be in place (packet updating, getActualState(), etc.)

(gist contains updated code as well)

Edited by CalmBit
Posted (edited)

Alright, figured it out, feel like an idiot. Your class tipped me off to the fact I was running sided logic, and that my update function was probably only being called on the server. Turns out that's a solid yes, and de-sided the logic. Will this have any particular side-effects I should look out for? I'm not exactly sure what the purpose is with siding that kind of logic, but it seems to be the standard.

 

That's not necessarily a solid idea, on my part. Seems like a great way to get weird de-sysncs...

Edited by CalmBit
Posted

As a last edit, I re-instated the server-sided logic, but made wasActive an instance variable rather than a local variable, with its value being each time its found to be non-congruent with isActive.  This achieves all of the desired effects. Thank you!

Posted
  On 3/14/2017 at 6:05 AM, CalmBit said:

(didn't realize there were four separate methods, but alright).

Expand  

They all do slightly different things. I ended up with all four because something wasn't working right (turned out to be a problem elsewhere, oops) and having all four doesn't hurt necessarily.  It could probably be reduced two two of them and work Just Fine.

 

Next, there's actually three network methods, not two.

https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/farming/entities/TileEntityTanner.java#L176-L188

One is called when the TE is first created, the other the rest of the time (and no, I can't remember which is which).

  • Like 1

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.

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

    • Maximize Savings With [acu639380] T e m u Promo Code $100 Off 2025 brings you unbeatable savings on T e m u , one of the most popular online shopping destinations. With the exclusive T e m u  Promo code (acu639380), you can unlock incredible discounts, including $100 off for new and existing users. Whether you’re a first-time shopper or a loyal customer, T e m u  ensures a seamless shopping experience with fast delivery, free shipping in 67 countries, and up to 90% off on a wide range of products. Why Choose T e m u ? T e m u  is a treasure trove of trending items at unbeatable prices. From fashion and beauty to electronics and home essentials, T e m u ’s vast collection caters to all your shopping needs. Here are some key features that make T e m u  stand out: Free shipping: Available in 67 countries. Unbeatable prices: Discounts up to 90% off. Fast delivery: Ensures your items arrive promptly. Exclusive Benefits of T e m u  Promo Code (acu639380) Using the T e m u  Promo code (acu639380) in 2025 can help you save more than ever before. Here’s a breakdown of the benefits: $100 Off for New Users: New shoppers can enjoy a flat $100 discount with the T e m u  first-time user Promo. $100 Off for Existing Users: Loyal customers can also take advantage of this substantial discount with the same code. 40% Extra Off: Apply the T e m u  Promo code (acu639380) to receive an additional 40% discount on selected products. $100 Promo Bundle: Get a $100 Promo bundle to maximize savings across multiple purchases. Free Gifts for New Users: First-time shoppers are rewarded with exclusive gifts. How to Redeem T e m u  Promo Code (acu639380) Redeeming your T e m u  Promo code (acu639380) is simple and straightforward: Visit the T e m u  website or app. Add your favorite items to your shopping cart. Enter the promo code (acu639380) at checkout. Watch the savings apply instantly! T e m u  Promos for 2025 This month is packed with incredible offers tailored for both new and existing users: For New Users: T e m u  Promo code (acu639380) $100 off: Enjoy a significant discount on your first order. T e m u  first-time user Promo: Unlock exclusive savings and free gifts. T e m u  discount code (acu639380) for 2025: Enhance your shopping experience with additional discounts. For Existing Users: T e m u  Promo code (acu639380) $100 off: Loyal customers can continue to enjoy massive savings. T e m u  Promo code (acu639380) 40% off: Apply this code for extra discounts on selected items. T e m u  Promo bundle: A $100 Promo bundle available for repeated use. Country-Specific T e m u  Promo Codes T e m u  offers regional discounts to ensure everyone can benefit from their amazing deals. Here’s how the T e m u  Promo code (acu639380) can be used worldwide: North America USA: $100 off your next purchase with T e m u  Promo code (acu639380). Canada: Enjoy a $100 discount using the same code. South America Mexico: Save 40% on selected items with T e m u  Promo code (acu639380). Brazil: Get exclusive 40% discounts on your shopping. Europe UK: Apply the T e m u  Promo code (acu639380) for $100 off. Germany: Take advantage of the $100 Promo bundle. Asia Japan: First-time users can use T e m u  new user Promo for $100 off. India: Use the Promo bundle for multiple savings. T e m u ’s New Offers in 2025 This month, T e m u  has introduced fresh deals to elevate your shopping experience. Enjoy free shipping, trending items at up to 90% off, and exclusive discounts with the T e m u  promo code (acu639380). Benefits of T e m u  Promos T e m u  Promos are designed to enhance your shopping experience. Here are the standout advantages: $100 Off: Ideal for significant savings, whether you’re a new or existing user. 40% Extra Discount: Perfect for those looking to stock up on essentials. Free Gifts: Specially curated for first-time shoppers. $100 Promo Bundle: Offers flexibility across multiple purchases. How T e m u  Makes Shopping Easy T e m u ’s user-friendly platform ensures a hassle-free shopping experience. With options like fast delivery, detailed product descriptions, and seamless payment methods, T e m u  is a one-stop shop for all your needs. FAQs about T e m u  Promo Code (acu639380) Can I combine multiple T e m u  Promo codes? No, only one Promo code can be used per transaction. However, the $100 Promo bundle can be split across multiple orders.  Is the T e m u  Promo code (acu639380) valid on all items? The code applies to a wide range of products but July exclude certain categories.  How often can I use the T e m u  Promo code (acu639380)? The usage frequency depends on the specific terms and conditions of each code. Final Thoughts T e m u  is setting new standards in online shopping with its incredible deals and discounts. With the T e m u  Promo code (acu639380), you can maximize your savings and enjoy a premium shopping experience. Whether you’re new to T e m u  or a returning customer, these offers ensure that every purchase is a win. Don’t wait—use the T e m u  promo code (acu639380) today and start saving big!
    • Typically—at least in my case—the broken datapack thing always turns out to be a broken mod. Someone else here might have a better answer for you than I do, but when that happens, I go through all my mods, disabling them one by one until I locate the culprit. It’s a headache, but it’s the only way I know how to do it.
    • Is there any mod for creating world templates for 1.20.1 forge, I found a fabric mod for such as purpose but can't seem to find one for forge. I know connector and forgeified fabric api exist but i'd prefer a forge mod to adding like 50 mods to my 200 mod modpack. Does anyone know of such a mod or is my only option using the fabric mod with connector?  
    • Please read the FAQ (https://forums.minecraftforge.net/topic/125488-rules-and-frequently-asked-questions-faq/) and post logs as described there to a site such as https://mclo.gs and post the link here.
    • I'm trying to play with the origins mod but even after adding it to the mod folder it doesn't show up in minecraft forge. I'm using 1.20.2 because that is the last update from the origins and I'm using the same version of forge.
  • Topics

×
×
  • Create New...

Important Information

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