Jump to content

Recommended Posts

Posted

can some one please make me a block with a custom render from scratch with all the files needed?? because i cant find any tutorials that explain it well and every time i try it crashes minecraft. also I'm using forge 1.4.6-6.5.0.487

Posted

i have tried that already but it doesn't explain it very well. i always get an error when i type this line

renderId = this.getRenderId();

it says it needs to be static but when i change it to static it tells me to remove the static modifier from getRenderId

Posted

I'm converting a mod I wrote from ModLoader to Forge. The current issue is my custom block renderer. It just isn't getting called. I also have a problem with "renderId", is that modelId or something else? There doesn't appear to be anything to allocate modelId like ModLoader. Do I just assign them from zero on myself, with custom modelId for my renderer? If so, what is renderId? Does that allow multiple renderers for a single package?

 

What I did was assign modelId starting at 0 (this mod has 3 custom block renderers), and assign renderId as 0. If I got that wrong, it should render every block with the first renderer. But my renderer isn't being called at all, it's using default block style with my texture.

 

One issue is with registering a renderer. I used the tutorial, the same one linked above. It's written for Minecraft 1.3. It says to add a line to registerRenderInformation in my package Proxy. That line is:

RenderingRegistry.instance().registerBlockHandler(new BoozeRender());

The problem is "instance" is marked Depricated. So what is the new/current way of registering a block renderer?

Posted

If you are interested in making a custom block from scratch, take a look at this : http://www.minecraftforum.net/topic/1483366-universal-subarakis-one-stop-custom-block-tutorial-make-it-with-techne/

its written for modloader, but most of the code is still relevant and very useful. I find it is also very good at explaining what some of the numbers do, so you are able to fiddle around with them and create your own features.

Posted
  On 1/17/2013 at 1:36 AM, Maurice753 said:
can some one please make me a block with a custom render from scratch with all the files needed?? because i cant find any tutorials that explain it well and every time i try it crashes minecraft. also I'm using forge 1.4.6-6.5.0.487

I figured it out on my own. I used this tutorial to convert my renderer from ModLoader to Forge.

http://www.minecraftforge.net/wiki/Upgrading_To_Forge_for_1.3.1#Custom_Block_renders

 

The explanation of renderId isn't very good. But I got it to work. Here's what I did. Your render class has...

public class yourBlockRenderClass implements ISimpleBlockRenderingHandler
{
    ...
    @Override
    public int getRenderId();
    {
         return 0;
    }
}

That method "getRenderId" in your render class is useless. It just distracts you. Don't use it for anything. It has to be there, or your code won't "compile", but just return something simple, such as always return zero.

 

Your block class has to return renderId. That's how the game knows which render class to call. ModLoader called it a modelId, so I'll use that name. The method in your block class is "getRenderType", so watch the name change.

@Override
    public int getRenderType()
    {
        return mod_YourMod.yourblockModelId;
    }

 

This renderId has to be static, so store it in your mod class.

package yourPackage;

@Mod(modid = "mod_YourMod", name = "YourMod", version = "someNumber")
@NetworkMod(clientSideRequired=true, serverSideRequired = true)
public class mod_YourMod
{
@SidedProxy(clientSide = "yourPackage.YourModClient", serverSide= "yourPackage.YourModProxy")
    public static YourModProxy proxy;

@Instance("mod_YourMod")
    public static mod_YourMod instance;

    public static int yourblockModelId;
...
}

 

Next is the important part, the thing missing from the tutorial. Assign your renderId, what ModLoader called a modelId. This is done in your proxy client class. And to make it more clear, I've written this to assign modelId for 3 blocks.

package yourPackage;

import cpw.mods.fml.client.registry.RenderingRegistry;
import net.minecraftforge.client.MinecraftForgeClient;

