mirror of
https://github.com/TotalFreedomMC/PlayerParticles.git
synced 2025-02-11 11:40:21 +00:00
Fix inconsistencies in whitespace formatting
Only use 4 spaces, no tabs.
This commit is contained in:
parent
8cbb588d18
commit
6871b7e3d2
50 changed files with 1652 additions and 1689 deletions
|
@ -41,8 +41,7 @@ public class FixedCommandModule implements CommandModule {
|
|||
LangManager.sendMessage(p, Lang.FIXED_COMMAND_DESC_REMOVE);
|
||||
LangManager.sendMessage(p, Lang.FIXED_COMMAND_DESC_LIST);
|
||||
LangManager.sendMessage(p, Lang.FIXED_COMMAND_DESC_INFO);
|
||||
if (p.hasPermission("playerparticles.fixed.clear"))
|
||||
LangManager.sendMessage(p, Lang.FIXED_COMMAND_DESC_CLEAR);
|
||||
if (p.hasPermission("playerparticles.fixed.clear")) LangManager.sendMessage(p, Lang.FIXED_COMMAND_DESC_CLEAR);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -69,28 +68,22 @@ public class FixedCommandModule implements CommandModule {
|
|||
double xPos = -1, yPos = -1, zPos = -1;
|
||||
try {
|
||||
if (args[0].startsWith("~")) {
|
||||
if (args[0].equals("~"))
|
||||
xPos = p.getLocation().getX();
|
||||
else
|
||||
xPos = p.getLocation().getX() + Double.parseDouble(args[0].substring(1));
|
||||
if (args[0].equals("~")) xPos = p.getLocation().getX();
|
||||
else xPos = p.getLocation().getX() + Double.parseDouble(args[0].substring(1));
|
||||
} else {
|
||||
xPos = Double.parseDouble(args[0]);
|
||||
}
|
||||
|
||||
if (args[1].startsWith("~")) {
|
||||
if (args[1].equals("~"))
|
||||
yPos = p.getLocation().getY() + 1;
|
||||
else
|
||||
yPos = p.getLocation().getY() + 1 + Double.parseDouble(args[1].substring(1));
|
||||
if (args[1].equals("~")) yPos = p.getLocation().getY() + 1;
|
||||
else yPos = p.getLocation().getY() + 1 + Double.parseDouble(args[1].substring(1));
|
||||
} else {
|
||||
yPos = Double.parseDouble(args[1]);
|
||||
}
|
||||
|
||||
if (args[2].startsWith("~")) {
|
||||
if (args[2].equals("~"))
|
||||
zPos = p.getLocation().getZ();
|
||||
else
|
||||
zPos = p.getLocation().getZ() + Double.parseDouble(args[2].substring(1));
|
||||
if (args[2].equals("~")) zPos = p.getLocation().getZ();
|
||||
else zPos = p.getLocation().getZ() + Double.parseDouble(args[2].substring(1));
|
||||
} else {
|
||||
zPos = Double.parseDouble(args[2]);
|
||||
}
|
||||
|
@ -185,10 +178,8 @@ public class FixedCommandModule implements CommandModule {
|
|||
Material material = null;
|
||||
try {
|
||||
material = ParticleUtils.closestMatch(args[5]);
|
||||
if (material == null)
|
||||
material = Material.matchMaterial(args[5]);
|
||||
if (material == null)
|
||||
throw new Exception();
|
||||
if (material == null) material = Material.matchMaterial(args[5]);
|
||||
if (material == null) throw new Exception();
|
||||
} catch (Exception e) {
|
||||
LangManager.sendMessage(p, Lang.CREATE_FIXED_DATA_ERROR, "block");
|
||||
return;
|
||||
|
@ -199,10 +190,8 @@ public class FixedCommandModule implements CommandModule {
|
|||
Material material = null;
|
||||
try {
|
||||
material = ParticleUtils.closestMatch(args[5]);
|
||||
if (material == null)
|
||||
material = Material.matchMaterial(args[5]);
|
||||
if (material == null)
|
||||
throw new Exception();
|
||||
if (material == null) material = Material.matchMaterial(args[5]);
|
||||
if (material == null) throw new Exception();
|
||||
} catch (Exception e) {
|
||||
LangManager.sendMessage(p, Lang.CREATE_FIXED_DATA_ERROR, "item");
|
||||
return;
|
||||
|
@ -251,10 +240,8 @@ public class FixedCommandModule implements CommandModule {
|
|||
String msg = Lang.LIST_FIXED_SUCCESS.get();
|
||||
boolean first = true;
|
||||
for (int id : ids) {
|
||||
if (!first)
|
||||
msg += ", ";
|
||||
else
|
||||
first = false;
|
||||
if (!first) msg += ", ";
|
||||
else first = false;
|
||||
msg += id;
|
||||
}
|
||||
|
||||
|
@ -281,7 +268,6 @@ public class FixedCommandModule implements CommandModule {
|
|||
|
||||
ParticlePair particle = fixedEffect.getParticlePair();
|
||||
|
||||
|
||||
DecimalFormat df = new DecimalFormat("0.##"); // Decimal formatter so the coords aren't super long
|
||||
String listMessage = Lang.INFO_FIXED_INFO.get() // @formatter:off
|
||||
.replaceAll("\\{0\\}", fixedEffect.getId() + "")
|
||||
|
@ -316,9 +302,7 @@ public class FixedCommandModule implements CommandModule {
|
|||
|
||||
for (PPlayer ppl : ParticleManager.getPPlayers())
|
||||
for (FixedParticleEffect fixedEffect : ppl.getFixedParticles())
|
||||
if (fixedEffect.getLocation().getWorld().equals(p.getLocation().getWorld())
|
||||
&& fixedEffect.getLocation().distance(p.getLocation()) <= radius)
|
||||
fixedEffectsToRemove.add(fixedEffect);
|
||||
if (fixedEffect.getLocation().getWorld().equals(p.getLocation().getWorld()) && fixedEffect.getLocation().distance(p.getLocation()) <= radius) fixedEffectsToRemove.add(fixedEffect);
|
||||
|
||||
for (FixedParticleEffect fixedEffect : fixedEffectsToRemove)
|
||||
DataManager.removeFixedEffect(fixedEffect.getOwnerUniqueId(), fixedEffect.getId());
|
||||
|
@ -333,8 +317,7 @@ public class FixedCommandModule implements CommandModule {
|
|||
LangManager.sendMessage(pplayer, Lang.FIXED_COMMAND_DESC_REMOVE);
|
||||
LangManager.sendMessage(pplayer, Lang.FIXED_COMMAND_DESC_LIST);
|
||||
LangManager.sendMessage(pplayer, Lang.FIXED_COMMAND_DESC_INFO);
|
||||
if (p.hasPermission("playerparticles.fixed.clear"))
|
||||
LangManager.sendMessage(p, Lang.FIXED_COMMAND_DESC_CLEAR);
|
||||
if (p.hasPermission("playerparticles.fixed.clear")) LangManager.sendMessage(p, Lang.FIXED_COMMAND_DESC_CLEAR);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -250,10 +250,8 @@ public class PlayerParticlesGui extends BukkitRunnable implements Listener {
|
|||
private static void setPPlayerEffect(PPlayer pplayer, ParticleEffect effect) {
|
||||
List<ParticlePair> particles = pplayer.getActiveParticles();
|
||||
ParticlePair particle;
|
||||
if (particles.isEmpty())
|
||||
particle = ParticlePair.getDefault(pplayer.getUniqueId());
|
||||
else
|
||||
particle = particles.get(0);
|
||||
if (particles.isEmpty()) particle = ParticlePair.getDefault(pplayer.getUniqueId());
|
||||
else particle = particles.get(0);
|
||||
|
||||
particle.setEffect(effect);
|
||||
particles.clear();
|
||||
|
@ -266,10 +264,8 @@ public class PlayerParticlesGui extends BukkitRunnable implements Listener {
|
|||
private static void setPPlayerStyle(PPlayer pplayer, ParticleStyle style) {
|
||||
List<ParticlePair> particles = pplayer.getActiveParticles();
|
||||
ParticlePair particle;
|
||||
if (particles.isEmpty())
|
||||
particle = ParticlePair.getDefault(pplayer.getUniqueId());
|
||||
else
|
||||
particle = particles.get(0);
|
||||
if (particles.isEmpty()) particle = ParticlePair.getDefault(pplayer.getUniqueId());
|
||||
else particle = particles.get(0);
|
||||
|
||||
particle.setStyle(style);
|
||||
particles.clear();
|
||||
|
@ -282,10 +278,8 @@ public class PlayerParticlesGui extends BukkitRunnable implements Listener {
|
|||
private static void setPPlayerItemMaterial(PPlayer pplayer, Material material) {
|
||||
List<ParticlePair> particles = pplayer.getActiveParticles();
|
||||
ParticlePair particle;
|
||||
if (particles.isEmpty())
|
||||
particle = ParticlePair.getDefault(pplayer.getUniqueId());
|
||||
else
|
||||
particle = particles.get(0);
|
||||
if (particles.isEmpty()) particle = ParticlePair.getDefault(pplayer.getUniqueId());
|
||||
else particle = particles.get(0);
|
||||
|
||||
particle.setItemMaterial(material);
|
||||
particles.clear();
|
||||
|
@ -298,10 +292,8 @@ public class PlayerParticlesGui extends BukkitRunnable implements Listener {
|
|||
private static void setPPlayerBlockMaterial(PPlayer pplayer, Material material) {
|
||||
List<ParticlePair> particles = pplayer.getActiveParticles();
|
||||
ParticlePair particle;
|
||||
if (particles.isEmpty())
|
||||
particle = ParticlePair.getDefault(pplayer.getUniqueId());
|
||||
else
|
||||
particle = particles.get(0);
|
||||
if (particles.isEmpty()) particle = ParticlePair.getDefault(pplayer.getUniqueId());
|
||||
else particle = particles.get(0);
|
||||
|
||||
particle.setBlockMaterial(material);
|
||||
particles.clear();
|
||||
|
@ -314,10 +306,8 @@ public class PlayerParticlesGui extends BukkitRunnable implements Listener {
|
|||
private static void setPPlayerColor(PPlayer pplayer, OrdinaryColor color) {
|
||||
List<ParticlePair> particles = pplayer.getActiveParticles();
|
||||
ParticlePair particle;
|
||||
if (particles.isEmpty())
|
||||
particle = ParticlePair.getDefault(pplayer.getUniqueId());
|
||||
else
|
||||
particle = particles.get(0);
|
||||
if (particles.isEmpty()) particle = ParticlePair.getDefault(pplayer.getUniqueId());
|
||||
else particle = particles.get(0);
|
||||
|
||||
particle.setColor(color);
|
||||
particles.clear();
|
||||
|
@ -330,10 +320,8 @@ public class PlayerParticlesGui extends BukkitRunnable implements Listener {
|
|||
private static void setPPlayerNoteColor(PPlayer pplayer, NoteColor noteColor) {
|
||||
List<ParticlePair> particles = pplayer.getActiveParticles();
|
||||
ParticlePair particle;
|
||||
if (particles.isEmpty())
|
||||
particle = ParticlePair.getDefault(pplayer.getUniqueId());
|
||||
else
|
||||
particle = particles.get(0);
|
||||
if (particles.isEmpty()) particle = ParticlePair.getDefault(pplayer.getUniqueId());
|
||||
else particle = particles.get(0);
|
||||
|
||||
particle.setNoteColor(noteColor);
|
||||
particles.clear();
|
||||
|
@ -425,9 +413,7 @@ public class PlayerParticlesGui extends BukkitRunnable implements Listener {
|
|||
public static void changeState(PPlayer pplayer, GuiState state) {
|
||||
Player player = pplayer.getPlayer();
|
||||
|
||||
if ((state == GuiState.EFFECT && PermissionManager.getEffectsUserHasPermissionFor(player).size() == 1) ||
|
||||
(state == GuiState.STYLE && PermissionManager.getStylesUserHasPermissionFor(player).size() == 1) ||
|
||||
(state == GuiState.DATA && getPPlayerSpawnMaterial(pplayer) == null && getPPlayerSpawnColor(pplayer) == null)) return;
|
||||
if ((state == GuiState.EFFECT && PermissionManager.getEffectsUserHasPermissionFor(player).size() == 1) || (state == GuiState.STYLE && PermissionManager.getStylesUserHasPermissionFor(player).size() == 1) || (state == GuiState.DATA && getPPlayerSpawnMaterial(pplayer) == null && getPPlayerSpawnColor(pplayer) == null)) return;
|
||||
|
||||
// Update the state and create an inventory for the player if one isn't already open for them
|
||||
// If they have the wrong inventory open for some reason, create a new one and open it for them
|
||||
|
@ -486,7 +472,7 @@ public class PlayerParticlesGui extends BukkitRunnable implements Listener {
|
|||
currentIconLore[2] = ChatColor.YELLOW + "Active Data: " + ChatColor.AQUA + getPPlayerDataString(pplayer);
|
||||
currentIconMeta.setLore(Arrays.asList(currentIconLore));
|
||||
currentIconMeta.setOwner(player.getName());
|
||||
//currentIconMeta.setOwningPlayer(Bukkit.getOfflinePlayer(player.getUniqueId())); // This doesn't exist in 1.9
|
||||
// currentIconMeta.setOwningPlayer(Bukkit.getOfflinePlayer(player.getUniqueId())); // This doesn't exist in 1.9
|
||||
currentIcon.setItemMeta(currentIconMeta);
|
||||
|
||||
ItemStack effectIcon = new ItemStack(defaultMenuIcons[0], 1);
|
||||
|
@ -632,8 +618,7 @@ public class PlayerParticlesGui extends BukkitRunnable implements Listener {
|
|||
|
||||
while (materialBag.size() < 28) { // Grab 28 random materials that are an item
|
||||
Material randomMaterial = ITEM_MATERIALS.get(RANDOM.nextInt(ITEM_MATERIALS.size()));
|
||||
if (!materialBag.contains(randomMaterial))
|
||||
materialBag.add(randomMaterial);
|
||||
if (!materialBag.contains(randomMaterial)) materialBag.add(randomMaterial);
|
||||
}
|
||||
|
||||
for (int i = 10; i <= 16; i++) { // Top row
|
||||
|
@ -657,8 +642,7 @@ public class PlayerParticlesGui extends BukkitRunnable implements Listener {
|
|||
|
||||
while (materialBag.size() < 28) { // Grab 28 random materials that are an item
|
||||
Material randomMaterial = BLOCK_MATERIALS.get(RANDOM.nextInt(BLOCK_MATERIALS.size()));
|
||||
if (!materialBag.contains(randomMaterial))
|
||||
materialBag.add(randomMaterial);
|
||||
if (!materialBag.contains(randomMaterial)) materialBag.add(randomMaterial);
|
||||
}
|
||||
|
||||
for (int i = 10; i <= 16; i++) { // Top row
|
||||
|
@ -978,8 +962,7 @@ public class PlayerParticlesGui extends BukkitRunnable implements Listener {
|
|||
*/
|
||||
private static ColorData getColorDataFromOrdinaryColor(DyeColor color) {
|
||||
for (ColorData colorData : colorMapping)
|
||||
if (colorData.getDyeColor().equals(color))
|
||||
return colorData;
|
||||
if (colorData.getDyeColor().equals(color)) return colorData;
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ import com.esophose.playerparticles.util.ParticleUtils;
|
|||
* All data changes to PPlayers such as group or fixed effect changes must be done through here,
|
||||
* rather than directly on the PPlayer object
|
||||
*/
|
||||
public class DataManager { // @formatter:off
|
||||
public class DataManager {
|
||||
|
||||
/**
|
||||
* The disabled worlds cached for quick access
|
||||
|
@ -53,7 +53,9 @@ public class DataManager { // @formatter:off
|
|||
/**
|
||||
* This is not instantiable
|
||||
*/
|
||||
private DataManager() { }
|
||||
private DataManager() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a PPlayer from cache
|
||||
|
@ -65,8 +67,7 @@ public class DataManager { // @formatter:off
|
|||
*/
|
||||
public static PPlayer getPPlayer(UUID playerUUID) {
|
||||
for (PPlayer pp : ParticleManager.particlePlayers)
|
||||
if (pp.getUniqueId() == playerUUID)
|
||||
return pp;
|
||||
if (pp.getUniqueId() == playerUUID) return pp;
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -90,9 +91,9 @@ public class DataManager { // @formatter:off
|
|||
|
||||
PlayerParticles.databaseConnector.connect((connection) -> {
|
||||
// Load particle groups
|
||||
String groupQuery = "SELECT * FROM pp_group g " +
|
||||
String groupQuery = "SELECT * FROM pp_group g " + // @formatter:off
|
||||
"JOIN pp_particle p ON g.uuid = p.group_uuid " +
|
||||
"WHERE g.owner_uuid = ?";
|
||||
"WHERE g.owner_uuid = ?"; // @formatter:on
|
||||
try (PreparedStatement statement = connection.prepareStatement(groupQuery)) {
|
||||
statement.setString(1, playerUUID.toString());
|
||||
|
||||
|
@ -132,9 +133,9 @@ public class DataManager { // @formatter:off
|
|||
}
|
||||
|
||||
// Load fixed effects
|
||||
String fixedQuery = "SELECT f.id AS f_id, f.world, f.xPos, f.yPos, f.zPos, p.id AS p_id, p.effect, p.style, p.item_material, p.block_material, p.note, p.r, p.g, p.b FROM pp_fixed f " +
|
||||
String fixedQuery = "SELECT f.id AS f_id, f.world, f.xPos, f.yPos, f.zPos, p.id AS p_id, p.effect, p.style, p.item_material, p.block_material, p.note, p.r, p.g, p.b FROM pp_fixed f " + // @formatter:off
|
||||
"JOIN pp_particle p ON f.particle_uuid = p.uuid " +
|
||||
"WHERE f.owner_uuid = ?";
|
||||
"WHERE f.owner_uuid = ?"; // @formatter:on
|
||||
try (PreparedStatement statement = connection.prepareStatement(fixedQuery)) {
|
||||
statement.setString(1, playerUUID.toString());
|
||||
|
||||
|
@ -392,8 +393,7 @@ public class DataManager { // @formatter:off
|
|||
maxFixedEffects = PlayerParticles.getPlugin().getConfig().getInt("max-fixed-effects");
|
||||
}
|
||||
|
||||
if (pplayer.getPlayer().hasPermission("playerparticles.fixed.unlimited"))
|
||||
return false;
|
||||
if (pplayer.getPlayer().hasPermission("playerparticles.fixed.unlimited")) return false;
|
||||
return pplayer.getFixedEffectIds().size() >= maxFixedEffects;
|
||||
}
|
||||
|
||||
|
@ -471,4 +471,4 @@ public class DataManager { // @formatter:off
|
|||
public void execute(T obj);
|
||||
}
|
||||
|
||||
} // @formatter:on
|
||||
}
|
||||
|
|
|
@ -166,7 +166,7 @@ public class LangManager {
|
|||
* @return The message
|
||||
*/
|
||||
public String get(String... replacements) {
|
||||
return String.format(this.message, (Object[])replacements);
|
||||
return String.format(this.message, (Object[]) replacements);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -54,7 +54,8 @@ public class ParticleManager extends BukkitRunnable implements Listener {
|
|||
*/
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onPlayerJoin(PlayerJoinEvent e) {
|
||||
DataManager.getPPlayer(e.getPlayer().getUniqueId(), (pplayer) -> {}); // Loads the PPlayer from the database
|
||||
DataManager.getPPlayer(e.getPlayer().getUniqueId(), (pplayer) -> {
|
||||
}); // Loads the PPlayer from the database
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -65,8 +66,7 @@ public class ParticleManager extends BukkitRunnable implements Listener {
|
|||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onPlayerQuit(PlayerQuitEvent e) {
|
||||
PPlayer pplayer = DataManager.getPPlayer(e.getPlayer().getUniqueId());
|
||||
if (pplayer != null)
|
||||
particlePlayers.remove(pplayer);
|
||||
if (pplayer != null) particlePlayers.remove(pplayer);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -84,7 +84,8 @@ public class ParticleManager extends BukkitRunnable implements Listener {
|
|||
public static void refreshPPlayers() {
|
||||
particlePlayers.clear();
|
||||
for (Player player : Bukkit.getOnlinePlayers())
|
||||
DataManager.getPPlayer(player.getUniqueId(), (pplayer) -> {}); // Loads the PPlayer from the database
|
||||
DataManager.getPPlayer(player.getUniqueId(), (pplayer) -> {
|
||||
}); // Loads the PPlayer from the database
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -148,8 +149,7 @@ public class ParticleManager extends BukkitRunnable implements Listener {
|
|||
// Loop for FixedParticleEffects
|
||||
// Don't spawn particles if the world doesn't allow it
|
||||
for (FixedParticleEffect effect : pplayer.getFixedParticles())
|
||||
if (!DataManager.isWorldDisabled(effect.getLocation().getWorld().getName()))
|
||||
displayFixedParticleEffect(effect);
|
||||
if (!DataManager.isWorldDisabled(effect.getLocation().getWorld().getName())) displayFixedParticleEffect(effect);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -83,8 +83,7 @@ public class PPlayer {
|
|||
*/
|
||||
public ParticleGroup getParticlesByName(String name) {
|
||||
for (ParticleGroup group : this.particleGroups)
|
||||
if (group.getName().equalsIgnoreCase(name))
|
||||
return group;
|
||||
if (group.getName().equalsIgnoreCase(name)) return group;
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -95,8 +94,7 @@ public class PPlayer {
|
|||
*/
|
||||
public List<ParticlePair> getActiveParticles() {
|
||||
for (ParticleGroup group : this.particleGroups)
|
||||
if (group.getName() == null)
|
||||
return group.getParticles();
|
||||
if (group.getName() == null) return group.getParticles();
|
||||
return null; // This should never return null, there will always be at least one ParticleGroup
|
||||
}
|
||||
|
||||
|
@ -109,8 +107,7 @@ public class PPlayer {
|
|||
public List<ParticlePair> getActiveParticlesForStyle(ParticleStyle style) {
|
||||
List<ParticlePair> matches = new ArrayList<ParticlePair>();
|
||||
for (ParticlePair pair : this.getActiveParticles())
|
||||
if (pair.getStyle().equals(style))
|
||||
matches.add(pair);
|
||||
if (pair.getStyle().equals(style)) matches.add(pair);
|
||||
return matches;
|
||||
}
|
||||
|
||||
|
@ -122,8 +119,7 @@ public class PPlayer {
|
|||
*/
|
||||
public ParticlePair getActiveParticle(int id) {
|
||||
for (ParticlePair particle : this.getActiveParticles())
|
||||
if (particle.getId() == id)
|
||||
return particle;
|
||||
if (particle.getId() == id) return particle;
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -144,8 +140,7 @@ public class PPlayer {
|
|||
*/
|
||||
public FixedParticleEffect getFixedEffectById(int id) {
|
||||
for (FixedParticleEffect fixedEffect : this.fixedParticles)
|
||||
if (fixedEffect.getId() == id)
|
||||
return fixedEffect;
|
||||
if (fixedEffect.getId() == id) return fixedEffect;
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -177,8 +172,7 @@ public class PPlayer {
|
|||
*/
|
||||
public void removeFixedEffect(int id) {
|
||||
for (int i = this.fixedParticles.size() - 1; i >= 0; i--)
|
||||
if (this.fixedParticles.get(i).getId() == id)
|
||||
this.fixedParticles.remove(i);
|
||||
if (this.fixedParticles.get(i).getId() == id) this.fixedParticles.remove(i);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -47,7 +47,7 @@ public enum ParticleEffect {
|
|||
DRIPPING_LAVA("DRIP_LAVA", "DRIP_LAVA"),
|
||||
DRIPPING_WATER("DRIP_WATER", "DRIP_WATER"),
|
||||
DUST("REDSTONE", "REDSTONE", ParticleProperty.COLORABLE),
|
||||
//ELDER_GUARDIAN("MOB_APPEARANCE", "MOB_APPEARANCE"), // No thank you
|
||||
// ELDER_GUARDIAN("MOB_APPEARANCE", "MOB_APPEARANCE"), // No thank you
|
||||
ENCHANT("ENCHANTMENT_TABLE", "ENCHANTMENT_TABLE"),
|
||||
ENCHANTED_HIT("CRIT_MAGIC", "CRIT_MAGIC"),
|
||||
END_ROD("END_ROD", "END_ROD"),
|
||||
|
@ -231,11 +231,13 @@ public enum ParticleEffect {
|
|||
}
|
||||
|
||||
if (this == DUST && VERSION_13) { // DUST uses a special data object for spawning in 1.13
|
||||
OrdinaryColor dustColor = (OrdinaryColor)color;
|
||||
OrdinaryColor dustColor = (OrdinaryColor) color;
|
||||
Object dustData = null;
|
||||
try { // The DustData class doesn't exist in Minecraft versions less than 1.13... so this is disgusting... but it works great
|
||||
dustData = DustOptions_CONSTRUCTOR.newInstance(Color.fromRGB(dustColor.getRed(), dustColor.getGreen(), dustColor.getBlue()), 1); // Wait, you can change the size of these now??? AWESOME! I might implement this in the future!
|
||||
} catch (Exception e) { }
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
|
||||
for (Player player : getPlayersInRange(center)) {
|
||||
player.spawnParticle(internalEnum, center.getX(), center.getY(), center.getZ(), 1, 0, 0, 0, 0, dustData);
|
||||
|
@ -271,7 +273,9 @@ public enum ParticleEffect {
|
|||
if (internalEnum.getDataType().getTypeName().equals("org.bukkit.block.data.BlockData")) {
|
||||
try { // The Material.createBlockData() method doesn't exist in Minecraft versions less than 1.13... so this is disgusting... but it works great
|
||||
extraData = createBlockData_METHOD.invoke(spawnMaterial);
|
||||
} catch (Exception e) { }
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
} else if (internalEnum.getDataType() == ItemStack.class) {
|
||||
extraData = new ItemStack(spawnMaterial);
|
||||
} else if (internalEnum.getDataType() == MaterialData.class) {
|
||||
|
|
|
@ -11,7 +11,7 @@ import com.esophose.playerparticles.styles.api.ParticleStyle;
|
|||
|
||||
public class ParticleStyleSpiral implements ParticleStyle {
|
||||
|
||||
private float stepX = 0;
|
||||
private int stepX = 0;
|
||||
|
||||
public List<PParticle> getParticles(ParticlePair particle, Location location) {
|
||||
List<PParticle> particles = new ArrayList<PParticle>();
|
||||
|
|
|
@ -46,11 +46,9 @@ public class ParticleUtils {
|
|||
Material mat = null;
|
||||
for (String name : input) {
|
||||
mat = closestMatch(name);
|
||||
if (mat != null)
|
||||
return mat;
|
||||
if (mat != null) return mat;
|
||||
}
|
||||
if (mat == null)
|
||||
mat = Material.BARRIER;
|
||||
if (mat == null) mat = Material.BARRIER;
|
||||
return mat;
|
||||
}
|
||||
|
||||
|
@ -86,7 +84,8 @@ public class ParticleUtils {
|
|||
}
|
||||
}
|
||||
for (int i = 0; i < n.length; ++i)
|
||||
if (n[i] != i + 1) return i + 1;
|
||||
if (n[i] != i + 1)
|
||||
return i + 1;
|
||||
return n.length + 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue