Magic

Magic

190k Downloads

Can't use effect in effectlib in 1.12.2 paper

Clexus opened this issue ยท 6 comments

commented
issued server command: /cast rush
[21:41:54 WARN]: [Magic] Error playing effects of class: Sphere
java.lang.NoClassDefFoundError: org/bukkit/block/data/BlockData
        at java.lang.Class.getDeclaredFields0(Native Method) ~[?:?]
        at java.lang.Class.privateGetDeclaredFields(Class.java:3297) ~[?:?]
        at java.lang.Class.getField0(Class.java:3482) ~[?:?]
        at java.lang.Class.getField0(Class.java:3496) ~[?:?]
        at java.lang.Class.getField(Class.java:2115) ~[?:?]
        at com.elmakers.mine.bukkit.slikey.effectlib.EffectManager.setField(EffectManager.java:396) ~[?:?]
        at com.elmakers.mine.bukkit.slikey.effectlib.EffectManager.getEffect(EffectManager.java:232) ~[?:?]
        at com.elmakers.mine.bukkit.effect.EffectLibManager.loadEffect(EffectLibManager.java:166) ~[?:?]
        at com.elmakers.mine.bukkit.effect.EffectLibManager.play(EffectLibManager.java:73) ~[?:?]
        at com.elmakers.mine.bukkit.effect.EffectPlayer.performEffects(EffectPlayer.java:872) ~[?:?]
        at com.elmakers.mine.bukkit.effect.EffectPlayer.playEffect(EffectPlayer.java:508) ~[?:?]
        at com.elmakers.mine.bukkit.effect.EffectPlayer.playEffect(EffectPlayer.java:494) ~[?:?]
        at com.elmakers.mine.bukkit.effect.builtin.EffectSingle.play(EffectSingle.java:12) ~[?:?]
        at com.elmakers.mine.bukkit.effect.EffectPlayer.startPlay(EffectPlayer.java:729) ~[?:?]
        at com.elmakers.mine.bukkit.effect.EffectPlayer.startEffects(EffectPlayer.java:709) ~[?:?]
        at com.elmakers.mine.bukkit.effect.EffectPlayer.start(EffectPlayer.java:641) ~[?:?]
        at com.elmakers.mine.bukkit.effect.EffectPlayer.start(EffectPlayer.java:649) ~[?:?]
        at com.elmakers.mine.bukkit.action.CastContext.playEffects(CastContext.java:715) ~[?:?]
        at com.elmakers.mine.bukkit.action.CastContext.playEffects(CastContext.java:668) ~[?:?]
        at com.elmakers.mine.bukkit.spell.BaseSpell.playEffects(BaseSpell.java:1992) ~[?:?]
        at com.elmakers.mine.bukkit.spell.BaseSpell.playEffects(BaseSpell.java:1976) ~[?:?]
        at com.elmakers.mine.bukkit.spell.BaseSpell.playEffects(BaseSpell.java:1982) ~[?:?]
        at com.elmakers.mine.bukkit.spell.BaseSpell.processResult(BaseSpell.java:1943) ~[?:?]
        at com.elmakers.mine.bukkit.spell.ActionSpell.processResult(ActionSpell.java:40) ~[?:?]
        at com.elmakers.mine.bukkit.spell.BaseSpell.finalizeCast(BaseSpell.java:1779) ~[?:?]
        at com.elmakers.mine.bukkit.spell.BaseSpell.cast(BaseSpell.java:1564) ~[?:?]
        at com.elmakers.mine.bukkit.spell.BaseSpell.cast(BaseSpell.java:1445) ~[?:?]
        at com.elmakers.mine.bukkit.spell.BaseSpell.cast(BaseSpell.java:1429) ~[?:?]
        at com.elmakers.mine.bukkit.magic.command.CastCommandExecutor.processCastCommand(CastCommandExecutor.java:181) ~[?:?]
        at com.elmakers.mine.bukkit.magic.command.CastCommandExecutor.onCommand(CastCommandExecutor.java:149) ~[?:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[patched_1.12.2.jar:git-Paper-1620]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:152) ~[patched_1.12.2.jar:git-Paper-1620]
        at org.bukkit.craftbukkit.v1_12_R1.CraftServer.dispatchCommand(CraftServer.java:685) ~[patched_1.12.2.jar:git-Paper-1620]
        at net.minecraft.server.v1_12_R1.PlayerConnection.handleCommand(PlayerConnection.java:1492) ~[patched_1.12.2.jar:git-Paper-1620]
        at net.minecraft.server.v1_12_R1.PlayerConnection.a(PlayerConnection.java:1297) ~[patched_1.12.2.jar:git-Paper-1620]
        at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(PacketPlayInChat.java:45) ~[patched_1.12.2.jar:git-Paper-1620]
        at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(PacketPlayInChat.java:5) ~[patched_1.12.2.jar:git-Paper-1620]
        at net.minecraft.server.v1_12_R1.PlayerConnectionUtils.lambda$ensureMainThread$0(PlayerConnectionUtils.java:14) ~[patched_1.12.2.jar:git-Paper-1620]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
        at net.minecraft.server.v1_12_R1.SystemUtils.a(SourceFile:46) ~[patched_1.12.2.jar:git-Paper-1620]
        at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:850) ~[patched_1.12.2.jar:git-Paper-1620]
        at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:423) ~[patched_1.12.2.jar:git-Paper-1620]
        at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:774) ~[patched_1.12.2.jar:git-Paper-1620]
        at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:666) ~[patched_1.12.2.jar:git-Paper-1620]
        at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: java.lang.ClassNotFoundException: org.bukkit.block.data.BlockData
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:109) ~[patched_1.12.2.jar:git-Paper-1620]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:104) ~[patched_1.12.2.jar:git-Paper-1620]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:587) ~[?:?]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?]
        ... 46 more
[21:41:54 WARN]: [Magic] Error playing effects of class: Cone
java.lang.NoClassDefFoundError: org/bukkit/block/data/BlockData
        at java.lang.Class.getDeclaredFields0(Native Method) ~[?:?]
        at java.lang.Class.privateGetDeclaredFields(Class.java:3297) ~[?:?]
        at java.lang.Class.getField0(Class.java:3482) ~[?:?]
        at java.lang.Class.getField0(Class.java:3496) ~[?:?]
        at java.lang.Class.getField(Class.java:2115) ~[?:?]
        at com.elmakers.mine.bukkit.slikey.effectlib.EffectManager.setField(EffectManager.java:396) ~[?:?]
        at com.elmakers.mine.bukkit.slikey.effectlib.EffectManager.getEffect(EffectManager.java:232) ~[?:?]
        at com.elmakers.mine.bukkit.effect.EffectLibManager.loadEffect(EffectLibManager.java:166) ~[?:?]
        at com.elmakers.mine.bukkit.effect.EffectLibManager.play(EffectLibManager.java:73) ~[?:?]
        at com.elmakers.mine.bukkit.effect.EffectPlayer.performEffects(EffectPlayer.java:872) ~[?:?]
        at com.elmakers.mine.bukkit.effect.EffectPlayer.playEffect(EffectPlayer.java:508) ~[?:?]
        at com.elmakers.mine.bukkit.effect.EffectPlayer.playEffect(EffectPlayer.java:494) ~[?:?]
        at com.elmakers.mine.bukkit.effect.builtin.EffectSingle.play(EffectSingle.java:12) ~[?:?]
        at com.elmakers.mine.bukkit.effect.EffectPlayer.startPlay(EffectPlayer.java:729) ~[?:?]
        at com.elmakers.mine.bukkit.effect.EffectPlayer.startEffects(EffectPlayer.java:709) ~[?:?]
        at com.elmakers.mine.bukkit.effect.EffectPlayer.start(EffectPlayer.java:641) ~[?:?]
        at com.elmakers.mine.bukkit.effect.EffectPlayer.start(EffectPlayer.java:649) ~[?:?]
        at com.elmakers.mine.bukkit.action.CastContext.playEffects(CastContext.java:715) ~[?:?]
        at com.elmakers.mine.bukkit.action.CastContext.playEffects(CastContext.java:674) ~[?:?]
        at com.elmakers.mine.bukkit.action.CastContext.playEffects(CastContext.java:662) ~[?:?]
        at com.elmakers.mine.bukkit.action.CastContext.playEffects(CastContext.java:656) ~[?:?]
        at com.elmakers.mine.bukkit.action.builtin.CustomProjectileAction.hit(CustomProjectileAction.java:918) ~[?:?]
        at com.elmakers.mine.bukkit.action.builtin.CustomProjectileAction.hitEntity(CustomProjectileAction.java:865) ~[?:?]
        at com.elmakers.mine.bukkit.action.builtin.CustomProjectileAction.step(CustomProjectileAction.java:769) ~[?:?]
        at com.elmakers.mine.bukkit.action.CompoundAction.perform(CompoundAction.java:102) ~[?:?]
        at com.elmakers.mine.bukkit.action.ActionContext.perform(ActionContext.java:43) ~[?:?]
        at com.elmakers.mine.bukkit.action.ActionHandler.perform(ActionHandler.java:221) ~[?:?]
        at com.elmakers.mine.bukkit.batch.ActionBatch.process(ActionBatch.java:38) ~[?:?]
        at com.elmakers.mine.bukkit.magic.Mage.processPendingBatches(Mage.java:2008) ~[?:?]
        at com.elmakers.mine.bukkit.magic.MagicController.processPendingBatches(MagicController.java:1632) ~[?:?]
        at com.elmakers.mine.bukkit.tasks.BatchUpdateTask.run(BatchUpdateTask.java:14) ~[?:?]
        at org.bukkit.craftbukkit.v1_12_R1.scheduler.CraftTask.run(CraftTask.java:64) ~[patched_1.12.2.jar:git-Paper-1620]
        at org.bukkit.craftbukkit.v1_12_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:423) ~[patched_1.12.2.jar:git-Paper-1620]
        at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:840) ~[patched_1.12.2.jar:git-Paper-1620]
        at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:423) ~[patched_1.12.2.jar:git-Paper-1620]
        at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:774) ~[patched_1.12.2.jar:git-Paper-1620]
        at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:666) ~[patched_1.12.2.jar:git-Paper-1620]
        at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: java.lang.ClassNotFoundException: org.bukkit.block.data.BlockData
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:109) ~[patched_1.12.2.jar:git-Paper-1620]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:104) ~[patched_1.12.2.jar:git-Paper-1620]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:587) ~[?:?]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?]
        ... 38 more

