adding new stuff

This commit is contained in:
Naman
2018-03-26 16:43:15 -05:00
parent 382f4c4b0c
commit 44b3de91dd
84 changed files with 1830 additions and 481 deletions

View File

@@ -1,5 +1,6 @@
package com.massivecraft.factions.cmd;
import com.darkblade12.particleeffect.ParticleEffect;
import com.massivecraft.factions.FLocation;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.util.VisualizeUtil;
@@ -9,8 +10,14 @@ import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.entity.Player;
import java.util.logging.Level;
public class CmdSeeChunk extends FCommand {
private boolean useParticles;
private int length;
private ParticleEffect effect;
public CmdSeeChunk() {
super();
aliases.add("seechunk");
@@ -22,6 +29,16 @@ public class CmdSeeChunk extends FCommand {
senderMustBeMember = false;
senderMustBeModerator = false;
senderMustBeAdmin = false;
this.useParticles = p.getConfig().getBoolean("see-chunk.particles", true);
this.length = p.getConfig().getInt("see-chunk.length", 10);
String effectName = p.getConfig().getString("see-chunk.particle", "BARRIER");
this.effect = ParticleEffect.fromName(effectName.toUpperCase());
if (this.effect == null) {
this.effect = ParticleEffect.BARRIER;
}
p.log(Level.INFO, "Using %s as the ParticleEffect for /f sc", effect.getName());
}
@Override
@@ -51,15 +68,19 @@ public class CmdSeeChunk extends FCommand {
showPillar(me, world, blockX, blockZ);
}
@SuppressWarnings("deprecation")
public static void showPillar(Player player, World world, int blockX, int blockZ) {
private void showPillar(Player player, World world, int blockX, int blockZ) {
for (int blockY = 0; blockY < player.getLocation().getBlockY() + 30; blockY++) {
Location loc = new Location(world, blockX, blockY, blockZ);
if (loc.getBlock().getType() != Material.AIR) {
continue;
}
int typeId = blockY % 5 == 0 ? Material.REDSTONE_LAMP_ON.getId() : Material.STAINED_GLASS.getId();
VisualizeUtil.addLocation(player, loc, typeId);
if (useParticles) {
this.effect.display(0, 0, 0, 10, 1, loc, player);
} else {
int typeId = blockY % 5 == 0 ? Material.REDSTONE_LAMP_ON.getId() : Material.STAINED_GLASS.getId();
VisualizeUtil.addLocation(player, loc, typeId);
}
}
}
@@ -68,4 +89,4 @@ public class CmdSeeChunk extends FCommand {
return TL.GENERIC_PLACEHOLDER;
}
}
}