From 5ee28509b9b7aa31877b7a47aa4380f0317b0459 Mon Sep 17 00:00:00 2001 From: Andrew Querol Date: Mon, 9 Feb 2015 22:05:33 -0600 Subject: [PATCH] Fixed the reggae... I hate how fast @Ecu got it.... --- .../quiddity/redux/ReduxCommandBlockTileEntity.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/mods/quiddity/redux/ReduxCommandBlockTileEntity.java b/src/main/java/mods/quiddity/redux/ReduxCommandBlockTileEntity.java index df2288d..fc445a5 100644 --- a/src/main/java/mods/quiddity/redux/ReduxCommandBlockTileEntity.java +++ b/src/main/java/mods/quiddity/redux/ReduxCommandBlockTileEntity.java @@ -298,18 +298,18 @@ public void receiveEvent(Event event) { int skipCount = 0; for (String s : triggerScript.getCommands()) { //noinspection StatementWithEmptyBody - for (;skipCount > 0; skipCount--); + for (;skipCount > 0; skipCount--) { continue; } String parsedCommand = s; - Pattern reduxPattern = Pattern.compile("\\$redux\\[[a-zA-Z]+\\]", Pattern.CASE_INSENSITIVE); + Pattern reduxPattern = Pattern.compile("\\$redux\\[\\w{1,}\\]"); Matcher reduxMatcher = reduxPattern.matcher(parsedCommand); - Pattern commandPattern = Pattern.compile("\\[[a-zA-Z]+\\]", Pattern.CASE_INSENSITIVE); - while (reduxMatcher.find() && !reduxMatcher.hitEnd()) { + Pattern commandPattern = Pattern.compile("\\[\\w{1,}\\]"); + while (reduxMatcher.find()) { MatchResult result = reduxMatcher.toMatchResult(); Matcher commandMatcher = commandPattern.matcher(result.group()); if (!commandMatcher.find()) continue; - String command = commandMatcher.toMatchResult().group().replaceAll("\\[", "").replaceAll("\\]", ""); + String command = commandMatcher.toMatchResult().group().replaceFirst("\\[", "").replaceFirst("\\]", ""); if (command.equalsIgnoreCase("PEEK") || command.equalsIgnoreCase("POP")) { if (command.equalsIgnoreCase("PEEK")) {