Skip to content
This repository has been archived by the owner on Jun 1, 2024. It is now read-only.

Casting issue with HOME memory #78

Closed
ShaneBeee opened this issue Jul 6, 2023 · 1 comment · Fixed by #81
Closed

Casting issue with HOME memory #78

ShaneBeee opened this issue Jul 6, 2023 · 1 comment · Fixed by #81
Assignees
Labels
bug Something isn't working paper-compability Compatibility with the internals of PaperMC & Forks

Comments

@ShaneBeee
Copy link

Bug Type

Console Errors

MobChip Version

1.9.0

Server Version

Paper 1.20.1

Description

Im using this API in a Skript addon, and when trying to get the HOME memory of a villager, a casting error comes up saying an Optional cannot be cast to Location
Please ignore the Skript stuff

[14:45:41 ERROR]: #!#! Stack trace:
[14:45:41 ERROR]: #!#! java.lang.ClassCastException: Cannot cast java.util.Optional to org.bukkit.Location
[14:45:41 ERROR]: #!#!     at java.base/java.lang.Class.cast(Class.java:3991)
[14:45:41 ERROR]: #!#!     at SkMobChip-1.0-SNAPSHOT.jar//me.gamercoder215.mobchip.abstraction.v1_20_R1.ChipUtil1_20_R1.getMemory(ChipUtil1_20_R1.java:981)
[14:45:41 ERROR]: #!#!     at SkMobChip-1.0-SNAPSHOT.jar//me.gamercoder215.mobchip.bukkit.BukkitBrain.getMemory(BukkitBrain.java:291)
[14:45:41 ERROR]: #!#!     at SkMobChip-1.0-SNAPSHOT.jar//com.shanebeestudios.skmob.elements.expressions.ExprEntityMemory.get(ExprEntityMemory.java:57)
[14:45:41 ERROR]: #!#!     at Skript-2.6.4.jar//ch.njol.skript.lang.util.SimpleExpression.getArray(SimpleExpression.java:99)
[14:45:41 ERROR]: #!#!     at Skript-2.6.4.jar//ch.njol.skript.effects.EffMessage.sendMessage(EffMessage.java:123)
[14:45:41 ERROR]: #!#!     at Skript-2.6.4.jar//ch.njol.skript.effects.EffMessage.execute(EffMessage.java:108)
[14:45:41 ERROR]: #!#!     at Skript-2.6.4.jar//ch.njol.skript.lang.Effect.run(Effect.java:50)
[14:45:41 ERROR]: #!#!     at Skript-2.6.4.jar//ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:61)
[14:45:41 ERROR]: #!#!     at Skript-2.6.4.jar//ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:89)
[14:45:41 ERROR]: #!#!     at Skript-2.6.4.jar//ch.njol.skript.command.Commands.handleEffectCommand(Commands.java:290)
[14:45:41 ERROR]: #!#!     at Skript-2.6.4.jar//ch.njol.skript.command.Commands$3$1.call(Commands.java:220)
[14:45:41 ERROR]: #!#!     at Skript-2.6.4.jar//ch.njol.skript.command.Commands$3$1.call(Commands.java:217)
[14:45:41 ERROR]: #!#!     at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftFuture.run(CraftFuture.java:88)
[14:45:41 ERROR]: #!#!     at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:480)
[14:45:41 ERROR]: #!#!     at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1480)
[14:45:41 ERROR]: #!#!     at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:447)
[14:45:41 ERROR]: #!#!     at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1394)
[14:45:41 ERROR]: #!#!     at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1171)
[14:45:41 ERROR]: #!#!     at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:318)
[14:45:41 ERROR]: #!#!     at java.base/java.lang.Thread.run(Thread.java:1623)

Expected Behavior

no error :)

Actual Behavior

Get error -> see description

Additional Information

No response

@ShaneBeee ShaneBeee added the unconfirmed bug A Bug that has yet to be confirmed label Jul 6, 2023
@gmitch215
Copy link
Owner

Paper uses Optionals for Memory instead of the default object, most likely for optimization and API purposes. I may add support for it.

@gmitch215 gmitch215 added bug Something isn't working paper-compability Compatibility with the internals of PaperMC & Forks and removed unconfirmed bug A Bug that has yet to be confirmed labels Jul 7, 2023
@gmitch215 gmitch215 self-assigned this Jul 7, 2023
@gmitch215 gmitch215 mentioned this issue Jul 11, 2023
4 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working paper-compability Compatibility with the internals of PaperMC & Forks
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants