1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-04 21:58:25 +02:00

Cleaned deprecated functions

This commit is contained in:
snowleo
2011-07-18 01:17:24 +02:00
parent 6733d177df
commit d2e1b2435f
6 changed files with 23 additions and 44 deletions

View File

@@ -174,26 +174,6 @@ public class FakeWorld implements World
throw new UnsupportedOperationException("Not supported yet."); throw new UnsupportedOperationException("Not supported yet.");
} }
public Minecart spawnMinecart(Location lctn)
{
throw new UnsupportedOperationException("Not supported yet.");
}
public StorageMinecart spawnStorageMinecart(Location lctn)
{
throw new UnsupportedOperationException("Not supported yet.");
}
public PoweredMinecart spawnPoweredMinecart(Location lctn)
{
throw new UnsupportedOperationException("Not supported yet.");
}
public Boat spawnBoat(Location lctn)
{
throw new UnsupportedOperationException("Not supported yet.");
}
public LivingEntity spawnCreature(Location lctn, CreatureType ct) public LivingEntity spawnCreature(Location lctn, CreatureType ct)
{ {
throw new UnsupportedOperationException("Not supported yet."); throw new UnsupportedOperationException("Not supported yet.");

View File

@@ -375,7 +375,6 @@ public class Util
} }
catch (IOException ex) catch (IOException ex)
{ {
return cl.getResourceAsStream(string);
} }
} }
} }

View File

