2014-04-19 01:15:23 +02:00
|
|
|
From 59a46b8a6c85a4c77499ee8fe98b140b87ec524b 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)});
|
|
|
|
}
|
|
|
|
|
|
|
|
--
|
2014-04-19 01:15:23 +02:00
|
|
|
1.9.1
|
2014-04-17 14:02:29 +02:00
|
|
|
|