@@ -39,7 +39,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bukkit</groupId>
|
<groupId>org.bukkit</groupId>
|
||||||
<artifactId>minecraft-server</artifactId>
|
<artifactId>minecraft-server</artifactId>
|
||||||
<version>1.5</version>
|
<version>1.6</version>
|
||||||
<type>jar</type>
|
<type>jar</type>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import net.minecraft.server.ChunkCoordinates;
|
|||||||
import net.minecraft.server.ConvertProgressUpdater;
|
import net.minecraft.server.ConvertProgressUpdater;
|
||||||
import net.minecraft.server.Convertable;
|
import net.minecraft.server.Convertable;
|
||||||
import net.minecraft.server.EntityPlayer;
|
import net.minecraft.server.EntityPlayer;
|
||||||
|
import net.minecraft.server.EntityTracker;
|
||||||
import net.minecraft.server.MinecraftServer;
|
import net.minecraft.server.MinecraftServer;
|
||||||
import net.minecraft.server.PropertyManager;
|
import net.minecraft.server.PropertyManager;
|
||||||
import net.minecraft.server.ServerConfigurationManager;
|
import net.minecraft.server.ServerConfigurationManager;
|
||||||
@@ -36,6 +37,7 @@ import net.minecraft.server.WorldManager;
|
|||||||
import net.minecraft.server.WorldServer;
|
import net.minecraft.server.WorldServer;
|
||||||
import net.minecraft.server.ServerCommand;
|
import net.minecraft.server.ServerCommand;
|
||||||
import net.minecraft.server.ICommandListener;
|
import net.minecraft.server.ICommandListener;
|
||||||
|
import net.minecraft.server.SecondaryWorldServer;
|
||||||
import org.bukkit.*;
|
import org.bukkit.*;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
import org.bukkit.plugin.PluginManager;
|
import org.bukkit.plugin.PluginManager;
|
||||||
@@ -57,7 +59,7 @@ import org.bukkit.util.config.Configuration;
|
|||||||
public final class CraftServer implements Server {
|
public final class CraftServer implements Server {
|
||||||
private final String serverName = "Craftbukkit";
|
private final String serverName = "Craftbukkit";
|
||||||
private final String serverVersion;
|
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 PluginManager pluginManager = new SimplePluginManager(this);
|
||||||
private final ServicesManager servicesManager = new SimpleServicesManager();
|
private final ServicesManager servicesManager = new SimpleServicesManager();
|
||||||
private final BukkitScheduler scheduler = new CraftScheduler(this);
|
private final BukkitScheduler scheduler = new CraftScheduler(this);
|
||||||
@@ -364,12 +366,13 @@ public final class CraftServer implements Server {
|
|||||||
converter.convert(name, new ConvertProgressUpdater(console));
|
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.addIWorldAccess((IWorldAccess)new WorldManager(console, internal));
|
||||||
internal.spawnMonsters = 1;
|
internal.spawnMonsters = 1;
|
||||||
internal.setSpawnFlags(true, true);
|
internal.setSpawnFlags(true, true);
|
||||||
console.serverConfigurationManager.setPlayerFileData(internal);
|
|
||||||
console.worlds.add(internal);
|
console.worlds.add(internal);
|
||||||
|
|
||||||
short short1 = 196;
|
short short1 = 196;
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ public class CraftCreeper extends CraftMonster implements Creeper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isPowered() {
|
public boolean isPowered() {
|
||||||
return getHandle().W().a(17) == 1;
|
return getHandle().X().a(17) == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPowered(boolean powered) {
|
public void setPowered(boolean powered) {
|
||||||
@@ -32,14 +32,14 @@ public class CraftCreeper extends CraftMonster implements Creeper {
|
|||||||
server.getPluginManager().callEvent(event);
|
server.getPluginManager().callEvent(event);
|
||||||
|
|
||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled()) {
|
||||||
getHandle().W().b(17, (byte)1);
|
getHandle().X().b(17, (byte)1);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
CreeperPowerEvent event = new CreeperPowerEvent(entity, CreeperPowerEvent.PowerCause.SET_OFF);
|
CreeperPowerEvent event = new CreeperPowerEvent(entity, CreeperPowerEvent.PowerCause.SET_OFF);
|
||||||
server.getPluginManager().callEvent(event);
|
server.getPluginManager().callEvent(event);
|
||||||
|
|
||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled()) {
|
||||||
getHandle().W().b(17, (byte)0);
|
getHandle().X().b(17, (byte)0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ import net.minecraft.server.Packet6SpawnPosition;
|
|||||||
import net.minecraft.server.ServerConfigurationManager;
|
import net.minecraft.server.ServerConfigurationManager;
|
||||||
import net.minecraft.server.WorldServer;
|
import net.minecraft.server.WorldServer;
|
||||||
import net.minecraft.server.ChunkCoordIntPair;
|
import net.minecraft.server.ChunkCoordIntPair;
|
||||||
|
import net.minecraft.server.Packet9Respawn;
|
||||||
|
import net.minecraft.server.World;
|
||||||
import org.bukkit.Achievement;
|
import org.bukkit.Achievement;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
@@ -168,58 +170,26 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
WorldServer newWorld = ((CraftWorld)location.getWorld()).getHandle();
|
WorldServer newWorld = ((CraftWorld)location.getWorld()).getHandle();
|
||||||
ServerConfigurationManager manager = server.getHandle();
|
ServerConfigurationManager manager = server.getHandle();
|
||||||
EntityPlayer entity = getHandle();
|
EntityPlayer entity = getHandle();
|
||||||
boolean teleportSuccess;
|
|
||||||
|
|
||||||
if (oldWorld != newWorld) {
|
if (oldWorld != newWorld) {
|
||||||
|
entity.dimension = newWorld.dimension;
|
||||||
EntityPlayer newEntity = new EntityPlayer(manager.server, newWorld, entity.name, new ItemInWorldManager(newWorld));
|
entity.netServerHandler.sendPacket(new Packet9Respawn((byte) entity.dimension));
|
||||||
|
|
||||||
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);
|
oldWorld.removeEntity(entity);
|
||||||
|
entity.dead = false;
|
||||||
|
|
||||||
newWorld.manager.addPlayer(newEntity);
|
if (entity.Q()) {
|
||||||
newWorld.addEntity(newEntity);
|
newWorld.addEntity(entity);
|
||||||
manager.players.add(newEntity);
|
entity.setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
|
||||||
|
newWorld.entityJoinedWorld(entity, false);
|
||||||
entity.netServerHandler.player = newEntity;
|
|
||||||
this.entity = newEntity;
|
|
||||||
|
|
||||||
setCompassTarget(getCompassTarget());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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 {
|
} else {
|
||||||
return entity.netServerHandler.teleport(location);
|
return entity.netServerHandler.teleport(location);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user