Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/com/codisimus/plugins/buttonwarp/ButtonWarp.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.*;
import java.util.Arrays;
import java.util.Collection;
import java.util.Properties;
import java.util.TreeMap;
import java.util.logging.Logger;
import net.milkbowl.vault.economy.Economy;
import net.milkbowl.vault.permission.Permission;

import org.bukkit.Server;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
Expand All @@ -16,6 +18,8 @@
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;

import net.milkbowl.vault.economy.Economy;

/**
* Loads Plugin and manages Data/Permissions
*
Expand Down
14 changes: 7 additions & 7 deletions src/com/codisimus/plugins/buttonwarp/ButtonWarpCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ private static void move(Player player, String name, boolean noWhere) {
*/
private static void link(Player player, String name) {
//Cancel if the Player is not targeting a correct Block type
Block block = player.getTargetBlock(null, 10);
Block block = player.getTargetBlock((Set<Material>)null, 10);
Material type = block.getType();
if (!LINKABLE.contains(type)) {
player.sendMessage("§4You are targeting a §6" + type.name()
Expand Down Expand Up @@ -533,7 +533,7 @@ private static void link(Player player, String name) {
*/
private static void unlink(Player player) {
//Cancel if the Player is not targeting a correct Block type
Block block = player.getTargetBlock(null, 10);
Block block = player.getTargetBlock((Set<Material>)null, 10);
Material type = block.getType();
if (!LINKABLE.contains(type)) {
player.sendMessage("§4You are targeting a §6" + type.name()
Expand Down Expand Up @@ -780,7 +780,7 @@ private static void global(Player player, String name, boolean global) {
* @param max The new maximum amount
*/
private static void max(Player player, int max) {
Block block = player.getTargetBlock(null, 10);
Block block = player.getTargetBlock((Set<Material>)null, 10);

//Find the Warp that will be modified using the target Block
Warp warp = ButtonWarp.findWarp(block);
Expand All @@ -805,7 +805,7 @@ private static void max(Player player, int max) {
* @param player The Player modifying the Button
*/
private static void allow(Player player) {
Block block = player.getTargetBlock(null, 10);
Block block = player.getTargetBlock((Set<Material>)null, 10);

//Find the Warp that will be modified using the target Block
Warp warp = ButtonWarp.findWarp(block);
Expand All @@ -829,7 +829,7 @@ private static void allow(Player player) {
* @param player The Player modifying the Button
*/
private static void deny(Player player) {
Block block = player.getTargetBlock(null, 10);
Block block = player.getTargetBlock((Set<Material>)null, 10);

//Find the Warp that will be modified using the target Block
Warp warp = ButtonWarp.findWarp(block);
Expand Down Expand Up @@ -924,7 +924,7 @@ private static void reset(Player player, String name) {
//Reset the target Button if a name was not provided
if (name == null) {
//Find the Warp that will be reset using the given name
Block block = player.getTargetBlock(null, 10);
Block block = player.getTargetBlock((Set<Material>)null, 10);
Warp warp = ButtonWarp.findWarp(block);

//Cancel if the Warp does not exist
Expand Down Expand Up @@ -1088,7 +1088,7 @@ private static Warp getWarp(Player player, String name) {

if (name == null) {
//Find the Warp using the target Block
warp = ButtonWarp.findWarp(player.getTargetBlock(null, 10));
warp = ButtonWarp.findWarp(player.getTargetBlock((Set<Material>)null, 10));

//Cancel if the Warp does not exist
if (warp == null ) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.codisimus.plugins.buttonwarp;

import java.util.HashMap;
import java.util.HashSet;

import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.vehicle.VehicleMoveEvent;
import org.bukkit.util.Vector;

/**
* Listens for interactions with Warps
Expand Down
11 changes: 6 additions & 5 deletions src/com/codisimus/plugins/buttonwarp/Econ.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package com.codisimus.plugins.buttonwarp;

import org.bukkit.entity.Player;

import net.milkbowl.vault.economy.Economy;
import net.milkbowl.vault.economy.EconomyResponse.ResponseType;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;

/**
* Manages payment/rewards of using Warps
Expand All @@ -22,7 +21,8 @@ public class Econ {
* @param amount The amount that will be charged
* @return True if the transaction was successful
*/
public static boolean charge(Player player, String source, double amount) {
@SuppressWarnings("deprecation")
public static boolean charge(Player player, String source, double amount) {
String name = player.getName();

//Cancel if the Player cannot afford the transaction
Expand Down Expand Up @@ -57,7 +57,8 @@ public static boolean charge(Player player, String source, double amount) {
* @param source The Player/Bank that will give the reward
* @param amount The amount that will be rewarded
*/
public static void reward(Player player, String source, double amount) {
@SuppressWarnings("deprecation")
public static void reward(Player player, String source, double amount) {
//Charge the source if it is not the server
if (!source.equalsIgnoreCase("server")) {
//Check if money comes from a Player or a Bank
Expand Down
17 changes: 9 additions & 8 deletions src/com/codisimus/plugins/buttonwarp/Metrics.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
package com.codisimus.plugins.buttonwarp;

import org.bukkit.Bukkit;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginDescriptionFile;

import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
Expand All @@ -24,6 +18,12 @@
import java.util.UUID;
import java.util.logging.Level;

import org.bukkit.Bukkit;
import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginDescriptionFile;

/**
* <p>
* The metrics class obtains data about a plugin and submits statistics about it to the metrics backend.
Expand Down Expand Up @@ -181,7 +181,8 @@ public void addCustomData(final Plotter plotter) {
*
* @return True if statistics measuring is running, otherwise false.
*/
public boolean start() {
@SuppressWarnings("deprecation")
public boolean start() {
synchronized (optOutLock) {
// Did we opt out?
if (isOptOut()) {
Expand Down Expand Up @@ -303,7 +304,7 @@ private void postPlugin(final boolean isPing) throws IOException {
data.append(encode("guid")).append('=').append(encode(guid));
encodeDataPair(data, "version", description.getVersion());
encodeDataPair(data, "server", Bukkit.getVersion());
encodeDataPair(data, "players", Integer.toString(Bukkit.getServer().getOnlinePlayers().length));
encodeDataPair(data, "players", Integer.toString(Bukkit.getOnlinePlayers().size()));
encodeDataPair(data, "revision", String.valueOf(REVISION));

// If we're pinging, append it
Expand Down
8 changes: 6 additions & 2 deletions src/com/codisimus/plugins/buttonwarp/Warp.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*
* @author Codisimus
*/
@SuppressWarnings("rawtypes")
public class Warp implements Comparable {
static boolean log;
static boolean broadcast;
Expand Down Expand Up @@ -237,7 +238,8 @@ private boolean hasAccess(Player player) {
* @param player The Player who is being checked for smuggling
* @return true if the Player is smuggling
*/
private boolean isSmuggling(Player player, Button button) {
@SuppressWarnings("deprecation")
private boolean isSmuggling(Player player, Button button) {
//Return false if smuggling is allowed
if (button.takeItems) {
return false;
Expand Down Expand Up @@ -404,7 +406,9 @@ public void teleport(Player player) {

player.teleport(sendTo);
if (sound) {
player.playSound(sendTo, Sound.ENDERMAN_TELEPORT, 0.8F, 0.075F);
Sound s;
try { s = Sound.valueOf("ENTITY_ENDERMEN_TELEPORT"); } catch (Exception e) { s = Sound.valueOf("ENDERMAN_TELEPORT"); }
player.playSound(sendTo, s, 0.8F, 0.075F);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: ButtonWarp
main: com.codisimus.plugins.buttonwarp.ButtonWarp
version: 2.2.3
version: 2.2.3 1.9-BUILD
author: Codisimus
website: www.codisimus.com
description: Teleport using buttons with price/reward/custom messages
Expand Down