PaperSpigot-Parent/CraftBukkit-Patches/0145-Add-quiet-option-to-hasKeyOfType.patch

38 lines
1.2 KiB
Diff

From 9311ebaaee26e191601040dc2636073ed58b4245 Mon Sep 17 00:00:00 2001
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