mirror of
https://github.com/EarthMC/QuickShop-Reremake.git
synced 2026-11-24 17:39:52 -05:00
修正过时的方法
This commit is contained in:
1 parent
9afc0fa174
commit
955544363f
10 files changed
+40
-275
No files matched your search
@@ -396,7 +396,6 @@ public class QS implements CommandExecutor {
|
||||
return;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void setPrice(CommandSender sender, String[] args) {
|
||||
if (sender instanceof Player && sender.hasPermission("quickshop.create.changeprice")) {
|
||||
Player p = (Player) sender;
|
||||
@@ -440,7 +439,11 @@ public class QS implements CommandExecutor {
|
||||
return;
|
||||
}
|
||||
sender.sendMessage(MsgUtil.getMessage("fee-charged-for-price-change", plugin.getEcon().format(fee)));
|
||||
plugin.getEcon().deposit(plugin.getConfig().getString("tax-account"), fee);
|
||||
for(OfflinePlayer player : Bukkit.getOfflinePlayers()) {
|
||||
if(player.getName().equals(plugin.getConfig().getString("tax-account"))) {
|
||||
plugin.getEcon().deposit(player.getUniqueId(), fee);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Update the shop
|
||||
shop.setPrice(price);
|
||||
|
||||
@@ -18,64 +18,6 @@ public class Economy implements EconomyCore {
|
||||
return core.isValid();
|
||||
}
|
||||
|
||||
/**
|
||||
* Deposits a given amount of money from thin air to the given username.
|
||||
*
|
||||
* @param name
|
||||
* The exact (case insensitive) username to give money to
|
||||
* @param amount
|
||||
* The amount to give them
|
||||
* @return True if success (Should be almost always)
|
||||
*/
|
||||
@Deprecated
|
||||
public boolean deposit(String name, double amount) {
|
||||
return core.deposit(name, amount);
|
||||
}
|
||||
|
||||
/**
|
||||
* Withdraws a given amount of money from the given username and turns it to
|
||||
* thin air.
|
||||
*
|
||||
* @param name
|
||||
* The exact (case insensitive) username to take money from
|
||||
* @param amount
|
||||
* The amount to take from them
|
||||
* @return True if success, false if they didn't have enough cash
|
||||
*/
|
||||
@Deprecated
|
||||
public boolean withdraw(String name, double amount) {
|
||||
return core.withdraw(name, amount);
|
||||
}
|
||||
|
||||
/**
|
||||
* Transfers the given amount of money from Player1 to Player2
|
||||
*
|
||||
* @param from
|
||||
* The player who is paying money
|
||||
* @param to
|
||||
* The player who is receiving money
|
||||
* @param amount
|
||||
* The amount to transfer
|
||||
* @return true if success (Payer had enough cash, receiver was able to
|
||||
* receive the funds)
|
||||
*/
|
||||
@Deprecated
|
||||
public boolean transfer(String from, String to, double amount) {
|
||||
return core.transfer(from, to, amount);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the balance of the given account name
|
||||
*
|
||||
* @param name
|
||||
* The name of the account
|
||||
* @return Their current balance.
|
||||
*/
|
||||
@Deprecated
|
||||
public double getBalance(String name) {
|
||||
return core.getBalance(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats the given number... E.g. 50.5 becomes $50.5 Dollars, or 50
|
||||
* Dollars 5 Cents
|
||||
@@ -87,11 +29,7 @@ public class Economy implements EconomyCore {
|
||||
public String format(double balance) {
|
||||
return core.format(balance);
|
||||
}
|
||||
@Deprecated
|
||||
public boolean has(String name, double amount) {
|
||||
return core.getBalance(name) >= amount;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return core.getClass().getName().split("_")[1];
|
||||
|
||||
@@ -13,55 +13,6 @@ public interface EconomyCore {
|
||||
*/
|
||||
public boolean isValid();
|
||||
|
||||
/**
|
||||
* Deposits a given amount of money from thin air to the given username.
|
||||
*
|
||||
* @param name
|
||||
* The exact (case insensitive) username to give money to
|
||||
* @param amount
|
||||
* The amount to give them
|
||||
* @return True if success (Should be almost always)
|
||||
*/
|
||||
@Deprecated
|
||||
public boolean deposit(String name, double amount);
|
||||
|
||||
/**
|
||||
* Withdraws a given amount of money from the given username and turns it to
|
||||
* thin air.
|
||||
*
|
||||
* @param name
|
||||
* The exact (case insensitive) username to take money from
|
||||
* @param amount
|
||||
* The amount to take from them
|
||||
* @return True if success, false if they didn't have enough cash
|
||||
*/
|
||||
@Deprecated
|
||||
public boolean withdraw(String name, double amount);
|
||||
|
||||
/**
|
||||
* Transfers the given amount of money from Player1 to Player2
|
||||
*
|
||||
* @param from
|
||||
* The player who is paying money
|
||||
* @param to
|
||||
* The player who is receiving money
|
||||
* @param amount
|
||||
* The amount to transfer
|
||||
* @return true if success (Payer had enough cash, receiver was able to
|
||||
* receive the funds)
|
||||
*/
|
||||
@Deprecated
|
||||
public boolean transfer(String from, String to, double amount);
|
||||
|
||||
/**
|
||||
* Fetches the balance of the given account name
|
||||
*
|
||||
* @param name
|
||||
* The name of the account
|
||||
* @return Their current balance.
|
||||
*/
|
||||
@Deprecated
|
||||
public double getBalance(String name);
|
||||
|
||||
/**
|
||||
* Formats the given number... E.g. 50.5 becomes $50.5 Dollars, or 50
|
||||
|
||||
@@ -28,39 +28,6 @@ public class Economy_Vault implements EconomyCore {
|
||||
return this.vault != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public boolean deposit(String name, double amount) {
|
||||
return this.vault.depositPlayer(name, amount).transactionSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public boolean withdraw(String name, double amount) {
|
||||
return this.vault.withdrawPlayer(name, amount).transactionSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public boolean transfer(String from, String to, double amount) {
|
||||
if (this.vault.getBalance(from) >= amount) {
|
||||
if (this.vault.withdrawPlayer(from, amount).transactionSuccess()) {
|
||||
if (!this.vault.depositPlayer(to, amount).transactionSuccess()) {
|
||||
this.vault.depositPlayer(from, amount);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public double getBalance(String name) {
|
||||
return this.vault.getBalance(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String format(double balance) {
|
||||
|
||||
@@ -69,7 +69,7 @@ public class BlockListener implements Listener {
|
||||
return;
|
||||
}
|
||||
// Cancel their current menu... Doesnt cancel other's menu's.
|
||||
Info action = plugin.getShopManager().getActions().get(p.getName());
|
||||
Info action = plugin.getShopManager().getActions().get(p.getUniqueId());
|
||||
if (action != null) {
|
||||
action.setAction(ShopAction.CANCELLED);
|
||||
}
|
||||
|
||||
@@ -14,11 +14,11 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.entity.EntityPickupItemEvent;
|
||||
import org.bukkit.event.inventory.InventoryCloseEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerMoveEvent;
|
||||
import org.bukkit.event.player.PlayerPickupItemEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
@@ -53,7 +53,6 @@ public class PlayerListener implements Listener {
|
||||
* Handles players left clicking a chest. Left click a NORMAL chest with
|
||||
* item : Send creation menu Left click a SHOP chest : Send purchase menu
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onClick(PlayerInteractEvent e) {
|
||||
if (e.getAction() != Action.LEFT_CLICK_BLOCK)
|
||||
@@ -191,7 +190,7 @@ public class PlayerListener implements Listener {
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerPickup(PlayerPickupItemEvent e) {
|
||||
public void onPlayerPickup(EntityPickupItemEvent e) {
|
||||
ItemStack stack = e.getItem().getItemStack();
|
||||
try {
|
||||
if (stack.getItemMeta().getDisplayName().startsWith(ChatColor.RED + "QuickShop ")) {
|
||||
|
||||
@@ -11,11 +11,11 @@ import org.bukkit.ChatColor;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
@@ -276,7 +276,6 @@ public class ShopManager {
|
||||
final String message = ChatColor.stripColor(msg);
|
||||
// Use from the main thread, because Bukkit hates life
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public void run() {
|
||||
HashMap<UUID, Info> actions = getActions();
|
||||
@@ -330,7 +329,7 @@ public class ShopManager {
|
||||
double tax = plugin.getConfig().getDouble("shop.cost");
|
||||
// Tax refers to the cost to create a shop. Not actual
|
||||
// tax, that would be silly
|
||||
if (tax != 0 && plugin.getEcon().getBalance(p.getName()) < tax) {
|
||||
if (tax != 0 && plugin.getEcon().getBalance(p.getUniqueId()) < tax) {
|
||||
p.sendMessage(MsgUtil.getMessage("you-cant-afford-a-new-shop", format(tax)));
|
||||
return;
|
||||
}
|
||||
@@ -347,12 +346,16 @@ public class ShopManager {
|
||||
// Else, if the event is cancelled, they won't get their
|
||||
// money back.
|
||||
if (tax != 0) {
|
||||
if (!plugin.getEcon().withdraw(p.getName(), tax)) {
|
||||
if (!plugin.getEcon().withdraw(p.getUniqueId(), tax)) {
|
||||
p.sendMessage(MsgUtil.getMessage("you-cant-afford-a-new-shop", format(tax)));
|
||||
shop.onUnload();
|
||||
return;
|
||||
}
|
||||
plugin.getEcon().deposit(plugin.getConfig().getString("tax-account"), tax);
|
||||
for(OfflinePlayer player : Bukkit.getOfflinePlayers()) {
|
||||
if(player.getName().equals(plugin.getConfig().getString("tax-account"))) {
|
||||
plugin.getEcon().deposit(player.getUniqueId(), tax);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* The shop has hereforth been successfully created */
|
||||
createShop(shop);
|
||||
@@ -472,8 +475,8 @@ public class ShopManager {
|
||||
if (!p.getUniqueId().equals(shop.getOwner())) {
|
||||
// Check their balance. Works with *most* economy
|
||||
// plugins*
|
||||
if (plugin.getEcon().getBalance(p.getName()) < amount * shop.getPrice()) {
|
||||
p.sendMessage(MsgUtil.getMessage("you-cant-afford-to-buy", format(amount * shop.getPrice()), format(plugin.getEcon().getBalance(p.getName()))));
|
||||
if (plugin.getEcon().getBalance(p.getUniqueId()) < amount * shop.getPrice()) {
|
||||
p.sendMessage(MsgUtil.getMessage("you-cant-afford-to-buy", format(amount * shop.getPrice()), format(plugin.getEcon().getBalance(p.getUniqueId()))));
|
||||
return;
|
||||
}
|
||||
// Don't tax them if they're purchasing from
|
||||
@@ -486,13 +489,17 @@ public class ShopManager {
|
||||
|
||||
double total = amount * shop.getPrice();
|
||||
if (!plugin.getEcon().withdraw(p.getUniqueId(), total)) {
|
||||
p.sendMessage(MsgUtil.getMessage("you-cant-afford-to-buy", format(amount * shop.getPrice()), format(plugin.getEcon().getBalance(p.getName()))));
|
||||
p.sendMessage(MsgUtil.getMessage("you-cant-afford-to-buy", format(amount * shop.getPrice()), format(plugin.getEcon().getBalance(p.getUniqueId()))));
|
||||
return;
|
||||
}
|
||||
if (!shop.isUnlimited() || plugin.getConfig().getBoolean("shop.pay-unlimited-shop-owners")) {
|
||||
plugin.getEcon().deposit(shop.getOwner(), total * (1 - tax));
|
||||
if (tax != 0) {
|
||||
plugin.getEcon().deposit(plugin.getConfig().getString("tax-account"), total * tax);
|
||||
for(OfflinePlayer player : Bukkit.getOfflinePlayers()) {
|
||||
if(player.getName().equals(plugin.getConfig().getString("tax-account"))) {
|
||||
plugin.getEcon().deposit(player.getUniqueId(), total * tax);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Notify the shop owner
|
||||
@@ -557,11 +564,15 @@ public class ShopManager {
|
||||
return;
|
||||
}
|
||||
if (tax != 0) {
|
||||
plugin.getEcon().deposit(plugin.getConfig().getString("tax-account"), total * tax);
|
||||
for(OfflinePlayer player : Bukkit.getOfflinePlayers()) {
|
||||
if(player.getName().equals(plugin.getConfig().getString("tax-account"))) {
|
||||
plugin.getEcon().deposit(player.getUniqueId(), total * tax);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Give them the money after we know we succeeded
|
||||
plugin.getEcon().deposit(p.getName(), total * (1 - tax));
|
||||
plugin.getEcon().deposit(p.getUniqueId(), total * (1 - tax));
|
||||
// Notify the owner of the purchase.
|
||||
String msg = MsgUtil.getMessage("player-sold-to-your-store", p.getName(), "" + amount, shop.getDataName());
|
||||
if (space == amount)
|
||||
|
||||
@@ -163,7 +163,7 @@ public class MsgUtil {
|
||||
if (enchs != null && !enchs.isEmpty()) {
|
||||
p.sendMessage(ChatColor.DARK_PURPLE + "+--------------------" + MsgUtil.getMessage("menu.enchants") + "-----------------------+");
|
||||
for (Entry<Enchantment, Integer> entries : enchs.entrySet()) {
|
||||
p.sendMessage(ChatColor.DARK_PURPLE + "| " + ChatColor.YELLOW + entries.getKey().getName() + " " + entries.getValue());
|
||||
p.sendMessage(ChatColor.DARK_PURPLE + "| " + ChatColor.YELLOW + entries.getKey() + " " + entries.getValue());
|
||||
}
|
||||
}
|
||||
try {
|
||||
@@ -175,7 +175,7 @@ public class MsgUtil {
|
||||
if (enchs != null && !enchs.isEmpty()) {
|
||||
p.sendMessage(ChatColor.DARK_PURPLE + "+-----------------" + MsgUtil.getMessage("menu.stored-enchants") + "--------------------+");
|
||||
for (Entry<Enchantment, Integer> entries : enchs.entrySet()) {
|
||||
p.sendMessage(ChatColor.DARK_PURPLE + "| " + ChatColor.YELLOW + entries.getKey().getName() + " " + entries.getValue());
|
||||
p.sendMessage(ChatColor.DARK_PURPLE + "| " + ChatColor.YELLOW + entries.getKey() + " " + entries.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -194,14 +194,14 @@ public class MsgUtil {
|
||||
if (enchs != null && !enchs.isEmpty()) {
|
||||
p.sendMessage(ChatColor.DARK_PURPLE + "+--------------------" + MsgUtil.getMessage("menu.enchants") + "-----------------------+");
|
||||
for (Entry<Enchantment, Integer> entries : enchs.entrySet()) {
|
||||
p.sendMessage(ChatColor.DARK_PURPLE + "| " + ChatColor.YELLOW + entries.getKey().getName() + " " + entries.getValue());
|
||||
p.sendMessage(ChatColor.DARK_PURPLE + "| " + ChatColor.YELLOW + entries.getKey() + " " + entries.getValue());
|
||||
}
|
||||
}
|
||||
enchs = shop.getItem().getItemMeta().getEnchants();
|
||||
if (enchs != null && !enchs.isEmpty()) {
|
||||
p.sendMessage(ChatColor.DARK_PURPLE + "+-----------------" + MsgUtil.getMessage("menu.stored-enchants") + "--------------------+");
|
||||
for (Entry<Enchantment, Integer> entries : enchs.entrySet()) {
|
||||
p.sendMessage(ChatColor.DARK_PURPLE + "| " + ChatColor.YELLOW + entries.getKey().getName() + " " + entries.getValue());
|
||||
p.sendMessage(ChatColor.DARK_PURPLE + "| " + ChatColor.YELLOW + entries.getKey() + " " + entries.getValue());
|
||||
}
|
||||
}
|
||||
try {
|
||||
@@ -213,7 +213,7 @@ public class MsgUtil {
|
||||
if (enchs != null && !enchs.isEmpty()) {
|
||||
p.sendMessage(ChatColor.DARK_PURPLE + "+-----------------" + MsgUtil.getMessage("menu.stored-enchants") + "--------------------+");
|
||||
for (Entry<Enchantment, Integer> entries : enchs.entrySet()) {
|
||||
p.sendMessage(ChatColor.DARK_PURPLE + "| " + ChatColor.YELLOW + entries.getKey().getName() + " " + entries.getValue());
|
||||
p.sendMessage(ChatColor.DARK_PURPLE + "| " + ChatColor.YELLOW + entries.getKey() + " " + entries.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -243,7 +243,7 @@ public class MsgUtil {
|
||||
if (enchs != null && !enchs.isEmpty()) {
|
||||
p.sendMessage(ChatColor.DARK_PURPLE + "+--------------------" + MsgUtil.getMessage("menu.enchants") + "-----------------------+");
|
||||
for (Entry<Enchantment, Integer> entries : enchs.entrySet()) {
|
||||
p.sendMessage(ChatColor.DARK_PURPLE + "| " + ChatColor.YELLOW + entries.getKey().getName() + " " + entries.getValue());
|
||||
p.sendMessage(ChatColor.DARK_PURPLE + "| " + ChatColor.YELLOW + entries.getKey() + " " + entries.getValue());
|
||||
}
|
||||
}
|
||||
try {
|
||||
@@ -255,7 +255,7 @@ public class MsgUtil {
|
||||
if (enchs != null && !enchs.isEmpty()) {
|
||||
p.sendMessage(ChatColor.DARK_PURPLE + "+--------------------" + MsgUtil.getMessage("menu.stored-enchants") + "-----------------------+");
|
||||
for (Entry<Enchantment, Integer> entries : enchs.entrySet()) {
|
||||
p.sendMessage(ChatColor.DARK_PURPLE + "| " + ChatColor.YELLOW + entries.getKey().getName() + " " + entries.getValue());
|
||||
p.sendMessage(ChatColor.DARK_PURPLE + "| " + ChatColor.YELLOW + entries.getKey() + " " + entries.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,10 @@
|
||||
package org.maxgamer.quickshop.Util;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataInput;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutput;
|
||||
import java.io.DataOutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
import java.util.zip.GZIPOutputStream;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
@@ -20,14 +14,12 @@ import org.bukkit.entity.Item;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.bukkit.inventory.meta.PotionMeta;
|
||||
import org.bukkit.potion.Potion;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
import org.bukkit.potion.PotionType;
|
||||
import org.maxgamer.quickshop.QuickShop;
|
||||
import org.maxgamer.quickshop.Util.CustomPotionsName.GenericPotionData;
|
||||
import org.maxgamer.quickshop.Util.CustomPotionsName.GenericPotionData.Category;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class NMS {
|
||||
private static ArrayList<NMSDependent> nmsDependencies = new ArrayList<NMSDependent>();
|
||||
private static int nextId = 0;
|
||||
|
||||
@@ -38,7 +38,6 @@ public class Util {
|
||||
private static HashSet<Material> tools = new HashSet<Material>();
|
||||
private static HashSet<Material> blacklist = new HashSet<Material>();
|
||||
private static HashSet<Material> shoppables = new HashSet<Material>();
|
||||
private static HashSet<Material> transparent = new HashSet<Material>();
|
||||
private static Map<Material, Entry<Double,Double>> restrictedPrices = new HashMap<Material, Entry<Double,Double>>();
|
||||
private static QuickShop plugin;
|
||||
private static Method storageContents;
|
||||
@@ -47,7 +46,6 @@ public class Util {
|
||||
tools.clear();
|
||||
blacklist.clear();
|
||||
shoppables.clear();
|
||||
transparent.clear();
|
||||
restrictedPrices.clear();
|
||||
|
||||
plugin = QuickShop.instance;
|
||||
@@ -125,93 +123,7 @@ public class Util {
|
||||
}
|
||||
}
|
||||
blacklist.add(mat);
|
||||
}
|
||||
|
||||
// ToDo: add extras to config file
|
||||
addTransparentBlock(Material.AIR);
|
||||
/* Misc */
|
||||
addTransparentBlock(Material.CAKE);
|
||||
/* Redstone Material */
|
||||
addTransparentBlock(Material.REDSTONE_WIRE);
|
||||
/* Redstone Torches */
|
||||
addTransparentBlock(Material.REDSTONE_TORCH);
|
||||
/* Diodes (Repeaters) */
|
||||
addTransparentBlock(Material.LEGACY_DIODE_BLOCK_OFF);
|
||||
addTransparentBlock(Material.LEGACY_DIODE_BLOCK_ON);
|
||||
/* Power Sources */
|
||||
addTransparentBlock(Material.DETECTOR_RAIL);
|
||||
addTransparentBlock(Material.LEVER);
|
||||
addTransparentBlock(Material.STONE_BUTTON);
|
||||
addTransparentBlock(Material.LEGACY_WOOD_BUTTON);
|
||||
addTransparentBlock(Material.LEGACY_STONE_PLATE);
|
||||
addTransparentBlock(Material.LEGACY_WOOD_PLATE);
|
||||
/* Nature Material */
|
||||
addTransparentBlock(Material.RED_MUSHROOM);
|
||||
addTransparentBlock(Material.BROWN_MUSHROOM);
|
||||
addTransparentBlock(Material.LEGACY_RED_ROSE);
|
||||
addTransparentBlock(Material.LEGACY_YELLOW_FLOWER);
|
||||
addTransparentBlock(Material.FLOWER_POT);
|
||||
/* Greens */
|
||||
addTransparentBlock(Material.LEGACY_LONG_GRASS);
|
||||
addTransparentBlock(Material.VINE);
|
||||
addTransparentBlock(Material.LEGACY_WATER_LILY);
|
||||
/* Seedy things */
|
||||
addTransparentBlock(Material.MELON_STEM);
|
||||
addTransparentBlock(Material.PUMPKIN_STEM);
|
||||
addTransparentBlock(Material.LEGACY_CROPS);
|
||||
addTransparentBlock(Material.LEGACY_NETHER_WARTS);
|
||||
/* Semi-nature */
|
||||
addTransparentBlock(Material.SNOW);
|
||||
addTransparentBlock(Material.FIRE);
|
||||
addTransparentBlock(Material.COBWEB);
|
||||
addTransparentBlock(Material.TRIPWIRE);
|
||||
addTransparentBlock(Material.TRIPWIRE_HOOK);
|
||||
/* Stairs */
|
||||
addTransparentBlock(Material.COBBLESTONE_STAIRS);
|
||||
addTransparentBlock(Material.BRICK_STAIRS);
|
||||
addTransparentBlock(Material.SANDSTONE_STAIRS);
|
||||
addTransparentBlock(Material.NETHER_BRICK_STAIRS);
|
||||
addTransparentBlock(Material.LEGACY_SMOOTH_STAIRS);
|
||||
/* Wood Stairs */
|
||||
addTransparentBlock(Material.LEGACY_BIRCH_WOOD_STAIRS);
|
||||
addTransparentBlock(Material.LEGACY_WOOD_STAIRS);
|
||||
addTransparentBlock(Material.LEGACY_JUNGLE_WOOD_STAIRS);
|
||||
addTransparentBlock(Material.LEGACY_SPRUCE_WOOD_STAIRS);
|
||||
addTransparentBlock(Material.PURPUR_STAIRS);
|
||||
addTransparentBlock(Material.DARK_PRISMARINE_STAIRS);
|
||||
addTransparentBlock(Material.PRISMARINE_STAIRS);
|
||||
addTransparentBlock(Material.PRISMARINE_BRICK_STAIRS);
|
||||
/* Lava & Water */
|
||||
addTransparentBlock(Material.LAVA);
|
||||
addTransparentBlock(Material.LEGACY_STATIONARY_LAVA);
|
||||
addTransparentBlock(Material.WATER);
|
||||
addTransparentBlock(Material.LEGACY_STATIONARY_WATER);
|
||||
/* Saplings and bushes */
|
||||
addTransparentBlock(Material.LEGACY_SAPLING);
|
||||
addTransparentBlock(Material.DEAD_BUSH);
|
||||
/* Construction Material */
|
||||
/* Fences */
|
||||
addTransparentBlock(Material.LEGACY_FENCE);
|
||||
addTransparentBlock(Material.LEGACY_FENCE_GATE);
|
||||
addTransparentBlock(Material.LEGACY_IRON_FENCE);
|
||||
addTransparentBlock(Material.LEGACY_NETHER_FENCE);
|
||||
/* Ladders, Signs */
|
||||
addTransparentBlock(Material.LADDER);
|
||||
addTransparentBlock(Material.LEGACY_SIGN_POST);
|
||||
addTransparentBlock(Material.WALL_SIGN);
|
||||
/* Bed */
|
||||
addTransparentBlock(Material.LEGACY_BED_BLOCK);
|
||||
/* Pistons */
|
||||
addTransparentBlock(Material.LEGACY_PISTON_EXTENSION);
|
||||
addTransparentBlock(Material.LEGACY_PISTON_MOVING_PIECE);
|
||||
addTransparentBlock(Material.LEGACY_RAILS);
|
||||
/* Torch & Trapdoor */
|
||||
addTransparentBlock(Material.TORCH);
|
||||
addTransparentBlock(Material.LEGACY_TRAP_DOOR);
|
||||
/* New */
|
||||
addTransparentBlock(Material.BREWING_STAND);
|
||||
addTransparentBlock(Material.LEGACY_WOODEN_DOOR);
|
||||
addTransparentBlock(Material.LEGACY_WOOD_STEP);
|
||||
}
|
||||
|
||||
for (String s : plugin.getConfig().getStringList("price-restriction")) {
|
||||
String[] sp = s.split(";");
|
||||
@@ -246,18 +158,10 @@ public class Util {
|
||||
}
|
||||
|
||||
public static boolean isTransparent(Material m) {
|
||||
boolean trans = transparent.contains(m);
|
||||
boolean trans = m.isTransparent();
|
||||
return trans;
|
||||
}
|
||||
|
||||
public static void addTransparentBlock(Material m) {
|
||||
if (transparent.add(m) == false) {
|
||||
System.out.println("Already added as transparent: " + m.toString());
|
||||
}
|
||||
if (!m.isBlock())
|
||||
System.out.println(m + " is not a block!");
|
||||
}
|
||||
|
||||
public static void parseColours(YamlConfiguration config) {
|
||||
Set<String> keys = config.getKeys(true);
|
||||
for (String key : keys) {
|
||||
|
||||
Reference in new issue
Block a user