2011-02-05 19:15:04 +01:00
|
|
|
package net.minecraft.server;
|
|
|
|
|
2012-07-29 09:33:13 +02:00
|
|
|
import java.util.Iterator;
|
|
|
|
|
2011-02-05 19:15:04 +01:00
|
|
|
public class WorldManager implements IWorldAccess {
|
|
|
|
|
2011-04-20 19:05:14 +02:00
|
|
|
private MinecraftServer server;
|
2011-06-12 00:02:58 +02:00
|
|
|
public WorldServer world; // CraftBukkit - private -> public
|
2011-02-05 19:15:04 +01:00
|
|
|
|
2011-05-26 14:48:22 +02:00
|
|
|
public WorldManager(MinecraftServer minecraftserver, WorldServer worldserver) {
|
2011-04-20 19:05:14 +02:00
|
|
|
this.server = minecraftserver;
|
2011-05-26 14:48:22 +02:00
|
|
|
this.world = worldserver;
|
2011-02-05 19:15:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public void a(String s, double d0, double d1, double d2, double d3, double d4, double d5) {}
|
|
|
|
|
|
|
|
public void a(Entity entity) {
|
2012-07-29 09:33:13 +02:00
|
|
|
this.world.getTracker().track(entity);
|
2011-02-05 19:15:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public void b(Entity entity) {
|
2012-07-29 09:33:13 +02:00
|
|
|
this.world.getTracker().untrackEntity(entity);
|
2011-02-05 19:15:04 +01:00
|
|
|
}
|
|
|
|
|
2012-07-29 09:33:13 +02:00
|
|
|
public void a(String s, double d0, double d1, double d2, float f, float f1) {
|
|
|
|
// CraftBukkit - this.world.dimension
|
2013-11-04 14:07:38 +01:00
|
|
|
this.server.getPlayerList().sendPacketNearby(d0, d1, d2, f > 1.0F ? (double) (16.0F * f) : 16.0D, this.world.dimension, new PacketPlayOutNamedSoundEffect(s, d0, d1, d2, f, f1));
|
2012-07-29 09:33:13 +02:00
|
|
|
}
|
2011-02-05 19:15:04 +01:00
|
|
|
|
2012-11-06 13:05:28 +01:00
|
|
|
public void a(EntityHuman entityhuman, String s, double d0, double d1, double d2, float f, float f1) {
|
2012-11-26 01:05:17 +01:00
|
|
|
// CraftBukkit - this.world.dimension
|
2013-11-04 14:07:38 +01:00
|
|
|
this.server.getPlayerList().sendPacketNearby(entityhuman, d0, d1, d2, f > 1.0F ? (double) (16.0F * f) : 16.0D, this.world.dimension, new PacketPlayOutNamedSoundEffect(s, d0, d1, d2, f, f1));
|
2012-11-06 13:05:28 +01:00
|
|
|
}
|
|
|
|
|
2011-02-05 19:15:04 +01:00
|
|
|
public void a(int i, int j, int k, int l, int i1, int j1) {}
|
|
|
|
|
|
|
|
public void a(int i, int j, int k) {
|
2012-12-20 05:03:52 +01:00
|
|
|
this.world.getPlayerChunkMap().flagDirty(i, j, k);
|
2011-02-05 19:15:04 +01:00
|
|
|
}
|
|
|
|
|
2012-03-01 11:49:23 +01:00
|
|
|
public void b(int i, int j, int k) {}
|
|
|
|
|
2011-02-05 19:15:04 +01:00
|
|
|
public void a(String s, int i, int j, int k) {}
|
|
|
|
|
2012-07-29 09:33:13 +02:00
|
|
|
public void a(EntityHuman entityhuman, int i, int j, int k, int l, int i1) {
|
|
|
|
// CraftBukkit - this.world.dimension
|
2013-11-04 14:07:38 +01:00
|
|
|
this.server.getPlayerList().sendPacketNearby(entityhuman, (double) j, (double) k, (double) l, 64.0D, this.world.dimension, new PacketPlayOutWorldEvent(i, j, k, l, i1, false));
|
2011-02-05 19:15:04 +01:00
|
|
|
}
|
2011-05-26 14:48:22 +02:00
|
|
|
|
2012-07-29 09:33:13 +02:00
|
|
|
public void a(int i, int j, int k, int l, int i1) {
|
2013-11-04 14:07:38 +01:00
|
|
|
this.server.getPlayerList().sendAll(new PacketPlayOutWorldEvent(i, j, k, l, i1, true));
|
2012-10-25 05:53:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public void b(int i, int j, int k, int l, int i1) {
|
2012-12-20 05:03:52 +01:00
|
|
|
Iterator iterator = this.server.getPlayerList().players.iterator();
|
2012-07-29 09:33:13 +02:00
|
|
|
|
|
|
|
while (iterator.hasNext()) {
|
|
|
|
EntityPlayer entityplayer = (EntityPlayer) iterator.next();
|
|
|
|
|
2013-11-04 14:07:38 +01:00
|
|
|
if (entityplayer != null && entityplayer.world == this.world && entityplayer.getId() != i) {
|
2012-07-29 09:33:13 +02:00
|
|
|
double d0 = (double) j - entityplayer.locX;
|
|
|
|
double d1 = (double) k - entityplayer.locY;
|
|
|
|
double d2 = (double) l - entityplayer.locZ;
|
|
|
|
|
|
|
|
if (d0 * d0 + d1 * d1 + d2 * d2 < 1024.0D) {
|
2013-11-04 14:07:38 +01:00
|
|
|
entityplayer.playerConnection.sendPacket(new PacketPlayOutBlockBreakAnimation(i, j, k, l, i1));
|
2012-07-29 09:33:13 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2011-05-26 14:48:22 +02:00
|
|
|
}
|
2013-11-04 14:07:38 +01:00
|
|
|
|
|
|
|
public void b() {}
|
2011-02-05 19:15:04 +01:00
|
|
|
}
|