mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-11-27 04:25:14 +01:00
Changed name of 1 class and 1 variable
This commit is contained in:
parent
7f8fe5e6c1
commit
e28548d534
@ -1,11 +1,11 @@
|
||||
package com.Acrobot.ChestShop.Chests;
|
||||
package com.Acrobot.ChestShop.Containers;
|
||||
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
/**
|
||||
* @author Acrobot
|
||||
*/
|
||||
public interface ChestObject {
|
||||
public interface Container {
|
||||
public ItemStack[] getContents();
|
||||
|
||||
public void setSlot(int slot, ItemStack item);
|
@ -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.uInventory;
|
||||
@ -8,7 +8,7 @@ import org.bukkit.inventory.ItemStack;
|
||||
/**
|
||||
* @author Acrobot
|
||||
*/
|
||||
public class MinecraftChest implements ChestObject {
|
||||
public class MinecraftChest implements Container {
|
||||
private final Chest chest;
|
||||
|
||||
public MinecraftChest(Chest chest) {
|
@ -29,8 +29,7 @@ import java.util.HashMap;
|
||||
* @author Acrobot
|
||||
*/
|
||||
public class playerInteract implements Listener {
|
||||
|
||||
private static final HashMap<Player, Long> lastTransactionTime = new HashMap<Player, Long>(); //Last player's transaction
|
||||
private static final HashMap<Player, Long> timeOfTheLatestSignClick = new HashMap<Player, Long>();
|
||||
public static int interval = 100;//Minimal interval between transactions
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
@ -61,7 +60,7 @@ public class playerInteract implements Listener {
|
||||
return;
|
||||
}
|
||||
|
||||
lastTransactionTime.put(player, System.currentTimeMillis());
|
||||
timeOfTheLatestSignClick.put(player, System.currentTimeMillis());
|
||||
|
||||
if (action == Action.RIGHT_CLICK_BLOCK) event.setCancelled(true);
|
||||
|
||||
@ -88,7 +87,7 @@ public class playerInteract implements Listener {
|
||||
}
|
||||
|
||||
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) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.Acrobot.ChestShop.Shop;
|
||||
|
||||
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.Language;
|
||||
import com.Acrobot.ChestShop.Config.Property;
|
||||
@ -19,14 +19,14 @@ import org.bukkit.inventory.ItemStack;
|
||||
*/
|
||||
public class Shop {
|
||||
private final short durability;
|
||||
private final ChestObject chest;
|
||||
private final Container chest;
|
||||
|
||||
public final ItemStack stock;
|
||||
public int stockAmount;
|
||||
public final String owner;
|
||||
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.durability = stock.getDurability();
|
||||
this.chest = chest;
|
||||
@ -208,7 +208,7 @@ public class Shop {
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
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.Utils.uBlock;
|
||||
import org.bukkit.ChatColor;
|
||||
|
Loading…
Reference in New Issue
Block a user