public class YourModClient extends YourModProxy
{
    @Override
    public void registerRenderInformation()
    {
        MinecraftForgeClient.preloadTexture("/yourPackage/terrain.png");
        MinecraftForgeClient.preloadTexture("/yourPackage/items.png");
        mod_YourMod.yourblockModelID = RenderingRegistry.instance().getNextAvailableRenderId();
        mod_YourMod.block2ModelID = RenderingRegistry.instance().getNextAvailableRenderId();
        mod_YourMod.block3ModelID = RenderingRegistry.instance().getNextAvailableRenderId();
        RenderingRegistry.instance().registerBlockHandler(mod_YourMod.yourblockModelID , new YourModRender());
        RenderingRegistry.instance().registerBlockHandler(mod_YourMod.block2ModelID , new YourModRender());
        RenderingRegistry.instance().registerBlockHandler(mod_YourMod.block3ModelID , new YourModRender());
    }
}

 

You will have to write method "renderWorldBlock" in your render class (here called YourModRender) to have a switch statement, call a different method for each renderId (aka modelId).

Posted
  On 1/23/2013 at 3:52 PM, rbdyck said:

  Quote
can some one please make me a block with a custom render from scratch with all the files needed?? because i cant find any tutorials that explain it well and every time i try it crashes minecraft. also I'm using forge 1.4.6-6.5.0.487

I figured it out on my own. I used this tutorial to convert my renderer from ModLoader to Forge.

http://www.minecraftforge.net/wiki/Upgrading_To_Forge_for_1.3.1#Custom_Block_renders

 

The explanation of renderId isn't very good. But I got it to work. Here's what I did. Your render class has...

public class yourBlockRenderClass implements ISimpleBlockRenderingHandler
{
    ...
    @Override
    public int getRenderId();
    {
         return 0;
    }
}

That method "getRenderId" in your render class is useless. It just distracts you. Don't use it for anything. It has to be there, or your code won't "compile", but just return something simple, such as always return zero.

 

Your block class has to return renderId. That's how the game knows which render class to call. ModLoader called it a modelId, so I'll use that name. The method in your block class is "getRenderType", so watch the name change.

@Override
    public int getRenderType()
    {
        return yourModClass.yourblockModelId;
    }

 

This renderId has to be static, so store it in your mod class.

package yourPackage;

@Mod(modid = "mod_YourMod", name = "YourMod", version = "someNumber")
@NetworkMod(clientSideRequired=true, serverSideRequired = true)
public class mod_YourMod
{
@SidedProxy(clientSide = "yourPackage.YourModClient", serverSide= "yourPackage.YourModProxy")
    public static YourModProxy proxy;

@Instance("mod_YourMod")
    public static mod_YourMod instance;

    public static int yourblockModelId;
...
}

 

Next is the important part, the thing missing from the tutorial. Assign your renderId, what ModLoader called a modelId. This is done in your proxy client class. And to make it more clear, I've written this to assign modelId for 3 blocks.

package yourPackage;

import cpw.mods.fml.client.registry.RenderingRegistry;
import net.minecraftforge.client.MinecraftForgeClient;

public class YourModClient extends YourModProxy
{
    @Override
    public void registerRenderInformation()
    {
        MinecraftForgeClient.preloadTexture("/yourPackage/terrain.png");
        MinecraftForgeClient.preloadTexture("/yourPackage/items.png");
        mod_YourMod.yourblockModelID = RenderingRegistry.instance().getNextAvailableRenderId();
        mod_YourMod.block2ModelID = RenderingRegistry.instance().getNextAvailableRenderId();
        mod_YourMod.block3ModelID = RenderingRegistry.instance().getNextAvailableRenderId();
        RenderingRegistry.instance().registerBlockHandler(mod_YourMod.yourblockModelID , new YourModRender());
        RenderingRegistry.instance().registerBlockHandler(mod_YourMod.block2ModelID , new YourModRender());
        RenderingRegistry.instance().registerBlockHandler(mod_YourMod.block3ModelID , new YourModRender());
    }
}

 

You will have to write method "renderWorldBlock" in your render class (here called YourModRender) to have a switch statement, call a different method for each renderId (aka modelId).

 

 

 

i dont get anymore errors but now minecraft runs out of memory :'(.  What do i type in the renderWorldBlock??

Posted

    @SideOnly(CLIENT)
    private void RenderYourblock(Block block, int x, int y, int z, RenderBlocks renderblocks)
    {
        ...
        return true;
    }

    @SideOnly(CLIENT)
    private void RenderBlock2(Block block, int x, int y, int z, RenderBlocks renderblocks)
    {
        ...
        return true;
    }

    @SideOnly(CLIENT)
    private void RenderBlock3(Block block, int x, int y, int z, RenderBlocks renderblocks)
    {
        ...
        return true;
    }

    @Override
    public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer)
    {
    if(modelID == mod_YourMod.yourblockModelID) 
    	{ 
    		return RenderYourblock(block, x, y, z, renderer);
    	}
    	else if(modelID == mod_YourMod.block2ModelID)
    	{
    		return RenderBlock2(block, x, y, z, renderer);
    	}
    	else if(modelID == mod_YourMod.block3ModelID)
    	{
    		return RenderBlock3(block, x, y, z, renderer);
    	}
    	else
    	{
    		return false;
    	}
    }

Here I used if...else if... statements instead of a switch. Why? Eh! Whatever.

Individual render methods do not have @Override, just renderWorldBlock. But those individual render methods have @SideOnly(CLIENT) so they aren't included in server code. Don't want to bog down a server. I think you can add that to renderWorldBlock as well. Your proxy client is only run on the client side anyway, so the render class won't get registered on a server.

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

    • New users at Temu receive a $100 discount on orders over $100 Use the code [aci789589] during checkout to get Temu Coupon Code $100 off For New Users. Yes, Temu offers $100 off coupon code “aci789589” for first-time users. Temu 100% Off coupon code "aci789589" will save you $100 on your order. To get a discount, click on the item to purchase and enter the code. Yes, Temu offers $100 off coupon code “aci789589” for first-time users. You can get a$100 bonus plus 30% off any purchase at Temu with the$100 Coupon Bundle at Temu if you sign up with the referral code [aci789589] and make a first purchase of$50 or more. The Temu $100 Off coupon code (aci789589) will save you $100 on your order. To get a discount, click on the item to purchase and enter the code. Yes Temu offers $100 Off Coupon Code “aci789589” for First Time Users. Yes, Temu offers $100 off coupon code {aci789589} for first-time users. You can get a $100 bonus plus 100% off any purchase at Temu with the $100 Coupon Bundle if you sign up with the referral code [aci789589] and make a first purchase of $100 or more. If you are who wish to join Temu, then you should use this exclusive Temu coupon code $100 off (aci789589) and get $100 off on your purchase with Temu. You can get a $100 discount with Temu coupon code {aci789589}. This exclusive offer is for existing customers and can be used for a $100 reduction on your total purchase. Enter coupon code {aci789589} at checkout to avail of the discount. You can use the code {aci789589} to get a $100 off Temu coupon as a new customer. Apply this Temu coupon code $100 off (aci789589) to get a $100 discount on your shopping with Temu. If you’re a first-time user and looking for a Temu coupon code $100 first time user(aci789589) then using this code will give you a flat $100 Off and a 90% discount on your Temu shopping. Temu $100% Off Coupon Code "aci789589" will save you $100 on your order. To get a discount, click on the item to purchase and enter the code. Temu coupon code$100off-{aci789589} Temu coupon code -{aci789589} Temu coupon code$50 off-{aci789589} Temu Coupon code [aci789589] for existing users can get up to 50% discount on product during checkout. Temu Coupon Codes for Existing Customers-aci789589 Temu values its loyal customers and offers various promo codes, including the Legit Temu Coupon Code (aci789589]) or (aci789589), which existing users can use. This ensures that repeat shoppers can also benefit from significant discounts on their purchases. Keep an eye out for special promotions and offers that are periodically available to enhance your shopping experience.
    • New users at Temu receive a $100 discount on orders over $100 Use the code [aci789589] during checkout to get Temu Coupon Code $100 off For New Users. Yes, Temu offers $100 off coupon code “aci789589” for first-time users. Temu 100% Off coupon code "aci789589" will save you $100 on your order. To get a discount, click on the item to purchase and enter the code. Yes, Temu offers $100 off coupon code “aci789589” for first-time users. You can get a$100 bonus plus 30% off any purchase at Temu with the$100 Coupon Bundle at Temu if you sign up with the referral code [aci789589] and make a first purchase of$50 or more. The Temu $100 Off coupon code (aci789589) will save you $100 on your order. To get a discount, click on the item to purchase and enter the code. Yes Temu offers $100 Off Coupon Code “aci789589” for First Time Users. Yes, Temu offers $100 off coupon code {aci789589} for first-time users. You can get a $100 bonus plus 100% off any purchase at Temu with the $100 Coupon Bundle if you sign up with the referral code [aci789589] and make a first purchase of $100 or more. If you are who wish to join Temu, then you should use this exclusive Temu coupon code $100 off (aci789589) and get $100 off on your purchase with Temu. You can get a $100 discount with Temu coupon code {aci789589}. This exclusive offer is for existing customers and can be used for a $100 reduction on your total purchase. Enter coupon code {aci789589} at checkout to avail of the discount. You can use the code {aci789589} to get a $100 off Temu coupon as a new customer. Apply this Temu coupon code $100 off (aci789589) to get a $100 discount on your shopping with Temu. If you’re a first-time user and looking for a Temu coupon code $100 first time user(aci789589) then using this code will give you a flat $100 Off and a 90% discount on your Temu shopping. Temu $100% Off Coupon Code "aci789589" will save you $100 on your order. To get a discount, click on the item to purchase and enter the code. Temu coupon code$100off-{aci789589} Temu coupon code -{aci789589} Temu coupon code$50 off-{aci789589} Temu Coupon code [aci789589] for existing users can get up to 50% discount on product during checkout. Temu Coupon Codes for Existing Customers-aci789589 Temu values its loyal customers and offers various promo codes, including the Legit Temu Coupon Code (aci789589]) or (aci789589), which existing users can use. This ensures that repeat shoppers can also benefit from significant discounts on their purchases. Keep an eye out for special promotions and offers that are periodically available to enhance your shopping experience.
    • New users at Temu receive a $100 discount on orders over $100 Use the code [aci789589] during checkout to get Temu Coupon Code $100 off For New Users. Yes, Temu offers $100 off coupon code “aci789589” for first-time users. Temu 100% Off coupon code "aci789589" will save you $100 on your order. To get a discount, click on the item to purchase and enter the code. Yes, Temu offers $100 off coupon code “aci789589” for first-time users. You can get a$100 bonus plus 30% off any purchase at Temu with the$100 Coupon Bundle at Temu if you sign up with the referral code [aci789589] and make a first purchase of$50 or more. The Temu $100 Off coupon code (aci789589) will save you $100 on your order. To get a discount, click on the item to purchase and enter the code. Yes Temu offers $100 Off Coupon Code “aci789589” for First Time Users. Yes, Temu offers $100 off coupon code {aci789589} for first-time users. You can get a $100 bonus plus 100% off any purchase at Temu with the $100 Coupon Bundle if you sign up with the referral code [aci789589] and make a first purchase of $100 or more. If you are who wish to join Temu, then you should use this exclusive Temu coupon code $100 off (aci789589) and get $100 off on your purchase with Temu. You can get a $100 discount with Temu coupon code {aci789589}. This exclusive offer is for existing customers and can be used for a $100 reduction on your total purchase. Enter coupon code {aci789589} at checkout to avail of the discount. You can use the code {aci789589} to get a $100 off Temu coupon as a new customer. Apply this Temu coupon code $100 off (aci789589) to get a $100 discount on your shopping with Temu. If you’re a first-time user and looking for a Temu coupon code $100 first time user(aci789589) then using this code will give you a flat $100 Off and a 90% discount on your Temu shopping. Temu $100% Off Coupon Code "aci789589" will save you $100 on your order. To get a discount, click on the item to purchase and enter the code. Temu coupon code$100off-{aci789589} Temu coupon code -{aci789589} Temu coupon code$50 off-{aci789589} Temu Coupon code [aci789589] for existing users can get up to 50% discount on product during checkout. Temu Coupon Codes for Existing Customers-aci789589 Temu values its loyal customers and offers various promo codes, including the Legit Temu Coupon Code (aci789589]) or (aci789589), which existing users can use. This ensures that repeat shoppers can also benefit from significant discounts on their purchases. Keep an eye out for special promotions and offers that are periodically available to enhance your shopping experience.
    • "Looking to save big on your next shopping spree? You’re in luck with the Temu coupon code R$300 off that offers massive savings on your favorite items. Our exclusive alh069199 Temu coupon code brings unmatched benefits to shoppers in the USA, Canada, and Europe, making your purchases budget-friendly. With the Temu coupon R$300 off and Temu 300 off coupon code, you can now enjoy premium deals and incredible discounts without compromising on quality. [h]What Is The Coupon Code For Temu R$300 Off?[/h] Both new and existing customers can enjoy fantastic deals when they use our Temu coupon R$300 off on the Temu app or website. Unlock great savings with the R$300 off Temu coupon and shop guilt-free. alh069199: Enjoy a flat R$300 off your total purchase instantly. alh069199: Access a R$300 coupon pack with multiple use vouchers. alh069199: New users receive a R$300 discount on their first purchase. alh069199: Existing users can get an extra R$300 in promo codes. alh069199: Special R$300 coupon for users in the USA and Canada. Temu Coupon Code R$300 Off For New Users In 2025 New to Temu? You can receive maximum benefits by using our code on your very first purchase. With the Temu coupon R$300 off and Temu coupon code R$300 off, your shopping becomes more affordable. alh069199: Flat R$300 discount for all new Temu users. alh069199: A R$300 coupon bundle with versatile offers. alh069199: Get up to R$300 in coupon value for multiple purchases. alh069199: Enjoy free shipping to over 68 countries worldwide. alh069199: Receive an extra 30% off on your first-time order. How To Redeem The Temu Coupon R$300 Off For New Customers? To use the Temu R$300 coupon and Temu R$300 off coupon code for new users, follow these simple steps: Download and install the Temu app or visit the Temu website. Create a new user account using your email or social login. Go to the ""Coupons"" section in your account settings. Enter the code alh069199 and tap ""Apply."" Shop your favorite items and enjoy a R$300 discount on your total. Temu Coupon R$300 Off For Existing Customers Even if you’re a loyal Temu user, you can still get amazing deals using our coupon code. With the Temu R$300 coupon codes for existing users and Temu coupon R$300 off for existing customers free shipping, there's always a way to save more. alh069199: Claim a R$300 extra discount exclusively for existing users. alh069199: Unlock a R$300 coupon pack for multiple transactions. alh069199: Enjoy a free gift and express shipping in the USA and Canada. alh069199: Get an additional 30% off, even on already discounted items. alh069199: Access free shipping to 68 global destinations. How To Use The Temu Coupon Code R$300 Off For Existing Customers? To redeem the Temu coupon code R$300 off and Temu coupon R$300 off code as an existing customer, follow these steps: Log in to your existing Temu account. Navigate to the ""Coupons"" or ""Promo Codes"" section. Enter alh069199 into the code field and apply. Browse and add items to your cart. Checkout with your discount automatically applied. Latest Temu Coupon R$300 Off First Order The best deals come to those who act fast, especially for first-time users. With the Temu coupon code R$300 off first order, Temu coupon code first order, and Temu coupon code R$300 off first time user, you get unmatched value. alh069199: Flat R$300 discount on your first-ever purchase. alh069199: Unlock a R$300 Temu coupon pack for your first order. alh069199: Get multiple-use coupons adding up to R$300. alh069199: Enjoy free shipping to 68 countries. alh069199: Benefit from an extra 30% off on your first order. How To Find The Temu Coupon Code R$300 Off? Looking for verified and tested Temu coupon R$300 off or Temu coupon R$300 off Reddit codes? Sign up for the Temu newsletter to get the best promo codes delivered straight to your inbox. Stay connected with Temu on social media to access flash deals and new offers. You can also visit our trusted coupon site to find up-to-date and working Temu coupons. Is Temu R$300 Off Coupon Legit? Yes, the Temu R$300 Off Coupon Legit offers are 300% valid and trustworthy. Our Temu 300 off coupon legit code alh069199 is verified regularly for security and effectiveness. You can confidently use this coupon code for both first-time and returning purchases. It works globally and doesn’t have an expiration date, making it your go-to shopping companion. How Does Temu R$300 Off Coupon Work? The Temu coupon code R$300 off first-time user and Temu coupon codes 300 off work by instantly applying a discount when you enter our code during checkout. Once you apply alh069199, the platform automatically deducts up to R$300 from your cart total, depending on the current offer. This code can be reused for different types of discounts, including bundles, flat discounts, and free gifts. No minimum purchase amount is required, making it versatile for all types of orders. How To Earn Temu R$300 Coupons As A New Customer? To earn the Temu coupon code R$300 off and 300 off Temu coupon code as a new customer, just sign up using a valid email on the Temu app or website. Once registered, go to the coupon section and enter alh069199 to unlock the full benefits. You’ll receive a combination of flat discounts, percentage-based savings, and free shipping offers across multiple purchases. What Are The Advantages Of Using The Temu Coupon R$300 Off? Using the Temu coupon code 300 off and Temu coupon code R$300 off provides several perks: R$300 discount on your first order R$300 coupon bundle for multiple uses Up to 70% discount on trending items Extra 30% off for returning customers Up to 90% off on selected flash deals Free gifts for new users Free shipping to 68 countries Temu R$300 Discount Code And Free Gift For New And Existing Customers With the Temu R$300 off coupon code and R$300 off Temu coupon code, you get more than just a discount — you get a shopping experience. alh069199: Save R$300 on your first purchase. alh069199: Enjoy an additional 30% off on all items. alh069199: Receive a complimentary gift as a new user. alh069199: Unlock up to 70% discount on selected products. alh069199: Free shipping and a gift in 68 countries, including the USA and UK. Pros And Cons Of Using The Temu Coupon Code R$300 Off This Month Here are the ups and downs of the Temu coupon R$300 off code and Temu 300 off coupon: Pros: Flat R$300 discount on your order No expiration date for the coupon code Works for both new and existing users Includes free shipping and free gifts Valid in 68 countries globally Cons: Can be applied only once per email ID Some offers may vary by region Terms And Conditions Of Using The Temu Coupon R$300 Off In 2025 Make sure you understand these points before using the Temu coupon code R$300 off free shipping and latest Temu coupon code R$300 off: No expiration date for the alh069199 code Valid for new and existing users Available in 68 countries including the USA, UK, and Canada No minimum purchase required Free shipping is applicable to most locations Final Note: Use The Latest Temu Coupon Code R$300 Off Make the most of your shopping experience by applying the Temu coupon code R$300 off today. Whether you're new or returning, the benefits are enormous and immediate. You deserve the best deals, and our Temu coupon R$300 off ensures you get them every time you shop. Act now and save big! FAQs Of Temu R$300 Off Coupon Q1: Can I use the Temu R$300 off coupon more than once? No, each email/account can only redeem the coupon once. However, the code offers multiple coupons within one pack. Q2: Is the Temu coupon code valid for existing users? Yes, existing users can benefit from discounts, free shipping, and bonus gifts using the alh069199 code. Q3: Do I need a minimum purchase to use the R$300 Temu coupon? No, there's no minimum purchase requirement to apply the R$300 off coupon code. Q4: How can I get the Temu R$300 coupon code for free? Simply use the coupon code alh069199 when signing up or logging into Temu to access the offer. Q5: Is the R$300 off Temu coupon code available worldwide? Yes, the code is valid in 68 countries including the USA, UK, and Canada with no region-based restrictions."
    • yeah its the same crash when ever i load into a world, if TileEntity cant solve this one then i fear ill have to do it the long way of disabling and enable mods :'{ as i feared 
  • Topics

×
×
  • Create New...

Important Information

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