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