@@ -196,7 +196,7 @@ public class EssentialsSign
public static boolean checkIfBlockBreaksSigns(final Block block) public static boolean checkIfBlockBreaksSigns(final Block block)
{ {
if (block.getFace(BlockFace.UP).getType() == Material.SIGN_POST) if (block.getRelative(BlockFace.UP).getType() == Material.SIGN_POST)
{ {
return true; return true;
} }
@@ -209,7 +209,7 @@ public class EssentialsSign
}; };
for (BlockFace blockFace : directions) for (BlockFace blockFace : directions)
{ {
final Block signblock = block.getFace(blockFace); final Block signblock = block.getRelative(blockFace);
if (signblock.getType() == Material.WALL_SIGN) if (signblock.getType() == Material.WALL_SIGN)
{ {
final org.bukkit.material.Sign sign = (org.bukkit.material.Sign)signblock.getState().getData(); final org.bukkit.material.Sign sign = (org.bukkit.material.Sign)signblock.getState().getData();

View File

@@ -168,12 +168,12 @@ public class SignProtection extends EssentialsSign
{ {
return new Block[] return new Block[]
{ {
block.getFace(BlockFace.NORTH), block.getRelative(BlockFace.NORTH),
block.getFace(BlockFace.SOUTH), block.getRelative(BlockFace.SOUTH),
block.getFace(BlockFace.EAST), block.getRelative(BlockFace.EAST),
block.getFace(BlockFace.WEST), block.getRelative(BlockFace.WEST),
block.getFace(BlockFace.DOWN), block.getRelative(BlockFace.DOWN),
block.getFace(BlockFace.UP) block.getRelative(BlockFace.UP)
}; };
} }

View File

@@ -60,7 +60,7 @@ public class EssentialsProtectBlockListener extends BlockListener
prot.alert(user, blockPlaced.getType().toString(), Util.i18n("alertPlaced")); prot.alert(user, blockPlaced.getType().toString(), Util.i18n("alertPlaced"));
} }
final Block below = blockPlaced.getFace(BlockFace.DOWN); final Block below = blockPlaced.getRelative(BlockFace.DOWN);
if (below.getType() == Material.RAILS if (below.getType() == Material.RAILS
&& prot.getSettingBool(ProtectConfig.prevent_block_on_rail) && prot.getSettingBool(ProtectConfig.prevent_block_on_rail)
&& prot.getStorage().isProtected(below, user.getName())) && prot.getStorage().isProtected(below, user.getName()))
@@ -77,7 +77,7 @@ public class EssentialsProtectBlockListener extends BlockListener
protect.add(blockPlaced); protect.add(blockPlaced);
if (prot.getSettingBool(ProtectConfig.protect_below_rails)) if (prot.getSettingBool(ProtectConfig.protect_below_rails))
{ {
protect.add(blockPlaced.getFace(BlockFace.DOWN)); protect.add(blockPlaced.getRelative(BlockFace.DOWN));
} }
} }
if ((blockPlaced.getType() == Material.SIGN_POST || blockPlaced.getType() == Material.WALL_SIGN) if ((blockPlaced.getType() == Material.SIGN_POST || blockPlaced.getType() == Material.WALL_SIGN)
@@ -117,7 +117,7 @@ public class EssentialsProtectBlockListener extends BlockListener
return; return;
} }
if (event.getBlock().getType() == Material.OBSIDIAN if (event.getBlock().getType() == Material.OBSIDIAN
|| event.getBlock().getFace(BlockFace.DOWN).getType() == Material.OBSIDIAN) || event.getBlock().getRelative(BlockFace.DOWN).getType() == Material.OBSIDIAN)
{ {
event.setCancelled(prot.getSettingBool(ProtectConfig.prevent_portal_creation)); event.setCancelled(prot.getSettingBool(ProtectConfig.prevent_portal_creation));
return; return;
@@ -262,14 +262,14 @@ public class EssentialsProtectBlockListener extends BlockListener
storage.unprotectBlock(block); storage.unprotectBlock(block);
if (type == Material.RAILS || type == Material.SIGN_POST) if (type == Material.RAILS || type == Material.SIGN_POST)
{ {
final Block below = block.getFace(BlockFace.DOWN); final Block below = block.getRelative(BlockFace.DOWN);
storage.unprotectBlock(below); storage.unprotectBlock(below);
} }
else else
{ {
for (BlockFace blockFace : faces) for (BlockFace blockFace : faces)
{ {
final Block against = block.getFace(blockFace); final Block against = block.getRelative(blockFace);
storage.unprotectBlock(against); storage.unprotectBlock(against);
} }
} }
@@ -278,7 +278,7 @@ public class EssentialsProtectBlockListener extends BlockListener
{ {
for (BlockFace blockFace : faces) for (BlockFace blockFace : faces)
{ {
final Block against = block.getFace(blockFace); final Block against = block.getRelative(blockFace);
storage.unprotectBlock(against); storage.unprotectBlock(against);
} }
} }
@@ -298,14 +298,14 @@ public class EssentialsProtectBlockListener extends BlockListener
storage.unprotectBlock(block); storage.unprotectBlock(block);
if (type == Material.RAILS || type == Material.SIGN_POST) if (type == Material.RAILS || type == Material.SIGN_POST)
{ {
final Block below = block.getFace(BlockFace.DOWN); final Block below = block.getRelative(BlockFace.DOWN);
storage.unprotectBlock(below); storage.unprotectBlock(below);
} }
else else
{ {
for (BlockFace blockFace : faces) for (BlockFace blockFace : faces)
{ {
final Block against = block.getFace(blockFace); final Block against = block.getRelative(blockFace);
storage.unprotectBlock(against); storage.unprotectBlock(against);
} }
} }
@@ -314,7 +314,7 @@ public class EssentialsProtectBlockListener extends BlockListener
{ {
for (BlockFace blockFace : faces) for (BlockFace blockFace : faces)
{ {
final Block against = block.getFace(blockFace); final Block against = block.getRelative(blockFace);
storage.unprotectBlock(against); storage.unprotectBlock(against);
} }
} }

View File

@@ -240,19 +240,19 @@ public class EssentialsProtectEntityListener extends EntityListener
for (Block block : event.blockList()) for (Block block : event.blockList())
{ {
if ((block.getType() == Material.RAILS || block.getFace(BlockFace.UP).getType() == Material.RAILS) if ((block.getType() == Material.RAILS || block.getRelative(BlockFace.UP).getType() == Material.RAILS)
&& prot.getSettingBool(ProtectConfig.protect_rails)) && prot.getSettingBool(ProtectConfig.protect_rails))
{ {
event.setCancelled(true); event.setCancelled(true);
return; return;
} }
if ((block.getType() == Material.WALL_SIGN if ((block.getType() == Material.WALL_SIGN
|| block.getFace(BlockFace.NORTH).getType() == Material.WALL_SIGN || block.getRelative(BlockFace.NORTH).getType() == Material.WALL_SIGN
|| block.getFace(BlockFace.EAST).getType() == Material.WALL_SIGN || block.getRelative(BlockFace.EAST).getType() == Material.WALL_SIGN
|| block.getFace(BlockFace.SOUTH).getType() == Material.WALL_SIGN || block.getRelative(BlockFace.SOUTH).getType() == Material.WALL_SIGN
|| block.getFace(BlockFace.WEST).getType() == Material.WALL_SIGN || block.getRelative(BlockFace.WEST).getType() == Material.WALL_SIGN
|| block.getType() == Material.SIGN_POST || block.getType() == Material.SIGN_POST
|| block.getFace(BlockFace.UP).getType() == Material.SIGN_POST) || block.getRelative(BlockFace.UP).getType() == Material.SIGN_POST)
&& prot.getSettingBool(ProtectConfig.protect_signs)) && prot.getSettingBool(ProtectConfig.protect_signs))
{ {
event.setCancelled(true); event.setCancelled(true);