Xcox123 Posted August 22, 2014 Share Posted August 22, 2014 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){" Quote Link to comment Share on other sites More sharing options...
Xcox123 Posted August 22, 2014 Author Share Posted August 22, 2014 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. Quote Link to comment Share on other sites More sharing options...
Xcox123 Posted August 22, 2014 Author Share Posted August 22, 2014 Thanks! And thanks for clearing up the multiple world things Quote Link to comment Share on other sites More sharing options...
Ewe Loon Posted August 22, 2014 Share Posted August 22, 2014 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()); Quote Link to comment Share on other sites More sharing options...
Xcox123 Posted August 22, 2014 Author Share Posted August 22, 2014 Yeah thats why I wanted the world... Quote Link to comment Share on other sites More sharing options...
jeffryfisher Posted August 22, 2014 Share Posted August 22, 2014 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 Quote 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. Link to comment Share on other sites More sharing options...
jeffryfisher Posted August 23, 2014 Share Posted August 23, 2014 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. Quote 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. Link to comment Share on other sites More sharing options...
TheGreyGhost Posted August 24, 2014 Share Posted August 24, 2014 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 Quote Link to comment Share on other sites More sharing options...
jabelar Posted August 25, 2014 Share Posted August 25, 2014 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. Quote Check out my tutorials here: http://jabelarminecraft.blogspot.com/ Link to comment Share on other sites More sharing options...
Recommended Posts
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.