mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2025-02-03 02:21:21 +01:00
Removed StringUtils class
Added random note particle color
This commit is contained in:
parent
f2287582d0
commit
6fb18325f1
@ -10,7 +10,6 @@
|
||||
<version>4.1.0-pre11</version>
|
||||
</parent>
|
||||
|
||||
|
||||
<artifactId>plugin</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user