Merge branch 'master' into 1.15
# Conflicts: # src/main/java/carpet/commands/ScriptCommand.java
This commit is contained in:
commit
01273548b2
17 files changed
+490
-329
No files matched your search
@@ -6,7 +6,7 @@ import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Locale;
|
||||
|
||||
public class BundledModule implements ModuleInterface
|
||||
public class BundledModule extends Module
|
||||
{
|
||||
private String name;
|
||||
private String code;
|
||||
|
||||
@@ -14,7 +14,7 @@ import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.util.Locale;
|
||||
|
||||
public class FileModule implements ModuleInterface
|
||||
public class FileModule extends Module
|
||||
{
|
||||
private String name;
|
||||
private String code;
|
||||
|
||||
+12
-6
@@ -10,13 +10,13 @@ import java.nio.file.Files;
|
||||
import static carpet.script.bundled.FileModule.read;
|
||||
import static carpet.script.bundled.FileModule.write;
|
||||
|
||||
public interface ModuleInterface
|
||||
public abstract class Module
|
||||
{
|
||||
String getName();
|
||||
String getCode();
|
||||
default boolean isInternal() {return true; }
|
||||
public abstract String getName();
|
||||
public abstract String getCode();
|
||||
public boolean isInternal() {return true; }
|
||||
|
||||
default Tag getData(String file)
|
||||
public Tag getData(String file)
|
||||
{
|
||||
File dataFile = CarpetServer.minecraft_server.getLevelStorage().resolveFile(
|
||||
CarpetServer.minecraft_server.getLevelName(), "scripts/"+getName()+".data"+(file==null?"":"."+file)+".nbt");
|
||||
@@ -24,7 +24,7 @@ public interface ModuleInterface
|
||||
return read(dataFile);
|
||||
}
|
||||
|
||||
default void saveData(String file, Tag globalState)
|
||||
public void saveData(String file, Tag globalState)
|
||||
{
|
||||
File dataFile =CarpetServer.minecraft_server.getLevelStorage().resolveFile(
|
||||
CarpetServer.minecraft_server.getLevelName(), "scripts/"+getName()+".data"+(file==null?"":"."+file)+".nbt");
|
||||
@@ -41,4 +41,10 @@ public interface ModuleInterface
|
||||
write(globalState, dataFile);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
return getName().hashCode();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user