Fixed a crash when right clicking a spark with an empty hand. Closes #1621

This commit is contained in:
Vasco Lavos committed 2015-12-06 14:23:56 +00:00
1 parent d026920573
commit 9ff67ffd7d
2 files changed
+2 -2

No files matched your search

@@ -286,7 +286,7 @@ public class EntityCorporeaSpark extends Entity implements ICorporeaSpark {
}
public boolean doPhantomInk(ItemStack stack) {
if(stack.getItem() == ModItems.phantomInk && !worldObj.isRemote) {
if(stack != null && stack.getItem() == ModItems.phantomInk && !worldObj.isRemote) {
int invis = dataWatcher.getWatchableObjectInt(EntitySpark.INVISIBILITY_DATA_WATCHER_KEY);
dataWatcher.updateObject(EntitySpark.INVISIBILITY_DATA_WATCHER_KEY, ~invis & 1);
return true;
@@ -285,7 +285,7 @@ public class EntitySpark extends Entity implements ISparkEntity {
}
public boolean doPhantomInk(ItemStack stack) {
if(stack.getItem() == ModItems.phantomInk && !worldObj.isRemote) {
if(stack != null && stack.getItem() == ModItems.phantomInk && !worldObj.isRemote) {
int invis = dataWatcher.getWatchableObjectInt(INVISIBILITY_DATA_WATCHER_KEY);
dataWatcher.updateObject(INVISIBILITY_DATA_WATCHER_KEY, ~invis & 1);
return true;