Fix WordGuard + minor fixes

This commit is contained in:
Andrzej Pomirski 2014-11-30 20:15:27 +01:00
parent 91c08045b8
commit a058b80990
4 changed files with 17 additions and 14 deletions

18
pom.xml
View File

@ -6,7 +6,7 @@
<groupId>com.acrobot.chestshop</groupId> <groupId>com.acrobot.chestshop</groupId>
<artifactId>chestshop</artifactId> <artifactId>chestshop</artifactId>
<version>3.7.17</version> <version>3.7.18</version>
<description>Chest-and-sign shop plugin for Bukkit</description> <description>Chest-and-sign shop plugin for Bukkit</description>
<scm> <scm>
@ -128,14 +128,14 @@
<finalName>ChestShop</finalName> <finalName>ChestShop</finalName>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>2.3.2</version>
<configuration> <configuration>
<source>1.6</source> <source>1.6</source>
<target>1.6</target> <target>1.6</target>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId> <artifactId>maven-shade-plugin</artifactId>

View File

@ -13,13 +13,13 @@ import java.util.UUID;
@DatabaseTable(tableName = "accounts") @DatabaseTable(tableName = "accounts")
public class Account { public class Account {
@DatabaseField(id = true) @DatabaseField(id = true, canBeNull = false)
private String name; private String name;
@DatabaseField(index = true) @DatabaseField(index = true, canBeNull = false)
private String shortName; private String shortName;
@DatabaseField @DatabaseField(canBeNull = false)
private UUID uuid; private UUID uuid;
public Account() { public Account() {

View File

@ -3,6 +3,7 @@ package com.Acrobot.ChestShop.Listeners.Item;
import com.Acrobot.Breeze.Utils.BlockUtil; import com.Acrobot.Breeze.Utils.BlockUtil;
import com.Acrobot.ChestShop.Signs.ChestShopSign; import com.Acrobot.ChestShop.Signs.ChestShopSign;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryMoveItemEvent; import org.bukkit.event.inventory.InventoryMoveItemEvent;
@ -11,7 +12,7 @@ import org.bukkit.event.inventory.InventoryMoveItemEvent;
*/ */
public class ItemMoveListener implements Listener { public class ItemMoveListener implements Listener {
@EventHandler @EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST)
public static void onItemMove(InventoryMoveItemEvent event) { public static void onItemMove(InventoryMoveItemEvent event) {
if (event.getSource() == null || !BlockUtil.isChest(event.getSource().getHolder())) { if (event.getSource() == null || !BlockUtil.isChest(event.getSource().getHolder())) {
return; return;

View File

@ -45,6 +45,8 @@ public class WorldGuardProtection implements Listener {
} }
private boolean canAccess(LocalPlayer player, Block block, ApplicableRegionSet set) { private boolean canAccess(LocalPlayer player, Block block, ApplicableRegionSet set) {
return worldGuard.getGlobalRegionManager().hasBypass(player, block.getWorld()) || set.canBuild(player) || set.allows(DefaultFlag.CHEST_ACCESS, player); return worldGuard.getGlobalRegionManager().hasBypass(player, block.getWorld())
|| set.testState(player, DefaultFlag.BUILD)
|| set.testState(player, DefaultFlag.CHEST_ACCESS);
} }
} }