Open draykhar opened 11 years ago
Rebalance Villagers is crashing when the zombie converts:
2013-10-01 08:55:15 [SEVERE] Could not pass event CreatureSpawnEvent to Rebalance Villagers v1.6.2 org.bukkit.event.EventException at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:427) at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) at org.bukkit.plugin.TimedRegisteredListener.callEvent(TimedRegisteredListener.java:47) at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:478) at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:463) at org.bukkit.craftbukkit.v1_6_R2.event.CraftEventFactory.callCreatureSpawnEvent(CraftEventFactory.java:256) at net.minecraft.server.v1_6_R2.World.addEntity(World.java:974) at net.minecraft.server.v1_6_R2.World.addEntity(World.java:945) at net.minecraft.server.v1_6_R2.EntityZombie.bW(EntityZombie.java:398) at net.minecraft.server.v1_6R2.EntityZombie.l(EntityZombie.java:181) at net.minecraft.server.v1_6_R2.World.entityJoinedWorld(World.java:1492) at net.minecraft.server.v1_6_R2.World.playerJoinedWorld(World.java:1467) at net.minecraft.server.v1_6_R2.World.tickEntities(World.java:1336) at net.minecraft.server.v1_6_R2.WorldServer.tickEntities(WorldServer.java:517) at net.minecraft.server.v1_6_R2.MinecraftServer.t(MinecraftServer.java:571) at net.minecraft.server.v1_6_R2.DedicatedServer.t(DedicatedServer.java:239) at net.minecraft.server.v1_6_R2.MinecraftServer.s(MinecraftServer.java:481) at net.minecraft.server.v1_6_R2.MinecraftServer.run(MinecraftServer.java:413) at net.minecraft.server.v1_6_R2.ThreadServerApplication.run(SourceFile:582) Caused by: java.util.ConcurrentModificationException at net.minecraft.server.v1_6_R2.World$1.guard(World.java:47) at net.minecraft.server.v1_6_R2.World$1.remove(World.java:41) at net.minecraft.server.v1_6_R2.World.removeEntity(World.java:1070) at com.hotmail.wolfiemario.rebalancevillagers.RebalanceVillagers.convertVillager(RebalanceVillagers.java:235) at com.hotmail.wolfiemario.rebalancevillagers.RebalanceVillagers.onCreatureSpawn(RebalanceVillagers.java:178) at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:425) ... 18 more
Still investigating.
Probably a Spigot incompatibilty. It can probably be fixed by starting a delayed task to call removeEntity() on the old villager to be replaced in this code (extract of Rebalance Villagers source).
Will try that out subject to available time.
/**
* Converts the given villager into a BalancedVillager, leaving an identical
* villager. Because the previous villager is removed, the new villager will
* have a different unique ID.
*/
public void convertVillager(EntityVillager vil,
net.minecraft.server.v1_6_R2.World mcWorld) {
Location location = vil.getBukkitEntity().getLocation();
BalancedVillager balancedVil = new BalancedVillager(vil, true);
balancedVil.setPosition(location.getX(), location.getY(),
location.getZ());
mcWorld.removeEntity(vil);
mcWorld.addEntity(balancedVil, SpawnReason.CUSTOM);
}
Apparently other people are having similar problems (see the comments on the plugin page http://dev.bukkit.org/bukkit-plugins/rebalance-villagers/) and we are in for even more pain with 1.6.4.
Investigated a modreq regarding zombie villagers not being able to be revived into villagers. After repeating the process, it doesn't work for me either. They make all the noises, shake, and then nothing.