3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-12-25 02:20:07 +01:00

Fixed some warnings and removed Bukkit/SpoutWorld.toLocation(pt) (replaced it by a call to the according Bukkit/SpoutUtil method)

Dieser Commit ist enthalten in:
TomyLobo 2012-01-06 18:07:27 +01:00
Ursprung f4ba28268a
Commit e810113ea0
4 geänderte Dateien mit 26 neuen und 41 gelöschten Zeilen

Datei anzeigen

@ -458,8 +458,7 @@ public class BukkitWorld extends LocalWorld {
public void dropItem(Vector pt, BaseItemStack item) { public void dropItem(Vector pt, BaseItemStack item) {
ItemStack bukkitItem = new ItemStack(item.getType(), item.getAmount(), ItemStack bukkitItem = new ItemStack(item.getType(), item.getAmount(),
(byte) item.getDamage()); (byte) item.getDamage());
world.dropItemNaturally(toLocation(pt), bukkitItem); world.dropItemNaturally(BukkitUtil.toLocation(world, pt), bukkitItem);
} }
/** /**
@ -573,10 +572,6 @@ public class BukkitWorld extends LocalWorld {
return num; return num;
} }
private Location toLocation(Vector pt) {
return new Location(world, pt.getX(), pt.getY(), pt.getZ());
}
/** /**
* Set a sign's text. * Set a sign's text.
* *

Datei anzeigen

@ -8,14 +8,12 @@ import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.WorldVector; import com.sk89q.worldedit.WorldVector;
import com.sk89q.worldedit.bags.BlockBag; import com.sk89q.worldedit.bags.BlockBag;
import org.getspout.api.ChatColor; import org.getspout.api.ChatColor;
import org.getspout.api.Spout;
import org.getspout.api.command.CommandSource; import org.getspout.api.command.CommandSource;
import org.getspout.api.player.Player; import org.getspout.api.player.Player;
import java.util.logging.Level;
public class SpoutCommandSender extends LocalPlayer { public class SpoutCommandSender extends LocalPlayer {
private CommandSource sender; private CommandSource sender;
@SuppressWarnings("unused")
private WorldEditPlugin plugin; private WorldEditPlugin plugin;
public SpoutCommandSender(WorldEditPlugin plugin, ServerInterface server, CommandSource sender) { public SpoutCommandSender(WorldEditPlugin plugin, ServerInterface server, CommandSource sender) {

Datei anzeigen

@ -37,6 +37,7 @@ import org.getspout.api.player.Player;
public class SpoutPlayer extends LocalPlayer { public class SpoutPlayer extends LocalPlayer {
private Player player; private Player player;
@SuppressWarnings("unused")
private WorldEditPlugin plugin; private WorldEditPlugin plugin;
public SpoutPlayer(WorldEditPlugin plugin, ServerInterface server, Player player) { public SpoutPlayer(WorldEditPlugin plugin, ServerInterface server, Player player) {

Datei anzeigen

@ -29,7 +29,6 @@ import com.sk89q.worldedit.blocks.BaseItemStack;
import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.regions.Region;
import org.getspout.api.geo.World; import org.getspout.api.geo.World;
import org.getspout.api.geo.discrete.Point;
import org.getspout.api.material.MaterialData; import org.getspout.api.material.MaterialData;
public class SpoutWorld extends LocalWorld { public class SpoutWorld extends LocalWorld {
@ -443,7 +442,7 @@ public class SpoutWorld extends LocalWorld {
public void dropItem(Vector pt, BaseItemStack item) { public void dropItem(Vector pt, BaseItemStack item) {
/*ItemStack bukkitItem = new ItemStack(item.getType(), item.getAmount(), /*ItemStack bukkitItem = new ItemStack(item.getType(), item.getAmount(),
(byte) item.getDamage()); (byte) item.getDamage());
world.dropItemNaturally(toLocation(pt), bukkitItem);*/ world.dropItemNaturally(SpoutUtil.toLocation(world, pt), bukkitItem);*/
} }
@ -457,16 +456,16 @@ public class SpoutWorld extends LocalWorld {
*/ */
@Override @Override
public int killMobs(Vector origin, double radius, int flags) { public int killMobs(Vector origin, double radius, int flags) {
boolean killPets = (flags & KillFlags.PETS) != 0; /*boolean killPets = (flags & KillFlags.PETS) != 0;
boolean killNPCs = (flags & KillFlags.NPCS) != 0; boolean killNPCs = (flags & KillFlags.NPCS) != 0;
boolean killAnimals = (flags & KillFlags.ANIMALS) != 0; boolean killAnimals = (flags & KillFlags.ANIMALS) != 0;*/
int num = 0; int num = 0;
double radiusSq = radius * radius; /*double radiusSq = radius * radius;
Point bukkitOrigin = SpoutUtil.toPoint(world, origin); Point bukkitOrigin = SpoutUtil.toPoint(world, origin);
/*
for (LivingEntity ent : world.getLivingEntities()) { for (LivingEntity ent : world.getLivingEntities()) {
if (ent instanceof HumanEntity) { if (ent instanceof HumanEntity) {
continue; continue;
@ -506,9 +505,9 @@ public class SpoutWorld extends LocalWorld {
@Override @Override
public int removeEntities(EntityType type, Vector origin, int radius) { public int removeEntities(EntityType type, Vector origin, int radius) {
int num = 0; int num = 0;
double radiusSq = radius * radius; /*double radiusSq = radius * radius;
/*for (Entity ent : world.getEntities()) { for (Entity ent : world.getEntities()) {
if (radius != -1 if (radius != -1
&& origin.distanceSq(SpoutUtil.toVector(ent.getTransform().getPosition())) > radiusSq) { && origin.distanceSq(SpoutUtil.toVector(ent.getTransform().getPosition())) > radiusSq) {
continue; continue;
@ -555,10 +554,6 @@ public class SpoutWorld extends LocalWorld {
return num; return num;
} }
private Point toLocation(Vector pt) {
return new Point(world, (float)pt.getX(), (float)pt.getY(), (float)pt.getZ());
}
/** /**
* Set a sign's text. * Set a sign's text.
* *
@ -566,8 +561,8 @@ public class SpoutWorld extends LocalWorld {
* @param text * @param text
* @return * @return
*/ */
private boolean setSignText(Vector pt, String[] text) { /*private boolean setSignText(Vector pt, String[] text) {
/*Block block = world.getBlockAt(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ()); Block block = world.getBlockAt(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ());
if (block == null) return false; if (block == null) return false;
BlockState state = block.getState(); BlockState state = block.getState();
if (state == null || !(state instanceof Sign)) return false; if (state == null || !(state instanceof Sign)) return false;
@ -577,9 +572,8 @@ public class SpoutWorld extends LocalWorld {
sign.setLine(2, text[2]); sign.setLine(2, text[2]);
sign.setLine(3, text[3]); sign.setLine(3, text[3]);
sign.update(); sign.update();
return true;*/ return true;
return false; }*/
}
/** /**
* Get a sign's text. * Get a sign's text.
@ -587,8 +581,8 @@ public class SpoutWorld extends LocalWorld {
* @param pt * @param pt
* @return * @return
*/ */
private String[] getSignText(Vector pt) { /*private String[] getSignText(Vector pt) {
/*Block block = world.getBlockAt(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ()); Block block = world.getBlockAt(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ());
if (block == null) return new String[] { "", "", "", "" }; if (block == null) return new String[] { "", "", "", "" };
BlockState state = block.getState(); BlockState state = block.getState();
if (state == null || !(state instanceof Sign)) return new String[] { "", "", "", "" }; if (state == null || !(state instanceof Sign)) return new String[] { "", "", "", "" };
@ -603,9 +597,7 @@ public class SpoutWorld extends LocalWorld {
line2 != null ? line2 : "", line2 != null ? line2 : "",
line3 != null ? line3 : "", line3 != null ? line3 : "",
}; };
*/ }*/
return new String[] {"", "", "", ""};
}
/** /**
* Get a container block's contents. * Get a container block's contents.
@ -613,8 +605,8 @@ public class SpoutWorld extends LocalWorld {
* @param pt * @param pt
* @return * @return
*/ */
private BaseItemStack[] getContainerBlockContents(Vector pt) { /*private BaseItemStack[] getContainerBlockContents(Vector pt) {
/*Block block = world.getBlockAt(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ()); Block block = world.getBlockAt(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ());
if (block == null) { if (block == null) {
return new BaseItemStack[0]; return new BaseItemStack[0];
} }
@ -641,10 +633,10 @@ public class SpoutWorld extends LocalWorld {
} }
} catch (Throwable ignore) {} } catch (Throwable ignore) {}
} }
}*/ }
return new BaseItemStack[0]; return contents;
} }*/
/** /**
* Set a container block's contents. * Set a container block's contents.
@ -653,8 +645,8 @@ public class SpoutWorld extends LocalWorld {
* @param contents * @param contents
* @return * @return
*/ */
private boolean setContainerBlockContents(Vector pt, BaseItemStack[] contents) { /*private boolean setContainerBlockContents(Vector pt, BaseItemStack[] contents) {
/*Block block = world.getBlock(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ()); Block block = world.getBlock(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ());
if (block == null) { if (block == null) {
return false; return false;
} }
@ -687,9 +679,8 @@ public class SpoutWorld extends LocalWorld {
} }
} }
return true;*/ return true;
return false; }*/
}
/** /**
* Returns whether a block has a valid ID. * Returns whether a block has a valid ID.