Removed StringUtils class

Added random note particle color
This commit is contained in:
Auxilor 2020-08-28 20:57:25 +01:00
parent f2287582d0
commit 6fb18325f1
3 changed files with 9 additions and 18 deletions

View File

@ -10,7 +10,6 @@
<version>4.1.0-pre11</version>
</parent>
<artifactId>plugin</artifactId>
<packaging>jar</packaging>

View File

@ -131,11 +131,19 @@ public abstract class Artifact extends EcoEnchant {
int ticks = this.getConfig().getInt(EcoEnchants.CONFIG_LOCATION + "particle-tick-delay");
int noteColor = 0;
AtomicDouble color = new AtomicDouble(0);
if(particle.equals(Particle.NOTE)) {
noteColor = Rand.randInt(0, 24);
color.set((double) noteColor/24);
}
final double finalColor = color.get();
new BukkitRunnable() {
@Override
public void run() {
if(entity.isOnGround() || entity.isInBlock() || entity.isDead()) this.cancel();
entity.getLocation().getWorld().spawnParticle(particle, entity.getLocation(), 1, 0, 0, 0, 0, extra, true);
entity.getLocation().getWorld().spawnParticle(particle, entity.getLocation(), 1, 0, 0, 0, finalColor, extra, true);
}
}.runTaskTimer(Main.getInstance(), 4, ticks);
}

View File

@ -1,16 +0,0 @@
package com.willfp.ecoenchants.util;
public class StringUtils {
public static String rot13(String input) {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < input.length(); i++) {
char c = input.charAt(i);
if (c >= 'a' && c <= 'm') c += 13;
else if (c >= 'A' && c <= 'M') c += 13;
else if (c >= 'n' && c <= 'z') c -= 13;
else if (c >= 'N' && c <= 'Z') c -= 13;
sb.append(c);
}
return sb.toString();
}
}