Posted August 22, 201411 yr 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){"
August 22, 201411 yr 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.
August 22, 201411 yr 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());
August 22, 201411 yr 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.
August 23, 201411 yr 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.
August 24, 201411 yr 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
August 25, 201411 yr 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.