Forgot to delete comments like commit bad3c18

This commit is contained in:
jack lin 2014-07-29 23:47:11 +12:00
parent 468ffa3325
commit 6fd33e9d4d
2 changed files with 13 additions and 133 deletions

View file

@ -2,14 +2,18 @@
<classpath> <classpath>
<classpathentry kind="src" path="src"/> <classpathentry kind="src" path="src"/>
<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="E:/Jack/Game dev/bukkit lib/ProjectKorra/Factions.jar"/>
<classpathentry kind="lib" path="C:/Users/Shawn/Documents/Bending Plugins/Factions.jar"/> <classpathentry kind="lib" path="E:/Jack/Game dev/bukkit lib/ProjectKorra/GriefPrevention-282.jar"/>
<classpathentry kind="lib" path="C:/Users/Shawn/Documents/Bending Plugins/GriefPrevention.jar"/> <classpathentry kind="lib" path="E:/Jack/Game dev/bukkit lib/ProjectKorra/mcore 7.2.1.jar"/>
<classpathentry kind="lib" path="C:/Users/Shawn/Documents/Bending Plugins/mcore.jar"/> <classpathentry kind="lib" path="E:/Jack/Game dev/bukkit lib/ProjectKorra/PreciousStones.jar"/>
<classpathentry kind="lib" path="C:/Users/Shawn/Documents/Bending Plugins/PreciousStones.jar"/> <classpathentry kind="lib" path="E:/Jack/Game dev/bukkit lib/ProjectKorra/TagAPI.jar"/>
<classpathentry kind="lib" path="C:/Users/Shawn/Documents/Bending Plugins/TagAPI.jar"/> <classpathentry kind="lib" path="E:/Jack/Game dev/bukkit lib/ProjectKorra/Towny.jar"/>
<classpathentry kind="lib" path="C:/Users/Shawn/Documents/Bending Plugins/Towny.jar"/> <classpathentry kind="lib" path="E:/Jack/Game dev/bukkit lib/bukkit-1.7.9-R0.2.jar">
<classpathentry kind="lib" path="C:/Users/Shawn/Documents/Bending Plugins/WorldEdit.jar"/> <attributes>
<classpathentry kind="lib" path="C:/Users/Shawn/Documents/Bending Plugins/WorldGuard.jar"/> <attribute name="javadoc_location" value="http://jd.bukkit.org/dev/apidocs"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="E:/Jack/Game dev/bukkit lib/WorldEdit-5.9.jar"/>
<classpathentry kind="lib" path="E:/Jack/Game dev/bukkit lib/WorldGuard-5.9.jar"/>
<classpathentry kind="output" path="bin"/> <classpathentry kind="output" path="bin"/>
</classpath> </classpath>

View file

