GTNewHorizons / GT-New-Horizons-Modpack

New Modpack with Gregtech, Thaumcraft and Witchery
https://www.gtnewhorizons.com/
Other
882 stars 275 forks source link

Exception when placing an EoH that has had its redstone output strength configured with a soldering iron #16585

Open norbby42 opened 1 week ago

norbby42 commented 1 week ago

Your GTNH Discord Username

Quackers#6418

Your Pack Version

2.6.0

Your Server

Private Dedicated

Java Version

Java 17

Type of Server

Vanilla Forge

Your Expectation

On placing the Eye of Harmony, the server would not get an exception.

Testcase:

  1. Place an Eye of Harmony controller block
  2. Use a Soldering Iron to cause it emit a strong redstone signal to one of its sides
  3. Break the Eye of Harmony controller block with a wrench or Vajra
  4. Place down the Eye of Harmony controller block
  5. Observe in the server log that there is an exception while parsing EoH's NBT
    • Expectation: No error
  6. Right click the Eye of Harmony with a screwdriver
  7. Observe that animations were off
    • Expectation: Animations would be on (the default value)

The Reality

Setting the redstone output strength causes an exception to fire when placing down the EoH controller block.

It appears the controller block item has partial NBT set when broken while configured: image

Stacktrace from the server log:

[GregTech GTNH]: Encountered Exception while loading MetaTileEntity.
[GregTech GTNH]: java.lang.NumberFormatException: Zero length BigInteger
    at java.base/java.math.BigInteger.<init>(BigInteger.java:312)
    at java.base/java.math.BigInteger.<init>(BigInteger.java:340)
    at RFB-Launch//com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_EyeOfHarmony.loadNBTData(GT_MetaTileEntity_EM_EyeOfHarmony.java:1719)
    at RFB-Launch//gregtech.api.metatileentity.CommonMetaTileEntity.loadMetaTileNBT(CommonMetaTileEntity.java:97)
    at RFB-Launch//gregtech.api.metatileentity.BaseMetaTileEntity.setInitialValuesAsNBT(BaseMetaTileEntity.java:210)
    at RFB-Launch//gregtech.common.blocks.GT_Item_Machines.placeBlockAt(GT_Item_Machines.java:276)
    at RFB-Launch//net.minecraft.item.ItemBlock.func_77648_a(ItemBlock.java:103)
    at RFB-Launch//net.minecraftforge.common.ForgeHooks.onPlaceItemIntoWorld(ForgeHooks.java:505)
    at RFB-Launch//net.minecraft.item.ItemStack.func_77943_a(ItemStack.java:128)
    at RFB-Launch//net.minecraft.server.management.ItemInWorldManager.func_73078_a(ItemInWorldManager.java:389)
    at RFB-Launch//net.minecraft.network.NetHandlerPlayServer.func_147346_a(NetHandlerPlayServer.java:556)
    at RFB-Launch//net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.func_148833_a(SourceFile:60)
    at RFB-Launch//net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.func_148833_a(SourceFile:9)
    at RFB-Launch//net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:212)
    at RFB-Launch//net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:165)
    at RFB-Launch//net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:659)
    at RFB-Launch//net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:334)
    at RFB-Launch//net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:547)
    at RFB-Launch//net.minecraft.server.MinecraftServer.run(MinecraftServer.java:427)
    at RFB-Launch//net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:685)

Your Proposal

Fix pls <3

Final Checklist