Updated Upstream and Sidestream(s) (Tuinity/Origami/Purpur)

Upstream/An Sidestream has released updates that appears to apply and compile correctly
This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing.

Tuinity Changes:
abeafb0 Updated Upstream (Paper)

Origami Changes:
e204bb8 Update Paper

Purpur Changes:
c7b279f Updated Upstream (Paper & Tuinity)
This commit is contained in:
Ivan Pekov 2021-01-05 19:21:38 +02:00
parent 548b666d62
commit 2b156e3c9c
No known key found for this signature in database
GPG Key ID: BC975C392D9CA3A3
23 changed files with 149 additions and 421 deletions

@ -1 +1 @@
Subproject commit 78f4af0495caff22cce5e8a05b2e2b15f85af1ba
Subproject commit e204bb8e0fa441dd74d2df98c0444cc2f43854a3

View File

@ -76,13 +76,11 @@ This is an overview over all patches that are currently used.
| server | Highly optimize VillagePlace filtering | Ivan Pekov | |
| server | Hopper Optimizations | Phoenix616 | |
| server | Implement TPSBar | BillyGalbreath | |
| server | Implement bamboo growth settings | William Blake Galbreath | |
| server | Implement infinite lava | William Blake Galbreath | |
| server | Improve task performance | ishland | Mykyta Komarn |
| server | Infinity No Arrows | Bud Gidiere | |
| server | Infinity bow settings | William Blake Galbreath | |
| server | Item stuck sleep config | tr7zw | |
| api | Kill AnnotationTest | tr7zw | |
| server | Lagging threshold | William Blake Galbreath | |
| server | MC-147659 - Fix non black cats spawning in swamp huts | William Blake Galbreath | |
| server | MC-168772 Fix - Add turtle egg block options | William Blake Galbreath | |

2
Purpur

@ -1 +1 @@
Subproject commit da957253a39022c68bc1a8cc2914066791f4855c
Subproject commit c7b279fe1bc55120c2902609d124f2940f74b231

@ -1 +1 @@
Subproject commit 076174a1116aee549bc536af1bb08a41272415c6
Subproject commit abeafb0f5ec4fb534dbf34c116970ad65260f085

View File

@ -1 +1 @@
Purpur-config-files&Timings-stuff&Add-component-util&Barrels-and-enderchests-6-rows&Lagging-threshold&Configurable-villager-brain-ticks&Alternative-Keepalive-Handling&MC-168772-Fix-Add-turtle-egg-block-options&Fix-vanilla-command-permission-handler&Fix-outdated-server-showing-in-ping-before-server-fu&Dont-send-useless-entity-packets&MC-147659-Fix-non-black-cats-spawning-in-swamp-huts&Cows-eat-mushrooms&Snowman-drop-and-put-back-pumpkin&Signs-editable-on-right-click&Signs-allow-color-codes&Allow-soil-to-moisten-from-water-directly-under-it&Option-to-toggle-milk-curing-bad-omen&Fix-the-dead-lagging-the-server&Skip-events-if-there-s-no-listeners&Add-permission-for-F3-N-debug&Allow-leashing-villagers&Implement-infinite-lava&Make-lava-flow-speed-configurable&PaperPR-Projectile-load-save-limit-per-chunk&Implement-bamboo-growth-settings&Add-5-second-tps-average-in-tps&Entity-lifespan&Squid-EAR-immunity&Allow-anvil-colors&Add-no-tick-block-list&Add-option-to-disable-dolphin-treasure-searching&Stop-squids-floating-on-top-of-water&Despawn-rate-config-options-per-projectile-type&PaperPR-Add-hex-color-code-support-for-console-loggi&Persistent-TileEntity-Lore-and-DisplayName&Infinity-bow-settings&Allow-infinite-and-mending-enchantments-together&Add-twisting-and-weeping-vines-growth-rates&Config-migration-disable-saving-projectiles-to-disk-&Spread-out-and-optimise-player-list-ticks&Implement-TPSBar
Purpur-config-files&Timings-stuff&Add-component-util&Barrels-and-enderchests-6-rows&Lagging-threshold&Configurable-villager-brain-ticks&Alternative-Keepalive-Handling&MC-168772-Fix-Add-turtle-egg-block-options&Fix-vanilla-command-permission-handler&Fix-outdated-server-showing-in-ping-before-server-fu&Dont-send-useless-entity-packets&MC-147659-Fix-non-black-cats-spawning-in-swamp-huts&Cows-eat-mushrooms&Snowman-drop-and-put-back-pumpkin&Signs-editable-on-right-click&Signs-allow-color-codes&Allow-soil-to-moisten-from-water-directly-under-it&Option-to-toggle-milk-curing-bad-omen&Fix-the-dead-lagging-the-server&Skip-events-if-there-s-no-listeners&Add-permission-for-F3-N-debug&Allow-leashing-villagers&Implement-infinite-lava&Make-lava-flow-speed-configurable&PaperPR-Projectile-load-save-limit-per-chunk&Add-5-second-tps-average-in-tps&Entity-lifespan&Squid-EAR-immunity&Allow-anvil-colors&Add-no-tick-block-list&Add-option-to-disable-dolphin-treasure-searching&Stop-squids-floating-on-top-of-water&Despawn-rate-config-options-per-projectile-type&PaperPR-Add-hex-color-code-support-for-console-loggi&Persistent-TileEntity-Lore-and-DisplayName&Infinity-bow-settings&Allow-infinite-and-mending-enchantments-together&Add-twisting-and-weeping-vines-growth-rates&Config-migration-disable-saving-projectiles-to-disk-&Spread-out-and-optimise-player-list-ticks&Implement-TPSBar

View File

@ -25,6 +25,18 @@ index fecd7b14d317f55eb1ce7b5c6af9913917971427..6df897ed32a94df4a06e1d5ac3d749e6
+ }
+ // Purpur end
}
diff --git a/src/main/java/org/bukkit/ChatColor.java b/src/main/java/org/bukkit/ChatColor.java
index 06bdfddb7b1acb7bb7b347ad1aa13bff0c823ab1..bd2723618272068bee0fb6be8d702c34cb44762b 100644
--- a/src/main/java/org/bukkit/ChatColor.java
+++ b/src/main/java/org/bukkit/ChatColor.java
@@ -312,6 +312,7 @@ public enum ChatColor {
* @return Associative {@link org.bukkit.ChatColor} with the given id,
* or null if it doesn't exist
*/
+ @Nullable // Yatopia
public static ChatColor getById(int id) {
return BY_ID.get(id);
}
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index b45ad8df8b7a44c9e6d12326e5ea85e8d166a16c..40d342ef1a618b7d85731b238b0344402e551251 100644
--- a/src/main/java/org/bukkit/Server.java

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Modify POM
diff --git a/pom.xml b/pom.xml
index 4516ba097e8afc3e422efc368311fa66e967c05a..f641f2b375bdb5c43880ff67195764c4d4124155 100644
index 024be926afb1219c6443c496721f4bd0a4fec222..89542d52c14cc009d8bf50f446ab2bebb8516c94 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,18 +3,18 @@

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Add GameProfileLookupEvent
diff --git a/pom.xml b/pom.xml
index f641f2b375bdb5c43880ff67195764c4d4124155..31aba885d940acf0a9df5d4e83dfec69030b2a37 100644
index 89542d52c14cc009d8bf50f446ab2bebb8516c94..3e6971d0bbc383e4639e402c076af5292ee9236a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -52,6 +52,10 @@
@ -35,18 +35,18 @@ index f641f2b375bdb5c43880ff67195764c4d4124155..31aba885d940acf0a9df5d4e83dfec69
<artifactId>fastutil</artifactId>
diff --git a/src/main/java/dev/tr7zw/yatopia/events/GameProfileLookupEvent.java b/src/main/java/dev/tr7zw/yatopia/events/GameProfileLookupEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..ff58b8875a07b34de02b9b479ff3e6daf66d7832
index 0000000000000000000000000000000000000000..313fe42442a93db76f91eaab50a345340f314fa8
--- /dev/null
+++ b/src/main/java/dev/tr7zw/yatopia/events/GameProfileLookupEvent.java
@@ -0,0 +1,45 @@
@@ -0,0 +1,51 @@
+package dev.tr7zw.yatopia.events;
+
+import com.mojang.authlib.GameProfile;
+import java.util.UUID;
+
+import org.bukkit.event.Event;
+import org.bukkit.event.HandlerList;
+
+import com.mojang.authlib.GameProfile;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+public class GameProfileLookupEvent extends Event {
+ private static final HandlerList handlers = new HandlerList();
@ -54,32 +54,38 @@ index 0000000000000000000000000000000000000000..ff58b8875a07b34de02b9b479ff3e6da
+ private final UUID uuid;
+ private final String name;
+
+ public GameProfileLookupEvent(boolean async, UUID uuid, String name) {
+ super(async);
+ this.uuid = uuid;
+ this.name = name;
+ }
+ public GameProfileLookupEvent(boolean async, @NotNull UUID uuid, @NotNull String name) {
+ super(async);
+ this.uuid = uuid;
+ this.name = name;
+ }
+
+ public GameProfile getGameProfile() {
+ return gameProfile;
+ }
+ @Nullable
+ public GameProfile getGameProfile() {
+ return gameProfile;
+ }
+
+ public void setGameProfile(GameProfile gameProfile) {
+ this.gameProfile = gameProfile;
+ }
+ public void setGameProfile(@Nullable GameProfile gameProfile) {
+ this.gameProfile = gameProfile;
+ }
+
+ public UUID getUuid() {
+ return uuid;
+ }
+ @NotNull
+ public UUID getUuid() {
+ return uuid;
+ }
+
+ public String getName() {
+ return name;
+ }
+ @NotNull
+ public String getName() {
+ return name;
+ }
+
+ public HandlerList getHandlers() {
+ @NotNull
+ @Override
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }

View File

@ -1,271 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: tr7zw <tr7zw@live.de>
Date: Sat, 1 Aug 2020 15:52:19 -0500
Subject: [PATCH] Kill AnnotationTest
diff --git a/src/test/java/org/bukkit/AnnotationTest.java b/src/test/java/org/bukkit/AnnotationTest.java
deleted file mode 100644
index a48be38b159bec27ec398666b28620a9ea625547..0000000000000000000000000000000000000000
--- a/src/test/java/org/bukkit/AnnotationTest.java
+++ /dev/null
@@ -1,259 +0,0 @@
-package org.bukkit;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-import org.junit.Assert;
-import org.junit.Test;
-import org.objectweb.asm.ClassReader;
-import org.objectweb.asm.Opcodes;
-import org.objectweb.asm.Type;
-import org.objectweb.asm.tree.AnnotationNode;
-import org.objectweb.asm.tree.ClassNode;
-import org.objectweb.asm.tree.MethodNode;
-import org.objectweb.asm.tree.ParameterNode;
-
-public class AnnotationTest {
-
- private static final String[] ACCEPTED_ANNOTATIONS = {
- "Lorg/jetbrains/annotations/Nullable;",
- "Lorg/jetbrains/annotations/NotNull;",
- "Lorg/jetbrains/annotations/Contract;",
- "Lorg/bukkit/UndefinedNullability;"
- };
-
- private static final String[] EXCLUDED_CLASSES = {
- // Internal technical classes
- "org/bukkit/plugin/java/JavaPluginLoader",
- "org/bukkit/util/io/BukkitObjectInputStream",
- "org/bukkit/util/io/BukkitObjectOutputStream",
- "org/bukkit/util/io/Wrapper",
- "org/bukkit/plugin/java/PluginClassLoader",
- // Generic functional interface
- "org/bukkit/util/Consumer",
- // Paper start
- // Timings history is broken in terms of nullability due to guavas Function defining that the param is NonNull
- "co/aikar/timings/TimingHistory$2",
- "co/aikar/timings/TimingHistory$2$1",
- "co/aikar/timings/TimingHistory$2$1$1",
- "co/aikar/timings/TimingHistory$2$1$2",
- "co/aikar/timings/TimingHistory$3",
- "co/aikar/timings/TimingHistory$4",
- "co/aikar/timings/TimingHistoryEntry$1"
- // Paper end
- };
-
- @Test
- public void testAll() throws IOException, URISyntaxException {
- URL loc = Bukkit.class.getProtectionDomain().getCodeSource().getLocation();
- File file = new File(loc.toURI());
-
- // Running from jar is not supported yet
- Assert.assertTrue("code must be in a directory", file.isDirectory());
-
- final HashMap<String, ClassNode> foundClasses = new HashMap<>();
- collectClasses(file, foundClasses);
-
- final ArrayList<String> errors = new ArrayList<>();
-
- for (ClassNode clazz : foundClasses.values()) {
- if (!isClassIncluded(clazz, foundClasses)) {
- continue;
- }
-
- for (MethodNode method : clazz.methods) {
- if (!isMethodIncluded(clazz, method, foundClasses)) {
- continue;
- }
-
- if (mustBeAnnotated(Type.getReturnType(method.desc)) && !isWellAnnotated(method.invisibleAnnotations)) {
- warn(errors, clazz, method, "return value");
- }
-
- Type[] paramTypes = Type.getArgumentTypes(method.desc);
- List<ParameterNode> parameters = method.parameters;
-
- for (int i = 0; i < paramTypes.length; i++) {
- if (mustBeAnnotated(paramTypes[i]) && !isWellAnnotated(method.invisibleParameterAnnotations == null ? null : method.invisibleParameterAnnotations[i])) {
- ParameterNode paramNode = parameters == null ? null : parameters.get(i);
- String paramName = paramNode == null ? null : paramNode.name;
-
- warn(errors, clazz, method, "parameter " + i + (paramName == null ? "" : ": " + paramName));
- }
- }
- }
- }
-
- if (errors.isEmpty()) {
- // Success
- return;
- }
-
- Collections.sort(errors);
-
- System.out.println(errors.size() + " missing annotation(s):");
- for (String message : errors) {
- System.out.print("\t");
- System.out.println(message);
- }
-
- Assert.fail("There " + errors.size() + " are missing annotation(s)");
- }
-
- private static void collectClasses(@NotNull File from, @NotNull Map<String, ClassNode> to) throws IOException {
- if (from.isDirectory()) {
- final File[] files = from.listFiles();
- assert files != null;
-
- for (File file : files) {
- collectClasses(file, to);
- }
- return;
- }
-
- if (!from.getName().endsWith(".class")) {
- return;
- }
-
- try (FileInputStream in = new FileInputStream(from)) {
- final ClassReader cr = new ClassReader(in);
-
- final ClassNode node = new ClassNode();
- cr.accept(node, ClassReader.SKIP_CODE | ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES);
-
- to.put(node.name, node);
- }
- }
-
- private static boolean isClassIncluded(@NotNull ClassNode clazz, @NotNull Map<String, ClassNode> allClasses) {
- // Exclude private, synthetic or deprecated classes and annotations, since their members can't be null
- if ((clazz.access & (Opcodes.ACC_PRIVATE | Opcodes.ACC_SYNTHETIC | Opcodes.ACC_DEPRECATED | Opcodes.ACC_ANNOTATION)) != 0) {
- return false;
- }
-
- if (isSubclassOf(clazz, "org/bukkit/material/MaterialData", allClasses)) {
- throw new AssertionError("Subclass of MaterialData must be deprecated: " + clazz.name);
- }
-
- if (isSubclassOf(clazz, "java/lang/Exception", allClasses)
- || isSubclassOf(clazz, "java/lang/RuntimeException", allClasses)) {
- // Exceptions are excluded
- return false;
- }
-
- for (String excludedClass : EXCLUDED_CLASSES) {
- if (excludedClass.equals(clazz.name)) {
- return false;
- }
- }
-
- return true;
- }
-
- private static boolean isMethodIncluded(@NotNull ClassNode clazz, @NotNull MethodNode method, @NotNull Map<String, ClassNode> allClasses) {
- // Exclude private, synthetic and deprecated methods
- if ((method.access & (Opcodes.ACC_PRIVATE | Opcodes.ACC_SYNTHETIC | Opcodes.ACC_DEPRECATED)) != 0 || (method.access & (Opcodes.ACC_PRIVATE | Opcodes.ACC_PROTECTED | Opcodes.ACC_PUBLIC)) == 0) { // Paper - ignore package-private
- return false;
- }
-
- // Exclude Java methods
- if (is(method, "toString", 0) || is(method, "clone", 0) || is(method, "equals", 1)) {
- return false;
- }
-
- // Exclude generated Enum methods
- if (isSubclassOf(clazz, "java/lang/Enum", allClasses) && (is(method, "values", 0) || is(method, "valueOf", 1))) {
- return false;
- }
-
- // Anonymous classes have generated constructors, which can't be annotated nor invoked
- if ("<init>".equals(method.name) && isAnonymous(clazz)) {
- return false;
- }
-
- return true;
- }
-
- private static boolean isWellAnnotated(@Nullable List<AnnotationNode> annotations) {
- if (annotations == null) {
- return false;
- }
-
- for (AnnotationNode node : annotations) {
- for (String acceptedAnnotation : ACCEPTED_ANNOTATIONS) {
- if (acceptedAnnotation.equals(node.desc)) {
- return true;
- }
- }
- }
-
- return false;
- }
-
- private static boolean mustBeAnnotated(@NotNull Type type) {
- return type.getSort() == Type.ARRAY || type.getSort() == Type.OBJECT;
- }
-
- private static boolean is(@NotNull MethodNode method, @NotNull String name, int parameters) {
- final List<ParameterNode> params = method.parameters;
- return method.name.equals(name) && (params == null || params.size() == parameters);
- }
-
- /**
- * Checks if the class is anonymous.
- *
- * @param clazz the class to check
- * @return true if given class is anonymous
- */
- private static boolean isAnonymous(@NotNull ClassNode clazz) {
- final String name = clazz.name;
- if (name == null) {
- return false;
- }
- final int nestedSeparator = name.lastIndexOf('$');
- if (nestedSeparator == -1 || nestedSeparator + 1 == name.length()) {
- return false;
- }
-
- // Nested classes have purely numeric names. Java classes can't begin with a number,
- // so if first character is a number, the class must be anonymous
- final char c = name.charAt(nestedSeparator + 1);
- return c >= '0' && c <= '9';
- }
-
- private static boolean isSubclassOf(@NotNull ClassNode what, @NotNull String ofWhat, @NotNull Map<String, ClassNode> allClasses) {
- if (ofWhat.equals(what.name)
- // Not only optimization: Super class may not be present in allClasses, so it is checked here
- || ofWhat.equals(what.superName)) {
- return true;
- }
-
- final ClassNode parent = allClasses.get(what.superName);
- if (parent != null && isSubclassOf(parent, ofWhat, allClasses)) {
- return true;
- }
-
- for (String superInterface : what.interfaces) {
- final ClassNode interfaceParent = allClasses.get(superInterface);
- if (interfaceParent != null && isSubclassOf(interfaceParent, ofWhat, allClasses)) {
- return true;
- }
- }
-
- return false;
- }
-
- private static void warn(@NotNull Collection<String> out, @NotNull ClassNode clazz, @NotNull MethodNode method, @NotNull String description) {
- out.add(clazz.name + " \t" + method.name + " \t" + description);
- }
-}

View File

@ -7,7 +7,7 @@ Original patch by:
Co-authored-by: tr7zw <tr7zw@live.de>
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 6df897ed32a94df4a06e1d5ac3d749e6a360ab2f..7b704b5841aa2f212b70719cf9bd79b4fb21fcf0 100644
index 6df897ed32a94df4a06e1d5ac3d749e6a360ab2f..b08a5a91315f3cd80c4c4ef47f5fc6755cbf73d8 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -1828,4 +1828,14 @@ public final class Bukkit {
@ -20,16 +20,16 @@ index 6df897ed32a94df4a06e1d5ac3d749e6a360ab2f..7b704b5841aa2f212b70719cf9bd79b4
+ public static long getLastTickMs() {
+ return server.getLastTickMs();
+ }
+ public static java.time.Duration getLastTickTime() {
+ @NotNull public static java.time.Duration getLastTickTime() {
+ return server.getLastTickTime();
+ }
+ // Yatopia end
}
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 40d342ef1a618b7d85731b238b0344402e551251..2f86ada4a487a6d59fa8b173c8339dcdda65cb30 100644
index 40d342ef1a618b7d85731b238b0344402e551251..d6ba0895f259c15de9fb974a5c74da709158fc28 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1651,4 +1651,23 @@ public interface Server extends PluginMessageRecipient {
@@ -1651,4 +1651,24 @@ public interface Server extends PluginMessageRecipient {
*/
boolean isLagging();
// Purpur end
@ -50,6 +50,7 @@ index 40d342ef1a618b7d85731b238b0344402e551251..2f86ada4a487a6d59fa8b173c8339dcd
+ *
+ * @return duration
+ */
+ @NotNull
+ java.time.Duration getLastTickTime();
+ // Yatopia end
}

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Add NBT API as a first-class lib
diff --git a/pom.xml b/pom.xml
index 31aba885d940acf0a9df5d4e83dfec69030b2a37..cb8eaf5dd3c89193960a433cdc5b6c2903076499 100644
index 3e6971d0bbc383e4639e402c076af5292ee9236a..0e762240836299630743f29d00db03ffa193d4ab 100644
--- a/pom.xml
+++ b/pom.xml
@@ -56,6 +56,11 @@

View File

@ -6,12 +6,13 @@ Subject: [PATCH] ProxyForwardDataEvent
diff --git a/src/main/java/net/yatopia/api/event/ProxyForwardDataEvent.java b/src/main/java/net/yatopia/api/event/ProxyForwardDataEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..22775d2d03ccd4c7decebc3e26b453efd44d865b
index 0000000000000000000000000000000000000000..d3780d965bdd491425a92bf5e554f7def6e0ecf0
--- /dev/null
+++ b/src/main/java/net/yatopia/api/event/ProxyForwardDataEvent.java
@@ -0,0 +1,114 @@
@@ -0,0 +1,125 @@
+package net.yatopia.api.event;
+
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableList;
+import com.mojang.authlib.properties.Property;
+import java.util.List;
@ -19,6 +20,7 @@ index 0000000000000000000000000000000000000000..22775d2d03ccd4c7decebc3e26b453ef
+import org.bukkit.event.Event;
+import org.bukkit.event.HandlerList;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Called when a proxy such as BungeeCord or Velocity forwards player data to the server.
@ -29,7 +31,7 @@ index 0000000000000000000000000000000000000000..22775d2d03ccd4c7decebc3e26b453ef
+ private final String name;
+ private List<Property> properties;
+
+ public ProxyForwardDataEvent(boolean async, UUID uuid, String name, List<Property> properties) {
+ public ProxyForwardDataEvent(boolean async, @NotNull UUID uuid, @NotNull String name, @NotNull List<Property> properties) {
+ super(async);
+ this.uuid = uuid;
+ this.name = name;
@ -41,6 +43,7 @@ index 0000000000000000000000000000000000000000..22775d2d03ccd4c7decebc3e26b453ef
+ *
+ * @return unique id
+ */
+ @NotNull
+ public UUID getUuid() {
+ return uuid;
+ }
@ -50,15 +53,19 @@ index 0000000000000000000000000000000000000000..22775d2d03ccd4c7decebc3e26b453ef
+ *
+ * @return name
+ */
+ @NotNull
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Returns an immutable copy of the forwarded properties.
+ * <p>
+ * If there were no properties, it would return an empty list.
+ *
+ * @return properties
+ */
+ @NotNull
+ public List<Property> getProperties() {
+ return ImmutableList.copyOf(properties);
+ }
@ -68,7 +75,8 @@ index 0000000000000000000000000000000000000000..22775d2d03ccd4c7decebc3e26b453ef
+ *
+ * @param property property
+ */
+ public void addProperty(Property property) {
+ public void addProperty(@NotNull Property property) {
+ Preconditions.checkNotNull(property, "property");
+ if (hasProperty(property.getName())) {
+ removeProperty(property.getName());
+ }
@ -81,9 +89,11 @@ index 0000000000000000000000000000000000000000..22775d2d03ccd4c7decebc3e26b453ef
+ * @param property the property's name you want to get
+ * @return property if present
+ */
+ public Property getProperty(String property) {
+ @Nullable
+ public Property getProperty(@NotNull String property) {
+ Preconditions.checkNotNull(property, "property");
+ for (Property prop : properties) {
+ if (prop.getName().toLowerCase().equalsIgnoreCase(property.toLowerCase())) {
+ if (prop.getName().equalsIgnoreCase(property)) {
+ return prop;
+ }
+ }
@ -96,7 +106,7 @@ index 0000000000000000000000000000000000000000..22775d2d03ccd4c7decebc3e26b453ef
+ * @param property the name of the property you want to check if exists
+ * @return boolean value
+ */
+ public boolean hasProperty(String property) {
+ public boolean hasProperty(@NotNull String property) {
+ return getProperty(property) != null;
+ }
+
@ -105,8 +115,8 @@ index 0000000000000000000000000000000000000000..22775d2d03ccd4c7decebc3e26b453ef
+ *
+ * @param property the property's name you want to remove
+ */
+ public void removeProperty(String property) {
+ properties.removeIf(prop -> prop.getName().toLowerCase().equalsIgnoreCase(property.toLowerCase()));
+ public void removeProperty(@NotNull String property) {
+ properties.removeIf(prop -> prop.getName().equalsIgnoreCase(property));
+ }
+
+ /**
@ -114,13 +124,14 @@ index 0000000000000000000000000000000000000000..22775d2d03ccd4c7decebc3e26b453ef
+ *
+ * @param property the property you want to remove
+ */
+ public void removeProperty(Property property) {
+ public void removeProperty(@NotNull Property property) {
+ Preconditions.checkNotNull(property, "property");
+ properties.remove(property);
+ }
+
+ //
+ private static final HandlerList handlers = new HandlerList();
+ @NotNull @Override public HandlerList getHandlers() { return handlers; }
+ public static HandlerList getHandlerList() { return handlers; }
+ @NotNull public static HandlerList getHandlerList() { return handlers; }
+ //
+}

View File

@ -7,10 +7,10 @@ Added per request
diff --git a/src/main/java/net/yatopia/api/event/PlayerAttackEntityEvent.java b/src/main/java/net/yatopia/api/event/PlayerAttackEntityEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..72e2cfd4c62f02154d8dddaa964249fe5aa64e98
index 0000000000000000000000000000000000000000..7a4bd2d6518409972651373c3e6ea0fd17f8fcf7
--- /dev/null
+++ b/src/main/java/net/yatopia/api/event/PlayerAttackEntityEvent.java
@@ -0,0 +1,121 @@
@@ -0,0 +1,123 @@
+package net.yatopia.api.event;
+
+import org.bukkit.entity.Entity;
@ -37,7 +37,7 @@ index 0000000000000000000000000000000000000000..72e2cfd4c62f02154d8dddaa964249fe
+ private boolean criticalHit;
+ private float damage;
+
+ public PlayerAttackEntityEvent(HumanEntity attacker, Entity attacked, ItemStack attackItem, boolean criticalHit, float damage) {
+ public PlayerAttackEntityEvent(@NotNull HumanEntity attacker, @NotNull Entity attacked, @NotNull ItemStack attackItem, boolean criticalHit, float damage) {
+ this.attacker = attacker;
+ this.attacked = attacked;
+ this.attackItem = attackItem;
@ -67,6 +67,8 @@ index 0000000000000000000000000000000000000000..72e2cfd4c62f02154d8dddaa964249fe
+
+ /**
+ * Returns the attack item used to damage the {@link #getAttackedEntity()}
+ * <p>
+ * If there wasn't any item, it would return ItemStack(Material.AIR)
+ *
+ * @return attack item
+ */
@ -129,6 +131,6 @@ index 0000000000000000000000000000000000000000..72e2cfd4c62f02154d8dddaa964249fe
+ //
+ private static final HandlerList handlers = new HandlerList();
+ @NotNull @Override public HandlerList getHandlers() { return handlers; }
+ public static HandlerList getHandlerList() { return handlers; }
+ @NotNull public static HandlerList getHandlerList() { return handlers; }
+ //
+}

View File

@ -4,37 +4,6 @@ Date: Sun, 25 Oct 2020 12:23:35 -0500
Subject: [PATCH] Yatopia-Server-Fixes
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 80409c4b52a4bb7146760070dae0e04d49bdd6b3..0bca517b4948cd55bfbf3ba4d5c1b3cd895cc086 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -731,4 +731,9 @@ public class PaperWorldConfig {
private void disableMobSpawnerSpawnEggTransformation() {
disableMobSpawnerSpawnEggTransformation = getBoolean("game-mechanics.disable-mob-spawner-spawn-egg-transformation", disableMobSpawnerSpawnEggTransformation);
}
+
+ public int projectileSaveLimit = -1;
+ private void projectileSaveLimit() {
+ projectileSaveLimit = getInt("projectile-load-save-per-chunk-limit", projectileSaveLimit);
+ }
}
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java.rej b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java.rej
deleted file mode 100644
index 67f63901bdbae923eb6262d522b5198f9df5a7bc..0000000000000000000000000000000000000000
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java.rej
+++ /dev/null
@@ -1,11 +0,0 @@
-diff a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java (rejected hunks)
-@@ -709,4 +709,9 @@ public class PaperWorldConfig {
- private void fixCuringExploit() {
- fixCuringZombieVillagerDiscountExploit = getBoolean("game-mechanics.fix-curing-zombie-villager-discount-exploit", fixCuringZombieVillagerDiscountExploit);
- }
-+
-+ public int projectileSaveLimit = -1;
-+ private void projectileSaveLimit() {
-+ projectileSaveLimit = getInt("projectile-load-save-per-chunk-limit", projectileSaveLimit);
-+ }
- }
diff --git a/src/main/java/de/minebench/origami/OrigamiConfig.java b/src/main/java/de/minebench/origami/OrigamiConfig.java
index fe7330fabe386966c2d203a190a00a785ea21be0..537456a7427cddd6783f5b5d8ee2d655668c4c53 100644
--- a/src/main/java/de/minebench/origami/OrigamiConfig.java

View File

@ -65,7 +65,7 @@ index fcf2bf8962cf6bc33d4213c1101debae4afa7114..ea882b3ff0608e23852e48e7aa10f364
private final String bukkitVersion = Versioning.getBukkitVersion();
private final Logger logger = Logger.getLogger("Minecraft");
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index dbc934b374ff1b9eb4b66d2365e89c39c951763b..3c603e2358de71f534e88551b72f202d190f58fe 100644
index dbc934b374ff1b9eb4b66d2365e89c39c951763b..00e7eb476f21a7ee711d6c5847a57154e79d9f1e 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -275,7 +275,7 @@ public class Main {
@ -73,7 +73,7 @@ index dbc934b374ff1b9eb4b66d2365e89c39c951763b..3c603e2358de71f534e88551b72f202d
// Paper start - This is some stupid bullshit
System.err.println("*** Warning, you've not updated in a while! ***");
- System.err.println("*** Please download a new build ***"); // Paper // Tuinity
+ System.err.println("*** Please download a new build as per instructions from https://yatopia.net/download ***"); // Paper // Tuinity // Yatopia
+ System.err.println("*** Please download a new build as per instructions from https://yatopiamc.org/download ***"); // Paper // Tuinity // Yatopia
//System.err.println("*** Server will start in 20 seconds ***");
//Thread.sleep(TimeUnit.SECONDS.toMillis(20));
// Paper End

View File

@ -106,7 +106,7 @@ index 248605cc533e4cad4b75b92b1d88ef6aa03f4c5c..40aaa7c1fe0bf0a5031d5e1e15035a40
public void restart() {
org.spigotmc.RestartCommand.restart();
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index 3c603e2358de71f534e88551b72f202d190f58fe..ce08abf2eabfdb606b806f4d6d374055f5e10168 100644
index 00e7eb476f21a7ee711d6c5847a57154e79d9f1e..e7818d40d9cac682eb28fadf319d08f8ca88e89d 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -162,6 +162,14 @@ public class Main {

View File

@ -52,7 +52,7 @@ index 0a9f03526abf0638ada15d9810b949887fca9f9a..64b662dc9146d0d414a9668d9b93e07a
this.setAllowFlight(dedicatedserverproperties.allowFlight);
this.setResourcePack(dedicatedserverproperties.resourcePack, this.ba());
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index ce08abf2eabfdb606b806f4d6d374055f5e10168..b9d11f4ba9a49d955b487ccf5a6dac4e1c9ba19b 100644
index e7818d40d9cac682eb28fadf319d08f8ca88e89d..605b7477dfce17c5d9752fd48a71098739e3f4c2 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -303,7 +303,7 @@ public class Main {

View File

@ -25,7 +25,7 @@ index 79f726ef43e70b8882890007146df199824d14e3..edb7a9de55718d9c860c82580aca78c3
{
ChatMessage chatmessage = new ChatMessage("If you wish to use IP forwarding, please enable it in your BungeeCord config as well!");
diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java
index d987483255195c0bde713a92676baced1eaff2b3..2fa0f21cfa81670f6c3f18f76e7fa8d0bb541f11 100644
index d987483255195c0bde713a92676baced1eaff2b3..bb45fc83d81948c84bc721961474e5e806ab404a 100644
--- a/src/main/java/net/minecraft/server/LoginListener.java
+++ b/src/main/java/net/minecraft/server/LoginListener.java
@@ -125,6 +125,23 @@ public class LoginListener implements PacketLoginInListener {
@ -38,7 +38,7 @@ index d987483255195c0bde713a92676baced1eaff2b3..2fa0f21cfa81670f6c3f18f76e7fa8d0
+ if (networkManager.spoofedProfile != null) {
+ properties = new java.util.ArrayList<>(Arrays.asList(networkManager.spoofedProfile));
+ } else {
+ properties = new java.util.ArrayList<>();
+ properties = java.util.Collections.emptyList();
+ }
+ net.yatopia.api.event.ProxyForwardDataEvent event = new net.yatopia.api.event.ProxyForwardDataEvent(
+ !org.bukkit.Bukkit.isPrimaryThread(), uuid, i.getName(), properties

View File

@ -7,7 +7,7 @@ If only 1 non-daemon thread is left to run when the server is shutting down, the
This patche ensures that executors make daemon threads.
diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java
index 2fa0f21cfa81670f6c3f18f76e7fa8d0bb541f11..9190caed195b9987e3af545f4de63b8d956788a6 100644
index bb45fc83d81948c84bc721961474e5e806ab404a..847122f76f6d951b24b22c86276140e02aaf37d6 100644
--- a/src/main/java/net/minecraft/server/LoginListener.java
+++ b/src/main/java/net/minecraft/server/LoginListener.java
@@ -108,7 +108,11 @@ public class LoginListener implements PacketLoginInListener {

View File

@ -132,7 +132,7 @@ index c3b57e8d572d13ec74d6df5544072cdc55756690..99e5e2c6fe12e0deda1f5aeb3f8922ef
private final EnumItemRarity a;
private final int maxStackSize;
diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java
index 9190caed195b9987e3af545f4de63b8d956788a6..178386cfb44152b50757234a624afef0d61e00d8 100644
index 847122f76f6d951b24b22c86276140e02aaf37d6..0500d49b51ed9bba27f351ff4bff93bb6e315846 100644
--- a/src/main/java/net/minecraft/server/LoginListener.java
+++ b/src/main/java/net/minecraft/server/LoginListener.java
@@ -32,7 +32,7 @@ public class LoginListener implements PacketLoginInListener {

View File

@ -79,66 +79,66 @@ index 0d23591fffcda1f8121e7bc7a6aa00d088b6e80b..7b326635aac5b1e7fb6e3933d133d7e1
long endTime = System.nanoTime();
diff --git a/src/main/java/org/yatopiamc/yatopia/server/entity/HalloweenChecker.java b/src/main/java/org/yatopiamc/yatopia/server/entity/HalloweenChecker.java
new file mode 100644
index 0000000000000000000000000000000000000000..71622619f325738d97a64fce5bfb7792934ce1d5
index 0000000000000000000000000000000000000000..b9e8c25fa4c4cc088a12c2b865887751c8cdbcd8
--- /dev/null
+++ b/src/main/java/org/yatopiamc/yatopia/server/entity/HalloweenChecker.java
@@ -0,0 +1,59 @@
+package org.yatopiamc.yatopia.server.entity;
+
+import java.time.LocalDate;
+import java.time.temporal.ChronoField;
+import net.minecraft.server.MinecraftServer;
+
+/**
+ * Entity halloween checker
+ * <p>
+ * Checks whether or not it is halloween at a specific rate rather than every time when
+ * a entity is being spawned.
+ * <p>
+ * The rate changes depending on how much TPS the server has. By default, the rate is every
+ * 2 hours, or every 144k ticks (if the server has _that_ much uptime)
+ *
+ * @author MrIvanPlays
+ */
+public class HalloweenChecker {
+
+ private static boolean halloweenSeason = false;
+ private static boolean halloweenDay = false;
+
+ private static int delay = (20 * 60 * 60) * 2;
+ private static int lastCheckTick = -delay;
+
+ public static void tick() {
+ if (MinecraftServer.currentTick % 100 == 0) {
+ // update the delay every 100 ticks
+ if (MinecraftServer.TPS >= 20) {
+ delay = (20 * 60 * 20) * 2;
+ }
+ if (MinecraftServer.TPS < 15) {
+ delay = delay + (20 * 60 * 15);
+ }
+ if (MinecraftServer.TPS < 10) {
+ delay = delay + (20 * 60 * 30);
+ }
+ }
+ if (MinecraftServer.currentTick - lastCheckTick > delay) {
+ LocalDate now = LocalDate.now();
+ int day = now.getDayOfMonth();
+ int month = now.get(ChronoField.MONTH_OF_YEAR);
+
+ halloweenDay = (month == 10) && (day == 31);
+ halloweenSeason = ((month == 10) && (day >= 20)) || ((month == 11) && (day <= 3));
+
+ lastCheckTick = MinecraftServer.currentTick;
+ }
+ }
+
+ public static boolean isHalloweenSeason() {
+ return halloweenSeason;
+ }
+
+ public static boolean isHalloweenDay() {
+ return halloweenDay;
+ }
+
+}
+package org.yatopiamc.yatopia.server.entity;
+
+import java.time.LocalDate;
+import java.time.temporal.ChronoField;
+import net.minecraft.server.MinecraftServer;
+
+/**
+ * Entity halloween checker
+ * <p>
+ * Checks whether or not it is halloween at a specific rate rather than every time when
+ * a entity is being spawned.
+ * <p>
+ * The rate changes depending on how much TPS the server has. By default, the rate is every
+ * 2 hours, or every 144k ticks (if the server has _that_ much uptime)
+ *
+ * @author MrIvanPlays
+ */
+public class HalloweenChecker {
+
+ private static boolean halloweenSeason = false;
+ private static boolean halloweenDay = false;
+
+ private static int delay = (20 * 60 * 60) * 2;
+ private static int lastCheckTick = -delay;
+
+ public static void tick() {
+ if (MinecraftServer.currentTick % 100 == 0) {
+ // update the delay every 100 ticks
+ if (MinecraftServer.TPS >= 20) {
+ delay = (20 * 60 * 60) * 2;
+ }
+ if (MinecraftServer.TPS < 15) {
+ delay = delay + (20 * 60 * 15);
+ }
+ if (MinecraftServer.TPS < 10) {
+ delay = delay + (20 * 60 * 30);
+ }
+ }
+ if (MinecraftServer.currentTick - lastCheckTick > delay) {
+ LocalDate now = LocalDate.now();
+ int day = now.getDayOfMonth();
+ int month = now.get(ChronoField.MONTH_OF_YEAR);
+
+ halloweenDay = (month == 10) && (day == 31);
+ halloweenSeason = ((month == 10) && (day >= 20)) || ((month == 11) && (day <= 3));
+
+ lastCheckTick = MinecraftServer.currentTick;
+ }
+ }
+
+ public static boolean isHalloweenSeason() {
+ return halloweenSeason;
+ }
+
+ public static boolean isHalloweenDay() {
+ return halloweenDay;
+ }
+
+}