Citizens2 icon indicating copy to clipboard operation
Citizens2 copied to clipboard

Conflict with other plugins registering entities

Open Arnuh opened this issue 10 years ago • 6 comments

While updating EchoPet people have reported conflict with Citizens making pets invisible. I did a fix on my side but now Citizens has a custom RegistryMaterial creating conflict.

With the latest echopet build from the jenkins and the Citizens build 1426(Which is the commit before https://github.com/CitizensDev/Citizens2/commit/765c42cb452451656d17a7ff4c3978205a0c4306) Everything works perfectly and citizens/pets display properly.

But after build 1428 which is after the 'Modify EntityTypes hooks to be less invasive' commit where you override the RegistryMaterials class in minecraft, pets are now invisible.

In a older build you were doing something similar to what I am doing now which is calling EntityTypes.b.a. Which allows for other plugins to also do the same, but when a plugin overrides the class only the one that overrides it last will work properly.

Arnuh avatar Nov 23 '16 21:11 Arnuh

That's... really odd that @fullwall did that at all. Right after he agreed with me that it wouldn't work, too. RIP.

I'll make sure that gets reverted as soon as he's available to talk to.

mcmonkey4eva avatar Nov 23 '16 22:11 mcmonkey4eva

Yeah it took me forever to track down what was causing the EchoPet pets to be invisible. I was working on my test server to see what things needed to be fixed for me to be able to update the servers on my network and spawned in a llama pet as a test. I could hear it but just could not see where it was. So I did what every first step was which was try it by itself. This worked fine which really confused me. Trial and error removing plugins one by one I tracked it to Citizens causing issues. I have been using EchoPet and Citizens together for a while so it was honestly the plugin I expected least to be the culprit. I reported it to the EchoPet repo thinking it needed to be fixed there but turns out to just be a bad commit in build 1427 that causes more issues than fixes for Citizens and other plugins.

drekryan avatar Nov 24 '16 01:11 drekryan

Basically the problem is that if you don't override the RegistryMaterials then when things like EntityVillager attempt to call EntityTypes#getName it will return null instead and crash the server. I thought that not crashing the server would be preferable, but I am open to any better way to do it. I think the best way to do it is to override a() and replace existing entries in the wrapped map.

fullwall avatar Nov 25 '16 10:11 fullwall

Please try the latest build.

fullwall avatar Nov 25 '16 11:11 fullwall

@fullwall seems to work with my limited testing. http://i.imgur.com/mJlJMJ7.png I'll be closing this unless another issue arises.

Arnuh avatar Nov 25 '16 23:11 Arnuh

Tested this as well on the server I was having this issue on. Can also say this appears to be fixed!

drekryan avatar Nov 26 '16 00:11 drekryan