mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-30 06:24:06 +01:00
Fix some missed cases with data value blocking
The item and block forms of double plants have different rules
This commit is contained in:
parent
5daa7e5418
commit
b572a59936
@ -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>
|
From: Thinkofdeath <thethinkofdeath@gmail.com>
|
||||||
Date: Wed, 15 Jan 2014 21:52:47 +0000
|
Date: Wed, 15 Jan 2014 21:52:47 +0000
|
||||||
Subject: [PATCH] Block data values that crash the client
|
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
|
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
|
--- 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
|
||||||
@@ -115,7 +115,7 @@ public class Chunk {
|
@@ -115,7 +115,7 @@ public class Chunk {
|
||||||
@ -26,7 +26,7 @@ index 874a089..2c95832 100644
|
|||||||
+ {
|
+ {
|
||||||
+ if (block == Blocks.DOUBLE_PLANT )
|
+ if (block == Blocks.DOUBLE_PLANT )
|
||||||
+ {
|
+ {
|
||||||
+ return data == 7 || data > 15 ? 0 : data;
|
+ return data < 6 || data >= 8 ? data : 0;
|
||||||
+ }
|
+ }
|
||||||
+ return data;
|
+ return data;
|
||||||
+ }
|
+ }
|
||||||
@ -57,7 +57,7 @@ index 874a089..2c95832 100644
|
|||||||
|
|
||||||
if (tileentity != null) {
|
if (tileentity != null) {
|
||||||
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 3a18002..a5b2f2f 100644
|
index 3a18002..2ab3b9b 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
|
||||||
@@ -204,10 +204,7 @@ public final class ItemStack {
|
@@ -204,10 +204,7 @@ public final class ItemStack {
|
||||||
@ -72,7 +72,7 @@ index 3a18002..a5b2f2f 100644
|
|||||||
|
|
||||||
if (nbttagcompound.hasKeyOfType("tag", 10)) {
|
if (nbttagcompound.hasKeyOfType("tag", 10)) {
|
||||||
// CraftBukkit - make defensive copy as this data may be coming from the save thread
|
// 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?
|
// Is this a block?
|
||||||
@ -84,7 +84,13 @@ index 3a18002..a5b2f2f 100644
|
|||||||
if (!(this.usesData() || this.getItem().usesDurability())) {
|
if (!(this.usesData() || this.getItem().usesDurability())) {
|
||||||
i = 0;
|
i = 0;
|
||||||
}
|
}
|
||||||
+ i = Chunk.checkData( block, i );
|
+ if ( block == Blocks.DOUBLE_PLANT )
|
||||||
|
+ {
|
||||||
|
+ if ( i >= 6 && i != 8 )
|
||||||
|
+ {
|
||||||
|
+ i = 0;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
+ // Spigot end
|
+ // Spigot end
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
Loading…
Reference in New Issue
Block a user