mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2024-09-11 04:39:32 +00:00
Fix FireStream Stuff
Dissipate correctly, etc.
This commit is contained in:
parent
937ff63bc6
commit
8e6c55b455
|
@ -5,14 +5,17 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.Material;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.WorldType;
|
import org.bukkit.WorldType;
|
||||||
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.projectkorra.ProjectKorra.airbending.AirPassive;
|
import com.projectkorra.ProjectKorra.airbending.AirPassive;
|
||||||
import com.projectkorra.ProjectKorra.chiblocking.ChiPassive;
|
import com.projectkorra.ProjectKorra.chiblocking.ChiPassive;
|
||||||
import com.projectkorra.ProjectKorra.earthbending.EarthPassive;
|
import com.projectkorra.ProjectKorra.earthbending.EarthPassive;
|
||||||
import com.projectkorra.ProjectKorra.firebending.FirePassive;
|
import com.projectkorra.ProjectKorra.firebending.FirePassive;
|
||||||
|
import com.projectkorra.ProjectKorra.firebending.FireStream;
|
||||||
import com.projectkorra.ProjectKorra.waterbending.Plantbending;
|
import com.projectkorra.ProjectKorra.waterbending.Plantbending;
|
||||||
import com.projectkorra.ProjectKorra.waterbending.WaterPassive;
|
import com.projectkorra.ProjectKorra.waterbending.WaterPassive;
|
||||||
|
|
||||||
|
@ -42,6 +45,18 @@ public class BendingManager implements Runnable {
|
||||||
EarthPassive.revertSands();
|
EarthPassive.revertSands();
|
||||||
Plantbending.regrow();
|
Plantbending.regrow();
|
||||||
handleDayNight();
|
handleDayNight();
|
||||||
|
|
||||||
|
for (int id: FireStream.instances.keySet()) {
|
||||||
|
FireStream.progress(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Block block: FireStream.ignitedblocks.keySet()) {
|
||||||
|
if (block.getType() != Material.FIRE) {
|
||||||
|
FireStream.ignitedblocks.remove(block);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FireStream.dissipateAll();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Methods.stopBending();
|
Methods.stopBending();
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.projectkorra.ProjectKorra;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -252,6 +253,7 @@ public class Commands {
|
||||||
s.sendMessage(ChatColor.GOLD + "There are no chiblocking abilities available.");
|
s.sendMessage(ChatColor.GOLD + "There are no chiblocking abilities available.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (String st: AbilityModuleManager.chiabilities) {
|
for (String st: AbilityModuleManager.chiabilities) {
|
||||||
s.sendMessage(ChatColor.GOLD + st);
|
s.sendMessage(ChatColor.GOLD + st);
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,10 +61,6 @@ public class FireStream {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean progress() {
|
public boolean progress() {
|
||||||
// if (Tools.isRegionProtectedFromBuild(player, Abilities.Blaze, location)) {
|
|
||||||
// remove();
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
if (System.currentTimeMillis() - time >= interval) {
|
if (System.currentTimeMillis() - time >= interval) {
|
||||||
location = location.clone().add(direction);
|
location = location.clone().add(direction);
|
||||||
time = System.currentTimeMillis();
|
time = System.currentTimeMillis();
|
||||||
|
@ -97,15 +93,13 @@ public class FireStream {
|
||||||
if (Methods.isPlant(block)) {
|
if (Methods.isPlant(block)) {
|
||||||
new Plantbending(block);
|
new Plantbending(block);
|
||||||
}
|
}
|
||||||
|
|
||||||
block.setType(Material.FIRE);
|
block.setType(Material.FIRE);
|
||||||
ignitedblocks.put(block, this.player);
|
ignitedblocks.put(block, this.player);
|
||||||
ignitedtimes.put(block, System.currentTimeMillis());
|
ignitedtimes.put(block, System.currentTimeMillis());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isIgnitable(Player player, Block block) {
|
public static boolean isIgnitable(Player player, Block block) {
|
||||||
// if (Tools.isRegionProtectedFromBuild(player, Abilities.Blaze,
|
|
||||||
// block.getLocation()))
|
|
||||||
// return false;
|
|
||||||
|
|
||||||
Material[] overwriteable = { Material.SAPLING, Material.LONG_GRASS,
|
Material[] overwriteable = { Material.SAPLING, Material.LONG_GRASS,
|
||||||
Material.DEAD_BUSH, Material.YELLOW_FLOWER, Material.RED_ROSE,
|
Material.DEAD_BUSH, Material.YELLOW_FLOWER, Material.RED_ROSE,
|
||||||
|
|
Loading…
Reference in a new issue