ItemsAdder / ia-vscode

https://marketplace.visualstudio.com/items?itemName=LoneDev.ia-vscode
6 stars 3 forks source link

Potion effect "SLOWNESS" not recognized by ItemsAdder #19

Open SniperTVmc opened 1 month ago

SniperTVmc commented 1 month ago

Hello! With the ItemsAdder extension, in the list of potion effects, it shows "SLOWNESS" and not "SLOW", which causes this kind of error in console. It would be great if this could be fix ;)

VSCode Screenshot:

https://github.com/ItemsAdder/ia-vscode/assets/53542570/d9eece7e-29bf-4da8-bdf6-0bba3e12f7a7

Error in console (when trying to trigger potion effet event):

[17:13:10 ERROR]: Could not pass event PlayerItemConsumeEvent to ItemsAdder v3.6.4-release-3
java.lang.IllegalArgumentException: effect type cannot be null
        at com.google.common.base.Preconditions.checkArgument(Preconditions.java:143) ~[guava-32.1.2-jre.jar:?]
        at org.bukkit.potion.PotionEffect.<init>(PotionEffect.java:85) ~[plazma-api-1.19.4-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.potion.PotionEffect.<init>(PotionEffect.java:56) ~[plazma-api-1.19.4-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.potion.PotionEffect.<init>(PotionEffect.java:106) ~[plazma-api-1.19.4-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.potion.PotionEffect.<init>(PotionEffect.java:119) ~[plazma-api-1.19.4-R0.1-SNAPSHOT.jar:?]
        at ia.m.dX.a(SourceFile:31) ~[ItemsAdder_3.6.4-release-3.jar:?]
        at ia.m.ej.a(SourceFile:94) ~[ItemsAdder_3.6.4-release-3.jar:?]
        at ia.m.ew.b(SourceFile:58) ~[ItemsAdder_3.6.4-release-3.jar:?]
        at ia.m.do.a(SourceFile:898) ~[ItemsAdder_3.6.4-release-3.jar:?]
        at ia.m.eL.a(SourceFile:570) ~[ItemsAdder_3.6.4-release-3.jar:?]
        at ia.m.ew.b(SourceFile:57) ~[ItemsAdder_3.6.4-release-3.jar:?]
        at ia.m.dt.a(SourceFile:176) ~[ItemsAdder_3.6.4-release-3.jar:?]
        at ia.m.dt.b(SourceFile:420) ~[ItemsAdder_3.6.4-release-3.jar:?]
        at com.destroystokyo.paper.event.executor.MethodHandleEventExecutor.execute(MethodHandleEventExecutor.java:40) ~[plazma-api-1.19.4-R0.1-SNAPSHOT.jar:?]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:77) ~[plazma-api-1.19.4-R0.1-SNAPSHOT.jar:git-Plazma-"264f7cf"]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[plazma-api-1.19.4-R0.1-SNAPSHOT.jar:?]
        at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:61) ~[plazma-1.19.4.jar:git-Plazma-"264f7cf"]
        at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:126) ~[plazma-1.19.4.jar:git-Plazma-"264f7cf"]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:617) ~[plazma-api-1.19.4-R0.1-SNAPSHOT.jar:?]
        at net.minecraft.world.entity.LivingEntity.completeUsingItem(LivingEntity.java:4014) ~[?:?]
        at net.minecraft.server.level.ServerPlayer.completeUsingItem(ServerPlayer.java:1829) ~[?:?]
        at net.minecraft.world.entity.LivingEntity.updateUsingItem(LivingEntity.java:3874) ~[?:?]
        at net.minecraft.server.level.ServerPlayer.updateUsingItem(ServerPlayer.java:2534) ~[?:?]
        at net.minecraft.world.entity.LivingEntity.updatingUsingItem(LivingEntity.java:3855) ~[?:?]
        at net.minecraft.world.entity.LivingEntity.tick(LivingEntity.java:3022) ~[?:?]
        at net.minecraft.world.entity.player.Player.tick(Player.java:305) ~[?:?]
        at net.minecraft.server.level.ServerPlayer.doTick(ServerPlayer.java:766) ~[?:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.tick(ServerGamePacketListenerImpl.java:374) ~[?:?]
        at net.minecraft.network.Connection.tick(Connection.java:604) ~[?:?]
        at net.minecraft.server.network.ServerConnectionListener.tick(ServerConnectionListener.java:234) ~[?:?]
        at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1607) ~[plazma-1.19.4.jar:git-Plazma-"264f7cf"]
        at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:494) ~[plazma-1.19.4.jar:git-Plazma-"264f7cf"]
        at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1426) ~[plazma-1.19.4.jar:git-Plazma-"264f7cf"]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1197) ~[plazma-1.19.4.jar:git-Plazma-"264f7cf"]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:326) ~[plazma-1.19.4.jar:git-Plazma-"264f7cf"]
        at java.lang.Thread.run(Thread.java:1583) ~[?:?]
LoneDev6 commented 1 month ago

https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/potion/PotionEffectType.html

SLOWNESS exists. Please provide your item configuration. image

SniperTVmc commented 1 month ago

The problem seems to be the result of the fact that in 1.19.4, the slowness effect is called SLOW, look at the screenshot:

image

Source: https://helpch.at/docs/1.19.4/org/bukkit/potion/PotionEffectType.html#SLOW (*Potion effects for 1.19.4 version)

My config version (addon source: spigotmc.org):

info:
  namespace: ax_food_pack
items:
  beer:
    display_name: Beer
    resource:
      material: POTION
      generate: true
      textures:
        - ax_food_pack:beer
    events:
      drink:
        potion_effect:
          type: SLOWNESS #With 'SLOWNESS', the effect is not recognized by the server, just need to replace by 'SLOW'
          amplifier: 1
          duration: 3600
LoneDev6 commented 1 month ago

I will fix that in the upcoming update, thanks!