-
Posts
892 -
Joined
-
Last visited
-
Days Won
1
Awesome_Spider last won the day on April 1 2018
Awesome_Spider had the most liked content!
Converted
-
Gender
Male
-
Location
Alberta, Canada
-
Personal Text
Know Java, learning C#
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
Awesome_Spider's Achievements
Dragon Slayer (6/8)
64
Reputation
-
[1.11] NullPointer on trying to get a list of dimensions.
Awesome_Spider replied to Awesome_Spider's topic in Modder Support
I'm still not having any luck. Any other ideas? There is a null pointer on the same method as last time. -
[1.11] NullPointer on trying to get a list of dimensions.
Awesome_Spider replied to Awesome_Spider's topic in Modder Support
Ok, thanks. -
[1.11] NullPointer on trying to get a list of dimensions.
Awesome_Spider replied to Awesome_Spider's topic in Modder Support
I found DimensionManager::getIds, is that right? -
[1.11] NullPointer on trying to get a list of dimensions.
Awesome_Spider replied to Awesome_Spider's topic in Modder Support
How am I supposed to do it? -
I am trying to make my mod create configurations for every dimension that is registered. However, I'm getting a null pointer exception and have tried many times in vain to fix it. Here is the code: public static void loadAll() { //Dimensions Integer[] ids = DimensionManager.getStaticDimensionIDs(); for (int id : ids) { WorldProvider dimension = DimensionManager.getProvider(id); //NullPointer String modId = ModIdentification.idFromObject(dimension); File file = new File(EnviroMineRevived.configDir, modId.toLowerCase() + "\\dimension.json"); DimensionProperties.base.load(file); } ... } I then call this method in my post-init method. It however throws a null pointer which leads me to believe that none of the dimensions are registered by then. Where should I be calling this? If you need more code just ask. Following is the error:
-
[1.11] Get a list of all tile entities registered
Awesome_Spider replied to Awesome_Spider's topic in Modder Support
Thanks for the suggestion. -
[1.11] Get a list of all tile entities registered
Awesome_Spider replied to Awesome_Spider's topic in Modder Support
Maybe I could look though all the tile entity instances in the world and see if they have the capability? I'm not sure. -
[1.11] Get a list of all tile entities registered
Awesome_Spider replied to Awesome_Spider's topic in Modder Support
I am creating a temperature system where some blocks give off heat. I have an api that contains a capability that mod developers can attach to their tile entities. This allows the tile entities to dynamically change their temperature. The amount of heat that reaches the player depends on how far the player is away from the tile entity. Yesterday, I asked how I should get blocks within a cube around the player, and now I need to know how far I should look for tile entities. To do this, I put a maximum temperature value in the capability that is set in the constructor of the capability. Now I need to get the tile entity with the highest maximum value, if that makes any sense. Long story short, getting all the tile entity classes was a stupid idea. I'm not sure how to go about this at this point. Sorry about the long post. -
[1.11] Get a list of all tile entities registered
Awesome_Spider replied to Awesome_Spider's topic in Modder Support
To address your first answer, if I'm not supposed to use the GameData method, is there an event I could subscribe to that is called when a tile entity is registered? I don't see one, but I'll look some more into it. For answer 2, I have an api that can be used by other mods that containes a capability that can be attached to a tile entity. I would like to get all the tile entities to check if their classes have the capability. However, on second thought, I will have to rethink that. The method I would use to check (hasCapability) isn't static. Meaning it is a per instance deal. -
I have two questions that I am stuck on. Question one: How do I get a list of all the tile entities that have been registered? Question two: Would I do this in post init to ensure all of the tiles have been registered, or would I use a different event? Any help on this is appreciated. Edit: I found GameData::getTileEntityRegistry, but it's deprecated.
-
[1.11] Get blocks in a certain radius
Awesome_Spider replied to Awesome_Spider's topic in Modder Support
Well, I guess I should have been more clear. A cube around the player will work. Thanks for your help. I think BlockPos::getAllInBox is exactly what I want. -
I am thinking about modding again after a few weeks or so of being swamped with school. What I want to do is get all the blocks within a radius around the player to test each block for different properties. Is there an easy way of doing this?
-
[1.11] Get the modid that registered a dimension
Awesome_Spider replied to Awesome_Spider's topic in Modder Support
Ok, thank you. -
[1.11] Get the modid that registered a dimension
Awesome_Spider replied to Awesome_Spider's topic in Modder Support
Another question, what was WorldProvider::getDimensionName replaced with? -
[1.11] Get the modid that registered a dimension
Awesome_Spider replied to Awesome_Spider's topic in Modder Support
Ok, I use that then. Thanks.