diff options
author | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-02-23 02:37:56 +0000 |
---|---|---|
committer | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-02-23 02:37:56 +0000 |
commit | f759e0b60d3a575d31921c930e436af321b0e7e8 (patch) | |
tree | 4b1eb7ac01670854c686b1f6faa2f97ff337f7d7 /src/main/java/org/bukkit | |
parent | a124bfdab59cc9a9d8369425027e61eccd1d62fb (diff) | |
download | craftbukkit-f759e0b60d3a575d31921c930e436af321b0e7e8.tar craftbukkit-f759e0b60d3a575d31921c930e436af321b0e7e8.tar.gz craftbukkit-f759e0b60d3a575d31921c930e436af321b0e7e8.tar.lz craftbukkit-f759e0b60d3a575d31921c930e436af321b0e7e8.tar.xz craftbukkit-f759e0b60d3a575d31921c930e436af321b0e7e8.zip |
Update to Minecraft 1.3 beta
Diffstat (limited to 'src/main/java/org/bukkit')
14 files changed, 219 insertions, 217 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index 6365b382..1d9ee884 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -9,10 +9,12 @@ import java.util.List; import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; +import net.minecraft.server.ChunkCoordinates; import net.minecraft.server.EntityPlayer; import net.minecraft.server.MinecraftServer; import net.minecraft.server.PropertyManager; import net.minecraft.server.ServerConfigurationManager; +import net.minecraft.server.ServerNBTManager; import net.minecraft.server.WorldManager; import net.minecraft.server.WorldServer; import org.bukkit.*; @@ -177,14 +179,14 @@ public final class CraftServer implements Server { console.d = config; boolean animals = config.a("spawn-monsters", console.m); - boolean monsters = config.a("spawn-monsters", console.worlds.get(0).k > 0); + boolean monsters = config.a("spawn-monsters", console.worlds.get(0).j > 0); console.l = config.a("online-mode", console.l); console.m = config.a("spawn-animals", console.m); console.n = config.a("pvp", console.n); for (WorldServer world : console.worlds) { - world.k = monsters ? 1 : 0; + world.j = monsters ? 1 : 0; world.a(monsters, animals); } @@ -210,10 +212,10 @@ public final class CraftServer implements Server { throw new IllegalArgumentException("File exists with the name '" + name + "' and isn't a folder"); } - WorldServer internal = new WorldServer(console, new File("."), name, environment == World.Environment.NETHER ? -1 : 0); + WorldServer internal = new WorldServer(console, new ServerNBTManager(new File("."), name, true), name, environment == World.Environment.NETHER ? -1 : 0); internal.a(new WorldManager(console, internal)); - internal.k = 1; + internal.j = 1; internal.a(true, true); console.f.a(internal); console.worlds.add(internal); @@ -236,9 +238,10 @@ public final class CraftServer implements Server { i = l; } - internal.A.d(internal.spawnX + j >> 4, internal.spawnZ + k >> 4); + ChunkCoordinates chunkcoordinates = internal.l(); + internal.u.d(chunkcoordinates.a + j >> 4, chunkcoordinates.c + k >> 4); - while (internal.d()) { + while (internal.e()) { ; } } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index 53bfed9c..9058a580 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -33,9 +33,9 @@ public class CraftWorld implements World { public CraftWorld(WorldServer world) { this.world = world; this.server = world.getServer(); - this.provider = world.A; + this.provider = world.u; - if (world.q instanceof WorldProviderHell) { + if (world.m instanceof WorldProviderHell) { environment = Environment.NETHER; } else { environment = Environment.NORMAL; @@ -65,7 +65,8 @@ public class CraftWorld implements World { } public Location getSpawnLocation() { - return new Location(this, world.spawnX, world.e(world.spawnX, world.spawnZ), world.spawnZ); + ChunkCoordinates spawn = world.l(); + return new Location(this, spawn.a, world.e(spawn.a, spawn.c), spawn.c); } public Chunk getChunkAt(int x, int z) { @@ -225,9 +226,9 @@ public class CraftWorld implements World { } public org.bukkit.entity.Item dropItemNaturally(Location loc, ItemStack item) { - double xs = world.l.nextFloat() * 0.7F + (1.0F - 0.7F) * 0.5D; - double ys = world.l.nextFloat() * 0.7F + (1.0F - 0.7F) * 0.5D; - double zs = world.l.nextFloat() * 0.7F + (1.0F - 0.7F) * 0.5D; + double xs = world.k.nextFloat() * 0.7F + (1.0F - 0.7F) * 0.5D; + double ys = world.k.nextFloat() * 0.7F + (1.0F - 0.7F) * 0.5D; + double zs = world.k.nextFloat() * 0.7F + (1.0F - 0.7F) * 0.5D; loc = loc.clone(); loc.setX(loc.getX() + xs); loc.setY(loc.getY() + ys); @@ -324,11 +325,11 @@ public class CraftWorld implements World { } public String getName() { - return world.w; + return world.q.j; } public long getId() { - return world.u; + return world.q.b(); } @Override @@ -349,11 +350,11 @@ public class CraftWorld implements World { } public long getFullTime() { - return world.e; + return world.k(); } public void setFullTime(long time) { - world.e = time; + world.a(time); } public Environment getEnvironment() { diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java index 0b9fc7aa..638d7ef0 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java @@ -1,4 +1,3 @@ - package org.bukkit.craftbukkit.block; import org.bukkit.block.BlockFace; @@ -349,7 +348,7 @@ public class CraftBlock implements Block { } public boolean isBlockFacePowered(BlockFace face) { - return chunk.getHandle().d.j(x, y, z, blockFaceToNotch(face)); + return chunk.getHandle().d.i(x, y, z, blockFaceToNotch(face)); } public boolean isBlockFaceIndirectlyPowered(BlockFace face) { diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java b/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java index e16c4181..b5fab374 100644..100755 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java @@ -1,40 +1,40 @@ -package org.bukkit.craftbukkit.block;
-
-import net.minecraft.server.TileEntityChest;
-import org.bukkit.block.Block;
-import org.bukkit.block.Chest;
-import org.bukkit.craftbukkit.CraftWorld;
-import org.bukkit.craftbukkit.inventory.CraftInventory;
-import org.bukkit.inventory.Inventory;
-
-/**
- * Represents a chest.
- *
- * @author sk89q
- */
-public class CraftChest extends CraftBlockState implements Chest {
- private final CraftWorld world;
- private final TileEntityChest chest;
-
- public CraftChest(final Block block) {
- super(block);
-
- world = (CraftWorld)block.getWorld();
- chest = (TileEntityChest)world.getTileEntityAt(getX(), getY(), getZ());
- }
-
- public Inventory getInventory() {
- return new CraftInventory(chest);
- }
-
- @Override
- public boolean update(boolean force) {
- boolean result = super.update(force);
-
- if (result) {
- chest.d();
- }
-
- return result;
- }
-}
+package org.bukkit.craftbukkit.block; + +import net.minecraft.server.TileEntityChest; +import org.bukkit.block.Block; +import org.bukkit.block.Chest; +import org.bukkit.craftbukkit.CraftWorld; +import org.bukkit.craftbukkit.inventory.CraftInventory; +import org.bukkit.inventory.Inventory; + +/** + * Represents a chest. + * + * @author sk89q + */ +public class CraftChest extends CraftBlockState implements Chest { + private final CraftWorld world; + private final TileEntityChest chest; + + public CraftChest(final Block block) { + super(block); + + world = (CraftWorld)block.getWorld(); + chest = (TileEntityChest)world.getTileEntityAt(getX(), getY(), getZ()); + } + + public Inventory getInventory() { + return new CraftInventory(chest); + } + + @Override + public boolean update(boolean force) { + boolean result = super.update(force); + + if (result) { + chest.h(); + } + + return result; + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java b/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java index 44c0bf6c..74c1b587 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java @@ -1,84 +1,84 @@ -package org.bukkit.craftbukkit.block;
-
-import net.minecraft.server.TileEntityMobSpawner;
-import org.bukkit.block.Block;
-import org.bukkit.block.CreatureSpawner;
-import org.bukkit.block.MobSpawner;
-import org.bukkit.craftbukkit.CraftWorld;
-import org.bukkit.entity.CreatureType;
-import org.bukkit.entity.MobType;
-
-public class CraftCreatureSpawner extends CraftBlockState implements CreatureSpawner, MobSpawner {
- private final CraftWorld world;
- private final TileEntityMobSpawner spawner;
-
- public CraftCreatureSpawner(final Block block) {
- super(block);
-
- world = (CraftWorld)block.getWorld();
- spawner = (TileEntityMobSpawner)world.getTileEntityAt(getX(), getY(), getZ());
- }
-
- public CreatureType getCreatureType() {
- return CreatureType.fromName(spawner.h);
- }
-
- public void setCreatureType(CreatureType creatureType) {
- spawner.h = creatureType.getName();
- }
-
- public String getCreatureTypeId() {
- return spawner.h;
- }
-
- public void setCreatureTypeId(String creatureType) {
- // Verify input
- CreatureType type = CreatureType.fromName(creatureType);
- if (type == null) {
- return;
- }
- spawner.h = type.getName();
- }
-
- public int getDelay() {
- return spawner.e;
- }
-
- public void setDelay(int delay) {
- spawner.e = delay;
- }
-
- /**
- * @deprecated Use getCreatureType() instead.
- */
- public MobType getMobType() {
- return MobType.fromName(spawner.h);
- }
-
- /**
- * @deprecated Use setCreatureType() instead.
- */
- public void setMobType(MobType mobType) {
- spawner.h = mobType.getName();
-
- }
-
- /**
- * @deprecated Use getCreatureTypeId() instead.
- */
- public String getMobTypeId() {
- return spawner.h;
- }
-
- /**
- * @deprecated Use setCreatureTypeId() instead.
- */
- public void setMobTypeId(String mobType) {
- // Verify input
- MobType type = MobType.fromName(mobType);
- if (type == null) {
- return;
- }
- spawner.h = type.getName();
- }
-}
+package org.bukkit.craftbukkit.block; + +import net.minecraft.server.TileEntityMobSpawner; +import org.bukkit.block.Block; +import org.bukkit.block.CreatureSpawner; +import org.bukkit.block.MobSpawner; +import org.bukkit.craftbukkit.CraftWorld; +import org.bukkit.entity.CreatureType; +import org.bukkit.entity.MobType; + +public class CraftCreatureSpawner extends CraftBlockState implements CreatureSpawner, MobSpawner { + private final CraftWorld world; + private final TileEntityMobSpawner spawner; + + public CraftCreatureSpawner(final Block block) { + super(block); + + world = (CraftWorld)block.getWorld(); + spawner = (TileEntityMobSpawner)world.getTileEntityAt(getX(), getY(), getZ()); + } + + public CreatureType getCreatureType() { + return CreatureType.fromName(spawner.h); + } + + public void setCreatureType(CreatureType creatureType) { + spawner.h = creatureType.getName(); + } + + public String getCreatureTypeId() { + return spawner.h; + } + + public void setCreatureTypeId(String creatureType) { + // Verify input + CreatureType type = CreatureType.fromName(creatureType); + if (type == null) { + return; + } + spawner.h = type.getName(); + } + + public int getDelay() { + return spawner.a; + } + + public void setDelay(int delay) { + spawner.a = delay; + } + + /** + * @deprecated Use getCreatureType() instead. + */ + public MobType getMobType() { + return MobType.fromName(spawner.h); + } + + /** + * @deprecated Use setCreatureType() instead. + */ + public void setMobType(MobType mobType) { + spawner.h = mobType.getName(); + + } + + /** + * @deprecated Use getCreatureTypeId() instead. + */ + public String getMobTypeId() { + return spawner.h; + } + + /** + * @deprecated Use setCreatureTypeId() instead. + */ + public void setMobTypeId(String mobType) { + // Verify input + MobType type = MobType.fromName(mobType); + if (type == null) { + return; + } + spawner.h = type.getName(); + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftDispenser.java b/src/main/java/org/bukkit/craftbukkit/block/CraftDispenser.java index 602feb5e..9b519fc2 100644..100755 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftDispenser.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftDispenser.java @@ -49,7 +49,7 @@ public class CraftDispenser extends CraftBlockState implements Dispenser { boolean result = super.update(force); if (result) { - dispenser.d(); + dispenser.h(); } return result; diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java b/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java index fd6e927b..30ffa6be 100644..100755 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java @@ -1,56 +1,56 @@ -package org.bukkit.craftbukkit.block;
-
-import net.minecraft.server.TileEntityFurnace;
-import org.bukkit.block.Block;
-import org.bukkit.block.Furnace;
-import org.bukkit.craftbukkit.CraftWorld;
-import org.bukkit.craftbukkit.inventory.CraftInventory;
-import org.bukkit.inventory.Inventory;
-
-/**
- * Represents a furnace.
- *
- * @author sk89q
- */
-public class CraftFurnace extends CraftBlockState implements Furnace {
- private final CraftWorld world;
- private final TileEntityFurnace furnace;
-
- public CraftFurnace(final Block block) {
- super(block);
-
- world = (CraftWorld)block.getWorld();
- furnace = (TileEntityFurnace)world.getTileEntityAt(getX(), getY(), getZ());
- }
-
- public Inventory getInventory() {
- return new CraftInventory(furnace);
- }
-
- @Override
- public boolean update(boolean force) {
- boolean result = super.update(force);
-
- if (result) {
- furnace.d();
- }
-
- return result;
- }
-
- public short getBurnTime() {
- return (short)furnace.e;
- }
-
- public void setBurnTime(short burnTime) {
- furnace.e = burnTime;
- }
-
- public short getCookTime() {
- return (short)furnace.g;
- }
-
- public void setCookTime(short cookTime) {
- furnace.g = cookTime;
- }
-}
+package org.bukkit.craftbukkit.block; + +import net.minecraft.server.TileEntityFurnace; +import org.bukkit.block.Block; +import org.bukkit.block.Furnace; +import org.bukkit.craftbukkit.CraftWorld; +import org.bukkit.craftbukkit.inventory.CraftInventory; +import org.bukkit.inventory.Inventory; + +/** + * Represents a furnace. + * + * @author sk89q + */ +public class CraftFurnace extends CraftBlockState implements Furnace { + private final CraftWorld world; + private final TileEntityFurnace furnace; + + public CraftFurnace(final Block block) { + super(block); + + world = (CraftWorld)block.getWorld(); + furnace = (TileEntityFurnace)world.getTileEntityAt(getX(), getY(), getZ()); + } + + public Inventory getInventory() { + return new CraftInventory(furnace); + } + + @Override + public boolean update(boolean force) { + boolean result = super.update(force); + + if (result) { + furnace.h(); + } + + return result; + } + + public short getBurnTime() { + return (short)furnace.a; + } + + public void setBurnTime(short burnTime) { + furnace.a = burnTime; + } + + public short getCookTime() { + return (short)furnace.c; + } + + public void setCookTime(short cookTime) { + furnace.c = cookTime; + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftNoteBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftNoteBlock.java index d4116e93..ec49c9f9 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftNoteBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftNoteBlock.java @@ -23,11 +23,11 @@ public class CraftNoteBlock extends CraftBlockState implements NoteBlock { } public byte getNote() { - return note.e; + return note.a; } public void setNote(byte n) { - note.e = n; + note.a = n; } public boolean play() { diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java index 3a275d8a..3b33c0cf 100644..100755 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java @@ -1,4 +1,3 @@ - package org.bukkit.craftbukkit.block; import net.minecraft.server.TileEntitySign; @@ -18,15 +17,15 @@ public class CraftSign extends CraftBlockState implements Sign { } public String[] getLines() { - return sign.e; + return sign.a; } public String getLine(int index) throws IndexOutOfBoundsException { - return sign.e[index]; + return sign.a[index]; } public void setLine(int index, String line) throws IndexOutOfBoundsException { - sign.e[index] = line; + sign.a[index] = line; } @Override @@ -34,7 +33,7 @@ public class CraftSign extends CraftBlockState implements Sign { boolean result = super.update(force); if (result) { - sign.d(); + sign.h(); } return result; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index d017bbd0..591bd0da 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -160,7 +160,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { newEntity.inventory.e = newEntity; newEntity.activeContainer = entity.activeContainer; newEntity.defaultContainer = entity.defaultContainer; - newWorld.A.d((int) location.getBlockX() >> 4, (int) location.getBlockZ() >> 4); + newWorld.u.d((int) location.getBlockX() >> 4, (int) location.getBlockZ() >> 4); newEntity.a.a(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); newWorld.manager.a(newEntity); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSheep.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSheep.java index 2135c9c5..c8be38d6 100644..100755 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSheep.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSheep.java @@ -19,12 +19,12 @@ public class CraftSheep extends CraftAnimals implements Sheep { public DyeColor getColor() { EntitySheep entity = (EntitySheep) getHandle(); - return DyeColor.getByData((byte) entity.e_()); + return DyeColor.getByData((byte) entity.n()); } public void setColor(DyeColor color) { EntitySheep entity = (EntitySheep) getHandle(); - entity.a(color.getData()); + entity.a_(color.getData()); } } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java index a723e148..57f9a9e9 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java @@ -19,15 +19,15 @@ public class CraftInventory implements org.bukkit.inventory.Inventory { } public int getSize() { - return getInventory().h_(); + return getInventory().m_(); } public String getName() { - return getInventory().b(); + return getInventory().c(); } public CraftItemStack getItem(int index) { - return new CraftItemStack(getInventory().a(index)); + return new CraftItemStack(getInventory().c_(index)); } public CraftItemStack[] getContents() { @@ -290,7 +290,7 @@ public class CraftInventory implements org.bukkit.inventory.Inventory { } private int getMaxItemStack() { - return getInventory().c(); + return getInventory().n_(); } public void remove(int materialId) { diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java index 4f715bfd..2f2be146 100644..100755 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java @@ -19,7 +19,7 @@ public class CraftInventoryPlayer extends CraftInventory implements PlayerInvent } public CraftItemStack getItemInHand() { - return new CraftItemStack( getInventory().e() ); + return new CraftItemStack( getInventory().b() ); } public void setItemInHand(ItemStack stack) { diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftSlot.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftSlot.java index aaa7426e..f0658364 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftSlot.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftSlot.java @@ -12,14 +12,14 @@ public class CraftSlot implements org.bukkit.inventory.Slot { } public Inventory getInventory() { - return new CraftInventory( slot.b ); + return new CraftInventory( slot.e ); } public int getIndex() { - return slot.a; + return slot.d; } public ItemStack getItem() { - return new CraftItemStack( slot.c() ); + return new CraftItemStack( slot.b() ); } } |