summaryrefslogtreecommitdiffstats
path: root/src/main/java/org
diff options
context:
space:
mode:
authorDinnerbone <dinnerbone@dinnerbone.com>2011-05-26 13:48:22 +0100
committerDinnerbone <dinnerbone@dinnerbone.com>2011-05-26 13:48:22 +0100
commit6903f2024217f0959c015e76b23297af8e3b573f (patch)
tree690bf275ce19c655bd64eea05be231ed0c318fd6 /src/main/java/org
parentf463453d73249fe73cf3e23ed37e6cee870c8bf4 (diff)
downloadcraftbukkit-6903f2024217f0959c015e76b23297af8e3b573f.tar
craftbukkit-6903f2024217f0959c015e76b23297af8e3b573f.tar.gz
craftbukkit-6903f2024217f0959c015e76b23297af8e3b573f.tar.lz
craftbukkit-6903f2024217f0959c015e76b23297af8e3b573f.tar.xz
craftbukkit-6903f2024217f0959c015e76b23297af8e3b573f.zip
Implemented 1.6!
Diffstat (limited to 'src/main/java/org')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/CraftServer.java9
-rw-r--r--src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java6
-rw-r--r--src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java66
3 files changed, 27 insertions, 54 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index a7be0d88..df6ee620 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -27,6 +27,7 @@ import net.minecraft.server.ChunkCoordinates;
import net.minecraft.server.ConvertProgressUpdater;
import net.minecraft.server.Convertable;
import net.minecraft.server.EntityPlayer;
+import net.minecraft.server.EntityTracker;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.PropertyManager;
import net.minecraft.server.ServerConfigurationManager;
@@ -36,6 +37,7 @@ import net.minecraft.server.WorldManager;
import net.minecraft.server.WorldServer;
import net.minecraft.server.ServerCommand;
import net.minecraft.server.ICommandListener;
+import net.minecraft.server.SecondaryWorldServer;
import org.bukkit.*;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginManager;
@@ -57,7 +59,7 @@ import org.bukkit.util.config.Configuration;
public final class CraftServer implements Server {
private final String serverName = "Craftbukkit";
private final String serverVersion;
- private final String protocolVersion = "1.5_02";
+ private final String protocolVersion = "1.6.2";
private final PluginManager pluginManager = new SimplePluginManager(this);
private final ServicesManager servicesManager = new SimpleServicesManager();
private final BukkitScheduler scheduler = new CraftScheduler(this);
@@ -364,12 +366,13 @@ public final class CraftServer implements Server {
converter.convert(name, new ConvertProgressUpdater(console));
}
- WorldServer internal = new WorldServer(console, new ServerNBTManager(new File("."), name, true), name, environment == World.Environment.NETHER ? -1 : 0, seed);
+ WorldServer internal = new WorldServer(console, new ServerNBTManager(new File("."), name, true), name, environment.getId(), seed);
+ internal.z = console.worlds.get(0).z;
+ internal.tracker = new EntityTracker(console, environment.getId());
internal.addIWorldAccess((IWorldAccess)new WorldManager(console, internal));
internal.spawnMonsters = 1;
internal.setSpawnFlags(true, true);
- console.serverConfigurationManager.setPlayerFileData(internal);
console.worlds.add(internal);
short short1 = 196;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java
index 974bd859..9de2a0a7 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java
@@ -19,7 +19,7 @@ public class CraftCreeper extends CraftMonster implements Creeper {
}
public boolean isPowered() {
- return getHandle().W().a(17) == 1;
+ return getHandle().X().a(17) == 1;
}
public void setPowered(boolean powered) {
@@ -32,14 +32,14 @@ public class CraftCreeper extends CraftMonster implements Creeper {
server.getPluginManager().callEvent(event);
if (!event.isCancelled()) {
- getHandle().W().b(17, (byte)1);
+ getHandle().X().b(17, (byte)1);
}
} else {
CreeperPowerEvent event = new CreeperPowerEvent(entity, CreeperPowerEvent.PowerCause.SET_OFF);
server.getPluginManager().callEvent(event);
if (!event.isCancelled()) {
- getHandle().W().b(17, (byte)0);
+ getHandle().X().b(17, (byte)0);
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 0ae97517..371b9ee4 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -13,6 +13,8 @@ import net.minecraft.server.Packet6SpawnPosition;
import net.minecraft.server.ServerConfigurationManager;
import net.minecraft.server.WorldServer;
import net.minecraft.server.ChunkCoordIntPair;
+import net.minecraft.server.Packet9Respawn;
+import net.minecraft.server.World;
import org.bukkit.Achievement;
import org.bukkit.Location;
import org.bukkit.Material;
@@ -168,58 +170,26 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
WorldServer newWorld = ((CraftWorld)location.getWorld()).getHandle();
ServerConfigurationManager manager = server.getHandle();
EntityPlayer entity = getHandle();
- boolean teleportSuccess;
if (oldWorld != newWorld) {
-
- EntityPlayer newEntity = new EntityPlayer(manager.server, newWorld, entity.name, new ItemInWorldManager(newWorld));
-
- newEntity.id = entity.id;
- newEntity.netServerHandler = entity.netServerHandler;
- newEntity.health = entity.health;
- newEntity.fireTicks = entity.fireTicks;
- newEntity.inventory = entity.inventory;
- newEntity.inventory.d = newEntity;
- newEntity.activeContainer = entity.activeContainer;
- newEntity.defaultContainer = entity.defaultContainer;
- newEntity.locX = location.getX();
- newEntity.locY = location.getY();
- newEntity.locZ = location.getZ();
- newEntity.displayName = entity.displayName;
- newEntity.compassTarget = entity.compassTarget;
- newEntity.fauxSleeping = entity.fauxSleeping;
- newWorld.chunkProviderServer.getChunkAt((int) location.getBlockX() >> 4, (int) location.getBlockZ() >> 4);
-
- teleportSuccess = newEntity.netServerHandler.teleport(location);
-
- if (teleportSuccess) {
- manager.server.tracker.trackPlayer(entity);
- manager.server.tracker.untrackEntity(entity);
- int cx = (int) location.getBlockX() >> 4;
- int cz = (int) location.getBlockZ() >> 4;
- for (int x = -10 ; x <= 10 ; x++) {
- for (int z = -10 ; z <= 10 ; z++) {
- ChunkCoordIntPair chunkPosition = new ChunkCoordIntPair(cx + x, cz + z);
- if (entity.g.remove(chunkPosition)) {
- newEntity.g.add(chunkPosition);
- }
- }
- }
- oldWorld.manager.removePlayer(entity);
- manager.players.remove(entity);
- oldWorld.removeEntity(entity);
-
- newWorld.manager.addPlayer(newEntity);
- newWorld.addEntity(newEntity);
- manager.players.add(newEntity);
-
- entity.netServerHandler.player = newEntity;
- this.entity = newEntity;
-
- setCompassTarget(getCompassTarget());
+ entity.dimension = newWorld.dimension;
+ entity.netServerHandler.sendPacket(new Packet9Respawn((byte) entity.dimension));
+ oldWorld.removeEntity(entity);
+ entity.dead = false;
+
+ if (entity.Q()) {
+ newWorld.addEntity(entity);
+ entity.setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
+ newWorld.entityJoinedWorld(entity, false);
}
- return teleportSuccess;
+ manager.a(entity);
+ entity.netServerHandler.a(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
+ entity.a((World)newWorld);
+ manager.a(entity, newWorld);
+ entity.a(entity.defaultContainer);
+
+ return true;
} else {
return entity.netServerHandler.teleport(location);
}