PTOM76 / EnhancedQuarries

開発中です。
Mozilla Public License 2.0
1 stars 3 forks source link

Game crash (endless recursion) when clicking a NormalMarker on 1.21 #34

Open kilroythethird opened 3 days ago

kilroythethird commented 3 days ago

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)