Offline download templates

This commit is contained in:
catfoolyou 2025-03-06 13:22:07 -05:00
parent 174ace5a99
commit 5c125b1bf4
8 changed files with 32449 additions and 32339 deletions

2
.gitignore vendored
View File

@ -1,4 +1,4 @@
bin/ bin/
.gradle/ .gradle/
build/ build/
mp-server/bukkit-command/ javascript/Eaglercraft_1.6.4_Offline.html

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" /> <component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_18" default="true" project-jdk-name="corretto-18" project-jdk-type="JavaSDK" /> <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="corretto-18" project-jdk-type="JavaSDK" />
</project> </project>

2
MakeOfflineDownload.sh Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
java -cp "lwjgl-rundir/MakeOfflineDownload.jar:desktopRuntime/CompileEPK.jar" net.lax1dude.eaglercraft.v1_8.buildtools.workspace.MakeOfflineDownload "javascript/OfflineDownloadTemplate.txt" "javascript/classes.js" "javascript/assets.epk" "javascript/Eaglercraft_1.6.4_Offline.html" "javascript/lang"

131
README.md
View File

@ -15,62 +15,42 @@ You're pretty much Shit Outta Luck if you're on a chromebook though.
## Issues? ## Issues?
I got tired of closing duplicate 'how to maek sever' issues almost every day so I disabled it because honestly I don't really care anymore, [join discord](https://discord.gg/Ekzcgs3DKZ) if you've got an issue to report that you are confident can be backed up with source code I got tired of closing duplicate 'how to maek sever' issues almost every day so I disabled it because honestly I don't really care anymore, find me on the Eagler discord and ping me if you've got an issue to report that you are confident can be backed up with source code
## How to make a server ## How to make a server
There are ***multiple parts*** **to a server**, mainly consisting of a **regular 1.5.2 Bukkit server**, and a **modified version of Bungeecord** called **EaglercraftBungee**, which on top of the regular Bungeecord functionality, it translates WebSocket connections to raw TCP connections which Bukkit can understand.
You may also want to set up your own **client**, allowing you to *control default server listings, resource packs, and an overall faster connection due to less load.*
If you want to use a domain for your server, **a reverse proxy** can be set up to enable extra functionality within EaglercraftBungee. **NGINX** is recommended, and a tutorial is included **[here](#Creating-a-Reverse-Proxy---NGINX)**. **This is optional, and can be skipped by just connecting with the IP.**
### If Gitpod/Github Codespaces are acceptable, you can use this: ### If Gitpod/Github Codespaces are acceptable, you can use this:
### [https://github.com/catfoolyou/Eagler-Server-1.6.4](https://github.com/catfoolyou/Eagler-Server-1.6.4) ### [https://github.com/catfoolyou/Eagler-Server-1.6.4](https://github.com/catfoolyou/Eagler-Server-1.6.4)
## Creating a server - Bukkit
1. **Check if Java is installed.** You can download it from [https://www.java.com/en/download/](https://www.java.com/en/download/) 1. **Check if Java is installed.** You can download it from [https://www.java.com/en/download/](https://www.java.com/en/download/)
2. Download the [mp-server.zip](https://github.com/catfoolyou/Project164/blob/main/mp-server.zip) file from this repository 2. Download the [mp-server.zip](https://github.com/catfoolyou/Project164/raw/main/mp-server.zip) file from this repository
4. Extract the ZIP file you downloaded to a new folder 4. Extract the ZIP file you downloaded to a new folder
5. Open the new folder, go into the `java/bungee_command` folder 5. Open the new folder, go into the `java/bukkit_command` folder
6. In Windows, double-click `run.bat`. It should open a new terminal window 6. Open a new terminal and run `java -jar craftbukkit-1.6.4-R2.0.jar` to start the bukkit server
![run.bat](https://i.gyazo.com/2b0f6b3e5b2e5a5a102c62ea5b6fba3f.png) 7. To add some bukkit plugins, download the plugin's JAR file for CraftBukkit 1.6.4 and place it in `java/bukkit_command/plugins`
**Some computers may just say 'run' instead of 'run.bat', both are correct** (See [https://github.com/lax1dude/eaglercraft-plugins/](https://github.com/lax1dude/eaglercraft-plugins/) to download some supported plugins)
7. On macOS or Linux, google how to open the terminal and use the `cd` command to navigate to `java/bungee_command`
Then, in that folder, run `chmod +x run_unix.sh` and then run `./run_unix.sh`. It should start the same server
8. Go to the other `java/bukkit_command` folder that was also extracted from the ZIP
9. On Windows, open a second terminal window and run `java -jar craftbukkit-1.6.4-R2.0.jar`
Keep both the first and second terminal window you opened, just minimize them don't close
10. On macOS or Linux, repeat step 7 and run the same command
11. **Your server is now ready.** Download and open [stable-download/Offline_Download_Version.html](https://github.com/catfoolyou/Project164/raw/main/stable-download/Offline_Download_Version.html)
12. Go to 'Multiplayer' from the main menu. Select 'Direct Connect', type `127.0.0.1:25565` and press 'Join Server'
13. **It should allow you to connect, if not, check the two terminal windows for errors**
14. If you are okay with regularly checking for updates to [Offline_Download_Version.html](https://github.com/catfoolyou/Project164/raw/main/stable-download/Offline_Download_Version.html), you are now finished
15. If you are playing with friends and want a shared website that can be updated, see the `stable-download/web` folder
16. To install, create a website and upload the contents of `stable-download/web` to the URL you want to have Eaglercraft on
17. **The 'web' folder will not work if you open it in your browser locally! If you see 'file:///' in the URL you are doing it wrong. You need to upload the folder to an HTTP or HTTPS server and access it over the internet via http:// or https://. The game will not load otherwise, this is not a bug**
18. To modify the list of default servers, modify the `window.eaglercraftOpts` variable in `index.html`.
19. **A full guide on how to configure `eaglercraftOpts` is coming soon, but it should be fairly intuitive to figure out how to set it up based on what the default values already are when you look in stable-download**
20. **To create a link to your site that automatically joins the server,** add a `?server=` variable to the URL, like (for example): [https://g.deev.is/eaglercraft/?server=127.0.0.1:25565](https://g.deev.is/eaglercraft/?server=127.0.0.1:25565) will automatically join `ws://127.0.0.1:25565/` as soon as the player finishes setting their username and skin
21. To change your server's MOTD and icon, edit the `motd1:` tag of the listener config in `java/bungee_command/config.yml`, and replace `server-icon.png` in the folder where the config file is. Use `&` to add color/formatting codes. The server list will downscale your icon to 64x64 pixels
22. You can give your MOTD multiple lines, add a `motd2:` to define a second line
23. **For an animated MOTD and icon, install EaglerMOTD: [https://github.com/lax1dude/eaglercraft-motd/](https://github.com/lax1dude/eaglercraft-motd/)**
24. To add some bukkit plugins, download the plugin's JAR file for CraftBukkit 1.6.4 and place it in `java/bukkit_command/plugins`
25. To add some bungee plugins, download the plugin's JAR file and place it in `java/bungee_command/plugins`
26. See [https://github.com/lax1dude/eaglercraft-plugins/](https://github.com/lax1dude/eaglercraft-plugins/) to download some supported plugins
27. **To disable voice chat, set `voice_enabled: false` in the bungeecord config.yml**
28. To add `/login` and `/register`, install [AuthMe](https://github.com/lax1dude/eaglercraft-plugins/tree/main/AuthMe) and carefully [read it's documentation](https://github.com/AuthMe/AuthMeReloaded/wiki) to set it up correctly
29. **To ban a username on Eaglercraftbungee, use:** `eag-ban <username>`
30. **To ban an IP on Eaglercraftbungee, use:** `eag-ban-ip <ip>`, or `eag-ban-ip <name>` to ban the IP of a player automatically
31. To ban a range of IP addresses, use slash notation to define a subnet. Example: `eag-ban-ip 192.168.0.0/8`
32. To ban users by wildcard (\*) use: `eag-ban-wildcard <text>*` or `eag-ban-wildcard *<text>` or `eag-ban-wildcard *<text>*`
33. **You can edit bans.txt in your EaglercraftBungee folder, the server automatically reloads the file when it is saved**
34. To ban users by regular expression, use: `eag-ban-regex <regex>` with a regular expression to match the username in **lowercase**
35. **If you use /op on your server, keep in mind that if you "/op LAX1DUDE", a player joining as 'laX1DUDE' or 'LaX1dUdE' or 'lax1dude' will all have /op too. To solve this problem, force all operators to only be able to join with all lowercase ('lax1dude') letters in their usernames by moving 'BitchFilterPlugin.jar" into "java/bukkit_command/plugins" and then register every op username lowercase**
36. To connect to your server through a `ws://` or `wss://` URL instead of `ip:port`, set up [nginx](https://nginx.org/) as a reverse proxy to the `ip:port` of you EaglercraftBungee server you want the URL to connect to. Use a location URL template with the `proxy_pass` directive.
37. Eaglercraft uses port 80 for IP connections by default, typing `127.0.0.1` is the same as typing `ws://127.0.0.1:80/`
38. To forward a client's remote IP address from a request on nginx to EaglercraftBungee for enforcing IP bans, set the `X-Real-IP` header on the request to websocket when it is proxied
39. To make a custom resource pack for your site, clone this repository and edit the files in [lwjgl-rundir/resources](https://github.com/catfoolyou/Project164/tree/main/lwjgl-rundir/resources).
40. When you are done, navigate to [epkcompiler/](https://github.com/catfoolyou/Project164/blob/main/CompilePackage.jar) and double-click `run.bat`. Wait for the window to say `Press any key to continue...` and close it. Then, go to `../javascript` in the repository and copy `javascript/assets.epk` to the `assets.epk` on your website
41. If you're on mac or linux, run `chmod +x CompileEPK.sh` and then `./CompileEPK.sh` to do this, then copy the same `javascript/assets.epk` to the `assets.epk` on your website
## EaglercraftBungee ## Creating a server - EaglercraftBungee
1. In the same new folder, go into the `java/bungee_command` folder
2. In Windows, double-click `run.bat`. It should open a second terminal window
Keep both the first and second terminal window you opened, just minimize them, don't close
3. On macOS or Linux, repeat step 7 in [Creating a Server - Bukkit](#Creating-a-server---Bukkit), but navigate to `java/bungee_command` this time
4. To add some bungee plugins, download the plugin's JAR file and place it in `java/bungee_command/plugins`
There are alot more configurations in bungeecord, but this should set you up
**Your server is now ready.** Visit any client, and go to 'Multiplayer' from the main menu. Select 'Direct Connect', type `ws://127.0.0.1:25565` and press 'Join Server'
**It should allow you to connect, if not, check the two terminal windows for errors**
EaglercraftBungee translates WebSockets to a raw Minecraft 1.6.4 TCP connection. It is just regular BungeeCord with more `config.yml` options, and a built in plugin for syncing people's custom skins between clients so people can see each other's skins
### If voice chat causes moderation problems, set `voice_enabled: false` in config.yml ### If voice chat causes moderation problems, set `voice_enabled: false` in config.yml
@ -194,6 +174,57 @@ test:
In this example, sending a player to the server `test`, such as when they enter a portal or type `/server test`, will trigger their client to disconnect from your bungeecord and then automatically reconnect to `wss://ServerHere/` as if it was entered via "Direct Connect" In this example, sending a player to the server `test`, such as when they enter a portal or type `/server test`, will trigger their client to disconnect from your bungeecord and then automatically reconnect to `wss://ServerHere/` as if it was entered via "Direct Connect"
## Creating a Reverse Proxy - NGINX
Here is a quick crash course of setting up NGINX on Linux, specifically on Debian distributions.
Here are some google searches for other distributions:
- [Windows](https://www.google.com/search?q=set+up+nginx+on+windows)
- [Mac](https://www.google.com/search?q=set+up+nginx+on+mac)
- [Linux - Arch](https://www.google.com/search?q=set+up+nginx+on+arch)
- [Linux - Fedora](https://www.google.com/search?q=set+up+nginx+on+fedora)
1. Open up your terminal, and run
``sudo apt update``
and
``sudo apt install nginx``
2. Open any web browser, and search for `localhost` in your search bar. You should see something like this:![Welcome to nginx](https://ubuntucommunity.s3.dualstack.us-east-2.amazonaws.com/optimized/2X/7/7504d83a9fe8c09d861b2f7c49e144ac773f0c0d_2_690x288.png)
3. Navigate to NGINX's configuration with `cd /etc/nginx/sites-enabled`.
4. Create a new configuration file with your domain name, for example `nano eaglercraft.example.com`
5. Paste in the following code into the file. Replace `example.com` with your own domain, and `app_server_address` as the `ip:port` of your EaglercraftBungee server you want the URL to connect to.
```
server {
listen 80;
listen [::]:80;
server_name example.com eaglercraft.example.com;
location / {
proxy_pass app_server_address;
include proxy_params;
}
}
```
6. Now, restart NGINX with `sudo service nginx restart` and you should be good to go!
## NGINX Configuration
### To implement the following configuration, add the lines below the `proxy_pass` line.
- **To stop people from using bookmarklets to load a client from a different URL onto your official URL via XXS, add these headers to NGINX:**
```
add_header X-Frame-Options "SAMEORIGIN";
add_header Referrer-Policy "strict-origin";
add_header X-XSS-Protection "1; mode=block";
add_header Content-Security-Policy "default-src 'self' 'unsafe-inline'; img-src 'self' 'unsafe-inline' data: blob:; connect-src 'self' ws: wss:; upgrade-insecure-requests";
```
- **To use IP bans and rate limiting, add `proxy_set_header X-Real-IP $remote_addr` to your proxy configuration**
### Plugin Development ### Plugin Development
**To develop a plugin, download [stable-download/java/bungee_command/bungee_dist.jar](https://github.com/lax1dude/eaglercraft/blob/main/stable-download/java/bungee_command/bungee-dist.jar) and add it to the Build Path of your Java IDE. Develop the plugin just like a regular BungeeCord plugin, see [EaglerMOTD](https://github.com/lax1dude/eaglercraft-motd/) for an example.** **To develop a plugin, download [stable-download/java/bungee_command/bungee_dist.jar](https://github.com/lax1dude/eaglercraft/blob/main/stable-download/java/bungee_command/bungee-dist.jar) and add it to the Build Path of your Java IDE. Develop the plugin just like a regular BungeeCord plugin, see [EaglerMOTD](https://github.com/lax1dude/eaglercraft-motd/) for an example.**
@ -208,16 +239,6 @@ In this example, sending a player to the server `test`, such as when they enter
**Register event handlers using the standard BungeeCord** `@EventHandler` **annotation in your** `Listener` **class** **Register event handlers using the standard BungeeCord** `@EventHandler` **annotation in your** `Listener` **class**
## Hosting a LAN server relay
### Simply download [stable-download/sp-relay.jar](https://github.com/lax1dude/eaglercraft/blob/main/stable-download/sp-relay.jar) and run `java -jar sp-relay.jar`
**Run `java -jar sp-relay.jar --debug` to view debug info like all the IPs of incoming connections, as it is not shown by default because logging all that info will reduce performance when the relay is being pinged many times a second depending on it's popularity.**
Edit the `relayConfig.ini` file generated on first launch to change the port and configure ratelimiting and such, and `relays.txt` to change the list of STUN and TURN relays reported to clients connecting to the relay, which are required to correctly establish a P2P LAN world connection in browsers
**The `origin-whitelist` config variable is a semicolon (`;`) seperated list of domains used to restrict what sites are to be allowed to use your relay. When left blank it allows all sites. Add `offline` to allow offline download clients to use your relay as well, and `null` to allow connections that do not specify an `Origin:` header. Use `*` as a wildcard, for example: `*.deev.is` allows all domains ending with "deev.is" to use the relay.**
## Compiling ## Compiling
To compile for the web, run the gradle 'generateJavascript' compile target to generate the classes.js file. To compile for the web, run the gradle 'generateJavascript' compile target to generate the classes.js file.

View File

@ -0,0 +1,87 @@
<!DOCTYPE html>
<!--
This file is from ${date}, there is no official eagler download link anymore, check the websites and discords of your favorite eagler servers for new versions
Be aware that some server owners are lazy and do not update their client regularly
-->
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Eaglercraft 1.6.4 Offline" />
<meta name="keywords" content="eaglercraft, catfoolyou, minecraft, lax1dude, 1.6.4" />
<title>Eaglercraft 1.6.4</title>
<meta property="og:locale" content="en-US" />
<meta property="og:type" content="website" />
<meta property="og:title" content="Eaglercraft 1.6.4 Offline" />
<meta property="og:description" content="this file is not a website, whoever uploaded it to this URL is a dumbass" />
<script type="text/javascript">
"use strict";
// %%%%%%%%% launch options %%%%%%%%%%%%
window.eaglercraftOpts = { container: "game_frame",
servers: [
{ serverName: "Local Test Server", serverAddress: "ws://localhost:25565", hideAddress: false },
{ serverName: "Minecraft Server", serverAddress: "wss://cautious-space-succotash-9g979vrp769cx655-25565.app.github.dev", hideAddress: false },
{ serverName: "Ayunboom", serverAddress: "wss://sus.shhnowisnottheti.me", hideAddress: false },
{ serverName: "Minecraft Server", serverAddress: "wss://25565-catfoolyou-eaglerserver-gyqthgj2gr2.ws-us114.gitpod.io", hideAddress: false },
{ serverName: "Minecraft Server", serverAddress: "wss://25565-catfoolyou-eaglerserver-500q8txwzw3.ws-us114.gitpod.io", hideAddress: false },
{ serverName: "Minecraft Server", serverAddress: "wss://25565-catfoolyou-eaglerserver-500q8txwzw3.ws-us110.gitpod.io", hideAddress: false }
]
};
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
${classes_js}
window.eaglercraftOpts.assetsURI = ${assets_epk};
var launchInterval = -1;
var launchCounter = 1;
var launchCountdownNumberElement = null;
var launchCountdownProgressElement = null;
function launchTick() {
launchCountdownNumberElement.innerText = "" + Math.floor(6.0 - launchCounter * 0.06);
launchCountdownProgressElement.style.width = "" + launchCounter + "%";
if(++launchCounter > 100) {
clearInterval(launchInterval);
setTimeout(() => { document.getElementById("launch_countdown_screen").remove(); main(); }, 50);
}
}
window.addEventListener("load", () => {
launchCountdownNumberElement = document.getElementById("launchCountdownNumber");
launchCountdownProgressElement = document.getElementById("launchCountdownProgress");
launchInterval = setInterval(launchTick, 50);
});
</script>
<link type="image/png" rel="shortcut icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAFiUAABYlAUlSJPAAAAR/SURBVEhLtZXZK3ZRFMYPcqXc+gv413DHxVuGIpIhkciQWaRccCNjSCkligwXSOZ5nmfv9zvn2e8+58V753sudmuvvdZ61l5r7XOc8H+GS/D19aUNkPz5+aktQH5/f//4+LBKZKuRk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L6gXEzINk5vCBQJ9rMD4+rkA8QNK036uDg4Py8vLu7m680KjIBNR3zBDoWQM1g98snyB+VSoRW8C/UwR81/SvhgNj9JOTkwwVERUdRBEI0BAdLRVERkhLS8vIyEDQlrsTPTU1lVFhKxARvZgUlFLbegCf4BvIsbi4mIg4E5EogIHhiKCMtU0WUFiVy06j5fAJIDdSBDQw+PegDfBRcbOPwH4F9LuFWIIQdQNKwWqzIE0aoFUaBsw+SQuFw0uNtC9A+F4i3QNrbg3IDn+SAsHh+wYiEpeyBEMLv/cAO6KzAijxxB+Y4wisBhssJUhjEbPJf4Nw+B+JXqLW3bw+wQAAAABJRU5ErkJggg==" />
</head>
<body style="margin:0px;width:100vw;height:100vh;overflow:hidden;" id="game_frame">
<div style="margin:0px;width:100%;height:100%;font-family:sans-serif;display:flex;align-items:center;user-select:none;" id="launch_countdown_screen">
<div style="margin:auto;text-align:center;">
<h1>This file is from <span style="color:#AA0000;">${date}</span></h1>
<h2>Game will launch in <span id="launchCountdownNumber">5</span>...</h2>
<div style="border:2px solid black;width:100%;height:15px;padding:1px;margin-bottom:20vh;"><div id="launchCountdownProgress" style="background-color:#555555;width:0%;height:100%;"></div></div>
</div>
</div>
</body>
</html>
<!-- lax1dude was here -->

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

Binary file not shown.