Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/28/18 in all areas

  1. Forge 1.12.2-14.23.5.2779 deprecated ReflectionHelper and changed the methods in ObfuscationReflectionHelper to only require an SRG name rather than both an SRG and MCP name. This is what @quadraxis was talking about.
    1 point
  2. https://mcforge.readthedocs.io/en/latest/concepts/registries/ and the JavaDoc comments
    1 point
  3. I don't think you need to feel guilty about the performance impact. With a modern computer, the GPU is capable of probably billions of such calculations. I assume that your item will be reasonably rare (a lot of the time probably not even rendering the item at all), and remember that only the items being rendered (i.e. in field of view) would even have an impact. So at most you're probably going to have a couple itemstacks in an inventory (and when viewing inventory frame rate isn't really as much of an issue even if performance dips), or maybe a couple items thrown on the ground. With modern programming (assuming you're using a full computer and not some resource-strapped embedded processor) it is best to use the proper logic and only deal with perf issues when they actually are an issue. I.e. profile the code and see if there is an actual problem. Of course you should not do stupid things like big loops, recursion, and such unless necessary. But otherwise you should just code for clean, well-structured code that uses the intended interfaces. Bug-free, maintainable code is the first priority.
    1 point
  4. Well, you could store the player's position somewhere within the dragon/AI in addition to the angle variable. When the AI to circle around kicks in calculate the current angle between these vectors [dragonPos - playerPos], [unitZ](<- I am not sure which direction the game consideres forward, I think it's unitZ though). You can calculate an angle between two vectors using arccos((vec1 DOT vec2) / (vec1.length * vec2.length)) if I am not mistaken. Then you can start circling, You know the angle the dragon started at so now you can just add to it each tick. The amount you add should be manually tweaked based on your dragon's speed. Now you have a new angle, which is your previous angle + X. You can then use this angle to calculate the position the dragon needs to be at: [x = playerX + r * cos(a), y = playerY + NUM, z = playerZ + r * sin(a) Where r is the distance from the dragon to the player you want to acheive(radius of your circle) and NUM is the height of the dragon relative to the player. Then just tell the dragon to move there.
    0 points
×
×
  • Create New...

Important Information

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