Can use in higher version like 1.19, but it should support 1.12

rush:
    category: combat
    actions:
        cast:
        - class: CustomProjectile
          start: 2
          actions:
            - class: Damage
              damage: 1
        - class: ChangeContext
          swap_source_and_target: true
          requires_entity_target: true
          actions:
            - class: Velocity
            - class: FallProtection
    effects:
        cast:
        - class: EffectSingle
          sound: entity_pig_hurt
          location: origin
          use_eye_location: true
          requires_entity_target: true
          effectlib:
            class: Sphere
            iterations: 100
            particles: 100
            particle: redstone
            particleCount: 30
            particle_increase: true
            radius: 3
            duration: 1
        hit:
        - class: EffectSingle
          sound: entity_pig_hurt
          location: origin
          requires_entity_target: true
          effectlib:
            class: Cone
            iterations: 100
            length_grow: 0.03
            radius_grow: 0.01
            particles: 100
            particle: fireworks_spark
            duration: 1
    parameters:
        target_type: Entity
        range: 48
        push: -2
        duration: 10000

the skill

commented

I was able to fix EffectLib, so you can grab a dev build here which should work on 1.12

https://jenkins.elmakers.com/job/MagicPlugin/4221/

i'll try that

commented

any specific reason running your server on that VERY outdated minecraft version?
anyway, just running latest Magic dev build on 1.12.2 makes my console explode with errors

commented

Latest Magic took a big batch of EffectLib changes from Chronokeeper- they weren't supposed to have broken backwards compatibility, but seems like maybe they did.

I'll take a look.

commented

Oof - so this is quite a pervasive problem, support was added about a year ago for spawning fake blocks in EffectLib, which I think broke backwards-compatibility completely and... I guess no one noticed?

Or at least no one made a Github issue about it until now ๐Ÿ˜‚

Unfortunately this integration is pretty deeply engrained in EffectManager and Effect, rather than encapsulated in ParticleDisplay like the rest of the version-dependent code.

So without ripping out all that support, I don't have any ideas at the moment how to fix this.

Might be time to just drop backwards compatibility, officially, but I will keep this open until I decide one way or the other.

commented

Oof - so this is quite a pervasive problem, support was added about a year ago for spawning fake blocks in EffectLib, which I think broke backwards-compatibility completely and... I guess no one noticed?

Or at least no one made a Github issue about it until now joy

Unfortunately this integration is pretty deeply engrained in EffectManager and Effect, rather than encapsulated in ParticleDisplay like the rest of the version-dependent code.

So without ripping out all that support, I don't have any ideas at the moment how to fix this.

Might be time to just drop backwards compatibility, officially, but I will keep this open until I decide one way or the other.

So what's the last version supprts 1.12.2?

commented

I was able to fix EffectLib, so you can grab a dev build here which should work on 1.12

https://jenkins.elmakers.com/job/MagicPlugin/4221/