Jump to content

DavidM

Members
  • Posts

    1830
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by DavidM

  1. If someone benchmarks a clean Forge install and a Fabric install, then the performance might be a tiny bit (not even noticeable) better on Fabric's side due to its lightweight. However such result is not conclusive, as Forge does a lot more (event system, utils, etc) than Fabric. Try benchmarking both API with 100+ mods and Forge API will manifest its advantage. Judging APIs solely for its performance is like comparing Tetris to a first person shooter game. "Hey Tetris uses up less RAM and CPU so it is much better than the FPS game!" But yeah, people might prefer Fabric if all they want is to add a simple tweak/mod to the game. At the end of the day, it is really up to the user and his/her use case.
  2. The packet handler method can be static, as it does not depend on a handler instance (unlike 1.12.2 and before).
  3. I think OP wants to make a mod that makes the port static (that is the function from the end-user perspective). It might be useful in that the LAN host does not need to tell other players the port number every time the LAN game starts (i.e. on a large campus, students might not be in the same room and thus have difficulties contacting each other). @yazigegeda Changing that is not going to be a simple task. Your options are either 1) replace the button and replace the IntegratedServer with a custom implementation or 2) use a coremod, which is not supported on these forums.
  4. Using the right click event is way easier and less destructive than your current approach. Replacing vanilla items should only be done if there are no other ways. There is a block pos as well as a direction in the event IIRC, so no ray tracing is required.
  5. I haven't used Fabric before, but from what I've heard: Forge uses an event driven system. Fabric (IIRC) treats all mods as coremods (mixins). This makes Fabric significantly more lightweight than Forge, and therefore quicker to develop and update. I wouldn't be surprised if a Forge update's workload is more than 10 times the workload of a Fabric update. However, since Fabric mods use mixins, it is very easy to cause incompatibilities between mods (think of Forge coremods), while Forge's event system can theoretically supports infinite amount of mods. Apart from that, Forge has a much bigger user base than Fabric, therefore the Forge team has to respond to more PRs and issues. I imagine this to be very time consuming.
  6. Static in Java is almost exactly like in C++, except for two points (that I can think of): 1. It does not denote the localness of a header member. 2. It cannot be used on a local variable to associate it with the static storage area (as opposed to stack).
  7. It does not. It might appear to be working for you as you either tested it in single player, did an inconclusive test, or got lucky, but making it static is fundamentally broken as it goes against the packet system. In your case, as soon as another packet is constructed in the same JVM before a previous packet is sent, the whole thing breaks. You should not make something "static" just because "I have no idea what the error means; let me just randomly change something and hope it will work"; instead, static should only be used if you want to make something class-specific (probably not the proper definition). That is only the case if you are playing on a client distribution, where the two sides exist in the same virtual machine. You should never rely on this, as it will break immediately once the mod is installed on the server distribution. Please elaborate. What doesn't work? What is the error it is giving you? There is no concept of "static class" (unless you meant a static subclass, which doesn't seem to be the case here).
  8. I would suggest to not post copy-passable code without explaining them, as others might copy it and not understand what it does The consumer is invoked if the item breaks due to that damageItem (aka. if the durability is 0). In the example DevTech provided above, the server will tell the client to play the item breaking animation if the item breaks.
  9. You are registering your packets in the wrong place. Where are you registering your packets (when non-static)? That is not going to work. Packets are not singletons. A packet is constructed per sending/receiving, and therefore the block pos needs to be an attribute (property?) of the packet object.
  10. RenderGameOverlayEvent (I miss spelt it, my apologies).
  11. 1.12.2 is no longer supported on these forums due to its age. Please update to a modern version of Minecraft (1.14 and above) to receive support.
  12. Honestly I would say having so many units would be confusing to new players (and some old players). I don't see how remembering ounces, nuggets, voxels and the conversions between them is easier than "144mb an ingot, 1000mb a bucket". Without a unified measurement (mB), some modders may start to favor certain units over the others, or invent their own units based on atoms, causing more confusion in the system.
  13. DavidM

    random item giver

    No, but you can make a custom mod that does that if you want.
  14. Note that you should not use MCreator if you want to release your mod to the public. If you want to make a proper mod, please learn Java and do it normally.
  15. You do not need TESR if the conditions are trivial (i.e. redstone power, light, etc). Check out block state properties and model variants. You might also want to look at vanilla redstone lamp or fence for examples.
  16. You should try logging whether the value is null. Currently, if the master is null, your write method wouldn’t do anything. I am suspecting that the master was never assigned (by accident).
  17. You can use a TESR if you want, but a block model should do the same. Parts like spider eyes don’t “glow”; they are just drawn without considering the lighting.
  18. From a quick glance, I would suggest checking if the master is null.
  19. Minecraft modding is programming in Java. If you don’t want to learn modding/programming but still want to add stuff into the game, there are mods like Content Tweaker that do that.
  20. Subscribe to RenderOverlayEvent and render your text there with FontRenderer#drawString. Make sure to check the component/type that is being rendered in the event.
  21. That code doesn’t have anything to do with disabling the animation though. Subscribe to the appropriate right click event and cancel the event.
  22. Try removing all the mods. Does the stuttering still occur?
×
×
  • Create New...

Important Information

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