
Virtual passengers are removed from the backing list by value instead of index
haykam821 opened this issue ยท 1 comments
According to the fastutil
documentation, the IntArrayList#removeInt
method uses indices instead of arrays:
public int removeInt(int index)
Removes the element at the specified position in this list (optional operation).
However, in both VirtualEntityUtils.removeVirtualPassenger
methods, Polymer passes values, rather than the index of each value, to the removal method:
As a result, when attempting to remove a virtual passenger, an exception such as the following is thrown:
java.lang.IndexOutOfBoundsException: Index (1578) is greater than or equal to list size (24)
at it.unimi.dsi.fastutil.ints.IntArrayList.removeInt(IntArrayList.java:359)
at eu.pb4.polymer.virtualentity.api.VirtualEntityUtils.removeVirtualPassenger(VirtualEntityUtils.java:47)
Fixed in 68a20c7