Fix CraftBukkit comments.

This commit is contained in:
Erik Broes 2012-01-12 12:02:39 +01:00
parent 42e473783e
commit 7f079a0cd6
28 changed files with 136 additions and 138 deletions

View File

@ -2,14 +2,14 @@ package net.minecraft.server;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Random; import java.util.Random;
// Craftbukkit start // CraftBukkit start
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.TreeType; import org.bukkit.TreeType;
import org.bukkit.block.BlockState; import org.bukkit.block.BlockState;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.block.BlockSpreadEvent; import org.bukkit.event.block.BlockSpreadEvent;
import org.bukkit.event.world.StructureGrowEvent; import org.bukkit.event.world.StructureGrowEvent;
// Craftbukkit end // CraftBukkit end
public class BlockMushroom extends BlockFlower { public class BlockMushroom extends BlockFlower {

View File

@ -267,7 +267,7 @@ public class BlockPiston extends Block {
} }
} }
// CraftBukkkit boolean -> int // CraftBukkit - boolean -> int
private static int g(World world, int i, int j, int k, int l) { private static int g(World world, int i, int j, int k, int l) {
int i1 = i + Facing.b[l]; int i1 = i + Facing.b[l];
int j1 = j + Facing.c[l]; int j1 = j + Facing.c[l];

View File

@ -28,7 +28,7 @@ public class BlockSand extends Block {
if (!instaFall && world.a(i - b0, j - b0, k - b0, i + b0, j + b0, k + b0)) { if (!instaFall && world.a(i - b0, j - b0, k - b0, i + b0, j + b0, k + b0)) {
if (!world.isStatic) { if (!world.isStatic) {
// CraftBukkit Change call to add data // CraftBukkit - Change call to add data
EntityFallingBlock entityfallingblock = new EntityFallingBlock(world, (double) ((float) i + 0.5F), (double) ((float) j + 0.5F), (double) ((float) k + 0.5F), this.id, world.getData(i, j, k)); EntityFallingBlock entityfallingblock = new EntityFallingBlock(world, (double) ((float) i + 0.5F), (double) ((float) j + 0.5F), (double) ((float) k + 0.5F), this.id, world.getData(i, j, k));
world.addEntity(entityfallingblock); world.addEntity(entityfallingblock);

View File

@ -9,7 +9,7 @@ import org.bukkit.TreeType;
import org.bukkit.block.BlockState; import org.bukkit.block.BlockState;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.world.StructureGrowEvent; import org.bukkit.event.world.StructureGrowEvent;
// Craftbukkit end // CraftBukkit end
public class BlockSapling extends BlockFlower { public class BlockSapling extends BlockFlower {
@ -29,7 +29,7 @@ public class BlockSapling extends BlockFlower {
if ((l & 8) == 0) { if ((l & 8) == 0) {
world.setData(i, j, k, l | 8); world.setData(i, j, k, l | 8);
} else { } else {
this.b(world, i, j, k, random, false, null, null); // Craftbukkit - added bonemeal, player and itemstack this.b(world, i, j, k, random, false, null, null); // CraftBukkit - added bonemeal, player and itemstack
} }
} }
} }

View File

@ -3,7 +3,7 @@ package net.minecraft.server;
import org.bukkit.craftbukkit.enchantments.CraftEnchantment; import org.bukkit.craftbukkit.enchantments.CraftEnchantment;
public abstract class Enchantment { public abstract class Enchantment {
// CraftBukkit comment - update CraftEnchant.getName(i) if this changes. // CraftBukkit - update CraftEnchant.getName(i) if this changes.
public static final Enchantment[] byId = new Enchantment[256]; public static final Enchantment[] byId = new Enchantment[256];
public static final Enchantment PROTECTION_ENVIRONMENTAL = new EnchantmentProtection(0, 10, 0); public static final Enchantment PROTECTION_ENVIRONMENTAL = new EnchantmentProtection(0, 10, 0);
public static final Enchantment PROTECTION_FIRE = new EnchantmentProtection(1, 5, 1); public static final Enchantment PROTECTION_FIRE = new EnchantmentProtection(1, 5, 1);
@ -37,9 +37,7 @@ public abstract class Enchantment {
byId[i] = this; byId[i] = this;
} }
// CraftBukkit start org.bukkit.enchantments.Enchantment.registerEnchantment(new CraftEnchantment(this)); // CraftBukkit
org.bukkit.enchantments.Enchantment.registerEnchantment(new CraftEnchantment(this));
// CraftBukkit end
} }
public int getRandomWeight() { public int getRandomWeight() {

View File

@ -196,7 +196,7 @@ public abstract class Entity {
} }
public void af() { public void af() {
// MethodProfiler.a("entityBaseTick"); // CraftBukkit -- not in production code // MethodProfiler.a("entityBaseTick"); // CraftBukkit - not in production code
if (this.vehicle != null && this.vehicle.dead) { if (this.vehicle != null && this.vehicle.dead) {
this.vehicle = null; this.vehicle = null;
} }
@ -299,7 +299,7 @@ public abstract class Entity {
} }
this.justCreated = false; this.justCreated = false;
// MethodProfiler.a(); // CraftBukkit -- not in production code // MethodProfiler.a(); // CraftBukkit - not in production code
} }
protected void av() { protected void av() {
@ -370,7 +370,7 @@ public abstract class Entity {
this.locY = this.boundingBox.b + (double) this.height - (double) this.bL; this.locY = this.boundingBox.b + (double) this.height - (double) this.bL;
this.locZ = (this.boundingBox.c + this.boundingBox.f) / 2.0D; this.locZ = (this.boundingBox.c + this.boundingBox.f) / 2.0D;
} else { } else {
// MethodProfiler.a("move"); // CraftBukkit -- not in production code // MethodProfiler.a("move"); // CraftBukkit - not in production code
this.bL *= 0.4F; this.bL *= 0.4F;
double d3 = this.locX; double d3 = this.locX;
double d4 = this.locZ; double d4 = this.locZ;
@ -532,8 +532,8 @@ public abstract class Entity {
} }
} }
// MethodProfiler.a(); // CraftBukkit -- not in production code // MethodProfiler.a(); // CraftBukkit - not in production code
// MethodProfiler.a("rest"); // CraftBukkit -- not in production code // MethodProfiler.a("rest"); // CraftBukkit - not in production code
this.locX = (this.boundingBox.a + this.boundingBox.d) / 2.0D; this.locX = (this.boundingBox.a + this.boundingBox.d) / 2.0D;
this.locY = this.boundingBox.b + (double) this.height - (double) this.bL; this.locY = this.boundingBox.b + (double) this.height - (double) this.bL;
this.locZ = (this.boundingBox.c + this.boundingBox.f) / 2.0D; this.locZ = (this.boundingBox.c + this.boundingBox.f) / 2.0D;
@ -646,7 +646,7 @@ public abstract class Entity {
this.fireTicks = -this.maxFireTicks; this.fireTicks = -this.maxFireTicks;
} }
// MethodProfiler.a(); // CraftBukkit -- not in production code // MethodProfiler.a(); // CraftBukkit - not in production code
} }
} }

View File

