First MC 1.5 version

This commit is contained in:
Acrobot 2013-03-16 19:27:24 +01:00
parent d908e904a2
commit 775dbe5afe
8 changed files with 16 additions and 18 deletions

View File

@ -6,7 +6,7 @@
<groupId>com.acrobot.chestshop</groupId>
<artifactId>chestshop</artifactId>
<version>3.50-t0053</version>
<version>3.50-t0054</version>
<description>Chest-and-sign shop plugin for Bukkit</description>
<scm>
@ -18,7 +18,7 @@
<repositories>
<repository>
<id>bukkit-repo</id>
<url>http://repo.bukkit.org/content/repositories/releases/</url>
<url>http://repo.bukkit.org/content/repositories/snapshots/</url>
</repository>
<repository>
<id>odditem-repo</id>
@ -38,7 +38,7 @@
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.4.7-R1.0</version>
<version>1.5-R0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.palmergames.towny</groupId>

View File

@ -1,7 +1,7 @@
package com.Acrobot.Breeze.Utils;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.Chest;
import org.bukkit.block.Sign;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
@ -29,7 +29,7 @@ public class BlockUtil {
* @return Is this block a chest?
*/
public static boolean isChest(Block block) {
return block.getType() == Material.CHEST;
return block.getState() instanceof Chest;
}
/**

View File

@ -30,7 +30,7 @@ public class BlockPlace implements Listener {
Block placed = event.getBlockPlaced();
if (placed.getType() != Material.CHEST) {
if (!BlockUtil.isChest(placed) && placed.getType() != Material.DROPPER && placed.getType() != Material.HOPPER) {
return;
}

View File

@ -1,5 +1,6 @@
package com.Acrobot.ChestShop.Listeners.Block.Break;
import com.Acrobot.Breeze.Utils.BlockUtil;
import com.Acrobot.ChestShop.Configuration.Properties;
import com.Acrobot.ChestShop.Listeners.Player.PlayerInteract;
import com.Acrobot.ChestShop.Plugins.ChestShop;
@ -11,8 +12,6 @@ import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.entity.EntityExplodeEvent;
import static org.bukkit.Material.CHEST;
/**
* @author Acrobot
*/
@ -39,7 +38,7 @@ public class ChestBreak implements Listener {
}
private static boolean canChestBeBroken(Block chest, Player breaker) {
if (chest.getType() != CHEST || !Properties.USE_BUILT_IN_PROTECTION || !ChestShopSign.isShopChest(chest)) {
if (!BlockUtil.isChest(chest) || !Properties.USE_BUILT_IN_PROTECTION || !ChestShopSign.isShopChest(chest)) {
return true;
}

View File

@ -1,5 +1,6 @@
package com.Acrobot.ChestShop.Listeners.PostShopCreation;
import com.Acrobot.Breeze.Utils.BlockUtil;
import com.Acrobot.ChestShop.Configuration.Properties;
import com.Acrobot.ChestShop.Events.ShopCreatedEvent;
import com.Acrobot.ChestShop.Signs.ChestShopSign;
@ -39,7 +40,7 @@ public class SignSticker implements Listener {
BlockFace chestFace = null;
for (BlockFace face : uBlock.CHEST_EXTENSION_FACES) {
if (signBlock.getRelative(face).getType() == Material.CHEST) {
if (BlockUtil.isChest(signBlock.getRelative(face))) {
chestFace = face;
break;
}

View File

@ -6,7 +6,6 @@ import com.Acrobot.ChestShop.Events.Protection.ProtectBlockEvent;
import com.Acrobot.ChestShop.Events.Protection.ProtectionCheckEvent;
import com.Acrobot.ChestShop.Signs.ChestShopSign;
import com.Acrobot.ChestShop.Utils.uName;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.block.Sign;
@ -46,7 +45,7 @@ public class Security {
for (BlockFace face : BLOCKS_AROUND) {
Block block = signBlock.getRelative(face);
if (block.getType() != Material.CHEST) {
if (!BlockUtil.isChest(block)) {
continue;
}
if (!canAccess(player, block)) {

View File

@ -5,7 +5,6 @@ import com.Acrobot.ChestShop.Configuration.Properties;
import com.Acrobot.ChestShop.Containers.AdminInventory;
import com.Acrobot.ChestShop.Utils.uBlock;
import com.Acrobot.ChestShop.Utils.uName;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.Chest;
import org.bukkit.block.Sign;
@ -55,7 +54,7 @@ public class ChestShopSign {
}
public static boolean isShopChest(Block chest) {
if (chest.getType() != Material.CHEST) {
if (!BlockUtil.isChest(chest)) {
return false;
}

View File

@ -2,7 +2,6 @@ package com.Acrobot.ChestShop.Utils;
import com.Acrobot.Breeze.Utils.BlockUtil;
import com.Acrobot.ChestShop.Signs.ChestShopSign;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.block.Chest;
@ -32,7 +31,7 @@ public class uBlock {
for (BlockFace chestFace : NEIGHBOR_FACES) {
Block relative = chestBlock.getRelative(chestFace);
if (relative.getState() instanceof Chest) {
if (BlockUtil.isChest(relative)) {
return (Chest) relative.getState();
}
}
@ -48,7 +47,7 @@ public class uBlock {
public static Chest findConnectedChest(Block block) {
for (BlockFace bf : SHOP_FACES) {
Block faceBlock = block.getRelative(bf);
if (faceBlock.getType() == Material.CHEST) {
if (BlockUtil.isChest(faceBlock)) {
return (Chest) faceBlock.getState();
}
}
@ -99,7 +98,8 @@ public class uBlock {
public static Chest findNeighbor(Block block) {
for (BlockFace blockFace : CHEST_EXTENSION_FACES) {
Block neighborBlock = block.getRelative(blockFace);
if (neighborBlock.getType() == Material.CHEST) {
if (BlockUtil.isChest(neighborBlock)) {
return (Chest) neighborBlock.getState();
}
}