Jump to content

Recommended Posts

Posted

Hi, I've stared writing a mod and have had some good success so far (really impressed with Forge BTW!). However I think my ambitions lie somewhat outside the normal mods.

 

I want to add a special effect to any block (or ultimately tile entity). Basically I want one player to be able to mark a set of blocks and then have that set of blocks be highlighted (for all players). Perhaps something a little like the black outline on the block in the centre of the screen, but persistant and on more than one block, or maybe some glow effect... I'm thinking that I can just render transparent a (very slightly larger) block over the top of the base block. The actual rendering style is to be decided, but I'm guessing it wouldn't affect the implementation too much.

 

I've had a look through this forum as best I can and I've also dug through this tutorial:

 

http://www.minecraftforge.net/wiki/Multiple_Pass_Render_Blocks

 

but I've not had much success so far.

 

Ideally I want to avoid modifying core Minecraft code, and keep all my code nicely isolated, so adding a new render pass doesn't seem like a good idea (for a number of reasons!). There seem to be a couple of pre/post block render Forge hooks but they seem to be commented out at the moment. I also don't think that would be the right place because if a block is not rendered in the transparent pass then it wouldn't get the hooks called that would allow me to overlay a glow.

 

I've seen that there's a ISimpleBlockRenderingHandler, but I think if I implemented that then it would only get called for non-vanilla blocks, whereas I really want to be able to be able to do this for all blocks without having to customise all the existing blocks.

 

Hopefully that's a decent enough description, could any one give me any pointers of things to look into? I'm happy to consider entirely different methods of achieving the same results by the way! but I am keen to keep the code as simple and non-invasive as possible. I just need a foot in the door, some places to put breakpoints and some code to read :)

 

Thanks in advance!

Posted

FYI After a few more searches I found this, which might be an option to try:

 

  On 6/27/2013 at 6:57 PM, hydroflame said:

you could technicly make an invisible entity that has information about the width/height/length of the protected area and x, y,z  and use this entity to draw a big box that represents the limit of the area.

Posted
  On 8/13/2013 at 8:23 AM, StevilKnevil said:

FYI After a few more searches I found this, which might be an option to try:

 

  Quote

you could technicly make an invisible entity that has information about the width/height/length of the protected area and x, y,z  and use this entity to draw a big box that represents the limit of the area.

 

hey thats ME :D!!!!

 

but yeah thats probably the best way to go unless you feel like doing ASM....... no come to think of it if you want the OTHER players to see it, its the only way to go

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Posted
  On 8/13/2013 at 1:41 PM, hydroflame said:

hey thats ME :D!!!!

 

:D

 

  Quote

but yeah thats probably the best way to go unless you feel like doing ASM....... no come to think of it if you want the OTHER players to see it, its the only way to go

 

ASM? I did actually think another way might be to do some code injection to (for example) modify the WorldRenderer... but I think that's probably bordering on yuk ;-)

Posted

So I've got this kinda working for using entities to do this, but I'm tending away from this idea now. The 'highlighting' of the blocks is something that is going to change relatively infrequently (e.g. about as often as block creation/destruction) rather than every frame. I think it would be more efficient to have it as part of the block render list rather than an entity that is updated every frame.

 

Or am I misundertanding how the block render lists are built?

 

NB I've got no idea yet on how I'll achieve it!

Posted

minecraft makes 1 glDisplayList per chunk, but i dont think theres any event that is called when a display list is updated, so you might have to make one

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Posted

I've got something working, but it's not the least invasive thing ever!

 

I extended the BlocksRederer to be a BlockEffectRenderer. It's still responsible for rendering the blocks themselves, but it also has the option to render a BlockEffect for each block it handles.

 

I had to do this because the block effect might be in renderpass 1, but if the block only renders in renderpass 0 then it all goes wrong :)

 

So I needed to modify WorldRenderer to instantiate (and call) my BlockEffectRenderer, which was only around 5 lines of code that needed changing, but I might try and tweak it a bit more to clean it up even more.

Posted

Perhaps a bit of a different method:

 

There is a renderWorldLast event--called after other world rendering to allow you to render things in ...the world.

 

You would need to synch a list of the 'highlighted' blocks between server + clients (packets, basic synch stuff), but then could simply use the renderWorldLast event to directly render your highlights -- no need for entities and the overhead they bring, or trying to use block renderers.  Using the event, you could theoretically render...anything you wanted. It seems to work well with transparency and occlusion (I have it rendering large bounding boxes around block-selections as well, using semi-transparent lines).

 

