SPIGOT-3303: Warn when attempting to grant non existent recipe

This commit is contained in:
md_5 2017-06-09 16:13:35 +10:00
parent 1b3122eef1
commit 2c34c38d7a

View File

@ -488,7 +488,16 @@
this.playerConnection.sendPacket(new PacketPlayOutCloseWindow(this.activeContainer.windowId));
this.r();
}
@@ -817,7 +1000,7 @@
@@ -814,10 +997,16 @@
for (int j = 0; j < i; ++j) {
MinecraftKey minecraftkey = aminecraftkey1[j];
+ // CraftBukkit start
+ if (CraftingManager.a(minecraftkey) == null) {
+ Bukkit.getLogger().warning("Ignoring grant of non existent recipe " + minecraftkey);
+ continue;
+ }
+ // CraftBukit end
arraylist.add(CraftingManager.a(minecraftkey));
}
@ -497,7 +506,7 @@
}
public void b(List<IRecipe> list) {
@@ -839,7 +1022,16 @@
@@ -839,7 +1028,16 @@
public void triggerHealthUpdate() {
this.lastHealthSent = -1.0E8F;
@ -514,7 +523,7 @@
public void a(IChatBaseComponent ichatbasecomponent, boolean flag) {
this.playerConnection.sendPacket(new PacketPlayOutChat(ichatbasecomponent, flag ? ChatMessageType.GAME_INFO : ChatMessageType.CHAT));
@@ -879,7 +1071,7 @@
@@ -879,7 +1077,7 @@
this.lastSentExp = -1;
this.lastHealthSent = -1.0F;
this.ch = -1;
@ -523,7 +532,7 @@
this.removeQueue.addAll(entityplayer.removeQueue);
this.cq = entityplayer.cq;
this.cv = entityplayer.cv;
@@ -938,6 +1130,18 @@
@@ -938,6 +1136,18 @@
}
public void a(EnumGamemode enumgamemode) {
@ -542,7 +551,7 @@
this.playerInteractManager.setGameMode(enumgamemode);
this.playerConnection.sendPacket(new PacketPlayOutGameStateChange(3, (float) enumgamemode.getId()));
if (enumgamemode == EnumGamemode.SPECTATOR) {
@@ -964,6 +1168,7 @@
@@ -964,6 +1174,7 @@
}
public boolean a(int i, String s) {
@ -550,7 +559,7 @@
if ("seed".equals(s) && !this.server.aa()) {
return true;
} else if (!"tell".equals(s) && !"help".equals(s) && !"me".equals(s) && !"trigger".equals(s)) {
@@ -977,6 +1182,15 @@
@@ -977,6 +1188,15 @@
} else {
return true;
}
@ -566,7 +575,7 @@
}
public String A() {
@@ -988,6 +1202,16 @@
@@ -988,6 +1208,16 @@
}
public void a(PacketPlayInSettings packetplayinsettings) {
@ -583,7 +592,7 @@
this.locale = packetplayinsettings.a();
this.cl = packetplayinsettings.c();
this.cm = packetplayinsettings.d();
@@ -1053,7 +1277,7 @@
@@ -1053,7 +1283,7 @@
this.co = (Entity) (entity == null ? this : entity);
if (entity1 != this.co) {
this.playerConnection.sendPacket(new PacketPlayOutCamera(this.co));
@ -592,7 +601,7 @@
}
}
@@ -1080,7 +1304,7 @@
@@ -1080,7 +1310,7 @@
@Nullable
public IChatBaseComponent getPlayerListName() {
@ -601,7 +610,7 @@
}
public void a(EnumHand enumhand) {
@@ -1097,12 +1321,17 @@
@@ -1097,12 +1327,17 @@
}
public void N() {
@ -619,7 +628,7 @@
}
public AdvancementDataPlayer getAdvancementData() {
@@ -1113,4 +1342,139 @@
@@ -1113,4 +1348,139 @@
public Vec3D Q() {
return this.cv;
}