Skip to content

Commit 3328cce

Browse files
committed
Renamed inputs on MiscUtils to be more confident
1 parent e4d7779 commit 3328cce

File tree

1 file changed

+12
-12
lines changed
  • MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/utils/misc

1 file changed

+12
-12
lines changed

MiniGamesBox Classic/src/main/java/plugily/projects/minigamesbox/classic/utils/misc/MiscUtils.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,21 +55,21 @@ public class MiscUtils {
5555
private MiscUtils() {
5656
}
5757

58-
public static String matchColorRegex(String s) {
58+
public static String matchColorRegex(String message) {
5959
if(Version.isCurrentLower(Version.v1_16)) {
60-
return s;
60+
return message;
6161
}
6262

63-
Matcher matcher = PATTERN.matcher(s);
63+
Matcher matcher = PATTERN.matcher(message);
6464
while(matcher.find()) {
6565
try {
66-
s = s.replace(matcher.group(0), net.md_5.bungee.api.ChatColor.of("#" + matcher.group(1)).toString());
67-
} catch(Exception e) {
68-
System.err.println("Invalid hex color: " + e.getLocalizedMessage());
66+
message = message.replace(matcher.group(0), net.md_5.bungee.api.ChatColor.of("#" + matcher.group(1)).toString());
67+
} catch(Exception exception) {
68+
System.err.println("Invalid hex color: " + exception.getLocalizedMessage() + " && " + message);
6969
}
7070
}
7171

72-
return s;
72+
return message;
7373
}
7474

7575
@Deprecated
@@ -87,8 +87,8 @@ public static Optional<AttributeInstance> getEntityAttribute(LivingEntity entity
8787
* @param location location to spawn firework there
8888
*/
8989
public static void spawnRandomFirework(Location location) {
90-
Firework fw = (Firework) location.getWorld().spawnEntity(location, XEntityType.FIREWORK_ROCKET.get());
91-
FireworkMeta fwm = fw.getFireworkMeta();
90+
Firework firework = (Firework) location.getWorld().spawnEntity(location, XEntityType.FIREWORK_ROCKET.get());
91+
FireworkMeta fireworkMeta = firework.getFireworkMeta();
9292

9393
//Get the type
9494
FireworkEffect.Type type;
@@ -124,11 +124,11 @@ public static void spawnRandomFirework(Location location) {
124124
.with(type).trail(RANDOM.nextBoolean()).build();
125125

126126
//Then apply the effect to the meta
127-
fwm.addEffect(effect);
127+
fireworkMeta.addEffect(effect);
128128

129129
//Generate some random power and set it
130-
fwm.setPower(RANDOM.nextInt(2) + 1);
131-
fw.setFireworkMeta(fwm);
130+
fireworkMeta.setPower(RANDOM.nextInt(2) + 1);
131+
firework.setFireworkMeta(fireworkMeta);
132132
}
133133

134134
/**

0 commit comments

Comments
 (0)