Use live TrueOG Network config
This commit is contained in:
1 parent
427fe85884
commit
628040a439
66 files changed
+75
-89
No files matched your search
@@ -1,3 +1,4 @@
|
||||
buildSrc/.kotlin/
|
||||
.classpath
|
||||
.project
|
||||
.settings
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
VERSION="$1"
|
||||
|
||||
# Ensure the target directory exists
|
||||
mkdir -p build/libs
|
||||
|
||||
# Copy and rename the jar, using $VERSION in the final filename
|
||||
cp worldedit-bukkit/build/libs/*-dist.jar "build/libs/WorldEdit-${VERSION}.jar"
|
||||
@@ -1,5 +1,6 @@
|
||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
import io.papermc.paperweight.userdev.attribute.Obfuscation
|
||||
import org.gradle.api.tasks.Copy
|
||||
|
||||
plugins {
|
||||
`java-library`
|
||||
@@ -91,14 +92,15 @@ tasks.named("assemble").configure {
|
||||
dependsOn("shadowJar")
|
||||
}
|
||||
|
||||
tasks.register("runCopyJarScript", Exec::class) {
|
||||
tasks.register<Copy>("copyPluginJar") {
|
||||
group = "build"
|
||||
description = "Runs the copyjar.sh script after build completion."
|
||||
workingDir(rootDir)
|
||||
commandLine("sh", "copyjar.sh", project.version.toString())
|
||||
description = "Copies the shaded Bukkit plugin jar into the root build/libs directory."
|
||||
dependsOn("shadowJar")
|
||||
from(tasks.named<ShadowJar>("shadowJar").flatMap { it.archiveFile })
|
||||
into(rootProject.layout.buildDirectory.dir("libs"))
|
||||
rename { "WorldEdit-${project.version}.jar" }
|
||||
}
|
||||
|
||||
tasks.named("build") {
|
||||
finalizedBy("runCopyJarScript")
|
||||
dependsOn("copyPluginJar")
|
||||
}
|
||||
|
||||
@@ -86,10 +86,13 @@ import java.io.InputStream;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Enumeration;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.jar.JarEntry;
|
||||
import java.util.jar.JarFile;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
@@ -137,6 +140,7 @@ public class WorldEditPlugin extends JavaPlugin implements TabCompleter {
|
||||
worldEdit.getPlatformManager().register(platform);
|
||||
|
||||
createDefaultConfiguration("config.yml"); // Create the default configuration file
|
||||
createDefaultDirectory("schematics");
|
||||
|
||||
config = new BukkitConfiguration(new YAMLProcessor(new File(getDataFolder(), "config.yml"), true), this);
|
||||
|
||||
@@ -356,6 +360,44 @@ public class WorldEditPlugin extends JavaPlugin implements TabCompleter {
|
||||
}
|
||||
}
|
||||
|
||||
protected void createDefaultDirectory(String name) {
|
||||
Path actual = getDataFolder().toPath().resolve(name);
|
||||
if (Files.exists(actual)) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
Files.createDirectories(actual);
|
||||
} catch (IOException e) {
|
||||
getLogger().log(Level.WARNING, "Failed to create default directory: " + name, e);
|
||||
return;
|
||||
}
|
||||
|
||||
String resourcePrefix = "defaults/" + name + "/";
|
||||
try (JarFile jarFile = new JarFile(getFile())) {
|
||||
Enumeration<JarEntry> entries = jarFile.entries();
|
||||
while (entries.hasMoreElements()) {
|
||||
JarEntry entry = entries.nextElement();
|
||||
if (entry.isDirectory() || !entry.getName().startsWith(resourcePrefix)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Path output = actual.resolve(entry.getName().substring(resourcePrefix.length()));
|
||||
Path parent = output.getParent();
|
||||
if (parent != null) {
|
||||
Files.createDirectories(parent);
|
||||
}
|
||||
try (InputStream input = jarFile.getInputStream(entry)) {
|
||||
Files.copy(input, output);
|
||||
}
|
||||
}
|
||||
|
||||
getLogger().info("Default directory written: " + name);
|
||||
} catch (IOException e) {
|
||||
getLogger().log(Level.WARNING, "Failed to write default directory", e);
|
||||
}
|
||||
}
|
||||
|
||||
private void copyDefaultConfig(InputStream input, File actual, String name) {
|
||||
try (FileOutputStream output = new FileOutputStream(actual)) {
|
||||
byte[] buf = new byte[8192];
|
||||
|
||||
@@ -18,80 +18,30 @@
|
||||
|
||||
limits:
|
||||
max-blocks-changed:
|
||||
default: -1
|
||||
maximum: -1
|
||||
default: 1500000
|
||||
maximum: 3000000
|
||||
vertical-height:
|
||||
default: 256
|
||||
default: 320
|
||||
max-polygonal-points:
|
||||
default: -1
|
||||
maximum: 20
|
||||
max-radius: -1
|
||||
max-super-pickaxe-size: 5
|
||||
max-brush-radius: 5
|
||||
maximum: 100
|
||||
max-radius: 500
|
||||
max-super-pickaxe-size: 10
|
||||
max-brush-radius: 50
|
||||
butcher-radius:
|
||||
default: -1
|
||||
maximum: -1
|
||||
default: 250
|
||||
maximum: 500
|
||||
disallowed-blocks:
|
||||
- "minecraft:oak_sapling"
|
||||
- "minecraft:jungle_sapling"
|
||||
- "minecraft:dark_oak_sapling"
|
||||
- "minecraft:spruce_sapling"
|
||||
- "minecraft:birch_sapling"
|
||||
- "minecraft:acacia_sapling"
|
||||
- "minecraft:black_bed"
|
||||
- "minecraft:blue_bed"
|
||||
- "minecraft:brown_bed"
|
||||
- "minecraft:cyan_bed"
|
||||
- "minecraft:gray_bed"
|
||||
- "minecraft:green_bed"
|
||||
- "minecraft:light_blue_bed"
|
||||
- "minecraft:light_gray_bed"
|
||||
- "minecraft:lime_bed"
|
||||
- "minecraft:magenta_bed"
|
||||
- "minecraft:orange_bed"
|
||||
- "minecraft:pink_bed"
|
||||
- "minecraft:purple_bed"
|
||||
- "minecraft:red_bed"
|
||||
- "minecraft:white_bed"
|
||||
- "minecraft:yellow_bed"
|
||||
- "minecraft:powered_rail"
|
||||
- "minecraft:detector_rail"
|
||||
- "minecraft:grass"
|
||||
- "minecraft:dead_bush"
|
||||
- "minecraft:moving_piston"
|
||||
- "minecraft:piston_head"
|
||||
- "minecraft:sunflower"
|
||||
- "minecraft:rose_bush"
|
||||
- "minecraft:dandelion"
|
||||
- "minecraft:poppy"
|
||||
- "minecraft:brown_mushroom"
|
||||
- "minecraft:red_mushroom"
|
||||
- "minecraft:tnt"
|
||||
- "minecraft:torch"
|
||||
- "minecraft:fire"
|
||||
- "minecraft:redstone_wire"
|
||||
- "minecraft:wheat"
|
||||
- "minecraft:potatoes"
|
||||
- "minecraft:carrots"
|
||||
- "minecraft:melon_stem"
|
||||
- "minecraft:pumpkin_stem"
|
||||
- "minecraft:beetroots"
|
||||
- "minecraft:rail"
|
||||
- "minecraft:lever"
|
||||
- "minecraft:redstone_torch"
|
||||
- "minecraft:redstone_wall_torch"
|
||||
- "minecraft:repeater"
|
||||
- "minecraft:comparator"
|
||||
- "minecraft:stone_button"
|
||||
- "minecraft:birch_button"
|
||||
- "minecraft:acacia_button"
|
||||
- "minecraft:dark_oak_button"
|
||||
- "minecraft:jungle_button"
|
||||
- "minecraft:oak_button"
|
||||
- "minecraft:spruce_button"
|
||||
- "minecraft:cactus"
|
||||
- "minecraft:sugar_cane"
|
||||
- "minecraft:bedrock"
|
||||
- "minecraft:barrier"
|
||||
- "minecraft:bedrock"
|
||||
- "minecraft:diamond_block"
|
||||
- "minecraft:diamond_ore"
|
||||
- "minecraft:deepslate_diamond_ore"
|
||||
- "minecraft:moving_piston"
|
||||
- "minecraft:piston_head"
|
||||
- "minecraft:tnt"
|
||||
- "minecraft:lava"
|
||||
- "minecraft:fire"
|
||||
|
||||
use-inventory:
|
||||
enable: false
|
||||
@@ -99,7 +49,7 @@ use-inventory:
|
||||
creative-mode-overrides: false
|
||||
|
||||
logging:
|
||||
log-commands: false
|
||||
log-commands: true
|
||||
file: worldedit.log
|
||||
# The format of custom log message. This is java general format string (java.util.Formatter). Arguments are:
|
||||
# 1$ : date - a Date object representing event time of the log record.
|
||||
@@ -135,11 +85,11 @@ files:
|
||||
allow-symbolic-links: false
|
||||
|
||||
history:
|
||||
size: 15
|
||||
expiration: 10
|
||||
size: 60
|
||||
expiration: 60
|
||||
|
||||
calculation:
|
||||
timeout: 100
|
||||
timeout: 1000
|
||||
|
||||
debugging:
|
||||
trace-unflushed-sessions: false
|
||||
@@ -148,6 +98,6 @@ wand-item: minecraft:wooden_axe
|
||||
shell-save-type:
|
||||
no-op-permissions: false
|
||||
debug: false
|
||||
show-help-on-first-use: true
|
||||
show-help-on-first-use: false
|
||||
server-side-cui: true
|
||||
command-block-support: false
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in new issue
Block a user