Industrial Foregoing

Industrial Foregoing

95M Downloads

Whats up with laser drill

DBotThePony opened this issue ยท 4 comments

commented

Happened when a player put several inverted lens, including white one. Server crashed and is no longer able to start.

Description: Ticking block entity

java.lang.IllegalArgumentException
    at net.minecraft.util.WeightedRandom.getRandomItem(SourceFile:18)
    at net.minecraft.util.WeightedRandom.getRandomItem(SourceFile:37)
    at com.buuz135.industrial.tile.world.LaserBaseTile.innerUpdate(LaserBaseTile.java:202)
    at net.ndrei.teslacorelib.tileentities.SidedTileEntity.update(SidedTileEntity.kt:991)
    at net.minecraft.world.World.redirect$tileEntityUpdate$zzj000(World.java:4132)
    at net.minecraft.world.World.updateEntities(World.java:1835)
    at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:613)
    at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:767)
    at net.minecraft.server.dedicated.DedicatedServer.updateTimeLightAndEntities(DedicatedServer.java:397)
    at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:668)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:526)
    at java.lang.Thread.run(Thread.java:748)

Industrial Foregoing Version: 1.12.2 1.9
TeslaCoreLib Version: 1.0.15
Crashlog: https://gist.github.com/roboderpy/ef37408f421bdf707bdbcb279b612e51

commented
commented

Also ran into this bug. It appears that with inverted lenses, the total weight in the list of items can get negative, which causes IllegalArgumentException.
I fixed it by adding a simple guard on https://github.com/InnovativeOnlineIndustries/Industrial-Foregoing/blob/1.12/src/main/java/com/buuz135/industrial/tile/world/LaserBaseTile.java#L201:
if (!items.isEmpty() && WeightedRandom.getTotalWeight(items) > 0) {

commented

Is there any progress with this issue? It still happens, as it was reported in my pack (xJon/The-1.12.2-Pack#453).

commented

๐Ÿ‘‹ Sorry but Industrial Foregoing has ended support for version 1.12. I'm closing this issue as it will no longer be updated for that version. Thanks for playing with the mod.