mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2026-11-04 09:02:07 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
257c12e727 | ||
|
|
8b3eaa70fb | ||
|
|
c96bb890b4 |
No files matched your search
@@ -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
@@ -1,2 +1,2 @@
|
||||
Manifest-Version: 1.0
|
||||
WorldGuard-Version: 1.7
|
||||
WorldGuard-Version: 1.7.1
|
||||
+18
-12
@@ -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();
|
||||
|
||||
|
||||
Reference in new issue
Block a user