Merge branch 'ver/1.16.4' of https://github.com/YatopiaMC/Yatopia into patch-mappalette

This commit is contained in:
Ivan Pekov 2021-01-07 17:53:28 +02:00
commit 87420d4569
No known key found for this signature in database
GPG Key ID: BC975C392D9CA3A3
57 changed files with 393 additions and 459 deletions

@ -1 +1 @@
Subproject commit 20b8c796f4b66bce7bc3be496f5c9e9edef1d226
Subproject commit 5e8ebc09f1c090843d154e8db1160c9075be7649

@ -1 +1 @@
Subproject commit d32f7b265f971d588a1ee69eb25e74ad372e133d
Subproject commit a841b5a54e163bd6c9e1f9ab3c1d7876b932521f

@ -1 +1 @@
Subproject commit 36c0e05ca7b28d77f18fcd698c9b57f6c35d0ece
Subproject commit e204bb8e0fa441dd74d2df98c0444cc2f43854a3

View File

@ -18,6 +18,7 @@ # Patches
| server | Add NBT API as a first-class lib | tr7zw | |
| api | Add StructureLocateEvent | dfsek | |
| server | Add StructureLocateEvent | dfsek | |
| server | Add a special case for floodgate and offline uuids | Ivan Pekov | |
| server | Add component util | William Blake Galbreath | |
| api | Add last tick time API | Ivan Pekov | tr7zw |
| server | Add last tick time API | Ivan Pekov | tr7zw |
@ -50,7 +51,6 @@ # Patches
| server | Configurable villager brain ticks | William Blake Galbreath | |
| server | Cows eat mushrooms | William Blake Galbreath | |
| server | Custom Locale Support | Bud Gidiere | |
| server | DataBits slight optimization | Paul Sauve | |
| api | Default permissions | William Blake Galbreath | |
| server | Despawn rate config options per projectile type | jmp | |
| api | Disable reload command | Ivan Pekov | |
@ -68,6 +68,7 @@ # Patches
| server | Fix LightEngineThreaded memory leak | Ivan Pekov | |
| server | Fix exp drop of zombie pigmen (MC-56653) | Phoenix616 | |
| server | Fix lead fall dmg config | tr7zw | |
| server | Fix rotating UP/DOWN CW and CCW | BillyGalbreath | |
| server | Fix the dead lagging the server | William Blake Galbreath | |
| server | Fix vanilla command permission handler | William Blake Galbreath | |
| server | Global Eula file | tr7zw | |
@ -76,13 +77,11 @@ # Patches
| 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 | |
@ -94,6 +93,7 @@ # Patches
| server | Nuke streams off SectionPosition | Ivan Pekov | |
| api | Optimise Bukkit's MapPalette | epserv | |
| server | Optimise portals | Ivan Pekov | |
| server | Optimised hallowen checker | Ivan Pekov | |
| server | Optimize BehaviorController | MrIvanPlays | |
| server | Optimize TileEntity load/unload | tr7zw | |
| server | Optimize Villagers | Ivan Pekov | |
@ -105,8 +105,8 @@ # Patches
| server | Option to toggle milk curing bad omen | William Blake Galbreath | |
| server | Origami Server Config | Phoenix616 | |
| server | PaperPR - Add hex color code support for console logging | Esophose | |
| server | PaperPR - Fix username connecting with no texture being | Camotoy | |
| server | PaperPR - Projectile load/save limit per chunk | jmp | |
| server | PaperPR: Fix harming potion dupe | PepperCode1 | |
| server | Per entity (type) collision settings | MrIvanPlays | tr7zw |
| server | Persistent TileEntity Lore and DisplayName | jmp | |
| api | PlayerAttackEntityEvent | Ivan Pekov | |
@ -124,6 +124,7 @@ # Patches
| server | Simpler ShapelessRecipes comparison for Vanilla | Paul Sauve | |
| server | Skip events if there's no listeners | William Blake Galbreath | |
| server | Smarter statistics ticking | Mykyta Komarnytskyy | |
| server | Smol entity optimisations | Ivan Pekov | |
| server | Snowman drop and put back pumpkin | William Blake Galbreath | |
| server | Spread out and optimise player list ticks | James Lyne | |
| server | Squid EAR immunity | William Blake Galbreath | |

2
Purpur

@ -1 +1 @@
Subproject commit 5758335e73176ec765e6d8c73b78c3f39f5262ee
Subproject commit 5c0dbf179b9bad231e894fe1e47169a66404004a

@ -1 +1 @@
Subproject commit 86b20d4ea11e52f1d5e9509351ac577e8a9cdce5
Subproject commit 33b3f860c233cf20cd2be93e474ee687116e180b

View File

