Skip to content

Commit 25161b7

Browse files
committed
Initial commit
0 parents  commit 25161b7

File tree

76 files changed

+2683
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+2683
-0
lines changed

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
* text=auto eol=lf
2+
gradlew text eol=lf
3+
*.sh text eol=lf
4+
*.bat text eol=crlf
5+
*.jar binary
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Build & Publish Gradle project
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- dev/dev
8+
9+
jobs:
10+
build-gradle-project:
11+
env:
12+
REPO_USER: ${{ secrets.REPO_USERNAME }}
13+
REPO_PASS: ${{ secrets.REPO_PASSWORD }}
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout project sources
17+
uses: actions/checkout@v4
18+
- name: Setup JDK 21 for x64
19+
uses: actions/setup-java@v4
20+
with:
21+
java-version: 21
22+
distribution: corretto
23+
architecture: x64
24+
- name: Setup Gradle
25+
uses: gradle/actions/setup-gradle@v3
26+
- name: Run shadowJar and publish with Gradle Wrapper
27+
run: ./gradlew shadowJar publish -ProxymcUsername=${{ env.REPO_USER }} -ProxymcPassword=${{ env.REPO_PASS }}
28+
- name: Upload artifact
29+
uses: actions/upload-artifact@v4
30+
with:
31+
path: paper/build/libs/SlimeIgnite-paper-*.jar

