Take 2 at fixing unbreakable code

This commit is contained in:
md_5 2014-01-10 15:39:36 +11:00
parent 1220314f79
commit acd5d21a06

View File

@ -1,19 +1,25 @@
From aa98163eefaa1479c99e6d527e5c81d79ae146fc Mon Sep 17 00:00:00 2001
From 0c83bc061d6d630018bf7da6c061d903d0187cec Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Fri, 10 Jan 2014 15:15:50 +1100
Subject: [PATCH] Fix ItemStack Unbreakable Code
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
index f32322e..fd1b18a 100644
index f32322e..37ceade 100644
--- a/src/main/java/net/minecraft/server/ItemStack.java
+++ b/src/main/java/net/minecraft/server/ItemStack.java
@@ -130,7 +130,7 @@ public final class ItemStack {
@@ -130,7 +130,13 @@ public final class ItemStack {
}
public boolean g() {
- return this.item.getMaxDurability() <= 0 ? false : !this.hasTag() || !this.getTag().getBoolean("Unbreakable");
+ return this.item.getMaxDurability() <= 0 ? false : (!this.hasTag() || !this.getTag().getBoolean("Unbreakable")); // Spigot
+ // Spigot Start
+ if ( this.item.getMaxDurability() <= 0 )
+ {
+ return false;
+ }
+ return ( !hasTag() ) || ( !getTag().getBoolean( "Unbreakable" ) );
+ // Spigot End
}
public boolean usesData() {