Jump to content

Recommended Posts

Posted

Hello, everyone. I'm relatively new to the Forge modding scene, at least as far as being a developer. I've been programming in Java for almost four years now, and this is my first mod. It's relatively simplistic, but I'm having a problem with one of the items I'm trying to add, and I can't seem to figure out why. The item in question, when held, is supposed to function similarly to the Hyperenergetic Nitor from Vazkii's Thaumic Tinkerer KAMI, in that it illuminates the area around the player as they move. To make a long story short, the best way I found to do this after some testing was to place a variant of air above the player that emits light. I accomplished this by checking the player's position, and if they have moved far enough away from the last light block, deleting the previous light block (if there was one) and placing a new one at their current location. This is achieved using the world.setBlock method. Obviously, it's a bit more complicated than described here, but these are the essentials. However, when I tested this system, it didn't work. After a few minutes of digging through debug reports, I tracked the problem down to a method inside the world chunk manager class that checks to see if the block being placed is valid to exist at the specified coordinates (as far as I can tell - the method is not deobfuscated, so there's only so much I can do). It's not throwing an exception, it just returns false and exits, meaning that the block does not get placed. I tried several methods of fixing this - first, I tried placing a regular stone block instead of my custom one. Second, I tried placing the block at a set of coordinates that was NOT inside the player's bounding box, in case it was a collision problem. Third, I tried placing the block elsewhere and moving it to its intended position with its current metadata. None of these methods worked, and thus I am stumped. If anyone wants to offer some insight into what I'm doing wrong (or maybe this is simply not possible), that would be much appreciated. If you need my environment info, I am running Forge version 10.13.4.1558 for MC 1.7.10 on Windows 10 x64 with JDK version 8u131 x64 with IntelliJ IDEA Community Edition 2017.1.1 build 171-4073 x64 as my IDE. Thank you for your time!

  • Guest locked this topic
Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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