.gitignore

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
# User-specific stuff
2+
.idea/
3+
4+
*.iml
5+
*.ipr
6+
*.iws
7+
8+
# IntelliJ
9+
out/
10+
# mpeltonen/sbt-idea plugin
11+
.idea_modules/
12+
13+
# JIRA plugin
14+
atlassian-ide-plugin.xml
15+
16+
# Compiled class file
17+
*.class
18+
19+
# Log file
20+
*.log
21+
22+
# BlueJ files
23+
*.ctxt
24+
25+
# Package Files #
26+
*.jar
27+
*.war
28+
*.nar
29+
*.ear
30+
*.zip
31+
*.tar.gz
32+
*.rar
33+
34+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
35+
hs_err_pid*
36+
37+
*~
38+
39+
# temporary files which can be created if a process still has a handle open of a deleted file
40+
.fuse_hidden*
41+
42+
# KDE directory preferences
43+
.directory
44+
45+
# Linux trash folder which might appear on any partition or disk
46+
.Trash-*
47+
48+
# .nfs files are created when an open file is removed but is still being accessed
49+
.nfs*
50+
51+
# General
52+
.DS_Store
53+
.AppleDouble
54+
.LSOverride
55+
56+
# Icon must end with two \r
57+
Icon
58+
59+
# Thumbnails
60+
._*
61+
62+
# Files that might appear in the root of a volume
63+
.DocumentRevisions-V100
64+
.fseventsd
65+
.Spotlight-V100
66+
.TemporaryItems
67+
.Trashes
68+
.VolumeIcon.icns
69+
.com.apple.timemachine.donotpresent
70+
71+
# Directories potentially created on remote AFP share
72+
.AppleDB
73+
.AppleDesktop
74+
Network Trash Folder
75+
Temporary Items
76+
.apdisk
77+
78+
# Windows thumbnail cache files
79+
Thumbs.db
80+
Thumbs.db:encryptable
81+
ehthumbs.db
82+
ehthumbs_vista.db
83+
84+
# Dump file
85+
*.stackdump
86+
87+
# Folder config file
88+
[Dd]esktop.ini
89+
90+
# Recycle Bin used on file shares
91+
$RECYCLE.BIN/
92+
93+
# Windows Installer files
94+
*.cab
95+
*.msi
96+
*.msix
97+
*.msm
98+
*.msp
99+
100+
# Windows shortcuts
101+
*.lnk
102+
103+
.gradle
104+
build/
105+
106+
# Ignore Gradle GUI config
107+
gradle-app.setting
108+
109+
# Cache of project
110+
.gradletasknamecache
111+
112+
**/build/
113+
114+
# Common working directory
115+
run/
116+
117+
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
118+
!gradle-wrapper.jar

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 RoxyMC
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# SlimeIgnite
2+
3+
An [Ignite](https://github.com/vectrix-space/ignite) mod implementation
4+
of [SlimeLoader](https://github.com/roxymc-net/SlimeLoader) for [Paper](https://papermc.io/).
5+
6+
## Supported versions
7+
8+
| Mod version | Compatible Paper version |
9+
|-------------|--------------------------|
10+
| 0.1 | 1.21.3, 1.21.4 |
11+
12+
## Usage
13+
14+
### Mod installation
15+
16+
Firstly, follow the [Ignite installation instructions](https://github.com/vectrix-space/ignite#install).
17+
18+
Then, navigate to [releases](https://github.com/roxymc-net/SlimeIgnite/releases) or [actions](https://github.com/roxymc-net/SlimeIgnite/actions) page and download the latest mod artifact for your platform.
19+
20+
After downloading, place the mod jar file inside your server's `mods` directory.
21+
22+
Finally, you can simply launch your server just like before and enjoy your slime worlds!
23+
(note: remember to launch the ignite jar, not your platform jar.)
24+
25+
### For developers (API)
26+
27+
SlimeIgnite API is available in our maven repository.
28+
29+
Depending on your target mod version, you would need:
30+
31+
```kts
32+
repositories {
33+
// for releases
34+
maven("https://repo.roxymc.net/releases")
35+
36+
// for snapshots
37+
maven("https://repo.roxymc.net/snapshots")
38+
}
39+
```
40+
41+
and
42+
43+
```kts
44+
dependencies {
45+
implementation("net.roxymc:slimeignite-api:VERSION")
46+
}
47+
```
48+
49+
## Compiling
50+
51+
To compile, navigate to project root directory and run:
52+
53+
```shell
54+
./gradlew shadowJar
55+
```

api/build.gradle.kts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
plugins {
2+
id("java-library")
3+
id("maven-publish")
4+
}
5+
6+
val minecraftVersion = project.property("minecraft-version")
7+
8+
dependencies {
9+
compileOnly("io.papermc.paper:paper-api:$minecraftVersion-R0.1-SNAPSHOT")
10+
api("net.roxymc.slimeloader:slime-loader:1.0-SNAPSHOT")
11+
}
12+
13+
java {
14+
withSourcesJar()
15+
}
16+
17+
publishing {
18+
repositories {
19+
val repoType = if (version.toString().endsWith("-SNAPSHOT")) "snapshots" else "releases"
20+
maven("https://repo.roxymc.net/${repoType}") {
21+
name = "roxymc"
22+
credentials(PasswordCredentials::class)
23+
}
24+
}
25+
26+
publications {
27+
create<MavenPublication>("maven") {
28+
artifactId = "${rootProject.name}-${project.name}".lowercase()
29+
30+
from(components["java"])
31+
}
32+
}
33+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package net.roxymc.slime.ignite;
2+
3+
import net.roxymc.slime.ignite.storage.SlimeWorldStorage;
4+
import org.bukkit.World;
5+
import org.jspecify.annotations.NullMarked;
6+
7+
@NullMarked
8+
public interface LoadedSlimeWorld extends SlimeWorldSkeleton {
9+
boolean readOnly();
10+
11+
SlimeWorldStorage storage();
12+
13+
World serverWorld();
14+
15+
@Override
16+
default boolean isLoaded() {
17+
return true;
18+
}
19+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package net.roxymc.slime.ignite;
2+
3+
import net.roxymc.slime.ignite.storage.SlimeWorldStorage;
4+
import net.roxymc.slime.world.World;
5+
import org.jspecify.annotations.NullMarked;
6+
7+
@NullMarked
8+
public interface SlimeWorldSkeleton {
9+
String name();
10+
11+
World data();
12+
13+
default SlimeWorldSkeleton snapshot() {
14+
return snapshot(name());
15+
}
16+
17+
SlimeWorldSkeleton snapshot(String name);
18+
19+
boolean isLoaded();
20+
21+
default LoadedSlimeWorld load(SlimeWorldStorage storage) {
22+
return load(storage, false);
23+
}
24+
25+
default LoadedSlimeWorld load(SlimeWorldStorage storage, boolean readOnly) {
26+
return storage.loadWorld(this, readOnly);
27+
}
28+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package net.roxymc.slime.ignite;
2+
3+
import net.roxymc.slime.world.World;
4+
import org.jspecify.annotations.NullMarked;
5+
6+
@NullMarked
7+
public record SlimeWorldSkeletonImpl(String name, World data) implements SlimeWorldSkeleton {
8+
@Override
9+
public SlimeWorldSkeleton snapshot(String name) {
10+
return new SlimeWorldSkeletonImpl(name, data);
11+
}
12+
13+
@Override
14+
public boolean isLoaded() {
15+
return false;
16+
}
17+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package net.roxymc.slime.ignite.loader;
2+
3+
import net.roxymc.slime.ignite.LoadedSlimeWorld;
4+
import net.roxymc.slime.ignite.SlimeWorldSkeleton;
5+
import net.roxymc.slime.ignite.storage.SlimeWorldStorage;
6+
import net.roxymc.slime.loader.SlimeLoader;
7+
import org.bukkit.World;
8+
import org.jetbrains.annotations.UnknownNullability;
9+
import org.jspecify.annotations.NullMarked;
10+
import org.jspecify.annotations.Nullable;
11+
12+
import java.io.IOException;
13+
import java.util.Optional;
14+
import java.util.ServiceLoader;
15+
import java.util.Set;
16+
17+
@NullMarked
18+
public abstract class SlimeWorldLoader {
19+
@SuppressWarnings("OptionalUsedAsFieldOrParameterType")
20+
private static final Optional<SlimeWorldLoader> INSTANCE = ServiceLoader.load(SlimeWorldLoader.class).findFirst();
21+
22+
SlimeWorldLoader() {
23+
}
24+
25+
public static SlimeWorldLoader get() {
26+
return INSTANCE.orElseThrow();
27+
}
28+
29+
public abstract @Nullable LoadedSlimeWorld slimeWorld(World world);
30+
31+
public abstract Set<String> storages();
32+
33+
public abstract @UnknownNullability SlimeWorldStorage storage(String name);
34+
35+
public abstract boolean registerStorage(SlimeWorldStorage storage);
36+
37+
public abstract SlimeLoader slimeLoader();
38+
39+
public abstract SlimeWorldSkeleton createEmptyWorld(String name);
40+
41+
public abstract LoadedSlimeWorld loadWorld(SlimeWorldSkeleton world, SlimeWorldStorage storage, boolean readOnly) throws IOException;
42+
}

0 commit comments

Comments
 (0)