From 226318d8af3a20746230b9e81985e618fabcf915 Mon Sep 17 00:00:00 2001 From: EvilSeph Date: Wed, 27 Jul 2011 21:18:52 -0400 Subject: [PATCH] Removed deprecated methods. getNote() that returns a byte has been replaced by getRawNote(). teleportTo(Location) has been replaced by teleport(location). teleportTo(Entity) has been replaced by teleport(Entity). SnowForm event has been replaced by BlockForm event. --- src/main/java/net/minecraft/server/World.java | 8 ++++---- .../org/bukkit/craftbukkit/block/CraftNoteBlock.java | 10 ++-------- .../org/bukkit/craftbukkit/entity/CraftEntity.java | 8 -------- 3 files changed, 6 insertions(+), 20 deletions(-) diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java index 736ae38c05..aacbef13ee 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -20,7 +20,6 @@ import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.craftbukkit.event.CraftEventFactory; import org.bukkit.event.block.BlockCanBuildEvent; import org.bukkit.event.block.BlockPhysicsEvent; -import org.bukkit.event.block.SnowFormEvent; import org.bukkit.event.block.BlockFormEvent; import org.bukkit.event.entity.CreatureSpawnEvent; import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; @@ -1915,12 +1914,13 @@ public class World implements IBlockAccess { i2 = chunk.getTypeId(l, k1, j1); if (this.v() && i2 == 0 && Block.SNOW.canPlace(this, l + i, k1, j1 + j) && l1 != 0 && l1 != Block.ICE.id && Block.byId[l1].material.isSolid()) { // CraftBukkit start - SnowFormEvent snow = new SnowFormEvent(this.getWorld().getBlockAt(l + i, k1, j1 + j)); + BlockState blockState = this.getWorld().getBlockAt(l + i, k1, j1 + j).getState(); + blockState.setTypeId(Block.SNOW.id); + BlockFormEvent snow = new BlockFormEvent(blockState.getBlock(), blockState); this.getServer().getPluginManager().callEvent(snow); if (!snow.isCancelled()) { - this.setTypeId(l + i, k1, j1 + j, snow.getMaterial().getId()); - this.setData(l + i, k1, j1 + j, snow.getData()); + blockState.update(true); } // CraftBukkit end } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftNoteBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftNoteBlock.java index 403c6d00d7..0851ad31ba 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftNoteBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftNoteBlock.java @@ -20,9 +20,8 @@ public class CraftNoteBlock extends CraftBlockState implements NoteBlock { note = (TileEntityNote) world.getTileEntityAt(getX(), getY(), getZ()); } - @Deprecated - public byte getNote() { - return note.note; + public Note getNote() { + return new Note(note.note); } public byte getRawNote() { @@ -33,11 +32,6 @@ public class CraftNoteBlock extends CraftBlockState implements NoteBlock { note.note = n.getId(); } - @Deprecated - public void setNote(byte n) { - note.note = n; - } - public void setRawNote(byte n) { note.note = n; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java index 7cc9e82a16..7c97c845e1 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -132,14 +132,6 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { return teleport(destination.getLocation()); } - public void teleportTo(Location location) { - teleport(location); - } - - public void teleportTo(org.bukkit.entity.Entity destination) { - teleport(destination); - } - public List getNearbyEntities(double x, double y, double z) { @SuppressWarnings("unchecked") List notchEntityList = entity.world.b(entity, entity.boundingBox.b(x, y, z));