Jump to content

Recommended Posts

Posted

I am trying to put many,many (potentially greater than 16) tile entities into one single block. Currently I have the following problems:

 

1. How do I attach a tile entity to the block based on the damage of the corresponding ItemBlock? The onItemUse method of ItemBlock does not mention about TileEntity, and the corresponding handling is done in the World class. The createTileEntity method does not provide any information about the placer either.

 

2. How do I change the texture/model based on the TileEntity? I am thinking about using getActualState(IBlockState, IBlockAccess, BlockPos) or TileEntitySpecialRender.

 

Thanks in advance.

Posted

My suggestion: don't. Unless your blocks are all closely related, it is my opinion that your code is much better off with individual block classes and instances.

 

But, if you really want to, there is a Block method (NOT the one in BlockContainer, but the one added by Forge) that returns a TileEntity and has the IBlockState / metadata as an argument, so you CAN return different TileEntity types based on that criteria. However, I believe you would be limited to the 16 values of IBlockState, as you wouldn't be able to use the 'actual' state at this point given that the TileEntity does not yet exist.

 

As for rendering, #getActualState is perfectly fine, and you probably won't even need a TESR to do it - ISmartBlockModel (or whatever replaced it in 1.9) provides everything you need to render based on the extended block state.

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

    • si on casse des blocs de champignons ça fait crasher le jeux
    • bonjour ou bonsoir c'est pour vous signaler un petit probléme on ne peut pas casser des blocs de champignons sur la nouvelle version  forge 1.21.5-55.0.9 . voila bonne journée
    • I have no idea what's causing it to crash when I go to create a world. https://paste.ee/p/Bc7VL85G
    • A few months ago, I was approached online by a so-called investment broker. Everything looked professional — flashy websites, fake but convincing reviews, even video calls with people who seemed legitimate. They promised unbelievable returns on Bitcoin investments, and I, eager to grow my crypto holdings, fell for it. Over a few weeks, I transferred Bitcoin worth around $360,000 to what I thought was a secured investment wallet. The “broker” kept assuring me my money was growing, even showing fake dashboards with fabricated profits. But when I tried to withdraw my funds, they demanded additional fees — taxes, account, activation, and release charges. That’s when the truth hit me I had been scammed. Devastated, I started searching for solutions. But then, a glimmer of hope. A cybersecurity contact muttered Try Dexdert Net Recovery. They hunt crypto ghosts. Dexdert Net had real testimonials, detailed explanations of their process, and most importantly, they didn’t ask for any suspicious upfront fees. After contacting them, their team patiently walked me through the steps gathering all evidence of the scam, tracking the Bitcoin transactions on the blockchain, and using legal recovery channels and cyber forensic methods. They kept me updated at every stage. 4 days later, I got the email I’ll never forget: Funds Recovered. Dexdert Net Recovery successfully trace and retrieve the entire $360,000 worth of Bitcoin from the scammer’s wallets. Thanks to Dexdert Net Pro Recovery, not only did I reclaim my lost Bitcoin, but I also regained a sense of justice — and a serious lesson learned. If you’re ever in a situation like I was, know this: there’s hope, and there are real experts out there who can help. Dexdert Net Recovery proved it to me. CONTACT DEXDERT NET RECOVERY VIA INFORMATION BELOW   Telegram: (@Dexdertprorecovery)      
    • So I just try to remove mods and see what works?
  • Topics

×
×
  • Create New...

Important Information

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