Jump to content

Recommended Posts

Posted (edited)
  On 7/28/2017 at 9:12 PM, 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.

Expand  

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 by Melonslise
Posted (edited)
  On 7/29/2017 at 2:59 PM, diesieben07 said:

No, it is not.

Expand  

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

 

Expand  

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 by Melonslise
Posted
  On 7/29/2017 at 4:32 PM, diesieben07 said:

Yes, you can use -1 for example. It will be overwritten by what the server sends anyways.

Expand  

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?

Posted (edited)
  On 7/29/2017 at 6:17 PM, 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.

Expand  

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 by Melonslise
Posted
  On 7/29/2017 at 7:52 PM, 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.

Expand  

I haven't compiled the mod so far so I'm currently using the default build.gradle from the latest 1.10 forge.

Posted (edited)
  On 7/29/2017 at 8:19 PM, 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.

Expand  

Incredible. Now everything is working.

Thanks a lot to you! You deserve a place in the credits list of my mod.

Edited 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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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