19 August 2022

674. Suddenly can't find USB audio devices (pulseaudio, debian)

 Sometimes only the onboard audio devices show up as being available in gnomeusing pulseaudio. Your usb devices for some reason don't show up. This has occured at some very inopportune moments, such as during online teaching.


If that happens, unplug/turn off the USB device, and run

pulseaudio -k && pactl load-module module-detect

then turn on the USB device again.


It should now be found.

01 January 2022

673. "Better Minecraft [Forge]" server for version 1.16.5

In post 672 I showed how to set up a better minecraft server for version 1.18. As it turns out, if you want to play Better Minecraft you'll want version 1.16.5, since most of the mods aren't yet available for minecraft 1.18.



The instructions here are adopted and adapted from  https://minecraft.fandom.com/wiki/Tutorials/Setting_up_a_Minecraft_Forge_server

1. Download the following files and put them in an appropriate folder:

https://files.minecraftforge.net/net/minecraftforge/forge/index_1.16.5.html

https://www.curseforge.com/minecraft/modpacks/better-minecraft-modpack/files/3585404

2. Next, do the following

First install the server by running this in the terminal

java -jar forge-1.16.5-36.2.20-installer.jar --installServer

It should give output similar to this:
JVM info: Debian - 17-ea - 17-ea+19-Debian-1
java.net.preferIPv4Stack=true
Found java version 17-ea
Target Directory: .
Data kindly mirrored by CreeperHost at https://www.creeperhost.net/
Extracting main jar:
  Extracted successfully
Considering minecraft server jar
...

The server installed successfully
You can delete this installer file now if you wish

Next do this to unpack and generate the eula.txt file:
java -jar minecraft_server.1.16.5.jar
[07:39:16] [main/ERROR]: Failed to load properties from file: server.properties
[07:39:16] [main/WARN]: Failed to load eula.txt
[07:39:16] [main/INFO]: You need to agree to the EULA in order to run the server. Go to eula.txt for more info.
Edit eula.txt and change eula to true:
 eula=true
3. Launch the server
On debian 11.1 the server crashed with openjdk 11 and 17. However, it worked with openjdk 8.

Instead I launched the server with
/usr/lib/jvm/java-8-openjdk-amd64/bin/java -Xmx10G -jar forge-1.16.5-36.2.20.jar



Note that I'm dedicating 10Gb of RAM to the server (I have 32 GB). You might want/need less.



Enjoy!

22 December 2021

672. Modded minecraft server on linux (Better Minecraft [FABRIC])

My son is now of the age where he's interested in playing computer games, and minecraft is popular among his friends. But it can't just be minecraft, it has to be Better Minecraft.

Client

Since curseforge doesn't have a linux-installer, we're using GDLauncher (as an AppImage) to run the minecraft client. Once GDLauncher is running you can install an instance of Better Minecraft by clicking on the "+" in the lower left corner, and clicking onthe CurseForrge tab, and searching for Better. We're using the [FABRIC] version.



You might have to adjust the amount of RAM afforded to minecraft.

The Server:

This was a bit trickier, until I found this: https://fabricmc.net/wiki/install

Follow the instructions under 'Server (simple method)' i.e.

1. Download jar from https://fabricmc.net/use/server/ to a folder where you want your server to reside, e.g. ~/.minecraft_server

(or use
curl -OJ https://meta.fabricmc.net/v2/versions/loader/1.18.1/0.12.12/0.10.2/server/jar )

2. Run
java -Xmx2G -jar fabric-server-mc.1.18.1-loader.0.12.12-launcher.0.10.2.jar nogui

It'll fail, with a message about the EULA.

Edit eula.txt and change false to true.

3. Download Fabric API from https://www.curseforge.com/minecraft/mc-mods/fabric-api and put it in the mods folder (e.g. ~/.minecraft_server/mods)

4. Download the Better Minecraft [FABRIC] Server Pack from https://www.curseforge.com/minecraft/modpacks/better-minecraft-fabric/files/3574082

5. Move the files from the server pack to the server directory i.e. replace the mods folder, and add the config folder + the images. The instructions are otherwise in the README.txt

6. Launch the server 
java -Xmx2G -jar fabric-server-mc.1.18.1-loader.0.12.12-launcher.0.10.2.jar

7. Using GDLauncher to launch your client, then go to Multiplayer, add a server (e.g. localhost, 127.0.0.1), and hopefully it'll show up:



I think this server will be a 'normal' one with default settings i.e. NOT creative mode.

To change to creative mode follow this

a) in the server window, type /op YourName to make yourself an operator

b) then in the minecraft client, type /gamemode 1


-----------------------

The GDLauncher instance mod files are kept in ~/.local/share/gdlauncher_carbon/data/instances/Better Minecraft [FABRIC] v1/instance/mods

Sometimes you have to copy the mod files between the client and the server to make sure that all the versions are identical.