Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
135 commits
Select commit Hold shift + click to select a range
9d5c151
Update to 1.21.1
kyngs Aug 11, 2024
c337bad
Update Upstream
invalid-email-address Aug 11, 2024
cbb8fb2
Re-add null-check in FastChunkPruner.java
kyngs Aug 21, 2024
ee1a536
Migrate back to the gradleup shadow plugin and upgrade version to 8.3.0
notstevy Aug 19, 2024
80e3297
Fix typo: worldData.name() was added twice to WorldsInUse instead of …
jepu2x Aug 24, 2024
3e34812
fix: issue with chunks not saving sometimes when unloading the world
TechStreetDev Aug 31, 2024
17eb817
fix disable dragon fights
emmanuelvlad Sep 9, 2024
e36d5ae
fix chunk pdc getting wiped on chunk unload
emmanuelvlad Sep 19, 2024
3fd836f
Move patch 0016 to the correct folder
kyngs Sep 20, 2024
6ba9ed9
1.21.3 work maybe donegit add .!
AverageGithub Nov 10, 2024
4ef6419
feat: update to da7138233f6392e791d790d1c3407414c855f9c2
davidmayr Dec 3, 2024
05876d7
fix: missing chunks & entities when chunk saving
davidmayr Dec 5, 2024
32f2640
fix: pdc not saving when chunks are unloaded
davidmayr Dec 5, 2024
138ee8b
fix: move saving up so block entities can get saved
davidmayr Dec 10, 2024
991eae1
Attempt to fix #142
kyngs Dec 13, 2024
c394d0f
Update deps
ComputerNerd100 Dec 15, 2024
6c01d44
Update gradlew to 8.11.1
ComputerNerd100 Dec 15, 2024
b4d01cd
Downgrade some versions slightly
ComputerNerd100 Dec 15, 2024
e70bcdd
chore(*): restructuring round 1
ComputerNerd100 Dec 16, 2024
83bb203
fix(conventions): call get on gradle property
ComputerNerd100 Dec 16, 2024
c62213a
chore(plugin): rename to ASP
ComputerNerd100 Dec 16, 2024
49f2351
chore(plugin): update plugin jar output name
ComputerNerd100 Dec 16, 2024
b7fd593
chore(*): restructuring round 2
ComputerNerd100 Dec 20, 2024
699f99a
chore(core): remove legacy SRF support
ComputerNerd100 Dec 20, 2024
bc2d52d
chore(api): fix javadoc
ComputerNerd100 Dec 20, 2024
3e9e99c
chore(api): Change SWI extra data to Map
ComputerNerd100 Dec 20, 2024
167c327
chore(impl): Replace FlowNBT with AdventureNBT in all patches
ComputerNerd100 Dec 20, 2024
8290f91
chore(*): Update to 1.21.4
ComputerNerd100 Dec 20, 2024
fa101d8
chore(settings): Add toolchain resolver plugin
ComputerNerd100 Dec 20, 2024
50c27aa
chore(conventions): Relocate gradle/build-logic -> buildSrc
ComputerNerd100 Dec 21, 2024
a9788b3
chore(gradlew): Update gradle wrapper to 8.12
ComputerNerd100 Dec 21, 2024
f7a4a97
chore(*): Setup initial hard fork structure
ComputerNerd100 Dec 21, 2024
2cc62f6
feat: update gradle patches
davidmayr Mar 9, 2025
826326e
feat: access transformer for Entitylist instead of manual patch
davidmayr Mar 9, 2025
5c81507
Port "0001-Build-Changes patch"
Owen1212055 Mar 9, 2025
f01085b
fix: access transformer
davidmayr Mar 9, 2025
d4a2939
Port "poi data loader" by Paul19988 from 11 Jun 2023
davidmayr Mar 9, 2025
8961d09
Port "Add support for serializing/deserializing PDC" by kyngs from 21…
davidmayr Mar 9, 2025
c64404b
Port "Fix entity loading" by Philip Kelley from 2 Nov 2023
davidmayr Mar 9, 2025
a8a8952
Port "Remove catch throwable" by Philip Kelley from 2 Nov 2023
davidmayr Mar 9, 2025
e68ce70
Port "Handle null data properly" by Philip Kelley from 4 Nov 2023
davidmayr Mar 9, 2025
2d58e8e
Port "Make SlimeWorld a PersistentDataHolder" by kyngs from 26 Oct 2023
davidmayr Mar 9, 2025
d1a2d6f
Port "Add v12, chunk pdc and extra nbt. Fix double compression on
davidmayr Mar 9, 2025
a0905cd
Port "Add migration from SRF 1-8" by kyngs from 6 Jan 2024
davidmayr Mar 9, 2025
4ab063b
Port "Add default spawn yaw, propagate CraftWorld#setSpawnLocation" b…
davidmayr Mar 9, 2025
c656549
Port "Fix chunks not getting serialized when reloaded." by kyngs from…
davidmayr Mar 9, 2025
7a6751e
Port "Compile fixes" by AverageGithub from 4 May 2024
davidmayr Mar 9, 2025
d1048d1
Port "Separate plugin and server, rework API (to v3)" by kyngs from 1…
davidmayr Mar 9, 2025
e545c35
Port "replace ChunkPos with long" by Aaron from 16 Jun 2024
davidmayr Mar 9, 2025
04d6276
Port "1.21 compatibility" by kyngs from 9 Jul 2024
davidmayr Mar 9, 2025
45a253c
Port "Fix chunk saving when unloading" by TechStreet from 26 Aug 2024
davidmayr Mar 9, 2025
4186933
Port "fix disable dragon fights" by evlad from 9 Sep 2024
davidmayr Mar 9, 2025
9c8f470
Port "fix chunk pdc getting wiped on chunk unload" by evlad from 19 S…
davidmayr Mar 9, 2025
15cf7d7
Port "1.21.3 fixes" by AverageGithub from 10 Nev 2024
davidmayr Mar 9, 2025
384c946
Port "Fix missing chunks & entities when chunk saving" by me from 5 D…
davidmayr Mar 9, 2025
7a8423a
Port "fix pdc not saving when chunks are unloaded" by me from 5 Dec 2024
davidmayr Mar 9, 2025
46e9aa1
fix: make this compile
davidmayr Mar 9, 2025
ff7d700
feat: update paper
davidmayr Mar 9, 2025
def3a1b
fix: slime property validation
davidmayr Mar 9, 2025
de45ac8
fix: specific entities not saving
davidmayr Mar 9, 2025
56c82f6
feat: Branding patch
davidmayr Mar 9, 2025
e400dae
feat: build attributes
davidmayr Mar 9, 2025
9f01743
fix: catch all exceptions during async save
davidmayr Mar 9, 2025
bcc9698
feat: dont save level dat
davidmayr Mar 10, 2025
b50cca9
feat: avoid useless uuid io call
davidmayr Mar 10, 2025
e2714ed
feat: delete temp world folder async after world is unloaded
davidmayr Mar 10, 2025
06dea19
feat: idk? Needs testing
davidmayr Mar 11, 2025
42039bb
fix: chunk pruner not working
davidmayr Mar 11, 2025
729571e
feat: get rid of NMS Slime World, as InMemoryWorld is doing all the h…
davidmayr Mar 12, 2025
fd22e87
feat: return a world instance in api. Makes it easier to grab a bukki…
davidmayr Mar 12, 2025
f4cb370
feat: make SlimeWorldInstance extend SlimeWorld
davidmayr Mar 12, 2025
6899fde
chore: remove unused internal api
davidmayr Mar 12, 2025
2be4b34
feat: Optimize getTileEntities and getEntities
davidmayr Mar 12, 2025
577258f
fix: SlimeWorld read-only status always true when importing vanilla w…
davidmayr Mar 12, 2025
06212da
feat: Improve Config IO
davidmayr Mar 12, 2025
dc9f14e
fix: missing at
davidmayr Mar 12, 2025
7ebe52c
feat: hook into paper hooks for chunk saving instead
davidmayr Mar 12, 2025
b944325
fix: use unloadcallback instead of paper hook
davidmayr Mar 12, 2025
f375cfa
fix: compile error
davidmayr Mar 12, 2025
1b05a8e
chore: move away from patch
davidmayr Mar 12, 2025
9b17dce
feat: Read only dimension data store
davidmayr Mar 12, 2025
d228563
chore: move empty list call up
davidmayr Mar 12, 2025
77c1ae4
fix: delete temp files function
davidmayr Mar 12, 2025
37d673f
chore: remove old comments
davidmayr Mar 13, 2025
0598e60
chore: use the chunk biome registry
davidmayr Mar 13, 2025
4f70f5d
fix: plugin compile issue
davidmayr Mar 13, 2025
fdf7a43
feat: log save errors instead of just printing exceptions, remove com…
davidmayr Mar 13, 2025
27486b1
chore: remove old patches dir
davidmayr Mar 13, 2025
b2521db
feat: update paper
davidmayr Mar 13, 2025
458c6fe
feat: separate loaders
davidmayr Mar 13, 2025
543d8bf
chore: remove unused events and unsed exceptions
davidmayr Mar 14, 2025
ad95161
chore: remove debug "test" command
davidmayr Mar 14, 2025
58f217a
fix: remove test command reference
davidmayr Mar 14, 2025
25168e5
chore: comments
davidmayr Mar 14, 2025
330e8c2
feat: re-add importer module
davidmayr Mar 14, 2025
927905c
fix: make importer work
davidmayr Mar 14, 2025
f7b05ea
fix: default biomes. Closes #85
davidmayr Mar 14, 2025
b1f04a9
feat: make assemble run shadowJar in importer
davidmayr Mar 14, 2025
f690973
fix: poi warnings (Closes #136)
davidmayr Mar 14, 2025
fa6c7e1
fix: Entities not saving on world unload
davidmayr Mar 14, 2025
a6082dc
chore: dont disable watchdog in test env
davidmayr Mar 15, 2025
34ad3c1
fix: Memory leak with some slime chunks
davidmayr Mar 15, 2025
995c7de
fix: persistent data container/extra data not being modifiable
davidmayr Mar 15, 2025
adb5aeb
chore: dont save pdc twice + Remove it in NMS constructor as updating…
davidmayr Mar 15, 2025
f539850
fix: seems like I really cannot go around patching NewChunkHolder :/
davidmayr Mar 15, 2025
bbf89c0
fix: move slices null check
davidmayr Mar 15, 2025
e64ac56
fix: pass slices to pruner
davidmayr Mar 15, 2025
ef52766
fix: pass slices to pruner
davidmayr Mar 15, 2025
b9df2e0
fix: imports and readme
davidmayr Mar 15, 2025
ee2a20e
fix: accidental recursion
davidmayr Mar 15, 2025
85183fd
fix: unload worlds in slime plugin (Closes #134)
davidmayr Mar 15, 2025
a1126cb
fix: chunk entity re-loading warning, dont save region/entities in te…
davidmayr Mar 15, 2025
191aff8
feat: 1.21.4 support, api v4, loading optimizations
AverageGithub Mar 15, 2025
712cbe2
fix: CHUNK_SECTION_MAX property name being wrong
davidmayr Mar 15, 2025
21aac06
fix: comment out platform thing from ComputerNerd
davidmayr Mar 15, 2025
cd0ebbd
fix: branding bukkit version
davidmayr Mar 15, 2025
3b4a54f
build: remove shadowjar classifier from plugin
davidmayr Mar 16, 2025
2e23ac5
fix: anvil reader compression
davidmayr Mar 23, 2025
85d569c
fix: prevent spawn location being incomplete (the slime properties ha…
davidmayr Mar 23, 2025
2f7eb0d
build: move stuff out of impl directory as paperweight doesn't like it.
davidmayr Mar 24, 2025
42f8870
fix: remove archive classifier from shadowjar for importer
davidmayr Mar 25, 2025
89a9b21
fix: entity chunk importing
davidmayr Mar 26, 2025
dc95a81
fix: npe on plugin disable (Closes #156)
davidmayr Apr 8, 2025
3d8f04c
Revert "chore(core): remove legacy SRF support"
davidmayr Apr 8, 2025
deb0774
feat: get legacy importer going with dataconverters
davidmayr Apr 12, 2025
26239f6
feat: reintroduce v10 and v11 deserializer
davidmayr Apr 12, 2025
74ae051
chore: remove my debug msg
davidmayr Apr 12, 2025
55609f3
feat: make skeleton cloning faster
davidmayr Mar 26, 2025
07ae605
feat: make core not dependent on aspaper-api for faster publishing
davidmayr Apr 20, 2025
1c79736
Merge remote-tracking branch 'origin/main' into develop
davidmayr Apr 20, 2025
8a0b8ed
feat: add slime serialization api based on the work of @Unoqwy. Close…
davidmayr Apr 20, 2025
c9a8c6b
fix(breaking): cloned worlds with a loader are no longer readOnly if …
davidmayr Apr 20, 2025
bf13df7
fix: javadoc mistake
davidmayr Apr 20, 2025
2c5d52f
feat: updated to latest paper commit (a838a886dcbc93664283034a41673e8…
davidmayr Apr 20, 2025
6de9d10
chore: updated javadoc to reflect on compound tag -> map change
davidmayr Apr 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 15 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
*.iml
*.ipr
*.iws
.idea/
.classpath
.project
.settings/
slimeworldmanager-test/
.DS_Store/
release.properties
libs/
.gradle/
.vscode/

**/.gradle/
.DS_Store
build/
slimeworldmanager-api
slimeworldmanager-server
run
*.hprof
paper-api-generator
**/run/

**/*.iml

aspaper-server/build.gradle.kts
aspaper-server/src/minecraft/
paper-server/
aspaper-api/build.gradle.kts
paper-api/
paper-api-generator/
aspaper-server/.gradle/
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ builds can be found in the [Discord](https://discord.gg/YevvsMa) under the #aspa
## Wiki
For API and usage info check out the docs at https://infernalsuite.com/

**If you run into any Flow-NBT errors when building your project, add the additional repository: `https://repo.rapture.pw/repository/maven-releases/`**

## Javadocs
The Javadocs can be found [here](https://docs.infernalsuite.com/).

Expand Down
96 changes: 8 additions & 88 deletions api/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,96 +1,16 @@
plugins {
`java-library`
`maven-publish`
signing
id("asp.base-conventions")
id("asp.publishing-conventions")
}

dependencies {
api("com.flowpowered:flow-nbt:2.0.2")
api("org.jetbrains:annotations:23.0.0")
api(libs.annotations)
api(libs.adventure.nbt)

compileOnly("io.papermc.paper:paper-api:1.21-R0.1-SNAPSHOT")
compileOnly(paperApi())
}

version = "3.0.0-SNAPSHOT"

java {
withSourcesJar()
withJavadocJar()
}

profiles {
profile("publish") {
activation {
property {
setKey("publish")
setValue("true")
}
}
action {
publishing {
publications {
create<MavenPublication>("maven") {
groupId = "${project.group}"
artifactId = project.name
version = "${project.version}"

from(components["java"])

pom {
name.set("Advanced Slime Paper API")
description.set("API for ASP")
url.set("https://github.com/InfernalSuite/AdvancedSlimePaper")
licenses {
license {
name.set("GNU General Public License, Version 3.0")
url.set("https://www.gnu.org/licenses/gpl-3.0.txt")
}
}
developers {
developer {
id.set("InfernalSuite")
name.set("The InfernalSuite Team")
url.set("https://github.com/InfernalSuite")
email.set("infernalsuite@gmail.com")
}
}
scm {
connection.set("scm:git:https://github.com:InfernalSuite/AdvancedSlimePaper.git")
developerConnection.set("scm:git:ssh://github.com:InfernalSuite/AdvancedSlimePaper.git")
url.set("https://github.com/InfernalSuite/AdvancedSlimePaper/")
}
issueManagement {
system.set("Github")
url.set("https://github.com/InfernalSuite/AdvancedSlimePaper/issues")
}
}

versionMapping {
usage("java-api") {
fromResolutionOf("runtimeClasspath")
}
usage("java-runtime") {
fromResolutionResult()
}
}
}
}
repositories {
maven {
name = "infernalsuite"
url = uri("https://repo.infernalsuite.com/repository/maven-snapshots/")
credentials {
username = project.property("ISUsername") as String?
password = project.property("ISPassword") as String?
}
}
}
}

signing {
useGpgCmd()
sign(publishing.publications["maven"])
}
}
}
publishConfiguration {
name = "Advanced Slime Paper API"
description = "API for Advanced Slime Paper"
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
package com.infernalsuite.aswm.api;
package com.infernalsuite.asp.api;

import com.infernalsuite.aswm.api.exceptions.*;
import com.infernalsuite.aswm.api.world.SlimeWorld;
import com.infernalsuite.aswm.api.world.properties.SlimePropertyMap;
import com.infernalsuite.aswm.api.loaders.SlimeLoader;
import com.infernalsuite.asp.api.exceptions.CorruptedWorldException;
import com.infernalsuite.asp.api.exceptions.InvalidWorldException;
import com.infernalsuite.asp.api.exceptions.NewerFormatException;
import com.infernalsuite.asp.api.exceptions.UnknownWorldException;
import com.infernalsuite.asp.api.exceptions.WorldAlreadyExistsException;
import com.infernalsuite.asp.api.exceptions.WorldLoadedException;
import com.infernalsuite.asp.api.exceptions.WorldTooBigException;
import com.infernalsuite.asp.api.loaders.SlimeSerializationAdapter;
import com.infernalsuite.asp.api.world.SlimeWorld;
import com.infernalsuite.asp.api.world.SlimeWorldInstance;
import com.infernalsuite.asp.api.world.properties.SlimePropertyMap;
import com.infernalsuite.asp.api.loaders.SlimeLoader;
import net.kyori.adventure.util.Services;
import org.bukkit.World;
import org.jetbrains.annotations.ApiStatus;
Expand Down Expand Up @@ -44,28 +52,28 @@ SlimeWorld readWorld(SlimeLoader loader, String worldName, boolean readOnly, Sli
* @param worldName the name of the world to get
* @return the loaded world, or {@code null} if no loaded world matches the given name
*/
SlimeWorld getLoadedWorld(String worldName);
SlimeWorldInstance getLoadedWorld(String worldName);

/**
* Gets a list of worlds which have been loaded by ASWM.
* Note: The returned list is immutable, and encompasses a view of the loaded worlds at the time of the method call.
*
* @return a list of worlds
*/
List<SlimeWorld> getLoadedWorlds();
List<SlimeWorldInstance> getLoadedWorlds();

/**
* Generates a Minecraft World from a {@link SlimeWorld} and
* adds it to the server's world list.
* <br>
* <b>This method must be called in sync with the Server Thread</b>
*
* @param world {@link SlimeWorld} world to be added to the server's world list
* @param world {@link SlimeWorldInstance} world to be added to the server's world list
* @param callWorldLoadEvent Whether to call {@link org.bukkit.event.world.WorldLoadEvent}
* @throws IllegalArgumentException if the world is already loaded
* @return Returns a slime world representing a live minecraft world
*/
SlimeWorld loadWorld(SlimeWorld world, boolean callWorldLoadEvent) throws IllegalArgumentException;
SlimeWorldInstance loadWorld(SlimeWorld world, boolean callWorldLoadEvent) throws IllegalArgumentException;

/**
* Checks if a {@link SlimeWorld} is loaded on the server.
Expand Down Expand Up @@ -126,6 +134,17 @@ SlimeWorld readWorld(SlimeLoader loader, String worldName, boolean readOnly, Sli
*/
SlimeWorld readVanillaWorld(File worldDir, String worldName, @Nullable SlimeLoader loader) throws InvalidWorldException, WorldLoadedException, WorldTooBigException, IOException, WorldAlreadyExistsException;

/**
* Returns the {@link SlimeSerializationAdapter} used to serialize and deserialize SlimeWorlds.
* Manual de-/serialization is considered experimental and may change in future versions.
* <p>
* <strong>Please use SlimeLoaders where possible</strong>
*
* @return A adapter for serializing and deserializing SlimeWorlds
*/
@ApiStatus.Experimental
SlimeSerializationAdapter getSerializer();

/**
* Gets the instance of the AdvancedSlimePaper API.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.infernalsuite.asp.api;

import com.infernalsuite.asp.api.world.SlimeWorld;
import net.kyori.adventure.nbt.CompoundBinaryTag;
import net.kyori.adventure.nbt.ListBinaryTag;
import org.jetbrains.annotations.ApiStatus;

import java.util.List;

@ApiStatus.Internal
public interface SlimeDataConverter {

// Will return new (fixed) instance
SlimeWorld applyDataFixers(SlimeWorld world);

CompoundBinaryTag convertChunkTo1_13(CompoundBinaryTag globalTag);

List<CompoundBinaryTag> convertEntities(List<CompoundBinaryTag> input, int from, int to);
List<CompoundBinaryTag> convertTileEntities(List<CompoundBinaryTag> input, int from, int to);
ListBinaryTag convertBlockPalette(ListBinaryTag input, int from, int to);

}
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
package com.infernalsuite.aswm.api;
package com.infernalsuite.asp.api;

import com.flowpowered.nbt.CompoundMap;
import com.flowpowered.nbt.CompoundTag;
import com.infernalsuite.aswm.api.world.SlimeWorld;
import com.infernalsuite.aswm.api.world.SlimeWorldInstance;
import com.infernalsuite.asp.api.world.SlimeWorld;
import com.infernalsuite.asp.api.world.SlimeWorldInstance;
import net.kyori.adventure.nbt.CompoundBinaryTag;
import net.kyori.adventure.nbt.ListBinaryTag;
import net.kyori.adventure.util.Services;
import org.bukkit.World;
import org.bukkit.persistence.PersistentDataContainer;
import org.jetbrains.annotations.ApiStatus;

import java.io.IOException;
import java.util.List;

@ApiStatus.Internal
public interface SlimeNMSBridge {
Expand All @@ -27,24 +28,18 @@ public interface SlimeNMSBridge {

SlimeWorldInstance getInstance(World world);

// Will return new (fixed) instance
SlimeWorld applyDataFixers(SlimeWorld world);

int getCurrentVersion();

static SlimeNMSBridge instance() {
return Holder.INSTANCE;
}

void extractCraftPDC(PersistentDataContainer source, CompoundMap target);
void extractCraftPDC(PersistentDataContainer source, CompoundBinaryTag.Builder builder);

PersistentDataContainer extractCompoundMapIntoCraftPDC(CompoundMap source);
SlimeDataConverter getSlimeDataConverter();

@ApiStatus.Internal
class Holder {
private static final SlimeNMSBridge INSTANCE = Services.service(SlimeNMSBridge.class).orElseThrow();
}

CompoundTag convertChunkTo1_13(CompoundTag tag);

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.infernalsuite.aswm.api.events;
package com.infernalsuite.asp.api.events;

import com.infernalsuite.aswm.api.world.SlimeWorld;
import com.infernalsuite.asp.api.world.SlimeWorldInstance;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
Expand All @@ -10,9 +10,9 @@
public class LoadSlimeWorldEvent extends Event {

private static final HandlerList handlers = new HandlerList();
private final SlimeWorld slimeWorld;
private final SlimeWorldInstance slimeWorld;

public LoadSlimeWorldEvent(SlimeWorld slimeWorld) {
public LoadSlimeWorldEvent(SlimeWorldInstance slimeWorld) {
super(false);
this.slimeWorld = Objects.requireNonNull(slimeWorld, "slimeWorld cannot be null");
}
Expand All @@ -26,7 +26,7 @@ public static HandlerList getHandlerList() {
return handlers;
}

public SlimeWorld getSlimeWorld() {
public SlimeWorldInstance getSlimeWorld() {
return slimeWorld;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.infernalsuite.aswm.api.exceptions;
package com.infernalsuite.asp.api.exceptions;

/**
* Exception thrown when a world could not
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.infernalsuite.asp.api.exceptions;

import java.io.File;
import java.nio.file.Path;

/**
* Exception thrown when a folder does
* not contain a valid Minecraft world.
*/
public class InvalidWorldException extends SlimeException {

public InvalidWorldException(Path worldDir, String reason) {
super("Directory " + worldDir.toString() + " does not contain a valid MC world! " + reason);
}

public InvalidWorldException(Path worldDir) {
super("Directory " + worldDir.toString() + " does not contain a valid MC world!");
}

public static InvalidWorldException legacy(File worldDir, String reason) {
return new InvalidWorldException(worldDir.toPath(), reason);
}

public static InvalidWorldException legacy(File worldDir) {
return new InvalidWorldException(worldDir.toPath());
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.infernalsuite.aswm.api.exceptions;
package com.infernalsuite.asp.api.exceptions;

/**
* Exception thrown when a world is encoded
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.infernalsuite.aswm.api.exceptions;
package com.infernalsuite.asp.api.exceptions;

/**
* Generic SWM exception.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.infernalsuite.aswm.api.exceptions;
package com.infernalsuite.asp.api.exceptions;

/**
* Exception thrown when a
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.infernalsuite.aswm.api.exceptions;
package com.infernalsuite.asp.api.exceptions;

/**
* Exception thrown when a world
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.infernalsuite.aswm.api.exceptions;
package com.infernalsuite.asp.api.exceptions;

/**
* Exception thrown when a world is loaded
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.infernalsuite.aswm.api.exceptions;
package com.infernalsuite.asp.api.exceptions;

/**
* Exception thrown when a MC world is
Expand Down
Loading