Skip to content

Commit

Permalink
fix: совместимость
Browse files Browse the repository at this point in the history
Мне лень снова писать
  • Loading branch information
Reider745 committed Dec 15, 2023
1 parent 5880887 commit 179b1b8
Show file tree
Hide file tree
Showing 13 changed files with 2,721 additions and 38 deletions.
Binary file modified iclibs/Nukkit-MOT-SNAPSHOT.jar
Binary file not shown.
5 changes: 4 additions & 1 deletion src/main/java/com/reider745/InnerCoreServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public static boolean isDevelopMode() {
}

public static boolean isRuntimeException() {
return server.getPropertyBoolean("inner_core.runtime_exception", isDevelopMode());
return server.getPropertyBoolean("inner_core.runtime_exception", false);
}

private static void processFile(ZipFile file, String uncompressedDirectory, ZipEntry entry) throws IOException {
Expand Down Expand Up @@ -319,6 +319,7 @@ public static void useNotSupport(String name) {
}

public static void useClientMethod(String name) {
if(!isDevelopMode()) return;
String message = "Use client method " + name;
if (isRuntimeException()) {
throw new RuntimeException(message);
Expand All @@ -328,6 +329,7 @@ public static void useClientMethod(String name) {
}

public static void useNotCurrentSupport(String name) {
if(!isDevelopMode()) return;
String message = "The " + name + " method is currently not supported";
if (isRuntimeException()) {
throw new RuntimeException(message);
Expand All @@ -337,6 +339,7 @@ public static void useNotCurrentSupport(String name) {
}

public static void useIncomprehensibleMethod(String name) {
if(!isDevelopMode()) return;
String message = "I don't really understand what this method does (" + name
+ "), which is why you're reading this right now";
if (isRuntimeException()) {
Expand Down
8 changes: 6 additions & 2 deletions src/main/java/com/reider745/api/CallbackHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ public enum Type {
GENERATION_CHUNK_OVERWORLD,
GENERATION_CHUNK_NETHER,
GENERATION_CHUNK_END,
PRE_GENERATION_CHUNK;
PRE_GENERATION_CHUNK,
PRE_GENERATION_CHUNK_NETHER,
PRE_GENERATION_CHUNK_END;
}

private static final HashMap<Type, ThreadRegion> types = new HashMap<>();
Expand All @@ -26,7 +28,9 @@ private static class ThreadRegion extends Thread {
private Level region;
private final ArrayList<ICallbackApply> applys = new ArrayList<>();

private Level getRegion() {
private final Level getRegion() {
if(region == null)
System.out.println("isNull: true");
return region;
}

Expand Down
Loading

0 comments on commit 179b1b8

Please sign in to comment.