Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installer: Minecraft Pi Server #2514

Open
3 tasks done
NoozAbooz opened this issue Jan 6, 2024 · 11 comments
Open
3 tasks done

Installer: Minecraft Pi Server #2514

NoozAbooz opened this issue Jan 6, 2024 · 11 comments

Comments

@NoozAbooz
Copy link
Contributor

NoozAbooz commented Jan 6, 2024

What is the name of the app?

Minecraft Pi Server

(Optional) Where is the app hosted?

https://github.com/NoozAbooz/mcpi-reborn-extended

About the app

Dedicated server for MCPI. Continuation of #2437 since Botspot gave the go-ahead.

Upload file or Add PR Link

Minecraft Pi Server.zip

Confirmations

Copy link
Contributor

github-actions bot commented Jan 6, 2024

A zipfile was found in the body of your issue.
The sha1sum of the zip was: 981ecd40b2d4c4958cccb2373ee3734b5cb38493

Click to show contents preview

Minecraft Pi Server/install

#!/bin/bash

# https://github.com/raspberrypi/bookworm-feedback/issues/107
PAGE_SIZE="$(getconf PAGE_SIZE)"
if [[ "$PAGE_SIZE" == "16384" ]]; then
    #switch to 4K pagesize kernel
    if [ -f /boot/config.txt ]; then
        text="Raspberry Pi 5 PiOS images ship by default with a 16K PageSize Linux Kernel.
        This kernel causes incompatibilities with some software including MCPI-Reborn https://github.com/raspberrypi/bookworm-feedback/issues/107

        Would you like to automatically switch to a 4K PageSize Linux Kernel?"
        userinput_func "$text" "No, keep 16K PageSize Kernel and Exit" "Yes, switch to 4K PageSize Kernel"
        if [ "$output" == "No, keep 16K PageSize Kernel and Exit" ]; then
            error "User error: Your current running kernel is built with 16K PageSize and is incompatible with MCPI-Reborn. You must switch to a 4K PageSize kernel (and chose to not do so automatically) before installing MCPI-Reborn."
        fi
        echo "" | sudo tee --append /boot/config.txt >/dev/null
        echo "[pi5]" | sudo tee --append /boot/config.txt >/dev/null
        echo "kernel=kernel8.img" | sudo tee --append /boot/config.txt >/dev/null
        echo -e "The 4K PageSize Kernel has been enabled by adding 'kernel=kernel8.img' to /boot/config.txt\nPlease reboot and install the Minecraft Pi app again."
        sleep infinity
    else
        error "User error (reporting allowed): Your current running kernel is built with 16K PageSize and is incompatible with Minecraft Pi. Changing kernels automatically cannot be done since no /boot/config.txt file was found."
    fi
fi

# Version
version=2.5.3-1

# Install
if [ "${arch}" = "64" ]; then
    url_arch=arm64
else
    url_arch=armhf
fi
url="https://github.com/NoozAbooz/mcpi-reborn-extended/releases/download/${version}/minecraft-pi-reborn-server-${version}-${url_arch}.AppImage"

# Cleanup Old Script Versions
sudo rm -f /etc/apt/trusted.gpg.d/mcpi-revival.gpg
sudo rm -f /etc/apt/sources.list.d/mcpi-revival.list
if package_installed minecraft-pi-reborn-server ;then
  apt_lock_wait
  sudo apt-get remove -y minecraft-pi-reborn-server
fi

# Download file
mkdir -p ~/.local/mcpi-server || error "Could not make directory"
wget -O ~/.local/mcpi-server/com.nooz.MCPIRebornExtendedServer.AppImage "${url}" || error 'Failed to download AppImage'
chmod +x ~/.local/mcpi-server/com.nooz.MCPIRebornExtendedServer.AppImage

enable_module fuse || exit 1

# Make Desktop file
mkdir -p ~/.local/share/applications || error "Could not make directory"
echo "[Desktop Entry]
Name=Minecraft Pi Server
Comment=Self-hosted multiplayer server for Minecraft Pi
Icon=$(dirname "$0")/icon-64.png
StartupNotify=false
Exec=${HOME}/.local/mcpi-server/com.nooz.MCPIRebornExtendedServer.AppImage
Path=${HOME}/.local/mcpi-server/
Terminal=true
Type=Application
Categories=Game;" > ~/.local/share/applications/com.nooz.MCPIRebornExtendedServer.desktop

