Tetra

Tetra

12M Downloads

[Bug] Sometimes Enchantment cause error

PixVoxel opened this issue ยท 0 comments

commented

Observed behaviour

Sometimes enchant with enchant book in tetra workbench takes exp and not working.

[16:09:36] [Server thread/FATAL]: Error executing task on Server
java.lang.IllegalArgumentException: bound must be positive
at java.util.Random.nextInt(Random.java:322) ~[?:?]
at se.mickelus.tetra.items.modular.IModularItem.lambda$applyDestabilizationEffects$42(IModularItem.java:673) ~[tetra-1.18.1-4.7.0.jar%23125!/:?]
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) ~[?:?]
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) ~[?:?]
at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:992) ~[?:?]
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?]
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) ~[?:?]
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) ~[?:?]
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) ~[?:?]
at se.mickelus.tetra.items.modular.IModularItem.applyDestabilizationEffects(IModularItem.java:663) ~[tetra-1.18.1-4.7.0.jar%23125!/:?]
at se.mickelus.tetra.items.modular.IModularItem.assemble(IModularItem.java:1032) ~[tetra-1.18.1-4.7.0.jar%23125!/:?]
at se.mickelus.tetra.blocks.workbench.WorkbenchTile.craft(WorkbenchTile.java:403) ~[tetra-1.18.1-4.7.0.jar%23125!/:?]
at se.mickelus.tetra.blocks.workbench.WorkbenchPacketCraft.handle(WorkbenchPacketCraft.java:23) ~[tetra-1.18.1-4.7.0.jar%23125!/:?]
at se.mickelus.mutil.network.PacketHandler.lambda$onMessage$2(PacketHandler.java:75) ~[mutil-1.18.1-4.4.0.jar%23100!/:4.4.0]
at net.minecraftforge.network.NetworkEvent$Context.enqueueWork(NetworkEvent.java:222) ~[forge-1.18.1-39.0.79-universal.jar%23135!/:?]
at se.mickelus.mutil.network.PacketHandler.onMessage(PacketHandler.java:73) ~[mutil-1.18.1-4.4.0.jar%23100!/:4.4.0]
at net.minecraftforge.network.simple.IndexedMessageCodec.lambda$tryDecode$3(IndexedMessageCodec.java:128) ~[forge-1.18.1-39.0.79-universal.jar%23135!/:?]
at java.util.Optional.ifPresent(Optional.java:178) ~[?:?]
at net.minecraftforge.network.simple.IndexedMessageCodec.tryDecode(IndexedMessageCodec.java:128) ~[forge-1.18.1-39.0.79-universal.jar%23135!/:?]
at net.minecraftforge.network.simple.IndexedMessageCodec.consume(IndexedMessageCodec.java:162) ~[forge-1.18.1-39.0.79-universal.jar%23135!/:?]
at net.minecraftforge.network.simple.SimpleChannel.networkEventListener(SimpleChannel.java:82) ~[forge-1.18.1-39.0.79-universal.jar%23135!/:?]
at net.minecraftforge.eventbus.EventBus.doCastFilter(EventBus.java:247) ~[eventbus-5.0.3.jar%232!/:?]
at net.minecraftforge.eventbus.EventBus.lambda$addListener$11(EventBus.java:239) ~[eventbus-5.0.3.jar%232!/:?]
at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302) ~[eventbus-5.0.3.jar%232!/:?]
at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283) ~[eventbus-5.0.3.jar%232!/:?]
at net.minecraftforge.network.NetworkInstance.dispatch(NetworkInstance.java:82) ~[forge-1.18.1-39.0.79-universal.jar%23135!/:?]
at net.minecraftforge.network.NetworkHooks.lambda$onCustomPayload$1(NetworkHooks.java:89) ~[forge-1.18.1-39.0.79-universal.jar%23135!/:?]
at java.util.Optional.map(Optional.java:260) ~[?:?]
at net.minecraftforge.network.NetworkHooks.onCustomPayload(NetworkHooks.java:89) ~[forge-1.18.1-39.0.79-universal.jar%23135!/:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl.m_7423_(ServerGamePacketListenerImpl.java:1416) ~[server-1.18.1-20211210.034407-srg.jar%23131!/:?]
at net.minecraft.network.protocol.game.ServerboundCustomPayloadPacket.m_5797_(ServerboundCustomPayloadPacket.java:35) ~[server-1.18.1-20211210.034407-srg.jar%23131!/:?]
at net.minecraft.network.protocol.game.ServerboundCustomPayloadPacket.m_5797_(ServerboundCustomPayloadPacket.java:8) ~[server-1.18.1-20211210.034407-srg.jar%23131!/:?]
at net.minecraft.network.protocol.PacketUtils.m_131356_(PacketUtils.java:21) ~[server-1.18.1-20211210.034407-srg.jar%23131!/:?]
at net.minecraft.server.TickTask.run(TickTask.java:18) ~[server-1.18.1-20211210.034407-srg.jar%23131!/:?]
at net.minecraft.util.thread.BlockableEventLoop.m_6367_(BlockableEventLoop.java:151) ~[server-1.18.1-20211210.034407-srg.jar%23131!/:?]
at net.minecraft.util.thread.ReentrantBlockableEventLoop.m_6367_(ReentrantBlockableEventLoop.java:23) ~[server-1.18.1-20211210.034407-srg.jar%23131!/:?]
at net.minecraft.server.MinecraftServer.m_6367_(MinecraftServer.java:765) ~[server-1.18.1-20211210.034407-srg.jar%23131!/:?]
at net.minecraft.server.MinecraftServer.m_6367_(MinecraftServer.java:161) ~[server-1.18.1-20211210.034407-srg.jar%23131!/:?]
at net.minecraft.util.thread.BlockableEventLoop.m_7245_(BlockableEventLoop.java:125) ~[server-1.18.1-20211210.034407-srg.jar%23131!/:?]
at net.minecraft.server.MinecraftServer.m_129961_(MinecraftServer.java:748) ~[server-1.18.1-20211210.034407-srg.jar%23131!/:?]
at net.minecraft.server.MinecraftServer.m_7245_(MinecraftServer.java:742) ~[server-1.18.1-20211210.034407-srg.jar%23131!/:?]
at net.minecraft.util.thread.BlockableEventLoop.m_18701_(BlockableEventLoop.java:134) ~[server-1.18.1-20211210.034407-srg.jar%23131!/:?]
at net.minecraft.server.MinecraftServer.m_130012_(MinecraftServer.java:728) ~[server-1.18.1-20211210.034407-srg.jar%23131!/:?]
at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:672) ~[server-1.18.1-20211210.034407-srg.jar%23131!/:?]
at net.minecraft.server.MinecraftServer.m_177918_(MinecraftServer.java:258) ~[server-1.18.1-20211210.034407-srg.jar%23131!/:?]
at java.lang.Thread.run(Thread.java:833) [?:?]

Expected behaviour

Working normally.

Steps to reproduce

  1. overenchant item
  2. take some enchant book
  3. work with tetra workbench
  4. tada, PROFIT!

Crashlog

No response

Tetra version

4.7.0

mutil/mGui version

4.4.0

Forge version

1.18.1 - 39.0.79

Other mods

No response