(see https://github.com/shadowmage45/AncientWarfare/blob/master/AncientWarfare/src/shadowmage/ancient_warfare/client/render/AWRenderHelper.java#L201 for examples)

 

 

Posted
  On 8/21/2013 at 5:01 PM, shadowmage4513 said:

Perhaps a bit of a different method:

 

There is a renderWorldLast event--called after other world rendering to allow you to render things in ...the world.

 

Very interesting, let me dig into that a little...

Posted
  On 8/21/2013 at 5:01 PM, shadowmage4513 said:

There is a renderWorldLast event--called after other world rendering to allow you to render things in ...the world.

 

This is really useful stuff (and I'll definitely be using that hook) but for this particular use case the special effects on the blocks are relatively unchanging between frames rather than changing every frame; so for efficiencies sake I think it's better to bake this stuff into the render lists for the chunk rather than pay the per frame costs of rendering the effects.

 

Please correct me if I'm mistaken!

Posted

You may very well be correct about the per-frame costs.  The renderWorldLast method doesn't have an easy way to setup/call an optimized displayList, so it has to rebuild/recalculate per-frame.  I am by no means a rendering expert though, so others may have more accurate info/input on it.

 

Please keep us informed if you do find a better process to accomplish your goal, would be interested in hearing about it :)

Posted
  Quote
I am by no means a rendering expert though, so others may have more accurate info/input on it.

*puts on glasses*

afaik there is no way to do that, for some reason mc uses displayList for 99% of the blocks then TileEntitySpecialRenderer for the other 1%, the thign that i hate is that there is no middle, you either need a TileEntity or you dont and cant use animation/render every frame .... :\ optifine has something for that but unfortunatelly that a mod in itself and now included in vanilla mc

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Posted
  On 8/22/2013 at 9:21 PM, shadowmage4513 said:

Please keep us informed if you do find a better process to accomplish your goal, would be interested in hearing about it :)

 

