mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-24 03:25:15 +01:00
Fix CraftBukkit comments.
This commit is contained in:
parent
42e473783e
commit
7f079a0cd6
@ -73,7 +73,7 @@ public class BlockCauldron extends Block {
|
||||
|
||||
if (!entityhuman.inventory.pickup(itemstack1)) {
|
||||
world.addEntity(new EntityItem(world, (double) i + 0.5D, (double) j + 1.5D, (double) k + 0.5D, itemstack1));
|
||||
} else if (entityhuman instanceof EntityPlayer) { //CraftBukkit
|
||||
} else if (entityhuman instanceof EntityPlayer) { // CraftBukkit
|
||||
((EntityPlayer) entityhuman).updateInventory(entityhuman.defaultContainer); // CraftBukkit
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,7 @@ import java.util.Random;
|
||||
// CraftBukkit start
|
||||
import org.bukkit.event.block.BlockSpreadEvent;
|
||||
import org.bukkit.event.block.BlockFadeEvent;
|
||||
//CraftBukkit end
|
||||
// CraftBukkit end
|
||||
|
||||
public class BlockGrass extends Block {
|
||||
|
||||
|
@ -2,14 +2,14 @@ package net.minecraft.server;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.TreeType;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.block.BlockSpreadEvent;
|
||||
import org.bukkit.event.world.StructureGrowEvent;
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
|
||||
public class BlockMushroom extends BlockFlower {
|
||||
|
||||
|
@ -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) {
|
||||
int i1 = i + Facing.b[l];
|
||||
int j1 = j + Facing.c[l];
|
||||
|
@ -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 (!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));
|
||||
|
||||
world.addEntity(entityfallingblock);
|
||||
|
@ -9,7 +9,7 @@ import org.bukkit.TreeType;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.world.StructureGrowEvent;
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
|
||||
public class BlockSapling extends BlockFlower {
|
||||
|
||||
@ -29,7 +29,7 @@ public class BlockSapling extends BlockFlower {
|
||||
if ((l & 8) == 0) {
|
||||
world.setData(i, j, k, l | 8);
|
||||
} 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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ package net.minecraft.server;
|
||||
import org.bukkit.craftbukkit.enchantments.CraftEnchantment;
|
||||
|
||||
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 PROTECTION_ENVIRONMENTAL = new EnchantmentProtection(0, 10, 0);
|
||||
public static final Enchantment PROTECTION_FIRE = new EnchantmentProtection(1, 5, 1);
|
||||
@ -37,9 +37,7 @@ public abstract class Enchantment {
|
||||
byId[i] = this;
|
||||
}
|
||||
|
||||
// CraftBukkit start
|
||||
org.bukkit.enchantments.Enchantment.registerEnchantment(new CraftEnchantment(this));
|
||||
// CraftBukkit end
|
||||
org.bukkit.enchantments.Enchantment.registerEnchantment(new CraftEnchantment(this)); // CraftBukkit
|
||||
}
|
||||
|
||||
public int getRandomWeight() {
|
||||
|
@ -196,7 +196,7 @@ public abstract class Entity {
|
||||
}
|
||||
|
||||
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) {
|
||||
this.vehicle = null;
|
||||
}
|
||||
@ -299,7 +299,7 @@ public abstract class Entity {
|
||||
}
|
||||
|
||||
this.justCreated = false;
|
||||
// MethodProfiler.a(); // CraftBukkit -- not in production code
|
||||
// MethodProfiler.a(); // CraftBukkit - not in production code
|
||||
}
|
||||
|
||||
protected void av() {
|
||||
@ -370,7 +370,7 @@ public abstract class Entity {
|
||||
this.locY = this.boundingBox.b + (double) this.height - (double) this.bL;
|
||||
this.locZ = (this.boundingBox.c + this.boundingBox.f) / 2.0D;
|
||||
} else {
|
||||
// MethodProfiler.a("move"); // CraftBukkit -- not in production code
|
||||
// MethodProfiler.a("move"); // CraftBukkit - not in production code
|
||||
this.bL *= 0.4F;
|
||||
double d3 = this.locX;
|
||||
double d4 = this.locZ;
|
||||
@ -532,8 +532,8 @@ public abstract class Entity {
|
||||
}
|
||||
}
|
||||
|
||||
// MethodProfiler.a(); // CraftBukkit -- not in production code
|
||||
// MethodProfiler.a("rest"); // CraftBukkit -- not in production code
|
||||
// MethodProfiler.a(); // CraftBukkit - not in production code
|
||||
// MethodProfiler.a("rest"); // CraftBukkit - not in production code
|
||||
this.locX = (this.boundingBox.a + this.boundingBox.d) / 2.0D;
|
||||
this.locY = this.boundingBox.b + (double) this.height - (double) this.bL;
|
||||
this.locZ = (this.boundingBox.c + this.boundingBox.f) / 2.0D;
|
||||
@ -646,7 +646,7 @@ public abstract class Entity {
|
||||
this.fireTicks = -this.maxFireTicks;
|
||||
}
|
||||
|
||||
// MethodProfiler.a(); // CraftBukkit -- not in production code
|
||||
// MethodProfiler.a(); // CraftBukkit - not in production code
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ public abstract class EntityCreature extends EntityLiving {
|
||||
}
|
||||
|
||||
protected void m_() {
|
||||
// MethodProfiler.a("ai"); // CraftBukkit -- not in production code
|
||||
// MethodProfiler.a("ai"); // CraftBukkit - not in production code
|
||||
if (this.f > 0) {
|
||||
--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)) {
|
||||
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) {
|
||||
@ -86,7 +86,7 @@ public abstract class EntityCreature extends EntityLiving {
|
||||
|
||||
this.pitch = 0.0F;
|
||||
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);
|
||||
double d0 = (double) (this.width * 2.0F);
|
||||
|
||||
@ -154,7 +154,7 @@ public abstract class EntityCreature extends EntityLiving {
|
||||
this.aW = true;
|
||||
}
|
||||
|
||||
// MethodProfiler.a(); // CraftBukkit -- not in production code
|
||||
// MethodProfiler.a(); // CraftBukkit - not in production code
|
||||
} else {
|
||||
super.m_();
|
||||
this.pathEntity = null;
|
||||
@ -162,7 +162,7 @@ public abstract class EntityCreature extends EntityLiving {
|
||||
}
|
||||
|
||||
protected void C() {
|
||||
// MethodProfiler.a("stroll"); // CraftBukkit -- not in production code
|
||||
// MethodProfiler.a("stroll"); // CraftBukkit - not in production code
|
||||
boolean flag = false;
|
||||
int i = -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);
|
||||
}
|
||||
|
||||
// MethodProfiler.a(); // CraftBukkit -- not in production code
|
||||
// MethodProfiler.a(); // CraftBukkit - not in production code
|
||||
}
|
||||
|
||||
protected void a(Entity entity, float f) {}
|
||||
|
@ -10,7 +10,7 @@ public class EntityFallingBlock extends Entity {
|
||||
super(world);
|
||||
}
|
||||
|
||||
// CraftBukkit -- changed method signature
|
||||
// CraftBukkit - changed method signature
|
||||
public EntityFallingBlock(World world, double d0, double d1, double d2, int i, int data) {
|
||||
super(world);
|
||||
this.a = i;
|
||||
@ -66,7 +66,7 @@ public class EntityFallingBlock extends Entity {
|
||||
this.motY *= -0.5D;
|
||||
if (this.world.getTypeId(i, j, k) != Block.PISTON_MOVING.id) {
|
||||
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) {
|
||||
this.b(this.a, 1);
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ public abstract class EntityHuman extends EntityLiving {
|
||||
// CraftBukkit end
|
||||
|
||||
public ChunkCoordinates F;
|
||||
public int sleepTicks; // CraftBukkit private -> public
|
||||
public int sleepTicks; // CraftBukkit - private -> public
|
||||
public float G;
|
||||
public float H;
|
||||
private ChunkCoordinates b;
|
||||
|
@ -81,8 +81,8 @@ public abstract class EntityLiving extends Entity {
|
||||
private int d = 0;
|
||||
private Entity e;
|
||||
protected int aZ = 0;
|
||||
public int expToDrop = 0; // CraftBukkit added
|
||||
public int maxAirTicks = 300; // CraftBukkit added
|
||||
public int expToDrop = 0; // CraftBukkit
|
||||
public int maxAirTicks = 300; // CraftBukkit
|
||||
|
||||
public EntityLiving(World world) {
|
||||
super(world);
|
||||
@ -129,7 +129,7 @@ public abstract class EntityLiving extends Entity {
|
||||
public void af() {
|
||||
this.am = this.an;
|
||||
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++) {
|
||||
this.a = -this.h();
|
||||
this.ae();
|
||||
@ -175,7 +175,7 @@ public abstract class EntityLiving extends Entity {
|
||||
|
||||
this.extinguish();
|
||||
} 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);
|
||||
}
|
||||
}
|
||||
@ -208,7 +208,7 @@ public abstract class EntityLiving extends Entity {
|
||||
this.W = this.V;
|
||||
this.lastYaw = this.yaw;
|
||||
this.lastPitch = this.pitch;
|
||||
// MethodProfiler.a(); // CraftBukkit -- not in production code
|
||||
// MethodProfiler.a(); // CraftBukkit - not in production code
|
||||
}
|
||||
|
||||
// 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()) {
|
||||
this.aW = false;
|
||||
this.aT = 0.0F;
|
||||
@ -887,7 +887,7 @@ public abstract class EntityLiving extends Entity {
|
||||
this.m_();
|
||||
}
|
||||
|
||||
// MethodProfiler.a(); // CraftBukkit -- not in production code
|
||||
// MethodProfiler.a(); // CraftBukkit - not in production code
|
||||
boolean flag = this.az();
|
||||
boolean flag1 = this.aA();
|
||||
|
||||
@ -912,7 +912,7 @@ public abstract class EntityLiving extends Entity {
|
||||
this.ak *= this.F();
|
||||
this.a(this.aT, this.aU);
|
||||
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));
|
||||
|
||||
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() {
|
||||
|
@ -27,7 +27,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
private int cc = -99999999;
|
||||
private int cd = -99999999;
|
||||
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
|
||||
private ItemStack[] ch = new ItemStack[] { null, null, null, null, null};
|
||||
private int ci = 0;
|
||||
@ -325,13 +325,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
this.netServerHandler.sendPacket(new Packet70Bed(4, 0));
|
||||
} else {
|
||||
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();
|
||||
|
||||
if (chunkcoordinates != null) {
|
||||
this.netServerHandler.a((double) chunkcoordinates.x, (double) chunkcoordinates.y, (double) chunkcoordinates.z, 0.0F, 0.0F);
|
||||
}
|
||||
//CraftBukkit end */
|
||||
// CraftBukkit end */
|
||||
|
||||
this.b.serverConfigurationManager.changeDimension(this, 1);
|
||||
this.cf = -1;
|
||||
|
@ -24,7 +24,7 @@ public class EntitySnowball extends EntityProjectile {
|
||||
|
||||
protected void a(MovingObjectPosition movingobjectposition) {
|
||||
if (movingobjectposition.entity != null) {
|
||||
int b0 = 0; //Craftbukkit - byte -> int
|
||||
int b0 = 0; // CraftBukkit - byte -> int
|
||||
|
||||
if (movingobjectposition.entity instanceof EntityBlaze) {
|
||||
b0 = 3;
|
||||
|
@ -388,7 +388,7 @@ public class EntityWolf extends EntityAnimal {
|
||||
|
||||
if (itemfood.p() && this.datawatcher.getInt(18) < 20) {
|
||||
--itemstack.count;
|
||||
this.d(itemfood.n(), RegainReason.EATING); // Craftbukkit
|
||||
this.d(itemfood.n(), RegainReason.EATING); // CraftBukkit
|
||||
if (itemstack.count <= 0) {
|
||||
entityhuman.inventory.setItem(entityhuman.inventory.itemInHandIndex, (ItemStack) null);
|
||||
}
|
||||
|
@ -104,7 +104,7 @@ public class ItemDoor extends Item {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
//CraftBukkit end
|
||||
// CraftBukkit end
|
||||
world.setTypeIdAndData(i, j + 1, k, block.id, l + 8);
|
||||
world.suppressPhysics = false;
|
||||
world.applyPhysics(i, j, k, block.id);
|
||||
|
@ -1,6 +1,6 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
import org.bukkit.entity.Player; // Craftbukkit
|
||||
import org.bukkit.entity.Player; // CraftBukkit
|
||||
|
||||
public class ItemDye extends Item {
|
||||
|
||||
@ -28,23 +28,23 @@ public class ItemDye extends Item {
|
||||
|
||||
if (i1 == Block.SAPLING.id) {
|
||||
if (!world.isStatic) {
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
Player player = (entityhuman instanceof EntityPlayer) ? (Player)entityhuman.getBukkitEntity() : null;
|
||||
((BlockSapling) Block.SAPLING).b(world, i, j, k, world.random, true, player, itemstack);
|
||||
//--itemstack.count; - called later if the bonemeal attempt was succesful
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if (i1 == Block.BROWN_MUSHROOM.id || i1 == Block.RED_MUSHROOM.id) {
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
if (!world.isStatic) {
|
||||
Player player = (entityhuman instanceof EntityPlayer) ? (Player)entityhuman.getBukkitEntity() : null;
|
||||
((BlockMushroom) Block.byId[i1]).b(world, i, j, k, world.random, true, player, itemstack);
|
||||
//--itemstack.count; - called later if the bonemeal attempt was succesful
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -190,7 +190,7 @@ public class MinecraftServer implements Runnable, ICommandListener, IMinecraftSe
|
||||
this.propertyManager.properties.remove("spawn-protection");
|
||||
this.propertyManager.savePropertiesFile();
|
||||
}
|
||||
// CratBukkit end
|
||||
// CraftBukkit end
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -700,7 +700,7 @@ public class MinecraftServer implements Runnable, ICommandListener, IMinecraftSe
|
||||
|
||||
public String d(String s) {
|
||||
RemoteControlCommandListener.a.a();
|
||||
// CraftBukkt start
|
||||
// CraftBukkit start
|
||||
ServerCommandEvent event = new ServerCommandEvent(Event.Type.REMOTE_COMMAND, this.remoteConsole, s);
|
||||
this.server.getPluginManager().callEvent(event);
|
||||
ServerCommand servercommand = new ServerCommand(event.getCommand(), RemoteControlCommandListener.a);
|
||||
|
@ -634,7 +634,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
|
||||
this.player.activeContainer.a();
|
||||
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) {
|
||||
this.sendPacket(new Packet103SetSlot(this.player.activeContainer.windowId, slot.c, this.player.inventory.getItemInHand()));
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ public class ServerConfigurationManager {
|
||||
private File l;
|
||||
private File m;
|
||||
public PlayerFileData playerFileData; // CraftBukkit - private - >public
|
||||
public boolean hasWhitelist; // Craftbukkit - private -> public
|
||||
public boolean hasWhitelist; // CraftBukkit - private -> public
|
||||
private int p = 0;
|
||||
|
||||
// CraftBukkit start
|
||||
@ -511,24 +511,24 @@ public class ServerConfigurationManager {
|
||||
this.operators.add(s.toLowerCase());
|
||||
this.q();
|
||||
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
Player player = server.server.getPlayer(s);
|
||||
if (player != null) {
|
||||
player.recalculatePermissions();
|
||||
}
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
public void removeOp(String s) {
|
||||
this.operators.remove(s.toLowerCase());
|
||||
this.q();
|
||||
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
Player player = server.server.getPlayer(s);
|
||||
if (player != null) {
|
||||
player.recalculatePermissions();
|
||||
}
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
private void p() {
|
||||
@ -705,7 +705,7 @@ public class ServerConfigurationManager {
|
||||
public void updateClient(EntityPlayer entityplayer) {
|
||||
entityplayer.updateInventory(entityplayer.defaultContainer);
|
||||
entityplayer.s_();
|
||||
entityplayer.cf = -1; // CraftBukkit added
|
||||
entityplayer.cf = -1; // CraftBukkit
|
||||
}
|
||||
|
||||
public int getPlayerCount() {
|
||||
|
@ -15,7 +15,7 @@ import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
|
||||
|
||||
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 {
|
||||
public boolean spawn;
|
||||
public ChunkEntry (int x, int z, boolean spawn) {
|
||||
|
@ -1086,8 +1086,8 @@ public class World implements IBlockAccess {
|
||||
}
|
||||
|
||||
public void tickEntities() {
|
||||
// MethodProfiler.a("entities"); // CraftBukkit -- not in production code
|
||||
// MethodProfiler.a("global"); // CraftBukkit -- not in production code
|
||||
// MethodProfiler.a("entities"); // CraftBukkit - not in production code
|
||||
// MethodProfiler.a("global"); // CraftBukkit - not in production code
|
||||
|
||||
int i;
|
||||
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);
|
||||
|
||||
int j;
|
||||
@ -1125,7 +1125,7 @@ public class World implements IBlockAccess {
|
||||
}
|
||||
|
||||
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) {
|
||||
entity = (Entity) this.entityList.get(i);
|
||||
@ -1142,7 +1142,7 @@ public class World implements IBlockAccess {
|
||||
this.playerJoinedWorld(entity);
|
||||
}
|
||||
|
||||
// MethodProfiler.a("remove"); // CraftBukkit -- not in production code
|
||||
// MethodProfiler.a("remove"); // CraftBukkit - not in production code
|
||||
if (entity.dead) {
|
||||
j = entity.bX;
|
||||
k = entity.bZ;
|
||||
@ -1154,10 +1154,10 @@ public class World implements IBlockAccess {
|
||||
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;
|
||||
Iterator iterator = this.h.iterator();
|
||||
|
||||
@ -1186,7 +1186,7 @@ public class World implements IBlockAccess {
|
||||
this.N.clear();
|
||||
}
|
||||
|
||||
// MethodProfiler.b("pendingTileEntities"); // CraftBukkit -- not in production code
|
||||
// MethodProfiler.b("pendingTileEntities"); // CraftBukkit - not in production code
|
||||
if (!this.M.isEmpty()) {
|
||||
Iterator iterator1 = this.M.iterator();
|
||||
|
||||
@ -1219,8 +1219,8 @@ public class World implements IBlockAccess {
|
||||
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) {
|
||||
@ -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)) {
|
||||
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 (!entity.passenger.dead && entity.passenger.vehicle == entity) {
|
||||
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
|
||||
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);
|
||||
}
|
||||
// CraftBukkit end
|
||||
// MethodProfiler.b("chunkSource"); // CraftBukkit -- not in production code
|
||||
// MethodProfiler.b("chunkSource"); // CraftBukkit - not in production code
|
||||
this.chunkProvider.unloadChunks();
|
||||
int j = this.a(1.0F);
|
||||
|
||||
@ -1731,16 +1731,16 @@ public class World implements IBlockAccess {
|
||||
|
||||
i = this.worldData.f() + 1L;
|
||||
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.worldData.a(i);
|
||||
// MethodProfiler.b("tickPending"); // CraftBukkit -- not in production code
|
||||
// MethodProfiler.b("tickPending"); // CraftBukkit - not in production code
|
||||
this.a(false);
|
||||
// MethodProfiler.b("tickTiles"); // CraftBukkit -- not in production code
|
||||
// MethodProfiler.b("tickTiles"); // CraftBukkit - not in production code
|
||||
this.k();
|
||||
// MethodProfiler.a(); // CraftBukkit -- not in production code
|
||||
// MethodProfiler.a(); // CraftBukkit - not in production code
|
||||
}
|
||||
|
||||
private void z() {
|
||||
@ -1858,8 +1858,8 @@ public class World implements IBlockAccess {
|
||||
}
|
||||
|
||||
protected void k() {
|
||||
// this.T.clear(); // CraftBukkit -- removed
|
||||
// MethodProfiler.a("buildList"); // CraftBukkit -- not in production code
|
||||
// this.T.clear(); // CraftBukkit - removed
|
||||
// MethodProfiler.a("buildList"); // CraftBukkit - not in production code
|
||||
|
||||
int i;
|
||||
int j;
|
||||
@ -1884,8 +1884,8 @@ public class World implements IBlockAccess {
|
||||
i = 0;
|
||||
int j1 = 0;
|
||||
|
||||
// MethodProfiler.a(); // CraftBukkit -- not in production code
|
||||
// Iterator iterator = this.T.iterator(); CraftBukkit == removed
|
||||
// MethodProfiler.a(); // CraftBukkit - not in production code
|
||||
// Iterator iterator = this.T.iterator(); // CraftBukkit - removed
|
||||
|
||||
// CraftBukkit start
|
||||
for (long chunkCoord : this.T.popAll()) {
|
||||
@ -1895,13 +1895,13 @@ public class World implements IBlockAccess {
|
||||
int k1 = chunkX * 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);
|
||||
// CraftBukkit end
|
||||
|
||||
// MethodProfiler.b("tickChunk"); // CraftBukkit -- not in production code
|
||||
// MethodProfiler.b("tickChunk"); // CraftBukkit - not in production code
|
||||
chunk.i();
|
||||
// MethodProfiler.b("moodSound"); // CraftBukkit -- not in production code
|
||||
// MethodProfiler.b("moodSound"); // CraftBukkit - not in production code
|
||||
int l1;
|
||||
int i2;
|
||||
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()) {
|
||||
this.l = this.l * 3 + 1013904223;
|
||||
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;
|
||||
l1 = this.l >> 2;
|
||||
i2 = l1 & 15;
|
||||
@ -1972,9 +1972,9 @@ public class World implements IBlockAccess {
|
||||
// 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));
|
||||
// MethodProfiler.b("tickTiles"); // CraftBukkit -- not in production code
|
||||
// MethodProfiler.b("tickTiles"); // CraftBukkit - not in production code
|
||||
|
||||
for (l1 = 0; l1 < 20; ++l1) {
|
||||
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) {
|
||||
// MethodProfiler.a("pathfind"); // CraftBukkit -- not in production code
|
||||
// MethodProfiler.a("pathfind"); // CraftBukkit - not in production code
|
||||
int i = MathHelper.floor(entity.locX);
|
||||
int j = MathHelper.floor(entity.locY);
|
||||
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);
|
||||
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;
|
||||
}
|
||||
|
||||
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 i1 = MathHelper.floor(entity.locY);
|
||||
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);
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -8,17 +8,17 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.craftbukkit.CraftWorld;
|
||||
import org.bukkit.event.world.StructureGrowEvent;
|
||||
// Craftbukkit end
|
||||
// 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 start
|
||||
BlockChangeDelegate c;
|
||||
StructureGrowEvent event;
|
||||
CraftWorld bukkitWorld;
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
int[] d = new int[] { 0, 0, 0};
|
||||
int e = 0;
|
||||
int f;
|
||||
@ -131,7 +131,7 @@ public class WorldGenBigTree extends WorldGenerator {
|
||||
if (l1 != 0 && l1 != 18) {
|
||||
++k1;
|
||||
} else {
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
if (event == null) {
|
||||
this.a(this.c, aint1[0], aint1[1], aint1[2], l, 0);
|
||||
} else {
|
||||
@ -139,7 +139,7 @@ public class WorldGenBigTree extends WorldGenerator {
|
||||
state.setTypeId(l);
|
||||
event.getBlocks().add(state);
|
||||
}
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
++k1;
|
||||
}
|
||||
}
|
||||
@ -215,7 +215,7 @@ public class WorldGenBigTree extends WorldGenerator {
|
||||
aint3[b1] = MathHelper.floor((double) (aint[b1] + j) + 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);
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
if (event == null) {
|
||||
this.a(this.c, aint3[0], aint3[1], aint3[2], i, 0);
|
||||
} else {
|
||||
@ -223,7 +223,7 @@ public class WorldGenBigTree extends WorldGenerator {
|
||||
state.setTypeId(i);
|
||||
event.getBlocks().add(state);
|
||||
}
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -393,7 +393,7 @@ public class WorldGenBigTree extends WorldGenerator {
|
||||
this.b();
|
||||
this.c();
|
||||
this.d();
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
if (event != null) {
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
@ -403,7 +403,7 @@ public class WorldGenBigTree extends WorldGenerator {
|
||||
}
|
||||
}
|
||||
}
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ public class WorldGenForest extends WorldGenerator {
|
||||
} else {
|
||||
i1 = world.getTypeId(i, j - 1, k);
|
||||
if ((i1 == Block.GRASS.id || i1 == Block.DIRT.id) && j < world.getHeight() - l - 1) { // CraftBukkit
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
if (event == null) {
|
||||
world.setRawTypeId(i, j - 1, k, Block.DIRT.id);
|
||||
} else {
|
||||
@ -75,7 +75,7 @@ public class WorldGenForest extends WorldGenerator {
|
||||
dirtState.setTypeId(Block.DIRT.id);
|
||||
event.getBlocks().add(dirtState);
|
||||
}
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
int i2;
|
||||
|
||||
for (i2 = j - 3 + l; i2 <= j + l; ++i2) {
|
||||
@ -89,7 +89,7 @@ public class WorldGenForest extends WorldGenerator {
|
||||
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)]) {
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
if (event == null) {
|
||||
this.a(world, l1, i2, k2, Block.LEAVES.id, 2);
|
||||
} else {
|
||||
@ -98,7 +98,7 @@ public class WorldGenForest extends WorldGenerator {
|
||||
leavesState.setData(new MaterialData(Block.LEAVES.id, (byte) 2));
|
||||
event.getBlocks().add(leavesState);
|
||||
}
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -107,7 +107,7 @@ public class WorldGenForest extends WorldGenerator {
|
||||
for (i2 = 0; i2 < l; ++i2) {
|
||||
j1 = world.getTypeId(i, j + i2, k);
|
||||
if (j1 == 0 || j1 == Block.LEAVES.id) {
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
if (event == null) {
|
||||
this.a(world, i, j + i2, k, Block.LOG.id, 2);
|
||||
} else {
|
||||
@ -116,10 +116,10 @@ public class WorldGenForest extends WorldGenerator {
|
||||
logState.setData(new MaterialData(Block.LOG.id, (byte) 2));
|
||||
event.getBlocks().add(logState);
|
||||
}
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
}
|
||||
}
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
if (event != null) {
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
@ -128,7 +128,7 @@ public class WorldGenForest extends WorldGenerator {
|
||||
}
|
||||
}
|
||||
}
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
@ -1,13 +1,13 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
import java.util.Random;
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.craftbukkit.CraftWorld;
|
||||
import org.bukkit.event.world.StructureGrowEvent;
|
||||
import org.bukkit.material.MaterialData;
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
|
||||
public class WorldGenHugeMushroom extends WorldGenerator {
|
||||
|
||||
@ -71,7 +71,7 @@ public class WorldGenHugeMushroom extends WorldGenerator {
|
||||
} else if (!Block.BROWN_MUSHROOM.canPlace(world, i, j, k)) {
|
||||
return false;
|
||||
} else {
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
if (event == null) {
|
||||
world.setRawTypeId(i, j - 1, k, Block.DIRT.id);
|
||||
} else {
|
||||
@ -79,7 +79,7 @@ public class WorldGenHugeMushroom extends WorldGenerator {
|
||||
dirtState.setTypeId(Block.DIRT.id);
|
||||
event.getBlocks().add(dirtState);
|
||||
}
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
int j2 = j + i1;
|
||||
|
||||
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)]) {
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
if (event == null) {
|
||||
world.setRawTypeIdAndData(i2, k1, k2, Block.BIG_MUSHROOM_1.id + l, l2);
|
||||
} else {
|
||||
@ -168,7 +168,7 @@ public class WorldGenHugeMushroom extends WorldGenerator {
|
||||
state.setData(new MaterialData(Block.BIG_MUSHROOM_1.id + l, (byte) l2));
|
||||
event.getBlocks().add(state);
|
||||
}
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -177,7 +177,7 @@ public class WorldGenHugeMushroom extends WorldGenerator {
|
||||
for (k1 = 0; k1 < i1; ++k1) {
|
||||
l1 = world.getTypeId(i, j + k1, k);
|
||||
if (!Block.o[l1]) {
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
if (event == null) {
|
||||
world.setRawTypeIdAndData(i, j + k1, k, Block.BIG_MUSHROOM_1.id + l, 10);
|
||||
} else {
|
||||
@ -186,10 +186,10 @@ public class WorldGenHugeMushroom extends WorldGenerator {
|
||||
state.setData(new MaterialData(Block.BIG_MUSHROOM_1.id + l, (byte) 10));
|
||||
event.getBlocks().add(state);
|
||||
}
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
}
|
||||
}
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
if (event != null) {
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
@ -198,7 +198,7 @@ public class WorldGenHugeMushroom extends WorldGenerator {
|
||||
}
|
||||
}
|
||||
}
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ public class WorldGenTaiga2 extends WorldGenerator {
|
||||
} else {
|
||||
l1 = world.getTypeId(i, j - 1, k);
|
||||
if ((l1 == Block.GRASS.id || l1 == Block.DIRT.id) && j < world.getHeight() - l - 1) { // CraftBukkit
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
if (event == null) {
|
||||
world.setRawTypeId(i, j - 1, k, Block.DIRT.id);
|
||||
} else {
|
||||
@ -76,7 +76,7 @@ public class WorldGenTaiga2 extends WorldGenerator {
|
||||
dirtState.setTypeId(Block.DIRT.id);
|
||||
event.getBlocks().add(dirtState);
|
||||
}
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
k2 = random.nextInt(2);
|
||||
i2 = 1;
|
||||
byte b0 = 0;
|
||||
@ -94,7 +94,7 @@ public class WorldGenTaiga2 extends WorldGenerator {
|
||||
int i4 = l3 - k;
|
||||
|
||||
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) {
|
||||
this.a(world, i3, j3, l3, Block.LEAVES.id, 1);
|
||||
} else {
|
||||
@ -103,7 +103,7 @@ public class WorldGenTaiga2 extends WorldGenerator {
|
||||
leavesState.setData(new MaterialData(Block.LEAVES.id, (byte) 1));
|
||||
event.getBlocks().add(leavesState);
|
||||
}
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -125,7 +125,7 @@ public class WorldGenTaiga2 extends WorldGenerator {
|
||||
for (j3 = 0; j3 < l - j2; ++j3) {
|
||||
i3 = world.getTypeId(i, j + j3, k);
|
||||
if (i3 == 0 || i3 == Block.LEAVES.id) {
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
if (event == null) {
|
||||
this.a(world, i, j + j3, k, Block.LOG.id, 1);
|
||||
} else {
|
||||
@ -134,10 +134,10 @@ public class WorldGenTaiga2 extends WorldGenerator {
|
||||
logState.setData(new MaterialData(Block.LOG.id, (byte) 1));
|
||||
event.getBlocks().add(logState);
|
||||
}
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
}
|
||||
}
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
if (event != null) {
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
@ -146,7 +146,7 @@ public class WorldGenTaiga2 extends WorldGenerator {
|
||||
}
|
||||
}
|
||||
}
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
@ -2,13 +2,13 @@ package net.minecraft.server;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
import org.bukkit.BlockChangeDelegate;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.craftbukkit.CraftWorld;
|
||||
import org.bukkit.event.world.StructureGrowEvent;
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
|
||||
public class WorldGenTrees extends WorldGenerator {
|
||||
|
||||
@ -66,7 +66,7 @@ public class WorldGenTrees extends WorldGenerator {
|
||||
} else {
|
||||
i1 = world.getTypeId(i, j - 1, k);
|
||||
if ((i1 == Block.GRASS.id || i1 == Block.DIRT.id) && j < world.getHeight() - l - 1) { // CraftBukkit
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
if (event == null) {
|
||||
world.setRawTypeId(i, j - 1, k, Block.DIRT.id);
|
||||
} else {
|
||||
@ -74,7 +74,7 @@ public class WorldGenTrees extends WorldGenerator {
|
||||
dirtState.setTypeId(Block.DIRT.id);
|
||||
event.getBlocks().add(dirtState);
|
||||
}
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
|
||||
int i2;
|
||||
|
||||
@ -89,7 +89,7 @@ public class WorldGenTrees extends WorldGenerator {
|
||||
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)]) {
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
if (event == null) {
|
||||
this.a(world, l1, i2, k2, Block.LEAVES.id, 0);
|
||||
} else {
|
||||
@ -97,7 +97,7 @@ public class WorldGenTrees extends WorldGenerator {
|
||||
leavesState.setTypeId(Block.LEAVES.id);
|
||||
event.getBlocks().add(leavesState);
|
||||
}
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -106,7 +106,7 @@ public class WorldGenTrees extends WorldGenerator {
|
||||
for (i2 = 0; i2 < l; ++i2) {
|
||||
j1 = world.getTypeId(i, j + i2, k);
|
||||
if (j1 == 0 || j1 == Block.LEAVES.id) {
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
if (event == null) {
|
||||
this.a(world, i, j + i2, k, Block.LOG.id, 0);
|
||||
} else {
|
||||
@ -114,10 +114,10 @@ public class WorldGenTrees extends WorldGenerator {
|
||||
logState.setTypeId(Block.LOG.id);
|
||||
event.getBlocks().add(logState);
|
||||
}
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
}
|
||||
}
|
||||
// Craftbukkit start
|
||||
// CraftBukkit start
|
||||
if (event != null) {
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
@ -126,7 +126,7 @@ public class WorldGenTrees extends WorldGenerator {
|
||||
}
|
||||
}
|
||||
}
|
||||
// Craftbukkit end
|
||||
// CraftBukkit end
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
@ -20,10 +20,10 @@ public abstract class WorldGenerator {
|
||||
|
||||
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) {
|
||||
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 {
|
||||
world.setRawTypeIdAndData(i, j, k, l, i1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user