3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-19 13:00:06 +01:00

Update upstream B/CB/S

Dieser Commit ist enthalten in:
Zach Brown 2016-07-12 23:22:58 -05:00
Ursprung aea3ab11ab
Commit d67763d7a3
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: CC9DA35FC5450B76
7 geänderte Dateien mit 18 neuen und 141 gelöschten Zeilen

Datei anzeigen

@ -1,9 +1,8 @@
From a852ab90e3a6ffc60f939d3848f65bc375bde8f7 Mon Sep 17 00:00:00 2001 From a7b8b2dfdda06856f138ea8b3fedc1c7aa72a75a Mon Sep 17 00:00:00 2001
From: Byteflux <byte@byteflux.net> From: Byteflux <byte@byteflux.net>
Date: Wed, 2 Mar 2016 00:52:31 -0600 Date: Wed, 2 Mar 2016 00:52:31 -0600
Subject: [PATCH] Lighting Queue Subject: [PATCH] Lighting Queue
This provides option to queue lighting updates to ensure they do not cause the server lag
diff --git a/src/main/java/co/aikar/timings/WorldTimingsHandler.java b/src/main/java/co/aikar/timings/WorldTimingsHandler.java diff --git a/src/main/java/co/aikar/timings/WorldTimingsHandler.java b/src/main/java/co/aikar/timings/WorldTimingsHandler.java
index 741da72..8b3aa17 100644 index 741da72..8b3aa17 100644
@ -85,19 +84,19 @@ index 015a223..0fae95d 100644
TileEntity tileentity; TileEntity tileentity;
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index 2ee5c92..23dc778 100644 index 023bcce..f39ec7e 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -279,6 +279,7 @@ public class ChunkProviderServer implements IChunkProvider { @@ -280,6 +280,7 @@ public class ChunkProviderServer implements IChunkProvider {
if (event.isCancelled()) {
return false; return false;
} }
save = event.isSaveChunk();
+ chunk.lightingQueue.processUnload(); // Paper + chunk.lightingQueue.processUnload(); // Paper
// Update neighbor counts // Update neighbor counts
for (int x = -2; x < 3; x++) { for (int x = -2; x < 3; x++) {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 31d2a10..88f99e5 100644 index 95f407f..ff1dd53 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -714,7 +714,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs @@ -714,7 +714,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
@ -235,5 +234,5 @@ index 8fb8176..672167a 100644
} }
-- --
2.9.0 2.9.0.windows.1

Datei anzeigen

@ -1,14 +1,14 @@
From 4249673124a2de38a0d6f8f81ff64379780f36f0 Mon Sep 17 00:00:00 2001 From afaf65e2a6361203102bc9eb70d47c782a9134e7 Mon Sep 17 00:00:00 2001
From: Jedediah Smith <jedediah@silencegreys.com> From: Jedediah Smith <jedediah@silencegreys.com>
Date: Sun, 21 Jun 2015 15:07:20 -0400 Date: Sun, 21 Jun 2015 15:07:20 -0400
Subject: [PATCH] Custom replacement for eaten items Subject: [PATCH] Custom replacement for eaten items
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 124811f..c6d5986 100644 index 89e6ef5..ad320c2 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
@@ -2265,12 +2265,24 @@ public abstract class EntityLiving extends Entity { @@ -2261,12 +2261,24 @@ public abstract class EntityLiving extends Entity {
ItemStack itemstack = (craftItem.equals(event.getItem())) ? this.bo.a(this.world, this) : CraftItemStack.asNMSCopy(event.getItem()).a(world, this); ItemStack itemstack = (craftItem.equals(event.getItem())) ? this.bo.a(this.world, this) : CraftItemStack.asNMSCopy(event.getItem()).a(world, this);
// CraftBukkit end // CraftBukkit end
@ -34,5 +34,5 @@ index 124811f..c6d5986 100644
} }
-- --
2.9.0 2.9.0.windows.1

Datei anzeigen

@ -1,11 +1,11 @@
From cfa7b89e6571573602f9286f3e188a219b259698 Mon Sep 17 00:00:00 2001 From a67ad017f95353466c65435997ddad3ef5776248 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co> From: Aikar <aikar@aikar.co>
Date: Sun, 27 Sep 2015 01:18:02 -0400 Date: Sun, 27 Sep 2015 01:18:02 -0400
Subject: [PATCH] handle NaN health/absorb values and repair bad data Subject: [PATCH] handle NaN health/absorb values and repair bad data
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 c6d5986..ff9096f 100644 index ad320c2..d66e766 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
@@ -468,7 +468,13 @@ public abstract class EntityLiving extends Entity { @@ -468,7 +468,13 @@ public abstract class EntityLiving extends Entity {
@ -34,7 +34,7 @@ index c6d5986..ff9096f 100644
// CraftBukkit start - Handle scaled health // CraftBukkit start - Handle scaled health
if (this instanceof EntityPlayer) { if (this instanceof EntityPlayer) {
org.bukkit.craftbukkit.entity.CraftPlayer player = ((EntityPlayer) this).getBukkitEntity(); org.bukkit.craftbukkit.entity.CraftPlayer player = ((EntityPlayer) this).getBukkitEntity();
@@ -2135,7 +2145,7 @@ public abstract class EntityLiving extends Entity { @@ -2131,7 +2141,7 @@ public abstract class EntityLiving extends Entity {
} }
public void setAbsorptionHearts(float f) { public void setAbsorptionHearts(float f) {
@ -44,7 +44,7 @@ index c6d5986..ff9096f 100644
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 9299695..e941f5f 100644 index e372761..d6b2974 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1390,6 +1390,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1390,6 +1390,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -56,5 +56,5 @@ index 9299695..e941f5f 100644
} }
-- --
2.9.0 2.9.0.windows.1

Datei anzeigen

@ -1,122 +0,0 @@
From efa5bad0e1fffbffdea0b131524edb1d2054d6b7 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Sat, 9 Jul 2016 20:00:28 -0500
Subject: [PATCH] Block sketchy heads
Checks for, and blocks, sketchy creative mode spawned, heads.
Currently only checks for new data, could be added to check all data if needed.
This is an NMS-port of the work done here: https://github.com/MylesIsCool/SkullExploitPatch by MylesIsCool (_MylesC)
diff --git a/src/main/java/com/destroystokyo/paper/ItemFilter.java b/src/main/java/com/destroystokyo/paper/ItemFilter.java
new file mode 100644
index 0000000..9266c19
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/ItemFilter.java
@@ -0,0 +1,84 @@
+package com.destroystokyo.paper;
+
+import net.minecraft.server.*;
+
+import javax.annotation.Nullable;
+
+public class ItemFilter {
+
+ /**
+ * Checks if the ItemStack passed could be a sketchy head item or block
+ * @param itemStackIn the ItemStack to check
+ * @return whether the item is safe or sketchy
+ */
+ public static boolean isHeadSketchy(@Nullable ItemStack itemStackIn) {
+ if (itemStackIn != null && itemStackIn.getTag() != null) {
+ NBTTagCompound itemTag = itemStackIn.getTag();
+ if (Item.getId(itemStackIn.getItem()) == Item.getId(Items.SKULL) && itemStackIn.getData() == 3) {
+ return isHeadItemSketchy(itemTag);
+ } else if (Item.getId(itemStackIn.getItem()) == Block.getId(Blocks.SKULL)) {
+ return isHeadBlockSketchy(itemTag);
+ }
+
+ // If we can't figure out which is which just run it through both
+ return isHeadItemSketchy(itemTag) || isHeadBlockSketchy(itemTag);
+ }
+ return false;
+ }
+
+ /**
+ * Checks the NBTTagCompound for sketchy data, from the perspective of an Item
+ * @param nbtTagCompound NBTTagCompound from an Item
+ * @return whether the data is safe or sketchy
+ */
+ private static boolean isHeadItemSketchy(NBTTagCompound nbtTagCompound) {
+ if (nbtTagCompound.hasKey("SkullOwner")) {
+ NBTTagCompound skullOwner = nbtTagCompound.getCompound("SkullOwner");
+ if (skullOwner.hasKey("Properties")) {
+ return isHeadNBTSketchy(skullOwner.getCompound("Properties"));
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Checks the NBTTagCompound for sketchy data, from the perspective of a Block
+ * @param nbtTagCompound NBTTagCompound from a Block
+ * @return whether the data is safe or sketchy
+ */
+ private static boolean isHeadBlockSketchy(NBTTagCompound nbtTagCompound) {
+ if (nbtTagCompound.hasKey("Owner")) {
+ NBTTagCompound skullOwner = nbtTagCompound.getCompound("Owner");
+ if (skullOwner.hasKey("Properties")) {
+ return isHeadNBTSketchy(skullOwner.getCompound("Properties"));
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Generified checker for use in both Items and Blocks after some semantics
+ * are done above in the calling methods.
+ * @param properties The generified properties compound from a parent-compound
+ * @return whether the data is safe or sketchy
+ */
+ private static boolean isHeadNBTSketchy(NBTTagCompound properties) {
+ if (properties.hasKey("textures")) {
+ NBTTagList textures = properties.getList("textures", 10);
+ for (NBTBase texture : textures.list) {
+ if (texture instanceof NBTTagCompound) {
+ if (!((NBTTagCompound) texture).hasKey("Signature")) {
+ // Check
+ if (((NBTTagCompound) texture).hasKey("Value")) {
+ if (((NBTTagCompound) texture).getString("Value").trim().length() > 0) {
+ return false;
+ }
+ }
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+}
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 85c62cd..0b1e089 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -2028,6 +2028,15 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
}
}
+ // Paper start - Block sketchy heads
+ if (itemstack != null && (Item.getId(itemstack.getItem()) == Item.getId(Items.SKULL) && itemstack.getData() == 3 || Item.getId(itemstack.getItem()) == Block.getId(Blocks.SKULL))) {
+ if (com.destroystokyo.paper.ItemFilter.isHeadSketchy(itemstack)) {
+ this.disconnect("Bad creative item!");
+ return;
+ }
+ }
+ // Paper end
+
boolean flag1 = packetplayinsetcreativeslot.a() >= 1 && packetplayinsetcreativeslot.a() <= 45;
// CraftBukkit - Add invalidItems check
boolean flag2 = itemstack == null || itemstack.getItem() != null && (!invalidItems.contains(Item.getId(itemstack.getItem())) || !org.spigotmc.SpigotConfig.filterCreativeItems); // Spigot
--
2.9.0

@ -1 +1 @@
Subproject commit a1760b6baec0db18f0eeda14e371a75fa6fc3d3b Subproject commit 19b3d5ef4cd3cc4cef246dd9dba02199e19f5daf

@ -1 +1 @@
Subproject commit 02d704b55af439337a63becf23d8a1e05780ef01 Subproject commit 301db84d3d85f5218f3ec590224071c04140bbe2

@ -1 +1 @@
Subproject commit 7745d45de92679ec54435905ec56cec46f5ce709 Subproject commit 9797151286c045686e3d09389353431efcc6034a