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.
++ *
++ * If there were no properties, it would return an empty list.
+ *
+ * @return properties
+ */
++ @NotNull
+ public List 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; }
+ //
+}
diff --git a/patches/api/0008-PlayerAttackEntityEvent.patch b/patches/api/0007-PlayerAttackEntityEvent.patch
similarity index 88%
rename from patches/api/0008-PlayerAttackEntityEvent.patch
rename to patches/api/0007-PlayerAttackEntityEvent.patch
index 5a545802..93d75bfb 100644
--- a/patches/api/0008-PlayerAttackEntityEvent.patch
+++ b/patches/api/0007-PlayerAttackEntityEvent.patch
@@ -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()}
++ *
++ * 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; }
+ //
+}
diff --git a/patches/api/0009-Add-StructureLocateEvent.patch b/patches/api/0008-Add-StructureLocateEvent.patch
similarity index 100%
rename from patches/api/0009-Add-StructureLocateEvent.patch
rename to patches/api/0008-Add-StructureLocateEvent.patch
diff --git a/patches/api/0010-Disable-reload-command.patch b/patches/api/0009-Disable-reload-command.patch
similarity index 100%
rename from patches/api/0010-Disable-reload-command.patch
rename to patches/api/0009-Disable-reload-command.patch
diff --git a/patches/server/0001-Yatopia-Server-Fixes.patch b/patches/server/0001-Yatopia-Server-Fixes.patch
index 9173a9fc..471592aa 100644
--- a/patches/server/0001-Yatopia-Server-Fixes.patch
+++ b/patches/server/0001-Yatopia-Server-Fixes.patch
@@ -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 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 resourcekey, final DimensionManager dimensionmanager, Supplier 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;
diff --git a/patches/server/0002-Modify-POM.patch b/patches/server/0002-Modify-POM.patch
index 55ac6f0d..bc273799 100644
--- a/patches/server/0002-Modify-POM.patch
+++ b/patches/server/0002-Modify-POM.patch
@@ -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 @@
diff --git a/patches/server/0003-Brandings.patch b/patches/server/0003-Brandings.patch
index abf18723..2abd54d9 100644
--- a/patches/server/0003-Brandings.patch
+++ b/patches/server/0003-Brandings.patch
@@ -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
Co-authored-by: Ivan Pekov
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 @@
diff --git a/patches/server/0006-Add-last-tick-time-API.patch b/patches/server/0006-Add-last-tick-time-API.patch
index b4007812..31b8c491 100644
--- a/patches/server/0006-Add-last-tick-time-API.patch
+++ b/patches/server/0006-Add-last-tick-time-API.patch
@@ -7,10 +7,10 @@ Original patch by:
Co-authored-by: tr7zw
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
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- cachedFuelMap = null; // Yatopia
-+
- public static Map
- f() {
-+ // Yatopia start
-+ if(cachedFuelMap != null) {
-+ return cachedFuelMap;
-+ }
-+ // Yatopia end
- Map
- 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
}
}
diff --git a/patches/server/0020-Optimize-TileEntity-load-unload.patch b/patches/server/0020-Optimize-TileEntity-load-unload.patch
index 69d53a1d..82c56802 100644
--- a/patches/server/0020-Optimize-TileEntity-load-unload.patch
+++ b/patches/server/0020-Optimize-TileEntity-load-unload.patch
@@ -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 {
diff --git a/patches/server/0022-Redirect-Configs.patch b/patches/server/0022-Redirect-Configs.patch
index ae7f011e..f6eff443 100644
--- a/patches/server/0022-Redirect-Configs.patch
+++ b/patches/server/0022-Redirect-Configs.patch
@@ -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 {
diff --git a/patches/server/0025-Fix-lead-fall-dmg-config.patch b/patches/server/0025-Fix-lead-fall-dmg-config.patch
index e8f5f600..f2c84219 100644
--- a/patches/server/0025-Fix-lead-fall-dmg-config.patch
+++ b/patches/server/0025-Fix-lead-fall-dmg-config.patch
@@ -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);
diff --git a/patches/server/0035-ProxyForwardDataEvent.patch b/patches/server/0035-ProxyForwardDataEvent.patch
index 5bc6fa91..2cbaed4c 100644
--- a/patches/server/0035-ProxyForwardDataEvent.patch
+++ b/patches/server/0035-ProxyForwardDataEvent.patch
@@ -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
diff --git a/patches/server/0037-Respect-PlayerKickEvent-leaveMessage.patch b/patches/server/0037-Respect-PlayerKickEvent-leaveMessage.patch
index 2f638601..ce5ef26d 100644
--- a/patches/server/0037-Respect-PlayerKickEvent-leaveMessage.patch
+++ b/patches/server/0037-Respect-PlayerKickEvent-leaveMessage.patch
@@ -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 {
diff --git a/patches/server/0040-Optimize-whitelist-command-for-multiple-additions-re.patch b/patches/server/0040-Optimize-whitelist-command-for-multiple-additions-re.patch
index 07157d6c..27ab1636 100644
--- a/patches/server/0040-Optimize-whitelist-command-for-multiple-additions-re.patch
+++ b/patches/server/0040-Optimize-whitelist-command-for-multiple-additions-re.patch
@@ -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
-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 instantLater = new java.util.ArrayList<>(); // Yatopia
-+
- if (!world.isClientSide) {
- List 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);
- }
diff --git a/patches/server/0052-lithium-PerlinNoiseSamplerMixin.patch b/patches/server/0051-lithium-PerlinNoiseSamplerMixin.patch
similarity index 100%
rename from patches/server/0052-lithium-PerlinNoiseSamplerMixin.patch
rename to patches/server/0051-lithium-PerlinNoiseSamplerMixin.patch
diff --git a/patches/server/0053-lithium-VoronoiBiomeAccessTypeMixin.patch b/patches/server/0052-lithium-VoronoiBiomeAccessTypeMixin.patch
similarity index 100%
rename from patches/server/0053-lithium-VoronoiBiomeAccessTypeMixin.patch
rename to patches/server/0052-lithium-VoronoiBiomeAccessTypeMixin.patch
diff --git a/patches/server/0054-lithium-NoiseChunkGeneratorMixin.patch b/patches/server/0053-lithium-NoiseChunkGeneratorMixin.patch
similarity index 100%
rename from patches/server/0054-lithium-NoiseChunkGeneratorMixin.patch
rename to patches/server/0053-lithium-NoiseChunkGeneratorMixin.patch
diff --git a/patches/server/0055-lithium-reduce-allocations.patch b/patches/server/0054-lithium-reduce-allocations.patch
similarity index 100%
rename from patches/server/0055-lithium-reduce-allocations.patch
rename to patches/server/0054-lithium-reduce-allocations.patch
diff --git a/patches/server/0056-Smarter-statistics-ticking.patch b/patches/server/0055-Smarter-statistics-ticking.patch
similarity index 100%
rename from patches/server/0056-Smarter-statistics-ticking.patch
rename to patches/server/0055-Smarter-statistics-ticking.patch
diff --git a/patches/server/0057-Configurable-criterion-triggers.patch b/patches/server/0056-Configurable-criterion-triggers.patch
similarity index 100%
rename from patches/server/0057-Configurable-criterion-triggers.patch
rename to patches/server/0056-Configurable-criterion-triggers.patch
diff --git a/patches/server/0058-Configurable-BlockPhysicsEvent.patch b/patches/server/0057-Configurable-BlockPhysicsEvent.patch
similarity index 93%
rename from patches/server/0058-Configurable-BlockPhysicsEvent.patch
rename to patches/server/0057-Configurable-BlockPhysicsEvent.patch
index fa3df713..377311be 100644
--- a/patches/server/0058-Configurable-BlockPhysicsEvent.patch
+++ b/patches/server/0057-Configurable-BlockPhysicsEvent.patch
@@ -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 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 {
diff --git a/patches/server/0063-Configurable-enchanting-table-tick.patch b/patches/server/0062-Configurable-enchanting-table-tick.patch
similarity index 100%
rename from patches/server/0063-Configurable-enchanting-table-tick.patch
rename to patches/server/0062-Configurable-enchanting-table-tick.patch
diff --git a/patches/server/0064-Do-not-update-distance-map-when-animal-and-mob-spawn.patch b/patches/server/0063-Do-not-update-distance-map-when-animal-and-mob-spawn.patch
similarity index 93%
rename from patches/server/0064-Do-not-update-distance-map-when-animal-and-mob-spawn.patch
rename to patches/server/0063-Do-not-update-distance-map-when-animal-and-mob-spawn.patch
index 0c65d9eb..93eaea47 100644
--- a/patches/server/0064-Do-not-update-distance-map-when-animal-and-mob-spawn.patch
+++ b/patches/server/0063-Do-not-update-distance-map-when-animal-and-mob-spawn.patch
@@ -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 {
diff --git a/patches/server/0064-Add-a-special-case-for-floodgate-and-offline-uuids.patch b/patches/server/0064-Add-a-special-case-for-floodgate-and-offline-uuids.patch
new file mode 100644
index 00000000..061d1dcf
--- /dev/null
+++ b/patches/server/0064-Add-a-special-case-for-floodgate-and-offline-uuids.patch
@@ -0,0 +1,29 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Ivan Pekov
+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;
+ }
diff --git a/patches/server/0065-PaperPR-Fix-username-connecting-with-no-texture-bein.patch b/patches/server/0065-PaperPR-Fix-username-connecting-with-no-texture-bein.patch
new file mode 100644
index 00000000..c454176e
--- /dev/null
+++ b/patches/server/0065-PaperPR-Fix-username-connecting-with-no-texture-bein.patch
@@ -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();
diff --git a/patches/server/0066-Optimised-hallowen-checker.patch b/patches/server/0066-Optimised-hallowen-checker.patch
new file mode 100644
index 00000000..f5505bb5
--- /dev/null
+++ b/patches/server/0066-Optimised-hallowen-checker.patch
@@ -0,0 +1,144 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Ivan Pekov
+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
++ * Checks whether or not it is halloween at a specific rate rather than every time when
++ * a entity is being spawned.
++ *
++ * 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;
++ }
++
++}
diff --git a/patches/server/0067-Smol-entity-optimisations.patch b/patches/server/0067-Smol-entity-optimisations.patch
new file mode 100644
index 00000000..895ba55a
--- /dev/null
+++ b/patches/server/0067-Smol-entity-optimisations.patch
@@ -0,0 +1,27 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Ivan Pekov
+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);
+ }
+ }