status_green "You might want to copy this down:
To run: Menu -> Games -> Minecraft Pi Server
- OR 'cd ~/.local/mcpi-server/ && ./com.nooz.MCPIRebornExtendedServer.AppImage'
Access your world files and configurations at '~/.local/mcpi-server/'
"

Minecraft Pi Server/credits

MCPI++ made by Nooz: https://github.com/NoozAbooz/
Ported to Pi-Apps by https://www.youtube.com/@oldspiceman2583 with modifications from Nooz

Minecraft Pi Server/website

https://github.com/NoozAbooz/mcpi-reborn-extended

Minecraft Pi Server/description

A modded dedicated server for Minecraft: Pi Edition modified to run in a headless environment.

To run: Menu -> Games -> Minecraft Pi Server
Access your world files and configurations at '~/.local/mcpi-server/'

Need help? Consider asking for support at https://discord.gg/XJJNG9jTuh

Notes:
- The server supports both vanilla and modded MCPI clients, but unmodded clients are INCOMPATIBLE if the server is in survival mode. 
- Player inventories are not saved

Minecraft Pi Server/uninstall

#!/bin/bash
rm -rf ~/.local/mcpi-server/com.nooz.MCPIRebornExtendedServer.AppImage ~/.local/share/applications/com.nooz.MCPIRebornExtendedServer.desktop

status "The server binary has been deleted, but your world data is still located at '${HOME}/.local/mcpi-server/'"

@NoozAbooz
Copy link
Contributor Author

This is currently untested FYI. I noticed in the OG pr that Botspot wanted to save files to /usr/share, but I decided to make the installer align with the formatting of the existing MCPI Client app.

@NoozAbooz NoozAbooz changed the title EDIT ME Include the app name and if it is a Package app or an Install based App Installer: Minecraft Pi Server Jan 6, 2024
@theofficialgman
Copy link
Collaborator

I noticed in the OG pr that Botspot wanted to save files to /usr/share

Yes we would like that. We are slowly trying to migrate all install scripts to perform global installation.

Copy link
Contributor

github-actions bot commented Jan 6, 2024

A zipfile was found in the body of your issue.
The sha1sum of the zip was: 58a7d39be75dd90d5c56e3661049b8fffb2f10c8

Click to show contents preview

Minecraft Pi Server/install

#!/bin/bash

# https://github.com/raspberrypi/bookworm-feedback/issues/107
PAGE_SIZE="$(getconf PAGE_SIZE)"
if [[ "$PAGE_SIZE" == "16384" ]]; then
    #switch to 4K pagesize kernel
    if [ -f /boot/config.txt ]; then
        text="Raspberry Pi 5 PiOS images ship by default with a 16K PageSize Linux Kernel.
        This kernel causes incompatibilities with some software including MCPI-Reborn https://github.com/raspberrypi/bookworm-feedback/issues/107

        Would you like to automatically switch to a 4K PageSize Linux Kernel?"
        userinput_func "$text" "No, keep 16K PageSize Kernel and Exit" "Yes, switch to 4K PageSize Kernel"
        if [ "$output" == "No, keep 16K PageSize Kernel and Exit" ]; then
            error "User error: Your current running kernel is built with 16K PageSize and is incompatible with MCPI-Reborn. You must switch to a 4K PageSize kernel (and chose to not do so automatically) before installing MCPI-Reborn."
        fi
        echo "" | sudo tee --append /boot/config.txt >/dev/null
        echo "[pi5]" | sudo tee --append /boot/config.txt >/dev/null
        echo "kernel=kernel8.img" | sudo tee --append /boot/config.txt >/dev/null
        echo -e "The 4K PageSize Kernel has been enabled by adding 'kernel=kernel8.img' to /boot/config.txt\nPlease reboot and install the Minecraft Pi app again."
        sleep infinity
    else
        error "User error (reporting allowed): Your current running kernel is built with 16K PageSize and is incompatible with Minecraft Pi. Changing kernels automatically cannot be done since no /boot/config.txt file was found."
    fi
fi

# Version
version=2.5.3-1

