22w22a first open-source release

This commit is contained in:
LAX1DUDE 2022-06-05 02:48:25 -07:00
parent 2640c2b045
commit b98c1a416d
18 changed files with 173594 additions and 10032 deletions

139
README.md
View File

@ -1,4 +1,137 @@
# eaglercraft-beta # Eaglercraft Beta Singleplayer
Eaglercraft for Minecraft Beta 1.3 (currently incomplete)
Do not ask for snapshot builds **A version of Eaglercraft with both singleplayer and multiplayer. Based on Minecraft Beta 1.3, you can play singleplayer and multiplayer in any web browser and your worlds will be saved to your browser's local storage. Works on all chromebooks, you can export and import your worlds to make backups or move worlds to a different computer.**
![Eaglercraft Singleplayer Minecraft Beta 1.3 in browser](https://media.discordapp.net/attachments/378764518081429506/982903386380853258/screenshot_singleplayer_small.png)
### Official Demo URL: [https://g.eags.us/eaglercraft/beta/](https://g.eags.us/eaglercraft/beta/)
### Download locally: [Singleplayer_Offline_Download_Version.html](https://github.com/LAX1DUDE/eaglercraft-beta/blob/main/stable-download/Singleplayer_Offline_Download_Version.html)
**Host the singleplayer client: [singleplayer-download.zip](https://github.com/LAX1DUDE/eaglercraft-beta/blob/main/stable-download/singleplayer-download.zip)**
**Host singleplayer and multiplayer: [multiplayer-download.zip](https://github.com/LAX1DUDE/eaglercraft-beta/blob/main/stable-download/multiplayer-download.zip)**
## Technical Details
**Discord server: [https://discord.gg/KMQW9Uvjyq](https://discord.gg/KMQW9Uvjyq)**
The game saves worlds to your browser's persistent local storage via [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API), the vanilla MCRegion chunk loader has been rewritten to store chunks as single files instead, without compression to speed up load and save times. These files are then stored in an IndexedDB table in the browser's local storage as ArrayBuffers with string keys describing the coordinates of the chunk.
This is done because there is no efficient way to emulate a `java.nio.RandomAccessFile` using IndexedDB. Browser already implement IndexedDB using a storage system similar to MCRegion by default, which will group many small objects together into single large files. Therefore storing each chunk as a single virtual file in IndexedDB will not cause the severe fragmentation issues and folder lag like the original Minecraft Classic chunk storage did.
### A list of item, block, and entity IDs can be found here: [ITEM-IDs.md](https://github.com/LAX1DUDE/eaglercraft-beta/blob/main/ITEM-IDs.md)
**Singleplayer Commands:**
- `/help` list all available commands
- `/give` spawn an item or block by id
- `/summon` spawn an entity by id
- `/time` change the world time
## Compiling
Like the 1.5.2 Eaglercraft, just import this entire repository as a gradle project and use the **teavmc** gradle task. It will generate a `classes.js` in the `javascript` folder of this repository.
To change any textures and stuff, make your changes in `lwjgl-rundir/resources` and then run `epkcompiler/run.bat` to generate a new `assets.epk` in the `javascript` folder where `classes.js` is. On linux/mac, open terminal and type `chmod +x run_unix.sh` and then `./run_unix.sh` to run the tool. Copy the new `javascript/assets.epk` onto your website over the old one to update it.
**Make sure you install java and add it to your PATH, or these scripts will not work.**
To compile the server, read the [readme.txt](https://github.com/LAX1DUDE/eaglercraft-beta/blob/main/bukkit/readme.txt) in the `bukkit` folder.
**To run the desktop java runtime**, create a new java project in an IDE. Link `src/main/java` and `src/lwjgl/java` as source folders, and add all jars in the `lwjgl-rundir` folder to your build path. Create a run configuration and set the main class to `net.lax1dude.eaglercraft.MinecraftMain`, and then set the working directory to `lwjgl-rundir`. The client should then launch with no errors, if not then re-read the previous two sentances and try again.
## Issues
Issues are disabled due to spam, you can just use common sense to solve most gameplay issues.
**Be aware this is an old version of Minecraft, many features in the 1.5.2 client did not exist yet in beta 1.3. If you believe a feature is missing, there is an 11 out of 10 chance that it isn't in vanilla minecraft beta 1.3 either.**
Minecraft beta has no sprinting, and hunger did not exist until beta 1.8 either. **To exit a boat or minecart**, you just right click the entity again the same way you did to enter it. **DO NOT ASK FOR THESE FEATURES TO BE ADDED**, this is supposed to be a 1:1 port of minecraft beta, if you want a feature that does not already exist natively in vanilla beta 1.3 then just play the 1.5.2 client instead.
**Nether portals are not supported in multiplayer, Notch didn't figure that out until beta 1.6.**
If you're genuinely stuck then join **[https://discord.gg/KMQW9Uvjyq](https://discord.gg/KMQW9Uvjyq)**
## Server Setup Guide
### DON'T HOST A PUBLIC SERVER! - [https://youtu.be/7qWNM0MMV1g](https://youtu.be/7qWNM0MMV1g)
**There is a password system built directly into the 'Multiplayer' screen of the main menu, which is enabled on all servers by default.**
### Steps:
1. **Make sure java is installed and on your system PATH**
2. Download and extract **[multiplayer-download.zip](https://github.com/LAX1DUDE/eaglercraft-beta/blob/main/stable-download/multiplayer-download.zip)** to a new folder
3. Go in the `server` folder
4. If on windows, double click `run.bat`
5. If on mac or linux, open terminal and run `chmod +x run_unix.sh`, and then `./run_unix.sh`
6. **Use the console to set passwords for all of your and your friends' usernames:**
- `set-password <username> <password> never`
**To set a temporary password that will expire, use this syntax:**
- `set-password <username> <password> [expires][s|m|h|d|w]`
**Examples:**
- `set-password lax1dude lax123 7d`
- `set-password ayonull shit 24h`
- `set-password ayunami2000 fard 30m`
**YOU WILL NOT BE ABLE TO JOIN THE SERVER WITHOUT A PASSWORD BY DEFAULT!**
**To change this behavior, edit `eagler.yml` in the `server` folder.**
7. Launch the **[offline download version](https://github.com/LAX1DUDE/eaglercraft-beta/blob/main/stable-download/Singleplayer_Offline_Download_Version.html)** from this repository and then set your username to the username you used with `set-password` on in the previous step
8. Click 'Multiplayer' on the main menu, enter `127.0.0.1:25565` as the server address, and then enter the password you set on your username in Step 6.
9. Click 'Connect', you should be able to join the server. If not, check that the `run.bat` window is still open, and that you entered the correct username and password that you used with `set-password` on Step 6.
10. **If you're okay checking for regular updates to the offline download version [here](https://github.com/LAX1DUDE/eaglercraft-beta/blob/main/stable-download/Singleplayer_Offline_Download_Version.html), or using [https://g.eags.us/eaglercraft/beta/](https://g.eags.us/eaglercraft/beta/) for WSS connections, you are now finished. Look up a guide on google to figure out how to port forward 25565 on your router to play from outside of your local network.**
11. **If you want to host your own web site with the client too, upload the contents of the `web` folder from the zip file you downloaded in Step 2 onto your website. If the website is HTTPS then the client will only be able to connect to a server running on WSS.**
12. **To get WSS, buy a domain and install nginx on your server as a reverse proxy with an SSL certificate for the domain**
13. To make your client auto connect to your server, put the `?server=<your server's ip>` parameter in the URL to your site
14. To make your client auto connect to your server without any changes to the URL, edit `web/index.html`:
**Replace this:**
```javascript
window.minecraftOpts = ["game_frame","assets.epk"];
(function(){
var q = window.location.search;
if(typeof q === 'string' && q.startsWith("?")) {
q = new URLSearchParams(q);
var s = q.get("server");
if(s) window.minecraftOpts.push(s);
}:
```
**With this:**
```javascript
window.minecraftOpts = ["game_frame","assets.epk","<your server's ip>"];
```
Replace `<your server's ip>` with the IP to your server. This will make the client directly open the connect screen once you're done editing your profile, with the IP address specified in this code autofilled in the address text field.
15. **To change your textures, make your changes in `lwjgl-rundir/resources` and then run `epkcompiler/run.bat` to generate a new `assets.epk` in the `javascript` folder where `classes.js` is. On linux/mac, open terminal and type `chmod +x run_unix.sh` and then `./run_unix.sh` to run the tool. Copy the new `javascript/assets.epk` onto your website over the old one to update it.**
## Password System
**Edit `server/eagler.yml` to reconfigure or disable the password system.**
**To configure your server not to require a password by default, but then allow users to run `/register-password` to set a password only on their specific username, edit these options in `eagler.yml` to be these values:**
```yaml
only_allow_registered_users_to_login: false
allow_self_registration: true
```
**Passwords are stored in `passDB.dat` in your server's folder, they are encrypted and cannot be decrypted without a supercomputer. If you lose a password then just use `set-password` again from your server's console or by joining the server with an account that has `/op`.**
**Use `clear-password` to remove a password from a username**
**There's no permission system support for these commands if such a thing even exists for beta 1.3, so you are limited to just using `/op` and `eagler.yml` to control which commands users should have access to.**
## Contributing
All I really have to say is, tabs not spaces, and format the code to be like the eclipse auto format tool on factory settings, but also run-on lines of code long enough to go off the screen and single line if statements and other format violations in that category are welcome if it helps enhance the contrast between the less important code and the more important code in a file. Don't commit changes to `javascript/classes.js` or `javascript/assets.epk` or anything in `stable-download/`. I'll recompile those myself when I merge the pull request.

View File

@ -37,7 +37,7 @@ dependencies {
teavm { teavm {
compileScopes = null; compileScopes = null;
minifying = true; minifying = false;
maxTopLevelNames = 10000; maxTopLevelNames = 10000;
properties = null; properties = null;
debugInformationGenerated = false; debugInformationGenerated = false;

View File

@ -12,6 +12,7 @@ public class CommandSetPassword extends EaglerCommand {
public CommandSetPassword() { public CommandSetPassword() {
super("set-password"); super("set-password");
setNeedsOp(true);
setAliases(Arrays.asList("set-pass")); setAliases(Arrays.asList("set-pass"));
setTooltip("Sets a password on a username for Eaglercraft connections"); setTooltip("Sets a password on a username for Eaglercraft connections");
setUsage("/set-password <username> <password> [expires][s|m|h|d|w]"); setUsage("/set-password <username> <password> [expires][s|m|h|d|w]");

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -0,0 +1,11 @@
enable_password_logins: true
only_allow_registered_users_to_login: true
allow_passwords_without_expiration: true
allow_self_registration: false
allow_self_registration_without_expiration: false
allow_self_change_password: true
allow_self_renew_password: true
allow_self_change_password_expiration: false
allow_self_delete_password: false
default_password_expire_time_seconds: 604800
maximum_password_expire_time_seconds: 1814400

Binary file not shown.

View File

@ -0,0 +1,3 @@
@echo off
java -Xmx512M -Xms512M -jar eaglercraft-bukkit.jar
pause

View File

@ -0,0 +1,2 @@
#!/bin/sh
java -Xmx512M -Xms512M -jar eaglercraft_bukkit.jar

View File

@ -0,0 +1,13 @@
#Minecraft server properties
#Sat Jun 04 22:36:41 PDT 2022
hellworld=false
level-name=world
max-players=20
online-mode=false
pvp=true
spawn-animals=true
spawn-monsters=true
spawn-protection=16
vanilla-address=null
websocket-address=0.0.0.0\:25565
white-list=false

Binary file not shown.

Binary file not shown.

10117
stable-download/web/classes.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,37 @@
<!DOCTYPE html>
<html>
<head>
<title>Eaglercraft Singleplayer</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="A version of Eaglercraft with both singleplayer and multiplayer. Based on Minecraft Beta 1.3, you can play singleplayer and multiplayer in any web browser and your worlds will be saved to your browser's local storage. Works on all chromebooks, you can export and import your worlds to make backups or move worlds to a different computer." />
<meta name="keywords" content="minecraft, applet, singleplayer, chromebook, lax1dude, games, eaglercraft, ealgercraft singleplayer, eagler" />
<meta name="author" content="LAX1DUDE" />
<meta property="og:title" content="Eaglercraft Singleplayer" />
<meta property="og:locale" content="en-US" />
<meta property="og:type" content="website" />
<meta property="og:image" content="https://media.discordapp.net/attachments/378764518081429506/982903386380853258/screenshot_singleplayer_small.png" />
<meta property="og:description" content="A version of Eaglercraft with both singleplayer and multiplayer. Based on Minecraft Beta 1.3, you can play singleplayer and multiplayer in any web browser and your worlds will be saved to your browser's local storage. Works on all chromebooks, you can export and import your worlds to make backups or move worlds to a different computer." />
<!-- Change this: <meta property="og:url" content="https://g.eags.us/eaglercraft/" /> -->
<script type="text/javascript" src="classes.js"></script>
<script type="text/javascript">
if(document.location.href.startsWith("file:")) {
alert("You're not supposed to 'open' this file in your browser. Please upload this folder to your HTTP(s) server and access it via the internet. This is not a bug, please read the documentation");
}else {
window.addEventListener("load", function(){
window.minecraftOpts = ["game_frame","assets.epk"];
(function(){
var q = window.location.search;
if(typeof q === 'string' && q.startsWith("?")) {
q = new URLSearchParams(q);
var s = q.get("server");
if(s) window.minecraftOpts.push(s);
}
})();
main();
});}
</script>
</head>
<body style="margin:0px;width:100vw;height:100vh;" id="game_frame">
</body>
</html>