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"?>
<classpath>
<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="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/GriefPrevention.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/TagAPI.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/WorldGuard.jar"/>

Binary file not shown.

View file

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

View file

@ -1,7 +1,6 @@
package com.projectkorra.ProjectKorra;
import java.util.ArrayList;
import java.util.concurrent.ConcurrentHashMap;
import java.util.HashMap;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
@ -67,9 +66,7 @@ public class BendingManager implements Runnable {
long time;
long interval;
ArrayList<World> worlds = new ArrayList<World>();
ConcurrentHashMap<World, Boolean> nights = new ConcurrentHashMap<World, Boolean>();
ConcurrentHashMap<World, Boolean> days = new ConcurrentHashMap<World, Boolean>();
private final HashMap<String, Time> dayNight = new HashMap<>();
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.";
@ -209,65 +206,104 @@ public class BendingManager implements Runnable {
}
public void handleDayNight() {
/**
* This code is ran on startup, it adds all loaded worlds to the
* hashmap.
*/
if (dayNight.size() < 1) {
for (World world : plugin.getServer().getWorlds()) {
if (world.getWorldType() == WorldType.NORMAL && !worlds.contains(world)) {
worlds.add(world);
nights.put(world, false);
days.put(world, false);
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()) {
final String worldName = world.getName();
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")) {
if (Methods.isBender(player.getName(), Element.Fire)
&& player.hasPermission("bending.message.daymessage")) {
player.sendMessage(ChatColor.RED + defaultsunrisemessage);
}
}
days.replace(world, true);
}
if (!Methods.isDay(world) && day) {
} else {
for (Player player : world.getPlayers()) {
if (Methods.isBender(player.getName(), Element.Fire) && player.hasPermission("bending.message.daymessage")) {
if (Methods.isBender(player.getName(), Element.Fire)
&& player.hasPermission("bending.message.daymessage")) {
player.sendMessage(ChatColor.RED + defaultsunsetmessage);
}
}
days.replace(world, false);
}
}
if (Methods.isNight(world) && !night) {
private void sendWaterbenderMessage(World world, Time time) {
if (time.equals(Time.NIGHT)) {
for (Player player : world.getPlayers()) {
if (Methods.isBender(player.getName(), Element.Water) && player.hasPermission("bending.message.nightmessage")) {
if (Methods.isBender(player.getName(), Element.Water)
&& player.hasPermission("bending.message.nightmessage")) {
if (Methods.isFullMoon(world)) {
player.sendMessage(ChatColor.AQUA + defaultfullmoonrisemessage);
player.sendMessage(ChatColor.AQUA
+ defaultfullmoonrisemessage);
} else {
player.sendMessage(ChatColor.AQUA + defaultmoonrisemessage);
player.sendMessage(ChatColor.AQUA
+ defaultmoonrisemessage);
}
}
}
nights.replace(world, true);
}
if (!Methods.isNight(world) && night) {
} else {
for (Player player : world.getPlayers()) {
if (Methods.isBender(player.getName(), Element.Water) && player.hasPermission("bending.message.nightmessage")) {
if (Methods.isBender(player.getName(), Element.Water)
&& player.hasPermission("bending.message.nightmessage")) {
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)) {
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.canMetalbend(p)) {
@ -540,9 +546,28 @@ public class Commands {
s.sendMessage("Abilities: ");
for (int i = 1; i <= 9; 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;
}
if (args.length == 1) {

View file

@ -68,6 +68,7 @@ public class ConfigManager {
config.addDefault("Properties.Water.CanBendWithWeapons", true);
config.addDefault("Properties.Water.NightFactor", 1.5);
config.addDefault("Properties.Water.FullMoonFactor", 3.0);
config.addDefault("Properties.Water.CanBendPackedIce", true);
config.addDefault("Properties.Earth.RevertEarthbending", 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.ProjectKorra;
import com.projectkorra.ProjectKorra.Ability.AvatarState;
import com.projectkorra.ProjectKorra.Utilities.ParticleEffect;
public class AirBlast {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -3,7 +3,6 @@ package com.projectkorra.ProjectKorra.airbending;
import java.util.ArrayList;
import java.util.concurrent.ConcurrentHashMap;
import org.bukkit.Effect;
import org.bukkit.Location;
import org.bukkit.Material;
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.util.Vector;
import com.projectkorra.ProjectKorra.BendingPlayer;
import com.projectkorra.ProjectKorra.Methods;
import com.projectkorra.ProjectKorra.ProjectKorra;
import com.projectkorra.ProjectKorra.Ability.AvatarState;

View file

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

View file

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