SpongePowered / SpongeForge

A Forge mod that implements SpongeAPI
http://www.spongepowered.org/
MIT License
1.14k stars 306 forks source link

ArithmeticException: / by zero crash caused by tileentity-activation #3192

Closed Sir-Will closed 4 years ago

Sir-Will commented 4 years ago

I am currently running

Issue Description When the config has the following setting the vanilla furnaces will cause the ArithmeticException: / by zero crashes.

This started after updating from 7.2.2-RC4029 to 7.2.3. Something seems to have changed which causes the setting to affect tile entities which are not listed.

    tileentity-activation {
        # If 'true', newly discovered tileentities will be added to this config with default settings.
        auto-populate=false
        # Default activation block range used for all tileentities unless overridden.
        default-block-range=64
        # Default tick rate used for all tileentities unless overridden.
        default-tick-rate=1
        # Per-mod overrides. Refer to the minecraft default mod for example.
        mods {
            foamfix {
                block-range {}
                # If 'false', tileentity activation rules for this mod will be ignored and always tick.
                enabled=true
                tick-rate {
                    hopper=8
                }
            }
            minecraft {
                block-range {}
                # If 'false', tileentity activation rules for this mod will be ignored and always tick.
                enabled=true
                tick-rate {
                    hopper=8
                }
            }
        }
    }
Description: Ticking block entity

java.lang.ArithmeticException: / by zero
    at org.spongepowered.common.mixin.plugin.tileentityactivation.TileEntityActivation.checkIfActive(TileEntityActivation.java:227)
    at org.spongepowered.common.SpongeImplHooks.shouldTickTile(SpongeImplHooks.java:3028)
    at net.minecraft.world.WorldServer.updateTileEntity(WorldServer.java:4738)
    at net.minecraft.world.WorldServer.redirect$zlo000$onUpdateTileEntities(WorldServer.java:4733)
    at net.minecraft.world.World.func_72939_s(World.java:1838)
    at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:3931)
    at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:767)
    at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:397)
    at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:668)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:526)
    at java.lang.Thread.run(Thread.java:748)

A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: Server thread
Stacktrace:
    at org.spongepowered.common.mixin.plugin.tileentityactivation.TileEntityActivation.checkIfActive(TileEntityActivation.java:227)
    at org.spongepowered.common.SpongeImplHooks.shouldTickTile(SpongeImplHooks.java:3028)
    at net.minecraft.world.WorldServer.updateTileEntity(WorldServer.java:4738)
    at net.minecraft.world.WorldServer.redirect$zlo000$onUpdateTileEntities(WorldServer.java:4733)

-- Block entity being ticked --
Details:
    Name: minecraft:furnace // net.minecraft.tileentity.TileEntityFurnace
    Block type: ID #62 (tile.furnace // net.minecraft.block.BlockFurnace // minecraft:lit_furnace)
    Block data value: 4 / 0x4 / 0b0100
    Block location: World: (-245,154,1762), Chunk: (at 11,9,2 in -16,110; contains blocks -256,0,1760 to -241,255,1775), Region: (-1,3; contains chunks -32,96 to -1,127, blocks -512,0,1536 to -1,255,2047)
    Actual block type: ID #62 (tile.furnace // net.minecraft.block.BlockFurnace // minecraft:lit_furnace)
    Actual block data value: 4 / 0x4 / 0b0100
Stacktrace:
    at net.minecraft.world.World.func_72939_s(World.java:1838)
    at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:3931)
Sir-Will commented 4 years ago

Looks like a new option was added which is an requirement. Adding them to the mod section seems to have fixed it.

                # Default activation block range used for all tileentities unless overridden.
                default-block-range=64
                # Default tick rate used for all tileentities unless overridden.
                default-tick-rate=1