July 29, 20178 yr Author 10 hours ago, diesieben07 said: This has nothing to do with static. One of your constructors registers the data parameter. The other one doesn't. They both need to do it. Surprisingly it worked. I had to register the key with a null value, though. Now I'm getting a crash after shooting the entity, quitting and reloading. I have no idea why since my prints tell me that my uuid value is not null. Edited July 29, 20178 yr by Melonslise
July 29, 20178 yr Author 1 hour ago, diesieben07 said: You managed to get a null Integer into your ID key. I added prints to the read/write nbt methods to check if I was writing/reading a null UUID, however you can see from the log that it's reading/writing an existing value.
July 29, 20178 yr Author Just now, diesieben07 said: The UUID is not the problem. Isn't the log pointing at the read/write nbt method, though?
July 29, 20178 yr Author 14 minutes ago, diesieben07 said: No, it is not. Are you sure? Quote Caused by: java.lang.NullPointerException at net.minecraft.nbt.NBTTagCompound.setUniqueId(NBTTagCompound.java:126) ~[NBTTagCompound.class:?] at melonslise.runicinscription.common.entity.EntityProjectile.writeEntityToNBT(EntityProjectile.java:210) ~[EntityProjectile.class:?] at net.minecraft.entity.Entity.writeToNBT(Entity.java:1798) ~[Entity.class:?] ... 12 more But even if the issue really is caused by a null in the ID key, I can't register the DataManager on the client otherwise. If I try to create a player field, it will be null on the client. Edited July 29, 20178 yr by Melonslise
July 29, 20178 yr Author 15 minutes ago, diesieben07 said: Alright, but as I said, if I create a player field to set the key, it will be null on client and I don't know any way to fix that.
July 29, 20178 yr Author 6 minutes ago, diesieben07 said: You can't do this. You must set a value. I thought the DataManager synced the client and server. Since I'm already setting the key on the server, shouldn't it sync to the client as well?
July 29, 20178 yr Author 6 minutes ago, diesieben07 said: Yes, but it can only do so if the key is registered there. I thought I was already registering the key in both my constructors.
July 29, 20178 yr Author 27 minutes ago, diesieben07 said: Yes, but you said you did it with null on the client. You cannot use null. What do I use then? A random number?
July 29, 20178 yr Author 1 hour ago, diesieben07 said: Yes, you can use -1 for example. It will be overwritten by what the server sends anyways. Still getting an error. Still looks like it has problems with nbt. I added a print and looks like it's writing nbt 2 times. Once it writes the correct value and the second time it writes null. Why so?
July 29, 20178 yr Author 8 minutes ago, diesieben07 said: I do not know. This is almost impossible to diagnose for me, because I do not see your code and I cannot run it. Please post a working Git repo of your mod if possible. Alright, it will take a while, though.
July 29, 20178 yr Author 56 minutes ago, diesieben07 said: I do not know. This is almost impossible to diagnose for me, because I do not see your code and I cannot run it. Please post a working Git repo of your mod if possible. Here's the repo. Check the 'Alpha-1.10' branch. Remember, though, the update is a heavy wip so you might see very unoptimized/retarded code in some places. Edited July 29, 20178 yr by Melonslise
July 29, 20178 yr Author 1 minute ago, diesieben07 said: Sorry, but your repository is not useful, you are missing at least the build.gradle. The repository root should be the root of your project. I haven't compiled the mod so far so I'm currently using the default build.gradle from the latest 1.10 forge.
July 29, 20178 yr Author 3 minutes ago, diesieben07 said: Good for you. Tell me which files you need and I'll upload them for you. Edited July 29, 20178 yr by Melonslise
July 29, 20178 yr Author 8 minutes ago, diesieben07 said: At the very least the repository needs to contain your build.gradle and your code. The repo should work out of the box when being cloned. Ok, I added the build.gradle file.
July 29, 20178 yr Author 9 minutes ago, diesieben07 said: This condition will never be true. NBTTagCompound::setUniqueId creates two entries with suffixes "Most" and "Least", so hasKey cannot be used to check if a unique ID saved like this exists. You have to use NBTTagCompound::hasUniqueId instead. Incredible. Now everything is working. Thanks a lot to you! You deserve a place in the credits list of my mod. Edited July 29, 20178 yr by Melonslise
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.