Fix balance of CraftBukkit start/end.

Dieser Commit ist enthalten in:
Erik Broes 2012-01-12 19:43:34 +01:00
Ursprung 897551e39e
Commit 7d0e739f96
9 geänderte Dateien mit 11 neuen und 13 gelöschten Zeilen

Datei anzeigen

@ -43,7 +43,7 @@ public class ConsoleLogManager {
int count = ((Integer)server.options.valueOf("log-count")).intValue(); int count = ((Integer)server.options.valueOf("log-count")).intValue();
boolean append = ((Boolean)server.options.valueOf("log-append")).booleanValue(); boolean append = ((Boolean)server.options.valueOf("log-append")).booleanValue();
FileHandler filehandler = new FileHandler(pattern, limit, count, append); FileHandler filehandler = new FileHandler(pattern, limit, count, append);
// CraftBukkit start // CraftBukkit end
filehandler.setFormatter(consolelogformatter); filehandler.setFormatter(consolelogformatter);
a.addHandler(filehandler); a.addHandler(filehandler);

Datei anzeigen

@ -46,7 +46,7 @@ public class EntityFireball extends Entity {
this.setPosition(this.locX, this.locY, this.locZ); this.setPosition(this.locX, this.locY, this.locZ);
this.height = 0.0F; this.height = 0.0F;
this.motX = this.motY = this.motZ = 0.0D; this.motX = this.motY = this.motZ = 0.0D;
// CraftBukkit start (added setDirection method) // CraftBukkit start - (added setDirection method)
this.setDirection(d0, d1, d2); this.setDirection(d0, d1, d2);
} }
@ -60,6 +60,7 @@ public class EntityFireball extends Entity {
this.dirY = d1 / d3 * 0.1D; this.dirY = d1 / d3 * 0.1D;
this.dirZ = d2 / d3 * 0.1D; this.dirZ = d2 / d3 * 0.1D;
} }
// CraftBukkit end
public void w_() { public void w_() {
super.w_(); super.w_();

Datei anzeigen

@ -513,7 +513,7 @@ public class EntityMinecart extends Entity implements IInventory {
this.motX *= this.derailedX; this.motX *= this.derailedX;
this.motY *= this.derailedY; this.motY *= this.derailedY;
this.motZ *= this.derailedZ; this.motZ *= this.derailedZ;
// CraftBukkit start // CraftBukkit end
} }
this.move(this.motX, this.motY, this.motZ); this.move(this.motX, this.motY, this.motZ);
@ -522,7 +522,7 @@ public class EntityMinecart extends Entity implements IInventory {
this.motX *= this.flyingX; this.motX *= this.flyingX;
this.motY *= this.flyingY; this.motY *= this.flyingY;
this.motZ *= this.flyingZ; this.motZ *= this.flyingZ;
// CraftBukkit start // CraftBukkit end
} }
} }

Datei anzeigen

@ -173,7 +173,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
this.b.serverConfigurationManager.sendAll(new Packet3Chat(event.getDeathMessage())); this.b.serverConfigurationManager.sendAll(new Packet3Chat(event.getDeathMessage()));
} }
// CraftBukkit - we clean the player's inventory after the EntityDeathEvent is called so plugins can get the exact state of the inventory. // CraftBukkit start - we clean the player's inventory after the EntityDeathEvent is called so plugins can get the exact state of the inventory.
for (int i = 0; i < this.inventory.items.length; ++i) { for (int i = 0; i < this.inventory.items.length; ++i) {
this.inventory.items[i] = null; this.inventory.items[i] = null;
} }

Datei anzeigen