# Install
if [ "${arch}" = "64" ]; then
    url_arch=arm64
else
    url_arch=armhf
fi
url="https://github.com/NoozAbooz/mcpi-reborn-extended/releases/download/${version}/minecraft-pi-reborn-server-${version}-${url_arch}.AppImage"

# Cleanup Old Script Versions
sudo rm -f /etc/apt/trusted.gpg.d/mcpi-revival.gpg
sudo rm -f /etc/apt/sources.list.d/mcpi-revival.list
if package_installed minecraft-pi-reborn-server ;then
  apt_lock_wait
  sudo apt-get remove -y minecraft-pi-reborn-server
fi

# Download file
sudo mkdir -p /usr/share/mcpi-server || error "Could not make directory"
sudo wget -O /usr/share/mcpi-server/com.nooz.MCPIRebornExtendedServer.AppImage "${url}" || error 'Failed to download AppImage'
sudo chmod +x /usr/share/mcpi-server/com.nooz.MCPIRebornExtendedServer.AppImage

enable_module fuse || exit 1

# Make Desktop file
sudo mkdir -p /usr/share/applications || error "Could not make directory"
echo "[Desktop Entry]
Name=Minecraft Pi Server
Comment=Self-hosted multiplayer server for Minecraft Pi
Icon=$(dirname "$0")/icon-64.png
StartupNotify=false
Exec=/usr/share/mcpi-server/com.nooz.MCPIRebornExtendedServer.AppImage
Path=/usr/share/mcpi-server/
Terminal=true
Type=Application
Categories=Game;" | sudo tee /usr/share/applications/com.nooz.MCPIRebornExtendedServer.desktop

status_green "You might want to copy this down:
To run: Menu -> Games -> Minecraft Pi Server
- OR 'cd /usr/share/mcpi-server/ && ./com.nooz.MCPIRebornExtendedServer.AppImage'
Access your world files and configurations at '/usr/share/mcpi-server/'
The server will be accessable on port '19132'. You must forward this port in your router to allow connections from outside your network.
Inside the server console, run 'help' for a list of possible commands.
"

Minecraft Pi Server/credits

MCPI++ made by Nooz: https://github.com/NoozAbooz/
Ported to Pi-Apps by https://www.youtube.com/@oldspiceman2583 with modifications from Nooz

Minecraft Pi Server/website

https://github.com/NoozAbooz/mcpi-reborn-extended

Minecraft Pi Server/description

A modded dedicated server for Minecraft: Pi Edition modified to run in a headless environment.

To run: Menu -> Games -> Minecraft Pi Server
Access your world files and configurations at '/usr/share/mcpi-server/'. You can modify server.properties to change basic settings.
The server will be accessable on port '19132'. You must forward this port in your router to allow connections from outside your network.
Inside the server console, run 'help' for a list of possible commands.

Need help? Consider asking for support at https://discord.gg/XJJNG9jTuh

Notes:
- The server supports both vanilla and modded MCPI clients, but unmodded clients are INCOMPATIBLE if the server is in survival mode. 
- Player inventories are not saved

Minecraft Pi Server/uninstall

#!/bin/bash
sudo rm -rf /usr/share/mcpi-server/com.nooz.MCPIRebornExtendedServer.AppImage /usr/share/applications/com.nooz.MCPIRebornExtendedServer.desktop

status "The server binary has been deleted, but your world data is still located at '/usr/share/mcpi-server/'"

@theofficialgman
Copy link
Collaborator

theofficialgman commented Jan 6, 2024

@NoozAbooz Please explain in clear terms what benefits your packages offer over TheBrokenRail's minecraft-pi-reborn . To an outsider (like me) all I see is that you package as a deb the work of TheBrokenRail that officially packages as an appimage and flatpak

@NoozAbooz
Copy link
Contributor Author

@NoozAbooz Please explain in clear terms what benefits your packages offer over TheBrokenRail's minecraft-pi-reborn . To an outsider (like me) all I see is that you package as a deb the work of TheBrokenRail that officially packages as an appimage and flatpak

There's a few QoL changes listed in the readme: https://github.com/NoozAbooz/mcpi-reborn-extended?tab=readme-ov-file#feature-list-in-order-of-awesomeness. For the server software, the only major change is that it fixes an issue with playing on older world files causing disappearing blocks: NoozAbooz/mcpi-reborn-extended#39.

