remove all suppressions of deprecation warnings

This commit is contained in:
RoboMWM 2020-06-20 12:28:21 -07:00
parent 4ce981d63a
commit ac5a666b8d
9 changed files with 30 additions and 31 deletions

View File

@ -897,7 +897,7 @@ public class Claim
return thisCorner.getWorld().getName().compareTo(otherCorner.getWorld().getName()) < 0; return thisCorner.getWorld().getName().compareTo(otherCorner.getWorld().getName()) < 0;
} }
@SuppressWarnings("deprecation")
long getPlayerInvestmentScore() long getPlayerInvestmentScore()
{ {
//decide which blocks will be considered player placed //decide which blocks will be considered player placed

View File

@ -1126,7 +1126,7 @@ public abstract class DataStore
//if the claim should be opened to looting //if the claim should be opened to looting
if (grantAccess) if (grantAccess)
{ {
@SuppressWarnings("deprecation")
Player winner = GriefPrevention.instance.getServer().getPlayer(winnerName); Player winner = GriefPrevention.instance.getServer().getPlayer(winnerName);
if (winner != null) if (winner != null)
{ {
@ -1145,9 +1145,9 @@ public abstract class DataStore
//if the siege ended due to death, transfer inventory to winner //if the siege ended due to death, transfer inventory to winner
if (drops != null) if (drops != null)
{ {
@SuppressWarnings("deprecation")
Player winner = GriefPrevention.instance.getServer().getPlayer(winnerName); Player winner = GriefPrevention.instance.getServer().getPlayer(winnerName);
@SuppressWarnings("deprecation")
Player loser = GriefPrevention.instance.getServer().getPlayer(loserName); Player loser = GriefPrevention.instance.getServer().getPlayer(loserName);
if (winner != null && loser != null) if (winner != null && loser != null)
{ {

View File

@ -232,7 +232,7 @@ public class EntityEventHandler implements Listener
{ {
//when not allowed, drop as item instead of forming a block //when not allowed, drop as item instead of forming a block
event.setCancelled(true); event.setCancelled(true);
@SuppressWarnings("deprecation")
ItemStack itemStack = new ItemStack(entity.getMaterial(), 1); ItemStack itemStack = new ItemStack(entity.getMaterial(), 1);
Item item = block.getWorld().dropItem(entity.getLocation(), itemStack); Item item = block.getWorld().dropItem(entity.getLocation(), itemStack);
item.setVelocity(new Vector()); item.setVelocity(new Vector());
@ -307,7 +307,7 @@ public class EntityEventHandler implements Listener
this.handleExplosion(explodeEvent.getBlock().getLocation(), null, explodeEvent.blockList()); this.handleExplosion(explodeEvent.getBlock().getLocation(), null, explodeEvent.blockList());
} }
@SuppressWarnings("deprecation")
void handleExplosion(Location location, Entity entity, List<Block> blocks) void handleExplosion(Location location, Entity entity, List<Block> blocks)
{ {
//only applies to claims-enabled worlds //only applies to claims-enabled worlds
@ -682,7 +682,7 @@ public class EntityEventHandler implements Listener
{ {
//handle it just like we would an entity damge by entity event, except don't send player messages to avoid double messages //handle it just like we would an entity damge by entity event, except don't send player messages to avoid double messages
//in cases like attacking with a flame sword or flame arrow, which would ALSO trigger the direct damage event handler //in cases like attacking with a flame sword or flame arrow, which would ALSO trigger the direct damage event handler
@SuppressWarnings("deprecation")
EntityDamageByEntityEvent eventWrapper = new EntityDamageByEntityEvent(event.getCombuster(), event.getEntity(), DamageCause.FIRE_TICK, event.getDuration()); EntityDamageByEntityEvent eventWrapper = new EntityDamageByEntityEvent(event.getCombuster(), event.getEntity(), DamageCause.FIRE_TICK, event.getDuration());
this.handleEntityDamageEvent(eventWrapper, false); this.handleEntityDamageEvent(eventWrapper, false);
event.setCancelled(eventWrapper.isCancelled()); event.setCancelled(eventWrapper.isCancelled());

View File

@ -1002,7 +1002,6 @@ public class GriefPrevention extends JavaPlugin
} }
//handles slash commands //handles slash commands
@SuppressWarnings("deprecation")
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args)
{ {
@ -3174,7 +3173,7 @@ public class GriefPrevention extends JavaPlugin
} }
} }
@SuppressWarnings("deprecation")
public OfflinePlayer resolvePlayerByName(String name) public OfflinePlayer resolvePlayerByName(String name)
{ {
//try online players first //try online players first
@ -3541,7 +3540,7 @@ public class GriefPrevention extends JavaPlugin
} }
} }
@SuppressWarnings("deprecation")
public void restoreChunk(Chunk chunk, int miny, boolean aggressiveMode, long delayInTicks, Player playerReceivingVisualization) public void restoreChunk(Chunk chunk, int miny, boolean aggressiveMode, long delayInTicks, Player playerReceivingVisualization)
{ {
//build a snapshot of this chunk, including 1 block boundary outside of the chunk all the way around //build a snapshot of this chunk, including 1 block boundary outside of the chunk all the way around

View File

@ -402,7 +402,7 @@ class PlayerEventHandler implements Listener
if (category == CommandCategory.Whisper && args.length > 1) if (category == CommandCategory.Whisper && args.length > 1)
{ {
//determine target player, might be NULL //determine target player, might be NULL
@SuppressWarnings("deprecation")
Player targetPlayer = instance.getServer().getPlayer(args[1]); Player targetPlayer = instance.getServer().getPlayer(args[1]);
//softmute feature //softmute feature
@ -666,7 +666,7 @@ class PlayerEventHandler implements Listener
} }
//when a player successfully joins the server... //when a player successfully joins the server...
@SuppressWarnings("deprecation")
@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST) @EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST)
void onPlayerJoin(PlayerJoinEvent event) void onPlayerJoin(PlayerJoinEvent event)
{ {
@ -2673,7 +2673,7 @@ class PlayerEventHandler implements Listener
private boolean isInventoryHolder(Block clickedBlock) private boolean isInventoryHolder(Block clickedBlock)
{ {
@SuppressWarnings("deprecation")
Material cacheKey = clickedBlock.getType(); Material cacheKey = clickedBlock.getType();
Boolean cachedValue = this.inventoryHolderCache.get(cacheKey); Boolean cachedValue = this.inventoryHolderCache.get(cacheKey);
if (cachedValue != null) if (cachedValue != null)

View File

@ -55,7 +55,7 @@ class RestoreNatureExecutionTask implements Runnable
this.player = player; this.player = player;
} }
@SuppressWarnings("deprecation")
@Override @Override
public void run() public void run()
{ {

View File

@ -53,7 +53,7 @@ class RestoreNatureProcessingTask implements Runnable
private ArrayList<Material> notAllowedToHang; //natural blocks which don't naturally hang in their air private ArrayList<Material> notAllowedToHang; //natural blocks which don't naturally hang in their air
private ArrayList<Material> playerBlocks; //a "complete" list of player-placed blocks. MUST BE MAINTAINED as patches introduce more private ArrayList<Material> playerBlocks; //a "complete" list of player-placed blocks. MUST BE MAINTAINED as patches introduce more
@SuppressWarnings("deprecation")
public RestoreNatureProcessingTask(BlockSnapshot[][][] snapshots, int miny, Environment environment, Biome biome, Location lesserBoundaryCorner, Location greaterBoundaryCorner, int seaLevel, boolean aggressiveMode, boolean creativeMode, Player player) public RestoreNatureProcessingTask(BlockSnapshot[][][] snapshots, int miny, Environment environment, Biome biome, Location lesserBoundaryCorner, Location greaterBoundaryCorner, int seaLevel, boolean aggressiveMode, boolean creativeMode, Player player)
{ {
this.snapshots = snapshots; this.snapshots = snapshots;
@ -165,7 +165,7 @@ class RestoreNatureProcessingTask implements Runnable
GriefPrevention.instance.getServer().getScheduler().scheduleSyncDelayedTask(GriefPrevention.instance, task); GriefPrevention.instance.getServer().getScheduler().scheduleSyncDelayedTask(GriefPrevention.instance, task);
} }
@SuppressWarnings("deprecation")
private void removePlayerLeaves() private void removePlayerLeaves()
{ {
if (this.seaLevel < 1) return; if (this.seaLevel < 1) return;
@ -187,7 +187,7 @@ class RestoreNatureProcessingTask implements Runnable
} }
//converts sandstone adjacent to sand to sand, and any other sandstone to air //converts sandstone adjacent to sand to sand, and any other sandstone to air
@SuppressWarnings("deprecation")
private void removeSandstone() private void removeSandstone()
{ {
for (int x = 1; x < snapshots.length - 1; x++) for (int x = 1; x < snapshots.length - 1; x++)
@ -227,7 +227,7 @@ class RestoreNatureProcessingTask implements Runnable
} }
} }
@SuppressWarnings("deprecation")
private void reduceStone() private void reduceStone()
{ {
if (this.seaLevel < 1) return; if (this.seaLevel < 1) return;
@ -275,7 +275,7 @@ class RestoreNatureProcessingTask implements Runnable
} }
} }
@SuppressWarnings("deprecation")
private void reduceLogs() private void reduceLogs()
{ {
if (this.seaLevel < 1) return; if (this.seaLevel < 1) return;
@ -313,7 +313,7 @@ class RestoreNatureProcessingTask implements Runnable
} }
} }
@SuppressWarnings("deprecation")
private void removePlayerBlocks() private void removePlayerBlocks()
{ {
int miny = this.miny; int miny = this.miny;
@ -337,7 +337,7 @@ class RestoreNatureProcessingTask implements Runnable
} }
} }
@SuppressWarnings("deprecation")
private void removeHanging() private void removeHanging()
{ {
int miny = this.miny; int miny = this.miny;
@ -364,7 +364,7 @@ class RestoreNatureProcessingTask implements Runnable
} }
} }
@SuppressWarnings("deprecation")
private void removeWallsAndTowers() private void removeWallsAndTowers()
{ {
Material[] excludedBlocksArray = new Material[] Material[] excludedBlocksArray = new Material[]
@ -427,7 +427,7 @@ class RestoreNatureProcessingTask implements Runnable
} while (changed); } while (changed);
} }
@SuppressWarnings("deprecation")
private void coverSurfaceStone() private void coverSurfaceStone()
{ {
for (int x = 1; x < snapshots.length - 1; x++) for (int x = 1; x < snapshots.length - 1; x++)
@ -452,7 +452,7 @@ class RestoreNatureProcessingTask implements Runnable
} }
} }
@SuppressWarnings("deprecation")
private void fillHolesAndTrenches() private void fillHolesAndTrenches()
{ {
ArrayList<Material> fillableBlocks = new ArrayList<Material>(); ArrayList<Material> fillableBlocks = new ArrayList<Material>();
@ -510,7 +510,7 @@ class RestoreNatureProcessingTask implements Runnable
} while (changed); } while (changed);
} }
@SuppressWarnings("deprecation")
private void fixWater() private void fixWater()
{ {
int miny = this.miny; int miny = this.miny;
@ -597,7 +597,7 @@ class RestoreNatureProcessingTask implements Runnable
} while (changed); } while (changed);
} }
@SuppressWarnings("deprecation")
private void removeDumpedFluids() private void removeDumpedFluids()
{ {
if (this.seaLevel < 1) return; if (this.seaLevel < 1) return;
@ -621,7 +621,7 @@ class RestoreNatureProcessingTask implements Runnable
} }
} }
@SuppressWarnings("deprecation")
private int highestY(int x, int z, boolean ignoreLeaves) private int highestY(int x, int z, boolean ignoreLeaves)
{ {
int y; int y;
@ -641,7 +641,7 @@ class RestoreNatureProcessingTask implements Runnable
return y; return y;
} }
@SuppressWarnings("deprecation")
static ArrayList<Material> getPlayerBlocks(Environment environment, Biome biome) static ArrayList<Material> getPlayerBlocks(Environment environment, Biome biome)
{ {
//NOTE on this list. why not make a list of natural blocks? //NOTE on this list. why not make a list of natural blocks?

View File

@ -56,7 +56,7 @@ public class Visualization
} }
//reverts a visualization by sending another block change list, this time with the real world block values //reverts a visualization by sending another block change list, this time with the real world block values
@SuppressWarnings("deprecation")
public static void Revert(Player player) public static void Revert(Player player)
{ {
if (!player.isOnline()) return; if (!player.isOnline()) return;
@ -129,7 +129,7 @@ public class Visualization
//adds a claim's visualization to the current visualization //adds a claim's visualization to the current visualization
//handy for combining several visualizations together, as when visualization a top level claim with several subdivisions inside //handy for combining several visualizations together, as when visualization a top level claim with several subdivisions inside
//locality is a performance consideration. only create visualization blocks for around 100 blocks of the locality //locality is a performance consideration. only create visualization blocks for around 100 blocks of the locality
@SuppressWarnings("deprecation")
private void addClaimElements(Claim claim, int height, VisualizationType visualizationType, Location locality) private void addClaimElements(Claim claim, int height, VisualizationType visualizationType, Location locality)
{ {
Location smallXsmallZ = claim.getLesserBoundaryCorner(); Location smallXsmallZ = claim.getLesserBoundaryCorner();

View File

@ -34,7 +34,7 @@ class VisualizationApplicationTask implements Runnable
this.player = player; this.player = player;
} }
@SuppressWarnings("deprecation")
@Override @Override
public void run() public void run()
{ {