@ -311,9 +311,6 @@ public class Methods {
* @throws SQLException * @throws SQLException
*/ */
public static void createBendingPlayer(UUID uuid, String player) { public static void createBendingPlayer(UUID uuid, String player) {
/*
* This will run when the player logs in.
*/
ResultSet rs2 = DBConnection.sql.readQuery("SELECT * FROM pk_players WHERE uuid = '" + uuid.toString() + "'"); ResultSet rs2 = DBConnection.sql.readQuery("SELECT * FROM pk_players WHERE uuid = '" + uuid.toString() + "'");
try { try {
if (!rs2.next()) { // Data doesn't exist, we want a completely new player. if (!rs2.next()) { // Data doesn't exist, we want a completely new player.
@ -381,7 +378,6 @@ public class Methods {
File readFile = new File(".", "bendingPlayers.yml"); File readFile = new File(".", "bendingPlayers.yml");
File writeFile = new File(".", "converted.yml"); File writeFile = new File(".", "converted.yml");
if (readFile.exists()) { if (readFile.exists()) {
// plugin.log.info("File exists");
try { try {
DataInputStream input = new DataInputStream(new FileInputStream(readFile)); DataInputStream input = new DataInputStream(new FileInputStream(readFile));
BufferedReader reader = new BufferedReader(new InputStreamReader(input)); BufferedReader reader = new BufferedReader(new InputStreamReader(input));
@ -496,9 +492,6 @@ public class Methods {
for (int y = yorg - r; y <= yorg + r; y++) { for (int y = yorg - r; y <= yorg + r; y++) {
for (int z = zorg - r; z <= zorg + r; z++) { for (int z = zorg - r; z <= zorg + r; z++) {
Block block = location.getWorld().getBlockAt(x, y, z); Block block = location.getWorld().getBlockAt(x, y, z);
// if
// (block.getLocation().distance(originblock.getLocation())
// <= radius) {
if (block.getLocation().distance(location) <= radius) { if (block.getLocation().distance(location) <= radius) {
blocks.add(block); blocks.add(block);
} }
@ -953,19 +946,6 @@ public class Methods {
public static boolean isChiBlocked(String player) { public static boolean isChiBlocked(String player) {
return Methods.getBendingPlayer(player).isChiBlocked(); return Methods.getBendingPlayer(player).isChiBlocked();
// long currTime = System.currentTimeMillis();
// long duration = ProjectKorra.plugin.getConfig().getLong("Abilities.Chi.Passive.BlockChi.Duration");
// if (BendingPlayer.blockedChi.contains(player)) {
// if (BendingPlayer.blockedChi.get(player) + ChiPassive.duration >= System.currentTimeMillis()) {
// return true;
// } else {
// BendingPlayer.blockedChi.remove(player);
// return false;
// }
// } else {
// Bukkit.getServer().broadcastMessage("test");
// return false;
// }
} }
public static boolean isDay(World world) { public static boolean isDay(World world) {
@ -991,21 +971,6 @@ public class Methods {
return false; return false;
Material material = block.getType(); Material material = block.getType();
// if ((material == Material.STONE) || (material == Material.CLAY)
// || (material == Material.COAL_ORE)
// || (material == Material.DIAMOND_ORE)
// || (material == Material.DIRT)
// || (material == Material.GOLD_ORE)
// || (material == Material.GRASS)
// || (material == Material.GRAVEL)
// || (material == Material.IRON_ORE)
// || (material == Material.LAPIS_ORE)
// || (material == Material.NETHERRACK)
// || (material == Material.REDSTONE_ORE)
// || (material == Material.SAND)
// || (material == Material.SANDSTONE)) {
// return true;
// }
for (String s : ProjectKorra.plugin.getConfig().getStringList("Properties.Earth.EarthbendableBlocks")) { for (String s : ProjectKorra.plugin.getConfig().getStringList("Properties.Earth.EarthbendableBlocks")) {
if (material == Material.getMaterial(s)) { if (material == Material.getMaterial(s)) {
@ -1115,26 +1080,12 @@ public class Methods {
Set<String> ignite = AbilityModuleManager.igniteabilities; Set<String> ignite = AbilityModuleManager.igniteabilities;
Set<String> explode = AbilityModuleManager.explodeabilities; Set<String> explode = AbilityModuleManager.explodeabilities;
// List<Abilities> ignite = new ArrayList<Abilities>();
// ignite.add(Abilities.Blaze);
// List<Abilities> explode = new ArrayList<Abilities>();
// explode.add(Abilities.FireBlast);
// explode.add(Abilities.Lightning);
if (ability == null && allowharmless) if (ability == null && allowharmless)
return false; return false;
if (isHarmlessAbility(ability) && allowharmless) if (isHarmlessAbility(ability) && allowharmless)
return false; return false;
// if (ignite.contains(ability)) {
// BlockIgniteEvent event = new BlockIgniteEvent(location.getBlock(),
// IgniteCause.FLINT_AND_STEEL, player);
// Bending.plugin.getServer().getPluginManager().callEvent(event);
// if (event.isCancelled())
// return false;
// event.setCancelled(true);
// }
PluginManager pm = Bukkit.getPluginManager(); PluginManager pm = Bukkit.getPluginManager();
Plugin wgp = pm.getPlugin("WorldGuard"); Plugin wgp = pm.getPlugin("WorldGuard");
@ -1430,17 +1381,12 @@ public class Methods {
breakBlock(affectedblock); breakBlock(affectedblock);
} else if (!affectedblock.isLiquid() } else if (!affectedblock.isLiquid()
&& affectedblock.getType() != Material.AIR) { && affectedblock.getType() != Material.AIR) {
// affectedblock.setType(Material.GLASS);
moveEarthBlock(affectedblock, topblock); moveEarthBlock(affectedblock, topblock);
} }
} else { } else {
breakBlock(affectedblock); breakBlock(affectedblock);
} }
// affectedblock.setType(block.getType());
// affectedblock.setData(block.getData());
//
// addTempEarthBlock(block, affectedblock);
moveEarthBlock(block, affectedblock); moveEarthBlock(block, affectedblock);
block.getWorld().playEffect(block.getLocation(), block.getWorld().playEffect(block.getLocation(),
Effect.GHAST_SHOOT, 0, 4); Effect.GHAST_SHOOT, 0, 4);
@ -1451,7 +1397,6 @@ public class Methods {
.add(negnorm.getX() * i, negnorm.getY() * i, .add(negnorm.getX() * i, negnorm.getY() * i,
negnorm.getZ() * i).getBlock(); negnorm.getZ() * i).getBlock();
if (!isEarthbendable(player, affectedblock)) { if (!isEarthbendable(player, affectedblock)) {
// verbose(affectedblock.getType());
if (down) { if (down) {
if (isTransparentToEarthbending(player, if (isTransparentToEarthbending(player,
affectedblock) affectedblock)
@ -1460,31 +1405,17 @@ public class Methods {
moveEarthBlock(affectedblock, block); moveEarthBlock(affectedblock, block);
} }
} }
// if (!Tools.adjacentToThreeOrMoreSources(block)
// && Tools.isWater(block)) {
// block.setType(Material.AIR);
// } else {
// byte full = 0x0;
// block.setType(Material.WATER);
// block.setData(full);
// }
break; break;
} }
if (EarthPassive.isPassiveSand(affectedblock)) { if (EarthPassive.isPassiveSand(affectedblock)) {
EarthPassive.revertSand(affectedblock); EarthPassive.revertSand(affectedblock);
} }
// if (affectedblock.getType() == Material.SAND) {
// affectedblock.setType(Material.SANDSTONE);
// }
if (block == null) { if (block == null) {
for (Block checkblock : blocks) { for (Block checkblock : blocks) {
tempnophysics.remove(checkblock); tempnophysics.remove(checkblock);
} }
return false; return false;
} }
// block.setType(affectedblock.getType());
// block.setData(affectedblock.getData());
// addTempEarthBlock(affectedblock, block);
moveEarthBlock(affectedblock, block); moveEarthBlock(affectedblock, block);
block = affectedblock; block = affectedblock;
} }
@ -1532,17 +1463,13 @@ public class Methods {
byte full = 0x0; byte full = 0x0;
Information info; Information info;
if (movedearth.containsKey(source)) { if (movedearth.containsKey(source)) {
// verbose("Moving something already moved.");
info = movedearth.get(source); info = movedearth.get(source);
info.setTime(System.currentTimeMillis()); info.setTime(System.currentTimeMillis());
movedearth.remove(source); movedearth.remove(source);
movedearth.put(target, info); movedearth.put(target, info);
} else { } else {
// verbose("Moving something for the first time.");
info = new Information(); info = new Information();
info.setBlock(source); info.setBlock(source);
// info.setType(source.getType());
// info.setData(source.getData());
info.setTime(System.currentTimeMillis()); info.setTime(System.currentTimeMillis());
info.setState(source.getState()); info.setState(source.getState());
movedearth.put(target, info); movedearth.put(target, info);
@ -1666,18 +1593,12 @@ public class Methods {
block, block,
getDrops(block, info.getState().getType(), info getDrops(block, info.getState().getType(), info
.getState().getRawData(), pickaxe)); .getState().getRawData(), pickaxe));
// ItemStack item = new ItemStack(info.getType());
// item.setData(new MaterialData(info.getType(),
// info.getData()));
// block.getWorld().dropItem(block.getLocation(), item);
tempair.remove(i); tempair.remove(i);
} else { } else {
info.setTime(info.getTime() + 10000); info.setTime(info.getTime() + 10000);
} }
return; return;
} else { } else {
// block.setType(info.getType());
// block.setData(info.getData());
info.getState().update(true); info.getState().update(true);
tempair.remove(i); tempair.remove(i);
} }
@ -1694,10 +1615,6 @@ public class Methods {
} }
if (block.equals(sourceblock)) { if (block.equals(sourceblock)) {
// verbose("Equals!");
// if (block.getType() == Material.SANDSTONE
// && info.getState().getType() == Material.SAND)
// block.setType(Material.SAND);
info.getState().update(true); info.getState().update(true);
if (EarthColumn.blockInAllAffectedBlocks(sourceblock)) if (EarthColumn.blockInAllAffectedBlocks(sourceblock))
EarthColumn.revertBlock(sourceblock); EarthColumn.revertBlock(sourceblock);
@ -1713,62 +1630,23 @@ public class Methods {
addTempAirBlock(block); addTempAirBlock(block);
movedearth.remove(block); movedearth.remove(block);
return true; return true;
// verbose("Block: " + block);
// verbose("Sourceblock: " + sourceblock);
// verbose("StartBlock: " + startblock);
// if (startblock != null) {
// if (startblock.equals(sourceblock)) {
// sourceblock.setType(info.getType());
// sourceblock.setData(info.getData());
// if (adjacentToThreeOrMoreSources(block)) {
// block.setType(Material.WATER);
// block.setData(full);
// } else {
// block.setType(Material.AIR);
// }
// movedearth.get(startblock).setInteger(10);
// if (EarthColumn
// .blockInAllAffectedBlocks(sourceblock))
// EarthColumn.revertBlock(sourceblock);
// if (EarthColumn.blockInAllAffectedBlocks(block))
// EarthColumn.revertBlock(block);
// EarthColumn.resetBlock(sourceblock);
// EarthColumn.resetBlock(block);
// movedearth.remove(block);
// return true;
// }
//
// } else {
// startblock = block;
// }
// revertBlock(sourceblock, startblock, true);
} }
if (sourceblock.getType() == Material.AIR || sourceblock.isLiquid()) { if (sourceblock.getType() == Material.AIR || sourceblock.isLiquid()) {
// sourceblock.setType(info.getType());
// sourceblock.setData(info.getData());
info.getState().update(true); info.getState().update(true);
} else { } else {
// if (info.getType() != Material.AIR) {
// ItemStack item = new ItemStack(info.getType());
// item.setData(new MaterialData(info.getType(), info
// .getData()));
// block.getWorld().dropItem(block.getLocation(), item);
dropItems( dropItems(
block, block,
getDrops(block, info.getState().getType(), info getDrops(block, info.getState().getType(), info
.getState().getRawData(), pickaxe)); .getState().getRawData(), pickaxe));
// }
} }
// if (info.getInteger() != 10) {
if (isAdjacentToThreeOrMoreSources(block)) { if (isAdjacentToThreeOrMoreSources(block)) {
block.setType(Material.WATER); block.setType(Material.WATER);
block.setData(full); block.setData(full);
} else { } else {
block.setType(Material.AIR); block.setType(Material.AIR);
} }
// }
if (EarthColumn.blockInAllAffectedBlocks(sourceblock)) if (EarthColumn.blockInAllAffectedBlocks(sourceblock))
EarthColumn.revertBlock(sourceblock); EarthColumn.revertBlock(sourceblock);
@ -1792,8 +1670,6 @@ public class Methods {
return rotate.multiply(Math.cos(angle)).add( return rotate.multiply(Math.cos(angle)).add(
thirdaxis.multiply(Math.sin(angle))); thirdaxis.multiply(Math.sin(angle)));
// return new Vector(x, z, y);
} }
public static void saveBendingPlayer(String player) { public static void saveBendingPlayer(String player) {