Advanced-Rocketry / AdvancedRocketry

Space mod for minecraft
http://arwiki.dmodoomsirius.me/
MIT License
215 stars 273 forks source link

[BUG] Biome scanner crash [1.12.2] #2327

Open Boscpeing opened 2 years ago

Boscpeing commented 2 years ago

Version of Advanced Rocketry

AdvancedRocketry-1.12.2-2.0.0-13.jar

Have you verified this is an issue in the latest unstable build

Version of LibVulpes

LibVulpes-1.12.2-0.4.2-25-universal.jar

Version of Minecraft

1.12.2 forge-14.23.5.2859

Does this occur without other mods installed

Crash report or log or visualVM (if applicable)

http://pastebin.com is a good place to put them crash reports that are put in the issue itself are hard to read

https://pastebin.com/L8kTS2ty

Description of the problem

Right click biome changer after sending a biome changing satellite into orbit. It then crashes. World crashes if you try and reload it.

Hacker6329 commented 2 years ago

This happens to me too

JovietUnion commented 1 year ago

me three

dercodeKoenig commented 1 month ago

this is a nullpointer exception. i mentioned the cause here: #2393 it happens because the biomeid is not initialized. the same biomeid is used in (BiomeHandler.java:22) (thanks for the log). this creates the nullpointerexception.

public class BiomeHandler {

public static void changeBiome(World world, Biome biomeId, BlockPos pos) {
    Chunk chunk = world.getChunkFromBlockCoords(pos);

    Biome biome = world.getBiome(pos);

    if(biome == biomeId)
        return;

    if(biome.topBlock != biomeId.topBlock) { // NULLPOINTER EXCEPTION CAUSED HERE
        BlockPos yy = world.getHeight(pos);

        while(!world.getBlockState(yy.down()).isOpaqueCube() && yy.getY() > 0)
            yy = yy.down();

        if(world.getBlockState(yy.down()) == biome.topBlock)
            world.setBlockState(yy.down(), biomeId.topBlock);
    }

    byte[] biomeArr = chunk.getBiomeArray();
    try {
        biomeArr[(pos.getX() & 15) + (pos.getZ() & 15)*16] = (byte)Biome.getIdForBiome(biomeId);
    } catch (IndexOutOfBoundsException e) {
        e.printStackTrace();
    }

    PacketHandler.sendToNearby(new PacketBiomeIDChange(chunk, world, new HashedBlockPosition(pos)), world.provider.getDimension(), pos, 256);
}

}

dercodeKoenig commented 1 week ago

fixed in "Advanced Rocketry - Reworked" (https://github.com/dercodeKoenig/AdvancedRocketry)