I only kept the download link to my repo since the original author in #2437 used it. Let me know if you want it changed to TBR's server software.

@theofficialgman
Copy link
Collaborator

theofficialgman commented Jan 6, 2024

There's a few QoL changes listed in the readme: https://github.com/NoozAbooz/mcpi-reborn-extended?tab=readme-ov-file#feature-list-in-order-of-awesomeness.

I have read the readme already. It does not describe the changes that have been made in ADDITION to those already included in TheBrokenRail's software. I am not interested in the full list of changes in reference to the ORIGINAL Minecraft Pi Edition

@NoozAbooz
Copy link
Contributor Author

NoozAbooz commented Jan 6, 2024

There's a few QoL changes listed in the readme: https://github.com/NoozAbooz/mcpi-reborn-extended?tab=readme-ov-file#feature-list-in-order-of-awesomeness.

I have read the readme already. It does not describe the changes that have been made in ADDITION to those already included in TheBrokenRail's software. I am not interested in the full list of changes in reference to the ORIGINAL Minecraft Pi Edition

Sorry, I should have made some of them more detailed. All of these are additions on top of reborn.

Add [even more] missing items to creative inventory (full set of armour, all food types, etc)
Sprinting via Ctrl key
Optifine-like zoom feature via C key
Modern 1.14+ Jappa textures from BasedSkeleton
Longer chat message length limit (512 characters)
Longer username length limit (32 characters)
Add [more] item names to hidden items
Sneaking via both the Shift and Alt keys
A custom "Cursed Chest" block for debugging
Ability to look around via arrow keys instead of mouse (useful if mouse is glitched)
Ability to also use Vim keybindings for movement (hjkl)

Of course though, these are not relevant to the current submission since they are the client modifications. Here's another version of the installer downloading from TBR's version if you want to use that instead. The icon is the same as the MCPI app.
Minecraft Pi Server.zip

Copy link
Contributor

github-actions bot commented Jan 6, 2024

A zipfile was found in the body of an issue comment.
The sha1sum of the zip was: 8a95d208742376902c97c4ec3682633979556a23

Click to show contents preview

Minecraft Pi Server/install

#!/bin/bash

# https://github.com/raspberrypi/bookworm-feedback/issues/107
PAGE_SIZE="$(getconf PAGE_SIZE)"
if [[ "$PAGE_SIZE" == "16384" ]]; then
    #switch to 4K pagesize kernel
    if [ -f /boot/config.txt ]; then
        text="Raspberry Pi 5 PiOS images ship by default with a 16K PageSize Linux Kernel.
        This kernel causes incompatibilities with some software including MCPI-Reborn https://github.com/raspberrypi/bookworm-feedback/issues/107

        Would you like to automatically switch to a 4K PageSize Linux Kernel?"
        userinput_func "$text" "No, keep 16K PageSize Kernel and Exit" "Yes, switch to 4K PageSize Kernel"
        if [ "$output" == "No, keep 16K PageSize Kernel and Exit" ]; then
            error "User error: Your current running kernel is built with 16K PageSize and is incompatible with MCPI-Reborn. You must switch to a 4K PageSize kernel (and chose to not do so automatically) before installing MCPI-Reborn."
        fi
        echo "" | sudo tee --append /boot/config.txt >/dev/null
        echo "[pi5]" | sudo tee --append /boot/config.txt >/dev/null
        echo "kernel=kernel8.img" | sudo tee --append /boot/config.txt >/dev/null
        echo -e "The 4K PageSize Kernel has been enabled by adding 'kernel=kernel8.img' to /boot/config.txt\nPlease reboot and install the Minecraft Pi app again."
        sleep infinity
    else
        error "User error (reporting allowed): Your current running kernel is built with 16K PageSize and is incompatible with Minecraft Pi. Changing kernels automatically cannot be done since no /boot/config.txt file was found."
    fi
fi

# Version
version=2.5.3

# Install
if [ "${arch}" = "64" ]; then
    url_arch=arm64
else
    url_arch=armhf
fi
url="https://gitea.thebrokenrail.com/minecraft-pi-reborn/minecraft-pi-reborn/releases/download/${version}/minecraft-pi-reborn-server-${version}-${url_arch}.AppImage"

