Fix MCUtils and other calls to postTaskOnMain

Method changed changed it's role to providing a TickTask object which
isn't automatically scheduled onto the server
This commit is contained in:
Shane Freeder 2019-05-10 18:42:33 +01:00
parent 994679a0c9
commit 026210202b
No known key found for this signature in database
GPG Key ID: A3F61EA5A085289C
7 changed files with 123 additions and 60 deletions

View File

@ -1,11 +1,11 @@
From 2a7df1df57521c5e013a7e71b748d5c73a4904cc Mon Sep 17 00:00:00 2001 From 2947fccbf09877c62048ba716cd3a027a5e8954e Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co> From: Aikar <aikar@aikar.co>
Date: Wed, 30 Mar 2016 19:36:20 -0400 Date: Wed, 30 Mar 2016 19:36:20 -0400
Subject: [PATCH] MC Dev fixes Subject: [PATCH] MC Dev fixes
diff --git a/src/main/java/net/minecraft/server/BiomeBase.java b/src/main/java/net/minecraft/server/BiomeBase.java diff --git a/src/main/java/net/minecraft/server/BiomeBase.java b/src/main/java/net/minecraft/server/BiomeBase.java
index 26fa6e7b64..9a839d6540 100644 index 26fa6e7b6..9a839d654 100644
--- a/src/main/java/net/minecraft/server/BiomeBase.java --- a/src/main/java/net/minecraft/server/BiomeBase.java
+++ b/src/main/java/net/minecraft/server/BiomeBase.java +++ b/src/main/java/net/minecraft/server/BiomeBase.java
@@ -42,7 +42,7 @@ public abstract class BiomeBase { @@ -42,7 +42,7 @@ public abstract class BiomeBase {
@ -27,7 +27,7 @@ index 26fa6e7b64..9a839d6540 100644
public List<WorldGenFeatureConfigured<?>> e() { public List<WorldGenFeatureConfigured<?>> e() {
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
index f0ff70980d..dd47e9cbe4 100644 index f0ff70980..dd47e9cbe 100644
--- a/src/main/java/net/minecraft/server/BlockPosition.java --- a/src/main/java/net/minecraft/server/BlockPosition.java
+++ b/src/main/java/net/minecraft/server/BlockPosition.java +++ b/src/main/java/net/minecraft/server/BlockPosition.java
@@ -57,12 +57,12 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali @@ -57,12 +57,12 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
@ -47,7 +47,7 @@ index f0ff70980d..dd47e9cbe4 100644
}); });
} }
diff --git a/src/main/java/net/minecraft/server/BlockStateEnum.java b/src/main/java/net/minecraft/server/BlockStateEnum.java diff --git a/src/main/java/net/minecraft/server/BlockStateEnum.java b/src/main/java/net/minecraft/server/BlockStateEnum.java
index b4c8722f04..59d86fc66e 100644 index b4c8722f0..59d86fc66 100644
--- a/src/main/java/net/minecraft/server/BlockStateEnum.java --- a/src/main/java/net/minecraft/server/BlockStateEnum.java
+++ b/src/main/java/net/minecraft/server/BlockStateEnum.java +++ b/src/main/java/net/minecraft/server/BlockStateEnum.java
@@ -20,10 +20,10 @@ public class BlockStateEnum<T extends Enum<T> & INamable> extends BlockState<T> @@ -20,10 +20,10 @@ public class BlockStateEnum<T extends Enum<T> & INamable> extends BlockState<T>
@ -64,7 +64,7 @@ index b4c8722f04..59d86fc66e 100644
if (this.b.containsKey(s1)) { if (this.b.containsKey(s1)) {
diff --git a/src/main/java/net/minecraft/server/ChunkSection.java b/src/main/java/net/minecraft/server/ChunkSection.java diff --git a/src/main/java/net/minecraft/server/ChunkSection.java b/src/main/java/net/minecraft/server/ChunkSection.java
index c973ab6076..30701fd7f3 100644 index c973ab607..30701fd7f 100644
--- a/src/main/java/net/minecraft/server/ChunkSection.java --- a/src/main/java/net/minecraft/server/ChunkSection.java
+++ b/src/main/java/net/minecraft/server/ChunkSection.java +++ b/src/main/java/net/minecraft/server/ChunkSection.java
@@ -148,6 +148,6 @@ public class ChunkSection { @@ -148,6 +148,6 @@ public class ChunkSection {
@ -76,7 +76,7 @@ index c973ab6076..30701fd7f3 100644
} }
} }
diff --git a/src/main/java/net/minecraft/server/EntityVindicator.java b/src/main/java/net/minecraft/server/EntityVindicator.java diff --git a/src/main/java/net/minecraft/server/EntityVindicator.java b/src/main/java/net/minecraft/server/EntityVindicator.java
index 45370ad5d9..b566e77869 100644 index 45370ad5d..b566e7786 100644
--- a/src/main/java/net/minecraft/server/EntityVindicator.java --- a/src/main/java/net/minecraft/server/EntityVindicator.java
+++ b/src/main/java/net/minecraft/server/EntityVindicator.java +++ b/src/main/java/net/minecraft/server/EntityVindicator.java
@@ -25,7 +25,7 @@ public class EntityVindicator extends EntityIllagerAbstract { @@ -25,7 +25,7 @@ public class EntityVindicator extends EntityIllagerAbstract {
@ -89,7 +89,7 @@ index 45370ad5d9..b566e77869 100644
this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, true)); this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, true));
this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityIronGolem.class, true)); this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityIronGolem.class, true));
diff --git a/src/main/java/net/minecraft/server/GameRules.java b/src/main/java/net/minecraft/server/GameRules.java diff --git a/src/main/java/net/minecraft/server/GameRules.java b/src/main/java/net/minecraft/server/GameRules.java
index d8d2267084..3de9d264db 100644 index d8d226708..3de9d264d 100644
--- a/src/main/java/net/minecraft/server/GameRules.java --- a/src/main/java/net/minecraft/server/GameRules.java
+++ b/src/main/java/net/minecraft/server/GameRules.java +++ b/src/main/java/net/minecraft/server/GameRules.java
@@ -17,7 +17,7 @@ import javax.annotation.Nullable; @@ -17,7 +17,7 @@ import javax.annotation.Nullable;
@ -110,8 +110,29 @@ index d8d2267084..3de9d264db 100644
this.d = supplier; this.d = supplier;
this.e = bifunction; this.e = bifunction;
} }
diff --git a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java
index 85c28ec8e..7016b03f6 100644
--- a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java
+++ b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java
@@ -77,14 +77,14 @@ public abstract class IAsyncTaskHandler<R extends Runnable> implements Mailbox<R
}
protected boolean executeNext() {
- R r0 = (Runnable) this.d.peek();
+ R r0 = this.d.peek(); // Paper - decompile fix
if (r0 == null) {
return false;
} else if (this.e == 0 && !this.canExecute(r0)) {
return false;
} else {
- this.executeTask((Runnable) this.d.remove());
+ this.executeTask(this.d.remove()); // Paper - decompile fix
return true;
}
}
diff --git a/src/main/java/net/minecraft/server/IBlockAccess.java b/src/main/java/net/minecraft/server/IBlockAccess.java diff --git a/src/main/java/net/minecraft/server/IBlockAccess.java b/src/main/java/net/minecraft/server/IBlockAccess.java
index 8753bea614..809ca0983a 100644 index 8753bea61..809ca0983 100644
--- a/src/main/java/net/minecraft/server/IBlockAccess.java --- a/src/main/java/net/minecraft/server/IBlockAccess.java
+++ b/src/main/java/net/minecraft/server/IBlockAccess.java +++ b/src/main/java/net/minecraft/server/IBlockAccess.java
@@ -96,7 +96,7 @@ public interface IBlockAccess { @@ -96,7 +96,7 @@ public interface IBlockAccess {
@ -124,7 +145,7 @@ index 8753bea614..809ca0983a 100644
do { do {
if (d12 > 1.0D && d13 > 1.0D && d14 > 1.0D) { if (d12 > 1.0D && d13 > 1.0D && d14 > 1.0D) {
diff --git a/src/main/java/net/minecraft/server/IBlockData.java b/src/main/java/net/minecraft/server/IBlockData.java diff --git a/src/main/java/net/minecraft/server/IBlockData.java b/src/main/java/net/minecraft/server/IBlockData.java
index e8ae4b5e44..0f4aa698aa 100644 index e8ae4b5e4..0f4aa698a 100644
--- a/src/main/java/net/minecraft/server/IBlockData.java --- a/src/main/java/net/minecraft/server/IBlockData.java
+++ b/src/main/java/net/minecraft/server/IBlockData.java +++ b/src/main/java/net/minecraft/server/IBlockData.java
@@ -265,12 +265,12 @@ public class IBlockData extends BlockDataAbstract<Block, IBlockData> implements @@ -265,12 +265,12 @@ public class IBlockData extends BlockDataAbstract<Block, IBlockData> implements
@ -166,7 +187,7 @@ index e8ae4b5e44..0f4aa698aa 100644
} }
} }
diff --git a/src/main/java/net/minecraft/server/IEntityAccess.java b/src/main/java/net/minecraft/server/IEntityAccess.java diff --git a/src/main/java/net/minecraft/server/IEntityAccess.java b/src/main/java/net/minecraft/server/IEntityAccess.java
index bf7e0d17ef..ee22bb0387 100644 index bf7e0d17e..ee22bb038 100644
--- a/src/main/java/net/minecraft/server/IEntityAccess.java --- a/src/main/java/net/minecraft/server/IEntityAccess.java
+++ b/src/main/java/net/minecraft/server/IEntityAccess.java +++ b/src/main/java/net/minecraft/server/IEntityAccess.java
@@ -147,17 +147,17 @@ public interface IEntityAccess { @@ -147,17 +147,17 @@ public interface IEntityAccess {
@ -204,7 +225,7 @@ index bf7e0d17ef..ee22bb0387 100644
if (pathfindertargetcondition.a(entityliving, t0)) { if (pathfindertargetcondition.a(entityliving, t0)) {
list1.add(t0); list1.add(t0);
diff --git a/src/main/java/net/minecraft/server/LootSelectorEntry.java b/src/main/java/net/minecraft/server/LootSelectorEntry.java diff --git a/src/main/java/net/minecraft/server/LootSelectorEntry.java b/src/main/java/net/minecraft/server/LootSelectorEntry.java
index 9290534917..1016325bd7 100644 index 929053491..1016325bd 100644
--- a/src/main/java/net/minecraft/server/LootSelectorEntry.java --- a/src/main/java/net/minecraft/server/LootSelectorEntry.java
+++ b/src/main/java/net/minecraft/server/LootSelectorEntry.java +++ b/src/main/java/net/minecraft/server/LootSelectorEntry.java
@@ -127,7 +127,7 @@ public abstract class LootSelectorEntry extends LootEntryAbstract { @@ -127,7 +127,7 @@ public abstract class LootSelectorEntry extends LootEntryAbstract {
@ -232,7 +253,7 @@ index 9290534917..1016325bd7 100644
} }
diff --git a/src/main/java/net/minecraft/server/NBTBase.java b/src/main/java/net/minecraft/server/NBTBase.java diff --git a/src/main/java/net/minecraft/server/NBTBase.java b/src/main/java/net/minecraft/server/NBTBase.java
index cb0c08a144..9aabcb630f 100644 index cb0c08a14..9aabcb630 100644
--- a/src/main/java/net/minecraft/server/NBTBase.java --- a/src/main/java/net/minecraft/server/NBTBase.java
+++ b/src/main/java/net/minecraft/server/NBTBase.java +++ b/src/main/java/net/minecraft/server/NBTBase.java
@@ -88,7 +88,7 @@ public interface NBTBase { @@ -88,7 +88,7 @@ public interface NBTBase {
@ -245,7 +266,7 @@ index cb0c08a144..9aabcb630f 100644
default String asString() { default String asString() {
return this.toString(); return this.toString();
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
index 0dda7aaf69..4e20cfba41 100644 index 0dda7aaf6..4e20cfba4 100644
--- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java --- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
+++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java +++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
@@ -134,7 +134,7 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> { @@ -134,7 +134,7 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> {
@ -258,7 +279,7 @@ index 0dda7aaf69..4e20cfba41 100644
} }
diff --git a/src/main/java/net/minecraft/server/RegistryBlockID.java b/src/main/java/net/minecraft/server/RegistryBlockID.java diff --git a/src/main/java/net/minecraft/server/RegistryBlockID.java b/src/main/java/net/minecraft/server/RegistryBlockID.java
index 7f89562e90..4efcb8b595 100644 index 7f89562e9..4efcb8b59 100644
--- a/src/main/java/net/minecraft/server/RegistryBlockID.java --- a/src/main/java/net/minecraft/server/RegistryBlockID.java
+++ b/src/main/java/net/minecraft/server/RegistryBlockID.java +++ b/src/main/java/net/minecraft/server/RegistryBlockID.java
@@ -27,7 +27,7 @@ public class RegistryBlockID<T> implements Registry<T> { @@ -27,7 +27,7 @@ public class RegistryBlockID<T> implements Registry<T> {
@ -271,7 +292,7 @@ index 7f89562e90..4efcb8b595 100644
this.c.set(i, t0); this.c.set(i, t0);
diff --git a/src/main/java/net/minecraft/server/RegistryID.java b/src/main/java/net/minecraft/server/RegistryID.java diff --git a/src/main/java/net/minecraft/server/RegistryID.java b/src/main/java/net/minecraft/server/RegistryID.java
index 4cb78c6a3f..e15d286710 100644 index 4cb78c6a3..e15d28671 100644
--- a/src/main/java/net/minecraft/server/RegistryID.java --- a/src/main/java/net/minecraft/server/RegistryID.java
+++ b/src/main/java/net/minecraft/server/RegistryID.java +++ b/src/main/java/net/minecraft/server/RegistryID.java
@@ -17,9 +17,9 @@ public class RegistryID<K> implements Registry<K> { @@ -17,9 +17,9 @@ public class RegistryID<K> implements Registry<K> {
@ -299,7 +320,7 @@ index 4cb78c6a3f..e15d286710 100644
this.f = 0; this.f = 0;
diff --git a/src/main/java/net/minecraft/server/SystemUtils.java b/src/main/java/net/minecraft/server/SystemUtils.java diff --git a/src/main/java/net/minecraft/server/SystemUtils.java b/src/main/java/net/minecraft/server/SystemUtils.java
index 41a5d1dc29..b3799ab564 100644 index 41a5d1dc2..b3799ab56 100644
--- a/src/main/java/net/minecraft/server/SystemUtils.java --- a/src/main/java/net/minecraft/server/SystemUtils.java
+++ b/src/main/java/net/minecraft/server/SystemUtils.java +++ b/src/main/java/net/minecraft/server/SystemUtils.java
@@ -45,8 +45,8 @@ public class SystemUtils { @@ -45,8 +45,8 @@ public class SystemUtils {
@ -343,7 +364,7 @@ index 41a5d1dc29..b3799ab564 100644
if (throwable != null) { if (throwable != null) {
completablefuture.completeExceptionally(throwable); completablefuture.completeExceptionally(throwable);
diff --git a/src/main/java/net/minecraft/server/VillagerTrades.java b/src/main/java/net/minecraft/server/VillagerTrades.java diff --git a/src/main/java/net/minecraft/server/VillagerTrades.java b/src/main/java/net/minecraft/server/VillagerTrades.java
index 1df86e3bb1..eabbf29334 100644 index 1df86e3bb..eabbf2933 100644
--- a/src/main/java/net/minecraft/server/VillagerTrades.java --- a/src/main/java/net/minecraft/server/VillagerTrades.java
+++ b/src/main/java/net/minecraft/server/VillagerTrades.java +++ b/src/main/java/net/minecraft/server/VillagerTrades.java
@@ -15,12 +15,12 @@ import javax.annotation.Nullable; @@ -15,12 +15,12 @@ import javax.annotation.Nullable;
@ -363,7 +384,7 @@ index 1df86e3bb1..eabbf29334 100644
hashmap.put(VillagerProfession.CLERIC, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.ROTTEN_FLESH, 32, 8, 2), new VillagerTrades.h(Items.REDSTONE, 1, 2, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.GOLD_INGOT, 3, 6, 10), new VillagerTrades.h(Items.LAPIS_LAZULI, 1, 1, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.RABBIT_FOOT, 2, 6, 20), new VillagerTrades.h(Blocks.GLOWSTONE, 4, 1, 6, 10)}, 4, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.SCUTE, 4, 6, 30), new VillagerTrades.b(Items.GLASS_BOTTLE, 9, 6, 30), new VillagerTrades.h(Items.ENDER_PEARL, 5, 1, 15)}, 5, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.NETHER_WART, 22, 6, 30), new VillagerTrades.h(Items.EXPERIENCE_BOTTLE, 3, 1, 30)}))); hashmap.put(VillagerProfession.CLERIC, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.ROTTEN_FLESH, 32, 8, 2), new VillagerTrades.h(Items.REDSTONE, 1, 2, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.GOLD_INGOT, 3, 6, 10), new VillagerTrades.h(Items.LAPIS_LAZULI, 1, 1, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.RABBIT_FOOT, 2, 6, 20), new VillagerTrades.h(Blocks.GLOWSTONE, 4, 1, 6, 10)}, 4, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.SCUTE, 4, 6, 30), new VillagerTrades.b(Items.GLASS_BOTTLE, 9, 6, 30), new VillagerTrades.h(Items.ENDER_PEARL, 5, 1, 15)}, 5, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.NETHER_WART, 22, 6, 30), new VillagerTrades.h(Items.EXPERIENCE_BOTTLE, 3, 1, 30)})));
hashmap.put(VillagerProfession.ARMORER, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.COAL, 15, 8, 2), new VillagerTrades.h(new ItemStack(Items.IRON_LEGGINGS), 7, 1, 6, 1, 0.2F), new VillagerTrades.h(new ItemStack(Items.IRON_BOOTS), 4, 1, 6, 1, 0.2F), new VillagerTrades.h(new ItemStack(Items.IRON_HELMET), 5, 1, 6, 1, 0.2F), new VillagerTrades.h(new ItemStack(Items.IRON_CHESTPLATE), 9, 1, 6, 1, 0.2F)}, 2, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.IRON_INGOT, 4, 6, 10), new VillagerTrades.h(new ItemStack(Items.pP), 36, 1, 6, 5, 0.2F), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_BOOTS), 1, 1, 6, 5, 0.2F), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_LEGGINGS), 3, 1, 6, 5, 0.2F)}, 3, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.LAVA_BUCKET, 1, 6, 20), new VillagerTrades.b(Items.DIAMOND, 1, 6, 20), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_HELMET), 1, 1, 6, 10, 0.2F), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_CHESTPLATE), 4, 1, 6, 10, 0.2F), new VillagerTrades.h(new ItemStack(Items.SHIELD), 5, 1, 6, 10, 0.2F)}, 4, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.e(Items.DIAMOND_LEGGINGS, 14, 2, 15, 0.2F), new VillagerTrades.e(Items.DIAMOND_BOOTS, 8, 2, 15, 0.2F)}, 5, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.e(Items.DIAMOND_HELMET, 8, 2, 30, 0.2F), new VillagerTrades.e(Items.DIAMOND_CHESTPLATE, 16, 2, 30, 0.2F)}))); hashmap.put(VillagerProfession.ARMORER, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.COAL, 15, 8, 2), new VillagerTrades.h(new ItemStack(Items.IRON_LEGGINGS), 7, 1, 6, 1, 0.2F), new VillagerTrades.h(new ItemStack(Items.IRON_BOOTS), 4, 1, 6, 1, 0.2F), new VillagerTrades.h(new ItemStack(Items.IRON_HELMET), 5, 1, 6, 1, 0.2F), new VillagerTrades.h(new ItemStack(Items.IRON_CHESTPLATE), 9, 1, 6, 1, 0.2F)}, 2, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.IRON_INGOT, 4, 6, 10), new VillagerTrades.h(new ItemStack(Items.pP), 36, 1, 6, 5, 0.2F), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_BOOTS), 1, 1, 6, 5, 0.2F), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_LEGGINGS), 3, 1, 6, 5, 0.2F)}, 3, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.LAVA_BUCKET, 1, 6, 20), new VillagerTrades.b(Items.DIAMOND, 1, 6, 20), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_HELMET), 1, 1, 6, 10, 0.2F), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_CHESTPLATE), 4, 1, 6, 10, 0.2F), new VillagerTrades.h(new ItemStack(Items.SHIELD), 5, 1, 6, 10, 0.2F)}, 4, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.e(Items.DIAMOND_LEGGINGS, 14, 2, 15, 0.2F), new VillagerTrades.e(Items.DIAMOND_BOOTS, 8, 2, 15, 0.2F)}, 5, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.e(Items.DIAMOND_HELMET, 8, 2, 30, 0.2F), new VillagerTrades.e(Items.DIAMOND_CHESTPLATE, 16, 2, 30, 0.2F)})));
diff --git a/src/main/java/net/minecraft/server/WorldPersistentData.java b/src/main/java/net/minecraft/server/WorldPersistentData.java diff --git a/src/main/java/net/minecraft/server/WorldPersistentData.java b/src/main/java/net/minecraft/server/WorldPersistentData.java
index b251a1d7d9..3c5b3fe101 100644 index b251a1d7d..3c5b3fe10 100644
--- a/src/main/java/net/minecraft/server/WorldPersistentData.java --- a/src/main/java/net/minecraft/server/WorldPersistentData.java
+++ b/src/main/java/net/minecraft/server/WorldPersistentData.java +++ b/src/main/java/net/minecraft/server/WorldPersistentData.java
@@ -37,7 +37,7 @@ public class WorldPersistentData { @@ -37,7 +37,7 @@ public class WorldPersistentData {

View File

@ -1,11 +1,11 @@
From 00efbd649e6a52763bb40eecd699134b2bd8f8b9 Mon Sep 17 00:00:00 2001 From 8be0f9b0ebf8cb9794ed83d22dc5aaa3874e1a1a Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co> From: Aikar <aikar@aikar.co>
Date: Mon, 28 Mar 2016 20:55:47 -0400 Date: Mon, 28 Mar 2016 20:55:47 -0400
Subject: [PATCH] MC Utils Subject: [PATCH] MC Utils
diff --git a/src/main/java/net/minecraft/server/AttributeInstance.java b/src/main/java/net/minecraft/server/AttributeInstance.java diff --git a/src/main/java/net/minecraft/server/AttributeInstance.java b/src/main/java/net/minecraft/server/AttributeInstance.java
index 2f2b103641..b1900ba364 100644 index 2f2b10364..b1900ba36 100644
--- a/src/main/java/net/minecraft/server/AttributeInstance.java --- a/src/main/java/net/minecraft/server/AttributeInstance.java
+++ b/src/main/java/net/minecraft/server/AttributeInstance.java +++ b/src/main/java/net/minecraft/server/AttributeInstance.java
@@ -21,8 +21,10 @@ public interface AttributeInstance { @@ -21,8 +21,10 @@ public interface AttributeInstance {
@ -20,7 +20,7 @@ index 2f2b103641..b1900ba364 100644
void b(UUID uuid); void b(UUID uuid);
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
index dd47e9cbe4..c927d524a8 100644 index dd47e9cbe..c927d524a 100644
--- a/src/main/java/net/minecraft/server/BlockPosition.java --- a/src/main/java/net/minecraft/server/BlockPosition.java
+++ b/src/main/java/net/minecraft/server/BlockPosition.java +++ b/src/main/java/net/minecraft/server/BlockPosition.java
@@ -120,6 +120,7 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali @@ -120,6 +120,7 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
@ -57,7 +57,7 @@ index dd47e9cbe4..c927d524a8 100644
return this.d(MathHelper.floor(d0), MathHelper.floor(d1), MathHelper.floor(d2)); return this.d(MathHelper.floor(d0), MathHelper.floor(d1), MathHelper.floor(d2));
} }
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index fc54888fa0..8f789c91f7 100644 index fc54888fa..8f789c91f 100644
--- a/src/main/java/net/minecraft/server/Chunk.java --- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -32,7 +32,7 @@ import org.bukkit.event.entity.CreatureSpawnEvent; @@ -32,7 +32,7 @@ import org.bukkit.event.entity.CreatureSpawnEvent;
@ -78,7 +78,7 @@ index fc54888fa0..8f789c91f7 100644
public TileEntity a(BlockPosition blockposition, Chunk.EnumTileEntityState chunk_enumtileentitystate) { public TileEntity a(BlockPosition blockposition, Chunk.EnumTileEntityState chunk_enumtileentitystate) {
// CraftBukkit start // CraftBukkit start
diff --git a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java diff --git a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java
index 857b2f8868..bbf136614c 100644 index 857b2f886..bbf136614 100644
--- a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java --- a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java
+++ b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java +++ b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java
@@ -31,7 +31,9 @@ public class ChunkCoordIntPair { @@ -31,7 +31,9 @@ public class ChunkCoordIntPair {
@ -93,7 +93,7 @@ index 857b2f8868..bbf136614c 100644
} }
diff --git a/src/main/java/net/minecraft/server/DataBits.java b/src/main/java/net/minecraft/server/DataBits.java diff --git a/src/main/java/net/minecraft/server/DataBits.java b/src/main/java/net/minecraft/server/DataBits.java
index 8bda055159..409dc837c6 100644 index 8bda05515..409dc837c 100644
--- a/src/main/java/net/minecraft/server/DataBits.java --- a/src/main/java/net/minecraft/server/DataBits.java
+++ b/src/main/java/net/minecraft/server/DataBits.java +++ b/src/main/java/net/minecraft/server/DataBits.java
@@ -82,6 +82,7 @@ public class DataBits { @@ -82,6 +82,7 @@ public class DataBits {
@ -105,7 +105,7 @@ index 8bda055159..409dc837c6 100644
return this.a; return this.a;
} }
diff --git a/src/main/java/net/minecraft/server/DataPalette.java b/src/main/java/net/minecraft/server/DataPalette.java diff --git a/src/main/java/net/minecraft/server/DataPalette.java b/src/main/java/net/minecraft/server/DataPalette.java
index 75ba698868..45403fbe30 100644 index 75ba69886..45403fbe3 100644
--- a/src/main/java/net/minecraft/server/DataPalette.java --- a/src/main/java/net/minecraft/server/DataPalette.java
+++ b/src/main/java/net/minecraft/server/DataPalette.java +++ b/src/main/java/net/minecraft/server/DataPalette.java
@@ -4,10 +4,12 @@ import javax.annotation.Nullable; @@ -4,10 +4,12 @@ import javax.annotation.Nullable;
@ -122,7 +122,7 @@ index 75ba698868..45403fbe30 100644
T a(int i); T a(int i);
diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java
index 4411d5640a..28a6be7ab0 100644 index 4411d5640..28a6be7ab 100644
--- a/src/main/java/net/minecraft/server/DataPaletteBlock.java --- a/src/main/java/net/minecraft/server/DataPaletteBlock.java
+++ b/src/main/java/net/minecraft/server/DataPaletteBlock.java +++ b/src/main/java/net/minecraft/server/DataPaletteBlock.java
@@ -8,7 +8,7 @@ import java.util.stream.Collectors; @@ -8,7 +8,7 @@ import java.util.stream.Collectors;
@ -164,7 +164,7 @@ index 4411d5640a..28a6be7ab0 100644
this.a(); this.a();
packetdataserializer.writeByte(this.i); packetdataserializer.writeByte(this.i);
diff --git a/src/main/java/net/minecraft/server/EntityCreature.java b/src/main/java/net/minecraft/server/EntityCreature.java diff --git a/src/main/java/net/minecraft/server/EntityCreature.java b/src/main/java/net/minecraft/server/EntityCreature.java
index 7636358a70..8520680814 100644 index 7636358a7..852068081 100644
--- a/src/main/java/net/minecraft/server/EntityCreature.java --- a/src/main/java/net/minecraft/server/EntityCreature.java
+++ b/src/main/java/net/minecraft/server/EntityCreature.java +++ b/src/main/java/net/minecraft/server/EntityCreature.java
@@ -6,6 +6,8 @@ import org.bukkit.event.entity.EntityUnleashEvent; @@ -6,6 +6,8 @@ import org.bukkit.event.entity.EntityUnleashEvent;
@ -177,7 +177,7 @@ index 7636358a70..8520680814 100644
super(entitytypes, world); super(entitytypes, world);
} }
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
index 4720632641..afa03ce6f2 100644 index 472063264..afa03ce6f 100644
--- a/src/main/java/net/minecraft/server/EntityInsentient.java --- a/src/main/java/net/minecraft/server/EntityInsentient.java
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java
@@ -143,6 +143,7 @@ public abstract class EntityInsentient extends EntityLiving { @@ -143,6 +143,7 @@ public abstract class EntityInsentient extends EntityLiving {
@ -189,7 +189,7 @@ index 4720632641..afa03ce6f2 100644
// CraftBukkit start - fire event // CraftBukkit start - fire event
setGoalTarget(entityliving, EntityTargetEvent.TargetReason.UNKNOWN, true); setGoalTarget(entityliving, EntityTargetEvent.TargetReason.UNKNOWN, true);
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index c1bb7a88ae..f86e6a4c51 100644 index c1bb7a88a..f86e6a4c5 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java --- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -126,6 +126,7 @@ public abstract class EntityLiving extends Entity { @@ -126,6 +126,7 @@ public abstract class EntityLiving extends Entity {
@ -201,7 +201,7 @@ index c1bb7a88ae..f86e6a4c51 100644
@Override @Override
public float getBukkitYaw() { public float getBukkitYaw() {
diff --git a/src/main/java/net/minecraft/server/EntityMonster.java b/src/main/java/net/minecraft/server/EntityMonster.java diff --git a/src/main/java/net/minecraft/server/EntityMonster.java b/src/main/java/net/minecraft/server/EntityMonster.java
index 6ab4c78b35..76142d5dc2 100644 index 6ab4c78b3..76142d5dc 100644
--- a/src/main/java/net/minecraft/server/EntityMonster.java --- a/src/main/java/net/minecraft/server/EntityMonster.java
+++ b/src/main/java/net/minecraft/server/EntityMonster.java +++ b/src/main/java/net/minecraft/server/EntityMonster.java
@@ -4,6 +4,7 @@ import java.util.function.Predicate; @@ -4,6 +4,7 @@ import java.util.function.Predicate;
@ -213,7 +213,7 @@ index 6ab4c78b35..76142d5dc2 100644
super(entitytypes, world); super(entitytypes, world);
this.f = 5; this.f = 5;
diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java
index 01d9ed69c5..3217a8ed18 100644 index 01d9ed69c..3217a8ed1 100644
--- a/src/main/java/net/minecraft/server/EntityTypes.java --- a/src/main/java/net/minecraft/server/EntityTypes.java
+++ b/src/main/java/net/minecraft/server/EntityTypes.java +++ b/src/main/java/net/minecraft/server/EntityTypes.java
@@ -5,6 +5,7 @@ import com.mojang.datafixers.types.Type; @@ -5,6 +5,7 @@ import com.mojang.datafixers.types.Type;
@ -235,8 +235,28 @@ index 01d9ed69c5..3217a8ed18 100644
return this.aZ.create(this, world); return this.aZ.create(this, world);
} }
diff --git a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java
index 7016b03f6..c22128953 100644
--- a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java
+++ b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java
@@ -55,6 +55,15 @@ public abstract class IAsyncTaskHandler<R extends Runnable> implements Mailbox<R
}
+ // Paper start
+ public void scheduleOnMain(Runnable r0) {
+ // postToMainThread does not work the same as older versions of mc
+ // This method is actually used to create a TickTask, which can then be posted onto main
+ this.addTask(this.postToMainThread(r0));
+ }
+ // Paper end
+
+ public void addTask(R r0) { a(r0); }; // Paper - OBFHELPER
public void a(R r0) {
this.d.add(r0);
LockSupport.unpark(this.getThread());
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
index e975265a28..aa6a58dd88 100644 index e975265a2..aa6a58dd8 100644
--- a/src/main/java/net/minecraft/server/ItemStack.java --- a/src/main/java/net/minecraft/server/ItemStack.java
+++ b/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java
@@ -37,10 +37,19 @@ import org.bukkit.event.world.StructureGrowEvent; @@ -37,10 +37,19 @@ import org.bukkit.event.world.StructureGrowEvent;
@ -296,7 +316,7 @@ index e975265a28..aa6a58dd88 100644
// CraftBukkit end // CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java
new file mode 100644 new file mode 100644
index 0000000000..3448b5588e index 000000000..c96f3ed17
--- /dev/null --- /dev/null
+++ b/src/main/java/net/minecraft/server/MCUtil.java +++ b/src/main/java/net/minecraft/server/MCUtil.java
@@ -0,0 +1,316 @@ @@ -0,0 +1,316 @@
@ -354,7 +374,7 @@ index 0000000000..3448b5588e
+ public static void scheduleTask(int ticks, Runnable runnable) { + public static void scheduleTask(int ticks, Runnable runnable) {
+ // We use post to main instead of process queue as we don't want to process these mid tick if + // We use post to main instead of process queue as we don't want to process these mid tick if
+ // Someone uses processQueueWhileWaiting + // Someone uses processQueueWhileWaiting
+ MinecraftServer.getServer().postToMainThread(new DelayedRunnable(ticks, runnable)); + MinecraftServer.getServer().scheduleOnMain(new DelayedRunnable(ticks, runnable));
+ } + }
+ +
+ public static void processQueue() { + public static void processQueue() {
@ -617,7 +637,7 @@ index 0000000000..3448b5588e
+ } + }
+} +}
diff --git a/src/main/java/net/minecraft/server/NBTTagCompound.java b/src/main/java/net/minecraft/server/NBTTagCompound.java diff --git a/src/main/java/net/minecraft/server/NBTTagCompound.java b/src/main/java/net/minecraft/server/NBTTagCompound.java
index e16a579b55..3f6d2676e7 100644 index e16a579b5..3f6d2676e 100644
--- a/src/main/java/net/minecraft/server/NBTTagCompound.java --- a/src/main/java/net/minecraft/server/NBTTagCompound.java
+++ b/src/main/java/net/minecraft/server/NBTTagCompound.java +++ b/src/main/java/net/minecraft/server/NBTTagCompound.java
@@ -23,7 +23,7 @@ public class NBTTagCompound implements NBTBase { @@ -23,7 +23,7 @@ public class NBTTagCompound implements NBTBase {
@ -646,7 +666,7 @@ index e16a579b55..3f6d2676e7 100644
return new UUID(this.getLong(s + "Most"), this.getLong(s + "Least")); return new UUID(this.getLong(s + "Most"), this.getLong(s + "Least"));
} }
diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java
index fe6854d0e4..2db7229e91 100644 index fe6854d0e..2db7229e9 100644
--- a/src/main/java/net/minecraft/server/NetworkManager.java --- a/src/main/java/net/minecraft/server/NetworkManager.java
+++ b/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java
@@ -43,7 +43,7 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> { @@ -43,7 +43,7 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
@ -687,7 +707,7 @@ index fe6854d0e4..2db7229e91 100644
public QueuedPacket(Packet<?> packet, @Nullable GenericFutureListener<? extends Future<? super Void>> genericfuturelistener) { public QueuedPacket(Packet<?> packet, @Nullable GenericFutureListener<? extends Future<? super Void>> genericfuturelistener) {
this.a = packet; this.a = packet;
diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java
index db2fe836c2..0d67676f7d 100644 index db2fe836c..0d67676f7 100644
--- a/src/main/java/net/minecraft/server/PacketDataSerializer.java --- a/src/main/java/net/minecraft/server/PacketDataSerializer.java
+++ b/src/main/java/net/minecraft/server/PacketDataSerializer.java +++ b/src/main/java/net/minecraft/server/PacketDataSerializer.java
@@ -33,6 +33,7 @@ public class PacketDataSerializer extends ByteBuf { @@ -33,6 +33,7 @@ public class PacketDataSerializer extends ByteBuf {
@ -699,7 +719,7 @@ index db2fe836c2..0d67676f7d 100644
for (int j = 1; j < 5; ++j) { for (int j = 1; j < 5; ++j) {
if ((i & -1 << j * 7) == 0) { if ((i & -1 << j * 7) == 0) {
diff --git a/src/main/java/net/minecraft/server/PacketEncoder.java b/src/main/java/net/minecraft/server/PacketEncoder.java diff --git a/src/main/java/net/minecraft/server/PacketEncoder.java b/src/main/java/net/minecraft/server/PacketEncoder.java
index 90223deae3..63c4dbd327 100644 index 90223deae..63c4dbd32 100644
--- a/src/main/java/net/minecraft/server/PacketEncoder.java --- a/src/main/java/net/minecraft/server/PacketEncoder.java
+++ b/src/main/java/net/minecraft/server/PacketEncoder.java +++ b/src/main/java/net/minecraft/server/PacketEncoder.java
@@ -42,6 +42,7 @@ public class PacketEncoder extends MessageToByteEncoder<Packet<?>> { @@ -42,6 +42,7 @@ public class PacketEncoder extends MessageToByteEncoder<Packet<?>> {
@ -711,7 +731,7 @@ index 90223deae3..63c4dbd327 100644
throw new SkipEncodeException(throwable); throw new SkipEncodeException(throwable);
} else { } else {
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
index 4e20cfba41..363ab5da12 100644 index 4e20cfba4..363ab5da1 100644
--- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java --- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
+++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java +++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
@@ -14,7 +14,7 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> { @@ -14,7 +14,7 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> {
@ -732,7 +752,7 @@ index 4e20cfba41..363ab5da12 100644
int j = 0; int j = 0;
ChunkSection[] achunksection = chunk.getSections(); ChunkSection[] achunksection = chunk.getSections();
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 8080e38b37..78a090ac75 100644 index 8080e38b3..78a090ac7 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java --- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -67,9 +67,9 @@ public class PlayerConnection implements PacketListenerPlayIn { @@ -67,9 +67,9 @@ public class PlayerConnection implements PacketListenerPlayIn {
@ -749,7 +769,7 @@ index 8080e38b37..78a090ac75 100644
private volatile int chatThrottle; private volatile int chatThrottle;
private static final AtomicIntegerFieldUpdater chatSpamField = AtomicIntegerFieldUpdater.newUpdater(PlayerConnection.class, "chatThrottle"); private static final AtomicIntegerFieldUpdater chatSpamField = AtomicIntegerFieldUpdater.newUpdater(PlayerConnection.class, "chatThrottle");
diff --git a/src/main/java/net/minecraft/server/PlayerInventory.java b/src/main/java/net/minecraft/server/PlayerInventory.java diff --git a/src/main/java/net/minecraft/server/PlayerInventory.java b/src/main/java/net/minecraft/server/PlayerInventory.java
index a5dba62caf..a088658ae0 100644 index a5dba62ca..a088658ae 100644
--- a/src/main/java/net/minecraft/server/PlayerInventory.java --- a/src/main/java/net/minecraft/server/PlayerInventory.java
+++ b/src/main/java/net/minecraft/server/PlayerInventory.java +++ b/src/main/java/net/minecraft/server/PlayerInventory.java
@@ -17,7 +17,7 @@ public class PlayerInventory implements IInventory, INamableTileEntity { @@ -17,7 +17,7 @@ public class PlayerInventory implements IInventory, INamableTileEntity {
@ -762,7 +782,7 @@ index a5dba62caf..a088658ae0 100644
public final EntityHuman player; public final EntityHuman player;
private ItemStack carried; private ItemStack carried;
diff --git a/src/main/java/net/minecraft/server/PotionUtil.java b/src/main/java/net/minecraft/server/PotionUtil.java diff --git a/src/main/java/net/minecraft/server/PotionUtil.java b/src/main/java/net/minecraft/server/PotionUtil.java
index b3824898da..bf4172be52 100644 index b3824898d..bf4172be5 100644
--- a/src/main/java/net/minecraft/server/PotionUtil.java --- a/src/main/java/net/minecraft/server/PotionUtil.java
+++ b/src/main/java/net/minecraft/server/PotionUtil.java +++ b/src/main/java/net/minecraft/server/PotionUtil.java
@@ -110,6 +110,7 @@ public class PotionUtil { @@ -110,6 +110,7 @@ public class PotionUtil {
@ -774,7 +794,7 @@ index b3824898da..bf4172be52 100644
MinecraftKey minecraftkey = IRegistry.POTION.getKey(potionregistry); MinecraftKey minecraftkey = IRegistry.POTION.getKey(potionregistry);
diff --git a/src/main/java/net/minecraft/server/RegistryBlockID.java b/src/main/java/net/minecraft/server/RegistryBlockID.java diff --git a/src/main/java/net/minecraft/server/RegistryBlockID.java b/src/main/java/net/minecraft/server/RegistryBlockID.java
index 4efcb8b595..60948afa4e 100644 index 4efcb8b59..60948afa4 100644
--- a/src/main/java/net/minecraft/server/RegistryBlockID.java --- a/src/main/java/net/minecraft/server/RegistryBlockID.java
+++ b/src/main/java/net/minecraft/server/RegistryBlockID.java +++ b/src/main/java/net/minecraft/server/RegistryBlockID.java
@@ -57,6 +57,7 @@ public class RegistryBlockID<T> implements Registry<T> { @@ -57,6 +57,7 @@ public class RegistryBlockID<T> implements Registry<T> {
@ -786,7 +806,7 @@ index 4efcb8b595..60948afa4e 100644
return this.b.size(); return this.b.size();
} }
diff --git a/src/main/java/net/minecraft/server/SystemUtils.java b/src/main/java/net/minecraft/server/SystemUtils.java diff --git a/src/main/java/net/minecraft/server/SystemUtils.java b/src/main/java/net/minecraft/server/SystemUtils.java
index b3799ab564..5fae5a1233 100644 index b3799ab56..5fae5a123 100644
--- a/src/main/java/net/minecraft/server/SystemUtils.java --- a/src/main/java/net/minecraft/server/SystemUtils.java
+++ b/src/main/java/net/minecraft/server/SystemUtils.java +++ b/src/main/java/net/minecraft/server/SystemUtils.java
@@ -58,7 +58,7 @@ public class SystemUtils { @@ -58,7 +58,7 @@ public class SystemUtils {
@ -799,7 +819,7 @@ index b3799ab564..5fae5a1233 100644
public static long getTimeMillis() { public static long getTimeMillis() {
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 83fdea893c..cbe87a3389 100644 index 83fdea893..cbe87a338 100644
--- a/src/main/java/net/minecraft/server/World.java --- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java
@@ -371,8 +371,9 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose @@ -371,8 +371,9 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@ -815,7 +835,7 @@ index 83fdea893c..cbe87a3389 100644
return this.setTypeAndData(blockposition, fluid.getBlockData(), 3 | (flag ? 64 : 0)); return this.setTypeAndData(blockposition, fluid.getBlockData(), 3 | (flag ? 64 : 0));
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
index 42f7bb0f7d..5d71addb0c 100644 index 42f7bb0f7..5d71addb0 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
@@ -85,6 +85,7 @@ public final class CraftItemStack extends ItemStack { @@ -85,6 +85,7 @@ public final class CraftItemStack extends ItemStack {

View File

@ -1,4 +1,4 @@
From 1c4c4bb0482e6d05872f36222423a4ac1e228074 Mon Sep 17 00:00:00 2001 From cfd22ead4cb25fe8ae29104637a52f3a53cb76a0 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com> From: Shane Freeder <theboyetronic@gmail.com>
Date: Thu, 5 Oct 2017 01:54:07 +0100 Date: Thu, 5 Oct 2017 01:54:07 +0100
Subject: [PATCH] handle PacketPlayInKeepAlive async Subject: [PATCH] handle PacketPlayInKeepAlive async
@ -15,7 +15,7 @@ also adding some additional logging in order to help work out what is causing
random disconnections for clients. random disconnections for clients.
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 7a4b14f865..de34c4e3ee 100644 index 7a4b14f86..2dd092f0a 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java --- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -2503,14 +2503,18 @@ public class PlayerConnection implements PacketListenerPlayIn { @@ -2503,14 +2503,18 @@ public class PlayerConnection implements PacketListenerPlayIn {
@ -32,7 +32,7 @@ index 7a4b14f865..de34c4e3ee 100644
} else if (!this.isExemptPlayer()) { } else if (!this.isExemptPlayer()) {
- this.disconnect(new ChatMessage("disconnect.timeout", new Object[0])); - this.disconnect(new ChatMessage("disconnect.timeout", new Object[0]));
+ // Paper start - This needs to be handled on the main thread for plugins + // Paper start - This needs to be handled on the main thread for plugins
+ minecraftServer.postToMainThread(() -> { + minecraftServer.scheduleOnMain(() -> {
+ this.disconnect(new ChatMessage("disconnect.timeout")); + this.disconnect(new ChatMessage("disconnect.timeout"));
+ }); + });
+ // Paper end + // Paper end

View File

@ -1,4 +1,4 @@
From 2c8f1fd13bdde1119e2853aa4cd38c7f70944368 Mon Sep 17 00:00:00 2001 From 93ca054cb327a04b224dbc227afbde0126cb6b65 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co> From: Aikar <aikar@aikar.co>
Date: Sun, 26 Nov 2017 13:19:58 -0500 Date: Sun, 26 Nov 2017 13:19:58 -0500
Subject: [PATCH] AsyncTabCompleteEvent Subject: [PATCH] AsyncTabCompleteEvent
@ -14,7 +14,7 @@ completion, such as offline players.
Also adds isCommand and getLocation to the sync TabCompleteEvent Also adds isCommand and getLocation to the sync TabCompleteEvent
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index bb276daa72..96ec50f6c6 100644 index 593414b2b..7fba7e28e 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java --- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -519,10 +519,10 @@ public class PlayerConnection implements PacketListenerPlayIn { @@ -519,10 +519,10 @@ public class PlayerConnection implements PacketListenerPlayIn {
@ -26,7 +26,7 @@ index bb276daa72..96ec50f6c6 100644
// CraftBukkit start // CraftBukkit start
if (chatSpamField.addAndGet(this, 1) > 500 && !this.minecraftServer.getPlayerList().isOp(this.player.getProfile())) { if (chatSpamField.addAndGet(this, 1) > 500 && !this.minecraftServer.getPlayerList().isOp(this.player.getProfile())) {
- this.disconnect(new ChatMessage("disconnect.spam", new Object[0])); - this.disconnect(new ChatMessage("disconnect.spam", new Object[0]));
+ minecraftServer.postToMainThread(() -> this.disconnect(new ChatMessage("disconnect.spam", new Object[0]))); // Paper + minecraftServer.scheduleOnMain(() -> this.disconnect(new ChatMessage("disconnect.spam", new Object[0]))); // Paper
return; return;
} }
// CraftBukkit end // CraftBukkit end
@ -70,7 +70,7 @@ index bb276daa72..96ec50f6c6 100644
@Override @Override
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 08f84e5db8..0732a6f218 100644 index 08f84e5db..0732a6f21 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1662,7 +1662,7 @@ public final class CraftServer implements Server { @@ -1662,7 +1662,7 @@ public final class CraftServer implements Server {
@ -83,7 +83,7 @@ index 08f84e5db8..0732a6f218 100644
return tabEvent.isCancelled() ? Collections.EMPTY_LIST : tabEvent.getCompletions(); return tabEvent.isCancelled() ? Collections.EMPTY_LIST : tabEvent.getCompletions();
diff --git a/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java b/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java diff --git a/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java b/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java
index 5510266fb1..a51202ed53 100644 index 5510266fb..a51202ed5 100644
--- a/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java --- a/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java
+++ b/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java +++ b/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java
@@ -28,6 +28,39 @@ public class ConsoleCommandCompleter implements Completer { @@ -28,6 +28,39 @@ public class ConsoleCommandCompleter implements Completer {

View File

@ -1,4 +1,4 @@
From 132fe501161e67d736c863d83ac399e2a8e6fe5a Mon Sep 17 00:00:00 2001 From 49edabb9820cc2f43da6ace27eff625eac73933d Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com> From: Shane Freeder <theboyetronic@gmail.com>
Date: Sun, 29 Jul 2018 05:02:15 +0100 Date: Sun, 29 Jul 2018 05:02:15 +0100
Subject: [PATCH] Break up and make tab spam limits configurable Subject: [PATCH] Break up and make tab spam limits configurable
@ -45,7 +45,7 @@ index 8c3880c83..d773ef5b0 100644
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 87fc6b6f3..bc0440048 100644 index e7e0c02b5..fc8d7d9d0 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java --- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -76,6 +76,7 @@ public class PlayerConnection implements PacketListenerPlayIn { @@ -76,6 +76,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
@ -70,7 +70,7 @@ index 87fc6b6f3..bc0440048 100644
// CraftBukkit start // CraftBukkit start
- if (chatSpamField.addAndGet(this, 1) > 500 && !this.minecraftServer.getPlayerList().isOp(this.player.getProfile())) { - if (chatSpamField.addAndGet(this, 1) > 500 && !this.minecraftServer.getPlayerList().isOp(this.player.getProfile())) {
+ if (tabSpamLimiter.addAndGet(com.destroystokyo.paper.PaperConfig.tabSpamIncrement) > com.destroystokyo.paper.PaperConfig.tabSpamLimit && !this.minecraftServer.getPlayerList().isOp(this.player.getProfile())) { // Paper start - split and make configurable + if (tabSpamLimiter.addAndGet(com.destroystokyo.paper.PaperConfig.tabSpamIncrement) > com.destroystokyo.paper.PaperConfig.tabSpamLimit && !this.minecraftServer.getPlayerList().isOp(this.player.getProfile())) { // Paper start - split and make configurable
minecraftServer.postToMainThread(() -> this.disconnect(new ChatMessage("disconnect.spam", new Object[0]))); // Paper minecraftServer.scheduleOnMain(() -> this.disconnect(new ChatMessage("disconnect.spam", new Object[0]))); // Paper
return; return;
} }
-- --

View File

@ -1,4 +1,4 @@
From 1e27d6d336f262e46c0b8eeaaab92d8d3d71b4ae Mon Sep 17 00:00:00 2001 From 86ef8ef7d0edbda3d6104a21220694ffc6f3fcff Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co> From: Aikar <aikar@aikar.co>
Date: Fri, 16 Nov 2018 23:08:50 -0500 Date: Fri, 16 Nov 2018 23:08:50 -0500
Subject: [PATCH] Book Size Limits Subject: [PATCH] Book Size Limits
@ -22,7 +22,7 @@ index a79cba50e..e5e41c662 100644
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index e7d3a5479..6096f309b 100644 index 530457772..630a0271e 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java --- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -14,6 +14,7 @@ import java.util.Iterator; @@ -14,6 +14,7 @@ import java.util.Iterator;
@ -68,7 +68,7 @@ index e7d3a5479..6096f309b 100644
+ +
+ if (byteTotal > byteAllowed) { + if (byteTotal > byteAllowed) {
+ PlayerConnection.LOGGER.warn(this.player.getName() + " tried to send too large of a book. Book Size: " + byteTotal + " - Allowed: "+ byteAllowed + " - Pages: " + pageList.size()); + PlayerConnection.LOGGER.warn(this.player.getName() + " tried to send too large of a book. Book Size: " + byteTotal + " - Allowed: "+ byteAllowed + " - Pages: " + pageList.size());
+ minecraftServer.postToMainThread(() -> this.disconnect("Book too large!")); + minecraftServer.scheduleOnMain(() -> this.disconnect("Book too large!"));
+ return; + return;
+ } + }
+ } + }

View File

@ -0,0 +1,22 @@
From 2f3037b6d9668bdf41e57d7a54e3ad241f065fb3 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Fri, 10 May 2019 18:38:19 +0100
Subject: [PATCH] Fix CB call to changed postToMainThread method
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 4dcfc423c..8c663f90c 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -281,7 +281,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
this.networkManager.getClass();
// CraftBukkit - Don't wait
- minecraftserver.postToMainThread(networkmanager::handleDisconnection);
+ minecraftserver.scheduleOnMain(networkmanager::handleDisconnection); // Paper
}
@Override
--
2.21.0