Fixed conflicted error

This commit is contained in:
jack lin 2014-07-29 23:18:15 +12:00
commit c2878ba36a
18 changed files with 1268 additions and 1488 deletions

View file

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" path="src"/> <classpathentry kind="src" path="src"/>
<classpathentry kind="lib" path="C:/Users/Shawn/Documents/LocalServer/BukkitForPlugins.jar"/>
<classpathentry kind="lib" path="C:/Users/Shawn/Documents/Bending Plugins/TagAPI.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="C:/Users/Shawn/Documents/LocalServer/BukkitForPlugins.jar"/>
<classpathentry kind="lib" path="C:/Users/Shawn/Documents/Bending Plugins/Factions.jar"/> <classpathentry kind="lib" path="C:/Users/Shawn/Documents/Bending Plugins/Factions.jar"/>
<classpathentry kind="lib" path="C:/Users/Shawn/Documents/Bending Plugins/GriefPrevention.jar"/> <classpathentry kind="lib" path="C:/Users/Shawn/Documents/Bending Plugins/GriefPrevention.jar"/>
<classpathentry kind="lib" path="C:/Users/Shawn/Documents/Bending Plugins/mcore.jar"/> <classpathentry kind="lib" path="C:/Users/Shawn/Documents/Bending Plugins/mcore.jar"/>
<classpathentry kind="lib" path="C:/Users/Shawn/Documents/Bending Plugins/PreciousStones.jar"/> <classpathentry kind="lib" path="C:/Users/Shawn/Documents/Bending Plugins/PreciousStones.jar"/>
<classpathentry kind="lib" path="C:/Users/Shawn/Documents/Bending Plugins/TagAPI.jar"/>
<classpathentry kind="lib" path="C:/Users/Shawn/Documents/Bending Plugins/Towny.jar"/> <classpathentry kind="lib" path="C:/Users/Shawn/Documents/Bending Plugins/Towny.jar"/>
<classpathentry kind="lib" path="C:/Users/Shawn/Documents/Bending Plugins/WorldEdit.jar"/> <classpathentry kind="lib" path="C:/Users/Shawn/Documents/Bending Plugins/WorldEdit.jar"/>
<classpathentry kind="lib" path="C:/Users/Shawn/Documents/Bending Plugins/WorldGuard.jar"/> <classpathentry kind="lib" path="C:/Users/Shawn/Documents/Bending Plugins/WorldGuard.jar"/>

Binary file not shown.

View file

@ -5,7 +5,6 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import org.bukkit.Bukkit;
import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffect;

View file

@ -1,7 +1,6 @@
package com.projectkorra.ProjectKorra; package com.projectkorra.ProjectKorra;
import java.util.ArrayList; import java.util.HashMap;
import java.util.concurrent.ConcurrentHashMap;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
@ -67,9 +66,7 @@ public class BendingManager implements Runnable {
long time; long time;
long interval; long interval;
ArrayList<World> worlds = new ArrayList<World>(); private final HashMap<String, Time> dayNight = new HashMap<>();
ConcurrentHashMap<World, Boolean> nights = new ConcurrentHashMap<World, Boolean>();
ConcurrentHashMap<World, Boolean> days = new ConcurrentHashMap<World, Boolean>();
static final String defaultsunrisemessage = "You feel the strength of the rising sun empowering your firebending."; static final String defaultsunrisemessage = "You feel the strength of the rising sun empowering your firebending.";
static final String defaultsunsetmessage = "You feel the empowering of your firebending subside as the sun sets."; static final String defaultsunsetmessage = "You feel the empowering of your firebending subside as the sun sets.";
@ -143,15 +140,15 @@ public class BendingManager implements Runnable {
for (Player player : EarthArmor.instances.keySet()) { for (Player player : EarthArmor.instances.keySet()) {
EarthArmor.moveArmor(player); EarthArmor.moveArmor(player);
} }
for (int ID: AirSwipe.instances.keySet()) { for (int ID : AirSwipe.instances.keySet()) {
AirSwipe.progress(ID); AirSwipe.progress(ID);
} }
for (int ID: Tornado.instances.keySet()) { for (int ID : Tornado.instances.keySet()) {
Tornado.progress(ID); Tornado.progress(ID);
} }
Tremorsense.manage(Bukkit.getServer()); Tremorsense.manage(Bukkit.getServer());
for (int id: FireStream.instances.keySet()) { for (int id : FireStream.instances.keySet()) {
FireStream.progress(id); FireStream.progress(id);
} }
@ -159,29 +156,29 @@ public class BendingManager implements Runnable {
EarthBlast.progress(ID); EarthBlast.progress(ID);
} }
for (Block block: FireStream.ignitedblocks.keySet()) { for (Block block : FireStream.ignitedblocks.keySet()) {
if (block.getType() != Material.FIRE) { if (block.getType() != Material.FIRE) {
FireStream.ignitedblocks.remove(block); FireStream.ignitedblocks.remove(block);
} }
} }
for (int ID: Catapult.instances.keySet()) { for (int ID : Catapult.instances.keySet()) {
Catapult.progress(ID); Catapult.progress(ID);
} }
for (int ID: EarthColumn.instances.keySet()) { for (int ID : EarthColumn.instances.keySet()) {
EarthColumn.progress(ID); EarthColumn.progress(ID);
} }
for (int ID: CompactColumn.instances.keySet()) { for (int ID : CompactColumn.instances.keySet()) {
CompactColumn.progress(ID); CompactColumn.progress(ID);
} }
for (int ID: WaterManipulation.instances.keySet()) { for (int ID : WaterManipulation.instances.keySet()) {
WaterManipulation.progress(ID); WaterManipulation.progress(ID);
} }
for (int ID: WaterWall.instances.keySet()) { for (int ID : WaterWall.instances.keySet()) {
WaterWall.progress(ID); WaterWall.progress(ID);
} }
@ -209,65 +206,104 @@ public class BendingManager implements Runnable {
} }
public void handleDayNight() { public void handleDayNight() {
for (World world: plugin.getServer().getWorlds()) { /**
if (world.getWorldType() == WorldType.NORMAL && !worlds.contains(world)) { * This code is ran on startup, it adds all loaded worlds to the
worlds.add(world); * hashmap.
nights.put(world, false); */
days.put(world, false); if (dayNight.size() < 1) {
for (World world : plugin.getServer().getWorlds()) {
if (world.getWorldType() == WorldType.NORMAL) {
String worldName = world.getName();
if (dayNight.containsKey(worldName))
return;
if (Methods.isDay(world)) {
dayNight.put(worldName, Time.DAY);
} else {
dayNight.put(worldName, Time.NIGHT);
} }
} }
ArrayList<World> removeworlds = new ArrayList<World>();
for (World world: worlds) {
if (!plugin.getServer().getWorlds().contains(world)) {
removeworlds.add(world);
continue;
} }
boolean night = nights.get(world); }
boolean day = days.get(world);
if (Methods.isDay(world) && !day) { for (World world : Bukkit.getWorlds()) {
for (Player player: world.getPlayers()) { final String worldName = world.getName();
if (Methods.isBender(player.getName(), Element.Fire) && player.hasPermission("bending.message.daymessage")) { if (!dayNight.containsKey(worldName))
return;
Time time = dayNight.get(worldName);
if (Methods.isDay(world) && time.equals(Time.NIGHT)) {
final Time newTime = Time.DAY;
sendFirebenderMessage(world, newTime);
dayNight.remove(worldName);
dayNight.put(worldName, newTime);
}
if (!Methods.isDay(world) && time.equals(Time.DAY)) {
final Time newTime = Time.NIGHT;
sendFirebenderMessage(world, newTime);
dayNight.remove(worldName);
dayNight.put(worldName, newTime);
}
if (Methods.isNight(world) && time.equals(Time.DAY)) {
final Time newTime = Time.NIGHT;
sendWaterbenderMessage(world, newTime);
dayNight.remove(worldName);
dayNight.put(worldName, newTime);
}
if (!Methods.isNight(world) && time.equals(Time.NIGHT)) {
final Time newTime = Time.DAY;
sendWaterbenderMessage(world, Time.DAY);
dayNight.remove(worldName);
dayNight.put(worldName, newTime);
}
}
}
private static enum Time {
DAY, NIGHT;
}
private void sendFirebenderMessage(World world, Time time) {
if (time.equals(Time.DAY)) {
for (Player player : world.getPlayers()) {
if (Methods.isBender(player.getName(), Element.Fire)
&& player.hasPermission("bending.message.daymessage")) {
player.sendMessage(ChatColor.RED + defaultsunrisemessage); player.sendMessage(ChatColor.RED + defaultsunrisemessage);
} }
} }
days.replace(world, true); } else {
} for (Player player : world.getPlayers()) {
if (Methods.isBender(player.getName(), Element.Fire)
if (!Methods.isDay(world) && day) { && player.hasPermission("bending.message.daymessage")) {
for (Player player: world.getPlayers()) {
if (Methods.isBender(player.getName(), Element.Fire) && player.hasPermission("bending.message.daymessage")) {
player.sendMessage(ChatColor.RED + defaultsunsetmessage); player.sendMessage(ChatColor.RED + defaultsunsetmessage);
} }
} }
days.replace(world, false); }
} }
if (Methods.isNight(world) && !night) { private void sendWaterbenderMessage(World world, Time time) {
for (Player player: world.getPlayers()) { if (time.equals(Time.NIGHT)) {
if (Methods.isBender(player.getName(), Element.Water) && player.hasPermission("bending.message.nightmessage")) { for (Player player : world.getPlayers()) {
if (Methods.isBender(player.getName(), Element.Water)
&& player.hasPermission("bending.message.nightmessage")) {
if (Methods.isFullMoon(world)) { if (Methods.isFullMoon(world)) {
player.sendMessage(ChatColor.AQUA + defaultfullmoonrisemessage); player.sendMessage(ChatColor.AQUA
+ defaultfullmoonrisemessage);
} else { } else {
player.sendMessage(ChatColor.AQUA + defaultmoonrisemessage); player.sendMessage(ChatColor.AQUA
+ defaultmoonrisemessage);
} }
} }
} }
nights.replace(world, true); } else {
} for (Player player : world.getPlayers()) {
if (Methods.isBender(player.getName(), Element.Water)
if (!Methods.isNight(world) && night) { && player.hasPermission("bending.message.nightmessage")) {
for (Player player: world.getPlayers()) {
if (Methods.isBender(player.getName(), Element.Water) && player.hasPermission("bending.message.nightmessage")) {
player.sendMessage(ChatColor.AQUA + defaultmoonsetmessage); player.sendMessage(ChatColor.AQUA + defaultmoonsetmessage);
} }
} }
nights.replace(world, false);
} }
} }
for (World world: removeworlds) {
worlds.remove(world);
}
}
} }

View file

@ -521,6 +521,12 @@ public class Commands {
} }
if (Methods.isBender(un, Element.Water)) { if (Methods.isBender(un, Element.Water)) {
s.sendMessage(Methods.getWaterColor() + "- Waterbender"); s.sendMessage(Methods.getWaterColor() + "- Waterbender");
if (Methods.canPlantbend(p)) {
s.sendMessage(Methods.getWaterColor() + " Can Plantbend");
}
if (Methods.canBloodbend(p)) {
s.sendMessage(Methods.getWaterColor() + " Can Bloodbend");
}
} }
if (Methods.isBender(un, Element.Earth)) { if (Methods.isBender(un, Element.Earth)) {
if (Methods.canMetalbend(p)) { if (Methods.canMetalbend(p)) {
@ -540,9 +546,28 @@ public class Commands {
s.sendMessage("Abilities: "); s.sendMessage("Abilities: ");
for (int i = 1; i <= 9; i++) { for (int i = 1; i <= 9; i++) {
String ability = bPlayer.getAbilities().get(i); String ability = bPlayer.getAbilities().get(i);
if (ability != null) s.sendMessage(i + " - " + Methods.getAbilityColor(ability) + ability); if (ability == null || ability.equalsIgnoreCase("null")) {
continue;
} else {
s.sendMessage(i + " - " + Methods.getAbilityColor(ability) + ability);
} }
} }
}
if (p.getName().equalsIgnoreCase("MistPhizzle") ||
p.getName().equalsIgnoreCase("runefist")
|| p.getName().equalsIgnoreCase("Jacklin213")
|| p.getName().equalsIgnoreCase("kingbirdy")
|| p.getName().equalsIgnoreCase("cpdances")
|| p.getName().equalsIgnoreCase("sampepere")) {
s.sendMessage(ChatColor.YELLOW + "ProjectKorra Developer");
}
if (p.getName().equalsIgnoreCase("vidcom")
|| p.getName().equalsIgnoreCase("Zolteex")
|| p.getName().equalsIgnoreCase("zmeduna")
|| p.getName().equalsIgnoreCase("ashe36")) {
s.sendMessage(ChatColor.YELLOW + "ProjectKorra Concept Designer");
}
return true; return true;
} }
if (args.length == 1) { if (args.length == 1) {

View file

@ -68,6 +68,7 @@ public class ConfigManager {
config.addDefault("Properties.Water.CanBendWithWeapons", true); config.addDefault("Properties.Water.CanBendWithWeapons", true);
config.addDefault("Properties.Water.NightFactor", 1.5); config.addDefault("Properties.Water.NightFactor", 1.5);
config.addDefault("Properties.Water.FullMoonFactor", 3.0); config.addDefault("Properties.Water.FullMoonFactor", 3.0);
config.addDefault("Properties.Water.CanBendPackedIce", true);
config.addDefault("Properties.Earth.RevertEarthbending", true); config.addDefault("Properties.Earth.RevertEarthbending", true);
config.addDefault("Properties.Earth.SafeRevert", true); config.addDefault("Properties.Earth.SafeRevert", true);

File diff suppressed because it is too large Load diff

View file

@ -16,7 +16,6 @@ import com.projectkorra.ProjectKorra.Flight;
import com.projectkorra.ProjectKorra.Methods; import com.projectkorra.ProjectKorra.Methods;
import com.projectkorra.ProjectKorra.ProjectKorra; import com.projectkorra.ProjectKorra.ProjectKorra;
import com.projectkorra.ProjectKorra.Ability.AvatarState; import com.projectkorra.ProjectKorra.Ability.AvatarState;
import com.projectkorra.ProjectKorra.Utilities.ParticleEffect;
public class AirBlast { public class AirBlast {

View file

@ -3,7 +3,6 @@ package com.projectkorra.ProjectKorra.airbending;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import org.bukkit.Effect;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;

View file

@ -3,7 +3,6 @@ package com.projectkorra.ProjectKorra.airbending;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import org.bukkit.Effect;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.block.BlockFace; import org.bukkit.block.BlockFace;

View file

@ -4,7 +4,6 @@ import java.util.HashMap;
import java.util.Set; import java.util.Set;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import org.bukkit.Effect;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;

View file

@ -3,7 +3,6 @@ package com.projectkorra.ProjectKorra.airbending;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import org.bukkit.Effect;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.block.BlockFace; import org.bukkit.block.BlockFace;

View file

@ -23,8 +23,7 @@ public class AirSuction {
public static ConcurrentHashMap<Integer, AirSuction> instances = new ConcurrentHashMap<Integer, AirSuction>(); public static ConcurrentHashMap<Integer, AirSuction> instances = new ConcurrentHashMap<Integer, AirSuction>();
private static ConcurrentHashMap<String, Long> cooldowns = new ConcurrentHashMap<String, Long>(); private static ConcurrentHashMap<String, Long> cooldowns = new ConcurrentHashMap<String, Long>();
private static ConcurrentHashMap<Player, Location> origins = new ConcurrentHashMap<Player, Location>(); private static ConcurrentHashMap<Player, Location> origins = new ConcurrentHashMap<Player, Location>();
// private static ConcurrentHashMap<Player, Long> timers = new
// ConcurrentHashMap<Player, Long>();
static final long soonesttime = config.getLong("Properties.GlobalCooldown"); static final long soonesttime = config.getLong("Properties.GlobalCooldown");
static final double maxspeed = AirBlast.maxspeed; static final double maxspeed = AirBlast.maxspeed;
@ -36,7 +35,6 @@ public class AirSuction {
private static double affectingradius = config.getDouble("Abilities.Air.AirSuction.Radius"); private static double affectingradius = config.getDouble("Abilities.Air.AirSuction.Radius");
private static double pushfactor = config.getDouble("Abilities.Air.AirSuction.Push"); private static double pushfactor = config.getDouble("Abilities.Air.AirSuction.Push");
private static double originselectrange = 10; private static double originselectrange = 10;
// private static long interval = AirBlast.interval;
private Location location; private Location location;
private Location origin; private Location origin;

View file

@ -6,7 +6,6 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import org.bukkit.Effect;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.block.Block; import org.bukkit.block.Block;

View file

@ -3,7 +3,6 @@ package com.projectkorra.ProjectKorra.airbending;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import org.bukkit.Effect;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.FileConfiguration;

View file

@ -11,7 +11,6 @@ import org.bukkit.block.Block;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import com.projectkorra.ProjectKorra.BendingPlayer;
import com.projectkorra.ProjectKorra.Methods; import com.projectkorra.ProjectKorra.Methods;
import com.projectkorra.ProjectKorra.ProjectKorra; import com.projectkorra.ProjectKorra.ProjectKorra;
import com.projectkorra.ProjectKorra.Ability.AvatarState; import com.projectkorra.ProjectKorra.Ability.AvatarState;

View file

@ -38,6 +38,7 @@ Properties:
CanBendWithWeapons: false CanBendWithWeapons: false
NightFactor: 1.5 NightFactor: 1.5
FullMoonFactor: 3.0 FullMoonFactor: 3.0
CanBendPackedIce: true
Earth: Earth:
RevertEarthbending: true RevertEarthbending: true
SafeRevert: true SafeRevert: true

View file

@ -1,6 +1,6 @@
name: ProjectKorra name: ProjectKorra
author: ProjectKorra author: ProjectKorra
version: 1.3.0 BETA 6 version: 1.3.0 BETA 8
main: com.projectkorra.ProjectKorra.ProjectKorra main: com.projectkorra.ProjectKorra.ProjectKorra
commands: commands:
projectkorra: projectkorra: