Changed name of 1 class and 1 variable

This commit is contained in:
Acrobot 2012-04-19 17:12:49 +02:00
parent 7f8fe5e6c1
commit e28548d534
5 changed files with 12 additions and 13 deletions

View File

@ -1,11 +1,11 @@
package com.Acrobot.ChestShop.Chests; package com.Acrobot.ChestShop.Containers;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
/** /**
* @author Acrobot * @author Acrobot
*/ */
public interface ChestObject { public interface Container {
public ItemStack[] getContents(); public ItemStack[] getContents();
public void setSlot(int slot, ItemStack item); public void setSlot(int slot, ItemStack item);

View File

@ -1,4 +1,4 @@
package com.Acrobot.ChestShop.Chests; package com.Acrobot.ChestShop.Containers;
import com.Acrobot.ChestShop.Utils.uBlock; import com.Acrobot.ChestShop.Utils.uBlock;
import com.Acrobot.ChestShop.Utils.uInventory; import com.Acrobot.ChestShop.Utils.uInventory;
@ -8,7 +8,7 @@ import org.bukkit.inventory.ItemStack;
/** /**
* @author Acrobot * @author Acrobot
*/ */
public class MinecraftChest implements ChestObject { public class MinecraftChest implements Container {
private final Chest chest; private final Chest chest;
public MinecraftChest(Chest chest) { public MinecraftChest(Chest chest) {

View File

@ -29,8 +29,7 @@ import java.util.HashMap;
* @author Acrobot * @author Acrobot
*/ */
public class playerInteract implements Listener { public class playerInteract implements Listener {
private static final HashMap<Player, Long> timeOfTheLatestSignClick = new HashMap<Player, Long>();
private static final HashMap<Player, Long> lastTransactionTime = new HashMap<Player, Long>(); //Last player's transaction
public static int interval = 100;//Minimal interval between transactions public static int interval = 100;//Minimal interval between transactions
@EventHandler(priority = EventPriority.HIGHEST) @EventHandler(priority = EventPriority.HIGHEST)
@ -61,7 +60,7 @@ public class playerInteract implements Listener {
return; return;
} }
lastTransactionTime.put(player, System.currentTimeMillis()); timeOfTheLatestSignClick.put(player, System.currentTimeMillis());
if (action == Action.RIGHT_CLICK_BLOCK) event.setCancelled(true); if (action == Action.RIGHT_CLICK_BLOCK) event.setCancelled(true);
@ -88,7 +87,7 @@ public class playerInteract implements Listener {
} }
private static boolean enoughTimeHasPassed(Player player) { private static boolean enoughTimeHasPassed(Player player) {
return !lastTransactionTime.containsKey(player) || (System.currentTimeMillis() - lastTransactionTime.get(player)) >= interval; return !timeOfTheLatestSignClick.containsKey(player) || (System.currentTimeMillis() - timeOfTheLatestSignClick.get(player)) >= interval;
} }
private static boolean hasAdminPermissions(Player player) { private static boolean hasAdminPermissions(Player player) {

View File

@ -1,7 +1,7 @@
package com.Acrobot.ChestShop.Shop; package com.Acrobot.ChestShop.Shop;
import com.Acrobot.ChestShop.ChestShop; import com.Acrobot.ChestShop.ChestShop;
import com.Acrobot.ChestShop.Chests.ChestObject; import com.Acrobot.ChestShop.Containers.Container;
import com.Acrobot.ChestShop.Config.Config; import com.Acrobot.ChestShop.Config.Config;
import com.Acrobot.ChestShop.Config.Language; import com.Acrobot.ChestShop.Config.Language;
import com.Acrobot.ChestShop.Config.Property; import com.Acrobot.ChestShop.Config.Property;
@ -19,14 +19,14 @@ import org.bukkit.inventory.ItemStack;
*/ */
public class Shop { public class Shop {
private final short durability; private final short durability;
private final ChestObject chest; private final Container chest;
public final ItemStack stock; public final ItemStack stock;
public int stockAmount; public int stockAmount;
public final String owner; public final String owner;
public final Sign sign; public final Sign sign;
public Shop(ChestObject chest, Sign sign, ItemStack... itemStacks) { public Shop(Container chest, Sign sign, ItemStack... itemStacks) {
this.stock = itemStacks[0]; this.stock = itemStacks[0];
this.durability = stock.getDurability(); this.durability = stock.getDurability();
this.chest = chest; this.chest = chest;
@ -208,7 +208,7 @@ public class Shop {
return uInventory.fits(player.getInventory(), stock, stockAmount, durability) <= 0; return uInventory.fits(player.getInventory(), stock, stockAmount, durability) <= 0;
} }
private boolean stockFitsChest(ChestObject chest) { private boolean stockFitsChest(Container chest) {
return chest.fits(stock, stockAmount, durability); return chest.fits(stock, stockAmount, durability);
} }

View File

@ -1,6 +1,6 @@
package com.Acrobot.ChestShop.Shop; package com.Acrobot.ChestShop.Shop;
import com.Acrobot.ChestShop.Chests.MinecraftChest; import com.Acrobot.ChestShop.Containers.MinecraftChest;
import com.Acrobot.ChestShop.Items.Items; import com.Acrobot.ChestShop.Items.Items;
import com.Acrobot.ChestShop.Utils.uBlock; import com.Acrobot.ChestShop.Utils.uBlock;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;