diff --git a/src/main/java/me/blackvein/quests/prompts/MobsPrompt.java b/src/main/java/me/blackvein/quests/prompts/MobsPrompt.java index d0d03fe00..784a49848 100644 --- a/src/main/java/me/blackvein/quests/prompts/MobsPrompt.java +++ b/src/main/java/me/blackvein/quests/prompts/MobsPrompt.java @@ -1,3 +1,15 @@ +/******************************************************************************************************* + * Continued by FlyingPikachu/HappyPikachu with permission from _Blackvein_. All rights reserved. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *******************************************************************************************************/ + package me.blackvein.quests.prompts; import java.util.Arrays; diff --git a/src/main/java/me/blackvein/quests/prompts/NPCsPrompt.java b/src/main/java/me/blackvein/quests/prompts/NPCsPrompt.java index 89d4bd7e7..6f468683a 100644 --- a/src/main/java/me/blackvein/quests/prompts/NPCsPrompt.java +++ b/src/main/java/me/blackvein/quests/prompts/NPCsPrompt.java @@ -1,3 +1,15 @@ +/******************************************************************************************************* + * Continued by FlyingPikachu/HappyPikachu with permission from _Blackvein_. All rights reserved. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *******************************************************************************************************/ + package me.blackvein.quests.prompts; import java.util.Arrays; diff --git a/src/main/java/me/blackvein/quests/util/MiscUtil.java b/src/main/java/me/blackvein/quests/util/MiscUtil.java index 012fcb4cb..8dfebd296 100644 --- a/src/main/java/me/blackvein/quests/util/MiscUtil.java +++ b/src/main/java/me/blackvein/quests/util/MiscUtil.java @@ -33,8 +33,10 @@ public class MiscUtil { public static String getProperMobName(EntityType type) { String name = type.name().toLowerCase(); name = Character.toUpperCase(name.charAt(0)) + name.substring(1); - while (fixUnderscore(name) != null) { - name = fixUnderscore(name); + int index = name.indexOf('_'); + if (index != -1) { + name = name.substring(0, (index + 1)) + Character.toUpperCase(name.charAt(index + 1)) + name.substring(index + 2); + name = name.replaceFirst("_", ""); } return name; } @@ -49,16 +51,6 @@ public class MiscUtil { return null; } - public static String fixUnderscore(String s) { - int index = s.indexOf('_'); - if (index == -1) { - return null; - } - s = s.substring(0, (index + 1)) + Character.toUpperCase(s.charAt(index + 1)) + s.substring(index + 2); - s = s.replaceFirst("_", ""); - return s; - } - public static String concatArgArray(String[] args, int startingIndex, int endingIndex, char delimiter) { String s = ""; for (int i = startingIndex; i <= endingIndex; i++) {