2014-04-17 21:47:40 +02:00
|
|
|
From af1ffa18a57d7474ab9c79f7f2af16e02bc7d867 Mon Sep 17 00:00:00 2001
|
2014-04-17 14:02:29 +02:00
|
|
|
From: Thinkofdeath <thethinkofdeath@gmail.com>
|
|
|
|
Date: Thu, 17 Apr 2014 12:58:08 +0100
|
|
|
|
Subject: [PATCH] Add quiet option to hasKeyOfType
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/NBTTagCompound.java b/src/main/java/net/minecraft/server/NBTTagCompound.java
|
|
|
|
index 5b8842f..7931c4a 100644
|
|
|
|
--- a/src/main/java/net/minecraft/server/NBTTagCompound.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/NBTTagCompound.java
|
|
|
|
@@ -119,13 +119,21 @@ public class NBTTagCompound extends NBTBase {
|
|
|
|
return this.map.containsKey(s);
|
|
|
|
}
|
|
|
|
|
|
|
|
- public boolean hasKeyOfType(String s, int i) {
|
|
|
|
+ // Spigot start - Add quiet option
|
|
|
|
+ public boolean hasKeyOfType(String s, int i)
|
|
|
|
+ {
|
|
|
|
+ return hasKeyOfType( s, i, false );
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public boolean hasKeyOfType(String s, int i, boolean quiet)
|
|
|
|
+ {
|
|
|
|
byte b0 = this.b(s);
|
|
|
|
|
|
|
|
if (b0 == i) {
|
|
|
|
return true;
|
|
|
|
} else if (i != 99) {
|
|
|
|
- if (b0 > 0) {
|
|
|
|
+ if (b0 > 0 && !quiet) {
|
|
|
|
+ // Spigot end
|
|
|
|
b.warn("NBT tag {} was of wrong type; expected {}, found {}", new Object[] { s, getTagName(i), getTagName(b0)});
|
|
|
|
}
|
|
|
|
|
|
|
|
--
|
|
|
|
1.8.5.2.msysgit.0
|
|
|
|
|