Jump to content

DavidM

Members
  • Posts

    1830
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by DavidM

  1. https://www.geeksforgeeks.org/reflection-in-java/ Since Minecraft code is obfuscated, use ObfuscatedReflectionHelper.
  2. You can still do this with the method I described above. Add an if statement before the rendering to check for this option would work. In Forge, you can create a new ItemGroup and add in the items by overriding ItemGroup#fill. Overriding the registry on a specific side is fine as long as the entries still matches up with the server/client. I.e. the server and client can have completely different blocks under the entry "dirt block", but there will be no problem with the game; it would render as the block on the client, while certain server-side functions are handled by the server-side block under the same entry. Note that overriding registry entries might cause incompatibilities (when 2 mods try to modify the same entry, only one mod will succeed). However it is still better in terms of compatibility than using a core mod as the former still respects the Forge system.
  3. Depends. If all you did is created a rendering method that would integrate well into Forge's event driven system, then yes. In vanilla Minecraft, barriers are rendered as particles, and handled inside ClientWorld. This might sound impossible, however you could replace the barrier block itself by overriding the registry and its entry in the Blocks class. After that, you have control over the full block. Simply use a TESR or subscribe to RenderWorldLastEvent and render the barrier sprite or emit the vanilla barrier particle in the block. If you feel like replacing the block entry may cause incompatibilities, you can also subscribe to RenderWorldLastEvent and render the barrier sprite at the vanilla barrier blocks (or use vanilla particles); however, this method would require you to set up a system to record all the barrier blocks in the world.
  4. Modifying vanilla isn't supported on these forums. In your case, modifying vanilla code isn't even necessary (People always say "my case definitely need a core mod", but it is in fact not needed in 99% of their case. You just have to be creative with the system ). Simply replace the barrier renderer with your own implementation.
  5. AFAIK Forge would never do anything like that.
  6. Try adding a debug line before rendering and print out the health. What does it say?
  7. You need to stitch your texture into the atlas during TextureStitchEvent.Pre.
  8. Yes. It's fine, but stuff like potion effects might be better.
  9. You need to apply the Food you created to your item.
  10. Create an instance of Food.Builder and build your food item with it.
  11. 1. I'm not sure if using GL11 in 1.15.2 is a good practice. Since GlStateManager has been made deprecated, there is probably a replacement for that. 2. Try disabling lighting.
  12. Reflection itself is actually pretty to understand; however, Mojang's obfuscation complicates the matter. I would suggest to look into Java's reflection itself before trying out Forge's API for it.
  13. Optifine do not provide "Minecraft capes". All they do is add a render layer to the donators that can only be seen if others have Optifine installed. It has nothing to do with Mojang's cape. Optifine's adding custom cape is considered a dick move in the community, as Mojang stated that modders should not mess with capes.
  14. Because at this point there is so many things that can go wrong, and it would take ages for other people to guess one by one. By seeing your code we can stop guessing in the dark and instead figure out what is wrong immediately. An analogy that is popular on this forum: just like in real life doctors have to examine your body to figure out what is wrong; they can’t magically know what is wrong if all information they have is “doctor it hurts”.
  15. You can override the entire entity with an implementation of your own.
  16. I’m pretty sure that a log at debug level would log warn level problems.
  17. Please post your code as a GitHub repo.
  18. Mods aren’t supposed to be zip files. What mod are you using?
  19. What version of Minecraft? What version of Forge? What language are you playing in? Please also post your debug.log.
  20. Isn't LivingFallEvent also fired on the server side?
  21. Clear out BetterFPS then (it is a core mod, so try reporting to its author before reporting to Forge).
  22. if (event.side == LogicalSide.SERVER && DaBoisMod.getCapabilityOf(event.player, FallingFromSkyProvider.FALLING_FROM_SKY_CAPABILITY).isFallingFromSky()) { if (!event.player.onGround) event.player.fallDistance = 0F; else DBMPacketHandler.sendToServer(new SSyncFallingFromSkyPacket(false)); } Assuming that the method names are correct, you are already on the server side in this if statement; however, you are still sending a packet to the server. Also I think there is an entity land event or something, and it might be better to use that for your case.
  23. OptiFine would have to add Forge support if they want it to work with Forge. Forge has nothing to do with launcher. It is modifications to the game to provide cross-mod compatibility.
×
×
  • Create New...

Important Information

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