Improved Mobs (Forge)

Improved Mobs (Forge)

8M Downloads

Armor Blacklist can freeze server

briansemrau opened this issue ยท 0 comments

commented

Bug Description:
Having a large number of armor pieces blacklisted in the config can cause the internal server to halt.

How to reproduce:
Adding all armor items to the blacklist causes a freeze almost immediately after loading the world. This bug was originally produced by only blacklisting other mods' armor, meaning the server could still freeze with available armor items.

Affected Versions:

  • ImprovedMobs: 1.2.1
  • Minecraft: 1.12.2
  • Forge: 14.23.4.2713

Suggested fix
It appears the issue exists here. Presumably the server is halted when the if-condition inside the while-loop is never true, which is the case when all equipment is blacklisted.

The issue could be solved by modifying ConfigHandler.getEquipment. I suggest adding the line list.removeAll(Arrays.asList(armorBlacklist)); before line 271. You would have to add a check if the list size is zero, in which (I think) you would leave armor as null. I don't know if you can create an ItemStack with a null parameter.

I don't know if this issue is present in the handling of other blacklists.