Updated to 1.3
This commit is contained in:
parent
6721deef13
commit
368b69f0f2
@ -2,7 +2,7 @@
|
|||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry kind="src" path="src"/>
|
<classpathentry kind="src" path="src"/>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
||||||
<classpathentry kind="lib" path="C:/Users/Travja/Documents/Projects/bukkit-1.2.5-R4.1-20120716.060315-25.jar"/>
|
|
||||||
<classpathentry kind="lib" path="C:/Users/Travja/Documents/Projects/Vault.jar"/>
|
<classpathentry kind="lib" path="C:/Users/Travja/Documents/Projects/Vault.jar"/>
|
||||||
|
<classpathentry kind="lib" path="C:/Users/Travja/Downloads/bukkit-1.3.1-R1.1-20120809.005103-3.jar"/>
|
||||||
<classpathentry kind="output" path="bin"/>
|
<classpathentry kind="output" path="bin"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -2,6 +2,7 @@ package me.Travja.HungerArena;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
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;
|
||||||
@ -26,7 +27,7 @@ public class BlockStorage implements Listener {
|
|||||||
public BlockStorage(Main m) {
|
public BlockStorage(Main m) {
|
||||||
this.plugin = m;
|
this.plugin = m;
|
||||||
}
|
}
|
||||||
/*@EventHandler
|
@EventHandler
|
||||||
public void creeperExplosion(EntityExplodeEvent event){
|
public void creeperExplosion(EntityExplodeEvent event){
|
||||||
if(plugin.canjoin== true){
|
if(plugin.canjoin== true){
|
||||||
for(Block b:event.blockList()){
|
for(Block b:event.blockList()){
|
||||||
@ -88,15 +89,34 @@ public class BlockStorage implements Listener {
|
|||||||
int z = b.getZ();
|
int z = b.getZ();
|
||||||
int d = b.getTypeId();
|
int d = b.getTypeId();
|
||||||
String coords = w + "," + x + "," + y + "," + z + "," + d;
|
String coords = w + "," + x + "," + y + "," + z + "," + d;
|
||||||
if(!(d== 51) && !(d==12){
|
if(!(d== 51) && !(d==12) && !(d==13)){
|
||||||
System.out.println("Place: " + coords);
|
System.out.println("Place: " + coords);
|
||||||
List<String> blocks = plugin.config.getStringList("Blocks_Placed");
|
List<String> blocks = plugin.config.getStringList("Blocks_Placed");
|
||||||
blocks.add(coords);
|
blocks.add(coords);
|
||||||
plugin.config.set("Blocks_Placed", blocks);
|
plugin.config.set("Blocks_Placed", blocks);
|
||||||
plugin.saveConfig();
|
plugin.saveConfig();
|
||||||
|
}else if (d == 12 || d == 13) {
|
||||||
|
System.out.println("Sand/Gravel");
|
||||||
|
int newy = y;
|
||||||
|
int replaced = 0;
|
||||||
|
Location l = b.getLocation();
|
||||||
|
while(l.getBlock().getRelative(BlockFace.DOWN).getType()== Material.AIR){
|
||||||
|
newy = newy-1;
|
||||||
|
replaced = 0;
|
||||||
|
System.out.println(newy);
|
||||||
}
|
}
|
||||||
Location location = b.getLocation();
|
while(l.getBlock().getRelative(BlockFace.DOWN).getType()== Material.WATER){
|
||||||
if (b.getType() == Material.SAND || b.getType() == Material.GRAVEL) {
|
newy = newy-1;
|
||||||
|
replaced = 8;
|
||||||
|
}
|
||||||
|
while(l.getBlock().getRelative(BlockFace.DOWN).getType()== Material.LAVA){
|
||||||
|
newy = newy-1;
|
||||||
|
replaced = 10;
|
||||||
|
}
|
||||||
|
if(l.getBlock().getRelative(BlockFace.DOWN).getType()!= Material.AIR || l.getBlock().getRelative(BlockFace.DOWN).getType()!= Material.WATER || l.getBlock().getRelative(BlockFace.DOWN).getType()!= Material.LAVA){
|
||||||
|
event.getPlayer().sendMessage(ChatColor.GREEN + "Block will land at " + x + ", " + newy + ", " + z + " and replaced " + replaced);
|
||||||
|
}
|
||||||
|
/*Location location = b.getLocation();
|
||||||
if (location.getBlock().getRelative(BlockFace.DOWN).getType() == Material.AIR) {
|
if (location.getBlock().getRelative(BlockFace.DOWN).getType() == Material.AIR) {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (i = location.getBlockY(); i > -1; i --) {
|
for (i = location.getBlockY(); i > -1; i --) {
|
||||||
@ -105,13 +125,13 @@ public class BlockStorage implements Listener {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
event.getPlayer().sendMessage("Block will land at: " + location);
|
event.getPlayer().sendMessage("Block will land at: " + location);
|
||||||
System.out.println("Sand Place: " + coords);
|
System.out.println("Sand/Gravel Place: " + coords);
|
||||||
List<String> blocks = plugin.config.getStringList("Blocks_Destroyed");
|
List<String> blocks = plugin.config.getStringList("Blocks_Destroyed");
|
||||||
blocks.add(coords);
|
blocks.add(coords);
|
||||||
plugin.config.set("Blocks_Destroyed", blocks);
|
plugin.config.set("Blocks_Destroyed", blocks);
|
||||||
plugin.saveConfig();
|
plugin.saveConfig();
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -178,6 +198,7 @@ public class BlockStorage implements Listener {
|
|||||||
int z = b.getZ();
|
int z = b.getZ();
|
||||||
int d = b.getTypeId();
|
int d = b.getTypeId();
|
||||||
String coords = w + "," + x + "," + y + "," + z + "," + d;
|
String coords = w + "," + x + "," + y + "," + z + "," + d;
|
||||||
|
if(d != 51 && d != 2){
|
||||||
System.out.println("Fade: " + coords);
|
System.out.println("Fade: " + coords);
|
||||||
List<String> blocks = plugin.config.getStringList("Blocks_Destroyed");
|
List<String> blocks = plugin.config.getStringList("Blocks_Destroyed");
|
||||||
blocks.add(coords);
|
blocks.add(coords);
|
||||||
@ -185,6 +206,7 @@ public class BlockStorage implements Listener {
|
|||||||
plugin.saveConfig();
|
plugin.saveConfig();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void blockGrow(BlockGrowEvent event){
|
public void blockGrow(BlockGrowEvent event){
|
||||||
if(plugin.canjoin== true){
|
if(plugin.canjoin== true){
|
||||||
@ -237,7 +259,7 @@ public class BlockStorage implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@EventHandler
|
/*@EventHandler
|
||||||
public void onChange(BlockPhysicsEvent event){
|
public void onChange(BlockPhysicsEvent event){
|
||||||
Block block = event.getBlock();
|
Block block = event.getBlock();
|
||||||
Material changed = event.getChangedType();
|
Material changed = event.getChangedType();
|
||||||
|
@ -7,7 +7,7 @@ import org.bukkit.entity.Entity;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.player.PlayerChatEvent;
|
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||||
|
|
||||||
public class ChatListener implements Listener {
|
public class ChatListener implements Listener {
|
||||||
public Main plugin;
|
public Main plugin;
|
||||||
@ -15,7 +15,7 @@ public class ChatListener implements Listener {
|
|||||||
this.plugin = m;
|
this.plugin = m;
|
||||||
}
|
}
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void TributeChat(PlayerChatEvent event){
|
public void TributeChat(AsyncPlayerChatEvent event){
|
||||||
Player p = event.getPlayer();
|
Player p = event.getPlayer();
|
||||||
String pname = p.getName();
|
String pname = p.getName();
|
||||||
if(plugin.Playing.contains(pname)){
|
if(plugin.Playing.contains(pname)){
|
||||||
|
@ -34,13 +34,22 @@ public class DeathListener implements Listener{
|
|||||||
Player p = event.getEntity();
|
Player p = event.getEntity();
|
||||||
Server s = p.getServer();
|
Server s = p.getServer();
|
||||||
String pname = p.getName();
|
String pname = p.getName();
|
||||||
String leftmsg = ChatColor.BLUE + "There are now " + plugin.Playing.size() + " tributes left!";
|
int players = plugin.Playing.size()-1;
|
||||||
|
String leftmsg = ChatColor.BLUE + "There are now " + players + " tributes left!";
|
||||||
String[] Spawncoords = plugin.config.getString("Spawn_coords").split(",");
|
String[] Spawncoords = plugin.config.getString("Spawn_coords").split(",");
|
||||||
World spawnw = plugin.getServer().getWorld(Spawncoords[3]);
|
World spawnw = plugin.getServer().getWorld(Spawncoords[3]);
|
||||||
double spawnx = Double.parseDouble(Spawncoords[0]);
|
double spawnx = Double.parseDouble(Spawncoords[0]);
|
||||||
double spawny = Double.parseDouble(Spawncoords[1]);
|
double spawny = Double.parseDouble(Spawncoords[1]);
|
||||||
double spawnz = Double.parseDouble(Spawncoords[2]);
|
double spawnz = Double.parseDouble(Spawncoords[2]);
|
||||||
Location Spawn = new Location(spawnw, spawnx, spawny, spawnz);
|
Location Spawn = new Location(spawnw, spawnx, spawny, spawnz);
|
||||||
|
if(plugin.config.getString("Cannon_Death").equalsIgnoreCase("True")){
|
||||||
|
double y = p.getLocation().getY();
|
||||||
|
double newy = y+200;
|
||||||
|
double x = p.getLocation().getX();
|
||||||
|
double z = p.getLocation().getZ();
|
||||||
|
Location strike = new Location(p.getWorld(), x, newy, z);
|
||||||
|
p.getWorld().strikeLightning(strike);
|
||||||
|
}
|
||||||
if(plugin.Frozen.contains(pname) && plugin.Playing.contains(pname)){
|
if(plugin.Frozen.contains(pname) && plugin.Playing.contains(pname)){
|
||||||
event.setDeathMessage("");
|
event.setDeathMessage("");
|
||||||
p.getServer().broadcastMessage(pname + ChatColor.LIGHT_PURPLE + " Stepped off their pedestal too early!");
|
p.getServer().broadcastMessage(pname + ChatColor.LIGHT_PURPLE + " Stepped off their pedestal too early!");
|
||||||
@ -48,7 +57,7 @@ public class DeathListener implements Listener{
|
|||||||
plugin.Playing.remove(pname);
|
plugin.Playing.remove(pname);
|
||||||
plugin.Dead.add(pname);
|
plugin.Dead.add(pname);
|
||||||
s.broadcastMessage(leftmsg);
|
s.broadcastMessage(leftmsg);
|
||||||
if(plugin.Playing.size()== 1 && plugin.canjoin== true){
|
if(plugin.Playing.size()== 1 && plugin.canjoin== false){
|
||||||
//Announce winner
|
//Announce winner
|
||||||
String winnername = plugin.Playing.get(i++);
|
String winnername = plugin.Playing.get(i++);
|
||||||
Player winner = plugin.getServer().getPlayerExact(winnername);
|
Player winner = plugin.getServer().getPlayerExact(winnername);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user