@ -1 +1 @@
AirplaneLite-MC-Dev-Fixes&AirplaneLite-Data-Structs&Strip-raytracing-for-EntityLiving-hasLineOfSight&Simpler-ShapelessRecipes-comparison-for-Vanilla&Use-unmodifiableMap-instead-of-making-copy&DataBits-slight-optimization&Swap-priority-of-checks-in-chunk-ticking&Reduce-projectile-chunk-loading
AirplaneLite-MC-Dev-Fixes&AirplaneLite-Data-Structs&Strip-raytracing-for-EntityLiving-hasLineOfSight&Simpler-ShapelessRecipes-comparison-for-Vanilla&Use-unmodifiableMap-instead-of-making-copy&Swap-priority-of-checks-in-chunk-ticking&Reduce-projectile-chunk-loading

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&Fix-rotating-UP-DOWN-CW-and-CCW

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..afe3477c9a577a5fa1ef6c7dfd5a221fd3ca9f6b 100644
index 3e6971d0bbc383e4639e402c076af5292ee9236a..0e762240836299630743f29d00db03ffa193d4ab 100644
--- a/pom.xml
+++ b/pom.xml
@@ -56,6 +56,11 @@
@ -27,7 +27,7 @@ index 31aba885d940acf0a9df5d4e83dfec69030b2a37..afe3477c9a577a5fa1ef6c7dfd5a221f
+ <dependency>
+ <groupId>de.tr7zw</groupId>
+ <artifactId>item-nbt-api</artifactId>
+ <version>2.6.0</version>
+ <version>2.7.1</version>
+ </dependency>
</dependencies>
@ -45,6 +45,27 @@ index 31aba885d940acf0a9df5d4e83dfec69030b2a37..afe3477c9a577a5fa1ef6c7dfd5a221f
</configuration>
</plugin>
<plugin>
diff --git a/src/main/java/org/bukkit/Chunk.java b/src/main/java/org/bukkit/Chunk.java
index 98263d896f316983609432c45b85401a2692432d..afaa459d2c351f99b598ec9054a6838ffb0098e8 100644
--- a/src/main/java/org/bukkit/Chunk.java
+++ b/src/main/java/org/bukkit/Chunk.java
@@ -275,4 +275,16 @@ public interface Chunk extends PersistentDataHolder {
* @return if the block is contained within
*/
boolean contains(@NotNull BlockData block);
+
+ // Yatopia start
+ /**
+ * Returns a custom tag container of this chunk.
+ *
+ * @return custom NBT tags container
+ */
+ @NotNull
+ default de.tr7zw.changeme.nbtapi.NBTCompound getNBTC() {
+ return new de.tr7zw.changeme.nbtapi.NBTChunk(this).getPersistentDataContainer();
+ }
+ // Yatopia end
}
diff --git a/src/main/java/org/bukkit/block/TileState.java b/src/main/java/org/bukkit/block/TileState.java
index 3b10fcc13893403b29f0260b8605144679e89b82..1e9a96d8b08cc396acf73dc42083009354e89d8a 100644
--- a/src/main/java/org/bukkit/block/TileState.java
@ -108,10 +129,10 @@ index 76e857c364fe79e20cf9bde54b65e5b7108174fd..dc7e9983b89726625acce95026b45695
+ // Yatopia end
}
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
index ccd81fca25233c2a9c2a8c3f4dda3053d7b2e723..5ad9dfb7856b2f86947b12b5444b2f8147f72bbf 100644
index 4f2520f7a4ca6d57a85924ada1068a055b9a01fb..9ac89fe309e5cb393bdda3a77f8313991ab77732 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
@@ -791,4 +791,42 @@ public class ItemStack implements Cloneable, ConfigurationSerializable {
@@ -792,4 +792,42 @@ public class ItemStack implements Cloneable, ConfigurationSerializable {
return itemMeta.hasItemFlag(flag);
}
// Paper end

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

@ -142,7 +142,7 @@ index 2291135eaef64c403183724cb6e413cd7e472672..6fcc7ed7c129e6a33386d65b37cbba4a
public static long a(long i, EnumDirection enumdirection) {
return a(i, enumdirection.getAdjacentX(), enumdirection.getAdjacentY(), enumdirection.getAdjacentZ());
diff --git a/src/main/java/net/minecraft/server/CommandDispatcher.java b/src/main/java/net/minecraft/server/CommandDispatcher.java
index cabce1a8ba5db56495628edd9bc796aee7a53356..9754a9eac48c50efdefdceefbb4386bf0df583dd 100644
index 17753c8a997aa286460be5d8eb6508e2eaed18ce..56d5cebd155f2b5ee24c1d8b75903316e59688d1 100644
--- a/src/main/java/net/minecraft/server/CommandDispatcher.java
+++ b/src/main/java/net/minecraft/server/CommandDispatcher.java
@@ -107,6 +107,7 @@ public class CommandDispatcher {
@ -153,7 +153,7 @@ index cabce1a8ba5db56495628edd9bc796aee7a53356..9754a9eac48c50efdefdceefbb4386bf
}
if (commanddispatcher_servertype.d) {
@@ -337,6 +338,7 @@ public class CommandDispatcher {
@@ -338,6 +339,7 @@ public class CommandDispatcher {
}
@ -161,7 +161,7 @@ index cabce1a8ba5db56495628edd9bc796aee7a53356..9754a9eac48c50efdefdceefbb4386bf
public static LiteralArgumentBuilder<CommandListenerWrapper> a(String s) {
return LiteralArgumentBuilder.literal(s);
}
@@ -356,6 +358,7 @@ public class CommandDispatcher {
@@ -357,6 +359,7 @@ public class CommandDispatcher {
};
}
@ -197,7 +197,7 @@ index 86f1cfe454ea0a989775b49a6b88375c766ef647..da53af61d1171db3c167c6e007adf953
if (!(this.k instanceof EntityPlayer)) {
throw CommandListenerWrapper.a.create();
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 985d0d4aea2210e908ac76fbeafc0c895372aee7..d224b1d0e224853e825486559938aed2c56c3981 100644
index 77100ab382b33aef8b2194b611c0b1d454da91fd..1ece3e1e9e7a26f1ee07202916687f627c9e4c95 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -434,7 +434,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@ -373,7 +373,7 @@ index dd52a8fe4fd46e57a5d1af49ba1965a483cf4fcc..00000000000000000000000000000000
- IChunkAccess ichunkaccess = iworldreader.getChunkAt(chunkcoordintpair.x, chunkcoordintpair.z, ChunkStatus.STRUCTURE_STARTS, !(iworldreader instanceof World) || !((World) iworldreader).origamiConfig.onlyFindGeneratedFeatures);
- if (ichunkaccess == null) {
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 07d47ad2362c5ebfa7993262a8faed240cc21717..107d7ac761bfb7667dfab88b31712e2061a46258 100644
index c2b5874a77ae8a992bc668dc19f5300bebf3d239..3bbfb0117187a26354fa58ec46eeb6e62845851e 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -96,6 +96,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@ -394,7 +394,7 @@ index 07d47ad2362c5ebfa7993262a8faed240cc21717..107d7ac761bfb7667dfab88b31712e20
this.world = new CraftWorld((WorldServer) this, gen, env);
diff --git a/src/main/java/net/minecraft/server/World.java.rej b/src/main/java/net/minecraft/server/World.java.rej
deleted file mode 100644
index 313aa8f7d47c53a6a0130994c9d61d7c073c95c6..0000000000000000000000000000000000000000
index f4e9c5a0136d3a0ed813efec7fe8a0e7f256cf40..0000000000000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/World.java.rej
+++ /dev/null
@@ -1,18 +0,0 @@
@ -411,7 +411,7 @@ index 313aa8f7d47c53a6a0130994c9d61d7c073c95c6..00000000000000000000000000000000
-@@ -124,6 +126,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
- protected World(WorldDataMutable worlddatamutable, ResourceKey<World> resourcekey, final DimensionManager dimensionmanager, Supplier<GameProfilerFiller> supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.World.Environment env, java.util.concurrent.Executor executor) { // Paper
- this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((WorldDataServer) worlddatamutable).getName()); // Spigot
- this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig((((WorldDataServer)worlddatamutable).getName()), this.spigotConfig); // Paper
- this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig(((WorldDataServer) worlddatamutable).getName(), this.spigotConfig); // Paper
-+ this.origamiConfig = new de.minebench.origami.OrigamiConfig.WorldConfig(((WorldDataServer)worlddatamutable).getName()); // Origami - World Config
- this.chunkPacketBlockController = this.paperConfig.antiXray ? new ChunkPacketBlockControllerAntiXray(this, executor) : ChunkPacketBlockController.NO_OPERATION_INSTANCE; // Paper - Anti-Xray
- this.generator = gen;

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Modify POM
diff --git a/pom.xml b/pom.xml
index 78c2a8bbcc0132f891c8aa545529d20aa0d9eb57..9f2cc8fbc0bfaefd772904076e6fd4d0c78f30ee 100644
index 174c0b67c1c5b41d80613128ebf2d78ee27f3cee..e20489a5834e9727a8c50435768ffe0e87af2188 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,11 +1,11 @@

View File

@ -39,10 +39,10 @@ index 74ed02fa9296583977bb721014b10ff8b708b43c..a13c7b2b5bc79ecaea404779149ed02c
.completer(new ConsoleCommandCompleter(this.server))
);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index a91869dde9f47e00b6c6e380e7d3b92282d9b235..fc3abab760aa90e2afa5b4bf6abd3a0aff897f25 100644
index 97cece32f994db6ff1d88b740060996869648f3c..c929c3ecb2a8c9056cad0418b2266b47bd0bbcaf 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1524,7 +1524,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
@@ -1519,7 +1519,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
}
public String getServerModName() {
@ -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

@ -9,7 +9,7 @@ Co-authored-by: Mykyta Komarnytskyy <nkomarn@hotmail.com>
Co-authored-by: Ivan Pekov <ivan@mrivanplays.com>
diff --git a/pom.xml b/pom.xml
index 9f2cc8fbc0bfaefd772904076e6fd4d0c78f30ee..2acc51071e968333f85959d76b86e7e6e0ee828b 100644
index e20489a5834e9727a8c50435768ffe0e87af2188..50fa602350b757a0444d104d5efd7b947aaf6cbd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -166,6 +166,12 @@

View File

@ -7,10 +7,10 @@ Original patch by:
Co-authored-by: tr7zw <tr7zw@live.de>
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index fc3abab760aa90e2afa5b4bf6abd3a0aff897f25..e990a39d97cb1427dd2ce43bdc79fb84e93e9c4b 100644
index c929c3ecb2a8c9056cad0418b2266b47bd0bbcaf..a342a13f387b4079bfc983d500a0fde534891196 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -936,6 +936,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
@@ -931,6 +931,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
// Paper End
// Spigot End
@ -19,7 +19,7 @@ index fc3abab760aa90e2afa5b4bf6abd3a0aff897f25..e990a39d97cb1427dd2ce43bdc79fb84
protected void w() {
try {
long serverStartTime = SystemUtils.getMonotonicNanos(); // Paper
@@ -1007,7 +1009,9 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
@@ -1002,7 +1004,9 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
this.a(gameprofilertick);
this.methodProfiler.a();
this.methodProfiler.enter("tick");

View File

@ -47,7 +47,7 @@ index 3ee8d31c453105eca7b96bede39a9ebbf40e1c2c..0a9f03526abf0638ada15d9810b94988
this.setAllowFlight(dedicatedserverproperties.allowFlight);
this.setResourcePack(dedicatedserverproperties.resourcePack, this.ba());
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 36c6968ac03872004d46e70f38c5a515621b8eb1..1597eec51d69f6fc136eda5e1b6bdcdb3fceeb69 100644
index 7034da84c5534d5e1acff645dc9e7d60ddf315fb..b1fa51050ca3deb9a7cfc732d5415010d753ada4 100644
--- 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 {
@ -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

@ -59,7 +59,7 @@ index 537456a7427cddd6783f5b5d8ee2d655668c4c53..004184a7c3da4f72f68a5fd9b4dd5abd
}
\ No newline at end of file
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 1597eec51d69f6fc136eda5e1b6bdcdb3fceeb69..615dc8586b692138446998bd6a1dc245d3c65c70 100644
index b1fa51050ca3deb9a7cfc732d5415010d753ada4..2f0e9e3fc184d803aa81b2d4d0b52927f575f69b 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -2870,7 +2870,7 @@ public abstract class EntityLiving extends Entity {

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 2acc51071e968333f85959d76b86e7e6e0ee828b..4918a1e92d3515825402258605bcd9b4511420a5 100644
index 50fa602350b757a0444d104d5efd7b947aaf6cbd..a590598ca65301c96ebbd1d93037731fb75f83e0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -348,6 +348,10 @@

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Modify default configs
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index 041016de85360adacf4a5d0845bb1ebcc25a14b9..0f45769b5d8b9b6c4a89550db16576c5c7221e04 100644
index ce14283dd1a1fddbea17c2fbaf1c4ef9d7a7479f..4a21a83c448355d61fb946bd0eb5d752767d536a 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -206,7 +206,7 @@ public class PaperConfig {
@ -16,12 +16,12 @@ index 041016de85360adacf4a5d0845bb1ebcc25a14b9..0f45769b5d8b9b6c4a89550db16576c5
+ boolean timings = getBoolean("timings.enabled", false); // Yatopia don't profile by default
boolean verboseTimings = getBoolean("timings.verbose", true);
TimingsManager.privacy = getBoolean("timings.server-name-privacy", false);
TimingsManager.hiddenConfigs = getList("timings.hidden-config-entries", Lists.newArrayList("database", "settings.bungeecord-addresses"));
TimingsManager.hiddenConfigs = getList("timings.hidden-config-entries", Lists.newArrayList("database", "settings.bungeecord-addresses", "settings.velocity-support.secret"));
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 2452f54d96cab2d93140c64e25d9b799cbc94caa..c3f38f3228e0104d878b3e116f203efc64279710 100644
index 5b2077c90e2a3010a6a596d7e3551e791e670d16..fd0f3d6ddea9d0a6f3fd3bba041d5ed60bddb13c 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -598,7 +598,7 @@ public class PaperWorldConfig {
@@ -624,7 +624,7 @@ public class PaperWorldConfig {
}
public boolean cooldownHopperWhenFull = true;

View File

@ -7,7 +7,7 @@ Original code by JellySquid, licensed under GNU Lesser General Public License v3
you can find the original code on https://github.com/jellysquid3/lithium-fabric/tree/1.16.x/fabric (Yarn mappings)
diff --git a/src/main/java/net/minecraft/server/EnumDirection.java b/src/main/java/net/minecraft/server/EnumDirection.java
index 36aafc3b71013bcec0f4d956761fc2710848b3fd..259af9622e91b784a0a5de254304a9eab9a09d15 100644
index 343eb3e9ab37730b55baeea839db6e882c3e50ae..9edc9f8eb820ba17559e796c6b42d78f038ba1db 100644
--- a/src/main/java/net/minecraft/server/EnumDirection.java
+++ b/src/main/java/net/minecraft/server/EnumDirection.java
@@ -20,13 +20,13 @@ public enum EnumDirection implements INamable {
@ -40,7 +40,7 @@ index 36aafc3b71013bcec0f4d956761fc2710848b3fd..259af9622e91b784a0a5de254304a9ea
}
public EnumDirection g() {
@@ -185,8 +189,12 @@ public enum EnumDirection implements INamable {
@@ -197,8 +201,12 @@ public enum EnumDirection implements INamable {
return (float) ((this.i & 3) * 90);
}

View File

@ -7,10 +7,10 @@ Original code by JellySquid, licensed under GNU Lesser General Public License v3
you can find the original code on https://github.com/jellysquid3/lithium-fabric/tree/1.16.x/fabric (Yarn mappings)
diff --git a/src/main/java/net/minecraft/server/AxisAlignedBB.java b/src/main/java/net/minecraft/server/AxisAlignedBB.java
index 20e9e06b36cda913809b46e71144d212322619aa..ed5b153f081b8c42b92cb8b195ff54d18e900490 100644
index acd009844099293befd28c5f1c20d947016fa19b..4fb61603ca2d7cb7df9742c72117f4d33bd2bbdf 100644
--- a/src/main/java/net/minecraft/server/AxisAlignedBB.java
+++ b/src/main/java/net/minecraft/server/AxisAlignedBB.java
@@ -194,12 +194,38 @@ public class AxisAlignedBB {
@@ -202,12 +202,38 @@ public class AxisAlignedBB {
return new AxisAlignedBB(vec3d.x, vec3d.y, vec3d.z, vec3d.x + 1.0D, vec3d.y + 1.0D, vec3d.z + 1.0D);
}

View File

@ -39,7 +39,7 @@ index 5d3bb5f393a1e0e4a2e8b9a466530a91279697a9..7f084e7f11a829c10d113c7fb39eec0b
if (enumdirection2 != EnumDirection.DOWN && world.isBlockFacePowered(blockposition1.shift(enumdirection2), enumdirection2)) {
return true;
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 615dc8586b692138446998bd6a1dc245d3c65c70..ddd9f3cca681b067515d8a8d217d03747c3352a3 100644
index 2f0e9e3fc184d803aa81b2d4d0b52927f575f69b..230e798c03edb57fe8733887d09150f67eb2bbfa 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -2591,10 +2591,12 @@ public abstract class EntityLiving extends Entity {

View File

@ -6,33 +6,10 @@ Subject: [PATCH] Heavily optimize furnance fuel and recipe lookups
Co-authored-by: Mykyta Komarn <nkomarn@hotmail.com>
diff --git a/src/main/java/net/minecraft/server/TileEntityFurnace.java b/src/main/java/net/minecraft/server/TileEntityFurnace.java
index 1d3c2dd93657fb5dc71ee6b444c585b54619d1e8..77ea56c5a25fe09a1721429d42965ad34d905870 100644
index e75e676d196d9f5a3409ec50645fab611b0afdad..fa2b88b54a419f506a195130e664701766720ceb 100644
--- a/src/main/java/net/minecraft/server/TileEntityFurnace.java
+++ b/src/main/java/net/minecraft/server/TileEntityFurnace.java
@@ -83,7 +83,14 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I
this.c = recipes;
}
+ private static Object2IntOpenHashMap<Item> cachedFuelMap = null; // Yatopia
+
public static Map<Item, Integer> f() {
+ // Yatopia start
+ if(cachedFuelMap != null) {
+ return cachedFuelMap;
+ }
+ // Yatopia end
Map<Item, Integer> map = Maps.newLinkedHashMap();
a(map, (IMaterial) Items.LAVA_BUCKET, 20000);
@@ -146,6 +153,7 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I
a(map, (IMaterial) Blocks.FLETCHING_TABLE, 300);
a(map, (IMaterial) Blocks.SMITHING_TABLE, 300);
a(map, (IMaterial) Blocks.COMPOSTER, 300);
+ cachedFuelMap = new Object2IntOpenHashMap<>(map); // Yatopia
return map;
}
@@ -271,7 +279,10 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I
@@ -283,7 +283,10 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I
this.cookTime = MathHelper.clamp(this.cookTime - 2, 0, this.cookTimeTotal);
}
} else {
@ -44,7 +21,7 @@ index 1d3c2dd93657fb5dc71ee6b444c585b54619d1e8..77ea56c5a25fe09a1721429d42965ad3
if (!this.isBurning() && this.canBurn(irecipe)) {
// CraftBukkit start
@@ -597,4 +608,18 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I
@@ -609,4 +612,18 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I
}
}

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Optimize TileEntity load/unload
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 107d7ac761bfb7667dfab88b31712e2061a46258..95b9663e072991004904365cfc2ba11edb01de20 100644
index 3bbfb0117187a26354fa58ec46eeb6e62845851e..ed2f75195d7a39882675af9ff0a7e8e7d208f906 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -42,8 +42,8 @@ public abstract class World implements GeneratorAccess, AutoCloseable {

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

@ -5,10 +5,10 @@ Subject: [PATCH] Fix lead fall dmg config
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index d224b1d0e224853e825486559938aed2c56c3981..0bca08dc6ffd367de7cffab0433900d6bfe555cf 100644
index 1ece3e1e9e7a26f1ee07202916687f627c9e4c95..540bd5ccb01789d9130ea64a78dc125f94f94bb6 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -1290,6 +1290,8 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -1301,6 +1301,8 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
this.fallDistance = 0.0F;
} else if (d0 < 0.0D) {
this.fallDistance = (float) ((double) this.fallDistance - d0);

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

@ -5,7 +5,7 @@ Subject: [PATCH] Respect PlayerKickEvent leaveMessage
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 10139becc33a483a81858dcad2d07571e48ea43e..c258b5b1cc6d5f7fae49c311865e9506d0164c6a 100644
index 9d058ddf875e660cb3bd5209e5ddbf1a7abbd04c..63bceb9f1695ce4db5b932ca627d944506b03c0d 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -323,7 +323,7 @@ public class PlayerConnection implements PacketListenerPlayIn {

View File

@ -185,10 +185,10 @@ index 0224a6d0e47e836fa485b39e7b4ce5b83ea554bf..fe578d306575bbdc8ca4a993a648e889
return (String[]) this.d.keySet().toArray(new String[this.d.size()]);
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index e990a39d97cb1427dd2ce43bdc79fb84e93e9c4b..c7031706ea51dd6d8c22c10fab2ce3154daac361 100644
index a342a13f387b4079bfc983d500a0fde534891196..156f350e8c4c3f9a8a59e4950e4bd03050dc3e62 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1969,6 +1969,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
@@ -1971,6 +1971,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
return new DataPackConfiguration(list, list1);
}

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

@ -5,7 +5,7 @@ Subject: [PATCH] Configurable flight checks
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index c258b5b1cc6d5f7fae49c311865e9506d0164c6a..687ebda8f3993de460ad3100a0aa7fe648b2582c 100644
index 63bceb9f1695ce4db5b932ca627d944506b03c0d..4e343bf4865655020994c40a1c7101afb994a659 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -179,7 +179,7 @@ public class PlayerConnection implements PacketListenerPlayIn {

View File

@ -1,53 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: PepperCode1 <44146161+PepperCode1@users.noreply.github.com>
Date: Mon, 19 Oct 2020 15:56:47 +0300
Subject: [PATCH] PaperPR: Fix harming potion dupe
diff --git a/src/main/java/net/minecraft/server/ItemPotion.java b/src/main/java/net/minecraft/server/ItemPotion.java
index 7862b63a245222d9a3d0896bdb2741b0e5e7ac40..04e48b195387410d9494ef87beba15e8d9e0419d 100644
--- a/src/main/java/net/minecraft/server/ItemPotion.java
+++ b/src/main/java/net/minecraft/server/ItemPotion.java
@@ -22,6 +22,8 @@ public class ItemPotion extends Item {
CriterionTriggers.z.a((EntityPlayer) entityhuman, itemstack);
}
+ List<MobEffect> instantLater = new java.util.ArrayList<>(); // Yatopia
+
if (!world.isClientSide) {
List<MobEffect> list = PotionUtil.getEffects(itemstack);
Iterator iterator = list.iterator();
@@ -30,7 +32,7 @@ public class ItemPotion extends Item {
MobEffect mobeffect = (MobEffect) iterator.next();
if (mobeffect.getMobEffect().isInstant()) {
- mobeffect.getMobEffect().applyInstantEffect(entityhuman, entityhuman, entityliving, mobeffect.getAmplifier(), 1.0D);
+ instantLater.add(mobeffect); // Yatopia
} else {
entityliving.addEffect(new MobEffect(mobeffect), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.POTION_DRINK); // CraftBukkit
}
@@ -44,7 +46,24 @@ public class ItemPotion extends Item {
}
}
+ // Yatopia start - fix harming potion dupe
+ if (!world.isClientSide) {
+ int len = instantLater.size();
+ while (len > 0) {
+ MobEffect mobeffect = instantLater.remove(0);
+ mobeffect.getMobEffect().applyInstantEffect(entityhuman, entityhuman, entityliving, mobeffect.getAmplifier(), 1.0D);
+ len--;
+ }
+ }
+ // Yatopia end
+
if (entityhuman == null || !entityhuman.abilities.canInstantlyBuild) {
+ // Yatopia start - fix harming potion dupe
+ if (entityliving.getHealth() <= 0 && !(entityhuman != null && entityliving.world.getGameRules().getBoolean(GameRules.KEEP_INVENTORY))) {
+ entityliving.dropItem(new ItemStack(Items.GLASS_BOTTLE), 0);
+ return ItemStack.NULL_ITEM;
+ }
+ // Yatopia end
if (itemstack.isEmpty()) {
return new ItemStack(Items.GLASS_BOTTLE);
}

View File

@ -8,10 +8,10 @@ Paper does alleviate this quite well by only firing if plugins are listening, bu
This patch implements a hard toggle for the event.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index c7031706ea51dd6d8c22c10fab2ce3154daac361..f4ca05cc77ae5ea47db51770f316413fdf8a728b 100644
index 156f350e8c4c3f9a8a59e4950e4bd03050dc3e62..5bc6b4acb86fcc774d7d90308dc7e8d0f9c9ff77 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1412,7 +1412,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
@@ -1407,7 +1407,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
while (iterator.hasNext()) {
WorldServer worldserver = (WorldServer) iterator.next();

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Configurable movement checks
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 687ebda8f3993de460ad3100a0aa7fe648b2582c..74ddd98008490ed10952fe3847e83e51aa464132 100644
index 4e343bf4865655020994c40a1c7101afb994a659..bd356f8334936c1c7c1a2961eee9c0cb4d7f77ba 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -443,7 +443,7 @@ public class PlayerConnection implements PacketListenerPlayIn {

View File

@ -58,7 +58,7 @@ index 38dc6086d18951e065d4048d1d8eee288c5c5fd1..4e094f0e1117cecbd39be645997eb9d3
this.f = ShapeDetectorBuilder.a().a(" ", " ", " ", " # ", " ", " ", " ").a(" ", " ", " ", " # ", " ", " ", " ").a(" ", " ", " ", " # ", " ", " ", " ").a(" ### ", " # # ", "# #", "# # #", "# #", " # # ", " ### ").a(" ", " ### ", " ##### ", " ##### ", " ##### ", " ### ", " ").a('#', ShapeDetectorBlock.a(BlockPredicate.a(Blocks.BEDROCK))).b();
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 0bca08dc6ffd367de7cffab0433900d6bfe555cf..51c4ff1bd6948ab46d723c37af39c76cdf662be5 100644
index 540bd5ccb01789d9130ea64a78dc125f94f94bb6..cbf9c61d535f1f99f08b1ee71a890a74d7f6d834 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -61,7 +61,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@ -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 {
@ -145,10 +145,10 @@ index 9190caed195b9987e3af545f4de63b8d956788a6..178386cfb44152b50757234a624afef0
private final MinecraftServer server;
public final NetworkManager networkManager;
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index f4ca05cc77ae5ea47db51770f316413fdf8a728b..b9b9caa0463580b744225beb7133d9282c5899f3 100644
index 5bc6b4acb86fcc774d7d90308dc7e8d0f9c9ff77..0d23591fffcda1f8121e7bc7a6aa00d088b6e80b 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -197,7 +197,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
@@ -192,7 +192,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
this.m = new GameProfilerSwitcher(SystemUtils.a, this::ai);
this.methodProfiler = GameProfilerDisabled.a;
this.serverPing = new ServerPing();
@ -245,7 +245,7 @@ index f0fdfd6891e59891e7370a2d682b65c647b28e9e..8d5fe0880f4f2bffe14dc1c7163cde69
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 95b9663e072991004904365cfc2ba11edb01de20..c63d728082e28c13bc9724e74b154d02fbb2392e 100644
index ed2f75195d7a39882675af9ff0a7e8e7d208f906..b9a4d29382f4693eb94b39cabfc46b7e952b9306 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -48,13 +48,13 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@ -265,7 +265,7 @@ index 95b9663e072991004904365cfc2ba11edb01de20..c63d728082e28c13bc9724e74b154d02
public final WorldDataMutable worldData;
private final Supplier<GameProfilerFiller> methodProfiler;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index a69b38f293723a58691b2777d170f9cc146d1148..b746d1efbb06173e16a5b3a7f6bf0f3303a5ae05 100644
index 8904b39db2203118fe3589133cb7e64334c20f33..d37c1e1f05b40ea672145478aa608a4002bc09bd 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -334,7 +334,7 @@ public class CraftWorld implements World {

View File

@ -9,7 +9,7 @@ Licensed under Bukkit and CraftBukkit's original license, GPLv3
The following patch should be treated as it is licensed in GPLv3
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index 84429f12d0c6e0990b7cbb1b503b7868b3a02b14..f04a5a526748f913e885b673dda793e5bb16c1b7 100644
index 12d9b73ccc2f4406957932397746cac7902d650e..a0d4a175720a2285dca2eaee96fc614104a76bcc 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -982,7 +982,7 @@ public class ChunkProviderServer extends IChunkProvider {

View File

@ -0,0 +1,29 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Ivan Pekov <ivan@mrivanplays.com>
Date: Tue, 29 Dec 2020 08:47:43 +0200
Subject: [PATCH] Add a special case for floodgate and offline uuids
floodgate spoofs uuids, but plugins such as luckperms get the uuid that the server uses, causing problems
if this option is configured properly, such things won't happen
diff --git a/src/main/java/org/yatopiamc/yatopia/server/YatopiaConfig.java b/src/main/java/org/yatopiamc/yatopia/server/YatopiaConfig.java
index 2d4fb0a4664578f8d5c23db854eb8f2764724940..00c600d74ba84cb564b9b22f53f279a93839d71f 100644
--- a/src/main/java/org/yatopiamc/yatopia/server/YatopiaConfig.java
+++ b/src/main/java/org/yatopiamc/yatopia/server/YatopiaConfig.java
@@ -225,7 +225,16 @@ public class YatopiaConfig {
fixFallDistance = getBoolean("settings.fixFallDistance", false);
}
+ public static boolean usingFloodgate = false;
+ private static void usingFloodgate() {
+ usingFloodgate = getBoolean("settings.using-floodgate", false);
+ }
+
public static boolean shouldUseOfflineUUID() {
+ if (usingFloodgate) {
+ // never cuz floodgate spoofs an uuid
+ return false;
+ }
if (org.spigotmc.SpigotConfig.bungee && com.destroystokyo.paper.PaperConfig.bungeeOnlineMode) {
return false;
}

View File

@ -0,0 +1,27 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Camotoy <20743703+Camotoy@users.noreply.github.com>
Date: Mon, 4 Jan 2021 10:45:49 +0200
Subject: [PATCH] PaperPR - Fix username connecting with no texture being
overwritten by usercache
diff --git a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java
index 8bda2180576d3c58ad592e6158621160a8c4c5cf..44132e902b653b07b21fd01d13a88870290af439 100644
--- a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java
+++ b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java
@@ -166,9 +166,15 @@ public class CraftPlayerProfile implements PlayerProfile {
if ((profile.getName() == null || !hasTextures()) && profile.getId() != null) {
GameProfile profile = userCache.getProfile(this.profile.getId());
if (profile != null) {
+ // Yatopia start - fix username connecting with no texture being overwritten by user cache
+ if (this.profile.getName() == null) {
// if old has it, assume its newer, so overwrite, else use cached if it was set and ours wasn't
copyProfileProperties(this.profile, profile);
this.profile = profile;
+ } else {
+ copyProfileProperties(profile, this.profile);
+ }
+ // Yatopia end
}
}
return this.profile.isComplete();

View File

@ -0,0 +1,144 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Ivan Pekov <ivan@mrivanplays.com>
Date: Mon, 4 Jan 2021 20:12:36 +0200
Subject: [PATCH] Optimised hallowen checker
diff --git a/src/main/java/net/minecraft/server/EntityBat.java b/src/main/java/net/minecraft/server/EntityBat.java
index 0a59e02d762a096cb3de62e0f8105cc5a5fab8d4..bdcbdc21f986852277dcc41a2b0f385f8caeb9f7 100644
--- a/src/main/java/net/minecraft/server/EntityBat.java
+++ b/src/main/java/net/minecraft/server/EntityBat.java
@@ -222,11 +222,16 @@ public class EntityBat extends EntityAmbient {
}
private static boolean eJ() {
+ // Yatopia start - optimised halloween checker
+ /*
LocalDate localdate = LocalDate.now();
int i = localdate.get(ChronoField.DAY_OF_MONTH);
int j = localdate.get(ChronoField.MONTH_OF_YEAR);
return j == 10 && i >= 20 || j == 11 && i <= 3;
+ */
+ return org.yatopiamc.yatopia.server.entity.HalloweenChecker.isHalloweenSeason();
+ // Yatopia end
}
@Override
diff --git a/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java b/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java
index f73304240a626f3f7d9355e6e5f2963a06c4bb7d..3ca3280d4a4d3cd8e0b4aff8431d8fe5904d23a4 100644
--- a/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java
+++ b/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java
@@ -109,11 +109,15 @@ public abstract class EntitySkeletonAbstract extends EntityMonster implements IR
this.eL();
this.setCanPickupLoot(this.world.paperConfig.skeletonsAlwaysCanPickUpLoot || this.random.nextFloat() < 0.55F * difficultydamagescaler.d()); // Paper
if (this.getEquipment(EnumItemSlot.HEAD).isEmpty()) {
+ /* // Yatopia start - optimised halloween checker
LocalDate localdate = LocalDate.now();
int i = localdate.get(ChronoField.DAY_OF_MONTH);
int j = localdate.get(ChronoField.MONTH_OF_YEAR);
if (j == 10 && i == 31 && this.random.nextFloat() < 0.25F) {
+ */
+ if (org.yatopiamc.yatopia.server.entity.HalloweenChecker.isHalloweenDay() && this.random.nextFloat() < 0.25F) {
+ // Yatopia end
this.setSlot(EnumItemSlot.HEAD, new ItemStack(this.random.nextFloat() < 0.1F ? Blocks.JACK_O_LANTERN : Blocks.CARVED_PUMPKIN));
this.dropChanceArmor[EnumItemSlot.HEAD.b()] = 0.0F;
}
diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java
index 752e39ad94ea9e8254853a3fda846be2bd436918..f470650838ab0e349a7ffc79fcb4b84460d32832 100644
--- a/src/main/java/net/minecraft/server/EntityZombie.java
+++ b/src/main/java/net/minecraft/server/EntityZombie.java
@@ -472,11 +472,15 @@ public class EntityZombie extends EntityMonster {
}
if (this.getEquipment(EnumItemSlot.HEAD).isEmpty()) {
+ /* // Yatopia start - optimised halloween checker
LocalDate localdate = LocalDate.now();
int i = localdate.get(ChronoField.DAY_OF_MONTH);
int j = localdate.get(ChronoField.MONTH_OF_YEAR);
if (j == 10 && i == 31 && this.random.nextFloat() < 0.25F) {
+ */
+ if (org.yatopiamc.yatopia.server.entity.HalloweenChecker.isHalloweenDay() && this.random.nextFloat() < 0.25F) {
+ // Yatopia end
this.setSlot(EnumItemSlot.HEAD, new ItemStack(this.random.nextFloat() < 0.1F ? Blocks.JACK_O_LANTERN : Blocks.CARVED_PUMPKIN));
this.dropChanceArmor[EnumItemSlot.HEAD.b()] = 0.0F;
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 0d23591fffcda1f8121e7bc7a6aa00d088b6e80b..7b326635aac5b1e7fb6e3933d133d7e181b7541c 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1335,6 +1335,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
// Paper end
com.tuinity.tuinity.util.CachedLists.reset(); // Tuinity
+ org.yatopiamc.yatopia.server.entity.HalloweenChecker.tick(); // Yatopia
// Paper start
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..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 * 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;
+ }
+
+}

View File

@ -0,0 +1,27 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Ivan Pekov <ivan@mrivanplays.com>
Date: Mon, 4 Jan 2021 20:32:06 +0200
Subject: [PATCH] Smol entity optimisations
diff --git a/src/main/java/net/minecraft/server/EntityBat.java b/src/main/java/net/minecraft/server/EntityBat.java
index bdcbdc21f986852277dcc41a2b0f385f8caeb9f7..dff2dc82c2a6b26c6e41b3949953abcaf379b20a 100644
--- a/src/main/java/net/minecraft/server/EntityBat.java
+++ b/src/main/java/net/minecraft/server/EntityBat.java
@@ -208,7 +208,7 @@ public class EntityBat extends EntityAmbient {
if (blockposition.getY() >= generatoraccess.getSeaLevel()) {
return false;
} else {
- int i = generatoraccess.getLightLevel(blockposition);
+ //int i = generatoraccess.getLightLevel(blockposition); // Yatopia - moved down
byte b0 = 4;
if (eJ()) {
@@ -217,6 +217,7 @@ public class EntityBat extends EntityAmbient {
return false;
}
+ int i = generatoraccess.getLightLevel(blockposition); // Yatopia - moved from above
return i > random.nextInt(b0) ? false : a(entitytypes, generatoraccess, enummobspawn, blockposition, random);
}
}