Generic cleanup/reformat.

This commit is contained in:
Erik Broes
2011-02-02 00:32:18 +01:00
parent 001a45804e
commit 04be2b9b31
32 changed files with 83 additions and 99 deletions

View File

@@ -69,14 +69,14 @@ public class BlockDispenser extends BlockContainer {
CraftBlock block = (CraftBlock) craftWorld.getBlockAt(i, j, k);
LivingEntity who = (entityhuman == null)?null:(LivingEntity)entityhuman.getBukkitEntity();
BlockInteractEvent bie = new BlockInteractEvent(eventType, block, who);
server.getPluginManager().callEvent(bie);
BlockInteractEvent event = new BlockInteractEvent(eventType, block, who);
server.getPluginManager().callEvent(event);
if (bie.isCancelled()) {
if (event.isCancelled()) {
return true;
}
// CraftBukkit end
TileEntityDispenser tileentitydispenser = (TileEntityDispenser) world.getTileEntity(i, j, k);
entityhuman.a(tileentitydispenser);
@@ -196,4 +196,4 @@ public class BlockDispenser extends BlockContainer {
world.c(i, j, k, 4);
}
}
}
}

View File

@@ -113,7 +113,7 @@ public class BlockFire extends Block {
}
}
}
// Craftbukkit start - won't be needed next port hopefully
if(l == 15) {
this.a(world, i + 1, j, k, 1, random);
@@ -131,13 +131,13 @@ public class BlockFire extends Block {
if (random.nextInt(l) < i1) {
boolean flag = world.getTypeId(i, j, k) == Block.TNT.id;
// CraftBukkit start: BlockBurnEvent
// CraftBukkit start
Server server = ((WorldServer)world).getServer();
CraftWorld cworld = ((WorldServer)world).getWorld();
org.bukkit.block.Block theBlock = (cworld.getBlockAt(i, j, k));
BlockBurnEvent burnEvent = new BlockBurnEvent(theBlock);
server.getPluginManager().callEvent(burnEvent);
if(!burnEvent.isCancelled()) {
BlockBurnEvent event = new BlockBurnEvent(theBlock);
server.getPluginManager().callEvent(event);
if(!event.isCancelled()) {
if (random.nextInt(2) == 0) {
world.e(i, j, k, this.id);
} else {
@@ -148,7 +148,7 @@ public class BlockFire extends Block {
Block.TNT.a(world, i, j, k, 0);
}
}
// CraftBukkit end: BlockBurnEvent
// CraftBukkit end
}
}

View File

@@ -79,7 +79,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public void f(Entity entity) {
// Craftbukkit start
List<org.bukkit.inventory.ItemStack> loot = new ArrayList<org.bukkit.inventory.ItemStack>();
for (int i = 0; i < inventory.a.length; ++i) {
if (inventory.a[i] != null) {
loot.add(new CraftItemStack(inventory.a[i]));

View File

@@ -65,7 +65,7 @@ public class ItemBlock extends Item {
return false;
} else {
// CraftBukkit start
/* We store the old data so we can undo it. Snow(78) and half-steps(44) are special in that they replace the block itself,
/* We store the old data so we can undo it. Snow(78) and half-steps(44) are special in that they replace the block itself,
* rather than the block touching the face we clicked on.
*/
org.bukkit.block.Block replacedBlock = (blockClicked.getTypeId() == Block.SNOW.id || blockClicked.getTypeId() == Block.STEP.id) ? blockClicked:blockClicked.getFace(faceClicked);

View File

@@ -29,7 +29,7 @@ public class ItemSign extends Item {
CraftWorld craftWorld = ((WorldServer) world).getWorld();
CraftServer craftServer = ((WorldServer) world).getServer();
org.bukkit.block.Block blockClicked = craftWorld.getBlockAt(i, j, k);
//CraftBukkit end
// CraftBukkit end
if (l == 1) {
++j;

View File

@@ -167,7 +167,7 @@ public class MinecraftServer implements ICommandListener, Runnable {
if(server != null) {
server.disablePlugins();
}
if (this.f != null) {
this.f.d();
}

View File

@@ -427,7 +427,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
Player who = (this.e == null) ? null : (Player) this.e.getBukkitEntity();
org.bukkit.inventory.ItemStack itemInHand = new CraftItemStack(itemstack);
PlayerItemEvent event = new PlayerItemEvent(eventType, who, itemInHand, blockClicked, blockFace);
PlayerItemEvent event = new PlayerItemEvent(eventType, who, itemInHand, blockClicked, blockFace);
// CraftBukkit We still call this event even in spawn protection.
// Don't call this event if using Buckets / signs

View File

@@ -2,9 +2,9 @@ package net.minecraft.server;
import java.util.Random;
//CraftBukkit start
// CraftBukkit start
import org.bukkit.BlockChangeDelegate;
//CraftBukkit end
// CraftBukkit end
public class WorldGenBigTree extends WorldGenerator {
@@ -346,7 +346,7 @@ public class WorldGenBigTree extends WorldGenerator {
// then allows plugins to catch manually-invoked generation events
return generate((BlockChangeDelegate)world, random, i, j, k);
}
public boolean generate(BlockChangeDelegate world, Random random, int i, int j, int k) {
// CraftBukkit end
this.c = world;

View File

@@ -2,9 +2,9 @@ package net.minecraft.server;
import java.util.Random;
//CraftBukkit start
// CraftBukkit start
import org.bukkit.BlockChangeDelegate;
//CraftBukkit end
// CraftBukkit end
public class WorldGenForest extends WorldGenerator {
@@ -18,7 +18,7 @@ public class WorldGenForest extends WorldGenerator {
// then allows plugins to catch manually-invoked generation events
return generate((BlockChangeDelegate)world, random, i, j, k);
}
public boolean generate(BlockChangeDelegate world, Random random, int i, int j, int k) {
// CraftBukkit end
int l = random.nextInt(3) + 5;

View File

@@ -2,9 +2,9 @@ package net.minecraft.server;
import java.util.Random;
//CraftBukkit start
// CraftBukkit start
import org.bukkit.BlockChangeDelegate;
//CraftBukkit end
// CraftBukkit end
public class WorldGenTaiga1 extends WorldGenerator {
@@ -18,7 +18,7 @@ public class WorldGenTaiga1 extends WorldGenerator {
// then allows plugins to catch manually-invoked generation events
return generate((BlockChangeDelegate)world, random, i, j, k);
}
public boolean generate(BlockChangeDelegate world, Random random, int i, int j, int k) {
// CraftBukkit end
int l = random.nextInt(5) + 7;

View File

@@ -2,9 +2,9 @@ package net.minecraft.server;
import java.util.Random;
//CraftBukkit start
// CraftBukkit start
import org.bukkit.BlockChangeDelegate;
//CraftBukkit end
// CraftBukkit end
public class WorldGenTaiga2 extends WorldGenerator {
@@ -18,7 +18,7 @@ public class WorldGenTaiga2 extends WorldGenerator {
// then allows plugins to catch manually-invoked generation events
return generate((BlockChangeDelegate)world, random, i, j, k);
}
public boolean generate(BlockChangeDelegate world, Random random, int i, int j, int k) {
// CraftBukkit end
int l = random.nextInt(4) + 6;