Updated pom.xml for Craftbukkit RB 1597. Corrected permissions bug where War admins couldn't change the corners of other zonemakers' zones.

This commit is contained in:
taoneill 2011-12-20 00:51:37 -05:00
parent 60356e56ab
commit 007344a63e
9 changed files with 29 additions and 37 deletions

View File

@ -35,13 +35,13 @@
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.0.0-R1-SNAPSHOT</version>
<version>1.0.1-R1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>1.0.1-R1</version>
<scope>compile</scope>
</dependency>
<dependency>

View File

@ -25,10 +25,17 @@ import org.bukkit.plugin.java.JavaPlugin;
import com.nijiko.permissions.PermissionHandler;
import com.nijikokun.bukkit.Permissions.Permissions;
import com.tommytony.war.*;
import com.tommytony.war.FlagReturn;
import com.tommytony.war.TeamKind;
import com.tommytony.war.TeamSpawnStyle;
import com.tommytony.war.WarHub;
import com.tommytony.war.Warzone;
import com.tommytony.war.ZoneLobby;
import com.tommytony.war.jobs.HelmetProtectionTask;
import com.tommytony.war.mappers.*;
import com.tommytony.war.utils.*;
import com.tommytony.war.mappers.WarMapper;
import com.tommytony.war.mappers.WarzoneMapper;
import com.tommytony.war.utils.ChatFixUtil;
import com.tommytony.war.utils.PlayerState;
/**
* Main class of War

View File

@ -3,7 +3,6 @@ package bukkit.tommytony.war;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.logging.Level;
import org.bukkit.ChatColor;
import org.bukkit.Location;
@ -12,7 +11,6 @@ import org.bukkit.block.Block;
import org.bukkit.block.ContainerBlock;
import org.bukkit.block.NoteBlock;
import org.bukkit.block.Sign;
import org.bukkit.craftbukkit.entity.CraftCreeper;
import org.bukkit.craftbukkit.entity.CraftPlayer;
import org.bukkit.craftbukkit.entity.CraftTNTPrimed;
import org.bukkit.entity.Arrow;
@ -20,17 +18,16 @@ import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile;
import org.bukkit.entity.TNTPrimed;
import org.bukkit.entity.ThrownPotion;
import org.bukkit.event.entity.CreatureSpawnEvent;
import org.bukkit.event.entity.EntityCombustEvent;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.FoodLevelChangeEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.event.entity.EntityListener;
import org.bukkit.event.entity.EntityRegainHealthEvent;
import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason;
import org.bukkit.event.entity.FoodLevelChangeEvent;
import org.bukkit.inventory.ItemStack;
import com.tommytony.war.Team;

View File

@ -1,9 +1,7 @@
package bukkit.tommytony.war;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.bukkit.ChatColor;
import org.bukkit.Location;
@ -552,8 +550,6 @@ public class WarPlayerListener extends PlayerListener {
}
}
public void purgeLatestPositions() {
this.latestLocations.clear();
}

View File

@ -3,14 +3,13 @@ package bukkit.tommytony.war.command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.tommytony.war.Monument;
import bukkit.tommytony.war.WarCommandHandler;
import com.tommytony.war.Team;
import com.tommytony.war.Warzone;
import com.tommytony.war.ZoneLobby;
import com.tommytony.war.mappers.WarzoneMapper;
import bukkit.tommytony.war.WarCommandHandler;
/**
* Deletes a monument.
*

View File

@ -906,6 +906,10 @@ public class Warzone {
if (this.hasPlayerState(player.getName())) {
this.restorePlayerState(player);
}
if (this.getLoadoutSelections().containsKey(player.getName())) {
// clear inventory selection
this.getLoadoutSelections().remove(player.getName());
}
player.setFireTicks(0);
player.setRemainingAir(300);

View File

@ -4,6 +4,8 @@ import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player;
import bukkit.tommytony.war.War;
import com.tommytony.war.mappers.WarMapper;
import com.tommytony.war.mappers.WarzoneMapper;
import com.tommytony.war.volumes.NotNorthwestException;
@ -11,9 +13,6 @@ import com.tommytony.war.volumes.NotSoutheastException;
import com.tommytony.war.volumes.TooBigException;
import com.tommytony.war.volumes.TooSmallException;
import bukkit.tommytony.war.War;
import bukkit.tommytony.war.command.SetZoneCommand;
public class ZoneSetter {
private final Player player;
@ -40,7 +39,7 @@ public class ZoneSetter {
War.war.getIncompleteZones().add(warzone);
warzone.getVolume().setNorthwest(northwestBlock);
War.war.msg(this.player, "Warzone " + warzone.getName() + " created. Northwesternmost point set to x:" + warzone.getVolume().getNorthwestX() + " z:" + warzone.getVolume().getNorthwestZ() + ". ");
} else if (!this.isPlayerAuthorOfZone(warzone)) {
} else if (!this.isPlayerAuthorOfZoneOrAdmin(warzone)) {
return;
} else {
// change existing warzone
@ -67,8 +66,6 @@ public class ZoneSetter {
}
}
public void placeSoutheast() {
Warzone warzone = War.war.findWarzone(this.zoneName);
Block southeastBlock = this.player.getLocation().getWorld().getBlockAt(this.player.getLocation());
@ -85,7 +82,7 @@ public class ZoneSetter {
War.war.getIncompleteZones().add(warzone);
warzone.getVolume().setSoutheast(southeastBlock);
War.war.msg(this.player, "Warzone " + warzone.getName() + " created. Southeasternmost point set to x:" + warzone.getVolume().getSoutheastX() + " z:" + warzone.getVolume().getSoutheastZ() + ". ");
} else if (!this.isPlayerAuthorOfZone(warzone)) {
} else if (!this.isPlayerAuthorOfZoneOrAdmin(warzone)) {
return;
} else {
// change existing warzone
@ -132,7 +129,7 @@ public class ZoneSetter {
War.war.getIncompleteZones().add(warzone);
warzone.getVolume().setZoneCornerOne(corner1Block);
War.war.msg(this.player, "Warzone " + warzone.getName() + " created. Corner 1 set to x:" + corner1Block.getX() + " y:" + corner1Block.getY() + " z:" + corner1Block.getZ() + ". ");
} else if (!this.isPlayerAuthorOfZone(warzone)) {
} else if (!this.isPlayerAuthorOfZoneOrAdmin(warzone)) {
return;
} else {
// change existing warzone
@ -174,7 +171,7 @@ public class ZoneSetter {
War.war.getIncompleteZones().add(warzone);
warzone.getVolume().setZoneCornerTwo(corner2Block);
War.war.msg(this.player, "Warzone " + warzone.getName() + " created. Corner 2 set to x:" + corner2Block.getX() + " y:" + corner2Block.getY() + " z:" + corner2Block.getZ() + ". ");
} else if (!this.isPlayerAuthorOfZone(warzone)) {
} else if (!this.isPlayerAuthorOfZoneOrAdmin(warzone)) {
return;
} else {
// change existing warzone
@ -196,12 +193,13 @@ public class ZoneSetter {
}
}
private boolean isPlayerAuthorOfZone(Warzone warzone) {
private boolean isPlayerAuthorOfZoneOrAdmin(Warzone warzone) {
boolean isAuthor = warzone.isAuthor(player);
if (!isAuthor) {
boolean isAdmin = !War.war.isWarAdmin(player);
if (!isAuthor && !isAdmin) {
War.war.badMsg(player, "You can't do this because you are not an author of the " + warzone.getName() + " warzone." );
}
return isAuthor;
return isAuthor || isAdmin;
}
private void resetWarzone(Warzone warzone, StringBuilder msgString) {

View File

@ -34,13 +34,6 @@ public class VolumeMapper {
return volume;
}
// public static ZoneVolume loadZoneVolume(String volumeName, String zoneName,
// War war, World world, Warzone zone) {
// ZoneVolume volume = new ZoneVolume(volumeName, war, world, zone);
// load(volume, zoneName, war, world);
// return volume;
// }
public static void load(Volume volume, String zoneName, World world) {
BufferedReader in = null;
try {

View File

@ -9,7 +9,6 @@ import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
@ -22,7 +21,6 @@ import org.bukkit.block.Dispenser;
import org.bukkit.block.Sign;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.material.MaterialData;
import bukkit.tommytony.war.War;