@ -364,7 +364,7 @@ public class EntityWolf extends EntityAnimal {
} }
if (!this.world.isStatic) { if (!this.world.isStatic) {
// CraftBukkit - added event call and isCancelled check. // CraftBukkit start - added event call and isCancelled check.
if (this.random.nextInt(3) == 0 && !CraftEventFactory.callEntityTameEvent(this, entityhuman).isCancelled()) { if (this.random.nextInt(3) == 0 && !CraftEventFactory.callEntityTameEvent(this, entityhuman).isCancelled()) {
// CraftBukkit end // CraftBukkit end
this.setTamed(true); this.setTamed(true);

Datei anzeigen

@ -39,7 +39,7 @@ public final class ItemStack {
this.setData(k); // CraftBukkit this.setData(k); // CraftBukkit
} }
// CraftBukkit - used to create a new ItemStack, specifying the enchantments at time of creation. // CraftBukkit start - used to create a new ItemStack, specifying the enchantments at time of creation.
public ItemStack(int id, int count, int data, NBTTagList enchantments) { public ItemStack(int id, int count, int data, NBTTagList enchantments) {
this(id, count, data); this(id, count, data);
// taken from .addEnchantment // taken from .addEnchantment

Datei anzeigen

@ -206,7 +206,6 @@ public class MinecraftServer implements Runnable, ICommandListener, IMinecraftSe
j = WorldSettings.a(j); j = WorldSettings.a(j);
log.info("Default game type: " + j); log.info("Default game type: " + j);
// CraftBukkit start (+ removed worldsettings and servernbtmanager) // CraftBukkit start (+ removed worldsettings and servernbtmanager)
int worldCount = 3; int worldCount = 3;
@ -223,13 +222,12 @@ public class MinecraftServer implements Runnable, ICommandListener, IMinecraftSe
} }
if (k == 2) { if (k == 2) {
// CraftBukkit start (+ don't do this in server.properties, do it in bukkit.yml) // CraftBukkit - (+ don't do this in server.properties, do it in bukkit.yml)
if (this.server.getAllowEnd()) { if (this.server.getAllowEnd()) {
dimension = 1; dimension = 1;
} else { } else {
continue; continue;
} }
// CraftBukkit end
} }
String worldType = Environment.getEnvironment(dimension).toString().toLowerCase(); String worldType = Environment.getEnvironment(dimension).toString().toLowerCase();

Datei anzeigen

@ -111,7 +111,7 @@ public class ServerConfigurationManager {
} }
public void c(EntityPlayer entityplayer) { public void c(EntityPlayer entityplayer) {
// CraftBukkit // CraftBukkit start
cserver.detectListNameConflict(entityplayer); cserver.detectListNameConflict(entityplayer);
this.sendAll(new Packet201PlayerInfo(entityplayer.listName, true, 1000)); this.sendAll(new Packet201PlayerInfo(entityplayer.listName, true, 1000));
// CraftBukkit end // CraftBukkit end
@ -223,6 +223,7 @@ public class ServerConfigurationManager {
} }
public EntityPlayer moveToWorld(EntityPlayer entityplayer, int i, boolean flag, Location location) { public EntityPlayer moveToWorld(EntityPlayer entityplayer, int i, boolean flag, Location location) {
// CraftBukkit end
this.server.getTracker(entityplayer.dimension).untrackPlayer(entityplayer); this.server.getTracker(entityplayer.dimension).untrackPlayer(entityplayer);
// this.server.getTracker(entityplayer.dimension).untrackEntity(entityplayer); // CraftBukkit // this.server.getTracker(entityplayer.dimension).untrackEntity(entityplayer); // CraftBukkit
this.getPlayerManager(entityplayer.dimension).removePlayer(entityplayer); this.getPlayerManager(entityplayer.dimension).removePlayer(entityplayer);

Datei anzeigen

@ -2421,11 +2421,9 @@ public class World implements IBlockAccess {
Entity entity = null; Entity entity = null;
for (int i = 0; i < list.size(); ++i) { for (int i = 0; i < list.size(); ++i) {
entity = (Entity) list.get(i); entity = (Entity) list.get(i);
// CraftBukkit start - fixed an NPE
if (entity == null) { if (entity == null) {
continue; continue;
} }
// CraftBukkit end
this.entityList.add(entity); this.entityList.add(entity);
// CraftBukkit end // CraftBukkit end
this.c((Entity) list.get(i)); this.c((Entity) list.get(i));