Remove unnecessary empty itemstack checks, see comments on d0fda72

This commit is contained in:
Electroblob
2018-02-16 22:28:00 +00:00
parent bec52edce4
commit 3be254a247
11 changed files with 98 additions and 141 deletions
@@ -28,7 +28,7 @@ public class PacketControlInput implements IMessageHandler<Message, IMessage> {
ItemStack wand = player.getHeldItemMainhand();
if(wand.isEmpty() || !(wand.getItem() instanceof ItemWand)){
if(!(wand.getItem() instanceof ItemWand)){
wand = player.getHeldItemOffhand();
}
@@ -41,7 +41,7 @@ public class PacketControlInput implements IMessageHandler<Message, IMessage> {
case NEXT_SPELL_KEY:
if(!wand.isEmpty() && wand.getItem() instanceof ItemWand){
if(wand.getItem() instanceof ItemWand){
WandHelper.selectNextSpell(wand);
// This line fixes the bug with continuous spells casting when they shouldn't be
@@ -52,7 +52,7 @@ public class PacketControlInput implements IMessageHandler<Message, IMessage> {
case PREVIOUS_SPELL_KEY:
if(!wand.isEmpty() && wand.getItem() instanceof ItemWand){
if(wand.getItem() instanceof ItemWand){
WandHelper.selectPreviousSpell(wand);
// This line fixes the bug with continuous spells casting when they shouldn't be