You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After many hours of debugging i managed to trace a java.lang.IllegalStateException: TickNextTick list out of synch server crash back to this mod's MutableBlockPos and (probably) dynamic trees (and possibly random patches?).
This Exception is thrown when pendingTickListEntriesTreeSet and pendingTickListEntriesHashSet differ. This seems to be caused by NextTickListEntrys not being removed from the HashSet if their .position is an instance of MutableBlockPos. I don't know why this happens, it might be related to an issue with equals and compareTo as described here.
Vanilla also has a MutableBlockPos class, with one difference: Vanilla's BlockPos provides a method toImmutable(), which for the normal BlockPos is implemented as a simple return this;. In the vanilla MutableBlockPos though this method is overriden with return new BlockPos(this);. Because NextTickListEntry.<init> calls toImmutable, all positions should be normal BlockPos, but because thut.api.maths.Vector3$MutableBlockPos doesn't override toImmutable, it uses the identity inherited from BlockPos instead.
I managed to fix this for me by adding a check in pendingTickListEntriesHashSet#add and, if the position is not an instance of BlockPos, replacing it using reflection.
Since i am on 1.12.2 and this repo only has the source for more recent versions i can't build a fix, but as vanilla minecraft now provides a MutableBlockPos it should be relatively simple to remove ThutCore's MutableBlockPos (or at least override toImmutable).
The text was updated successfully, but these errors were encountered:
this is fixed for the next 1.15.2 update, that was some really old stuff that I forgot to update, from before vanilla had an easily accessible immutable block pos...
After many hours of debugging i managed to trace a
java.lang.IllegalStateException: TickNextTick list out of synch
server crash back to this mod's MutableBlockPos and (probably) dynamic trees (and possibly random patches?).This Exception is thrown when
pendingTickListEntriesTreeSet
andpendingTickListEntriesHashSet
differ. This seems to be caused byNextTickListEntry
s not being removed from the HashSet if their.position
is an instance ofMutableBlockPos
. I don't know why this happens, it might be related to an issue withequals
andcompareTo
as described here.Vanilla also has a
MutableBlockPos
class, with one difference: Vanilla'sBlockPos
provides a methodtoImmutable()
, which for the normalBlockPos
is implemented as a simplereturn this;
. In the vanillaMutableBlockPos
though this method is overriden withreturn new BlockPos(this);
. BecauseNextTickListEntry.<init>
callstoImmutable
, all positions should be normalBlockPos
, but becausethut.api.maths.Vector3$MutableBlockPos
doesn't overridetoImmutable
, it uses the identity inherited fromBlockPos
instead.I managed to fix this for me by adding a check in
pendingTickListEntriesHashSet#add
and, if the position is not an instance ofBlockPos
, replacing it using reflection.Since i am on 1.12.2 and this repo only has the source for more recent versions i can't build a fix, but as vanilla minecraft now provides a
MutableBlockPos
it should be relatively simple to remove ThutCore'sMutableBlockPos
(or at least overridetoImmutable
).The text was updated successfully, but these errors were encountered: