From ff84af45d0ee39ad7c11a7f7607e45dac1f702ef Mon Sep 17 00:00:00 2001 From: md_5 Date: Tue, 12 Jul 2016 20:18:28 +1000 Subject: [PATCH] Rebuild patches. --- CraftBukkit-Patches/0003-mc-dev-imports.patch | 289 +----------------- .../0099-Convert-player-skulls-async.patch | 6 +- 2 files changed, 4 insertions(+), 291 deletions(-) diff --git a/CraftBukkit-Patches/0003-mc-dev-imports.patch b/CraftBukkit-Patches/0003-mc-dev-imports.patch index 83034d77..613be0e5 100644 --- a/CraftBukkit-Patches/0003-mc-dev-imports.patch +++ b/CraftBukkit-Patches/0003-mc-dev-imports.patch @@ -1,4 +1,4 @@ -From 701131eeaff795c9a7745ee77f668266db96b9f8 Mon Sep 17 00:00:00 2001 +From c5edb4cba018e8f72b3bd270afffbceeb3710b1b Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 1 Dec 2013 15:10:48 +1100 Subject: [PATCH] mc-dev imports @@ -500,135 +500,6 @@ index 0000000..6c6f905 + world.applyPhysics(blockposition3, block); + } +} -diff --git a/src/main/java/net/minecraft/server/ItemSkull.java b/src/main/java/net/minecraft/server/ItemSkull.java -new file mode 100644 -index 0000000..40338ae ---- /dev/null -+++ b/src/main/java/net/minecraft/server/ItemSkull.java -@@ -0,0 +1,123 @@ -+package net.minecraft.server; -+ -+import com.mojang.authlib.GameProfile; -+import java.util.UUID; -+ -+public class ItemSkull extends Item { -+ -+ private static final String[] a = new String[] { "skeleton", "wither", "zombie", "char", "creeper", "dragon"}; -+ -+ public ItemSkull() { -+ this.a(CreativeModeTab.c); -+ this.setMaxDurability(0); -+ this.a(true); -+ } -+ -+ public EnumInteractionResult a(ItemStack itemstack, EntityHuman entityhuman, World world, BlockPosition blockposition, EnumHand enumhand, EnumDirection enumdirection, float f, float f1, float f2) { -+ if (enumdirection == EnumDirection.DOWN) { -+ return EnumInteractionResult.FAIL; -+ } else { -+ IBlockData iblockdata = world.getType(blockposition); -+ Block block = iblockdata.getBlock(); -+ boolean flag = block.a((IBlockAccess) world, blockposition); -+ -+ if (!flag) { -+ if (!world.getType(blockposition).getMaterial().isBuildable()) { -+ return EnumInteractionResult.FAIL; -+ } -+ -+ blockposition = blockposition.shift(enumdirection); -+ } -+ -+ if (entityhuman.a(blockposition, enumdirection, itemstack) && Blocks.SKULL.canPlace(world, blockposition)) { -+ if (world.isClientSide) { -+ return EnumInteractionResult.SUCCESS; -+ } else { -+ world.setTypeAndData(blockposition, Blocks.SKULL.getBlockData().set(BlockSkull.FACING, enumdirection), 11); -+ int i = 0; -+ -+ if (enumdirection == EnumDirection.UP) { -+ i = MathHelper.floor((double) (entityhuman.yaw * 16.0F / 360.0F) + 0.5D) & 15; -+ } -+ -+ TileEntity tileentity = world.getTileEntity(blockposition); -+ -+ if (tileentity instanceof TileEntitySkull) { -+ TileEntitySkull tileentityskull = (TileEntitySkull) tileentity; -+ -+ if (itemstack.getData() == 3) { -+ GameProfile gameprofile = null; -+ -+ if (itemstack.hasTag()) { -+ NBTTagCompound nbttagcompound = itemstack.getTag(); -+ -+ if (nbttagcompound.hasKeyOfType("SkullOwner", 10)) { -+ gameprofile = GameProfileSerializer.deserialize(nbttagcompound.getCompound("SkullOwner")); -+ } else if (nbttagcompound.hasKeyOfType("SkullOwner", 8) && !nbttagcompound.getString("SkullOwner").isEmpty()) { -+ gameprofile = new GameProfile((UUID) null, nbttagcompound.getString("SkullOwner")); -+ } -+ } -+ -+ tileentityskull.setGameProfile(gameprofile); -+ } else { -+ tileentityskull.setSkullType(itemstack.getData()); -+ } -+ -+ tileentityskull.setRotation(i); -+ Blocks.SKULL.a(world, blockposition, tileentityskull); -+ } -+ -+ --itemstack.count; -+ return EnumInteractionResult.SUCCESS; -+ } -+ } else { -+ return EnumInteractionResult.FAIL; -+ } -+ } -+ } -+ -+ public int filterData(int i) { -+ return i; -+ } -+ -+ public String f_(ItemStack itemstack) { -+ int i = itemstack.getData(); -+ -+ if (i < 0 || i >= ItemSkull.a.length) { -+ i = 0; -+ } -+ -+ return super.getName() + "." + ItemSkull.a[i]; -+ } -+ -+ public String a(ItemStack itemstack) { -+ if (itemstack.getData() == 3 && itemstack.hasTag()) { -+ if (itemstack.getTag().hasKeyOfType("SkullOwner", 8)) { -+ return LocaleI18n.a("item.skull.player.name", new Object[] { itemstack.getTag().getString("SkullOwner")}); -+ } -+ -+ if (itemstack.getTag().hasKeyOfType("SkullOwner", 10)) { -+ NBTTagCompound nbttagcompound = itemstack.getTag().getCompound("SkullOwner"); -+ -+ if (nbttagcompound.hasKeyOfType("Name", 8)) { -+ return LocaleI18n.a("item.skull.player.name", new Object[] { nbttagcompound.getString("Name")}); -+ } -+ } -+ } -+ -+ return super.a(itemstack); -+ } -+ -+ public boolean a(NBTTagCompound nbttagcompound) { -+ super.a(nbttagcompound); -+ if (nbttagcompound.hasKeyOfType("SkullOwner", 8) && !nbttagcompound.getString("SkullOwner").isEmpty()) { -+ GameProfile gameprofile = new GameProfile((UUID) null, nbttagcompound.getString("SkullOwner")); -+ -+ gameprofile = TileEntitySkull.b(gameprofile); -+ nbttagcompound.set("SkullOwner", GameProfileSerializer.serialize(new NBTTagCompound(), gameprofile)); -+ return true; -+ } else { -+ return false; -+ } -+ } -+} diff --git a/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java b/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java new file mode 100644 index 0000000..2a04b86 @@ -1630,164 +1501,6 @@ index 0000000..a527aac + return this.g; + } +} -diff --git a/src/main/java/net/minecraft/server/TileEntitySkull.java b/src/main/java/net/minecraft/server/TileEntitySkull.java -new file mode 100644 -index 0000000..4ae6796 ---- /dev/null -+++ b/src/main/java/net/minecraft/server/TileEntitySkull.java -@@ -0,0 +1,152 @@ -+package net.minecraft.server; -+ -+import com.google.common.collect.Iterables; -+import com.mojang.authlib.GameProfile; -+import com.mojang.authlib.minecraft.MinecraftSessionService; -+import com.mojang.authlib.properties.Property; -+import java.util.UUID; -+import javax.annotation.Nullable; -+ -+public class TileEntitySkull extends TileEntity implements ITickable { -+ -+ private int a; -+ public int rotation; -+ private GameProfile g; -+ private int h; -+ private boolean i; -+ private static UserCache j; -+ private static MinecraftSessionService k; -+ -+ public TileEntitySkull() {} -+ -+ public static void a(UserCache usercache) { -+ TileEntitySkull.j = usercache; -+ } -+ -+ public static void a(MinecraftSessionService minecraftsessionservice) { -+ TileEntitySkull.k = minecraftsessionservice; -+ } -+ -+ public NBTTagCompound save(NBTTagCompound nbttagcompound) { -+ super.save(nbttagcompound); -+ nbttagcompound.setByte("SkullType", (byte) (this.a & 255)); -+ nbttagcompound.setByte("Rot", (byte) (this.rotation & 255)); -+ if (this.g != null) { -+ NBTTagCompound nbttagcompound1 = new NBTTagCompound(); -+ -+ GameProfileSerializer.serialize(nbttagcompound1, this.g); -+ nbttagcompound.set("Owner", nbttagcompound1); -+ } -+ -+ return nbttagcompound; -+ } -+ -+ public void a(NBTTagCompound nbttagcompound) { -+ super.a(nbttagcompound); -+ this.a = nbttagcompound.getByte("SkullType"); -+ this.rotation = nbttagcompound.getByte("Rot"); -+ if (this.a == 3) { -+ if (nbttagcompound.hasKeyOfType("Owner", 10)) { -+ this.g = GameProfileSerializer.deserialize(nbttagcompound.getCompound("Owner")); -+ } else if (nbttagcompound.hasKeyOfType("ExtraType", 8)) { -+ String s = nbttagcompound.getString("ExtraType"); -+ -+ if (!UtilColor.b(s)) { -+ this.g = new GameProfile((UUID) null, s); -+ this.h(); -+ } -+ } -+ } -+ -+ } -+ -+ public void E_() { -+ if (this.a == 5) { -+ if (this.world.isBlockIndirectlyPowered(this.position)) { -+ this.i = true; -+ ++this.h; -+ } else { -+ this.i = false; -+ } -+ } -+ -+ } -+ -+ @Nullable -+ public GameProfile getGameProfile() { -+ return this.g; -+ } -+ -+ @Nullable -+ public PacketPlayOutTileEntityData getUpdatePacket() { -+ return new PacketPlayOutTileEntityData(this.position, 4, this.c()); -+ } -+ -+ public NBTTagCompound c() { -+ return this.save(new NBTTagCompound()); -+ } -+ -+ public void setSkullType(int i) { -+ this.a = i; -+ this.g = null; -+ } -+ -+ public void setGameProfile(@Nullable GameProfile gameprofile) { -+ this.a = 3; -+ this.g = gameprofile; -+ this.h(); -+ } -+ -+ private void h() { -+ this.g = b(this.g); -+ this.update(); -+ } -+ -+ public static GameProfile b(GameProfile gameprofile) { -+ if (gameprofile != null && !UtilColor.b(gameprofile.getName())) { -+ if (gameprofile.isComplete() && gameprofile.getProperties().containsKey("textures")) { -+ return gameprofile; -+ } else if (TileEntitySkull.j != null && TileEntitySkull.k != null) { -+ GameProfile gameprofile1 = TileEntitySkull.j.getProfile(gameprofile.getName()); -+ -+ if (gameprofile1 == null) { -+ return gameprofile; -+ } else { -+ Property property = (Property) Iterables.getFirst(gameprofile1.getProperties().get("textures"), (Object) null); -+ -+ if (property == null) { -+ gameprofile1 = TileEntitySkull.k.fillProfileProperties(gameprofile1, true); -+ } -+ -+ return gameprofile1; -+ } -+ } else { -+ return gameprofile; -+ } -+ } else { -+ return gameprofile; -+ } -+ } -+ -+ public int getSkullType() { -+ return this.a; -+ } -+ -+ public void setRotation(int i) { -+ this.rotation = i; -+ } -+ -+ public void a(EnumBlockMirror enumblockmirror) { -+ if (this.world != null && this.world.getType(this.getPosition()).get(BlockSkull.FACING) == EnumDirection.UP) { -+ this.rotation = enumblockmirror.a(this.rotation, 16); -+ } -+ -+ } -+ -+ public void a(EnumBlockRotation enumblockrotation) { -+ if (this.world != null && this.world.getType(this.getPosition()).get(BlockSkull.FACING) == EnumDirection.UP) { -+ this.rotation = enumblockrotation.a(this.rotation, 16); -+ } -+ -+ } -+} diff --git a/src/main/java/net/minecraft/server/WorldGenLargeFeature.java b/src/main/java/net/minecraft/server/WorldGenLargeFeature.java new file mode 100644 index 0000000..8ceac26 diff --git a/CraftBukkit-Patches/0099-Convert-player-skulls-async.patch b/CraftBukkit-Patches/0099-Convert-player-skulls-async.patch index 4f60f664..a7feb174 100644 --- a/CraftBukkit-Patches/0099-Convert-player-skulls-async.patch +++ b/CraftBukkit-Patches/0099-Convert-player-skulls-async.patch @@ -1,11 +1,11 @@ -From 73991a09568d5ba9953ede0db74129b06497d799 Mon Sep 17 00:00:00 2001 +From c5eb46666e3ebdc9846c0186731381f6e3228441 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/ItemSkull.java b/src/main/java/net/minecraft/server/ItemSkull.java -index 40338ae..2a8c5f0 100644 +index 4833541..213221f 100644 --- a/src/main/java/net/minecraft/server/ItemSkull.java +++ b/src/main/java/net/minecraft/server/ItemSkull.java @@ -108,13 +108,21 @@ public class ItemSkull extends Item { @@ -32,7 +32,7 @@ index 40338ae..2a8c5f0 100644 + // Spigot end return true; } else { - return false; + nbttagcompound.remove("SkullOwner"); // CraftBukkit - remove broken skulls diff --git a/src/main/java/net/minecraft/server/TileEntitySkull.java b/src/main/java/net/minecraft/server/TileEntitySkull.java index 4ae6796..654b51d 100644 --- a/src/main/java/net/minecraft/server/TileEntitySkull.java