Jump to content

[SOLVED] [1.10] Client spawns two entities


Melonslise

Recommended Posts

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 by Melonslise
Link to comment
Share on other sites

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 by Melonslise
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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 by Melonslise
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by Melonslise
Link to comment
Share on other sites

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.