2020-07-17 18:05:50 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2020-08-07 02:59:57 +02:00
|
|
|
From: tr7zw <tr7zw@live.de>
|
2020-08-05 15:21:25 +02:00
|
|
|
Date: Wed, 5 Aug 2020 08:05:10 -0500
|
2020-08-03 18:48:42 +02:00
|
|
|
Subject: [PATCH] Add config Yatopia command and basic settings
|
2020-06-27 17:23:21 +02:00
|
|
|
|
|
|
|
|
2020-08-06 16:05:19 +02:00
|
|
|
diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
|
2020-08-13 17:53:32 +02:00
|
|
|
index b67f05f290db653cf75a89e85bd3decb5044a1e0..11758b6b158d971b9beb1b609d7513dab46be525 100644
|
2020-08-06 16:05:19 +02:00
|
|
|
--- a/src/main/java/co/aikar/timings/TimingsExport.java
|
|
|
|
+++ b/src/main/java/co/aikar/timings/TimingsExport.java
|
|
|
|
@@ -232,6 +232,7 @@ public class TimingsExport extends Thread {
|
|
|
|
pair("paper", mapAsJSON(Bukkit.spigot().getPaperConfig(), null)), // Tuinity - add config to timings report
|
|
|
|
pair("tuinity", mapAsJSON(Bukkit.spigot().getTuinityConfig(), null)) // Tuinity - add config to timings report
|
2020-08-13 17:53:32 +02:00
|
|
|
, pair("purpur", mapAsJSON(Bukkit.spigot().getPurpurConfig(), null)) // Purpur - add config to timings report
|
|
|
|
+ , pair("yatopia", mapAsJSON(Bukkit.spigot().getYatopiaConfig(), null)) // Yatopia - add config to timings report
|
2020-08-06 16:05:19 +02:00
|
|
|
));
|
|
|
|
|
|
|
|
new TimingsExport(listeners, parent, history).start();
|
2020-08-03 18:48:42 +02:00
|
|
|
diff --git a/src/main/java/dev/tr7zw/yatopia/YatopiaCommand.java b/src/main/java/dev/tr7zw/yatopia/YatopiaCommand.java
|
2020-06-27 17:23:21 +02:00
|
|
|
new file mode 100644
|
2020-08-15 11:43:24 +02:00
|
|
|
index 0000000000000000000000000000000000000000..27c6daf22b5ddc8e9de6ef084f396347a5b44feb
|
2020-06-27 17:23:21 +02:00
|
|
|
--- /dev/null
|
2020-08-03 18:48:42 +02:00
|
|
|
+++ b/src/main/java/dev/tr7zw/yatopia/YatopiaCommand.java
|
2020-08-15 11:43:24 +02:00
|
|
|
@@ -0,0 +1,126 @@
|
|
|
|
+package dev.tr7zw.yatopia;
|
|
|
|
+
|
|
|
|
+import com.google.common.base.Preconditions;
|
|
|
|
+import com.google.common.collect.Lists;
|
|
|
|
+import java.io.File;
|
|
|
|
+import java.util.Arrays;
|
|
|
|
+import java.util.Collection;
|
|
|
|
+import java.util.Collections;
|
|
|
|
+import java.util.List;
|
|
|
|
+import java.util.Locale;
|
|
|
|
+import java.util.function.Function;
|
|
|
|
+import net.minecraft.server.MinecraftKey;
|
|
|
|
+import net.minecraft.server.MinecraftServer;
|
|
|
|
+import org.bukkit.Bukkit;
|
|
|
|
+import org.bukkit.ChatColor;
|
|
|
|
+import org.bukkit.Location;
|
|
|
|
+import org.bukkit.command.Command;
|
|
|
|
+import org.bukkit.command.CommandSender;
|
|
|
|
+import org.spigotmc.TicksPerSecondCommand;
|
|
|
|
+
|
|
|
|
+public class YatopiaCommand extends Command {
|
|
|
|
+
|
|
|
|
+ public YatopiaCommand(String name) {
|
|
|
|
+ super(name);
|
|
|
|
+ this.description = "Yatopia related commands";
|
|
|
|
+ this.usageMessage = "/yatopia [help | reload | info | version]";
|
|
|
|
+ this.setPermission("bukkit.command.yatopia");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public List<String> tabComplete(CommandSender sender, String alias, String[] args, Location location) throws IllegalArgumentException {
|
|
|
|
+ if (args.length <= 1) {
|
|
|
|
+ return getListMatchingLast(args, "help", "info", "reload", "version");
|
|
|
|
+ }
|
|
|
|
+ return Collections.emptyList();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // Code from Mojang - copyright them
|
|
|
|
+ public static List<String> getListMatchingLast(String[] args, String... matches) {
|
|
|
|
+ return getListMatchingLast(args, Arrays.asList(matches));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public static boolean matches(String s, String s1) {
|
|
|
|
+ return s1.regionMatches(true, 0, s, 0, s.length());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public static List<String> getListMatchingLast(String[] strings, Collection<?> collection) {
|
|
|
|
+ String last = strings[strings.length - 1];
|
|
|
|
+ List<String> results = Lists.newArrayList();
|
|
|
|
+
|
|
|
|
+ if (!collection.isEmpty()) {
|
|
|
|
+ Function<Object, String> toStringFunction = (o) -> {
|
|
|
|
+ Preconditions.checkNotNull(o);
|
|
|
|
+ return o.toString();
|
|
|
|
+ };
|
|
|
|
+ for (Object c : collection) {
|
|
|
|
+ String value = toStringFunction.apply(c);
|
|
|
|
+ if (matches(last, value)) {
|
|
|
|
+ results.add(value);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (results.isEmpty()) {
|
|
|
|
+ for (Object c : collection) {
|
|
|
|
+ if (c instanceof MinecraftKey) {
|
|
|
|
+ MinecraftKey key = (MinecraftKey) c;
|
|
|
|
+ if (matches(last, key.getKey())) {
|
|
|
|
+ results.add(key.toString());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return results;
|
|
|
|
+ }
|
|
|
|
+ // end copy stuff
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public boolean execute(CommandSender sender, String commandLabel, String[] args) {
|
|
|
|
+ if (!testPermission(sender)) return true;
|
|
|
|
+
|
|
|
|
+ if (args.length == 0) {
|
|
|
|
+ sender.sendMessage(ChatColor.RED + "Usage: " + usageMessage);
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ switch (args[0].toLowerCase(Locale.ENGLISH)) {
|
|
|
|
+ case "info":
|
|
|
|
+ doInfo(sender);
|
|
|
|
+ break;
|
|
|
|
+ case "reload":
|
|
|
|
+ doReload(sender);
|
|
|
|
+ break;
|
|
|
|
+ case "ver":
|
|
|
|
+ case "version":
|
|
|
|
+ Command ver = org.bukkit.Bukkit.getServer().getCommandMap().getCommand("version");
|
|
|
|
+ if (ver != null) {
|
|
|
|
+ ver.execute(sender, commandLabel, new String[0]);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ // else - fall through to default
|
|
|
|
+ default:
|
|
|
|
+ sender.sendMessage(ChatColor.RED + "Usage: " + usageMessage);
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void doInfo(CommandSender sender) {
|
|
|
|
+ Command.broadcastCommandMessage(sender, ChatColor.GOLD + "Last tick took " + TicksPerSecondCommand.format(Bukkit.getLastTickMs()));
|
|
|
|
+ //TODO
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void doReload(CommandSender sender) {
|
|
|
|
+ Command.broadcastCommandMessage(sender, ChatColor.RED + "Please note that this command is not supported and may cause issues.");
|
|
|
|
+ Command.broadcastCommandMessage(sender, ChatColor.RED + "If you encounter any issues please use the /stop command to restart your server.");
|
|
|
|
+
|
|
|
|
+ MinecraftServer console = MinecraftServer.getServer();
|
|
|
|
+ dev.tr7zw.yatopia.YatopiaConfig.init((File) console.options.valueOf("yatopia-settings"));
|
|
|
|
+ console.server.reloadCount++;
|
|
|
|
+
|
|
|
|
+ Command.broadcastCommandMessage(sender, ChatColor.GREEN + "Yatopia config reload complete.");
|
|
|
|
+ }
|
|
|
|
+}
|
2020-08-03 18:48:42 +02:00
|
|
|
diff --git a/src/main/java/dev/tr7zw/yatopia/YatopiaConfig.java b/src/main/java/dev/tr7zw/yatopia/YatopiaConfig.java
|
2020-06-27 17:23:21 +02:00
|
|
|
new file mode 100644
|
2020-08-15 11:43:24 +02:00
|
|
|
index 0000000000000000000000000000000000000000..b6e34ea413e29792043955a655d4261553825157
|
2020-06-27 17:23:21 +02:00
|
|
|
--- /dev/null
|
2020-08-03 18:48:42 +02:00
|
|
|
+++ b/src/main/java/dev/tr7zw/yatopia/YatopiaConfig.java
|
2020-08-15 11:43:24 +02:00
|
|
|
@@ -0,0 +1,215 @@
|
|
|
|
+package dev.tr7zw.yatopia;
|
|
|
|
+
|
|
|
|
+import com.google.common.base.Throwables;
|
|
|
|
+import java.io.File;
|
|
|
|
+import java.io.IOException;
|
|
|
|
+import java.lang.reflect.InvocationTargetException;
|
|
|
|
+import java.lang.reflect.Method;
|
|
|
|
+import java.lang.reflect.Modifier;
|
|
|
|
+import java.util.HashMap;
|
|
|
|
+import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
+import java.util.concurrent.TimeUnit;
|
|
|
|
+import java.util.logging.Level;
|
|
|
|
+import java.util.regex.Pattern;
|
|
|
|
+import net.minecraft.server.MinecraftServer;
|
|
|
|
+import org.bukkit.Bukkit;
|
|
|
|
+import org.bukkit.command.Command;
|
|
|
|
+import org.bukkit.configuration.InvalidConfigurationException;
|
|
|
|
+import org.bukkit.configuration.file.YamlConfiguration;
|
|
|
|
+
|
|
|
|
+public class YatopiaConfig {
|
|
|
|
+
|
|
|
|
+ public static File CONFIG_FILE;
|
|
|
|
+ private static final String HEADER = "This is the main configuration file for Yatopia.\n"
|
|
|
|
+ + "Yatopia contains many breaking changes and settings, so know what you are doing!\n"
|
|
|
|
+ + "You have been warned!\n";
|
|
|
|
+ /*========================================================================*/
|
|
|
|
+ public static YamlConfiguration config;
|
|
|
|
+ public static int version; // since we're remapping sidestreams' configs we need this public
|
|
|
|
+ static Map<String, Command> commands;
|
|
|
|
+ public static boolean verbose; // since we're remapping sidestreams' configs we need this public
|
|
|
|
+ private static boolean fatalError;
|
|
|
|
+ /*========================================================================*/
|
|
|
|
+ private static boolean metricsStarted;
|
|
|
|
+
|
|
|
|
+ public static void init(File configFile) {
|
|
|
|
+ CONFIG_FILE = configFile;
|
|
|
|
+ config = new YamlConfiguration();
|
|
|
|
+ try {
|
|
|
|
+ config.load(CONFIG_FILE);
|
|
|
|
+ } catch (IOException ex) {
|
|
|
|
+ } catch (InvalidConfigurationException ex) {
|
|
|
|
+ Bukkit.getLogger().log(Level.SEVERE, "Could not load yatopia.yml, please correct your syntax errors", ex);
|
|
|
|
+ throw Throwables.propagate(ex);
|
|
|
|
+ }
|
|
|
|
+ config.options().header(HEADER);
|
|
|
|
+ config.options().copyDefaults(true);
|
|
|
|
+ verbose = getBoolean("verbose", false);
|
|
|
|
+
|
|
|
|
+ commands = new HashMap<String, Command>();
|
|
|
|
+ commands.put("yatopia", new YatopiaCommand("yatopia"));
|
|
|
|
+
|
|
|
|
+ version = getInt("config-version", 1);
|
|
|
|
+ set("config-version", 1);
|
|
|
|
+ removeLeftovers();
|
|
|
|
+ readConfig(YatopiaConfig.class, null);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private static void removeLeftovers() {
|
|
|
|
+ // this method is only to remove non-used values in the config
|
|
|
|
+
|
|
|
|
+ // leftover from akarin / rainforest
|
|
|
|
+ if (config.get("world-settings") != null) {
|
|
|
|
+ set("world-settings", null);
|
|
|
|
+ }
|
|
|
|
+ // unused settings getting removed
|
|
|
|
+ if (config.get("settings.disablePlayerOutOfWorldBorderCheck") != null) {
|
|
|
|
+ set("settings.disablePlayerOutOfWorldBorderCheck", null);
|
|
|
|
+ }
|
|
|
|
+ if (config.get("settings.disableEntityCollisions") != null) {
|
|
|
|
+ set("settings.disableEntityCollisions", null);
|
|
|
|
+ }
|
|
|
|
+ if (config.get("settings.onlyPlayerCollisions") != null) {
|
|
|
|
+ set("settings.onlyPlayerCollisions", null);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ protected static void logError(String s) {
|
|
|
|
+ Bukkit.getLogger().severe(s);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ protected static void fatal(String s) {
|
|
|
|
+ fatalError = true;
|
|
|
|
+ throw new RuntimeException("Fatal yatopia.yml config error: " + s);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ protected static void log(String s) {
|
|
|
|
+ if (verbose) {
|
|
|
|
+ Bukkit.getLogger().info(s);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public static void registerCommands() {
|
|
|
|
+ for (Map.Entry<String, Command> entry : commands.entrySet()) {
|
|
|
|
+ MinecraftServer.getServer().server.getCommandMap().register(entry.getKey(), "Yatopia", entry.getValue());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ static void readConfig(Class<?> clazz, Object instance) {
|
|
|
|
+ for (Method method : clazz.getDeclaredMethods()) {
|
|
|
|
+ if (Modifier.isPrivate(method.getModifiers())) {
|
|
|
|
+ if (method.getParameterTypes().length == 0 && method.getReturnType() == Void.TYPE) {
|
|
|
|
+ try {
|
|
|
|
+ method.setAccessible(true);
|
|
|
|
+ method.invoke(instance);
|
|
|
|
+ } catch (InvocationTargetException ex) {
|
|
|
|
+ throw Throwables.propagate(ex.getCause());
|
|
|
|
+ } catch (Exception ex) {
|
|
|
|
+ Bukkit.getLogger().log(Level.SEVERE, "Error invoking " + method, ex);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ try {
|
|
|
|
+ config.save(CONFIG_FILE);
|
|
|
|
+ } catch (IOException ex) {
|
|
|
|
+ Bukkit.getLogger().log(Level.SEVERE, "Could not save " + CONFIG_FILE, ex);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private static final Pattern SPACE = Pattern.compile(" ");
|
|
|
|
+ private static final Pattern NOT_NUMERIC = Pattern.compile("[^-\\d.]");
|
|
|
|
+
|
|
|
|
+ public static int getSeconds(String str) {
|
|
|
|
+ str = SPACE.matcher(str).replaceAll("");
|
|
|
|
+ final char unit = str.charAt(str.length() - 1);
|
|
|
|
+ str = NOT_NUMERIC.matcher(str).replaceAll("");
|
|
|
|
+ double num;
|
|
|
|
+ try {
|
|
|
|
+ num = Double.parseDouble(str);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ num = 0D;
|
|
|
|
+ }
|
|
|
|
+ switch (unit) {
|
|
|
|
+ case 'd':
|
|
|
|
+ num *= (double) 60 * 60 * 24;
|
|
|
|
+ break;
|
|
|
|
+ case 'h':
|
|
|
|
+ num *= (double) 60 * 60;
|
|
|
|
+ break;
|
|
|
|
+ case 'm':
|
|
|
|
+ num *= 60;
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ case 's':
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ return (int) num;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ protected static String timeSummary(int seconds) {
|
|
|
|
+ String time = "";
|
|
|
|
+
|
|
|
|
+ if (seconds > 60 * 60 * 24) {
|
|
|
|
+ time += TimeUnit.SECONDS.toDays(seconds) + "d";
|
|
|
|
+ seconds %= 60 * 60 * 24;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (seconds > 60 * 60) {
|
|
|
|
+ time += TimeUnit.SECONDS.toHours(seconds) + "h";
|
|
|
|
+ seconds %= 60 * 60;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (seconds > 0) {
|
|
|
|
+ time += TimeUnit.SECONDS.toMinutes(seconds) + "m";
|
|
|
|
+ }
|
|
|
|
+ return time;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private static void set(String path, Object val) {
|
|
|
|
+ config.set(path, val);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private static boolean getBoolean(String path, boolean def) {
|
|
|
|
+ config.addDefault(path, def);
|
|
|
|
+ return config.getBoolean(path, config.getBoolean(path));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private static double getDouble(String path, double def) {
|
|
|
|
+ config.addDefault(path, def);
|
|
|
|
+ return config.getDouble(path, config.getDouble(path));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private static float getFloat(String path, float def) {
|
|
|
|
+ // TODO: Figure out why getFloat() always returns the default value.
|
|
|
|
+ return (float) getDouble(path, (double) def);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private static int getInt(String path, int def) {
|
|
|
|
+ config.addDefault(path, def);
|
|
|
|
+ return config.getInt(path, config.getInt(path));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private static <T> List<T> getList(String path, List<T> def) {
|
|
|
|
+ config.addDefault(path, def);
|
|
|
|
+ return (List<T>) config.getList(path, config.getList(path));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private static String getString(String path, String def) {
|
|
|
|
+ config.addDefault(path, def);
|
|
|
|
+ return config.getString(path, config.getString(path));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public static boolean disableEntityStuckChecks = false;
|
|
|
|
+ private static void disableEntityStuckChecks() {
|
|
|
|
+ disableEntityStuckChecks = getBoolean("settings.disableEntityStuckChecks", false);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public static boolean disableEntityCollisionboxes = false;
|
|
|
|
+ private static void disableEntityCollisionboxes() {
|
|
|
|
+ disableEntityCollisionboxes = getBoolean("settings.disableEntityCollisionboxes", false);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+}
|
2020-06-27 17:23:21 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
|
2020-08-13 17:53:32 +02:00
|
|
|
index a60634fc455e8a59399020689b70eb64b6824d12..cb4a89940cf02de5c3eefc5c746397a931c96b7a 100644
|
2020-06-27 17:23:21 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java
|
2020-08-11 17:38:17 +02:00
|
|
|
@@ -181,6 +181,15 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
|
|
|
// Paper end
|
2020-08-05 02:27:24 +02:00
|
|
|
com.tuinity.tuinity.config.TuinityConfig.init((java.io.File) options.valueOf("tuinity-settings")); // Tuinity - Server Config
|
2020-08-11 17:38:17 +02:00
|
|
|
|
2020-08-03 18:48:42 +02:00
|
|
|
+ // Yatopia start
|
2020-06-27 17:23:21 +02:00
|
|
|
+ try {
|
2020-08-11 17:38:17 +02:00
|
|
|
+ dev.tr7zw.yatopia.YatopiaConfig.init((java.io.File) options.valueOf("yatopia-settings"));
|
|
|
|
+ } catch (Exception e) {
|
2020-06-27 17:23:21 +02:00
|
|
|
+ DedicatedServer.LOGGER.error("Unable to load server configuration", e);
|
|
|
|
+ return false;
|
2020-08-11 17:38:17 +02:00
|
|
|
+ }
|
2020-08-03 18:48:42 +02:00
|
|
|
+ dev.tr7zw.yatopia.YatopiaConfig.registerCommands();
|
|
|
|
+ // Yatopia end
|
2020-06-27 17:23:21 +02:00
|
|
|
this.setPVP(dedicatedserverproperties.pvp);
|
2020-08-03 18:48:42 +02:00
|
|
|
this.setAllowFlight(dedicatedserverproperties.allowFlight);
|
2020-08-13 17:53:32 +02:00
|
|
|
this.setResourcePack(dedicatedserverproperties.resourcePack, this.aZ());
|
2020-06-27 17:23:21 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
2020-08-15 15:34:43 +02:00
|
|
|
index 8b81bfdec79f5ddf9b3ca433e1d09553edc4e79d..968b1c878c519092150d309adf03dcfe3ae2e8ca 100644
|
2020-06-27 17:23:21 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/Entity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/Entity.java
|
2020-08-14 20:16:57 +02:00
|
|
|
@@ -1034,7 +1034,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
2020-06-27 17:23:21 +02:00
|
|
|
VoxelShapeCollision voxelshapecollision = VoxelShapeCollision.a(this);
|
|
|
|
VoxelShape voxelshape = this.world.getWorldBorder().c();
|
2020-06-28 15:31:41 +02:00
|
|
|
Stream<VoxelShape> stream = !this.world.getWorldBorder().isInBounds(axisalignedbb) ? Stream.empty() : Stream.of(voxelshape); // Paper
|
2020-06-27 17:23:21 +02:00
|
|
|
- Stream<VoxelShape> stream1 = this.world.c(this, axisalignedbb.b(vec3d), (entity) -> {
|
2020-08-11 20:40:29 +02:00
|
|
|
+ Stream<VoxelShape> stream1 = dev.tr7zw.yatopia.YatopiaConfig.disableEntityCollisionboxes ? Stream.empty() : this.world.c(this, axisalignedbb.b(vec3d), (entity) -> { // Yatopia
|
2020-06-27 17:23:21 +02:00
|
|
|
return true;
|
|
|
|
});
|
|
|
|
StreamAccumulator<VoxelShape> streamaccumulator = new StreamAccumulator<>(Stream.concat(stream1, stream));
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
2020-08-15 11:43:24 +02:00
|
|
|
index f24f7f1230a380f46112e886fb5dff7c33edb2ce..88f4c30a03e9139b0284ff1a545ad80941dbd46c 100644
|
2020-06-27 17:23:21 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
|
|
|
@@ -266,6 +266,7 @@ public abstract class EntityLiving extends Entity {
|
2020-08-03 18:48:42 +02:00
|
|
|
//this.world.getMethodProfiler().enter("livingEntityBaseTick"); // Akarin - remove caller
|
2020-06-27 17:23:21 +02:00
|
|
|
boolean flag = this instanceof EntityHuman;
|
|
|
|
|
2020-08-15 11:43:24 +02:00
|
|
|
+ if (dev.tr7zw.yatopia.YatopiaConfig.disableEntityStuckChecks) { // Yatopia
|
2020-06-27 17:23:21 +02:00
|
|
|
if (this.isAlive()) {
|
|
|
|
if (this.inBlock()) {
|
|
|
|
this.damageEntity(DamageSource.STUCK, 1.0F);
|
|
|
|
@@ -281,6 +282,7 @@ public abstract class EntityLiving extends Entity {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-08-13 17:53:32 +02:00
|
|
|
+ } // Yatopia
|
2020-06-27 17:23:21 +02:00
|
|
|
|
|
|
|
if (this.isFireProof() || this.world.isClientSide) {
|
|
|
|
this.extinguish();
|
2020-08-11 17:38:17 +02:00
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
2020-08-15 11:43:24 +02:00
|
|
|
index e2a540d07c68e4ca9b2a2a46d6ba9a33903eced9..40e0ce2fbad4af193ede76047ad7d894369f10c9 100644
|
2020-08-11 17:38:17 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
2020-08-13 17:53:32 +02:00
|
|
|
@@ -837,6 +837,7 @@ public final class CraftServer implements Server {
|
2020-08-11 17:38:17 +02:00
|
|
|
net.pl3x.purpur.PurpurConfig.init((File) console.options.valueOf("purpur-settings")); // Purpur
|
|
|
|
com.proximyst.rainforest.RainforestConfig.init((File) console.options.valueOf("rainforest-settings")); // Rainforest
|
2020-08-15 11:43:24 +02:00
|
|
|
de.minebench.origami.OrigamiConfig.init((File) console.options.valueOf("origami-settings")); // Origami
|
2020-08-11 17:38:17 +02:00
|
|
|
+ dev.tr7zw.yatopia.YatopiaConfig.init((File) console.options.valueOf("yatopia-settings")); // Yatopia
|
|
|
|
for (WorldServer world : console.getWorlds()) {
|
|
|
|
world.worldDataServer.setDifficulty(config.difficulty);
|
|
|
|
world.setSpawnFlags(config.spawnMonsters, config.spawnAnimals);
|
2020-08-15 11:43:24 +02:00
|
|
|
@@ -2265,6 +2266,13 @@ public final class CraftServer implements Server {
|
|
|
|
return de.minebench.origami.OrigamiConfig.config;
|
2020-08-13 17:53:32 +02:00
|
|
|
}
|
|
|
|
// Origami end
|
2020-08-15 11:43:24 +02:00
|
|
|
+
|
2020-08-13 17:53:32 +02:00
|
|
|
+ // Yatopia start
|
2020-08-15 11:43:24 +02:00
|
|
|
+ @Override
|
2020-08-13 17:53:32 +02:00
|
|
|
+ public YamlConfiguration getYatopiaConfig() {
|
|
|
|
+ return dev.tr7zw.yatopia.YatopiaConfig.config;
|
|
|
|
+ }
|
|
|
|
+ // Yatopia end
|
2020-08-15 11:43:24 +02:00
|
|
|
|
2020-08-13 17:53:32 +02:00
|
|
|
@Override
|
|
|
|
public void restart() {
|
2020-08-11 17:38:17 +02:00
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
2020-08-15 11:43:24 +02:00
|
|
|
index 63cbecc4cdd549247b58fd094c27683655667799..afbcaee4177323da039793bc27869085c632c76a 100644
|
2020-08-11 17:38:17 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
2020-08-15 11:43:24 +02:00
|
|
|
@@ -169,6 +169,14 @@ public class Main {
|
2020-08-11 17:38:17 +02:00
|
|
|
.describedAs("Yml file");
|
2020-08-15 11:43:24 +02:00
|
|
|
// Origami end
|
2020-08-11 17:38:17 +02:00
|
|
|
|
|
|
|
+ // Yatopia start
|
|
|
|
+ acceptsAll(asList("yatopia", "yatopia-settings"), "File for yatopia settings")
|
|
|
|
+ .withRequiredArg()
|
|
|
|
+ .ofType(File.class)
|
|
|
|
+ .defaultsTo(new File("yatopia.yml"))
|
|
|
|
+ .describedAs("Yml file");
|
|
|
|
+ // Yatopia end
|
|
|
|
+
|
|
|
|
// Paper start
|
|
|
|
acceptsAll(asList("server-name"), "Name of the server")
|
|
|
|
.withRequiredArg()
|