lambdaisland / witchcraft

Clojure API for manipulating Minecraft, based on Bukkit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Syntax error (ClassNotFoundException) compiling at (lambdaisland/witchcraft/events.clj:1:1).

crofty opened this issue · comments

Hi,
I was just attempting to try out this project but i've fallen at the first hurdle:

$ clj
Clojure 1.10.3
user=> (require '[lambdaisland.witchcraft :as wc])
Syntax error (ClassNotFoundException) compiling at (lambdaisland/witchcraft/events.clj:1:1).
org.bukkit.Bukkit

This is my full deps.edn:

{:deps {com.lambdaisland/witchcraft {:mvn/version "0.30.297"}}
 :mvn/repos {"glowstone-repo" {:url "https://repo.glowstone.net/content/repositories/snapshots/"}
             "aikar" {:url "https://repo.aikar.co/nexus/content/repositories/aikar-release/"}}}

It's my first time trying this, and I'm not at all familiar with the Minecraft server ecosystem, so have I missed a step?
Thanks

I just happened to stumble upon this too, maybe the way dependencies are arranged has changed, so tried my luck by looking into deps.edn of this project and from :glowstone alias grabbed net.glowstone/glowstone {:mvn/version "2021.7.0-SNAPSHOT"} to my deps.edn file, so I have now

{:deps {com.lambdaisland/witchcraft {:mvn/version "0.37.324"}
        net.glowstone/glowstone {:mvn/version "2021.7.0-SNAPSHOT"}}
 :mvn/repos
 {"glowstone-repo" {:url "https://repo.glowstone.net/content/repositories/snapshots/"}
  "aikar"          {:url "https://repo.aikar.co/nexus/content/repositories/aikar-release/"}}}

after which (require '[lambdaisland.witchcraft :as wc]) works with a few warnings

Reflection warning, lambdaisland/witchcraft.clj:121:8 - reference to field getKey on org.bukkit.enchantments.Enchantment can't be resolved.
Reflection warning, lambdaisland/witchcraft.clj:1597:7 - call to method remove on org.bukkit.inventory.Inventory can't be resolved (argument types: java.lang.Object).
Reflection warning, lambdaisland/witchcraft.clj:1597:7 - call to method remove on org.bukkit.inventory.Inventory can't be resolved (argument types: unknown).
Reflection warning, lambdaisland/witchcraft.clj:1883:21 - call to method hardcore on org.bukkit.WorldCreator can't be resolved (no such method).
nil

After that, wc/start! seems not to be around any longer:

user=> (wc/start!)
Syntax error compiling at (REPL:1:1).
No such var: wc/start!

But there seems to be wc/start-glowstone!

user=> (wc/start-glowstone!)
#future[{:status :pending, :val nil} 0xab8d6a6]
user=> 21:39:40 [INFO] This server is running Glowstone version 2021.7.0-SNAPSHOT.e540641 (MC: 1.12.2) (Implementing API version 1.12.2-R6.0-SNAPSHOT)
21:39:40 [INFO] Recipes: 307 shaped, 63 shapeless, 26 furnace, 10 dynamic, 44 fuels.
...

I'm totally just dabbling here, just writing a report, hope this helps! :)

It's entirely possible that glowstone support is not working at the moment. We recommend running with Paper. See the instructions here: https://github.com/lambdaisland/witchcraft-workshop

Nice! I forgot that there was a workshop recently, thank you! :)