geforkt von Mirrors/Paper
Generic code cleanup
Dieser Commit ist enthalten in:
Ursprung
332d9c4f18
Commit
09aa37fe4a
@ -148,7 +148,7 @@ public class BlockButton extends Block {
|
||||
if (j1 == 0) {
|
||||
return true;
|
||||
} else {
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
int old = (j1 != 8) ? 1 : 0;
|
||||
int current = (j1 == 8) ? 1 : 0;
|
||||
BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(block, old, current);
|
||||
@ -156,7 +156,7 @@ public class BlockButton extends Block {
|
||||
if ((eventRedstone.getNewCurrent() > 0) != (j1 == 8)) {
|
||||
return true;
|
||||
}
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
|
||||
world.c(i, j, k, i1 + j1);
|
||||
world.b(i, j, k, i, j, k);
|
||||
@ -227,14 +227,14 @@ public class BlockButton extends Block {
|
||||
int l = world.getData(i, j, k);
|
||||
|
||||
if ((l & 8) != 0) {
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
CraftWorld craftWorld = ((WorldServer) world).getWorld();
|
||||
CraftServer server = ((WorldServer) world).getServer();
|
||||
CraftBlock block = (CraftBlock) craftWorld.getBlockAt(i, j, k);
|
||||
BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(block, 1, 0);
|
||||
server.getPluginManager().callEvent(eventRedstone);
|
||||
if (eventRedstone.getNewCurrent() > 0) return;
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
|
||||
world.c(i, j, k, l & 7);
|
||||
world.h(i, j, k, this.id);
|
||||
|
@ -84,7 +84,7 @@ public class BlockDispenser extends BlockContainer {
|
||||
}
|
||||
}
|
||||
|
||||
// Craftbukkit - following method should be public
|
||||
// CraftBukkit - private->public
|
||||
public void b(World world, int i, int j, int k, Random random) {
|
||||
int l = world.getData(i, j, k);
|
||||
float f = 0.0F;
|
||||
|
@ -61,7 +61,8 @@ public class BlockFire extends Block {
|
||||
if (!world.d(i, j - 1, k) || l > 3) {
|
||||
world.e(i, j, k, 0);
|
||||
}
|
||||
} else if (!flag && !this.b((IBlockAccess)world, i, j - 1, k) && l == 15 && random.nextInt(4) == 0) { // CraftBukkit - Cast to IBlockAccess
|
||||
// CraftBukkit - Cast to IBlockAccess
|
||||
} else if (!flag && !this.b((IBlockAccess) world, i, j - 1, k) && l == 15 && random.nextInt(4) == 0) {
|
||||
world.e(i, j, k, 0);
|
||||
} else {
|
||||
if (l % 2 == 0 && l > 2) {
|
||||
@ -94,7 +95,7 @@ public class BlockFire extends Block {
|
||||
|
||||
if (i2 > 0 && random.nextInt(l1) <= i2) {
|
||||
// CraftBukkit start - Call to stop spread of fire.
|
||||
org.bukkit.block.Block theBlock = (cworld.getBlockAt(i1, k1, j1));
|
||||
org.bukkit.block.Block theBlock = cworld.getBlockAt(i1, k1, j1);
|
||||
|
||||
if (theBlock.getTypeId() != Block.FIRE.id) {
|
||||
BlockIgniteEvent event = new BlockIgniteEvent(theBlock, igniteCause, thePlayer);
|
||||
@ -132,7 +133,7 @@ public class BlockFire extends Block {
|
||||
// CraftBukkit start
|
||||
Server server = ((WorldServer) world).getServer();
|
||||
CraftWorld cworld = ((WorldServer) world).getWorld();
|
||||
org.bukkit.block.Block theBlock = (cworld.getBlockAt(i, j, k));
|
||||
org.bukkit.block.Block theBlock = cworld.getBlockAt(i, j, k);
|
||||
BlockBurnEvent event = new BlockBurnEvent(theBlock);
|
||||
server.getPluginManager().callEvent(event);
|
||||
if (event.isCancelled()) {
|
||||
|
@ -28,9 +28,8 @@ public class BlockFlowing extends BlockFluids {
|
||||
}
|
||||
|
||||
public void a(World world, int i, int j, int k, Random random) {
|
||||
// CraftBukkit start
|
||||
// CraftBukkit
|
||||
CraftBlock source = (CraftBlock) ((WorldServer) world).getWorld().getBlockAt(i, j, k);
|
||||
// CraftBukkit end
|
||||
|
||||
int l = this.g(world, i, j, k);
|
||||
byte b0 = 1;
|
||||
@ -96,8 +95,7 @@ public class BlockFlowing extends BlockFluids {
|
||||
}
|
||||
|
||||
if (this.l(world, i, j - 1, k)) {
|
||||
// CraftBukkit start
|
||||
// Craftbucket send "down" to the server
|
||||
// CraftBukkit start - send "down" to the server
|
||||
BlockFromToEvent event = new BlockFromToEvent(Type.BLOCK_FLOW, source, BlockFace.DOWN);
|
||||
((WorldServer) world).getServer().getPluginManager().callEvent(event);
|
||||
|
||||
|
@ -113,14 +113,14 @@ public class BlockPressurePlate extends Block {
|
||||
flag1 = true;
|
||||
}
|
||||
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
CraftWorld craftWorld = ((WorldServer) world).getWorld();
|
||||
CraftServer server = ((WorldServer) world).getServer();
|
||||
CraftBlock block = (CraftBlock) craftWorld.getBlockAt(i, j, k);
|
||||
BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(block, flag ? 1 : 0, flag1 ? 1 : 0);
|
||||
server.getPluginManager().callEvent(eventRedstone);
|
||||
flag1 = eventRedstone.getNewCurrent() > 0;
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
|
||||
if (flag1 && !flag) {
|
||||
world.c(i, j, k, 1);
|
||||
|
@ -98,14 +98,14 @@ public class BlockRedstoneTorch extends BlockTorch {
|
||||
b.remove(0);
|
||||
}
|
||||
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
CraftBlock block = (CraftBlock) ((WorldServer) world).getWorld().getBlockAt(i, j, k);
|
||||
BlockRedstoneEvent event = new BlockRedstoneEvent(block, flag ? 15 : 0, flag ? 0 : 15);
|
||||
((WorldServer) world).getServer().getPluginManager().callEvent(event);
|
||||
if ((event.getNewCurrent() != 0) == flag) {
|
||||
return;
|
||||
}
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
|
||||
if (this.a) {
|
||||
if (flag) {
|
||||
@ -133,7 +133,8 @@ public class BlockRedstoneTorch extends BlockTorch {
|
||||
}
|
||||
|
||||
public boolean c(World world, int i, int j, int k, int l) {
|
||||
return l == 0 ? this.b((IBlockAccess) world, i, j, k, l) : false; // CraftBukkit -- cast to IBlockAccess
|
||||
// CraftBukkit -- cast to IBlockAccess
|
||||
return l == 0 ? this.b((IBlockAccess) world, i, j, k, l) : false;
|
||||
}
|
||||
|
||||
public int a(int i, Random random) {
|
||||
|
@ -103,14 +103,14 @@ public class BlockRedstoneWire extends Block {
|
||||
}
|
||||
}
|
||||
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
if (k1 != l1) {
|
||||
CraftBlock block = (CraftBlock) ((WorldServer) world).getWorld().getBlockAt(i, j, k);
|
||||
BlockRedstoneEvent event = new BlockRedstoneEvent(block, k1, l1);
|
||||
((WorldServer) world).getServer().getPluginManager().callEvent(event);
|
||||
l1 = event.getNewCurrent();
|
||||
}
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
|
||||
if (k1 != l1) {
|
||||
world.h = true;
|
||||
@ -293,7 +293,8 @@ public class BlockRedstoneWire extends Block {
|
||||
}
|
||||
|
||||
public boolean c(World world, int i, int j, int k, int l) {
|
||||
return !this.a ? false : this.b((IBlockAccess) world, i, j, k, l); // CraftBukkit -- cast to IBlockAccess
|
||||
// CraftBukkit -- cast to IBlockAccess
|
||||
return !this.a ? false : this.b((IBlockAccess) world, i, j, k, l);
|
||||
}
|
||||
|
||||
public boolean b(IBlockAccess iblockaccess, int i, int j, int k, int l) {
|
||||
|
@ -6,6 +6,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
// CraftBukkit
|
||||
import org.bukkit.craftbukkit.CraftWorld;
|
||||
|
||||
public class Chunk {
|
||||
@ -358,7 +359,8 @@ public class Chunk {
|
||||
|
||||
if (i != this.j || j != this.k) {
|
||||
System.out.println("Wrong location! " + entity);
|
||||
System.out.println("" + entity.locX + "," + entity.locZ + "(" + i + "," + j + ") vs " + this.j + "," + this.k); // CraftBukkit
|
||||
// CraftBukkit
|
||||
System.out.println("" + entity.locX + "," + entity.locZ + "(" + i + "," + j + ") vs " + this.j + "," + this.k);
|
||||
Thread.dumpStack();
|
||||
}
|
||||
|
||||
|
@ -23,8 +23,8 @@ public class ChunkProviderServer implements IChunkProvider {
|
||||
private IChunkProvider c;
|
||||
private IChunkLoader d;
|
||||
public LongHashtable<Chunk> e = new LongHashtable<Chunk>(); // CraftBukkit
|
||||
public List f = new ArrayList(); // Craftbukkit
|
||||
public WorldServer g; // Craftbukkit
|
||||
public List f = new ArrayList(); // CraftBukkit
|
||||
public WorldServer g; // CraftBukkit
|
||||
|
||||
public ChunkProviderServer(WorldServer worldserver, IChunkLoader ichunkloader, IChunkProvider ichunkprovider) {
|
||||
this.b = new EmptyChunk(worldserver, new byte['\u8000'], 0, 0);
|
||||
@ -34,7 +34,7 @@ public class ChunkProviderServer implements IChunkProvider {
|
||||
}
|
||||
|
||||
public boolean a(int i, int j) {
|
||||
return this.e.containsKey(i, j); // Craftbukkit - entire method removed
|
||||
return this.e.containsKey(i, j); // CraftBukkit
|
||||
}
|
||||
|
||||
public void c(int i, int j) {
|
||||
@ -109,7 +109,7 @@ public class ChunkProviderServer implements IChunkProvider {
|
||||
return chunk == null ? (this.g.r ? this.d(i, j) : this.b) : chunk;
|
||||
}
|
||||
|
||||
public Chunk e(int i, int j) { // Craftbukkit - public
|
||||
public Chunk e(int i, int j) { // CraftBukkit - private->public
|
||||
if (this.d == null) {
|
||||
return null;
|
||||
} else {
|
||||
@ -128,7 +128,7 @@ public class ChunkProviderServer implements IChunkProvider {
|
||||
}
|
||||
}
|
||||
|
||||
public void a(Chunk chunk) { // Craftbukkit - public
|
||||
public void a(Chunk chunk) { // CraftBukkit - private->public
|
||||
if (this.d != null) {
|
||||
try {
|
||||
this.d.b(this.g, chunk);
|
||||
@ -138,7 +138,7 @@ public class ChunkProviderServer implements IChunkProvider {
|
||||
}
|
||||
}
|
||||
|
||||
public void b(Chunk chunk) { // Craftbukkit - public
|
||||
public void b(Chunk chunk) { // CraftBukkit - private->public
|
||||
if (this.d != null) {
|
||||
try {
|
||||
chunk.r = this.g.k();
|
||||
@ -201,9 +201,9 @@ public class ChunkProviderServer implements IChunkProvider {
|
||||
Chunk chunk = e.get(chunkcoordinates);
|
||||
if (chunk == null) continue;
|
||||
|
||||
ChunkUnloadEvent cue = new ChunkUnloadEvent(Type.CHUNK_UNLOADED, chunk.bukkitChunk);
|
||||
server.getPluginManager().callEvent(cue);
|
||||
if (!cue.isCancelled()) {
|
||||
ChunkUnloadEvent event = new ChunkUnloadEvent(Type.CHUNK_UNLOADED, chunk.bukkitChunk);
|
||||
server.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
g.getWorld().preserveChunk( (CraftChunk) chunk.bukkitChunk );
|
||||
|
||||
chunk.e();
|
||||
|
@ -17,7 +17,7 @@ public class ConsoleCommandHandler {
|
||||
String s = servercommand.a;
|
||||
ICommandListener icommandlistener = servercommand.b;
|
||||
String s1 = icommandlistener.c();
|
||||
WorldServer worldserver = b.worlds.get(0); // Craftbukkit
|
||||
WorldServer worldserver = this.b.worlds.get(0); // CraftBukkit
|
||||
ServerConfigurationManager serverconfigurationmanager = this.b.f;
|
||||
|
||||
if (!s.toLowerCase().startsWith("help") && !s.toLowerCase().startsWith("?")) {
|
||||
|
@ -2,14 +2,15 @@ package net.minecraft.server;
|
||||
|
||||
import java.util.logging.ConsoleHandler;
|
||||
import java.util.logging.FileHandler;
|
||||
import java.util.logging.Handler;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import java.util.logging.Handler; // CraftBukkit
|
||||
|
||||
public class ConsoleLogManager {
|
||||
|
||||
public static Logger a = Logger.getLogger("Minecraft");
|
||||
public static Logger global = Logger.getLogger(""); // Craftbukkit
|
||||
public static Logger global = Logger.getLogger(""); // CraftBukkit
|
||||
|
||||
public ConsoleLogManager() {}
|
||||
|
||||
@ -19,22 +20,22 @@ public class ConsoleLogManager {
|
||||
a.setUseParentHandlers(false);
|
||||
ConsoleHandler consolehandler = new ConsoleHandler();
|
||||
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
for (Handler handler: global.getHandlers()) {
|
||||
global.removeHandler(handler);
|
||||
}
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
|
||||
consolehandler.setFormatter(consolelogformatter);
|
||||
a.addHandler(consolehandler);
|
||||
global.addHandler(consolehandler); // Craftbukkit
|
||||
global.addHandler(consolehandler); // CraftBukkit
|
||||
|
||||
try {
|
||||
FileHandler filehandler = new FileHandler("server.log", true);
|
||||
|
||||
filehandler.setFormatter(consolelogformatter);
|
||||
a.addHandler(filehandler);
|
||||
global.addHandler(filehandler); // Craftbukkit
|
||||
global.addHandler(filehandler); // CraftBukkit
|
||||
} catch (Exception exception) {
|
||||
a.log(Level.WARNING, "Failed to log to server.log", exception);
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ public abstract class Entity {
|
||||
public int ticksLived;
|
||||
public int maxFireTicks;
|
||||
public int fireTicks;
|
||||
public int maxAirTicks; // Craftbukkit: Make public
|
||||
public int maxAirTicks; // CraftBukkit -- protected->public
|
||||
protected boolean bv;
|
||||
public int noDamageTicks;
|
||||
public int airTicks;
|
||||
@ -264,8 +264,7 @@ public abstract class Entity {
|
||||
|
||||
protected void P() {
|
||||
if (!this.by) {
|
||||
// CraftBukkit start
|
||||
// TODO: this event spams!
|
||||
// CraftBukkit start -- TODO: this event spams!
|
||||
if (this instanceof EntityLiving) {
|
||||
CraftServer server = ((WorldServer) this.world).getServer();
|
||||
// TODO: shouldn't be sending null for the block.
|
||||
@ -276,6 +275,7 @@ public abstract class Entity {
|
||||
|
||||
EntityDamageByBlockEvent event = new EntityDamageByBlockEvent(damager, damagee, damageType, damageDone);
|
||||
server.getPluginManager().callEvent(event);
|
||||
|
||||
if (!event.isCancelled()) {
|
||||
this.a((Entity) null, event.getDamage());
|
||||
}
|
||||
@ -476,7 +476,7 @@ public abstract class Entity {
|
||||
int i1;
|
||||
int j1;
|
||||
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
if ((this.bg) && (getBukkitEntity() instanceof Vehicle)) {
|
||||
Vehicle vehicle = (Vehicle) getBukkitEntity();
|
||||
org.bukkit.World wrld = ((WorldServer) world).getWorld();
|
||||
@ -495,7 +495,7 @@ public abstract class Entity {
|
||||
VehicleBlockCollisionEvent event = new VehicleBlockCollisionEvent(Type.VEHICLE_COLLISION_BLOCK, vehicle, block);
|
||||
((WorldServer) world).getServer().getPluginManager().callEvent(event);
|
||||
}
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
|
||||
if (this.bg && !flag) {
|
||||
this.bf = (float) ((double) this.bf + (double) MathHelper.a(d9 * d9 + d10 * d10) * 0.6D);
|
||||
@ -602,11 +602,12 @@ public abstract class Entity {
|
||||
EntityDamageEvent event = new EntityDamageEvent(damagee, damageType, damageDone);
|
||||
server.getPluginManager().callEvent(event);
|
||||
|
||||
if (!event.isCancelled()){
|
||||
this.a((Entity) null, event.getDamage());
|
||||
}
|
||||
if (event.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
i = event.getDamage();
|
||||
}
|
||||
// CraftBukkit end
|
||||
this.a((Entity) null, i);
|
||||
}
|
||||
@ -843,7 +844,7 @@ public abstract class Entity {
|
||||
this.airTicks = nbttagcompound.d("Air");
|
||||
this.onGround = nbttagcompound.m("OnGround");
|
||||
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
if (nbttagcompound.b("World")) {
|
||||
String worldName = nbttagcompound.i("World");
|
||||
|
||||
@ -854,7 +855,7 @@ public abstract class Entity {
|
||||
}
|
||||
}
|
||||
}
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
|
||||
this.a(this.locX, this.locY, this.locZ);
|
||||
this.b(nbttagcompound);
|
||||
@ -1021,14 +1022,15 @@ public abstract class Entity {
|
||||
this.e = 0.0D;
|
||||
if (entity == null) {
|
||||
if (this.vehicle != null) {
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
if ((this.getBukkitEntity() instanceof LivingEntity) && (vehicle.getBukkitEntity() instanceof CraftVehicle)) {
|
||||
CraftVehicle cvehicle = (CraftVehicle) vehicle.getBukkitEntity();
|
||||
LivingEntity living = (LivingEntity) getBukkitEntity();
|
||||
|
||||
VehicleExitEvent event = new VehicleExitEvent(Type.VEHICLE_EXIT, cvehicle, living);
|
||||
((WorldServer) world).getServer().getPluginManager().callEvent(event);
|
||||
}
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
|
||||
this.c(this.vehicle.locX, this.vehicle.boundingBox.b + (double) this.vehicle.width, this.vehicle.locZ, this.yaw, this.pitch);
|
||||
this.vehicle.passenger = null;
|
||||
@ -1036,14 +1038,15 @@ public abstract class Entity {
|
||||
|
||||
this.vehicle = null;
|
||||
} else if (this.vehicle == entity) {
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
if ((this.getBukkitEntity() instanceof LivingEntity) && (vehicle.getBukkitEntity() instanceof CraftVehicle)) {
|
||||
CraftVehicle cvehicle = (CraftVehicle) vehicle.getBukkitEntity();
|
||||
LivingEntity living = (LivingEntity) getBukkitEntity();
|
||||
|
||||
VehicleExitEvent event = new VehicleExitEvent(Type.VEHICLE_EXIT, cvehicle, living);
|
||||
((WorldServer) world).getServer().getPluginManager().callEvent(event);
|
||||
}
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
|
||||
this.vehicle.passenger = null;
|
||||
this.vehicle = null;
|
||||
|
@ -220,7 +220,8 @@ public class EntityBoat extends Entity {
|
||||
this.motZ += this.passenger.motZ * 0.2D;
|
||||
}
|
||||
|
||||
d4 = this.maxSpeed; // CraftBukkit
|
||||
// CraftBukkit
|
||||
d4 = this.maxSpeed;
|
||||
if (this.motX < -d4) {
|
||||
this.motX = -d4;
|
||||
}
|
||||
@ -325,7 +326,9 @@ public class EntityBoat extends Entity {
|
||||
Location from = new Location(world, prevX, prevY, prevZ, prevYaw, prevPitch);
|
||||
Location to = new Location(world, this.locX, this.locY, this.locZ, this.yaw, this.pitch);
|
||||
Vehicle vehicle = (Vehicle) this.getBukkitEntity();
|
||||
|
||||
server.getPluginManager().callEvent(new VehicleEvent(Type.VEHICLE_UPDATE, vehicle));
|
||||
|
||||
if (!from.equals(to)) {
|
||||
VehicleMoveEvent event = new VehicleMoveEvent(Type.VEHICLE_MOVE, vehicle, from, to);
|
||||
server.getPluginManager().callEvent(event);
|
||||
|
@ -10,8 +10,8 @@ import org.bukkit.event.entity.EntityTargetEvent.TargetReason;
|
||||
|
||||
public class EntityCreature extends EntityLiving {
|
||||
|
||||
public PathEntity a; // Craftbukkit - public
|
||||
public Entity d; // Craftbukkit - public
|
||||
public PathEntity a; // CraftBukkit - public
|
||||
public Entity d; // CraftBukkit - public
|
||||
protected boolean e = false;
|
||||
|
||||
public EntityCreature(World world) {
|
||||
@ -29,6 +29,7 @@ public class EntityCreature extends EntityLiving {
|
||||
EntityTargetEvent event = new EntityTargetEvent(this.getBukkitEntity(), target.getBukkitEntity(), TargetReason.CLOSEST_PLAYER);
|
||||
CraftServer server = ((WorldServer) this.world).getServer();
|
||||
server.getPluginManager().callEvent(event);
|
||||
|
||||
if (!event.isCancelled()) {
|
||||
if (event.getTarget() == null) {
|
||||
this.d = null;
|
||||
@ -46,6 +47,7 @@ public class EntityCreature extends EntityLiving {
|
||||
EntityTargetEvent event = new EntityTargetEvent(this.getBukkitEntity(), null, TargetReason.TARGET_DIED);
|
||||
CraftServer server = ((WorldServer) this.world).getServer();
|
||||
server.getPluginManager().callEvent(event);
|
||||
|
||||
if (!event.isCancelled()) {
|
||||
if (event.getTarget() == null) {
|
||||
this.d = null;
|
||||
@ -115,7 +117,8 @@ public class EntityCreature extends EntityLiving {
|
||||
double d1 = vec3d.a - this.locX;
|
||||
double d2 = vec3d.c - this.locZ;
|
||||
double d3 = vec3d.b - (double) l1;
|
||||
float f4 = (float) (TrigMath.atan2(d2, d1) * 180.0D / 3.1415927410125732D) - 90.0F; // Craftbukkit
|
||||
// CraftBukkit -- Math -> TrigMath
|
||||
float f4 = (float) (TrigMath.atan2(d2, d1) * 180.0D / 3.1415927410125732D) - 90.0F;
|
||||
float f5 = f4 - this.yaw;
|
||||
|
||||
for (this.av = this.az; f5 < -180.0F; f5 += 360.0F) {
|
||||
|
@ -83,18 +83,20 @@ public class EntityCreeper extends EntityMonster {
|
||||
this.e(1);
|
||||
++this.a;
|
||||
if (this.a >= 30) {
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
CraftServer server = ((WorldServer) this.world).getServer();
|
||||
org.bukkit.event.Event.Type eventType = ExplosionPrimedEvent.Type.EXPLOSION_PRIMED;
|
||||
|
||||
ExplosionPrimedEvent event = new ExplosionPrimedEvent(eventType, CraftEntity.getEntity(server, this), 3.0F, false);
|
||||
server.getPluginManager().callEvent(event);
|
||||
|
||||
if (!event.isCancelled()) {
|
||||
this.world.a(this, this.locX, this.locY, this.locZ, event.getRadius(), event.getFire());
|
||||
this.C();
|
||||
} else {
|
||||
this.a = 0;
|
||||
}
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
this.e = true;
|
||||
|
@ -184,7 +184,7 @@ public class EntityEgg extends Entity {
|
||||
}
|
||||
|
||||
boolean hatching = !this.world.isStatic && this.random.nextInt(8) == 0;
|
||||
byte numHatching = (this.random.nextInt(32) == 0) ? (byte) 4 : (byte) 1;
|
||||
int numHatching = (this.random.nextInt(32) == 0) ? 4 : 1;
|
||||
if (!hatching) {
|
||||
numHatching = 0;
|
||||
}
|
||||
@ -195,8 +195,9 @@ public class EntityEgg extends Entity {
|
||||
Type eventType = Type.PLAYER_EGG_THROW;
|
||||
Player player = (this.g == null) ? null : (Player) this.g.getBukkitEntity();
|
||||
|
||||
PlayerEggThrowEvent event = new PlayerEggThrowEvent(eventType, player, (Egg)this.getBukkitEntity(), hatching, numHatching, hatchingType);
|
||||
PlayerEggThrowEvent event = new PlayerEggThrowEvent(eventType, player, (Egg) this.getBukkitEntity(), hatching, (byte) numHatching, hatchingType);
|
||||
server.getPluginManager().callEvent(event);
|
||||
|
||||
hatching = event.isHatching();
|
||||
numHatching = event.getNumHatches();
|
||||
hatchingType = event.getHatchType();
|
||||
|
@ -144,20 +144,20 @@ public class EntityFireball extends Entity {
|
||||
stick = movingobjectposition.g.a(this.j, 0);
|
||||
}
|
||||
if (stick) {
|
||||
// CraftBukkit end
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
CraftServer server = ((WorldServer) this.world).getServer();
|
||||
org.bukkit.event.Event.Type eventType = ExplosionPrimedEvent.Type.EXPLOSION_PRIMED;
|
||||
|
||||
ExplosionPrimedEvent event = new ExplosionPrimedEvent(eventType, CraftEntity.getEntity(server, this), 1.0F, false);
|
||||
server.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
this.world.a((Entity) null, this.locX, this.locY, this.locZ, event.getRadius(), event.getFire());
|
||||
this.C();
|
||||
}
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
this.locX += this.motX;
|
||||
|
@ -213,9 +213,9 @@ public class EntityFish extends Entity {
|
||||
stick = movingobjectposition.g.a(this.b, 0);
|
||||
}
|
||||
if (!stick) {
|
||||
// CraftBukkit end
|
||||
this.c = movingobjectposition.g;
|
||||
}
|
||||
// CraftBukkit end
|
||||
} else {
|
||||
this.h = true;
|
||||
}
|
||||
|
@ -159,7 +159,8 @@ public abstract class EntityHuman extends EntityLiving {
|
||||
this.n = this.o;
|
||||
super.q();
|
||||
float f = MathHelper.a(this.motX * this.motX + this.motZ * this.motZ);
|
||||
float f1 = (float) TrigMath.atan(-this.motY * 0.20000000298023224D) * 15.0F; // CraftBukkit
|
||||
// CraftBukkit -- Math -> TrigMath
|
||||
float f1 = (float) TrigMath.atan(-this.motY * 0.20000000298023224D) * 15.0F;
|
||||
|
||||
if (f > 0.1F) {
|
||||
f = 0.1F;
|
||||
@ -258,6 +259,7 @@ public abstract class EntityHuman extends EntityLiving {
|
||||
Player player = (Player) this.getBukkitEntity();
|
||||
CraftServer server = ((WorldServer) world).getServer();
|
||||
CraftItem drop = new CraftItem(server, entityitem);
|
||||
|
||||
PlayerDropItemEvent event = new PlayerDropItemEvent(player, drop);
|
||||
server.getPluginManager().callEvent(event);
|
||||
|
||||
@ -416,21 +418,19 @@ public abstract class EntityHuman extends EntityLiving {
|
||||
org.bukkit.entity.Entity damager = this.getBukkitEntity();
|
||||
org.bukkit.entity.Entity damagee = (entity == null) ? null : entity.getBukkitEntity();
|
||||
DamageCause damageType = EntityDamageEvent.DamageCause.ENTITY_ATTACK;
|
||||
int damageDone = i;
|
||||
|
||||
EntityDamageByEntityEvent event = new EntityDamageByEntityEvent(damager, damagee, damageType, damageDone);
|
||||
EntityDamageByEntityEvent event = new EntityDamageByEntityEvent(damager, damagee, damageType, i);
|
||||
server.getPluginManager().callEvent(event);
|
||||
|
||||
if (event.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
entity.a(this, event.getDamage());
|
||||
} else {
|
||||
entity.a(this, i);
|
||||
i = event.getDamage();
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
entity.a(this, i);
|
||||
ItemStack itemstack = this.z();
|
||||
|
||||
if (itemstack != null && entity instanceof EntityLiving) {
|
||||
|
@ -124,6 +124,7 @@ public abstract class EntityLiving extends Entity {
|
||||
CraftServer server = ((WorldServer) this.world).getServer();
|
||||
org.bukkit.entity.Entity victim = this.getBukkitEntity();
|
||||
DamageCause damageType = EntityDamageEvent.DamageCause.SUFFOCATION;
|
||||
|
||||
EntityDamageEvent event = new EntityDamageEvent(victim, damageType, 1);
|
||||
server.getPluginManager().callEvent(event);
|
||||
|
||||
@ -239,7 +240,8 @@ public abstract class EntityLiving extends Entity {
|
||||
if (f > 0.05F) {
|
||||
f3 = 1.0F;
|
||||
f2 = f * 3.0F;
|
||||
f1 = (float) TrigMath.atan2(d1, d0) * 180.0F / 3.1415927F - 90.0F; // Craftbukkit
|
||||
// CraftBukkit -- Math -> TrigMath
|
||||
f1 = (float) TrigMath.atan2(d1, d0) * 180.0F / 3.1415927F - 90.0F;
|
||||
}
|
||||
|
||||
if (this.V > 0.0F) {
|
||||
@ -446,13 +448,14 @@ public abstract class EntityLiving extends Entity {
|
||||
}
|
||||
|
||||
protected void o() {
|
||||
// Craftbukkit start - whole method
|
||||
int i = this.h();
|
||||
|
||||
// CraftBukkit start - whole method
|
||||
List<org.bukkit.inventory.ItemStack> loot = new ArrayList<org.bukkit.inventory.ItemStack>();
|
||||
int drop = this.h();
|
||||
int count = random.nextInt(3);
|
||||
|
||||
if ((drop > 0) && (count > 0)) {
|
||||
loot.add(new org.bukkit.inventory.ItemStack(drop, count));
|
||||
if ((i > 0) && (count > 0)) {
|
||||
loot.add(new org.bukkit.inventory.ItemStack(i, count));
|
||||
}
|
||||
|
||||
CraftEntity entity = (CraftEntity) getBukkitEntity();
|
||||
@ -464,7 +467,7 @@ public abstract class EntityLiving extends Entity {
|
||||
for (org.bukkit.inventory.ItemStack stack: event.getDrops()) {
|
||||
cworld.dropItemNaturally(entity.getLocation(), stack);
|
||||
}
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
protected int h() {
|
||||
@ -479,6 +482,7 @@ public abstract class EntityLiving extends Entity {
|
||||
CraftServer server = ((WorldServer) this.world).getServer();
|
||||
org.bukkit.entity.Entity victim = this.getBukkitEntity();
|
||||
DamageCause damageType = EntityDamageEvent.DamageCause.FALL;
|
||||
|
||||
EntityDamageEvent event = new EntityDamageEvent(victim, damageType, i);
|
||||
server.getPluginManager().callEvent(event);
|
||||
|
||||
|
@ -47,7 +47,7 @@ public class EntityMinecart extends Entity implements IInventory {
|
||||
|
||||
public EntityMinecart(World world) {
|
||||
super(world);
|
||||
this.h = new ItemStack[27]; //Craftbukkit
|
||||
this.h = new ItemStack[27]; // CraftBukkit
|
||||
this.a = 0;
|
||||
this.b = 0;
|
||||
this.c = 1;
|
||||
@ -111,6 +111,7 @@ public class EntityMinecart extends Entity implements IInventory {
|
||||
if (event.isCancelled()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
i = event.getDamage();
|
||||
// CraftBukkit end
|
||||
|
||||
@ -225,7 +226,8 @@ public class EntityMinecart extends Entity implements IInventory {
|
||||
--j;
|
||||
}
|
||||
|
||||
double d4 = this.maxSpeed; // CraftBukkit
|
||||
// CraftBukkit
|
||||
double d4 = this.maxSpeed;
|
||||
boolean flag = false;
|
||||
|
||||
d0 = 0.0078125D;
|
||||
@ -254,7 +256,8 @@ public class EntityMinecart extends Entity implements IInventory {
|
||||
this.motZ -= d0;
|
||||
}
|
||||
|
||||
int[][] aint = EntityMinecart.j[l]; // CraftBukkit -- be explicit.
|
||||
// CraftBukkit -- be explicit.
|
||||
int[][] aint = EntityMinecart.j[l];
|
||||
double d5 = (double) (aint[1][0] - aint[0][0]);
|
||||
double d6 = (double) (aint[1][2] - aint[0][2]);
|
||||
double d7 = Math.sqrt(d5 * d5 + d6 * d6);
|
||||
@ -327,7 +330,8 @@ public class EntityMinecart extends Entity implements IInventory {
|
||||
this.a(this.locX, this.locY + (double) aint[1][1], this.locZ);
|
||||
}
|
||||
|
||||
if (this.passenger != null || !slowWhenEmpty) { // Craftbukkit
|
||||
// CraftBukkit
|
||||
if (this.passenger != null || !slowWhenEmpty) {
|
||||
this.motX *= 0.996999979019165D;
|
||||
this.motY *= 0.0D;
|
||||
this.motZ *= 0.996999979019165D;
|
||||
@ -464,7 +468,9 @@ public class EntityMinecart extends Entity implements IInventory {
|
||||
Location from = new Location(world, prevX, prevY, prevZ, prevYaw, prevPitch);
|
||||
Location to = new Location(world, this.locX, this.locY, this.locZ, this.yaw, this.pitch);
|
||||
Vehicle vehicle = (Vehicle) this.getBukkitEntity();
|
||||
|
||||
server.getPluginManager().callEvent(new VehicleEvent(Type.VEHICLE_UPDATE, vehicle));
|
||||
|
||||
if (!from.equals(to)) {
|
||||
VehicleMoveEvent event = new VehicleMoveEvent(Type.VEHICLE_MOVE, vehicle, from, to);
|
||||
server.getPluginManager().callEvent(event);
|
||||
@ -606,7 +612,6 @@ public class EntityMinecart extends Entity implements IInventory {
|
||||
public void h(Entity entity) {
|
||||
if (!this.world.isStatic) {
|
||||
if (entity != this.passenger) {
|
||||
|
||||
// CraftBukkit start
|
||||
CraftServer server = ((WorldServer) world).getServer();
|
||||
Type eventType = Type.VEHICLE_COLLISION_ENTITY;
|
||||
|
@ -48,13 +48,15 @@ public class EntityMonster extends EntityCreature implements IMonster {
|
||||
if (this.passenger != entity && this.vehicle != entity) {
|
||||
if (entity != this) {
|
||||
// CraftBukkit start
|
||||
CraftServer server = ((WorldServer) this.world).getServer();
|
||||
org.bukkit.entity.Entity bukkitTarget = null;
|
||||
if (entity != null) {
|
||||
bukkitTarget = entity.getBukkitEntity();
|
||||
}
|
||||
|
||||
EntityTargetEvent event = new EntityTargetEvent(this.getBukkitEntity(), bukkitTarget, TargetReason.TARGET_ATTACKED_ENTITY);
|
||||
CraftServer server = ((WorldServer) this.world).getServer();
|
||||
server.getPluginManager().callEvent(event);
|
||||
|
||||
if (!event.isCancelled()) {
|
||||
if (event.getTarget() == null) {
|
||||
this.d = null;
|
||||
@ -83,18 +85,18 @@ public class EntityMonster extends EntityCreature implements IMonster {
|
||||
org.bukkit.entity.Entity damager = this.getBukkitEntity();
|
||||
org.bukkit.entity.Entity damagee = (entity == null) ? null : entity.getBukkitEntity();
|
||||
DamageCause damageType = EntityDamageEvent.DamageCause.ENTITY_ATTACK;
|
||||
int damageDone = this.c;
|
||||
|
||||
EntityDamageByEntityEvent event = new EntityDamageByEntityEvent(damager, damagee, damageType, damageDone);
|
||||
EntityDamageByEntityEvent event = new EntityDamageByEntityEvent(damager, damagee, damageType, this.c);
|
||||
server.getPluginManager().callEvent(event);
|
||||
|
||||
if (!event.isCancelled()) {
|
||||
entity.a(this, event.getDamage());
|
||||
}
|
||||
} else {
|
||||
entity.a(this, this.c);
|
||||
return;
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
entity.a(this, this.c);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -76,13 +76,15 @@ public class EntityPigZombie extends EntityZombie {
|
||||
|
||||
private void c(Entity entity) {
|
||||
// CraftBukkit start
|
||||
CraftServer server = ((WorldServer) this.world).getServer();
|
||||
org.bukkit.entity.Entity bukkitTarget = null;
|
||||
if (entity != null) {
|
||||
bukkitTarget = entity.getBukkitEntity();
|
||||
}
|
||||
|
||||
EntityTargetEvent event = new EntityTargetEvent(this.getBukkitEntity(), bukkitTarget, TargetReason.PIG_ZOMBIE_TARGET);
|
||||
CraftServer server = ((WorldServer) this.world).getServer();
|
||||
server.getPluginManager().callEvent(event);
|
||||
|
||||
if (!event.isCancelled()) {
|
||||
if (event.getTarget() == null) {
|
||||
this.d = null;
|
||||
|
@ -1,17 +1,19 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
// CraftBukkit start
|
||||
import java.util.ArrayList;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.craftbukkit.CraftWorld;
|
||||
import org.bukkit.craftbukkit.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.entity.EntityDeathEvent;
|
||||
// CraftBukkit end
|
||||
|
||||
public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
|
||||
@ -86,7 +88,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
}
|
||||
|
||||
public void a(Entity entity) {
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
List<org.bukkit.inventory.ItemStack> loot = new ArrayList<org.bukkit.inventory.ItemStack>();
|
||||
|
||||
for (int i = 0; i < inventory.a.length; ++i) {
|
||||
@ -101,16 +103,17 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
}
|
||||
}
|
||||
|
||||
CraftEntity ent = (CraftEntity)getBukkitEntity();
|
||||
EntityDeathEvent event = new EntityDeathEvent(Event.Type.ENTITY_DEATH, ent, loot);
|
||||
CraftEntity craftEntity = (CraftEntity) getBukkitEntity();
|
||||
CraftWorld cworld = ((WorldServer) world).getWorld();
|
||||
Server server = ((WorldServer) world).getServer();
|
||||
|
||||
EntityDeathEvent event = new EntityDeathEvent(Event.Type.ENTITY_DEATH, craftEntity, loot);
|
||||
server.getPluginManager().callEvent(event);
|
||||
|
||||
for (org.bukkit.inventory.ItemStack stack: event.getDrops()) {
|
||||
cworld.dropItemNaturally(ent.getLocation(), stack);
|
||||
cworld.dropItemNaturally(craftEntity.getLocation(), stack);
|
||||
}
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
public boolean a(Entity entity, int i) {
|
||||
|
@ -42,8 +42,10 @@ public class EntitySkeleton extends EntityMonster {
|
||||
CraftServer server = ((WorldServer) this.world).getServer();
|
||||
Type eventType = Type.ENTITY_COMBUST;
|
||||
org.bukkit.entity.Entity entity = this.getBukkitEntity();
|
||||
|
||||
EntityCombustEvent event = new EntityCombustEvent(eventType, entity);
|
||||
server.getPluginManager().callEvent(event);
|
||||
|
||||
if (!event.isCancelled()) {
|
||||
this.fireTicks = 300;
|
||||
}
|
||||
@ -90,7 +92,7 @@ public class EntitySkeleton extends EntityMonster {
|
||||
}
|
||||
|
||||
protected void o() {
|
||||
// Craftbukkit start - whole method
|
||||
// CraftBukkit start - whole method
|
||||
List<org.bukkit.inventory.ItemStack> loot = new ArrayList<org.bukkit.inventory.ItemStack>();
|
||||
|
||||
int count = this.random.nextInt(3);
|
||||
@ -103,15 +105,16 @@ public class EntitySkeleton extends EntityMonster {
|
||||
loot.add(new org.bukkit.inventory.ItemStack(org.bukkit.Material.BONE, count));
|
||||
}
|
||||
|
||||
CraftEntity entity = (CraftEntity)getBukkitEntity();
|
||||
EntityDeathEvent event = new EntityDeathEvent(Type.ENTITY_DEATH, entity, loot);
|
||||
CraftWorld cworld = ((WorldServer) world).getWorld();
|
||||
Server server = ((WorldServer) world).getServer();
|
||||
CraftEntity entity = (CraftEntity) getBukkitEntity();
|
||||
|
||||
EntityDeathEvent event = new EntityDeathEvent(Type.ENTITY_DEATH, entity, loot);
|
||||
server.getPluginManager().callEvent(event);
|
||||
|
||||
for (org.bukkit.inventory.ItemStack stack: event.getDrops()) {
|
||||
cworld.dropItemNaturally(entity.getLocation(), stack);
|
||||
}
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
}
|
||||
}
|
||||
|
@ -49,9 +49,10 @@ public class EntitySpider extends EntityMonster {
|
||||
|
||||
if (f1 > 0.5F && this.random.nextInt(100) == 0) {
|
||||
// CraftBukkit start
|
||||
EntityTargetEvent event = new EntityTargetEvent(this.getBukkitEntity(), null, TargetReason.FORGOT_TARGET);
|
||||
CraftServer server = ((WorldServer) this.world).getServer();
|
||||
EntityTargetEvent event = new EntityTargetEvent(this.getBukkitEntity(), null, TargetReason.FORGOT_TARGET);
|
||||
server.getPluginManager().callEvent(event);
|
||||
|
||||
if (!event.isCancelled()) {
|
||||
if (event.getTarget() == null) {
|
||||
this.d = null;
|
||||
|
@ -55,11 +55,10 @@ public class EntityTNTPrimed extends Entity {
|
||||
}
|
||||
|
||||
if (this.a-- <= 0) {
|
||||
// Craftbukkit start
|
||||
// Need to reverse the order of the explosion and the entity death so we have a location for the event.
|
||||
// CraftBukkit start - Need to reverse the order of the explosion and the entity death so we have a location for the event.
|
||||
this.h();
|
||||
this.C();
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
} else {
|
||||
this.world.a("smoke", this.locX, this.locY + 0.5D, this.locZ, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
@ -68,15 +67,17 @@ public class EntityTNTPrimed extends Entity {
|
||||
private void h() {
|
||||
float f = 4.0F;
|
||||
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
CraftServer server = ((WorldServer) this.world).getServer();
|
||||
org.bukkit.event.Event.Type eventType = ExplosionPrimedEvent.Type.EXPLOSION_PRIMED;
|
||||
|
||||
ExplosionPrimedEvent event = new ExplosionPrimedEvent(eventType, CraftEntity.getEntity(server, this), f, false);
|
||||
server.getPluginManager().callEvent(event);
|
||||
|
||||
if (!event.isCancelled()) {
|
||||
this.world.a((Entity) null, this.locX, this.locY, this.locZ, event.getRadius(), event.getFire());
|
||||
}
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
protected void a(NBTTagCompound nbttagcompound) {
|
||||
|
@ -73,7 +73,8 @@ public class EntityTracker {
|
||||
|
||||
this.a.add(entitytrackerentry);
|
||||
this.b.a(entity.id, entitytrackerentry);
|
||||
entitytrackerentry.b(entity.world.d); // Craftbukkit
|
||||
// CraftBukkit
|
||||
entitytrackerentry.b(entity.world.d); // CraftBukkit
|
||||
}
|
||||
}
|
||||
|
||||
@ -104,7 +105,8 @@ public class EntityTracker {
|
||||
while (iterator.hasNext()) {
|
||||
EntityTrackerEntry entitytrackerentry = (EntityTrackerEntry) iterator.next();
|
||||
|
||||
entitytrackerentry.a(entitytrackerentry.a.world.d); // Craftbukkit
|
||||
// CraftBukkit
|
||||
entitytrackerentry.a(entitytrackerentry.a.world.d);
|
||||
if (entitytrackerentry.m && entitytrackerentry.a instanceof EntityPlayer) {
|
||||
arraylist.add((EntityPlayer) entitytrackerentry.a);
|
||||
}
|
||||
|
@ -159,7 +159,8 @@ public class EntityTrackerEntry {
|
||||
double d1 = entityplayer.locZ - (double) (this.f / 32);
|
||||
|
||||
if (d0 >= (double) (-this.b) && d0 <= (double) this.b && d1 >= (double) (-this.b) && d1 <= (double) this.b) {
|
||||
if ((!this.n.contains(entityplayer)) && (this.a.world == entityplayer.world)) { // Craftbukkit
|
||||
// CraftBukkit
|
||||
if ((!this.n.contains(entityplayer)) && (this.a.world == entityplayer.world)) {
|
||||
this.n.add(entityplayer);
|
||||
entityplayer.a.b(this.b());
|
||||
if (this.s) {
|
||||
|
@ -24,6 +24,7 @@ public class EntityZombie extends EntityMonster {
|
||||
CraftServer server = ((WorldServer) this.world).getServer();
|
||||
EntityCombustEvent event = new EntityCombustEvent(Type.ENTITY_COMBUST, this.getBukkitEntity());
|
||||
server.getPluginManager().callEvent(event);
|
||||
|
||||
if (!event.isCancelled()) {
|
||||
this.fireTicks = 300;
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ public class Explosion {
|
||||
public float f;
|
||||
public Set g = new HashSet();
|
||||
|
||||
public boolean wasCanceled = false; // Craftbukkit
|
||||
public boolean wasCanceled = false; // CraftBukkit
|
||||
|
||||
public Explosion(World world, Entity entity, double d0, double d1, double d2, float f) {
|
||||
this.i = world;
|
||||
@ -131,8 +131,10 @@ public class Explosion {
|
||||
// TODO: get the x/y/z of the tnt block?
|
||||
// does this even get called ever? @see EntityTNTPrimed - not BlockTNT or whatever
|
||||
damageType = EntityDamageEvent.DamageCause.BLOCK_EXPLOSION;
|
||||
|
||||
EntityDamageByBlockEvent event = new EntityDamageByBlockEvent(null, damagee, damageType, damageDone);
|
||||
server.getPluginManager().callEvent(event);
|
||||
|
||||
if (!event.isCancelled()) {
|
||||
entity.a(this.e, event.getDamage());
|
||||
entity.motX += d0 * d10;
|
||||
@ -187,20 +189,20 @@ public class Explosion {
|
||||
// CraftBukkit start
|
||||
Server server = ((WorldServer) this.i).getServer();
|
||||
CraftWorld world = ((WorldServer) this.i).getWorld();
|
||||
org.bukkit.entity.Entity splode = (this.e == null) ? null : this.e.getBukkitEntity();
|
||||
org.bukkit.entity.Entity explode = (this.e == null) ? null : this.e.getBukkitEntity();
|
||||
Location location = new Location(world, this.b, this.c, this.d);
|
||||
|
||||
List<org.bukkit.block.Block> blocklist = new ArrayList<org.bukkit.block.Block>();
|
||||
List<org.bukkit.block.Block> blockList = new ArrayList<org.bukkit.block.Block>();
|
||||
for (int j = arraylist.size() - 1; j >= 0; j--) {
|
||||
ChunkPosition cpos = (ChunkPosition) arraylist.get(j);
|
||||
org.bukkit.block.Block blox = world.getBlockAt(cpos.a, cpos.b, cpos.c);
|
||||
if (!blox.getType().equals(org.bukkit.Material.AIR)) {
|
||||
blocklist.add(blox);
|
||||
org.bukkit.block.Block block = world.getBlockAt(cpos.a, cpos.b, cpos.c);
|
||||
if (!block.getType().equals(org.bukkit.Material.AIR)) {
|
||||
blockList.add(block);
|
||||
}
|
||||
}
|
||||
|
||||
org.bukkit.event.Event.Type eventType = EntityExplodeEvent.Type.ENTITY_EXPLODE;
|
||||
EntityExplodeEvent event = new EntityExplodeEvent(eventType, splode, location, blocklist);
|
||||
EntityExplodeEvent event = new EntityExplodeEvent(eventType, explode, location, blockList);
|
||||
server.getPluginManager().callEvent(event);
|
||||
|
||||
if (event.isCancelled()) {
|
||||
@ -239,7 +241,8 @@ public class Explosion {
|
||||
}
|
||||
|
||||
if (i1 > 0) {
|
||||
Block.byId[i1].a(this.i, j, k, l, this.i.getData(j, k, l), event.getYield()); // Craftbukkit
|
||||
// CraftBukkit
|
||||
Block.byId[i1].a(this.i, j, k, l, this.i.getData(j, k, l), event.getYield());
|
||||
this.i.e(j, k, l, 0);
|
||||
Block.byId[i1].c(this.i, j, k, l);
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ public class InventoryPlayer implements IInventory {
|
||||
public ItemStack[] a = new ItemStack[36];
|
||||
public ItemStack[] b = new ItemStack[4];
|
||||
public int c = 0;
|
||||
public EntityHuman e; // Craftbukkit - public
|
||||
public EntityHuman e; // CraftBukkit - private->public
|
||||
private ItemStack f;
|
||||
public boolean d = false;
|
||||
|
||||
|
@ -22,8 +22,7 @@ public class ItemBlock extends Item {
|
||||
}
|
||||
|
||||
public boolean a(ItemStack itemstack, EntityHuman entityhuman, World world, int i, int j, int k, int l) {
|
||||
// CraftBukkit start
|
||||
// Bail if we have nothing of the item in hand
|
||||
// CraftBukkit start -- Bail if we have nothing of the item in hand
|
||||
if (itemstack.count == 0) {
|
||||
return false;
|
||||
}
|
||||
@ -101,7 +100,8 @@ public class ItemBlock extends Item {
|
||||
|
||||
int distanceFromSpawn = (int) Math.max(Math.abs(i - spawnX), Math.abs(k - spawnZ));
|
||||
|
||||
boolean canBuild = distanceFromSpawn > ((WorldServer) world).x.spawnProtection || thePlayer.isOp(); // CraftBukkit Configurable spawn protection start
|
||||
// CraftBukkit Configurable spawn protection start
|
||||
boolean canBuild = distanceFromSpawn > ((WorldServer) world).x.spawnProtection || thePlayer.isOp();
|
||||
|
||||
BlockPlaceEvent event = new BlockPlaceEvent(eventType, placedBlock, replacedBlockState, blockClicked, itemInHand, thePlayer, canBuild);
|
||||
server.getPluginManager().callEvent(event);
|
||||
|
@ -5,7 +5,7 @@ public final class ItemStack {
|
||||
public int count;
|
||||
public int b;
|
||||
public int id;
|
||||
public int damage; // Craftbukkit - make public
|
||||
public int damage; // CraftBukkit - private->public
|
||||
|
||||
public ItemStack(Block block) {
|
||||
this(block, 1);
|
||||
|
@ -3,7 +3,6 @@ package net.minecraft.server;
|
||||
import java.awt.GraphicsEnvironment;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintStream;
|
||||
import java.net.InetAddress;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
@ -14,6 +13,7 @@ import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
// CraftBukkit start
|
||||
import java.io.PrintStream;
|
||||
import java.net.UnknownHostException;
|
||||
import joptsimple.OptionSet;
|
||||
import org.bukkit.command.ConsoleCommandSender;
|
||||
@ -30,7 +30,7 @@ public class MinecraftServer implements Runnable, ICommandListener {
|
||||
public static HashMap b = new HashMap();
|
||||
public NetworkListenThread c;
|
||||
public PropertyManager d;
|
||||
//public WorldServer e; // Craftbukkit - removed
|
||||
// public WorldServer e; // CraftBukkit - removed
|
||||
public ServerConfigurationManager f;
|
||||
private ConsoleCommandHandler o;
|
||||
private boolean p = true;
|
||||
@ -45,7 +45,7 @@ public class MinecraftServer implements Runnable, ICommandListener {
|
||||
public boolean m;
|
||||
public boolean n;
|
||||
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
public int spawnProtection;
|
||||
public List<WorldServer> worlds = new ArrayList<WorldServer>();
|
||||
public CraftServer server;
|
||||
@ -53,7 +53,7 @@ public class MinecraftServer implements Runnable, ICommandListener {
|
||||
public ConsoleCommandSender console;
|
||||
// Craftbukkit end
|
||||
|
||||
public MinecraftServer(OptionSet options) { // Craftbukkit - adds argument OptionSet
|
||||
public MinecraftServer(OptionSet options) { // CraftBukkit - adds argument OptionSet
|
||||
new ThreadSleepForever(this);
|
||||
this.options = options; // CraftBukkit
|
||||
}
|
||||
@ -66,10 +66,10 @@ public class MinecraftServer implements Runnable, ICommandListener {
|
||||
threadcommandreader.start();
|
||||
ConsoleLogManager.a();
|
||||
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
System.setOut(new PrintStream(new LoggerOutputStream(a, Level.INFO), true));
|
||||
System.setErr(new PrintStream(new LoggerOutputStream(a, Level.SEVERE), true));
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
|
||||
a.info("Starting minecraft server version Beta 1.3");
|
||||
if (Runtime.getRuntime().maxMemory() / 1024L / 1024L < 512L) {
|
||||
@ -78,7 +78,7 @@ public class MinecraftServer implements Runnable, ICommandListener {
|
||||
}
|
||||
|
||||
a.info("Loading properties");
|
||||
this.d = new PropertyManager(options); // Craftbukkit
|
||||
this.d = new PropertyManager(options); // CraftBukkit
|
||||
String s = this.d.a("server-ip", "");
|
||||
|
||||
this.l = this.d.a("online-mode", true);
|
||||
@ -130,18 +130,18 @@ public class MinecraftServer implements Runnable, ICommandListener {
|
||||
|
||||
a.info("Preparing start region");
|
||||
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
WorldServer world = new WorldServer(this, new ServerNBTManager(new File("."), s, true), s, this.d.a("hellworld", false) ? -1 : 0);
|
||||
world.a(new WorldManager(this, world));
|
||||
world.j = this.d.a("spawn-monsters", true) ? 1 : 0;
|
||||
world.a(this.d.a("spawn-monsters", true), this.m);
|
||||
this.f.a(world);
|
||||
worlds.add(world);
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
|
||||
short short1 = 196;
|
||||
long i = System.currentTimeMillis();
|
||||
ChunkCoordinates chunkcoordinates = worlds.get(0).l(); // Craftbukkit
|
||||
ChunkCoordinates chunkcoordinates = worlds.get(0).l(); // CraftBukkit
|
||||
|
||||
for (int j = -short1; j <= short1 && this.p; j += 16) {
|
||||
for (int k = -short1; k <= short1 && this.p; k += 16) {
|
||||
@ -159,7 +159,7 @@ public class MinecraftServer implements Runnable, ICommandListener {
|
||||
i = l;
|
||||
}
|
||||
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
for (WorldServer worldserver: worlds) {
|
||||
world.u.d(chunkcoordinates.a + j >> 4, chunkcoordinates.c + k >> 4);
|
||||
|
||||
@ -167,7 +167,7 @@ public class MinecraftServer implements Runnable, ICommandListener {
|
||||
;
|
||||
}
|
||||
}
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
}
|
||||
}
|
||||
|
||||
@ -190,15 +190,15 @@ public class MinecraftServer implements Runnable, ICommandListener {
|
||||
private void f() {
|
||||
a.info("Saving chunks");
|
||||
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
for (WorldServer world: worlds) {
|
||||
world.a(true, (IProgressUpdate) null);
|
||||
world.r();
|
||||
|
||||
Event worldSaved = new WorldEvent( Event.Type.WORLD_SAVED, world.getWorld() );
|
||||
server.getPluginManager().callEvent( worldSaved );
|
||||
WorldEvent event = new WorldEvent( Event.Type.WORLD_SAVED, world.getWorld() );
|
||||
server.getPluginManager().callEvent( event );
|
||||
}
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
private void g() {
|
||||
@ -207,13 +207,13 @@ public class MinecraftServer implements Runnable, ICommandListener {
|
||||
if (server != null) {
|
||||
server.disablePlugins();
|
||||
}
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
|
||||
if (this.f != null) {
|
||||
this.f.d();
|
||||
}
|
||||
|
||||
if (this.worlds.size() > 0) { // Craftbukkit
|
||||
if (this.worlds.size() > 0) { // CraftBukkit
|
||||
this.f();
|
||||
}
|
||||
}
|
||||
@ -243,7 +243,8 @@ public class MinecraftServer implements Runnable, ICommandListener {
|
||||
|
||||
j += l;
|
||||
i = k;
|
||||
if (this.worlds.size() > 0 && this.worlds.get(0).q()) { // Craftbukkit - TODO - Replace with loop?
|
||||
// CraftBukkit - TODO - Replace with loop?
|
||||
if (this.worlds.size() > 0 && this.worlds.get(0).q()) {
|
||||
this.h();
|
||||
j = 0L;
|
||||
} else {
|
||||
@ -314,7 +315,7 @@ public class MinecraftServer implements Runnable, ICommandListener {
|
||||
Vec3D.a();
|
||||
++this.h;
|
||||
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
if (this.h % 20 == 0) {
|
||||
for (int i = 0; i < this.f.b.size(); ++i) {
|
||||
EntityPlayer entityplayer = (EntityPlayer) this.f.b.get(i);
|
||||
@ -333,8 +334,7 @@ public class MinecraftServer implements Runnable, ICommandListener {
|
||||
|
||||
world.d();
|
||||
}
|
||||
// Craftbukkit end
|
||||
|
||||
// CraftBukkit end
|
||||
this.c.a();
|
||||
this.f.b();
|
||||
this.k.a();
|
||||
@ -358,11 +358,11 @@ public class MinecraftServer implements Runnable, ICommandListener {
|
||||
while (this.r.size() > 0) {
|
||||
ServerCommand servercommand = (ServerCommand) this.r.remove(0);
|
||||
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
if (server.dispatchCommand(console, servercommand.a)) {
|
||||
continue;
|
||||
}
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
|
||||
this.o.a(servercommand);
|
||||
}
|
||||
@ -372,7 +372,7 @@ public class MinecraftServer implements Runnable, ICommandListener {
|
||||
this.q.add(iupdateplayerlistbox);
|
||||
}
|
||||
|
||||
public static void main(final OptionSet options) { // Craftbukkit - replaces main(String args[])
|
||||
public static void main(final OptionSet options) { // CraftBukkit - replaces main(String args[])
|
||||
try {
|
||||
MinecraftServer minecraftserver = new MinecraftServer(options);
|
||||
|
||||
|
@ -79,7 +79,7 @@ public class NetLoginHandler extends NetHandler {
|
||||
a.info(this.b() + " logged in with entity id " + entityplayer.id);
|
||||
NetServerHandler netserverhandler = new NetServerHandler(this.e, this.b, entityplayer);
|
||||
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
ChunkCoordinates chunkcoordinates = entityplayer.world.l();
|
||||
netserverhandler.b((Packet) (new Packet1Login("", "", entityplayer.id, entityplayer.world.j(), (byte) entityplayer.world.m.g)));
|
||||
netserverhandler.b((Packet) (new Packet6SpawnPosition(chunkcoordinates.a, chunkcoordinates.b, chunkcoordinates.c)));
|
||||
@ -88,7 +88,7 @@ public class NetLoginHandler extends NetHandler {
|
||||
netserverhandler.a(entityplayer.locX, entityplayer.locY, entityplayer.locZ, entityplayer.yaw, entityplayer.pitch);
|
||||
this.e.c.a(netserverhandler);
|
||||
netserverhandler.b((Packet) (new Packet4UpdateTime(entityplayer.world.k())));
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
|
||||
entityplayer.l();
|
||||
}
|
||||
|
@ -3,10 +3,10 @@ package net.minecraft.server;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
// CraftBukkit start
|
||||
import java.util.logging.Level;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.block.BlockDamageLevel;
|
||||
@ -29,7 +29,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
public NetworkManager b;
|
||||
public boolean c = false;
|
||||
private MinecraftServer d;
|
||||
public EntityPlayer e; // Craftbukkit - public
|
||||
public EntityPlayer e; // CraftBukkit - private->public
|
||||
private int f;
|
||||
private int g;
|
||||
private boolean h;
|
||||
@ -76,16 +76,16 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
public void a(String s) {
|
||||
// CraftBukkit start
|
||||
String leaveMessage = "\u00A7e" + this.e.name + " left the game.";
|
||||
PlayerKickEvent kickEvent = new PlayerKickEvent(org.bukkit.event.Event.Type.PLAYER_KICK, server.getPlayer(this.e), s, leaveMessage);
|
||||
server.getPluginManager().callEvent(kickEvent);
|
||||
if (kickEvent.isCancelled()) {
|
||||
PlayerKickEvent event = new PlayerKickEvent(org.bukkit.event.Event.Type.PLAYER_KICK, server.getPlayer(this.e), s, leaveMessage);
|
||||
server.getPluginManager().callEvent(event);
|
||||
if (event.isCancelled()) {
|
||||
// Do not kick the player
|
||||
return;
|
||||
}
|
||||
// Send the possibly modified leave message
|
||||
this.b.a((Packet) (new Packet255KickDisconnect( kickEvent.getReason() )));
|
||||
this.b.a((Packet) (new Packet255KickDisconnect( event.getReason() )));
|
||||
this.b.c();
|
||||
this.d.f.a((Packet) (new Packet3Chat( kickEvent.getLeaveMessage() )));
|
||||
this.d.f.a((Packet) (new Packet3Chat( event.getLeaveMessage() )));
|
||||
// CraftBukkit end
|
||||
this.d.f.c(this.e);
|
||||
this.c = true;
|
||||
@ -159,7 +159,8 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
this.e.motX = d5;
|
||||
this.e.motZ = d4;
|
||||
if (this.e.vehicle != null) {
|
||||
((WorldServer)this.e.world).b(this.e.vehicle, true); // Craftbukkit
|
||||
// CraftBukkit
|
||||
((WorldServer) this.e.world).b(this.e.vehicle, true);
|
||||
}
|
||||
|
||||
if (this.e.vehicle != null) {
|
||||
@ -170,7 +171,8 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
this.i = this.e.locX;
|
||||
this.j = this.e.locY;
|
||||
this.k = this.e.locZ;
|
||||
this.e.world.f(this.e); // Craftbukkit
|
||||
// CraftBukkit
|
||||
this.e.world.f(this.e);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -211,7 +213,8 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
double d6 = d2 - this.e.locY;
|
||||
double d7 = d3 - this.e.locZ;
|
||||
float f4 = 0.0625F;
|
||||
boolean flag = this.e.world.a(this.e, this.e.boundingBox.b().e((double) f4, (double) f4, (double) f4)).size() == 0; // Craftbukkit
|
||||
// CraftBukkit
|
||||
boolean flag = this.e.world.a(this.e, this.e.boundingBox.b().e((double) f4, (double) f4, (double) f4)).size() == 0;
|
||||
|
||||
this.e.c(d4, d6, d7);
|
||||
d4 = d1 - this.e.locX;
|
||||
@ -232,7 +235,8 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
}
|
||||
|
||||
this.e.b(d1, d2, d3, f2, f3);
|
||||
boolean flag2 = this.e.world.a(this.e, this.e.boundingBox.b().e((double) f4, (double) f4, (double) f4)).size() == 0; // Craftbukkit
|
||||
// CraftBukkit
|
||||
boolean flag2 = this.e.world.a(this.e, this.e.boundingBox.b().e((double) f4, (double) f4, (double) f4)).size() == 0;
|
||||
|
||||
if (flag && (flag1 || !flag2) && !this.e.E()) {
|
||||
this.a(this.i, this.j, this.k, f2, f3);
|
||||
@ -275,7 +279,8 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
if (packet14blockdig.e == 4) {
|
||||
this.e.y();
|
||||
} else {
|
||||
boolean flag = ((WorldServer)this.e.world).v = this.d.f.h(this.e.name); // Craftbukkit
|
||||
// CraftBukkit
|
||||
boolean flag = ((WorldServer) this.e.world).v = this.d.f.h(this.e.name);
|
||||
boolean flag1 = false;
|
||||
|
||||
if (packet14blockdig.e == 0) {
|
||||
@ -301,7 +306,8 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
}
|
||||
}
|
||||
|
||||
ChunkCoordinates chunkcoordinates = this.e.world.l(); // Craftbukkit
|
||||
// CraftBukkit
|
||||
ChunkCoordinates chunkcoordinates = this.e.world.l();
|
||||
int l = (int) MathHelper.e((float) (i - chunkcoordinates.a));
|
||||
int i1 = (int) MathHelper.e((float) (k - chunkcoordinates.c));
|
||||
|
||||
@ -343,7 +349,6 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
}
|
||||
}
|
||||
}
|
||||
// CraftBukkit end
|
||||
} else if (packet14blockdig.e == 2) {
|
||||
// CraftBukkit start - Get last block that the player hit
|
||||
// Otherwise the block is a Bedrock @(0,0,0)
|
||||
@ -360,7 +365,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
BlockDamageEvent event;
|
||||
// If the amount of damage going to the block plus the current amount
|
||||
// of damage is greater than 1, the block is going to break.
|
||||
if (e.c.c + damage >= 1.0F) {
|
||||
if (this.e.c.c + damage >= 1.0F) {
|
||||
// if we are destroying either a redstone wire with a current greater than 0 or
|
||||
// a redstone torch that is on, then we should notify plugins that this block has
|
||||
// returned to a current value of 0 (since it will once the redstone is destroyed)
|
||||
@ -373,9 +378,10 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
}
|
||||
server.getPluginManager().callEvent(event);
|
||||
if (event.isCancelled()) {
|
||||
e.c.c = 0; // Reset the amount of damage if stopping break.
|
||||
this.e.c.c = 0; // Reset the amount of damage if stopping break.
|
||||
}
|
||||
}
|
||||
// CraftBukkit end
|
||||
} else if (packet14blockdig.e == 3) {
|
||||
double d4 = this.e.locX - ((double) i + 0.5D);
|
||||
double d5 = this.e.locY - ((double) j + 0.5D);
|
||||
@ -383,10 +389,12 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
double d7 = d4 * d4 + d5 * d5 + d6 * d6;
|
||||
|
||||
if (d7 < 256.0D) {
|
||||
// CraftBukkit
|
||||
this.e.a.b((Packet) (new Packet53BlockChange(i, j, k, this.e.world)));
|
||||
}
|
||||
}
|
||||
|
||||
// CraftBukkit start
|
||||
lastX = i;
|
||||
lastY = j;
|
||||
lastZ = k;
|
||||
@ -398,9 +406,9 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
|
||||
public void a(Packet15Place packet15place) {
|
||||
ItemStack itemstack = this.e.inventory.b();
|
||||
boolean flag = ((WorldServer)this.e.world).v = this.d.f.h(this.e.name); // Craftbukkit
|
||||
|
||||
// CraftBukkit start
|
||||
boolean flag = ((WorldServer) this.e.world).v = this.d.f.h(this.e.name);
|
||||
|
||||
CraftBlock blockClicked = null;
|
||||
BlockFace blockFace = null;
|
||||
|
||||
@ -471,7 +479,8 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
int j = packet15place.b;
|
||||
int k = packet15place.c;
|
||||
int l = packet15place.d;
|
||||
ChunkCoordinates chunkcoordinates = this.e.world.l(); // Craftbukkit
|
||||
// CraftBukkit
|
||||
ChunkCoordinates chunkcoordinates = this.e.world.l();
|
||||
int i1 = (int) MathHelper.e((float) (i - chunkcoordinates.a));
|
||||
int j1 = (int) MathHelper.e((float) (k - chunkcoordinates.c));
|
||||
|
||||
@ -488,7 +497,6 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
this.e.c.a(this.e, this.e.world, itemstack, i, j, k, l);
|
||||
this.e.a.b((Packet) (new Packet53BlockChange(i, j, k, this.e.world)));
|
||||
// CraftBukkit end
|
||||
|
||||
if (l == 0) {
|
||||
--j;
|
||||
}
|
||||
@ -513,7 +521,8 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
++i;
|
||||
}
|
||||
|
||||
this.e.a.b((Packet) (new Packet53BlockChange(i, j, k, this.e.world))); // Craftbukkit
|
||||
// CraftBukkit
|
||||
this.e.a.b((Packet) (new Packet53BlockChange(i, j, k, this.e.world)));
|
||||
}
|
||||
|
||||
if (itemstack != null && itemstack.count == 0) {
|
||||
@ -527,11 +536,13 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
this.e.activeContainer.a();
|
||||
this.e.h = false;
|
||||
|
||||
if (!ItemStack.a(this.e.inventory.b(), packet15place.e) || always) { // CraftBukkit
|
||||
// CraftBukkit
|
||||
if (!ItemStack.a(this.e.inventory.b(), packet15place.e) || always) {
|
||||
this.b((Packet) (new Packet103SetSlot(this.e.activeContainer.f, slot.a, this.e.inventory.b())));
|
||||
}
|
||||
|
||||
((WorldServer)this.e.world).v = false; // Craftbukkit
|
||||
// CraftBukkit
|
||||
((WorldServer) this.e.world).v = false;
|
||||
}
|
||||
|
||||
public void a(String s, Object[] aobject) {
|
||||
@ -552,10 +563,10 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
}
|
||||
|
||||
public void a(Packet16BlockItemSwitch packet16blockitemswitch) {
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
PlayerItemHeldEvent event = new PlayerItemHeldEvent(Type.PLAYER_ITEM_HELD, getPlayer(), e.inventory.c, packet16blockitemswitch.a);
|
||||
server.getPluginManager().callEvent(event);
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
|
||||
this.e.inventory.c = packet16blockitemswitch.a;
|
||||
}
|
||||
@ -575,11 +586,11 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
}
|
||||
}
|
||||
|
||||
chat(s); // CraftBukkit
|
||||
// CraftBukkit start
|
||||
chat(s);
|
||||
}
|
||||
}
|
||||
|
||||
// CraftBukkit start
|
||||
public boolean chat(String msg) {
|
||||
if (msg.startsWith("/")) {
|
||||
this.c(msg);
|
||||
@ -589,11 +600,12 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
Player player = getPlayer();
|
||||
PlayerChatEvent event = new PlayerChatEvent(Type.PLAYER_CHAT, player, msg);
|
||||
server.getPluginManager().callEvent(event);
|
||||
msg = String.format(event.getFormat(), event.getPlayer().getDisplayName(), event.getMessage());
|
||||
|
||||
if (event.isCancelled()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
msg = String.format(event.getFormat(), event.getPlayer().getDisplayName(), event.getMessage());
|
||||
a.info(msg);
|
||||
for (final String line: TextWrapper.wrapText(msg)) {
|
||||
this.d.f.a((Packet) (new Packet3Chat(line)));
|
||||
@ -632,6 +644,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
// Legacy command handler
|
||||
event = new PlayerChatEvent(Type.PLAYER_COMMAND, player, s);
|
||||
server.getPluginManager().callEvent(event);
|
||||
|
||||
if (event.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
@ -724,7 +737,8 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
}
|
||||
|
||||
public void a(Packet7UseEntity packet7useentity) {
|
||||
Entity entity = ((WorldServer)this.e.world).a(packet7useentity.b); // Craftbukkit
|
||||
// CraftBukkit
|
||||
Entity entity = ((WorldServer) this.e.world).a(packet7useentity.b);
|
||||
|
||||
if (entity != null && this.e.e(entity) && this.e.f(entity) < 4.0F) {
|
||||
if (packet7useentity.c == 0) {
|
||||
@ -741,7 +755,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
|
||||
// CraftBukkit start
|
||||
CraftPlayer player = getPlayer();
|
||||
player.setHandle(e);
|
||||
player.setHandle(this.e);
|
||||
// CraftBukkit end
|
||||
}
|
||||
}
|
||||
@ -784,8 +798,10 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
}
|
||||
|
||||
public void a(Packet130UpdateSign packet130updatesign) {
|
||||
if (this.e.world.f(packet130updatesign.a, packet130updatesign.b, packet130updatesign.c)) { // Craftbukkit
|
||||
TileEntity tileentity = this.e.world.getTileEntity(packet130updatesign.a, packet130updatesign.b, packet130updatesign.c); // Craftbukkit
|
||||
// CraftBukkit start
|
||||
if (this.e.world.f(packet130updatesign.a, packet130updatesign.b, packet130updatesign.c)) {
|
||||
TileEntity tileentity = this.e.world.getTileEntity(packet130updatesign.a, packet130updatesign.b, packet130updatesign.c);
|
||||
// CraftBukkit end
|
||||
|
||||
int i;
|
||||
int j;
|
||||
@ -817,23 +833,25 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
|
||||
// CraftBukkit start - SIGN_CHANGE hook
|
||||
Player player = server.getPlayer(this.e);
|
||||
SignChangeEvent modifyEvent = new SignChangeEvent(org.bukkit.event.Event.Type.SIGN_CHANGE, (CraftBlock) player.getWorld().getBlockAt(i, k, j), server.getPlayer(this.e), packet130updatesign.d);
|
||||
server.getPluginManager().callEvent(modifyEvent);
|
||||
if (modifyEvent.isCancelled()) {
|
||||
SignChangeEvent event = new SignChangeEvent(org.bukkit.event.Event.Type.SIGN_CHANGE, (CraftBlock) player.getWorld().getBlockAt(i, k, j), server.getPlayer(this.e), packet130updatesign.d);
|
||||
server.getPluginManager().callEvent(event);
|
||||
|
||||
if (event.isCancelled()) {
|
||||
// Normally we would return here, but we have to update the sign with blank text if it's been cancelled
|
||||
// Otherwise the client will have bad text on their sign (client shows text changes as they type)
|
||||
for (int l = 0; l < 4; ++l) {
|
||||
modifyEvent.setLine(l, "");
|
||||
event.setLine(l, "");
|
||||
}
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
for (int l = 0; l < 4; ++l) {
|
||||
tileentitysign.a[l] = modifyEvent.getLine(l); // CraftBukkit
|
||||
tileentitysign.a[l] = event.getLine(l);
|
||||
// CraftBukkit
|
||||
}
|
||||
|
||||
tileentitysign.h();
|
||||
this.e.world.g(i, k, j); // Craftbukkit
|
||||
this.e.world.g(i, k, j); // CraftBukkit
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -29,7 +29,8 @@ class PlayerInstance {
|
||||
this.d = j;
|
||||
this.e = new ChunkCoordIntPair(i, j);
|
||||
|
||||
playermanager.world.u.d(i, j); // Craftbukkit
|
||||
// CraftBukkit
|
||||
playermanager.world.u.d(i, j);
|
||||
}
|
||||
|
||||
public void a(EntityPlayer entityplayer) {
|
||||
@ -56,7 +57,8 @@ class PlayerInstance {
|
||||
PlayerManager.c(this.a).remove(this);
|
||||
}
|
||||
|
||||
((WorldServer)entityplayer.world).u.c(this.c, this.d); // Craftbukkit
|
||||
// CraftBukkit
|
||||
((WorldServer) entityplayer.world).u.c(this.c, this.d);
|
||||
}
|
||||
|
||||
entityplayer.f.remove(this.e);
|
||||
@ -132,12 +134,12 @@ class PlayerInstance {
|
||||
j = this.j;
|
||||
k = this.d * 16 + this.l;
|
||||
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
this.a((Packet) (new Packet53BlockChange(i, j, k, a.world)));
|
||||
if (Block.p[a.world.getTypeId(i, j, k)]) {
|
||||
this.a(a.world.getTileEntity(i, j, k));
|
||||
}
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
} else {
|
||||
int l;
|
||||
|
||||
@ -151,23 +153,28 @@ class PlayerInstance {
|
||||
int i1 = this.k - this.j + 2;
|
||||
int j1 = this.m - this.l + 1;
|
||||
|
||||
this.a((Packet) (new Packet51MapChunk(i, j, k, l, i1, j1, a.world))); // Craftbukkit
|
||||
List list = a.world.d(i, j, k, i + l, j + i1, k + j1); // Craftbukkit
|
||||
// CraftBukkit start
|
||||
this.a((Packet) (new Packet51MapChunk(i, j, k, l, i1, j1, a.world)));
|
||||
List list = a.world.d(i, j, k, i + l, j + i1, k + j1);
|
||||
// CraftBukkit end
|
||||
|
||||
for (int k1 = 0; k1 < list.size(); ++k1) {
|
||||
this.a((TileEntity) list.get(k1));
|
||||
}
|
||||
} else {
|
||||
this.a((Packet) (new Packet52MultiBlockChange(this.c, this.d, this.f, this.g, a.world))); // Craftbukkit
|
||||
// CraftBukkit
|
||||
this.a((Packet) (new Packet52MultiBlockChange(this.c, this.d, this.f, this.g, a.world)));
|
||||
|
||||
for (i = 0; i < this.g; ++i) {
|
||||
j = this.c * 16 + (this.g >> 12 & 15);
|
||||
k = this.g & 255;
|
||||
l = this.d * 16 + (this.g >> 8 & 15);
|
||||
if (Block.p[a.world.getTypeId(j, k, l)]) { // Craftbukkit
|
||||
// CraftBukkit start
|
||||
if (Block.p[a.world.getTypeId(j, k, l)]) {
|
||||
System.out.println("Sending!");
|
||||
this.a(a.world.getTileEntity(j, k, l)); // Craftbukkit
|
||||
this.a(a.world.getTileEntity(j, k, l));
|
||||
}
|
||||
// CraftBukkit end
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10,14 +10,16 @@ public class PlayerManager {
|
||||
private List c = new ArrayList();
|
||||
private MinecraftServer d;
|
||||
private final int[][] e = new int[][] { { 1, 0}, { 0, 1}, { -1, 0}, { 0, -1}};
|
||||
public WorldServer world; // Craftbukkit
|
||||
|
||||
// Craftbukkit - change of method signature
|
||||
// CraftBukkit start
|
||||
public WorldServer world;
|
||||
|
||||
// CraftBukkit - change of method signature
|
||||
public PlayerManager(MinecraftServer minecraftserver, WorldServer world) {
|
||||
this.d = minecraftserver;
|
||||
|
||||
this.world = world; // Craftbukkit
|
||||
this.world = world;
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
public void a() {
|
||||
for (int i = 0; i < this.c.size(); ++i) {
|
||||
|
@ -29,9 +29,9 @@ public class ServerConfigurationManager {
|
||||
|
||||
public static Logger a = Logger.getLogger("Minecraft");
|
||||
public List b = new ArrayList();
|
||||
public MinecraftServer c; // Craftbukkit - public
|
||||
// public PlayerManager d; // Craftbukkit - removed!
|
||||
public int e; // Craftbukkit - public
|
||||
public MinecraftServer c; // CraftBukkit - private->public
|
||||
// public PlayerManager d; // CraftBukkit - removed!
|
||||
public int e; // CraftBukkit - private->public
|
||||
private Set f = new HashSet();
|
||||
private Set g = new HashSet();
|
||||
private Set h = new HashSet();
|
||||
@ -57,7 +57,7 @@ public class ServerConfigurationManager {
|
||||
this.k = minecraftserver.a("banned-ips.txt");
|
||||
this.l = minecraftserver.a("ops.txt");
|
||||
this.m = minecraftserver.a("white-list.txt");
|
||||
// this.d = new PlayerManager(minecraftserver); // Craftbukkit - removed!
|
||||
// this.d = new PlayerManager(minecraftserver); // CraftBukkit - removed!
|
||||
this.e = minecraftserver.d.a("max-players", 20);
|
||||
this.o = minecraftserver.d.a("white-list", false);
|
||||
this.g();
|
||||
@ -71,22 +71,21 @@ public class ServerConfigurationManager {
|
||||
}
|
||||
|
||||
public void a(WorldServer worldserver) {
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
if (this.n == null) {
|
||||
this.n = worldserver.m().d();
|
||||
}
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
public int a() {
|
||||
return 144; // Craftbukkit - magic number from PlayerManager.b() (??)
|
||||
return 144; // CraftBukkit - magic number from PlayerManager.b() (??)
|
||||
}
|
||||
|
||||
public void a(EntityPlayer entityplayer) {
|
||||
this.b.add(entityplayer);
|
||||
this.n.b(entityplayer);
|
||||
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
((WorldServer) entityplayer.world).u.d((int) entityplayer.locX >> 4, (int) entityplayer.locZ >> 4);
|
||||
|
||||
while (entityplayer.world.a(entityplayer, entityplayer.boundingBox).size() != 0) {
|
||||
@ -98,16 +97,16 @@ public class ServerConfigurationManager {
|
||||
server.getPluginManager().callEvent(new PlayerEvent(PlayerEvent.Type.PLAYER_JOIN, server.getPlayer(entityplayer)));
|
||||
|
||||
((WorldServer) entityplayer.world).manager.a(entityplayer);
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
public void b(EntityPlayer entityplayer) {
|
||||
((WorldServer)entityplayer.world).manager.c(entityplayer); // Craftbukkit
|
||||
((WorldServer) entityplayer.world).manager.c(entityplayer); // CraftBukkit
|
||||
}
|
||||
|
||||
public void c(EntityPlayer entityplayer) {
|
||||
this.n.a(entityplayer);
|
||||
entityplayer.world.d(entityplayer); // Craftbukkit
|
||||
entityplayer.world.d(entityplayer); // CraftBukkit
|
||||
this.b.remove(entityplayer);
|
||||
|
||||
// CraftBukkit start
|
||||
@ -159,7 +158,7 @@ public class ServerConfigurationManager {
|
||||
}
|
||||
|
||||
public EntityPlayer d(EntityPlayer entityplayer) {
|
||||
// Craftbukkit start - every reference to this.c.e should be entityplayer.world
|
||||
// CraftBukkit start - every reference to this.c.e should be entityplayer.world
|
||||
this.c.k.a(entityplayer);
|
||||
this.c.k.b(entityplayer);
|
||||
((WorldServer) entityplayer.world).manager.b(entityplayer);
|
||||
@ -178,8 +177,10 @@ public class ServerConfigurationManager {
|
||||
// CraftBukkit start
|
||||
Player respawnPlayer = server.getPlayer(entityplayer);
|
||||
Location respawnLocation = new Location(respawnPlayer.getWorld(), entityplayer1.locX, entityplayer1.locY, entityplayer1.locZ, entityplayer1.yaw, entityplayer1.pitch);
|
||||
|
||||
PlayerRespawnEvent respawnEvent = new PlayerRespawnEvent(Event.Type.PLAYER_RESPAWN, respawnPlayer, respawnLocation );
|
||||
server.getPluginManager().callEvent(respawnEvent);
|
||||
|
||||
entityplayer1.world = ((CraftWorld) respawnEvent.getRespawnLocation().getWorld()).getHandle();
|
||||
entityplayer1.locX = respawnEvent.getRespawnLocation().getX();
|
||||
entityplayer1.locY = respawnEvent.getRespawnLocation().getY();
|
||||
@ -193,27 +194,29 @@ public class ServerConfigurationManager {
|
||||
|
||||
entityplayer1.a.b((Packet) (new Packet9Respawn()));
|
||||
entityplayer1.a.a(entityplayer1.locX, entityplayer1.locY, entityplayer1.locZ, entityplayer1.yaw, entityplayer1.pitch);
|
||||
// CraftBukkit start
|
||||
((WorldServer) entityplayer1.world).manager.a(entityplayer1);
|
||||
entityplayer.world.a(entityplayer1);
|
||||
// CraftBukkit end
|
||||
this.b.add(entityplayer1);
|
||||
entityplayer1.l();
|
||||
entityplayer1.s();
|
||||
return entityplayer1;
|
||||
// Craftbukkit end
|
||||
}
|
||||
|
||||
public void b() {
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
for (WorldServer world: c.worlds) {
|
||||
world.manager.a();
|
||||
}
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
// Craftbukkit - changed signature
|
||||
// CraftBukkit start - changed signature
|
||||
public void a(int i, int j, int k, WorldServer world) {
|
||||
world.manager.a(i, j, k);
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
public void a(Packet packet) {
|
||||
for (int i = 0; i < this.b.size(); ++i) {
|
||||
|
@ -2,7 +2,7 @@ package net.minecraft.server;
|
||||
|
||||
public class TileEntityChest extends TileEntity implements IInventory {
|
||||
|
||||
private ItemStack[] a = new ItemStack[27]; //Craftbukkit
|
||||
private ItemStack[] a = new ItemStack[27]; // CraftBukkit
|
||||
|
||||
// CraftBukkit start
|
||||
public ItemStack[] getContents() {
|
||||
|
@ -359,6 +359,7 @@ public class World implements IBlockAccess {
|
||||
if (world != null) {
|
||||
BlockPhysicsEvent event = new BlockPhysicsEvent(Event.Type.BLOCK_PHYSICS, world.getBlockAt(i, j, k), l);
|
||||
((WorldServer) this).getServer().getPluginManager().callEvent(event);
|
||||
|
||||
if (event.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
@ -745,11 +746,10 @@ public class World implements IBlockAccess {
|
||||
CraftServer server = ((WorldServer) this).getServer();
|
||||
Location loc = new Location(((WorldServer) this).getWorld(), entity.bi, entity.bj, entity.bk);
|
||||
|
||||
CreatureSpawnEvent cse;
|
||||
cse = new CreatureSpawnEvent(entity.getBukkitEntity(), type, loc);
|
||||
server.getPluginManager().callEvent(cse);
|
||||
CreatureSpawnEvent event = new CreatureSpawnEvent(entity.getBukkitEntity(), type, loc);
|
||||
server.getPluginManager().callEvent(event);
|
||||
|
||||
if (cse.isCancelled()) {
|
||||
if (event.isCancelled()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -1408,8 +1408,9 @@ public class World implements IBlockAccess {
|
||||
}
|
||||
|
||||
// CraftBukkit start -- Only call spawner if we have players online and the world allows for mobs or animals
|
||||
if ((this.D || this.E) && (this instanceof WorldServer && ((WorldServer) this).getServer().getHandle().b.size() > 0))
|
||||
if ((this.D || this.E) && (this instanceof WorldServer && ((WorldServer) this).getServer().getHandle().b.size() > 0)) {
|
||||
SpawnerCreature.a(this, this.D, this.E);
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
this.o.a();
|
||||
@ -1621,7 +1622,7 @@ public class World implements IBlockAccess {
|
||||
axisalignedbb = null;
|
||||
}
|
||||
|
||||
// Craftbukkit start - We dont want to allow the user to override the bounding box check
|
||||
// CraftBukkit start - We dont want to allow the user to override the bounding box check
|
||||
boolean defaultReturn = axisalignedbb != null && !this.a(axisalignedbb) ? false : (block != Block.WATER && block != Block.STATIONARY_WATER && block != Block.LAVA && block != Block.STATIONARY_LAVA && block != Block.FIRE && block != Block.SNOW ? i > 0 && block == null && block1.a(this, j, k, l) : true);
|
||||
|
||||
if (!defaultReturn) {
|
||||
|
@ -2,17 +2,15 @@ package net.minecraft.server;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
// CraftBukkit start
|
||||
// CraftBukkit
|
||||
import org.bukkit.BlockChangeDelegate;
|
||||
// CraftBukkit end
|
||||
|
||||
public class WorldGenBigTree extends WorldGenerator {
|
||||
|
||||
static final byte[] a = new byte[] { (byte) 2, (byte) 0, (byte) 0, (byte) 1, (byte) 2, (byte) 1};
|
||||
Random b = new Random();
|
||||
// CraftBukkit start
|
||||
// CraftBukkit
|
||||
BlockChangeDelegate c;
|
||||
// CraftBukkit end
|
||||
int[] d = new int[] { 0, 0, 0};
|
||||
int e = 0;
|
||||
int f;
|
||||
|
@ -2,9 +2,8 @@ package net.minecraft.server;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
// CraftBukkit start
|
||||
// CraftBukkit
|
||||
import org.bukkit.BlockChangeDelegate;
|
||||
// CraftBukkit end
|
||||
|
||||
public class WorldGenForest extends WorldGenerator {
|
||||
|
||||
|
@ -2,9 +2,8 @@ package net.minecraft.server;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
// CraftBukkit start
|
||||
// CraftBukkit
|
||||
import org.bukkit.BlockChangeDelegate;
|
||||
// CraftBukkit end
|
||||
|
||||
public class WorldGenTaiga1 extends WorldGenerator {
|
||||
|
||||
|
@ -2,9 +2,8 @@ package net.minecraft.server;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
// CraftBukkit start
|
||||
// CraftBukkit
|
||||
import org.bukkit.BlockChangeDelegate;
|
||||
// CraftBukkit end
|
||||
|
||||
public class WorldGenTaiga2 extends WorldGenerator {
|
||||
|
||||
|
@ -2,9 +2,8 @@ package net.minecraft.server;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
// CraftBukkit start
|
||||
// CraftBukkit
|
||||
import org.bukkit.BlockChangeDelegate;
|
||||
// CraftBukkit end
|
||||
|
||||
public class WorldGenTrees extends WorldGenerator {
|
||||
|
||||
|
@ -3,12 +3,12 @@ package net.minecraft.server;
|
||||
public class WorldManager implements IWorldAccess {
|
||||
|
||||
private MinecraftServer a;
|
||||
public WorldServer world; // Craftbukkit
|
||||
public WorldServer world; // CraftBukkit
|
||||
|
||||
// Craftbukkit - changed signature
|
||||
// CraftBukkit - changed signature
|
||||
public WorldManager(MinecraftServer minecraftserver, WorldServer world) {
|
||||
this.a = minecraftserver;
|
||||
this.world = world; // Craftbukkit
|
||||
this.world = world; // CraftBukkit
|
||||
}
|
||||
|
||||
public void a(String s, double d0, double d1, double d2, double d3, double d4, double d5) {}
|
||||
@ -28,7 +28,8 @@ public class WorldManager implements IWorldAccess {
|
||||
public void a() {}
|
||||
|
||||
public void a(int i, int j, int k) {
|
||||
this.a.f.a(i, j, k, world); // Craftbukkit
|
||||
// CraftBukkit
|
||||
this.a.f.a(i, j, k, world);
|
||||
}
|
||||
|
||||
public void a(String s, int i, int j, int k) {}
|
||||
|
@ -1,11 +1,11 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
// CraftBukkit start
|
||||
import java.io.File;
|
||||
import org.bukkit.BlockChangeDelegate;
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.craftbukkit.CraftWorld;
|
||||
@ -16,9 +16,9 @@ public class WorldServer extends World implements BlockChangeDelegate {
|
||||
public ChunkProviderServer u;
|
||||
public boolean v = false;
|
||||
public boolean w;
|
||||
public final MinecraftServer x; // Craftbukkit - private -> public final
|
||||
public final MinecraftServer x; // CraftBukkit - private -> public final
|
||||
private EntityList y = new EntityList();
|
||||
public PlayerManager manager; // Craftbukkit
|
||||
public PlayerManager manager; // CraftBukkit
|
||||
|
||||
public WorldServer(MinecraftServer minecraftserver, IDataManager idatamanager, String s, int i) {
|
||||
super(idatamanager, s, (new Random()).nextLong(), WorldProvider.a(i));
|
||||
@ -87,7 +87,8 @@ public class WorldServer extends World implements BlockChangeDelegate {
|
||||
i1 = l;
|
||||
}
|
||||
|
||||
return i1 > this.x.spawnProtection || this.x.f.h(entityhuman.name); // CraftBukkit Configurable spawn protection start
|
||||
// CraftBukkit -- Configurable spawn protection
|
||||
return i1 > this.x.spawnProtection || this.x.f.h(entityhuman.name);
|
||||
}
|
||||
|
||||
protected void b(Entity entity) {
|
||||
@ -113,11 +114,11 @@ public class WorldServer extends World implements BlockChangeDelegate {
|
||||
public Explosion a(Entity entity, double d0, double d1, double d2, float f, boolean flag) {
|
||||
Explosion explosion = super.a(entity, d0, d1, d2, f, flag);
|
||||
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
if (explosion.wasCanceled) {
|
||||
return explosion;
|
||||
}
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
|
||||
this.x.f.a(d0, d1, d2, 64.0D, new Packet60Explosion(d0, d1, d2, f, explosion.g));
|
||||
return explosion;
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren