From 1fd79fc87e1c4d19b2df9ff55263e82ebb1b0e46 Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 10 Jun 2013 11:38:51 +1000 Subject: [PATCH] Null checks for the sake of nullchecks --- CraftBukkit-Patches/0048-Particle-API.patch | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CraftBukkit-Patches/0048-Particle-API.patch b/CraftBukkit-Patches/0048-Particle-API.patch index ba2edcdfd9..cd49f27db9 100644 --- a/CraftBukkit-Patches/0048-Particle-API.patch +++ b/CraftBukkit-Patches/0048-Particle-API.patch @@ -1,4 +1,4 @@ -From 461dd70b9d40f1e410a05fae349799406a3402f4 Mon Sep 17 00:00:00 2001 +From ba6bfe5a1b4eac8a2700b40870ffb2f0faad617e Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 2 Jun 2013 16:14:30 +1000 Subject: [PATCH] Particle API @@ -43,7 +43,7 @@ index 7de0de5..7eca388 100644 datavalue = 0; } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index f07982d..db5c3c3 100644 +index f07982d..a9a0a90 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -887,31 +887,21 @@ public class CraftWorld implements World { @@ -53,7 +53,7 @@ index f07982d..db5c3c3 100644 - - int datavalue = data == null ? 0 : CraftEffect.getDataValue(effect, data); - playEffect(loc, effect, datavalue, radius); -+ if (data.getClass().equals(org.bukkit.material.MaterialData.class)) { ++ if (data != null && data.getClass().equals(org.bukkit.material.MaterialData.class)) { + org.bukkit.material.MaterialData materialData = (org.bukkit.material.MaterialData) data; + Validate.isTrue(!materialData.getItemType().isBlock(), "Material must be block"); + spigot().playEffect(loc, effect, materialData.getItemType().getId(), materialData.getData(), 0, 0, 0, 1, 1, radius); @@ -152,7 +152,7 @@ index f07982d..db5c3c3 100644 public Spigot spigot() diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 3d39d07..140b06f 100644 +index 3d39d07..8ee2c3b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -266,13 +266,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -180,7 +180,7 @@ index 3d39d07..140b06f 100644 - - int datavalue = data == null ? 0 : CraftEffect.getDataValue(effect, data); - playEffect(loc, effect, datavalue); -+ if (data.getClass().equals(org.bukkit.material.MaterialData.class)) { ++ if (data != null && data.getClass().equals(org.bukkit.material.MaterialData.class)) { + org.bukkit.material.MaterialData materialData = (org.bukkit.material.MaterialData) data; + Validate.isTrue(!materialData.getItemType().isBlock(), "Material must be block"); + spigot().playEffect(loc, effect, materialData.getItemType().getId(), materialData.getData(), 0, 0, 0, 1, 1, 64);