Boolean misclassified as operator
StevenDoesStuffs opened this issue ยท 5 comments
Issue type:
- ๐ Bug
Short description:
I was trying to program a "threeand" operator which takes in 3 booleans and and's them together. According to this website, the threeand operator (threeand a b c = and (and a b) c
) is equivalent to threeand = (and .) . and
. I then translated it into variable cards and used it using apply3
. The result worked when I put it into a display panel (it showed either true
or false
). Then I tried using it in a not operator, but then it tells me "The operator not
received an input with type Operator
at position 1 while the type Boolean
was expected."
Steps to reproduce the problem:
- Create variable 3and (as stated above it's equal to
(and .) . and
, but if needed I can give more details). One tricky thing to note here is that the integrated dynamics pipe is the Haskell pipe but flipped. - Create variable
x = 3and a b c
for any booleans a, b, c. - Create variable
y = not x
. - Put
y
into a display panel to see the error.
Expected behaviour:
I expected that the variable card which contains not x
would not error and give me the opposite of whatever's in x
.
Versions:
- This mod: 1.1.7
- Minecraft: 1.12
- Forge: 14.23.5.2847
Log file: https://paste.ee/p/wmMr7
Probably related issue
I did some more testing later and tried to create a variable z = named x
, and putting that into a display panel crashed the game (server side crash). Anyhow, the link to that crash report is here.
I'm unable to reproduce your problem. Could you share the steps to reproduce the problem via ID operators instead of with Haskell?
Here's some screenshots of the setup. Does that work?
I have the same issue, when working with apply3, it returns a boolean, but anything that wants a boolean value, says its returning an operato , not boolean.
putting that variable card into a predicate slot on the player simulator caused a server side crash also.
[22:09:28] [Server thread/ERROR] [FML]: Exception caught during firing event net.minecraftforge.fml.common.gameevent.TickEvent$ServerTickEvent@2a6bd287: java.lang.ClassCastException: org.cyclops.integrateddynamics.core.evaluate.variable.ValueTypeBoolean$ValueBoolean cannot be cast to org.cyclops.integrateddynamics.core.evaluate.variable.ValueTypeOperator$ValueOperator at org.cyclops.integratedtunnels.part.aspect.TunnelAspectWriteBuilders$Item.lambda$static$7(TunnelAspectWriteBuilders.java:483) ~[TunnelAspectWriteBuilders$Item.class:?] at org.cyclops.integrateddynamics.core.part.aspect.build.AspectBuilder$BuiltWriter.write(AspectBuilder.java:429) ~[AspectBuilder$BuiltWriter.class:?] at org.cyclops.integrateddynamics.part.aspect.write.AspectWriteBase.update(AspectWriteBase.java:59) ~[AspectWriteBase.class:?] at org.cyclops.integrateddynamics.core.part.aspect.build.AspectBuilder$BuiltWriter.update(AspectBuilder.java:452) ~[AspectBuilder$BuiltWriter.class:?] at org.cyclops.integrateddynamics.core.part.write.PartTypeWriteBase.update(PartTypeWriteBase.java:96) ~[PartTypeWriteBase.class:?] at org.cyclops.integrateddynamics.core.part.write.PartTypeWriteBase.update(PartTypeWriteBase.java:48) ~[PartTypeWriteBase.class:?] at org.cyclops.integrateddynamics.core.network.PartNetworkElement.update(PartNetworkElement.java:135) ~[PartNetworkElement.class:?] at org.cyclops.integrateddynamics.core.network.Network.update(Network.java:410) ~[Network.class:?] at org.cyclops.integrateddynamics.core.TickHandler.onTick(TickHandler.java:65) ~[TickHandler.class:?] at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_2218_TickHandler_onTick_TickEvent.invoke(.dynamic) ~[?:?] at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) ~[ASMEventHandler.class:?] at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182) [EventBus.class:?] at net.minecraftforge.fml.common.FMLCommonHandler.onPostServerTick(FMLCommonHandler.java:266) [FMLCommonHandler.class:?] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:712) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:526) [MinecraftServer.class:?] at java.lang.Thread.run(Unknown Source) [?:1.8.0_231]
after some trial and error of workarounds, I have found, putting the variable card in a display, then using a block reader on the display to fetch the displayValue, you can get a string of "bool" which you can then use parse_boolean
on, not the best thing to do, but works as a temporary measure if you need it @StevenDoesStuffs
Update, after some more testing, thanks to @met4000, it seems like its an issue with apply3, if I used apply2 -> apply, it works fine.