Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hey, simple question. How do I get an instance 9f the world when I do not have it in my method params(not sure what they're called, but the "public void method(method params){"

  • Author

renderTileEntityAt extending TileEntitySpecialRenderer. And I'm not sure specifically what world. I know that it has IBlockAccess built into it(thats what I need access to). I'd assume the main world, the one you have as World world in your method params.

I think you will find IBlockAccess is the the world

the available methods it has might be enough for what you want

if not you might be able to cast it to World to access more methods

 

if you dont know how to find out what class an object is

System.out.println(obj.getClass().getSimpleName());

 

 

In one of my mods, I needed the same thing in a place called from a method that had a world parameter that it was not kind enough to pass along to me. What I did was trace that method's call chain back to where a static world was being passed in, and I imitated the static reference (I was fortunate that it was public). Amazingly it worked  :)

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

I happen to be in that mod today, so I can show you what I used:

 

   

WorldClient wc = FMLClientHandler.instance ().getWorldClient ();

 

It traces back to Minecraft.theWorld. This is in a @SideOnly(Side.CLIENT) class, so YMMV.

 

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

FYI last time I checked:

 

Server side you can access the worlds from

MinecraftServer.getServer().worldServerForDimension or DimensionManager.getWorld()

 

Client side you can access the world from

Minecraft.theworld

 

See here for an overview of what it looked like in 1.6.4; probably it is still almost the same...

 

http://greyminecraftcoder.blogspot.com.au/2013/10/client-side-class-linkage-map.html

http://greyminecraftcoder.blogspot.com.au/2013/10/server-side-class-linkage-map.html

 

-TGG

 

See here for an overview of what it looked like in 1.6.4; probably it is still almost the same...

 

http://greyminecraftcoder.blogspot.com.au/2013/10/client-side-class-linkage-map.html

http://greyminecraftcoder.blogspot.com.au/2013/10/server-side-class-linkage-map.html

 

-TGG

 

Wow!  You've got some time on your hands.  Good stuff though!  I'm going to study these when I'm not so tired.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.