General Cleanup and Bugfix
This commit is contained in:
parent
ce1c84a8ef
commit
3d1694b75c
2 changed files with 14 additions and 14 deletions
|
@ -29,23 +29,23 @@ public class gPowerApplyingTask extends BukkitRunnable{
|
|||
|
||||
private void activatePower(Player player, String colour) {
|
||||
if ((colour.startsWith("grey") || colour.startsWith("gra")) && (player.getWorld().getTime() > 12575 && player.getWorld().getTime() < 22925)){
|
||||
player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 100, 1, true, false, Color.GRAY));
|
||||
player.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, 100, 1, true, false, Color.GRAY));
|
||||
player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 200, 0, true, false, Color.GRAY));
|
||||
player.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, 300, 0, true, false, Color.GRAY));
|
||||
}else if (colour.startsWith("r")){
|
||||
player.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 100, 1, true, false, Color.GRAY));
|
||||
player.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 200, 0, true, false, Color.RED));
|
||||
}else if (colour.startsWith("o")){
|
||||
player.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, 100, 1, true, false, Color.GRAY));
|
||||
player.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 100, 1, true, false, Color.GRAY));
|
||||
}else if (colour.startsWith("y") && player.getLocation().getBlock().getLightFromSky() == 15){
|
||||
player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 100, 1, true, false, Color.GRAY));
|
||||
}else if (colour.startsWith("g")){
|
||||
player.addPotionEffect(new PotionEffect(PotionEffectType.LUCK, 100, 1, true, false, Color.GRAY));
|
||||
player.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, 100, 1, true, false, Color.GRAY));
|
||||
player.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, 200, 0, true, false, Color.ORANGE));
|
||||
player.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 200, 0, true, false, Color.ORANGE));
|
||||
}else if (colour.startsWith("y") && player.getLocation().getBlock().getLightFromSky() == 15 && player.getLocation().getBlock().getLightFromBlocks() == 15){
|
||||
player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 200, 0, true, false, Color.YELLOW));
|
||||
}else if (colour.startsWith("g") && !colour.startsWith("gra") && !colour.startsWith("grey")){
|
||||
player.addPotionEffect(new PotionEffect(PotionEffectType.LUCK, 200, 1, true, false, Color.GREEN));
|
||||
player.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, 200, 0, true, false, Color.GREEN));
|
||||
}else if (colour.startsWith("b")){
|
||||
player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 100, 1, true, false, Color.GRAY));
|
||||
player.addPotionEffect(new PotionEffect(PotionEffectType.WATER_BREATHING, 100, 1, true, false, Color.GRAY));
|
||||
player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 200, 1, true, false, Color.BLUE));
|
||||
player.addPotionEffect(new PotionEffect(PotionEffectType.WATER_BREATHING, 200, 0, true, false, Color.BLUE));
|
||||
}else if (colour.startsWith("p")){
|
||||
player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, 100, 1, true, false, Color.GRAY));
|
||||
player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, 200, 0, true, false, Color.PURPLE));
|
||||
}else{
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ public class gPowerListener implements Listener{
|
|||
public gPowerListener(AliPresents plugin){
|
||||
this.plugin = plugin;
|
||||
this.powerApplyingTask = new gPowerApplyingTask(this.plugin);
|
||||
bukkitTask = powerApplyingTask.runTaskTimer(plugin, 100, 100);
|
||||
bukkitTask = powerApplyingTask.runTaskTimer(plugin, 190, 190);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue