From 7cae4cb66f96a3581672c221818669e3fac8f7cc Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Wed, 23 Apr 2014 12:48:39 +0100 Subject: [PATCH] Actually remove the old patches --- ...137-Add-quiet-option-to-hasKeyOfType.patch | 37 ------- .../0138-Log-null-TileEntity-Owner.patch | 29 ------ ...ial-case-invalid-usernames-for-UUIDs.patch | 34 ------- .../0140-Convert-player-skulls-async.patch | 96 ------------------- ...ssDefError-crash-and-notify-on-crash.patch | 50 ---------- ...-destroying-all-items-in-the-second-.patch | 23 ----- ...3-Silence-skull-related-console-spam.patch | 48 ---------- 7 files changed, 317 deletions(-) delete mode 100644 CraftBukkit-Patches/0137-Add-quiet-option-to-hasKeyOfType.patch delete mode 100644 CraftBukkit-Patches/0138-Log-null-TileEntity-Owner.patch delete mode 100644 CraftBukkit-Patches/0139-Don-t-special-case-invalid-usernames-for-UUIDs.patch delete mode 100644 CraftBukkit-Patches/0140-Convert-player-skulls-async.patch delete mode 100644 CraftBukkit-Patches/0141-Prevent-NoClassDefError-crash-and-notify-on-crash.patch delete mode 100644 CraftBukkit-Patches/0142-Stop-anvils-from-destroying-all-items-in-the-second-.patch delete mode 100644 CraftBukkit-Patches/0143-Silence-skull-related-console-spam.patch diff --git a/CraftBukkit-Patches/0137-Add-quiet-option-to-hasKeyOfType.patch b/CraftBukkit-Patches/0137-Add-quiet-option-to-hasKeyOfType.patch deleted file mode 100644 index 4bb3ddd40e..0000000000 --- a/CraftBukkit-Patches/0137-Add-quiet-option-to-hasKeyOfType.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 59a46b8a6c85a4c77499ee8fe98b140b87ec524b Mon Sep 17 00:00:00 2001 -From: Thinkofdeath -Date: Thu, 17 Apr 2014 12:58:08 +0100 -Subject: [PATCH] Add quiet option to hasKeyOfType - - -diff --git a/src/main/java/net/minecraft/server/NBTTagCompound.java b/src/main/java/net/minecraft/server/NBTTagCompound.java -index 5b8842f..7931c4a 100644 ---- a/src/main/java/net/minecraft/server/NBTTagCompound.java -+++ b/src/main/java/net/minecraft/server/NBTTagCompound.java -@@ -119,13 +119,21 @@ public class NBTTagCompound extends NBTBase { - return this.map.containsKey(s); - } - -- public boolean hasKeyOfType(String s, int i) { -+ // Spigot start - Add quiet option -+ public boolean hasKeyOfType(String s, int i) -+ { -+ return hasKeyOfType( s, i, false ); -+ } -+ -+ public boolean hasKeyOfType(String s, int i, boolean quiet) -+ { - byte b0 = this.b(s); - - if (b0 == i) { - return true; - } else if (i != 99) { -- if (b0 > 0) { -+ if (b0 > 0 && !quiet) { -+ // Spigot end - b.warn("NBT tag {} was of wrong type; expected {}, found {}", new Object[] { s, getTagName(i), getTagName(b0)}); - } - --- -1.9.1 - diff --git a/CraftBukkit-Patches/0138-Log-null-TileEntity-Owner.patch b/CraftBukkit-Patches/0138-Log-null-TileEntity-Owner.patch deleted file mode 100644 index b95974a5f3..0000000000 --- a/CraftBukkit-Patches/0138-Log-null-TileEntity-Owner.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 336e47f7667c88b93d2270fc264bd0cfffe1b307 Mon Sep 17 00:00:00 2001 -From: md_5 -Date: Sun, 20 Apr 2014 11:16:54 +1000 -Subject: [PATCH] Log null TileEntity Owner - - -diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java -index 78e17d7..19d008c 100644 ---- a/src/main/java/net/minecraft/server/TileEntity.java -+++ b/src/main/java/net/minecraft/server/TileEntity.java -@@ -177,7 +177,14 @@ public class TileEntity { - - // CraftBukkit start - add method - public InventoryHolder getOwner() { -- org.bukkit.block.BlockState state = world.getWorld().getBlockAt(x, y, z).getState(); -+ // Spigot start -+ org.bukkit.block.Block block = world.getWorld().getBlockAt(x, y, z); -+ if (block == null) { -+ org.bukkit.Bukkit.getLogger().log(java.util.logging.Level.WARNING, "No block for owner at %s %d %d %d", new Object[]{world.getWorld(), x, y, z}); -+ return null; -+ } -+ // Spigot end -+ org.bukkit.block.BlockState state = block.getState(); - if (state instanceof InventoryHolder) return (InventoryHolder) state; - return null; - } --- -1.9.1 - diff --git a/CraftBukkit-Patches/0139-Don-t-special-case-invalid-usernames-for-UUIDs.patch b/CraftBukkit-Patches/0139-Don-t-special-case-invalid-usernames-for-UUIDs.patch deleted file mode 100644 index f8e89f6fb5..0000000000 --- a/CraftBukkit-Patches/0139-Don-t-special-case-invalid-usernames-for-UUIDs.patch +++ /dev/null @@ -1,34 +0,0 @@ -From e0c38283dbe5d50a2b6290bf60d75140814e80e4 Mon Sep 17 00:00:00 2001 -From: md_5 -Date: Sun, 20 Apr 2014 18:58:00 +1000 -Subject: [PATCH] Don't special case 'invalid' usernames for UUIDs. - - -diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 7c265b5..a996677 100644 ---- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java -+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -231,8 +231,6 @@ public final class CraftServer implements Server { - private boolean printSaveWarning; - private CraftIconCache icon; - private boolean overrideAllCommandBlockCommands = false; -- private final Pattern validUserPattern = Pattern.compile("^[a-zA-Z0-9_]{2,16}$"); -- private final UUID invalidUserUUID = UUID.nameUUIDFromBytes("InvalidUsername".getBytes(Charsets.UTF_8)); - - private final class BooleanWrapper { - private boolean value = true; -@@ -1321,11 +1319,6 @@ public final class CraftServer implements Server { - Validate.notNull(name, "Name cannot be null"); - com.google.common.base.Preconditions.checkArgument( !org.apache.commons.lang.StringUtils.isBlank( name ), "Name cannot be blank" ); // Spigot - -- // If the name given cannot ever be a valid username give a dummy return, for scoreboard plugins -- if (!validUserPattern.matcher(name).matches()) { -- return new CraftOfflinePlayer(this, new GameProfile(invalidUserUUID, name)); -- } -- - OfflinePlayer result = getPlayerExact(name); - if (result == null) { - // This is potentially blocking :( --- -1.9.1 - diff --git a/CraftBukkit-Patches/0140-Convert-player-skulls-async.patch b/CraftBukkit-Patches/0140-Convert-player-skulls-async.patch deleted file mode 100644 index f742d66539..0000000000 --- a/CraftBukkit-Patches/0140-Convert-player-skulls-async.patch +++ /dev/null @@ -1,96 +0,0 @@ -From ee8b9ae55fe9c950dbfd15a9c50e1ed5341cd92b Mon Sep 17 00:00:00 2001 -From: Thinkofdeath -Date: Sun, 20 Apr 2014 13:18:55 +0100 -Subject: [PATCH] Convert player skulls async - - -diff --git a/src/main/java/net/minecraft/server/TileEntitySkull.java b/src/main/java/net/minecraft/server/TileEntitySkull.java -index 748f00a..a239f04 100644 ---- a/src/main/java/net/minecraft/server/TileEntitySkull.java -+++ b/src/main/java/net/minecraft/server/TileEntitySkull.java -@@ -6,11 +6,25 @@ import net.minecraft.util.com.google.common.collect.Iterables; - import net.minecraft.util.com.mojang.authlib.GameProfile; - import net.minecraft.util.com.mojang.authlib.properties.Property; - -+// Spigot start -+import java.util.concurrent.Executor; -+import java.util.concurrent.Executors; -+import com.google.common.util.concurrent.ThreadFactoryBuilder; -+import net.minecraft.util.com.mojang.authlib.Agent; -+// Spigot end -+ - public class TileEntitySkull extends TileEntity { - - private int a; - private int i; - private GameProfile j = null; -+ // Spigot start -+ private static final Executor executor = Executors.newFixedThreadPool(3, -+ new ThreadFactoryBuilder() -+ .setNameFormat("Head Conversion Thread - %1$d") -+ .build() -+ ); -+ // Spigot end - - public TileEntitySkull() {} - -@@ -65,18 +79,45 @@ public class TileEntitySkull extends TileEntity { - private void d() { - if (this.j != null && !UtilColor.b(this.j.getName())) { - if (!this.j.isComplete() || !this.j.getProperties().containsKey("textures")) { -- GameProfile gameprofile = MinecraftServer.getServer().getUserCache().a(this.j.getName()); -- -- if (gameprofile != null) { -- Property property = (Property) Iterables.getFirst(gameprofile.getProperties().get("textures"), null); -- -- if (property == null) { -- gameprofile = MinecraftServer.getServer().av().fillProfileProperties(gameprofile, true); -+ // Spigot start - Handle async -+ final String name = this.j.getName(); -+ executor.execute(new Runnable() { -+ @Override -+ public void run() { -+ GameProfile[] profiles = new GameProfile[1]; -+ GameProfileLookup gameProfileLookup = new GameProfileLookup(profiles); -+ -+ MinecraftServer.getServer().getGameProfileRepository().findProfilesByNames(new String[] { name }, Agent.MINECRAFT, gameProfileLookup); -+ if (!MinecraftServer.getServer().getOnlineMode() && profiles[0] == null) { -+ UUID uuid = EntityHuman.a(new GameProfile(null, name)); -+ GameProfile profile = new GameProfile(uuid, name); -+ -+ gameProfileLookup.onProfileLookupSucceeded(profile); -+ } -+ -+ GameProfile profile = profiles[0]; -+ if (profile != null) { -+ Property property = Iterables.getFirst(profile.getProperties().get("textures"), null); -+ -+ if (property == null) { -+ profile = MinecraftServer.getServer().av().fillProfileProperties(profile, true); -+ } -+ -+ final GameProfile finalProfile = profile; -+ MinecraftServer.getServer().processQueue.add(new Runnable() { -+ @Override -+ public void run() { -+ j = finalProfile; -+ update(); -+ MinecraftServer.getServer().getPlayerList().sendPacketNearby(x, y, z, -+ world.spigotConfig.viewDistance * 16, -+ world.worldData.j()/*Dimension*/, getUpdatePacket()); -+ } -+ }); -+ } - } -- -- this.j = gameprofile; -- this.update(); -- } -+ }); -+ // Spigot end - } - } - } --- -1.9.1 - diff --git a/CraftBukkit-Patches/0141-Prevent-NoClassDefError-crash-and-notify-on-crash.patch b/CraftBukkit-Patches/0141-Prevent-NoClassDefError-crash-and-notify-on-crash.patch deleted file mode 100644 index ffef68347d..0000000000 --- a/CraftBukkit-Patches/0141-Prevent-NoClassDefError-crash-and-notify-on-crash.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 82df31b541e31a945256feb3314a11e0c7a068f1 Mon Sep 17 00:00:00 2001 -From: David -Date: Mon, 21 Apr 2014 12:43:08 +0100 -Subject: [PATCH] Prevent NoClassDefError crash and notify on crash - - -diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 52ed625..ff65035 100644 ---- a/src/main/java/net/minecraft/server/World.java -+++ b/src/main/java/net/minecraft/server/World.java -@@ -108,6 +108,8 @@ public abstract class World implements IBlockAccess { - protected float growthOdds = 100; - protected float modifiedOdds = 100; - private final byte chunkTickRadius; -+ public static boolean haveWeSilencedAPhysicsCrash; -+ public static String blockLocation; - - public static long chunkToKey(int x, int z) - { -@@ -531,6 +533,9 @@ public abstract class World implements IBlockAccess { - // CraftBukkit end - - block1.doPhysics(this, i, j, k, block); -+ } catch (StackOverflowError stackoverflowerror) { // Spigot Start -+ haveWeSilencedAPhysicsCrash = true; -+ blockLocation = i + ", " + j + ", " + k; // Spigot End - } catch (Throwable throwable) { - CrashReport crashreport = CrashReport.a(throwable, "Exception while updating neighbours"); - CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Block being updated"); -diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java -index de08ad6..94a3d42 100644 ---- a/src/main/java/org/spigotmc/WatchdogThread.java -+++ b/src/main/java/org/spigotmc/WatchdogThread.java -@@ -60,6 +60,13 @@ public class WatchdogThread extends Thread - log.log( Level.SEVERE, "Be sure to include ALL relevant console errors and Minecraft crash reports" ); - log.log( Level.SEVERE, "Spigot version: " + Bukkit.getServer().getVersion() ); - // -+ if(net.minecraft.server.World.haveWeSilencedAPhysicsCrash) -+ { -+ log.log( Level.SEVERE, "------------------------------" ); -+ log.log( Level.SEVERE, "During the run of the server, a physics stackoverflow was supressed" ); -+ log.log( Level.SEVERE, "near " + net.minecraft.server.World.blockLocation); -+ } -+ // - log.log( Level.SEVERE, "------------------------------" ); - log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Spigot!):" ); - dumpThread( ManagementFactory.getThreadMXBean().getThreadInfo( MinecraftServer.getServer().primaryThread.getId(), Integer.MAX_VALUE ), log ); --- -1.8.3.2 - diff --git a/CraftBukkit-Patches/0142-Stop-anvils-from-destroying-all-items-in-the-second-.patch b/CraftBukkit-Patches/0142-Stop-anvils-from-destroying-all-items-in-the-second-.patch deleted file mode 100644 index 4557e4915e..0000000000 --- a/CraftBukkit-Patches/0142-Stop-anvils-from-destroying-all-items-in-the-second-.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 7ae6acfc6b64a79f58ff5fda931a7a8762116173 Mon Sep 17 00:00:00 2001 -From: David -Date: Wed, 23 Apr 2014 01:01:47 +0100 -Subject: [PATCH] Stop anvils from destroying all items in the second slot - -While this may allow multiple stacked items to be repaired at once, it's better than eating all of a user's items. - -diff --git a/src/main/java/net/minecraft/server/ContainerAnvilInventory.java b/src/main/java/net/minecraft/server/ContainerAnvilInventory.java -index 1afa6e7..d975b44 100644 ---- a/src/main/java/net/minecraft/server/ContainerAnvilInventory.java -+++ b/src/main/java/net/minecraft/server/ContainerAnvilInventory.java -@@ -43,7 +43,7 @@ public class ContainerAnvilInventory extends InventorySubcontainer { // CraftBuk - ContainerAnvilInventory(ContainerAnvil containeranvil, String s, boolean flag, int i) { - super(s, flag, i); - this.a = containeranvil; -- this.setMaxStackSize(1); // CraftBukkit -+ // Spigot - Removed this.setMaxStackSize(1); // CraftBukkit - } - - // CraftBukkit start - override inherited maxStack from InventorySubcontainer --- -1.8.3.2 - diff --git a/CraftBukkit-Patches/0143-Silence-skull-related-console-spam.patch b/CraftBukkit-Patches/0143-Silence-skull-related-console-spam.patch deleted file mode 100644 index 81f212a934..0000000000 --- a/CraftBukkit-Patches/0143-Silence-skull-related-console-spam.patch +++ /dev/null @@ -1,48 +0,0 @@ -From c8888a07ef487318a1abf690f797b620a8bcdcf0 Mon Sep 17 00:00:00 2001 -From: Thinkofdeath -Date: Wed, 23 Apr 2014 10:28:24 +0100 -Subject: [PATCH] Silence skull related console spam - - -diff --git a/src/main/java/net/minecraft/server/ItemSkull.java b/src/main/java/net/minecraft/server/ItemSkull.java -index 49346a6..fbc1f95 100644 ---- a/src/main/java/net/minecraft/server/ItemSkull.java -+++ b/src/main/java/net/minecraft/server/ItemSkull.java -@@ -71,7 +71,7 @@ public class ItemSkull extends Item { - if (itemstack.hasTag()) { - NBTTagCompound nbttagcompound = itemstack.getTag(); - -- if (nbttagcompound.hasKeyOfType("SkullOwner", 10)) { -+ if (nbttagcompound.hasKeyOfType("SkullOwner", 10, true)) { // Spigot - gameprofile = GameProfileSerializer.a(nbttagcompound.getCompound("SkullOwner")); - } else if (nbttagcompound.hasKeyOfType("SkullOwner", 8) && nbttagcompound.getString("SkullOwner").length() > 0) { - gameprofile = new GameProfile((UUID) null, nbttagcompound.getString("SkullOwner")); -diff --git a/src/main/java/net/minecraft/server/TileEntitySkull.java b/src/main/java/net/minecraft/server/TileEntitySkull.java -index a239f04..f5b1aee 100644 ---- a/src/main/java/net/minecraft/server/TileEntitySkull.java -+++ b/src/main/java/net/minecraft/server/TileEntitySkull.java -@@ -45,7 +45,7 @@ public class TileEntitySkull extends TileEntity { - this.a = nbttagcompound.getByte("SkullType"); - this.i = nbttagcompound.getByte("Rot"); - if (this.a == 3) { -- if (nbttagcompound.hasKeyOfType("Owner", 10)) { -+ if (nbttagcompound.hasKeyOfType("Owner", 10, true)) { // Spigot - this.j = GameProfileSerializer.a(nbttagcompound.getCompound("Owner")); - } else if (nbttagcompound.hasKeyOfType("ExtraType", 8) && !UtilColor.b(nbttagcompound.getString("ExtraType"))) { - this.j = new GameProfile((UUID) null, nbttagcompound.getString("ExtraType")); -diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java -index 15e114d..fbeccc8 100644 ---- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java -+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java -@@ -33,7 +33,7 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta { - CraftMetaSkull(NBTTagCompound tag) { - super(tag); - -- if (tag.hasKeyOfType(SKULL_OWNER.NBT, 10)) { -+ if (tag.hasKeyOfType(SKULL_OWNER.NBT, 10, true)) { // Spigot - profile = GameProfileSerializer.a(tag.getCompound(SKULL_OWNER.NBT)); - } else if (tag.hasKeyOfType(SKULL_OWNER.NBT, 8)) { - profile = MinecraftServer.getServer().getUserCache().a(tag.getString(SKULL_OWNER.NBT)); --- -1.9.1 -