[ISSUE] Block Mining Stage
opened this issue · comments
Describe the issue
I'm not sure if it is different throughout versions, but because the constructor for BlockPosition needs three integers in 1.19.4 and three doubles are provided, the mining stage effect fails. I was able to fix the issue by cloning the project and changing a few things:
Before
Object position = blockPosition.getConstructor(double.class, double.class, double.class)
.newInstance(location.getX(), location.getY(), location.getZ());
After
Object position = blockPosition.getConstructor(int.class, int.class, int.class)
.newInstance(location.getBlockX(), location.getBlockY(), location.getBlockZ());
The Console:
[22:11:13 WARN]: java.lang.NoSuchMethodException: net.minecraft.core.BlockPosition.<init>(double,double,double)
[22:11:13 WARN]: at java.base/java.lang.Class.getConstructor0(Class.java:3585)
[22:11:13 WARN]: at java.base/java.lang.Class.getConstructor(Class.java:2271)
[22:11:13 WARN]: at SkJade.jar//com.ankoki.skjade.elements.effects.EffShowMiningStage.execute(EffShowMiningStage.java:94)
[22:11:13 WARN]: at Skript-2.6.4 (2).jar//ch.njol.skript.lang.Effect.run(Effect.java:50)
[22:11:13 WARN]: at Skript-2.6.4 (2).jar//ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:61)
[22:11:13 WARN]: at Skript-2.6.4 (2).jar//ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:89)
[22:11:13 WARN]: at Skript-2.6.4 (2).jar//ch.njol.skript.command.Commands.handleEffectCommand(Commands.java:290)
[22:11:13 WARN]: at Skript-2.6.4 (2).jar//ch.njol.skript.command.Commands$3$1.call(Commands.java:220)
[22:11:13 WARN]: at Skript-2.6.4 (2).jar//ch.njol.skript.command.Commands$3$1.call(Commands.java:217)
[22:11:13 WARN]: at org.bukkit.craftbukkit.v1_19_R3.scheduler.CraftFuture.run(CraftFuture.java:88)
[22:11:13 WARN]: at org.bukkit.craftbukkit.v1_19_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:483)
[22:11:13 WARN]: at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1483)
[22:11:13 WARN]: at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:447)
[22:11:13 WARN]: at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1397)
[22:11:13 WARN]: at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1174)
[22:11:13 WARN]: at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:320)
[22:11:13 WARN]: at java.base/java.lang.Thread.run(Thread.java:833)
Expected behavior
The mining stage should appear on the specified blocks without errors nor warnings.
To Reproduce
show mining stage 5 at target block
Information
1.19.4
Paper
SkJade 1.4.3
Thank you :)
Is it 1.19.4 exactly this changed, or is it just where you noticed this.
My testing was just in 1.19.4. Using a website though I found that the double constructor was removed in 1.19.4, but it seems like previous versions do support the integer variant.
The site: https://mappings.cephx.dev/
Thank you very much, ill get on this for my 1.4.4 bump.
No problem. Glad I could help!