Fork me on GitHub
#minecraft
<
2021-10-13
>
jkent02:10:14

does anyone have experience with https://github.com/lambdaisland/witchcraft? I was trying to follow the https://github.com/lambdaisland/witchcraft/blob/main/doc/witchcraft_manual.org#running-from-the-repl to get a locally running glowstone server running in my repl, which I was able to do, but it seems like the published jar is pretty out of date. for instance, the block function doesn’t exist, which is the next thing that the manual goes over after getting the server up:

> (wc/block [0 0 0])
Syntax error compiling at (/private/var/folders/vg/zw2xmz2n5tn995hr3nd93h180000gp/T/form-init8340767686230672678.clj:1:1).
No such var: wc/block
currently, my deps.edn looks like
{:paths     ["src" "resources"]
 :deps      {org.clojure/clojure            {:mvn/version "1.10.3"}
             com.lambdaisland/witchcraft    {:mvn/version "0.0.28"}}
 :mvn/repos {"glowstone-repo" {:url ""}
             "aikar"          {:url ""}}}
but should I be relying on the github source rather than the packaged jar to be getting everything up and running?
com.lambdaisland/witchcraft    {:git/url ""
                                :git/sha "12edfe88f0753909e2d7123f4de540d33d1d90a8"}
any experienced opinions or help on this would be great thanks!

plexus11:10:26

Hey @jkent, you came to the right place! Really happy to hear you're trying out witchcraft. The manual is indeed out of date, hoping to give it a big overhaul soon.

plexus11:10:43

strange though, block should still be there

plexus11:10:18

oh I see the released version is pretty old, let me cut a new release. At the moment you're generally best of just taking the latest commit on main

plexus11:10:26

New release:

[com.lambdaisland/witchcraft "0.3.90"]
{com.lambdaisland/witchcraft {:mvn/version "0.3.90"}}

plexus11:10:02

have you found https://github.com/lambdaisland/witchcraft-plugin as well? this is now the recommended way to get started, you can add this to any Glowstone, Spigot, or Paper server

plexus11:10:33

I think you'll need to add the Glowstone dependency as well if you want to run Glowstone from your REPL:

plexus11:10:45

net.glowstone/glowstone {:mvn/version "2021.8.0"}

plexus11:10:13

let me know if you get things running, after that you should probably just start looking at some example code. There are a few things under lambdaisland.witchcraft.gallery.*, these are "official" examples which we'll make sure remain up to date and functional. Then there's much more stuff of just me experimenting under repl_sessions, or in my own witchcraft experiments repo cauldron https://github.com/plexus/cauldron

jkent13:10:48

@plexus I appreciate the help and thanks for releasing the new version! this is my updated deps.edn, you should notice I needed to update the glowstone repo release repository to point it as releases rather than snapshots as stated in the docs

{:paths     ["src" "resources"]
 :deps      {org.clojure/clojure         {:mvn/version "1.10.3"}
             com.lambdaisland/witchcraft {:mvn/version "0.3.90"}
             net.glowstone/glowstone     {:mvn/version "2021.8.0"}}
 :mvn/repos {"glowstone-repo" {:url ""}
             "aikar"          {:url ""}}}
unfortunately, I’m now encountering an error when I require witchcraft
> (require '[lambdaisland.witchcraft :as wc]) 
WARNING: bean already refers to: #'clojure.core/bean in namespace: lambdaisland.witchcraft, being replaced by: #'lambdaisland.witchcraft.safe-bean/bean
Syntax error (ClassNotFoundException) compiling at (lambdaisland/witchcraft.clj:1:1).
org.bukkit.GameRule
I see that you now have support for starting paper as well as glowstone in the repl. do I need the paper deps too?

plexus13:10:33

no, you don't need the paper deps.

jkent13:10:02

also, it sounds like you recommend running the server outside of the repl and adding the plugin instead. I can move in that direction but I was just hoping I could get this working first

plexus13:10:46

yeah I see what's happening, haven't tested with Glowstone in a while. In principle we rely on Bukkit being a shared interface/API, but in this case I suppose Glowstone does not have all the bukkit stuff that paper has. I'll have to fix that, we should stick to the largest common denominator, and detect the rest dynamically

plexus13:10:55

or, probably more accurately this version of Glowstone does not yet have this particular Bukkit class

plexus13:10:56

if you're coming from a Clojure perspective I understand that it seems much more appealing running things inside your REPL rather than running a separate server, that was also my starting point and why I went initially with Glowstone

plexus13:10:44

but Glowstone is in this annoying limbo state where the last stable version is quite old (it's based on the Minecraft 1.12 protocol and feature set), and the newer stuff is not yet generally usable

plexus13:10:21

they have said they might have a new release towards the end of the year, but of course that could always lapse

jkent13:10:30

should I switch to running paper in the repl then?

plexus13:10:54

still, I do want to continue supporting Glowstone 1.12 until the newer stuff is ready, I'll have that fixed hopefully soonish

plexus13:10:14

you can try running paper in the REPL but honestly it's much easier to just download the server jar and drop in the plugin

plexus13:10:22

this is really the easiest least friction path

plexus13:10:38

and the most well tested one

plexus13:10:41

I don't have a ton of time right now but I may be able to put out a fix for glowstone

jkent13:10:12

awesome, I’ll try the server with the plugin approach if you dont have time to put out a fix. I really appreciate the quick responses and the help. going with the standalone server approach, which do you recommend?

plexus13:10:50

if you want to run paper inside your repl you need to run paper standalone first, have it patch the mojang jar, then take that jar and add it to your classpath. You also need to create an eula.txt to show that you agree to the eula.

plexus13:10:18

I've mostly been using PaperMC, it seems to be the most advanced/optimized of the bukkit servers

👍 1
plexus13:10:28

ok, putting out a new release which should fix glowstone support

plexus13:10:43

[com.lambdaisland/witchcraft "0.4.94"]
{com.lambdaisland/witchcraft {:mvn/version "0.4.94"}}

plexus13:10:18

please do keep us posted and share what you end up doing/creating!

jkent14:10:04

woot! I was able to get the server up with the new release!!!

jkent14:10:09

I’ll make sure to share anything I create. that creative activity will need to wait till this evening though 😉