From f4da69a205cd60e315170ec9e012a30dd23cf1cb Mon Sep 17 00:00:00 2001 From: GJ Date: Wed, 13 Feb 2013 16:34:36 -0500 Subject: [PATCH] Fix some missing default cases and possible fall-through issues. --- src/main/java/com/gmail/nossr50/database/Database.java | 1 + .../java/com/gmail/nossr50/skills/fishing/ShakeMob.java | 1 + .../com/gmail/nossr50/skills/utilities/CombatTools.java | 2 ++ src/main/java/com/gmail/nossr50/spout/popups/XpBar.java | 6 ++++++ src/main/java/com/gmail/nossr50/util/BlockChecks.java | 4 +++- src/main/java/com/gmail/nossr50/util/ItemChecks.java | 2 ++ 6 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/nossr50/database/Database.java b/src/main/java/com/gmail/nossr50/database/Database.java index 0552ace48..7ba91dacb 100644 --- a/src/main/java/com/gmail/nossr50/database/Database.java +++ b/src/main/java/com/gmail/nossr50/database/Database.java @@ -173,6 +173,7 @@ public final class Database { write("ALTER TABLE `" + tablePrefix + "experience` ADD FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON DELETE CASCADE;"); write("ALTER TABLE `" + tablePrefix + "cooldowns` ADD FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON DELETE CASCADE;"); write("ALTER TABLE `" + tablePrefix + "skills` ADD FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON DELETE CASCADE;"); + break; case FISHING: sql = "SELECT * FROM `" + tablePrefix + "experience` ORDER BY `" + tablePrefix + "experience`.`fishing` ASC LIMIT 0 , 30"; diff --git a/src/main/java/com/gmail/nossr50/skills/fishing/ShakeMob.java b/src/main/java/com/gmail/nossr50/skills/fishing/ShakeMob.java index e78396965..fee79099a 100644 --- a/src/main/java/com/gmail/nossr50/skills/fishing/ShakeMob.java +++ b/src/main/java/com/gmail/nossr50/skills/fishing/ShakeMob.java @@ -86,6 +86,7 @@ public final class ShakeMob { break; } } + break; default: break; diff --git a/src/main/java/com/gmail/nossr50/skills/utilities/CombatTools.java b/src/main/java/com/gmail/nossr50/skills/utilities/CombatTools.java index ca4c05b6f..21559cff1 100644 --- a/src/main/java/com/gmail/nossr50/skills/utilities/CombatTools.java +++ b/src/main/java/com/gmail/nossr50/skills/utilities/CombatTools.java @@ -532,6 +532,8 @@ public final class CombatTools { baseXP = configInstance.getSkeletonXP(); break; } + break; + case SLIME: baseXP = configInstance.getSlimeXP(); break; diff --git a/src/main/java/com/gmail/nossr50/spout/popups/XpBar.java b/src/main/java/com/gmail/nossr50/spout/popups/XpBar.java index 7a6ec9db3..ec5708e89 100644 --- a/src/main/java/com/gmail/nossr50/spout/popups/XpBar.java +++ b/src/main/java/com/gmail/nossr50/spout/popups/XpBar.java @@ -42,6 +42,9 @@ public class XpBar { case DISABLED: break; + + default: + break; } spoutPlayer.getMainScreen().setDirty(true); @@ -194,6 +197,9 @@ public class XpBar { case DISABLED: break; + + default: + break; } } diff --git a/src/main/java/com/gmail/nossr50/util/BlockChecks.java b/src/main/java/com/gmail/nossr50/util/BlockChecks.java index e942b471a..ba2acc9f0 100644 --- a/src/main/java/com/gmail/nossr50/util/BlockChecks.java +++ b/src/main/java/com/gmail/nossr50/util/BlockChecks.java @@ -162,10 +162,12 @@ public final class BlockChecks { return true; case SMOOTH_BRICK: case COBBLE_WALL: - if (block.getData() == 0) { + if (block.getData() == (byte)0x0) { return true; } + return false; + default: return false; } diff --git a/src/main/java/com/gmail/nossr50/util/ItemChecks.java b/src/main/java/com/gmail/nossr50/util/ItemChecks.java index d74066b93..6ebc5edba 100644 --- a/src/main/java/com/gmail/nossr50/util/ItemChecks.java +++ b/src/main/java/com/gmail/nossr50/util/ItemChecks.java @@ -564,6 +564,8 @@ public class ItemChecks { return true; } + return false; + default: return false; }