# Cleanup Old Script Versions
sudo rm -f /etc/apt/trusted.gpg.d/mcpi-revival.gpg
sudo rm -f /etc/apt/sources.list.d/mcpi-revival.list
if package_installed minecraft-pi-reborn-server ;then
  apt_lock_wait
  sudo apt-get remove -y minecraft-pi-reborn-server
fi

# Download file
sudo mkdir -p /usr/share/mcpi-server || error "Could not make directory"
sudo wget -O /usr/share/mcpi-server/com.thebrokenrail.MCPIRebornServer.AppImage "${url}" || error 'Failed to download AppImage'
sudo chmod +x /usr/share/mcpi-server/com.thebrokenrail.MCPIRebornServer.AppImage

enable_module fuse || exit 1

# Make Desktop file
sudo mkdir -p /usr/share/applications || error "Could not make directory"
echo "[Desktop Entry]
Name=Minecraft Pi Server
Comment=Self-hosted multiplayer server for Minecraft Pi
Icon=$(dirname "$0")/icon-64.png
StartupNotify=false
Exec=/usr/share/mcpi-server/com.thebrokenrail.MCPIRebornServer.AppImage
Path=/usr/share/mcpi-server/
Terminal=true
Type=Application
Categories=Game;" | sudo tee /usr/share/applications/com.thebrokenrail.MCPIRebornServer.desktop

status_green "You might want to copy this down:
To run: Menu -> Games -> Minecraft Pi Server
- OR 'cd /usr/share/mcpi-server/ && ./com.thebrokenrail.MCPIRebornServer.AppImage'
Access your world files and configurations at '/usr/share/mcpi-server/'
The server will be accessable on port '19132'. You must forward this port in your router to allow connections from outside your network.
Inside the server console, run 'help' for a list of possible commands.
"

Minecraft Pi Server/credits

MCPI++ made by Nooz: https://github.com/NoozAbooz/
Ported to Pi-Apps by https://www.youtube.com/@oldspiceman2583 with modifications from Nooz

Minecraft Pi Server/website

https://discord.com/invite/aDqejQGMMy

Minecraft Pi Server/description

A modded dedicated server for Minecraft: Pi Edition modified to run in a headless environment.

To run: Menu -> Games -> Minecraft Pi Server
Access your world files and configurations at '/usr/share/mcpi-server/'. You can modify server.properties to change basic settings.
The server will be accessable on port '19132'. You must forward this port in your router to allow connections from outside your network.
Inside the server console, run 'help' for a list of possible commands.

Need help? Consider asking for support at https://discord.com/invite/aDqejQGMMy

Notes:
- The server supports both vanilla and modded MCPI clients, but unmodded clients are INCOMPATIBLE if the server is in survival mode. 
- Player inventories are not saved

Minecraft Pi Server/uninstall

#!/bin/bash
sudo rm -rf /usr/share/mcpi-server/com.thebrokenrail.MCPIRebornServer.AppImage /usr/share/applications/com.thebrokenrail.MCPIRebornServer.desktop

status "The server binary has been deleted, but your world data is still located at '/usr/share/mcpi-server/'"

@theofficialgman
Copy link
Collaborator

@NoozAbooz I am currently leaning towards TBR's version to match the current client available via pi-apps already.

In your personal opinion do you see any reason that a user would want to have both TBR's and your version installed? I am considering having both in pi-apps and am debating whether they should be separate apps or one app where a userinput prompt asks the user which one they would like to install. If we choose to do separate apps I think we need to rename the current application to better describe what it is. My current thinking of the following names to actually match the project names.

for the clients:
Minecraft Pi Reborn
Minecraft Pi Reborn Extended

for the servers:
Minecraft Pi Reborn Server
Minecraft Pi Reborn Extended Server

additionally I will add a subfolder Games/Minecraft Pi that these will reside in so it does not increase the length of the Games folder.

@NoozAbooz
Copy link
Contributor Author

Unless it's a MCPI dev, most users shouldn't have two versions installed at once. The naming seems fine, though it seems a little long. MInecraft Pi Reborn++/Minecraft Pi Reborn++ Server could also work as an alternative if you would like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants