mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-06-19 15:03:54 +00:00
some hasty refactoring
This commit is contained in:
@ -91,7 +91,7 @@ public class Message
|
||||
@SuppressWarnings("deprecation")
|
||||
public void replace()
|
||||
{
|
||||
snipeData.sendMessage(ChatColor.AQUA + "Replace Material: " + BlockTypes.getFromStateId(snipeData.getReplaceId()));
|
||||
snipeData.sendMessage(ChatColor.AQUA + "Replace Material: " + BlockTypes.get(snipeData.getReplaceId()));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -144,7 +144,7 @@ public class Message
|
||||
@SuppressWarnings("deprecation")
|
||||
public void voxel()
|
||||
{
|
||||
snipeData.sendMessage(ChatColor.GOLD + "Voxel: " + ChatColor.RED + BlockTypes.getFromStateId(snipeData.getVoxelId()));
|
||||
snipeData.sendMessage(ChatColor.GOLD + "Voxel: " + ChatColor.RED + BlockTypes.get(snipeData.getVoxelId()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -333,7 +333,7 @@ public class Sniper {
|
||||
return true;
|
||||
} else {
|
||||
int originalData = snipeData.getReplaceData();
|
||||
snipeData.setReplaceData(BlockTypes.AIR.getInternalId());
|
||||
snipeData.setReplaceData(0);
|
||||
// SniperReplaceMaterialChangedEvent event = new SniperReplaceMaterialChangedEvent(this, toolId, BukkitAdapter.adapt(BlockState.get((snipeData.getReplaceId() << BlockTypes.BIT_OFFSET) + originalData)), BukkitAdapter.adapt(BlockState.get((snipeData.getReplaceId() << BlockTypes.BIT_OFFSET) + snipeData.getReplaceData())));
|
||||
// callEvent(event);
|
||||
snipeData.getVoxelMessage().replaceData();
|
||||
|
@ -72,7 +72,7 @@ public class OverlayBrush extends PerformBrush
|
||||
@SuppressWarnings("deprecation")
|
||||
private boolean isIgnoredBlock(int materialId)
|
||||
{
|
||||
BlockTypes type = BlockTypes.getFromStateId(materialId);
|
||||
BlockTypes type = BlockTypes.get(materialId);
|
||||
switch (type) {
|
||||
case WATER:
|
||||
case LAVA:
|
||||
@ -86,7 +86,7 @@ public class OverlayBrush extends PerformBrush
|
||||
@SuppressWarnings("deprecation")
|
||||
private boolean isOverrideableMaterial(int materialId)
|
||||
{
|
||||
BlockMaterial mat = BlockTypes.getFromStateId(materialId).getMaterial();
|
||||
BlockMaterial mat = BlockTypes.get(materialId).getMaterial();
|
||||
if (allBlocks && !(mat.isAir()))
|
||||
{
|
||||
return true;
|
||||
|
@ -9,7 +9,6 @@ import com.thevoxelbox.voxelsniper.brush.perform.PerformBrush;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -174,7 +173,7 @@ public class PunishBrush extends PerformBrush
|
||||
target = location.clone();
|
||||
target.add(x, y, z);
|
||||
Player plr = ((Player) entity);
|
||||
BlockData bd = BukkitAdapter.adapt(BlockState.get(v.getVoxelId() + (v.getPropertyId() << BlockTypes.BIT_OFFSET)));
|
||||
BlockData bd = BukkitAdapter.adapt(BlockState.getFromInternalId(v.getVoxelId() + (v.getPropertyId() << BlockTypes.BIT_OFFSET)));
|
||||
plr.sendBlockChange(target, bd);
|
||||
}
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ public class ScannerBrush extends Brush
|
||||
@Override
|
||||
protected final void arrow(final SnipeData v)
|
||||
{
|
||||
this.checkFor = BukkitAdapter.adapt(BlockTypes.getFromStateId(v.getVoxelId()));
|
||||
this.checkFor = BukkitAdapter.adapt(BlockTypes.get(v.getVoxelId()));
|
||||
this.scan(v, this.getTargetBlock().getFace(this.getLastBlock()));
|
||||
}
|
||||
|
||||
@ -157,7 +157,7 @@ public class ScannerBrush extends Brush
|
||||
@Override
|
||||
protected final void powder(final SnipeData v)
|
||||
{
|
||||
this.checkFor = BukkitAdapter.adapt(BlockTypes.getFromStateId(v.getVoxelId()));
|
||||
this.checkFor = BukkitAdapter.adapt(BlockTypes.get(v.getVoxelId()));
|
||||
this.scan(v, this.getTargetBlock().getFace(this.getLastBlock()));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user