@ -22,7 +22,7 @@ public abstract class EntityCreature extends EntityLiving {
} }
protected void m_() { protected void m_() {
// MethodProfiler.a("ai"); // CraftBukkit -- not in production code // MethodProfiler.a("ai"); // CraftBukkit - not in production code
if (this.f > 0) { if (this.f > 0) {
--this.f; --this.f;
} }
@ -73,7 +73,7 @@ public abstract class EntityCreature extends EntityLiving {
} }
} }
// MethodProfiler.a(); // CraftBukkit -- not in production code // MethodProfiler.a(); // CraftBukkit - not in production code
if (!this.e && this.target != null && (this.pathEntity == null || this.random.nextInt(20) == 0)) { if (!this.e && this.target != null && (this.pathEntity == null || this.random.nextInt(20) == 0)) {
this.pathEntity = this.world.findPath(this, this.target, f); this.pathEntity = this.world.findPath(this, this.target, f);
} else if (!this.e && (this.pathEntity == null && this.random.nextInt(180) == 0 || this.random.nextInt(120) == 0 || this.f > 0) && this.aS < 100) { } else if (!this.e && (this.pathEntity == null && this.random.nextInt(180) == 0 || this.random.nextInt(120) == 0 || this.f > 0) && this.aS < 100) {
@ -86,7 +86,7 @@ public abstract class EntityCreature extends EntityLiving {
this.pitch = 0.0F; this.pitch = 0.0F;
if (this.pathEntity != null && this.random.nextInt(100) != 0) { if (this.pathEntity != null && this.random.nextInt(100) != 0) {
// MethodProfiler.a("followpath"); // CraftBukkit -- not in production code // MethodProfiler.a("followpath"); // CraftBukkit - not in production code
Vec3D vec3d = this.pathEntity.a(this); Vec3D vec3d = this.pathEntity.a(this);
double d0 = (double) (this.width * 2.0F); double d0 = (double) (this.width * 2.0F);
@ -154,7 +154,7 @@ public abstract class EntityCreature extends EntityLiving {
this.aW = true; this.aW = true;
} }
// MethodProfiler.a(); // CraftBukkit -- not in production code // MethodProfiler.a(); // CraftBukkit - not in production code
} else { } else {
super.m_(); super.m_();
this.pathEntity = null; this.pathEntity = null;
@ -162,7 +162,7 @@ public abstract class EntityCreature extends EntityLiving {
} }
protected void C() { protected void C() {
// MethodProfiler.a("stroll"); // CraftBukkit -- not in production code // MethodProfiler.a("stroll"); // CraftBukkit - not in production code
boolean flag = false; boolean flag = false;
int i = -1; int i = -1;
int j = -1; int j = -1;
@ -188,7 +188,7 @@ public abstract class EntityCreature extends EntityLiving {
this.pathEntity = this.world.a(this, i, j, k, 10.0F); this.pathEntity = this.world.a(this, i, j, k, 10.0F);
} }
// MethodProfiler.a(); // CraftBukkit -- not in production code // MethodProfiler.a(); // CraftBukkit - not in production code
} }
protected void a(Entity entity, float f) {} protected void a(Entity entity, float f) {}

View File

@ -10,7 +10,7 @@ public class EntityFallingBlock extends Entity {
super(world); super(world);
} }
// CraftBukkit -- changed method signature // CraftBukkit - changed method signature
public EntityFallingBlock(World world, double d0, double d1, double d2, int i, int data) { public EntityFallingBlock(World world, double d0, double d1, double d2, int i, int data) {
super(world); super(world);
this.a = i; this.a = i;
@ -66,7 +66,7 @@ public class EntityFallingBlock extends Entity {
this.motY *= -0.5D; this.motY *= -0.5D;
if (this.world.getTypeId(i, j, k) != Block.PISTON_MOVING.id) { if (this.world.getTypeId(i, j, k) != Block.PISTON_MOVING.id) {
this.die(); this.die();
// CraftBukkit -- setTypeId => setTypeIdAndData // CraftBukkit - setTypeId => setTypeIdAndData
if ((!this.world.a(this.a, i, j, k, true, 1) || BlockSand.g(this.world, i, j - 1, k) || !this.world.setTypeIdAndData(i, j, k, this.a, this.data)) && !this.world.isStatic) { if ((!this.world.a(this.a, i, j, k, true, 1) || BlockSand.g(this.world, i, j - 1, k) || !this.world.setTypeIdAndData(i, j, k, this.a, this.data)) && !this.world.isStatic) {
this.b(this.a, 1); this.b(this.a, 1);
} }

View File

@ -48,7 +48,7 @@ public abstract class EntityHuman extends EntityLiving {
// CraftBukkit end // CraftBukkit end
public ChunkCoordinates F; public ChunkCoordinates F;
public int sleepTicks; // CraftBukkit private -> public public int sleepTicks; // CraftBukkit - private -> public
public float G; public float G;
public float H; public float H;
private ChunkCoordinates b; private ChunkCoordinates b;

View File

@ -81,8 +81,8 @@ public abstract class EntityLiving extends Entity {
private int d = 0; private int d = 0;
private Entity e; private Entity e;
protected int aZ = 0; protected int aZ = 0;
public int expToDrop = 0; // CraftBukkit added public int expToDrop = 0; // CraftBukkit
public int maxAirTicks = 300; // CraftBukkit added public int maxAirTicks = 300; // CraftBukkit
public EntityLiving(World world) { public EntityLiving(World world) {
super(world); super(world);
@ -129,7 +129,7 @@ public abstract class EntityLiving extends Entity {
public void af() { public void af() {
this.am = this.an; this.am = this.an;
super.af(); super.af();
// MethodProfiler.a("mobBaseTick"); // CraftBukkit -- not in production code // MethodProfiler.a("mobBaseTick"); // CraftBukkit - not in production code
if (this.random.nextInt(1000) < this.a++) { if (this.random.nextInt(1000) < this.a++) {
this.a = -this.h(); this.a = -this.h();
this.ae(); this.ae();
@ -175,7 +175,7 @@ public abstract class EntityLiving extends Entity {
this.extinguish(); this.extinguish();
} else { } else {
if (this.getAirTicks() != 300) { // CraftBukkit -- only set if needed to work around a datawatcher inefficiency if (this.getAirTicks() != 300) { // CraftBukkit - only set if needed to work around a datawatcher inefficiency
this.setAirTicks(maxAirTicks); this.setAirTicks(maxAirTicks);
} }
} }
@ -208,7 +208,7 @@ public abstract class EntityLiving extends Entity {
this.W = this.V; this.W = this.V;
this.lastYaw = this.yaw; this.lastYaw = this.yaw;
this.lastPitch = this.pitch; this.lastPitch = this.pitch;
// MethodProfiler.a(); // CraftBukkit -- not in production code // MethodProfiler.a(); // CraftBukkit - not in production code
} }
// CraftBukkit start // CraftBukkit start
@ -877,7 +877,7 @@ public abstract class EntityLiving extends Entity {
} }
} }
// MethodProfiler.a("ai"); // CraftBukkit -- not in production code // MethodProfiler.a("ai"); // CraftBukkit - not in production code
if (this.L()) { if (this.L()) {
this.aW = false; this.aW = false;
this.aT = 0.0F; this.aT = 0.0F;
@ -887,7 +887,7 @@ public abstract class EntityLiving extends Entity {
this.m_(); this.m_();
} }
// MethodProfiler.a(); // CraftBukkit -- not in production code // MethodProfiler.a(); // CraftBukkit - not in production code
boolean flag = this.az(); boolean flag = this.az();
boolean flag1 = this.aA(); boolean flag1 = this.aA();
@ -912,7 +912,7 @@ public abstract class EntityLiving extends Entity {
this.ak *= this.F(); this.ak *= this.F();
this.a(this.aT, this.aU); this.a(this.aT, this.aU);
this.ak = f; this.ak = f;
// MethodProfiler.a("push"); // CraftBukkit -- not in production code // MethodProfiler.a("push"); // CraftBukkit - not in production code
List list1 = this.world.b((Entity) this, this.boundingBox.b(0.20000000298023224D, 0.0D, 0.20000000298023224D)); List list1 = this.world.b((Entity) this, this.boundingBox.b(0.20000000298023224D, 0.0D, 0.20000000298023224D));
if (list1 != null && list1.size() > 0) { if (list1 != null && list1.size() > 0) {
@ -925,7 +925,7 @@ public abstract class EntityLiving extends Entity {
} }
} }
// MethodProfiler.a(); // CraftBukkit -- not in production code // MethodProfiler.a(); // CraftBukkit - not in production code
} }
protected boolean L() { protected boolean L() {

View File

@ -27,7 +27,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
private int cc = -99999999; private int cc = -99999999;
private int cd = -99999999; private int cd = -99999999;
private boolean ce = true; private boolean ce = true;
public int cf = -99999999; // Craftbukkit - priv to pub - "lastSentExp" public int cf = -99999999; // CraftBukkit - priv to pub - "lastSentExp"
public int cg = 60; // CraftBukkit - private to public; temporary until we get an API out public int cg = 60; // CraftBukkit - private to public; temporary until we get an API out
private ItemStack[] ch = new ItemStack[] { null, null, null, null, null}; private ItemStack[] ch = new ItemStack[] { null, null, null, null, null};
private int ci = 0; private int ci = 0;
@ -325,7 +325,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
this.netServerHandler.sendPacket(new Packet70Bed(4, 0)); this.netServerHandler.sendPacket(new Packet70Bed(4, 0));
} else { } else {
this.a((Statistic) AchievementList.B); this.a((Statistic) AchievementList.B);
/* //CraftBukkit start - removed to fix our handling of The End portals /* CraftBukkit start - removed to fix our handling of The End portals
ChunkCoordinates chunkcoordinates = this.b.getWorldServer(i).d(); ChunkCoordinates chunkcoordinates = this.b.getWorldServer(i).d();
if (chunkcoordinates != null) { if (chunkcoordinates != null) {

View File

@ -24,7 +24,7 @@ public class EntitySnowball extends EntityProjectile {
protected void a(MovingObjectPosition movingobjectposition) { protected void a(MovingObjectPosition movingobjectposition) {
if (movingobjectposition.entity != null) { if (movingobjectposition.entity != null) {
int b0 = 0; //Craftbukkit - byte -> int int b0 = 0; // CraftBukkit - byte -> int
if (movingobjectposition.entity instanceof EntityBlaze) { if (movingobjectposition.entity instanceof EntityBlaze) {
b0 = 3; b0 = 3;

View File

@ -388,7 +388,7 @@ public class EntityWolf extends EntityAnimal {
if (itemfood.p() && this.datawatcher.getInt(18) < 20) { if (itemfood.p() && this.datawatcher.getInt(18) < 20) {
--itemstack.count; --itemstack.count;
this.d(itemfood.n(), RegainReason.EATING); // Craftbukkit this.d(itemfood.n(), RegainReason.EATING); // CraftBukkit
if (itemstack.count <= 0) { if (itemstack.count <= 0) {
entityhuman.inventory.setItem(entityhuman.inventory.itemInHandIndex, (ItemStack) null); entityhuman.inventory.setItem(entityhuman.inventory.itemInHandIndex, (ItemStack) null);
} }

View File

@ -1,6 +1,6 @@
package net.minecraft.server; package net.minecraft.server;
import org.bukkit.entity.Player; // Craftbukkit import org.bukkit.entity.Player; // CraftBukkit
public class ItemDye extends Item { public class ItemDye extends Item {
@ -28,23 +28,23 @@ public class ItemDye extends Item {
if (i1 == Block.SAPLING.id) { if (i1 == Block.SAPLING.id) {
if (!world.isStatic) { if (!world.isStatic) {
// Craftbukkit start // CraftBukkit start
Player player = (entityhuman instanceof EntityPlayer) ? (Player)entityhuman.getBukkitEntity() : null; Player player = (entityhuman instanceof EntityPlayer) ? (Player)entityhuman.getBukkitEntity() : null;
((BlockSapling) Block.SAPLING).b(world, i, j, k, world.random, true, player, itemstack); ((BlockSapling) Block.SAPLING).b(world, i, j, k, world.random, true, player, itemstack);
//--itemstack.count; - called later if the bonemeal attempt was succesful //--itemstack.count; - called later if the bonemeal attempt was succesful
// Craftbukkit end // CraftBukkit end
} }
return true; return true;
} }
if (i1 == Block.BROWN_MUSHROOM.id || i1 == Block.RED_MUSHROOM.id) { if (i1 == Block.BROWN_MUSHROOM.id || i1 == Block.RED_MUSHROOM.id) {
// Craftbukkit start // CraftBukkit start
if (!world.isStatic) { if (!world.isStatic) {
Player player = (entityhuman instanceof EntityPlayer) ? (Player)entityhuman.getBukkitEntity() : null; Player player = (entityhuman instanceof EntityPlayer) ? (Player)entityhuman.getBukkitEntity() : null;
((BlockMushroom) Block.byId[i1]).b(world, i, j, k, world.random, true, player, itemstack); ((BlockMushroom) Block.byId[i1]).b(world, i, j, k, world.random, true, player, itemstack);
//--itemstack.count; - called later if the bonemeal attempt was succesful //--itemstack.count; - called later if the bonemeal attempt was succesful
// Craftbukkit end // CraftBukkit end
} }
return true; return true;

View File

@ -190,7 +190,7 @@ public class MinecraftServer implements Runnable, ICommandListener, IMinecraftSe
this.propertyManager.properties.remove("spawn-protection"); this.propertyManager.properties.remove("spawn-protection");
this.propertyManager.savePropertiesFile(); this.propertyManager.savePropertiesFile();
} }
// CratBukkit end // CraftBukkit end
return true; return true;
} }
@ -700,7 +700,7 @@ public class MinecraftServer implements Runnable, ICommandListener, IMinecraftSe
public String d(String s) { public String d(String s) {
RemoteControlCommandListener.a.a(); RemoteControlCommandListener.a.a();
// CraftBukkt start // CraftBukkit start
ServerCommandEvent event = new ServerCommandEvent(Event.Type.REMOTE_COMMAND, this.remoteConsole, s); ServerCommandEvent event = new ServerCommandEvent(Event.Type.REMOTE_COMMAND, this.remoteConsole, s);
this.server.getPluginManager().callEvent(event); this.server.getPluginManager().callEvent(event);
ServerCommand servercommand = new ServerCommand(event.getCommand(), RemoteControlCommandListener.a); ServerCommand servercommand = new ServerCommand(event.getCommand(), RemoteControlCommandListener.a);

View File

@ -634,7 +634,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
this.player.activeContainer.a(); this.player.activeContainer.a();
this.player.h = false; this.player.h = false;
// CraftBukkit | TODO CHECK IF NEEDED -- new if structure might not need 'always'. Kept it in for now, but may be able to remove in future // CraftBukkit - TODO CHECK IF NEEDED -- new if structure might not need 'always'. Kept it in for now, but may be able to remove in future
if (!ItemStack.equals(this.player.inventory.getItemInHand(), packet15place.itemstack) || always) { if (!ItemStack.equals(this.player.inventory.getItemInHand(), packet15place.itemstack) || always) {
this.sendPacket(new Packet103SetSlot(this.player.activeContainer.windowId, slot.c, this.player.inventory.getItemInHand())); this.sendPacket(new Packet103SetSlot(this.player.activeContainer.windowId, slot.c, this.player.inventory.getItemInHand()));
} }

View File

@ -42,7 +42,7 @@ public class ServerConfigurationManager {
private File l; private File l;
private File m; private File m;
public PlayerFileData playerFileData; // CraftBukkit - private - >public public PlayerFileData playerFileData; // CraftBukkit - private - >public
public boolean hasWhitelist; // Craftbukkit - private -> public public boolean hasWhitelist; // CraftBukkit - private -> public
private int p = 0; private int p = 0;
// CraftBukkit start // CraftBukkit start
@ -511,24 +511,24 @@ public class ServerConfigurationManager {
this.operators.add(s.toLowerCase()); this.operators.add(s.toLowerCase());
this.q(); this.q();
// Craftbukkit start // CraftBukkit start
Player player = server.server.getPlayer(s); Player player = server.server.getPlayer(s);
if (player != null) { if (player != null) {
player.recalculatePermissions(); player.recalculatePermissions();
} }
// Craftbukkit end // CraftBukkit end
} }
public void removeOp(String s) { public void removeOp(String s) {
this.operators.remove(s.toLowerCase()); this.operators.remove(s.toLowerCase());
this.q(); this.q();
// Craftbukkit start // CraftBukkit start
Player player = server.server.getPlayer(s); Player player = server.server.getPlayer(s);
if (player != null) { if (player != null) {
player.recalculatePermissions(); player.recalculatePermissions();
} }
// Craftbukkit end // CraftBukkit end
} }
private void p() { private void p() {
@ -705,7 +705,7 @@ public class ServerConfigurationManager {
public void updateClient(EntityPlayer entityplayer) { public void updateClient(EntityPlayer entityplayer) {
entityplayer.updateInventory(entityplayer.defaultContainer); entityplayer.updateInventory(entityplayer.defaultContainer);
entityplayer.s_(); entityplayer.s_();
entityplayer.cf = -1; // CraftBukkit added entityplayer.cf = -1; // CraftBukkit
} }
public int getPlayerCount() { public int getPlayerCount() {

View File

@ -15,7 +15,7 @@ import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
public final class SpawnerCreature { public final class SpawnerCreature {
// private static HashMap b = new HashMap(); // CraftBukkit -- moved local to spawnEntities // private static HashMap b = new HashMap(); // CraftBukkit - moved local to spawnEntities
static private class ChunkEntry extends EntryBase { static private class ChunkEntry extends EntryBase {
public boolean spawn; public boolean spawn;
public ChunkEntry (int x, int z, boolean spawn) { public ChunkEntry (int x, int z, boolean spawn) {

View File

@ -1086,8 +1086,8 @@ public class World implements IBlockAccess {
} }
public void tickEntities() { public void tickEntities() {
// MethodProfiler.a("entities"); // CraftBukkit -- not in production code // MethodProfiler.a("entities"); // CraftBukkit - not in production code
// MethodProfiler.a("global"); // CraftBukkit -- not in production code // MethodProfiler.a("global"); // CraftBukkit - not in production code
int i; int i;
Entity entity; Entity entity;
@ -1105,7 +1105,7 @@ public class World implements IBlockAccess {
} }
} }
// MethodProfiler.b("remove"); // CraftBukkit -- not in production code // MethodProfiler.b("remove"); // CraftBukkit - not in production code
this.entityList.removeAll(this.J); this.entityList.removeAll(this.J);
int j; int j;
@ -1125,7 +1125,7 @@ public class World implements IBlockAccess {
} }
this.J.clear(); this.J.clear();
// MethodProfiler.b("regular"); // CraftBukkit -- not in production code // MethodProfiler.b("regular"); // CraftBukkit - not in production code
for (i = 0; i < this.entityList.size(); ++i) { for (i = 0; i < this.entityList.size(); ++i) {
entity = (Entity) this.entityList.get(i); entity = (Entity) this.entityList.get(i);
@ -1142,7 +1142,7 @@ public class World implements IBlockAccess {
this.playerJoinedWorld(entity); this.playerJoinedWorld(entity);
} }
// MethodProfiler.a("remove"); // CraftBukkit -- not in production code // MethodProfiler.a("remove"); // CraftBukkit - not in production code
if (entity.dead) { if (entity.dead) {
j = entity.bX; j = entity.bX;
k = entity.bZ; k = entity.bZ;
@ -1154,10 +1154,10 @@ public class World implements IBlockAccess {
this.d(entity); this.d(entity);
} }
// MethodProfiler.a(); // CraftBukkit -- not in production code // MethodProfiler.a(); // CraftBukkit - not in production code
} }
// MethodProfiler.b("tileEntities"); // CraftBukkit -- not in production code // MethodProfiler.b("tileEntities"); // CraftBukkit - not in production code
this.S = true; this.S = true;
Iterator iterator = this.h.iterator(); Iterator iterator = this.h.iterator();
@ -1186,7 +1186,7 @@ public class World implements IBlockAccess {
this.N.clear(); this.N.clear();
} }
// MethodProfiler.b("pendingTileEntities"); // CraftBukkit -- not in production code // MethodProfiler.b("pendingTileEntities"); // CraftBukkit - not in production code
if (!this.M.isEmpty()) { if (!this.M.isEmpty()) {
Iterator iterator1 = this.M.iterator(); Iterator iterator1 = this.M.iterator();
@ -1219,8 +1219,8 @@ public class World implements IBlockAccess {
this.M.clear(); this.M.clear();
} }
// MethodProfiler.a(); // CraftBukkit -- not in production code // MethodProfiler.a(); // CraftBukkit - not in production code
// MethodProfiler.a(); // CraftBukkit -- not in production code // MethodProfiler.a(); // CraftBukkit - not in production code
} }
public void a(Collection collection) { public void a(Collection collection) {
@ -1254,7 +1254,7 @@ public class World implements IBlockAccess {
} }
} }
// MethodProfiler.a("chunkCheck"); // CraftBukkit -- not in production code // MethodProfiler.a("chunkCheck"); // CraftBukkit - not in production code
if (Double.isNaN(entity.locX) || Double.isInfinite(entity.locX)) { if (Double.isNaN(entity.locX) || Double.isInfinite(entity.locX)) {
entity.locX = entity.bI; entity.locX = entity.bI;
} }
@ -1292,7 +1292,7 @@ public class World implements IBlockAccess {
} }
} }
// MethodProfiler.a(); // CraftBukkit -- not in production code // MethodProfiler.a(); // CraftBukkit - not in production code
if (flag && entity.bW && entity.passenger != null) { if (flag && entity.bW && entity.passenger != null) {
if (!entity.passenger.dead && entity.passenger.vehicle == entity) { if (!entity.passenger.dead && entity.passenger.vehicle == entity) {
this.playerJoinedWorld(entity.passenger); this.playerJoinedWorld(entity.passenger);
@ -1715,13 +1715,13 @@ public class World implements IBlockAccess {
} }
} }
// MethodProfiler.a("mobSpawner"); // CraftBukkit -- not in production code // MethodProfiler.a("mobSpawner"); // CraftBukkit - not in production code
// CraftBukkit start - Only call spawner if we have players online and the world allows for mobs or animals // CraftBukkit start - Only call spawner if we have players online and the world allows for mobs or animals
if ((this.allowMonsters || this.allowAnimals) && (this instanceof WorldServer && this.getServer().getHandle().players.size() > 0)) { if ((this.allowMonsters || this.allowAnimals) && (this instanceof WorldServer && this.getServer().getHandle().players.size() > 0)) {
SpawnerCreature.spawnEntities(this, this.allowMonsters, this.allowAnimals && this.worldData.f() % 400L == 0L); SpawnerCreature.spawnEntities(this, this.allowMonsters, this.allowAnimals && this.worldData.f() % 400L == 0L);
} }
// CraftBukkit end // CraftBukkit end
// MethodProfiler.b("chunkSource"); // CraftBukkit -- not in production code // MethodProfiler.b("chunkSource"); // CraftBukkit - not in production code
this.chunkProvider.unloadChunks(); this.chunkProvider.unloadChunks();
int j = this.a(1.0F); int j = this.a(1.0F);
@ -1731,16 +1731,16 @@ public class World implements IBlockAccess {
i = this.worldData.f() + 1L; i = this.worldData.f() + 1L;
if (i % (long) this.u == 0L) { if (i % (long) this.u == 0L) {
// MethodProfiler.b("save"); // CraftBukkit -- not in production code // MethodProfiler.b("save"); // CraftBukkit - not in production code
this.save(false, (IProgressUpdate) null); this.save(false, (IProgressUpdate) null);
} }
this.worldData.a(i); this.worldData.a(i);
// MethodProfiler.b("tickPending"); // CraftBukkit -- not in production code // MethodProfiler.b("tickPending"); // CraftBukkit - not in production code
this.a(false); this.a(false);
// MethodProfiler.b("tickTiles"); // CraftBukkit -- not in production code // MethodProfiler.b("tickTiles"); // CraftBukkit - not in production code
this.k(); this.k();
// MethodProfiler.a(); // CraftBukkit -- not in production code // MethodProfiler.a(); // CraftBukkit - not in production code
} }
private void z() { private void z() {
@ -1858,8 +1858,8 @@ public class World implements IBlockAccess {
} }
protected void k() { protected void k() {
// this.T.clear(); // CraftBukkit -- removed // this.T.clear(); // CraftBukkit - removed
// MethodProfiler.a("buildList"); // CraftBukkit -- not in production code // MethodProfiler.a("buildList"); // CraftBukkit - not in production code
int i; int i;
int j; int j;
@ -1884,8 +1884,8 @@ public class World implements IBlockAccess {
i = 0; i = 0;
int j1 = 0; int j1 = 0;
// MethodProfiler.a(); // CraftBukkit -- not in production code // MethodProfiler.a(); // CraftBukkit - not in production code
// Iterator iterator = this.T.iterator(); CraftBukkit == removed // Iterator iterator = this.T.iterator(); // CraftBukkit - removed
// CraftBukkit start // CraftBukkit start
for (long chunkCoord : this.T.popAll()) { for (long chunkCoord : this.T.popAll()) {
@ -1895,13 +1895,13 @@ public class World implements IBlockAccess {
int k1 = chunkX * 16; int k1 = chunkX * 16;
j = chunkZ * 16; j = chunkZ * 16;
// MethodProfiler.a("getChunk"); // CraftBukkit -- not in production code // MethodProfiler.a("getChunk"); // CraftBukkit - not in production code
Chunk chunk = this.getChunkAt(chunkX, chunkZ); Chunk chunk = this.getChunkAt(chunkX, chunkZ);
// CraftBukkit end // CraftBukkit end
// MethodProfiler.b("tickChunk"); // CraftBukkit -- not in production code // MethodProfiler.b("tickChunk"); // CraftBukkit - not in production code
chunk.i(); chunk.i();
// MethodProfiler.b("moodSound"); // CraftBukkit -- not in production code // MethodProfiler.b("moodSound"); // CraftBukkit - not in production code
int l1; int l1;
int i2; int i2;
int j2; int j2;
@ -1927,7 +1927,7 @@ public class World implements IBlockAccess {
} }
} }
// MethodProfiler.b("thunder"); // CraftBukkit -- not in production code // MethodProfiler.b("thunder"); // CraftBukkit - not in production code
if (this.random.nextInt(100000) == 0 && this.w() && this.v()) { if (this.random.nextInt(100000) == 0 && this.w() && this.v()) {
this.l = this.l * 3 + 1013904223; this.l = this.l * 3 + 1013904223;
l1 = this.l >> 2; l1 = this.l >> 2;
@ -1940,7 +1940,7 @@ public class World implements IBlockAccess {
} }
} }
// MethodProfiler.b("iceandsnow"); // CraftBukkit -- not in production code // MethodProfiler.b("iceandsnow"); // CraftBukkit - not in production code
this.l = this.l * 3 + 1013904223; this.l = this.l * 3 + 1013904223;
l1 = this.l >> 2; l1 = this.l >> 2;
i2 = l1 & 15; i2 = l1 & 15;
@ -1972,9 +1972,9 @@ public class World implements IBlockAccess {
// CraftBukkit end // CraftBukkit end
} }
// MethodProfiler.b("checkLight"); // CraftBukkit -- not in production code // MethodProfiler.b("checkLight"); // CraftBukkit - not in production code
this.s(k1 + this.random.nextInt(16), this.random.nextInt(this.height), j + this.random.nextInt(16)); this.s(k1 + this.random.nextInt(16), this.random.nextInt(this.height), j + this.random.nextInt(16));
// MethodProfiler.b("tickTiles"); // CraftBukkit -- not in production code // MethodProfiler.b("tickTiles"); // CraftBukkit - not in production code
for (l1 = 0; l1 < 20; ++l1) { for (l1 = 0; l1 < 20; ++l1) {
this.l = this.l * 3 + 1013904223; this.l = this.l * 3 + 1013904223;
@ -1991,7 +1991,7 @@ public class World implements IBlockAccess {
} }
} }
// MethodProfiler.a(); // CraftBukkit -- not in production code // MethodProfiler.a(); // CraftBukkit - not in production code
} }
} }
@ -2467,7 +2467,7 @@ public class World implements IBlockAccess {
} }
public PathEntity findPath(Entity entity, Entity entity1, float f) { public PathEntity findPath(Entity entity, Entity entity1, float f) {
// MethodProfiler.a("pathfind"); // CraftBukkit -- not in production code // MethodProfiler.a("pathfind"); // CraftBukkit - not in production code
int i = MathHelper.floor(entity.locX); int i = MathHelper.floor(entity.locX);
int j = MathHelper.floor(entity.locY); int j = MathHelper.floor(entity.locY);
int k = MathHelper.floor(entity.locZ); int k = MathHelper.floor(entity.locZ);
@ -2481,12 +2481,12 @@ public class World implements IBlockAccess {
ChunkCache chunkcache = new ChunkCache(this, i1, j1, k1, l1, i2, j2); ChunkCache chunkcache = new ChunkCache(this, i1, j1, k1, l1, i2, j2);
PathEntity pathentity = (new Pathfinder(chunkcache)).a(entity, entity1, f); PathEntity pathentity = (new Pathfinder(chunkcache)).a(entity, entity1, f);
// MethodProfiler.a(); // CraftBukkit -- not in production code // MethodProfiler.a(); // CraftBukkit - not in production code
return pathentity; return pathentity;
} }
public PathEntity a(Entity entity, int i, int j, int k, float f) { public PathEntity a(Entity entity, int i, int j, int k, float f) {
// MethodProfiler.a("pathfind"); // CraftBukkit -- not in production code // MethodProfiler.a("pathfind"); // CraftBukkit - not in production code
int l = MathHelper.floor(entity.locX); int l = MathHelper.floor(entity.locX);
int i1 = MathHelper.floor(entity.locY); int i1 = MathHelper.floor(entity.locY);
int j1 = MathHelper.floor(entity.locZ); int j1 = MathHelper.floor(entity.locZ);
@ -2500,7 +2500,7 @@ public class World implements IBlockAccess {
ChunkCache chunkcache = new ChunkCache(this, l1, i2, j2, k2, l2, i3); ChunkCache chunkcache = new ChunkCache(this, l1, i2, j2, k2, l2, i3);
PathEntity pathentity = (new Pathfinder(chunkcache)).a(entity, i, j, k, f); PathEntity pathentity = (new Pathfinder(chunkcache)).a(entity, i, j, k, f);
// MethodProfiler.a(); // CraftBukkit -- not in production code // MethodProfiler.a(); // CraftBukkit - not in production code
return pathentity; return pathentity;
} }

View File

@ -8,17 +8,17 @@ import org.bukkit.Bukkit;
import org.bukkit.block.BlockState; import org.bukkit.block.BlockState;
import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.craftbukkit.CraftWorld;
import org.bukkit.event.world.StructureGrowEvent; import org.bukkit.event.world.StructureGrowEvent;
// Craftbukkit end // CraftBukkit end
public class WorldGenBigTree extends WorldGenerator { public class WorldGenBigTree extends WorldGenerator {
static final byte[] a = new byte[] { (byte) 2, (byte) 0, (byte) 0, (byte) 1, (byte) 2, (byte) 1}; static final byte[] a = new byte[] { (byte) 2, (byte) 0, (byte) 0, (byte) 1, (byte) 2, (byte) 1};
Random b = new Random(); Random b = new Random();
// Craftbukkit start // CraftBukkit start
BlockChangeDelegate c; BlockChangeDelegate c;
StructureGrowEvent event; StructureGrowEvent event;
CraftWorld bukkitWorld; CraftWorld bukkitWorld;
// Craftbukkit end // CraftBukkit end
int[] d = new int[] { 0, 0, 0}; int[] d = new int[] { 0, 0, 0};
int e = 0; int e = 0;
int f; int f;
@ -131,7 +131,7 @@ public class WorldGenBigTree extends WorldGenerator {
if (l1 != 0 && l1 != 18) { if (l1 != 0 && l1 != 18) {
++k1; ++k1;
} else { } else {
// Craftbukkit start // CraftBukkit start
if (event == null) { if (event == null) {
this.a(this.c, aint1[0], aint1[1], aint1[2], l, 0); this.a(this.c, aint1[0], aint1[1], aint1[2], l, 0);
} else { } else {
@ -139,7 +139,7 @@ public class WorldGenBigTree extends WorldGenerator {
state.setTypeId(l); state.setTypeId(l);
event.getBlocks().add(state); event.getBlocks().add(state);
} }
// Craftbukkit end // CraftBukkit end
++k1; ++k1;
} }
} }
@ -215,7 +215,7 @@ public class WorldGenBigTree extends WorldGenerator {
aint3[b1] = MathHelper.floor((double) (aint[b1] + j) + 0.5D); aint3[b1] = MathHelper.floor((double) (aint[b1] + j) + 0.5D);
aint3[b2] = MathHelper.floor((double) aint[b2] + (double) j * d0 + 0.5D); aint3[b2] = MathHelper.floor((double) aint[b2] + (double) j * d0 + 0.5D);
aint3[b3] = MathHelper.floor((double) aint[b3] + (double) j * d1 + 0.5D); aint3[b3] = MathHelper.floor((double) aint[b3] + (double) j * d1 + 0.5D);
// Craftbukkit start // CraftBukkit start
if (event == null) { if (event == null) {
this.a(this.c, aint3[0], aint3[1], aint3[2], i, 0); this.a(this.c, aint3[0], aint3[1], aint3[2], i, 0);
} else { } else {
@ -223,7 +223,7 @@ public class WorldGenBigTree extends WorldGenerator {
state.setTypeId(i); state.setTypeId(i);
event.getBlocks().add(state); event.getBlocks().add(state);
} }
// Craftbukkit end // CraftBukkit end
} }
} }
} }
@ -393,7 +393,7 @@ public class WorldGenBigTree extends WorldGenerator {
this.b(); this.b();
this.c(); this.c();
this.d(); this.d();
// Craftbukkit start // CraftBukkit start
if (event != null) { if (event != null) {
Bukkit.getPluginManager().callEvent(event); Bukkit.getPluginManager().callEvent(event);
if (!event.isCancelled()) { if (!event.isCancelled()) {
@ -403,7 +403,7 @@ public class WorldGenBigTree extends WorldGenerator {
} }
} }
} }
// Craftbukkit end // CraftBukkit end
return true; return true;
} }
} }

View File

@ -67,7 +67,7 @@ public class WorldGenForest extends WorldGenerator {
} else { } else {
i1 = world.getTypeId(i, j - 1, k); i1 = world.getTypeId(i, j - 1, k);
if ((i1 == Block.GRASS.id || i1 == Block.DIRT.id) && j < world.getHeight() - l - 1) { // CraftBukkit if ((i1 == Block.GRASS.id || i1 == Block.DIRT.id) && j < world.getHeight() - l - 1) { // CraftBukkit
// Craftbukkit start // CraftBukkit start
if (event == null) { if (event == null) {
world.setRawTypeId(i, j - 1, k, Block.DIRT.id); world.setRawTypeId(i, j - 1, k, Block.DIRT.id);
} else { } else {
@ -75,7 +75,7 @@ public class WorldGenForest extends WorldGenerator {
dirtState.setTypeId(Block.DIRT.id); dirtState.setTypeId(Block.DIRT.id);
event.getBlocks().add(dirtState); event.getBlocks().add(dirtState);
} }
// Craftbukkit end // CraftBukkit end
int i2; int i2;
for (i2 = j - 3 + l; i2 <= j + l; ++i2) { for (i2 = j - 3 + l; i2 <= j + l; ++i2) {
@ -89,7 +89,7 @@ public class WorldGenForest extends WorldGenerator {
int l2 = k2 - k; int l2 = k2 - k;
if ((Math.abs(j2) != k1 || Math.abs(l2) != k1 || random.nextInt(2) != 0 && j1 != 0) && !Block.o[world.getTypeId(l1, i2, k2)]) { if ((Math.abs(j2) != k1 || Math.abs(l2) != k1 || random.nextInt(2) != 0 && j1 != 0) && !Block.o[world.getTypeId(l1, i2, k2)]) {
// Craftbukkit start // CraftBukkit start
if (event == null) { if (event == null) {
this.a(world, l1, i2, k2, Block.LEAVES.id, 2); this.a(world, l1, i2, k2, Block.LEAVES.id, 2);
} else { } else {
@ -98,7 +98,7 @@ public class WorldGenForest extends WorldGenerator {
leavesState.setData(new MaterialData(Block.LEAVES.id, (byte) 2)); leavesState.setData(new MaterialData(Block.LEAVES.id, (byte) 2));
event.getBlocks().add(leavesState); event.getBlocks().add(leavesState);
} }
// Craftbukkit end // CraftBukkit end
} }
} }
} }
@ -107,7 +107,7 @@ public class WorldGenForest extends WorldGenerator {
for (i2 = 0; i2 < l; ++i2) { for (i2 = 0; i2 < l; ++i2) {
j1 = world.getTypeId(i, j + i2, k); j1 = world.getTypeId(i, j + i2, k);
if (j1 == 0 || j1 == Block.LEAVES.id) { if (j1 == 0 || j1 == Block.LEAVES.id) {
// Craftbukkit start // CraftBukkit start
if (event == null) { if (event == null) {
this.a(world, i, j + i2, k, Block.LOG.id, 2); this.a(world, i, j + i2, k, Block.LOG.id, 2);
} else { } else {
@ -116,10 +116,10 @@ public class WorldGenForest extends WorldGenerator {
logState.setData(new MaterialData(Block.LOG.id, (byte) 2)); logState.setData(new MaterialData(Block.LOG.id, (byte) 2));
event.getBlocks().add(logState); event.getBlocks().add(logState);
} }
// Craftbukkit end // CraftBukkit end
} }
} }
// Craftbukkit start // CraftBukkit start
if (event != null) { if (event != null) {
Bukkit.getPluginManager().callEvent(event); Bukkit.getPluginManager().callEvent(event);
if (!event.isCancelled()) { if (!event.isCancelled()) {
@ -128,7 +128,7 @@ public class WorldGenForest extends WorldGenerator {
} }
} }
} }
// Craftbukkit end // CraftBukkit end
return true; return true;
} else { } else {
return false; return false;

View File

@ -1,13 +1,13 @@
package net.minecraft.server; package net.minecraft.server;
import java.util.Random; import java.util.Random;
// Craftbukkit start // CraftBukkit start
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.block.BlockState; import org.bukkit.block.BlockState;
import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.craftbukkit.CraftWorld;
import org.bukkit.event.world.StructureGrowEvent; import org.bukkit.event.world.StructureGrowEvent;
import org.bukkit.material.MaterialData; import org.bukkit.material.MaterialData;
// Craftbukkit end // CraftBukkit end
public class WorldGenHugeMushroom extends WorldGenerator { public class WorldGenHugeMushroom extends WorldGenerator {
@ -71,7 +71,7 @@ public class WorldGenHugeMushroom extends WorldGenerator {
} else if (!Block.BROWN_MUSHROOM.canPlace(world, i, j, k)) { } else if (!Block.BROWN_MUSHROOM.canPlace(world, i, j, k)) {
return false; return false;
} else { } else {
// Craftbukkit start // CraftBukkit start
if (event == null) { if (event == null) {
world.setRawTypeId(i, j - 1, k, Block.DIRT.id); world.setRawTypeId(i, j - 1, k, Block.DIRT.id);
} else { } else {
@ -79,7 +79,7 @@ public class WorldGenHugeMushroom extends WorldGenerator {
dirtState.setTypeId(Block.DIRT.id); dirtState.setTypeId(Block.DIRT.id);
event.getBlocks().add(dirtState); event.getBlocks().add(dirtState);
} }
// Craftbukkit end // CraftBukkit end
int j2 = j + i1; int j2 = j + i1;
if (l == 1) { if (l == 1) {
@ -159,7 +159,7 @@ public class WorldGenHugeMushroom extends WorldGenerator {
} }
if ((l2 != 0 || j >= j + i1 - 1) && !Block.o[world.getTypeId(i2, k1, k2)]) { if ((l2 != 0 || j >= j + i1 - 1) && !Block.o[world.getTypeId(i2, k1, k2)]) {
// Craftbukkit start // CraftBukkit start
if (event == null) { if (event == null) {
world.setRawTypeIdAndData(i2, k1, k2, Block.BIG_MUSHROOM_1.id + l, l2); world.setRawTypeIdAndData(i2, k1, k2, Block.BIG_MUSHROOM_1.id + l, l2);
} else { } else {
@ -168,7 +168,7 @@ public class WorldGenHugeMushroom extends WorldGenerator {
state.setData(new MaterialData(Block.BIG_MUSHROOM_1.id + l, (byte) l2)); state.setData(new MaterialData(Block.BIG_MUSHROOM_1.id + l, (byte) l2));
event.getBlocks().add(state); event.getBlocks().add(state);
} }
// Craftbukkit end // CraftBukkit end
} }
} }
} }
@ -177,7 +177,7 @@ public class WorldGenHugeMushroom extends WorldGenerator {
for (k1 = 0; k1 < i1; ++k1) { for (k1 = 0; k1 < i1; ++k1) {
l1 = world.getTypeId(i, j + k1, k); l1 = world.getTypeId(i, j + k1, k);
if (!Block.o[l1]) { if (!Block.o[l1]) {
// Craftbukkit start // CraftBukkit start
if (event == null) { if (event == null) {
world.setRawTypeIdAndData(i, j + k1, k, Block.BIG_MUSHROOM_1.id + l, 10); world.setRawTypeIdAndData(i, j + k1, k, Block.BIG_MUSHROOM_1.id + l, 10);
} else { } else {
@ -186,10 +186,10 @@ public class WorldGenHugeMushroom extends WorldGenerator {
state.setData(new MaterialData(Block.BIG_MUSHROOM_1.id + l, (byte) 10)); state.setData(new MaterialData(Block.BIG_MUSHROOM_1.id + l, (byte) 10));
event.getBlocks().add(state); event.getBlocks().add(state);
} }
// Craftbukkit end // CraftBukkit end
} }
} }
// Craftbukkit start // CraftBukkit start
if (event != null) { if (event != null) {
Bukkit.getPluginManager().callEvent(event); Bukkit.getPluginManager().callEvent(event);
if (!event.isCancelled()) { if (!event.isCancelled()) {
@ -198,7 +198,7 @@ public class WorldGenHugeMushroom extends WorldGenerator {
} }
} }
} }
// Craftbukkit end // CraftBukkit end
return true; return true;
} }
} }

View File

@ -68,7 +68,7 @@ public class WorldGenTaiga2 extends WorldGenerator {
} else { } else {
l1 = world.getTypeId(i, j - 1, k); l1 = world.getTypeId(i, j - 1, k);
if ((l1 == Block.GRASS.id || l1 == Block.DIRT.id) && j < world.getHeight() - l - 1) { // CraftBukkit if ((l1 == Block.GRASS.id || l1 == Block.DIRT.id) && j < world.getHeight() - l - 1) { // CraftBukkit
// Craftbukkit start // CraftBukkit start
if (event == null) { if (event == null) {
world.setRawTypeId(i, j - 1, k, Block.DIRT.id); world.setRawTypeId(i, j - 1, k, Block.DIRT.id);
} else { } else {
@ -76,7 +76,7 @@ public class WorldGenTaiga2 extends WorldGenerator {
dirtState.setTypeId(Block.DIRT.id); dirtState.setTypeId(Block.DIRT.id);
event.getBlocks().add(dirtState); event.getBlocks().add(dirtState);
} }
// Craftbukkit end // CraftBukkit end
k2 = random.nextInt(2); k2 = random.nextInt(2);
i2 = 1; i2 = 1;
byte b0 = 0; byte b0 = 0;
@ -94,7 +94,7 @@ public class WorldGenTaiga2 extends WorldGenerator {
int i4 = l3 - k; int i4 = l3 - k;
if ((Math.abs(k3) != k2 || Math.abs(i4) != k2 || k2 <= 0) && !Block.o[world.getTypeId(i3, j3, l3)]) { if ((Math.abs(k3) != k2 || Math.abs(i4) != k2 || k2 <= 0) && !Block.o[world.getTypeId(i3, j3, l3)]) {
// Craftbukkit start // CraftBukkit start
if (event == null) { if (event == null) {
this.a(world, i3, j3, l3, Block.LEAVES.id, 1); this.a(world, i3, j3, l3, Block.LEAVES.id, 1);
} else { } else {
@ -103,7 +103,7 @@ public class WorldGenTaiga2 extends WorldGenerator {
leavesState.setData(new MaterialData(Block.LEAVES.id, (byte) 1)); leavesState.setData(new MaterialData(Block.LEAVES.id, (byte) 1));
event.getBlocks().add(leavesState); event.getBlocks().add(leavesState);
} }
// Craftbukkit end // CraftBukkit end
} }
} }
} }
@ -125,7 +125,7 @@ public class WorldGenTaiga2 extends WorldGenerator {
for (j3 = 0; j3 < l - j2; ++j3) { for (j3 = 0; j3 < l - j2; ++j3) {
i3 = world.getTypeId(i, j + j3, k); i3 = world.getTypeId(i, j + j3, k);
if (i3 == 0 || i3 == Block.LEAVES.id) { if (i3 == 0 || i3 == Block.LEAVES.id) {
// Craftbukkit start // CraftBukkit start
if (event == null) { if (event == null) {
this.a(world, i, j + j3, k, Block.LOG.id, 1); this.a(world, i, j + j3, k, Block.LOG.id, 1);
} else { } else {
@ -134,10 +134,10 @@ public class WorldGenTaiga2 extends WorldGenerator {
logState.setData(new MaterialData(Block.LOG.id, (byte) 1)); logState.setData(new MaterialData(Block.LOG.id, (byte) 1));
event.getBlocks().add(logState); event.getBlocks().add(logState);
} }
// Craftbukkit end // CraftBukkit end
} }
} }
// Craftbukkit start // CraftBukkit start
if (event != null) { if (event != null) {
Bukkit.getPluginManager().callEvent(event); Bukkit.getPluginManager().callEvent(event);
if (!event.isCancelled()) { if (!event.isCancelled()) {
@ -146,7 +146,7 @@ public class WorldGenTaiga2 extends WorldGenerator {
} }
} }
} }
// Craftbukkit end // CraftBukkit end
return true; return true;
} else { } else {
return false; return false;

View File

@ -2,13 +2,13 @@ package net.minecraft.server;
import java.util.Random; import java.util.Random;
// Craftbukkit start // CraftBukkit start
import org.bukkit.BlockChangeDelegate; import org.bukkit.BlockChangeDelegate;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.block.BlockState; import org.bukkit.block.BlockState;
import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.craftbukkit.CraftWorld;
import org.bukkit.event.world.StructureGrowEvent; import org.bukkit.event.world.StructureGrowEvent;
// Craftbukkit end // CraftBukkit end
public class WorldGenTrees extends WorldGenerator { public class WorldGenTrees extends WorldGenerator {
@ -66,7 +66,7 @@ public class WorldGenTrees extends WorldGenerator {
} else { } else {
i1 = world.getTypeId(i, j - 1, k); i1 = world.getTypeId(i, j - 1, k);
if ((i1 == Block.GRASS.id || i1 == Block.DIRT.id) && j < world.getHeight() - l - 1) { // CraftBukkit if ((i1 == Block.GRASS.id || i1 == Block.DIRT.id) && j < world.getHeight() - l - 1) { // CraftBukkit
// Craftbukkit start // CraftBukkit start
if (event == null) { if (event == null) {
world.setRawTypeId(i, j - 1, k, Block.DIRT.id); world.setRawTypeId(i, j - 1, k, Block.DIRT.id);
} else { } else {
@ -74,7 +74,7 @@ public class WorldGenTrees extends WorldGenerator {
dirtState.setTypeId(Block.DIRT.id); dirtState.setTypeId(Block.DIRT.id);
event.getBlocks().add(dirtState); event.getBlocks().add(dirtState);
} }
// Craftbukkit end // CraftBukkit end
int i2; int i2;
@ -89,7 +89,7 @@ public class WorldGenTrees extends WorldGenerator {
int l2 = k2 - k; int l2 = k2 - k;
if ((Math.abs(j2) != k1 || Math.abs(l2) != k1 || random.nextInt(2) != 0 && j1 != 0) && !Block.o[world.getTypeId(l1, i2, k2)]) { if ((Math.abs(j2) != k1 || Math.abs(l2) != k1 || random.nextInt(2) != 0 && j1 != 0) && !Block.o[world.getTypeId(l1, i2, k2)]) {
// Craftbukkit start // CraftBukkit start
if (event == null) { if (event == null) {
this.a(world, l1, i2, k2, Block.LEAVES.id, 0); this.a(world, l1, i2, k2, Block.LEAVES.id, 0);
} else { } else {
@ -97,7 +97,7 @@ public class WorldGenTrees extends WorldGenerator {
leavesState.setTypeId(Block.LEAVES.id); leavesState.setTypeId(Block.LEAVES.id);
event.getBlocks().add(leavesState); event.getBlocks().add(leavesState);
} }
// Craftbukkit end // CraftBukkit end
} }
} }
} }
@ -106,7 +106,7 @@ public class WorldGenTrees extends WorldGenerator {
for (i2 = 0; i2 < l; ++i2) { for (i2 = 0; i2 < l; ++i2) {
j1 = world.getTypeId(i, j + i2, k); j1 = world.getTypeId(i, j + i2, k);
if (j1 == 0 || j1 == Block.LEAVES.id) { if (j1 == 0 || j1 == Block.LEAVES.id) {
// Craftbukkit start // CraftBukkit start
if (event == null) { if (event == null) {
this.a(world, i, j + i2, k, Block.LOG.id, 0); this.a(world, i, j + i2, k, Block.LOG.id, 0);
} else { } else {
@ -114,10 +114,10 @@ public class WorldGenTrees extends WorldGenerator {
logState.setTypeId(Block.LOG.id); logState.setTypeId(Block.LOG.id);
event.getBlocks().add(logState); event.getBlocks().add(logState);
} }
// Craftbukkit end // CraftBukkit end
} }
} }
// Craftbukkit start // CraftBukkit start
if (event != null) { if (event != null) {
Bukkit.getPluginManager().callEvent(event); Bukkit.getPluginManager().callEvent(event);
if (!event.isCancelled()) { if (!event.isCancelled()) {
@ -126,7 +126,7 @@ public class WorldGenTrees extends WorldGenerator {
} }
} }
} }
// Craftbukkit end // CraftBukkit end
return true; return true;
} else { } else {
return false; return false;

View File

@ -20,10 +20,10 @@ public abstract class WorldGenerator {
public void a(double d0, double d1, double d2) {} public void a(double d0, double d1, double d2) {}
// CraftBukkit -- change signature // CraftBukkit - change signature
protected void a(BlockChangeDelegate world, int i, int j, int k, int l, int i1) { protected void a(BlockChangeDelegate world, int i, int j, int k, int l, int i1) {
if (this.a) { if (this.a) {
((World) world).setTypeIdAndData(i, j, k, l, i1); // CraftBukkit -- force-cast to world to get it working ((World) world).setTypeIdAndData(i, j, k, l, i1); // CraftBukkit - force-cast to world to get it working
} else { } else {
world.setRawTypeIdAndData(i, j, k, l, i1); world.setRawTypeIdAndData(i, j, k, l, i1);
} }