Fix some missed cases with data value blocking

The item and block forms of double plants have different rules
This commit is contained in:
Thinkofdeath 2014-05-30 20:28:14 +01:00
parent 5daa7e5418
commit b572a59936

View file

@ -1,11 +1,11 @@
From 049447a07afd2593061a234a82daea7098690941 Mon Sep 17 00:00:00 2001
From 2a693183d7eef1e420940b89477c31b4589e6dea Mon Sep 17 00:00:00 2001
From: Thinkofdeath <thethinkofdeath@gmail.com>
Date: Wed, 15 Jan 2014 21:52:47 +0000
Subject: [PATCH] Block data values that crash the client
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 874a089..2c95832 100644
index 874a089..088ee42 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -115,7 +115,7 @@ public class Chunk {
@ -26,7 +26,7 @@ index 874a089..2c95832 100644
+ {
+ if (block == Blocks.DOUBLE_PLANT )
+ {
+ return data == 7 || data > 15 ? 0 : data;
+ return data < 6 || data >= 8 ? data : 0;
+ }
+ return data;
+ }
@ -57,7 +57,7 @@ index 874a089..2c95832 100644
if (tileentity != null) {
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
index 3a18002..a5b2f2f 100644
index 3a18002..2ab3b9b 100644
--- a/src/main/java/net/minecraft/server/ItemStack.java
+++ b/src/main/java/net/minecraft/server/ItemStack.java
@@ -204,10 +204,7 @@ public final class ItemStack {
@ -72,7 +72,7 @@ index 3a18002..a5b2f2f 100644
if (nbttagcompound.hasKeyOfType("tag", 10)) {
// CraftBukkit - make defensive copy as this data may be coming from the save thread
@@ -258,11 +255,15 @@ public final class ItemStack {
@@ -258,11 +255,21 @@ public final class ItemStack {
}
// Is this a block?
@ -84,7 +84,13 @@ index 3a18002..a5b2f2f 100644
if (!(this.usesData() || this.getItem().usesDurability())) {
i = 0;
}
+ i = Chunk.checkData( block, i );
+ if ( block == Blocks.DOUBLE_PLANT )
+ {
+ if ( i >= 6 && i != 8 )
+ {
+ i = 0;
+ }
+ }
+ // Spigot end
}
// CraftBukkit end