MineColonies for ComputerCraft

MineColonies for ComputerCraft

2M Downloads

ColonyPeripheral.getCitizens/getVisitors does not return happiness

ParapetCloud opened this issue ยท 2 comments

commented

Describe the bug
ColonyPeripheral.getCitizens and getVisitors does not return happiness as the signature of the method has changed.
https://github.com/ldtteam/minecolonies/blob/884f9e0ad7f3a148a94271026fb2ec29aca36665/src/api/java/com/minecolonies/api/entity/citizen/citizenhandlers/ICitizenHappinessHandler.java#L50

To Reproduce
Steps to reproduce the behavior:

  1. Open A lua prompt in a computer
  2. Run colony.getCitizens()
  3. Game crashes (though if it didn't crash there would be no happiness)

Expected behavior
An object with happiness value should be returned

Versions:
Minecraft: 1.19.2-forge43.2.8
Minecolonies: 1.0.1351-RELEASE
Colony4cc: 2.3.3

Additional context
java.lang.NoSuchMethodError: 'double com.minecolonies.api.entity.citizen.citizenhandlers.ICitizenHappinessHandler.getHappiness(com.minecolonies.api.colony.IColony, com.minecolonies.api.colony.ICitizenData)'
at nz.co.mirality.colony4cc.peripheral.ColonyPeripheral.lambda$getCitizens$38(ColonyPeripheral.java:254) ~[Colony4ComputerCraft-1.19.2-2.3.3.jar%23324!/:2.3.3] {re:classloading}
at nz.co.mirality.colony4cc.peripheral.ColonyPeripheral.protectPut(ColonyPeripheral.java:782) ~[Colony4ComputerCraft-1.19.2-2.3.3.jar%23324!/:2.3.3] {re:classloading}
at nz.co.mirality.colony4cc.peripheral.ColonyPeripheral.getCitizens(ColonyPeripheral.java:254) ~[Colony4ComputerCraft-1.19.2-2.3.3.jar%23324!/:2.3.3] {re:classloading}
at nz.co.mirality.colony4cc.peripheral.ColonyPeripheral$cc$getCitizens1.apply(CC generated method) ~[?:?] {re:classloading,re:classloading,re:classloading,re:classloading}
at dan200.computercraft.core.asm.PeripheralMethod.lambda$static$0(PeripheralMethod.java:21) ~[cc-tweaked-1.19.2-1.101.2.jar%23317!/:1.101.2] {re:classloading}
at dan200.computercraft.core.computer.LuaContext.lambda$issueMainThreadTask$0(LuaContext.java:32) ~[cc-tweaked-1.19.2-1.101.2.jar%23317!/:1.101.2] {re:classloading}
at dan200.computercraft.core.computer.mainthread.MainThreadExecutor.execute(MainThreadExecutor.java:146) ~[cc-tweaked-1.19.2-1.101.2.jar%23317!/:1.101.2] {re:classloading}
at dan200.computercraft.core.computer.mainthread.MainThread.tick(MainThread.java:144) ~[cc-tweaked-1.19.2-1.101.2.jar%23317!/:1.101.2] {re:classloading}
at dan200.computercraft.shared.computer.core.ServerContext.tick(ServerContext.java:148) ~[cc-tweaked-1.19.2-1.101.2.jar%23317!/:1.101.2] {re:classloading}
at dan200.computercraft.shared.CommonHooks.onServerTick(CommonHooks.java:56) ~[cc-tweaked-1.19.2-1.101.2.jar%23317!/:1.101.2] {re:classloading}
at dan200.computercraft.shared.CommonHooks_onServerTick_ServerTickEvent.invoke(.dynamic) ~[cc-tweaked-1.19.2-1.101.2.jar%23317!/:1.101.2] {re:classloading,pl:eventbus:B}
at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:73) ~[eventbus-6.0.3.jar%2385!/:?] {}
at net.minecraftforge.eventbus.EventBus.post(EventBus.java:315) ~[eventbus-6.0.3.jar%2385!/:?] {}
at net.minecraftforge.eventbus.EventBus.post(EventBus.java:296) ~[eventbus-6.0.3.jar%2385!/:?] {}
at net.minecraftforge.event.ForgeEventFactory.onPreServerTick(ForgeEventFactory.java:835) ~[forge-1.19.2-43.2.8-universal.jar%23440!/:?] {re:classloading}
at net.minecraft.server.MinecraftServer.m_5705(MinecraftServer.java:804) ~[client-1.19.2-20220805.130853-srg.jar%23435!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:A}
at net.minecraft.client.server.IntegratedServer.m_5705(IntegratedServer.java:84) ~[client-1.19.2-20220805.130853-srg.jar%23435!/:?] {re:classloading,pl:runtimedistcleaner:A}
at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:654) ~[client-1.19.2-20220805.130853-srg.jar%23435!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:A}
at net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:244) ~[client-1.19.2-20220805.130853-srg.jar%23435!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:A}
at java.lang.Thread.run(Thread.java:833) [?:?] {}

commented

The minimum supported version of MineColonies for Colony4CC 2.3.3 is 1.0.1391-BETA, as noted in the changelog.

It appears that I did forget to update the compatibility manifest, so Forge doesn't warn about this on startup, as intended.

You will either need to downgrade Colony4CC or upgrade MineColonies. (Upgrading is usually preferred.)

commented

The compatibility metadata has been fixed in the latest releases.