Game crash (endless recursion) when clicking a NormalMarker on 1.21
kilroythethird opened this issue ยท 1 comments
The NormalMarker::searchMarker function runs into an endless loop because it checks if it already added a marker with List.contains.
I guess because BlockPos doesn't implement equals (anymore ?) this doesn't work and it endlessly recurses.
I "fixed" it by simple switching to this ugly piece of code:
private static boolean _has(List<BlockPos> list, BlockPos pos){
for(BlockPos p : list){
if(p.getX() == pos.getX() && p.getY() == pos.getY() && p.getZ() == pos.getZ()){
return true;
}
}
return false;
}
....
if (!_has(blockPosList, blockPosX1)) { ....
(Last time i wrote java is about 10 years plus i have no clue about mc modding, so sry if i messed something up)