mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-20 15:14:35 +00:00
Merge remote-tracking branch 'origin/master'
Conflicts: .classpath src/com/projectkorra/ProjectKorra/RevertChecker.java
This commit is contained in:
commit
6737c255bf
5 changed files with 552 additions and 693 deletions
|
@ -1,6 +1,7 @@
|
||||||
<?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/BukkitForPlugins1.8.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/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"/>
|
||||||
|
@ -13,6 +14,5 @@
|
||||||
<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"/>
|
||||||
<classpathentry kind="lib" path="C:/Users/Shawn/Documents/LocalServer/plugins/KorraRPG.jar"/>
|
<classpathentry kind="lib" path="C:/Users/Shawn/Documents/LocalServer/plugins/KorraRPG.jar"/>
|
||||||
<classpathentry kind="lib" path="C:/Users/Shawn/Documents/LocalServer/BukkitForPlugins1.8.jar"/>
|
|
||||||
<classpathentry kind="output" path="bin"/>
|
<classpathentry kind="output" path="bin"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|
|
@ -75,6 +75,9 @@ import com.palmergames.bukkit.towny.object.WorldCoord;
|
||||||
import com.palmergames.bukkit.towny.utils.PlayerCacheUtil;
|
import com.palmergames.bukkit.towny.utils.PlayerCacheUtil;
|
||||||
import com.palmergames.bukkit.towny.war.flagwar.TownyWar;
|
import com.palmergames.bukkit.towny.war.flagwar.TownyWar;
|
||||||
import com.palmergames.bukkit.towny.war.flagwar.TownyWarConfig;
|
import com.palmergames.bukkit.towny.war.flagwar.TownyWarConfig;
|
||||||
|
import com.projectkorra.ProjectKorra.Element;
|
||||||
|
import com.projectkorra.ProjectKorra.Information;
|
||||||
|
import com.projectkorra.ProjectKorra.ProjectKorra;
|
||||||
import com.projectkorra.ProjectKorra.Ability.AbilityModule;
|
import com.projectkorra.ProjectKorra.Ability.AbilityModule;
|
||||||
import com.projectkorra.ProjectKorra.Ability.AbilityModuleManager;
|
import com.projectkorra.ProjectKorra.Ability.AbilityModuleManager;
|
||||||
import com.projectkorra.ProjectKorra.Ability.AvatarState;
|
import com.projectkorra.ProjectKorra.Ability.AvatarState;
|
||||||
|
@ -1444,7 +1447,7 @@ public class Methods {
|
||||||
if (gpp != null && respectGriefPrevention) {
|
if (gpp != null && respectGriefPrevention) {
|
||||||
Material type = player.getWorld().getBlockAt(location).getType();
|
Material type = player.getWorld().getBlockAt(location).getType();
|
||||||
if (type == null) type = Material.AIR;
|
if (type == null) type = Material.AIR;
|
||||||
String reason = GriefPrevention.instance.allowBuild(player, location, type);
|
String reason = GriefPrevention.instance.allowBuild(player, location, null);
|
||||||
|
|
||||||
if (ignite.contains(ability)) {
|
if (ignite.contains(ability)) {
|
||||||
|
|
||||||
|
@ -1734,6 +1737,16 @@ public class Methods {
|
||||||
return ParticleEffect.CLOUD;
|
return ParticleEffect.CLOUD;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Collection<Player> getPlayersAroundPoint(Location location, double distance) {
|
||||||
|
Collection<Player> players = new HashSet<Player>();
|
||||||
|
for (Player player: Bukkit.getOnlinePlayers()) {
|
||||||
|
if (player.getLocation().distance(location) <= distance) {
|
||||||
|
players.add(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return players;
|
||||||
|
}
|
||||||
|
|
||||||
public static void playAirbendingParticles(Location loc, int amount) {
|
public static void playAirbendingParticles(Location loc, int amount) {
|
||||||
playAirbendingParticles(loc, amount, (float) Math.random(), (float) Math.random(), (float) Math.random());
|
playAirbendingParticles(loc, amount, (float) Math.random(), (float) Math.random(), (float) Math.random());
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.projectkorra.ProjectKorra;
|
package com.projectkorra.ProjectKorra;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
|
@ -43,43 +44,34 @@ public class RevertChecker implements Runnable {
|
||||||
@Override
|
@Override
|
||||||
public ArrayList<Chunk> call() throws Exception {
|
public ArrayList<Chunk> call() throws Exception {
|
||||||
ArrayList<Chunk> chunks = new ArrayList<Chunk>();
|
ArrayList<Chunk> chunks = new ArrayList<Chunk>();
|
||||||
|
|
||||||
for (Player player : server.getOnlinePlayers()) {
|
for (Player player : server.getOnlinePlayers()) {
|
||||||
Chunk chunk = player.getLocation().getChunk();
|
Collection<? extends Player> players = server.getOnlinePlayers();
|
||||||
|
|
||||||
|
for (Player player2 : players) {
|
||||||
|
Chunk chunk = player2.getLocation().getChunk();
|
||||||
if (!chunks.contains(chunk))
|
if (!chunks.contains(chunk))
|
||||||
chunks.add(chunk);
|
chunks.add(chunk);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return chunks;
|
return chunks;
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void run() {
|
public void run() {
|
||||||
time = System.currentTimeMillis();
|
time = System.currentTimeMillis();
|
||||||
|
|
||||||
if (plugin.getConfig().getBoolean("Properties.Earth.RevertEarthbending")) {
|
if (plugin.getConfig().getBoolean("Properties.Earth.RevertEarthbending")) {
|
||||||
|
|
||||||
// ArrayList<Chunk> chunks = new ArrayList<Chunk>();
|
|
||||||
// Player[] players = plugin.getServer().getOnlinePlayers();
|
|
||||||
//
|
|
||||||
// for (Player player : players) {
|
|
||||||
// Chunk chunk = player.getLocation().getChunk();
|
|
||||||
// if (!chunks.contains(chunk))
|
|
||||||
// chunks.add(chunk);
|
|
||||||
// }
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Tools.verbose("Calling future at t="
|
|
||||||
// + System.currentTimeMillis());
|
|
||||||
returnFuture = plugin
|
returnFuture = plugin
|
||||||
.getServer()
|
.getServer()
|
||||||
.getScheduler()
|
.getScheduler()
|
||||||
.callSyncMethod(plugin,
|
.callSyncMethod(plugin,
|
||||||
new getOccupiedChunks(plugin.getServer()));
|
new getOccupiedChunks(plugin.getServer()));
|
||||||
ArrayList<Chunk> chunks = returnFuture.get();
|
ArrayList<Chunk> chunks = returnFuture.get();
|
||||||
// Tools.verbose("Future called, t=" +
|
|
||||||
// System.currentTimeMillis());
|
|
||||||
|
|
||||||
Map<Block, Information> earth = new HashMap<Block, Information>();
|
Map<Block, Information> earth = new HashMap<Block, Information>();
|
||||||
earth.putAll(Methods.movedearth);
|
earth.putAll(Methods.movedearth);
|
||||||
|
@ -118,41 +110,6 @@ public class RevertChecker implements Runnable {
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
// for (Block block : Tools.tempearthblocks.keySet()) {
|
|
||||||
// if (revertQueue.containsKey(block))
|
|
||||||
// continue;
|
|
||||||
// boolean remove = true;
|
|
||||||
//
|
|
||||||
// Block index = Tools.tempearthblocks.get(block);
|
|
||||||
// if (Tools.movedearth.containsKey(index)) {
|
|
||||||
// Information info = Tools.movedearth.get(index);
|
|
||||||
// if (time < info.getTime() + ConfigManager.revertchecktime
|
|
||||||
// || (chunks.contains(index.getChunk()) && safeRevert)) {
|
|
||||||
// remove = false;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// if (remove)
|
|
||||||
// addToRevertQueue(block);
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
|
|
||||||
// for (Block block : Tools.movedearth.keySet()) {
|
|
||||||
// if (movedEarthQueue.containsKey(block))
|
|
||||||
// continue;
|
|
||||||
// Information info = Tools.movedearth.get(block);
|
|
||||||
// if (time >= info.getTime() + ConfigManager.revertchecktime) {
|
|
||||||
// // if (Tools.tempearthblocks.containsKey(info.getBlock()))
|
|
||||||
// // Tools.verbose("PROBLEM!");
|
|
||||||
// // block.setType(info.getType());
|
|
||||||
// // Tools.movedearth.remove(block);
|
|
||||||
// addToMovedEarthQueue(block, info.getType());
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Tools.writeToLog("Still " + Tools.tempearthblocks.size()
|
|
||||||
// + " remaining.");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -204,8 +204,14 @@ public class LavaFlow
|
||||||
}
|
}
|
||||||
else if(Math.random() < PARTICLE_DENSITY
|
else if(Math.random() < PARTICLE_DENSITY
|
||||||
&& dSquared < Math.pow(currentRadius + PARTICLE_OFFSET, 2)
|
&& dSquared < Math.pow(currentRadius + PARTICLE_OFFSET, 2)
|
||||||
&& currentRadius + PARTICLE_OFFSET < maxRadius)
|
&& currentRadius + PARTICLE_OFFSET < maxRadius) {
|
||||||
ParticleEffect.LAVA.display(loc, (float) Math.random(), (float) Math.random(), (float) Math.random(), 0, 1);
|
try {
|
||||||
|
ParticleEffect.LAVA.sendToPlayers(Methods.getPlayersAroundPoint(loc, 100), loc, (float) Math.random(), (float) Math.random(), (float) Math.random(), 0, 1);
|
||||||
|
} catch (Exception e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -253,7 +259,12 @@ public class LavaFlow
|
||||||
&& !isLava(tempBlock)
|
&& !isLava(tempBlock)
|
||||||
&& Math.random() < PARTICLE_DENSITY
|
&& Math.random() < PARTICLE_DENSITY
|
||||||
&& tempBlock.getLocation().distanceSquared(origin) <= Math.pow(radius,2))
|
&& tempBlock.getLocation().distanceSquared(origin) <= Math.pow(radius,2))
|
||||||
ParticleEffect.LAVA.display(loc, 0, 0, 0, 0, 1);
|
try {
|
||||||
|
ParticleEffect.LAVA.sendToPlayers(Methods.getPlayersAroundPoint(loc, 100), loc, 0, 0, 0, 0, 1);
|
||||||
|
} catch (Exception e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -285,7 +296,12 @@ public class LavaFlow
|
||||||
if(Math.random() < LAVA_CREATE_SPEED)
|
if(Math.random() < LAVA_CREATE_SPEED)
|
||||||
createLava(tempBlock);
|
createLava(tempBlock);
|
||||||
else
|
else
|
||||||
ParticleEffect.LAVA.display(loc, 0, 0, 0, 0, 1);
|
try {
|
||||||
|
ParticleEffect.LAVA.sendToPlayers(Methods.getPlayersAroundPoint(loc, 100), loc, 0, 0, 0, 0, 1);
|
||||||
|
} catch (Exception e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if(!makeLava && isLava(tempBlock))
|
else if(!makeLava && isLava(tempBlock))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue