Jump to content

Novârch

Members
  • Posts

    422
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Novârch

  1. LazyOptional.ifPresent(props -> {}) is what you want, props will be an instance of your capability. Here's an example of how I use it.
  2. Would it be a good idea to make a List of UUIDs and store it in the players capability?
  3. 1.7.10 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
  4. Nope, gives me a java.lang.IllegalStateException: Removing entity while ticking!, already detailed in this thread. *Edit: I'm trying to teleport a PLAYER, not a normal entity, changeDimension works fine on ENTITES, but not PLAYERS.
  5. I personally got an Acer Aspire 7 refurbished for 550$, they're rare to come by, but they come with a GTX 1050.
  6. I...have no idea, that code is horrible, I wrote the mod's core functionality 3 months ago on 1.12 and haven't changed it since, I should really fix some of that horrible code, thanks for pointing that out. I added a !World#isRemote to the packet before teleporting, but the server host still can't teleport other players, but they can teleport him.
  7. I'm trying to transport players to a modded dimension if they are near another player using an ability. I'm using Entity#getDistance for the distance calculation and World#getPlayers to get the players. I'm then sending a client to server packet to transport the players, I have no idea why, but it only works if I do it in a client to server packet. The code where the distance is being calculated and the method is being called can be found here on GitHub, and the packet code can be found here.
  8. 1.7.10 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
  9. No one can fix your problem without context, and with that attitude, no one wants to.
  10. Congratulations, you shortened my code by TWO CHARACTERS.
  11. Here's an example of how I did it in my mod.
  12. Are you using deobfuscated names for reflection, because that's very wrong. If you are replace them with the names from MCP. (Incase you don't know what deobfuscated and obfuscated means,getTrueSource -> func_76346_g)
  13. Try usingDeferedRegister, it'll most likely fix all your problems.
  14. Why don't you just use forge setdimension ingame?
  15. Thanks for all the help, I fixed it by making a player object in my provider and passing that into the LazyOptional.
  16. I'm using LazyOptional again but now I'm not passing in Minecraft#player as the player, but now I'm passing in null so: I've now added a check for the logical side before applying the capability. I've added @Nonull on the player argument in the capability's constructor. It seems my only problem is that I'm passing in null as the player in a few places causing , but I don't think I can pass in a non-null argument in these places without using Minecraft#player, how am I supposed the get a player besides Minecraft#player in my main class or my provider?
  17. Agreed, removed the first one. I've changed out the LazyOptional for something else, how is my capability being created on the server? I've created a second version of the setters that doesn't send the packet. Agreed, but first I'd like to fix what I already have.
  18. 1.7.10 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
  19. As detailed in this thread I made a few days ago I've had some problems syncing capability data to the client, I marked that thread as solved thinking I fixed the issue, but upon testing my mod in multiplayer I realized that I did nothing. To put it simply, I stored an instance of the capability in my main class and used that, which is wrong in many ways. I've restructured the capability in a way in which it should send an update packet to the client every time it's data is updated, but nothing is happening. The update packet can be found here on GitHub, the capability class that's sending the packet here, and the code I'm trying to run here(method on line 39). There aren't any errors in the debug.log, but it can be found here.
  20. That's bad, try something like this: *Edit: Yes, change the TM
  21. No one cares. If it's short, send it in as a spoiler here, if it's long(> 100 lines), send it as a GitHub gist. Send this:
  22. It's hard to tell what your error is from the code, but I'd say you should look into how you're registering the dimension, it seems really weird. For instance this is how my DimensioInit class looks: Look around for some examples of other people creating dimensions, or at the vanilla dimensions' code. On a separate note, if you're planning to release the mod on CurseForge or another site, put a bit more work into texturing, being a bad artist isn't a good excuse for a terrible looking mod.
  23. Something in this, I'd have to see the code to know what: Anyway, that's your error.
  24. Vanilla code is the most useful resource you can find, other than that I encourage you look at other people's code. Some nice examples are Choonster's Test Mod 3, TGG's Minecraft by example, Cadiboo's Example Mod and Vazkii's Botania.
×
×
  • Create New...

Important Information

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