Compare commits

...
3 Commits
Author SHA1 Message Date
sk89q 257c12e727 Updated for 0.2.8. 2010-12-04 00:15:50 -08:00
sk89q 8b3eaa70fb Updated for newer builds of hMod. 2010-12-02 22:56:47 -08:00
sk89q c96bb890b4 Caught NullPointerException caused by getting the players list too early. 2010-12-01 22:43:36 -08:00
3 changed files with 22 additions and 13 deletions

No files matched your search

+3
View File
@@ -1,3 +1,6 @@
1.7.1:
- Updated for v0.2.8.
1.7
- Updated for v0.2.6_02 and hMod b129.
- Added option to prevent water from damaging particular blocks
+1 -1
View File
@@ -1,2 +1,2 @@
Manifest-Version: 1.0
WorldGuard-Version: 1.7
WorldGuard-Version: 1.7.1
+18 -12
View File
@@ -146,15 +146,18 @@ public class WorldGuardListener extends PluginListener {
public void postReload() {
invinciblePlayers.clear();
amphibiousPlayers.clear();
for (Player player : etc.getServer().getPlayerList()) {
if (player.isInGroup("wg-invincible")) {
invinciblePlayers.add(player.getName());
}
if (player.isInGroup("wg-amphibious")) {
amphibiousPlayers.add(player.getName());
try {
for (Player player : etc.getServer().getPlayerList()) {
if (player.isInGroup("wg-invincible")) {
invinciblePlayers.add(player.getName());
}
if (player.isInGroup("wg-amphibious")) {
amphibiousPlayers.add(player.getName());
}
}
} catch (NullPointerException e) { // Thrown if loaded too early
}
}
@@ -388,13 +391,13 @@ public class WorldGuardListener extends PluginListener {
} else if ((split[0].equalsIgnoreCase("/stack")
|| split[0].equalsIgnoreCase("/;"))
&& player.canUseCommand("/stack")) {
hm[] items = player.getInventory().getArray();
hn[] items = player.getInventory().getArray();
int len = items.length;
int affected = 0;
for (int i = 0; i < len; i++) {
hm item = items[i];
hn item = items[i];
// Avoid infinite stacks and stacks with durability
if (item == null || item.a <= 0 || item.d > 0) {
@@ -411,7 +414,7 @@ public class WorldGuardListener extends PluginListener {
// Find another stack of the same type
for (int j = i + 1; j < len; j++) {
hm item2 = items[j];
hn item2 = items[j];
// Avoid infinite stacks and stacks with durability
if (item2 == null || item2.a <= 0 || item2.d > 0) {
@@ -569,7 +572,7 @@ public class WorldGuardListener extends PluginListener {
@Override
public boolean onInventoryChange(Player player) {
if (blacklist != null && blacklist.hasOnAcquire()) {
hm[] items = player.getInventory().getArray();
hn[] items = player.getInventory().getArray();
boolean needUpdate = false;
for (int i = 0; i < items.length; i++) {
@@ -592,11 +595,14 @@ public class WorldGuardListener extends PluginListener {
/**
* Called when a player uses an item (rightclick with item in hand)
* @param player the player
* @param blockPlaced where a block would end up when the item was a bucket
* @param blockClicked
* @param item the item being used (in hand)
* @return true to prevent using the item.
*/
@Override
public boolean onItemUse(Player player, Item item) {
public boolean onItemUse(Player player, Block blockPlaced,
Block blockClicked, Item item) {
if (blacklist != null) {
int itemId = item.getItemId();