Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Update Spigot to 1.13 #331

Open
wants to merge 20 commits into
base: spigot-1.13
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
33 changes: 5 additions & 28 deletions src/main/java/com/thevoxelbox/voxelsniper/Message.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.thevoxelbox.voxelsniper;

import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.block.data.BlockData;

/**
*
Expand Down Expand Up @@ -57,14 +57,6 @@ public void custom(String message)
snipeData.sendMessage(message);
}

/**
* Display data value.
*/
public void data()
{
snipeData.sendMessage(ChatColor.BLUE + "Data Variable: " + ChatColor.DARK_RED + snipeData.getData());
}

/**
* Display voxel height.
*/
Expand All @@ -86,18 +78,9 @@ public void performerName(String performerName)
/**
* Displaye replace material.
*/
@SuppressWarnings("deprecation")
public void replace()
{
snipeData.sendMessage(ChatColor.AQUA + "Replace Material: " + ChatColor.RED + snipeData.getReplaceId() + ChatColor.GRAY + " (" + Material.getMaterial(snipeData.getReplaceId()).toString() + ")");
}

/**
* Display replace data value.
*/
public void replaceData()
{
snipeData.sendMessage(ChatColor.DARK_GRAY + "Replace Data Variable: " + ChatColor.DARK_RED + snipeData.getReplaceData());
snipeData.sendMessage(ChatColor.AQUA + "Replace Material: " + ChatColor.RED + snipeData.getReplaceData().getAsString());
}

/**
Expand Down Expand Up @@ -139,10 +122,9 @@ public void toggleRange()
/**
* Display voxel type.
*/
@SuppressWarnings("deprecation")
public void voxel()
{
snipeData.sendMessage(ChatColor.GOLD + "Voxel: " + ChatColor.RED + snipeData.getVoxelId() + ChatColor.GRAY + " (" + Material.getMaterial(snipeData.getVoxelId()).toString() + ")");
snipeData.sendMessage(ChatColor.GOLD + "Voxel: " + ChatColor.RED + snipeData.getVoxelData().getAsString());
}

/**
Expand All @@ -161,14 +143,9 @@ public void voxelList()
returnValueBuilder.append("Block Types Selected: ");
returnValueBuilder.append(ChatColor.AQUA);

for (int[] valuePair : snipeData.getVoxelList().getList())
for (BlockData data : snipeData.getVoxelList().getList())
{
returnValueBuilder.append(valuePair[0]);
if (valuePair[1] != -1)
{
returnValueBuilder.append(":");
returnValueBuilder.append(valuePair[1]);
}
returnValueBuilder.append(data.getAsString());
returnValueBuilder.append(" ");
}

Expand Down
143 changes: 0 additions & 143 deletions src/main/java/com/thevoxelbox/voxelsniper/MetricsManager.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.thevoxelbox.voxelsniper;

import java.util.Set;

import org.bukkit.Art;
import org.bukkit.ChatColor;
import org.bukkit.Chunk;
Expand All @@ -10,8 +12,6 @@
import org.bukkit.entity.Painting;
import org.bukkit.entity.Player;

import java.util.Set;

/**
* Painting state change handler.
*
Expand All @@ -37,7 +37,6 @@ private PaintingWrapper()
* @param choice
* Chosen index to set the painting to
*/
@SuppressWarnings("deprecation")
public static void paint(final Player p, final boolean auto, final boolean back, final int choice)
{
Location targetLocation = p.getTargetBlock((Set<Material>) null, 4).getLocation();
Expand Down
34 changes: 14 additions & 20 deletions src/main/java/com/thevoxelbox/voxelsniper/RangeBlockHelper.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.thevoxelbox.voxelsniper;

import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
Expand Down Expand Up @@ -165,10 +166,9 @@ public final Block getCurBlock()
*
* @return Block
*/
@SuppressWarnings("deprecation")
public final Block getFaceBlock()
{
while ((this.getNextBlock() != null) && (this.getCurBlock().getTypeId() == 0))
while ((this.getNextBlock() != null) && (this.getCurBlock().getType() == Material.AIR))
{
}

Expand Down Expand Up @@ -252,11 +252,10 @@ public final Block getRangeBlock()
*
* @return Block
*/
@SuppressWarnings("deprecation")
public final Block getTargetBlock()
{
this.fromOffworld();
while ((this.getNextBlock() != null) && (this.getCurBlock().getTypeId() == 0))
while ((this.getNextBlock() != null) && (this.getCurBlock().getType() == Material.AIR))
{

}
Expand All @@ -268,12 +267,11 @@ public final Block getTargetBlock()
*
* @param type
*/
@SuppressWarnings("deprecation")
public final void setCurBlock(final int type)
public final void setCurBlock(final Material type)
{
if (this.getCurBlock() != null)
{
this.world.getBlockAt(this.targetX, this.targetY, this.targetZ).setTypeId(type);
this.world.getBlockAt(this.targetX, this.targetY, this.targetZ).setType(type);
}
}

Expand All @@ -282,16 +280,15 @@ public final void setCurBlock(final int type)
*
* @param type
*/
@SuppressWarnings("deprecation")
public final void setFaceBlock(final int type)
public final void setFaceBlock(final Material type)
{
while ((this.getNextBlock() != null) && (this.getCurBlock().getTypeId() == 0))
while ((this.getNextBlock() != null) && (this.getCurBlock().getType() == Material.AIR))
{
}

if (this.getCurBlock() != null)
{
this.world.getBlockAt(this.targetX, this.targetY, this.targetZ).setTypeId(type);
this.world.getBlockAt(this.targetX, this.targetY, this.targetZ).setType(type);
}
}

Expand All @@ -300,12 +297,11 @@ public final void setFaceBlock(final int type)
*
* @param type
*/
@SuppressWarnings("deprecation")
public final void setLastBlock(final int type)
public final void setLastBlock(final Material type)
{
if (this.getLastBlock() != null)
{
this.world.getBlockAt(this.lastX, this.lastY, this.lastZ).setTypeId(type);
this.world.getBlockAt(this.lastX, this.lastY, this.lastZ).setType(type);
}
}

Expand All @@ -314,20 +310,18 @@ public final void setLastBlock(final int type)
*
* @param type
*/
@SuppressWarnings("deprecation")
public final void setTargetBlock(final int type)
public final void setTargetBlock(final Material type)
{
while ((this.getNextBlock() != null) && (this.getCurBlock().getTypeId() == 0))
while ((this.getNextBlock() != null) && (this.getCurBlock().getType() == Material.AIR))
{

}
if (this.getCurBlock() != null)
{
this.world.getBlockAt(this.targetX, this.targetY, this.targetZ).setTypeId(type);
this.world.getBlockAt(this.targetX, this.targetY, this.targetZ).setType(type);
}
}

@SuppressWarnings("deprecation")
private Block getRange()
{
this.lastX = this.targetX;
Expand All @@ -350,7 +344,7 @@ private Block getRange()
}
while ((this.length <= this.range) && ((this.targetX == this.lastX) && (this.targetY == this.lastY) && (this.targetZ == this.lastZ)));

if (this.world.getBlockTypeIdAt(this.targetX, this.targetY, this.targetZ) != 0)
if (this.world.getBlockAt(this.targetX, this.targetY, this.targetZ).getType() != Material.AIR)
{
return this.world.getBlockAt(this.targetX, this.targetY, this.targetZ);
}
Expand Down
Loading