My best thinking at the moment is to do something like this in WorldRender:

 

                                    if (block != null)
                                    {
                                        if (l1 == 0 && block.hasTileEntity(chunkcache.getBlockMetadata(k2, i2, j2)))
                                        {
                                            TileEntity tileentity = chunkcache.getBlockTileEntity(k2, i2, j2);

                                            if (TileEntityRenderer.instance.hasSpecialRenderer(tileentity))
                                            {
                                                this.tileEntityRenderers.add(tileentity);
                                            }
                                        }

                                        int i3 = block.getRenderBlockPass();

                                        if (i3 > l1)
                                        {
                                            flag = true;
                                        }
                                        // !!! NEW: Slight change here !!!
                                        if (block.canRenderInPass(l1))
                                        {
                                            flag1 |= renderblocks.renderBlockByRenderType(block, k2, i2, j2);
                                        }
                                    }
                                     
                                    // !!! NEW !!!
                                    // Note that this can happen on air blocks (i.e. block == null)
                                    {
                                    	/*
                                         * to handle special effects for blocks
                                         */
                                        int i3 = ForgeHooksClient.getBlockEffectRenderPass(block, k2, i2, j2);

                                        if (i3 > l1)
                                        {
                                            flag = true;
                                        }
                                        if (i3 == l1)
                                        {
                                        	// This is the correct render pass for this block effect
                                        	flag1 |= ForgeHooksClient.renderBlockEffect(block, k2, i2, j2);
                                        }
                                    }
                                    // !!! END NEW !!!

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

    • One code that’s making waves across shopping platforms is acw696499. This Temu coupon brings maximum benefits for shoppers in the USA, Canada, Europe, and even the Middle East. Whether you're searching for the Temu coupon code 2025 for existing customers or just hunting for a Temu 90% discount coupon, this article is your complete guide to saving smart. What Is The Temu Coupon Code 90% Off? The Temu coupon 90% off is your passport to incredible deals. Both new and existing users can unlock huge discounts by applying our exclusive 90% off Temu coupon code on the Temu app or website. Here’s how acw696499 helps you: acw696499 – Get up to 90% off instantly if you're a first-time user on Temu. acw696499 – Enjoy an extra 30% discount if you're an existing user placing another order. acw696499 – Receive a flat $100 off your total order value as a brand-new Temu shopper. acw696499 – Access a $100 coupon pack that can be used across multiple orders for bigger savings. acw696499 – Enjoy $100 flat discount and special promotions tailored for users in the USA, Canada, and European nations. Temu Coupon Code 90% Off For New Users If you're signing up for the first time, you're in luck! The Temu coupon 90% off gives you maximum value, turning your first purchase into a mega deal. Even though it’s promoted for new users, our Temu coupon code 90 off for existing users has perks too—but new users get the juiciest deals. Here’s what you get using acw696499: acw696499 – Flat 90% discount for new Temu users on their very first order. acw696499 – Claim a $100 coupon bundle instantly after registration. acw696499 – Redeem multiple-use $100 coupon pack applicable across various categories. acw696499 – Get free international shipping to 68 countries worldwide. acw696499 – Grab an extra 40% off on any item as a welcome gift for first-time users. How To Redeem The Temu 90% Off Coupon Code For New Customers? Using the Temu 90% off coupon is easy! Just follow these steps and start saving big. Go to the Temu app or official website. Sign up with a new email address if you're a new customer. Browse your favorite products and add them to the cart. On the checkout page, paste the Temu 90 off coupon code: acw696499. Hit apply, and enjoy 90% off instantly on your first order! Temu Coupon Code 90% Off For Existing Users Already a Temu shopper? Don't worry, you’re not left out. The Temu 90 off coupon code also works beautifully for returning users. You’ll be glad to know the Temu coupon code for existing customers still gives you huge perks when using our exclusive code. Here’s what you get using acw696499: acw696499 – A 90% discount even for existing Temu users during promotional periods. acw696499 – $100 coupon pack available for returning shoppers across multiple categories. acw696499 – Free gift with every order, delivered via express shipping across the USA and Canada. acw696499 – Additional 90% off applied on top of ongoing discounts, making the deal even sweeter. acw696499 – Enjoy free shipping to 68 countries without any extra charges. How To Use The Temu Coupon Code 90% Off For Existing Customers? It’s just as easy for existing customers to redeem the Temu coupon code 90 off. Follow these simple steps: Open the Temu app and log into your account. Browse and select your desired items. Head to checkout and look for the promo code section. Apply the Temu discount code for existing users: acw696499. Tap “Apply” and your discount will automatically reduce your order total! How To Find The Temu Coupon Code 90% Off? Want the Temu coupon code 90% off first order without hassle? Here's how: You can find the latest Temu coupons 90 off by subscribing to the Temu newsletter. This is the easiest way to stay updated with ongoing promotions and new deals. Additionally, follow Temu on Instagram, Facebook, and Twitter. Their social media handles often drop flash coupons and exclusive promo codes. And of course, you can always visit trusted coupon websites (like ours!) to find verified and tested Temu discount codes, including acw696499. How Temu 90% Off Coupons Work? The Temu coupon code 90% off first time user is applied during checkout and automatically deducts up to 90% from the total amount of eligible products. The Temu coupon code 90 percent off works via an advanced promotional engine that recognizes new users or eligible existing customers. Once the code is entered, the system applies a discount based on your account status, location, and the product category. It’s a smart way Temu uses to reward both new and loyal users while keeping the shopping experience seamless. How To Earn 90% Off Coupons In Temu As A New Customer? To earn the Temu coupon code 90% off, simply create a new Temu account via their app or website and use a fresh email. The Temu 90 off coupon code first order can be accessed immediately after signing up. You’ll also get additional coupons through daily app logins, referrals, game spins, and social sharing. Stay active and your discount pool grows fast! What Are The Advantages Of Using Temu 90% Off Coupons? Using the Temu 90% off coupon code legit gives you a ton of advantages, whether you're new or returning to Temu. Here’s why: 90% discount on your very first order. $100 coupon bundle for multiple uses across categories. 70% discount on high-demand products like electronics, fashion, and gadgets. 90% off for existing Temu customers as loyalty rewards. Up to 90% off on selected limited-time items. Free gift for new users upon first-time sign-up. Free delivery to 68 countries including the USA, UK, and Middle Eastern nations. Temu Free Gift And Special Discount For New And Existing Users Using the Temu 90% off coupon code not only gives you discounts but also unlocks a world of special gifts. The 90% off Temu coupon code is your gateway to added bonuses. Check out these rewards with acw696499: acw696499 – 90% discount for your first-ever Temu order. acw696499 – Extra 30% off on any individual product in your cart. acw696499 – Free welcome gift for new Temu users who activate the code. acw696499 – Up to 70% off across fashion, tech, and home goods. acw696499 – Free gift plus free international shipping to 68 countries including the USA and UK. Pros And Cons Of Using Temu Coupon Code 90% Off Here’s a quick look at the Temu coupon 90% off code and Temu free coupon code 90 off in action: Pros: Massive 90% off savings for new and existing users. Exclusive $100 coupon bundle. Additional discounts on already discounted products. Free international shipping included. Special gifts for first-time buyers. Cons: May not apply to all products. Limited-time usage. Can only be used once per new account in some cases. Terms And Conditions Of The Temu 90% Off Coupon Code In 2025 Every deal comes with some fine print. Here are the key T&Cs for the Temu coupon code 90% off free shipping and Temu coupon code 90% off reddit mentions: The coupon code acw696499 has no expiration date. Valid for both new and existing users. Available for use in 68 countries worldwide. No minimum purchase amount is required. Only one coupon code can be used per checkout. Cannot be combined with other storewide promotions or codes. Final Note If you're shopping this August, don’t miss out on the Temu coupon code 90% off. It’s one of the most generous offers Temu has launched this year. Whether you’re a new buyer or a returning customer, the Temu 90% off coupon will help you save big—so don’t hesitate to use acw696499 now. FAQs Of Temu 90% Off Coupon  Is the Temu 90% off coupon code valid in all countries? Yes, the code is valid in 68 countries including the USA, Canada, the UK, and Europe.  Can I use the 90% off Temu code on sale items? Absolutely! It applies on sale and non-sale items, but exclusions may vary per category.  How many times can I use the Temu 90% coupon code? New users can use it once, while existing users can access recurring benefits through bundles.  Do I get free shipping with the 90% off code? Yes, the 90% off code includes free standard shipping in all 68 eligible countries.  Is the code acw696499 legit for Temu? Yes! It’s verified, working, and 100% legit for both new and existing customers.
    • The acw696499 Temu coupon code is your ultimate key to massive discounts across the USA, Canada, and European countries. Whether you're shopping fashion, home goods, or electronics, this code unlocks unbeatable value. If you're hunting for a Temu coupon code 2025 for existing customers or a Temu 70% discount coupon, we’ve got you covered. This article is your complete guide to unlocking the best Temu deals this month. What Is The Temu Coupon Code 70% Off? If you’ve ever wondered whether both new and existing customers can enjoy a big discount at Temu, the answer is yes! With our exclusive Temu coupon 70% off, you can now enjoy top-tier savings directly on the Temu app and website using the 70% off Temu coupon code. Here’s how you can use acw696499 to your advantage: acw696499 – Get up to 70% off on your first purchase as a new user. acw696499 – Enjoy 70% extra discount as an existing customer on selected items. acw696499 – Unlock a flat $100 off for new Temu users instantly. acw696499 – Redeem a $100 coupon pack valid for multiple transactions throughout August. acw696499 – Get an extra $100 off promo code specially curated for customers in the USA, Canada, and Europe. Temu Coupon Code 70% Off For New Users New to Temu? You’re in for a treat. With our Temu coupon 70% off, first-time customers can grab the best deals in August like never before—even better if you're in the USA, Canada, or Europe. Plus, if you're searching for a Temu coupon code 70 off for existing users, don't worry—we cover that too. But here’s what new users get when using acw696499: acw696499 – Flat 70% discount for new users on their first order. acw696499 – $100 coupon bundle exclusively for first-time buyers. acw696499 – Up to $100 coupon bundle redeemable across multiple categories. acw696499 – Free shipping to 68 countries including the UK, USA, and Germany. acw696499 – Extra 40% off on any purchase for new app signups. How To Redeem The Temu 70% Off Coupon Code For New Customers? Want to know how to apply the Temu 70% off deal? Here's how to use the Temu 70 off coupon code in a few easy steps: Download and install the Temu app or visit their website. Create a new account using your email or phone number. Add your favorite products to the shopping cart. Go to checkout and enter acw696499 in the promo code field. Instantly enjoy your massive savings with 70% off. Temu Coupon Code 70% Off For Existing Users Good news for loyal Temu shoppers: the savings aren’t limited to new users. Even as a returning customer, you can enjoy exclusive offers using our Temu 70 off coupon code and Temu coupon code for existing customers. Here’s what you get with acw696499 if you’re an existing user: acw696499 – 70% discount for existing Temu users across select categories. acw696499 – $100 coupon bundle for multiple purchases throughout August. acw696499 – Free gift with express shipping to USA and Canada. acw696499 – Extra 30% off on top of your existing discount offers. acw696499 – Free shipping to over 68 countries for all items. How To Use The Temu Coupon Code 70% Off For Existing Customers? Here's how to redeem the Temu coupon code 70 off and activate your Temu discount code for existing users: Open the Temu app or go to the website. Log in to your existing Temu account. Browse and add your favorite products to your cart. On the payment page, apply the promo code acw696499. Enjoy up to 70% off instantly at checkout. How To Find The Temu Coupon Code 70% Off? To easily find a Temu coupon code 70% off first order or the latest Temu coupons 70 off, here’s what you should do: Sign up for the Temu newsletter. This gives you direct access to verified coupons sent straight to your inbox. Additionally, visit Temu’s official social media pages. They frequently drop promo codes for limited-time offers. You can also browse trusted coupon websites—like ours—to find the most updated and tested Temu coupon codes. How Temu 70% Off Coupons Work? The Temu coupon code 70% off first time user and Temu coupon code 70 percent off are both digitally applied codes you enter during checkout. When you apply the code (like acw696499), the system automatically deducts a percentage (up to 70%) from the total purchase amount. Depending on whether you’re a new or existing customer, the discount structure varies. New users may receive additional bundles and freebies, while returning customers get loyalty bonuses like free gifts, express shipping, or layered discounts. How To Earn 70% Off Coupons In Temu As A New Customer? To earn the Temu coupon code 70% off as a new user, all you need to do is sign up for an account and enter the Temu 70 off coupon code first order at checkout. You may also participate in Temu’s referral program and spin-to-win promotions. These features often generate new discount codes, coupon bundles, and other perks. The earlier you join in August, the better your chances of stacking your savings with exclusive limited-time deals. What Are The Advantages Of Using Temu 70% Off Coupons? The benefits of using our Temu 70% off coupon code legit and coupon code for Temu 70 off include: 70% discount on your first order. $100 coupon bundle usable across multiple categories. 70% discount on trending and popular items. 70% off for existing Temu customers in selected countries. Up to 70% off in limited-time flash sales. Free gift for new users with every purchase. Free delivery to 68 countries worldwide. Temu Free Gift And Special Discount For New And Existing Users With our Temu 70% off coupon code and 70% off Temu coupon code, you get more than just savings—you also get bonuses. Use acw696499 and receive: acw696499 – 70% discount for your first order. acw696499 – Extra 30% off on any item. acw696499 – Free gift for new Temu users. acw696499 – Up to 70% discount on any item on the Temu app. acw696499 – Free gift with free shipping to 68 countries including the USA and UK. Pros And Cons Of Using Temu Coupon Code 70% Off Here are some pros and cons of using our Temu coupon 70% off code and Temu free coupon code 70 off: Pros: Huge 70% discount on thousands of items. Easy-to-use code available for both new and returning users. Free gifts and shipping bonuses included. Stackable with existing sales. Available for global customers. Cons: Limited to eligible items. Some deals are time-sensitive. Shipping time may vary based on location. Terms And Conditions Of The Temu 70% Off Coupon Code In 2025 Please note the Temu coupon code 70% off free shipping and Temu coupon code 70% off reddit terms: This coupon code has no expiration date. Valid for both new and existing users in 68 countries. There are no minimum purchase requirements. Free shipping is available for eligible countries. Coupon stackability may vary during special events or sales. Final Note The Temu coupon code 70% off offers some of the best savings you’ll find online this August. Whether you’re a first-timer or a loyal customer, this code ensures you save big. Use the Temu 70% off coupon to unlock exciting deals, free gifts, and jaw-dropping discounts across the Temu app and website. Don’t miss out on your chance to maximize savings today. FAQs Of Temu 70% Off Coupon What is the Temu coupon code for 70% off in August 2025? The code acw696499 gives users up to 70% off on various categories for both new and existing customers across multiple countries. Is the Temu 70% off coupon code legit? Yes, acw696499 is 100% legit and tested to work during August 2025 for users in the USA, Canada, UK, and Europe.  Can existing Temu customers use the 70% off coupon code? Absolutely. The acw696499 code also benefits returning users with extra discounts and special perks like free gifts and shipping.  How can I apply the Temu 70% off coupon code? Simply enter acw696499 in the promo code section during checkout either on the app or website to claim your discount.  Where can I find the latest Temu coupons 70 off? You can visit Temu’s official social pages, sign up for their newsletter, or check trusted coupon websites like ours for verified codes.
    • cat_jam, rainbows, make_bubbles_pop and cavedust are client-side-only mods Remove these from your server
  • Topics

×
×
  • Create New...

Important Information

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