From 8c8f53fd44de8f4d471131abf931cf372f820bce Mon Sep 17 00:00:00 2001 From: Erik Broes Date: Sat, 15 Jan 2011 21:26:05 +0100 Subject: [PATCH] Events should be present tense, not paste tense. --- .../net/minecraft/server/BlockCactus.java | 6 +++--- .../minecraft/server/ChunkProviderServer.java | 4 ++-- .../java/net/minecraft/server/Entity.java | 4 ++-- .../java/net/minecraft/server/Explosion.java | 10 +++++----- .../java/net/minecraft/server/ItemBlock.java | 4 ++-- .../minecraft/server/NetServerHandler.java | 20 +++++++++---------- .../org/bukkit/craftbukkit/CraftWorld.java | 0 7 files changed, 24 insertions(+), 24 deletions(-) mode change 100755 => 100644 src/main/java/org/bukkit/craftbukkit/CraftWorld.java diff --git a/src/main/java/net/minecraft/server/BlockCactus.java b/src/main/java/net/minecraft/server/BlockCactus.java index 820849f2cd..569c5be944 100644 --- a/src/main/java/net/minecraft/server/BlockCactus.java +++ b/src/main/java/net/minecraft/server/BlockCactus.java @@ -6,8 +6,8 @@ import org.bukkit.craftbukkit.CraftBlock; import org.bukkit.craftbukkit.CraftEntity; import org.bukkit.craftbukkit.CraftLivingEntity; import org.bukkit.craftbukkit.CraftPlayer; -import org.bukkit.event.entity.EntityDamagedByBlockEvent; -import org.bukkit.event.entity.EntityDamagedEvent; +import org.bukkit.event.entity.EntityDamageByBlockEvent; +import org.bukkit.event.entity.EntityDamageEvent; // CraftBukkit end import java.util.Random; @@ -104,7 +104,7 @@ public class BlockCactus extends Block { } if(toPassIn != null) { - EntityDamagedByBlockEvent edbbe = new EntityDamagedByBlockEvent(((WorldServer) world).getWorld().getBlockAt(i, j, k), toPassIn, EntityDamagedEvent.DamageCause.CONTACT, 1); + EntityDamageByBlockEvent edbbe = new EntityDamageByBlockEvent(((WorldServer) world).getWorld().getBlockAt(i, j, k), toPassIn, EntityDamageEvent.DamageCause.CONTACT, 1); ((WorldServer) world).getServer().getPluginManager().callEvent(edbbe); if (edbbe.isCancelled()) diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java index 60516dac77..9972786234 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -8,7 +8,7 @@ import org.bukkit.craftbukkit.CraftChunk; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.event.Event.Type; -import org.bukkit.event.world.ChunkLoadedEvent; +import org.bukkit.event.world.ChunkLoadEvent; // CraftBukkit end public class ChunkProviderServer implements IChunkProvider { @@ -79,7 +79,7 @@ public class ChunkProviderServer implements IChunkProvider { */ CraftWorld world = g.getWorld(); CraftChunk cchunk = world.updateChunk(i, j); - server.getPluginManager().callEvent(new ChunkLoadedEvent(Type.CHUNK_LOADED, cchunk)); + server.getPluginManager().callEvent(new ChunkLoadEvent(Type.CHUNK_LOADED, cchunk)); } // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java index 1ee40687ec..75f53ac2bb 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -5,7 +5,7 @@ import org.bukkit.craftbukkit.CraftEntity; import org.bukkit.craftbukkit.CraftLivingEntity; import org.bukkit.craftbukkit.CraftPlayer; import org.bukkit.craftbukkit.CraftServer; -import org.bukkit.event.entity.EntityDamagedEvent; +import org.bukkit.event.entity.EntityDamageEvent; // CraftBukkit end import java.util.List; @@ -476,7 +476,7 @@ public abstract class Entity { defender = new CraftLivingEntity(server, (EntityLiving)this); } - EntityDamagedEvent ede = new EntityDamagedEvent(defender, EntityDamagedEvent.DamageCause.FIRE, i1); + EntityDamageEvent ede = new EntityDamageEvent(defender, EntityDamageEvent.DamageCause.FIRE, i1); server.getPluginManager().callEvent(ede); if (ede.isCancelled()) return; diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java index 3bf4358ceb..87abf71ce4 100644 --- a/src/main/java/net/minecraft/server/Explosion.java +++ b/src/main/java/net/minecraft/server/Explosion.java @@ -5,9 +5,9 @@ import org.bukkit.craftbukkit.CraftEntity; import org.bukkit.craftbukkit.CraftLivingEntity; import org.bukkit.craftbukkit.CraftPlayer; import org.bukkit.craftbukkit.CraftServer; -import org.bukkit.event.entity.EntityDamagedByBlockEvent; -import org.bukkit.event.entity.EntityDamagedByEntityEvent; -import org.bukkit.event.entity.EntityDamagedEvent; +import org.bukkit.event.entity.EntityDamageByBlockEvent; +import org.bukkit.event.entity.EntityDamageByEntityEvent; +import org.bukkit.event.entity.EntityDamageEvent; // CraftBukkit end import java.util.*; @@ -123,7 +123,7 @@ public class Explosion { if (e == null) { // Block explosion // Craftbukkit TODO: get the x/y/z of the tnt block? - EntityDamagedByBlockEvent edbbe = new EntityDamagedByBlockEvent(null, damagee, EntityDamagedEvent.DamageCause.BLOCK_EXPLOSION, damage); + EntityDamageByBlockEvent edbbe = new EntityDamageByBlockEvent(null, damagee, EntityDamageEvent.DamageCause.BLOCK_EXPLOSION, damage); servr.getPluginManager().callEvent(edbbe); if(!edbbe.isCancelled()) entity.a(e, damage); } else { @@ -134,7 +134,7 @@ public class Explosion { } else if (e instanceof EntityLiving) { damager = new CraftLivingEntity(servr, (EntityLiving) e); } - EntityDamagedByEntityEvent edbbe = new EntityDamagedByEntityEvent(damager, damagee, EntityDamagedEvent.DamageCause.ENTITY_EXPLOSION, damage); + EntityDamageByEntityEvent edbbe = new EntityDamageByEntityEvent(damager, damagee, EntityDamageEvent.DamageCause.ENTITY_EXPLOSION, damage); servr.getPluginManager().callEvent(edbbe); if (!edbbe.isCancelled()) { diff --git a/src/main/java/net/minecraft/server/ItemBlock.java b/src/main/java/net/minecraft/server/ItemBlock.java index 9a08c2dada..7fa6380863 100644 --- a/src/main/java/net/minecraft/server/ItemBlock.java +++ b/src/main/java/net/minecraft/server/ItemBlock.java @@ -6,7 +6,7 @@ import org.bukkit.craftbukkit.CraftBlock; import org.bukkit.craftbukkit.CraftItemStack; import org.bukkit.craftbukkit.CraftPlayer; import org.bukkit.event.Event.Type; -import org.bukkit.event.block.BlockPlacedEvent; +import org.bukkit.event.block.BlockPlaceEvent; // CraftBukkit end public class ItemBlock extends Item { @@ -81,7 +81,7 @@ public class ItemBlock extends Item { // CraftBukkit hardcoded Spawn distance for now boolean canBuild = distanceFromSpawn > 16 || thePlayer.isOp(); - BlockPlacedEvent bpe = new BlockPlacedEvent(Type.BLOCK_PLACED, placedBlock, blockClicked, itemInHand, thePlayer, canBuild); + BlockPlaceEvent bpe = new BlockPlaceEvent(Type.BLOCK_PLACED, placedBlock, blockClicked, itemInHand, thePlayer, canBuild); ((WorldServer) world).getServer().getPluginManager().callEvent(bpe); if (bpe.isCancelled() || !bpe.canBuild()) { diff --git a/src/main/java/net/minecraft/server/NetServerHandler.java b/src/main/java/net/minecraft/server/NetServerHandler.java index 326132834e..a1f3a9bc7c 100644 --- a/src/main/java/net/minecraft/server/NetServerHandler.java +++ b/src/main/java/net/minecraft/server/NetServerHandler.java @@ -13,8 +13,8 @@ import org.bukkit.craftbukkit.CraftItemStack; import org.bukkit.craftbukkit.CraftPlayer; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.event.Event.Type; -import org.bukkit.event.block.BlockDamagedEvent; -import org.bukkit.event.block.BlockRightClickedEvent; +import org.bukkit.event.block.BlockDamageEvent; +import org.bukkit.event.block.BlockRightClickEvent; import org.bukkit.event.player.PlayerChatEvent; import org.bukkit.event.player.PlayerItemEvent; import org.bukkit.event.player.PlayerMoveEvent; @@ -291,13 +291,13 @@ public class NetServerHandler extends NetHandler implements ICommandListener { if (packet14blockdig.e == 0) { if (i2 > 16 || flag) { if(blockId > 0) { - BlockDamagedEvent event; + BlockDamageEvent event; // If the amount of damage that the player is going to do to the block // is >= 1, then the block is going to break (eg, flowers, torches) if (damage >= 1.0F) { - event = new BlockDamagedEvent(Type.BLOCK_DAMAGED, block, BlockDamageLevel.BROKEN, player); + event = new BlockDamageEvent(Type.BLOCK_DAMAGED, block, BlockDamageLevel.BROKEN, player); } else { - event = new BlockDamagedEvent(Type.BLOCK_DAMAGED, block, BlockDamageLevel.STARTED, player); + event = new BlockDamageEvent(Type.BLOCK_DAMAGED, block, BlockDamageLevel.STARTED, player); } server.getPluginManager().callEvent(event); if (!event.isCancelled()) { @@ -309,7 +309,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener { // CraftBukkit start - Get last block that the player hit // Otherwise the block is a Bedrock @(0,0,0) block = (CraftBlock) player.getWorld().getBlockAt(lastX, lastY, lastZ); - BlockDamagedEvent event = new BlockDamagedEvent(Type.BLOCK_DAMAGED, block, BlockDamageLevel.STOPPED, player); + BlockDamageEvent event = new BlockDamageEvent(Type.BLOCK_DAMAGED, block, BlockDamageLevel.STOPPED, player); server.getPluginManager().callEvent(event); if (!event.isCancelled()) { e.c.a(); @@ -318,13 +318,13 @@ public class NetServerHandler extends NetHandler implements ICommandListener { } else if (packet14blockdig.e == 1) { if (i2 > 16 || flag) { // CraftBukkit start - BlockDamagedEvent event; + BlockDamageEvent event; // If the amount of damage going to the block plus the current amount // of damage is greater than 1, the block is going to break. if (e.c.d + damage >= 1.0F) { - event = new BlockDamagedEvent(Type.BLOCK_DAMAGED, block, BlockDamageLevel.BROKEN, player); + event = new BlockDamageEvent(Type.BLOCK_DAMAGED, block, BlockDamageLevel.BROKEN, player); } else { - event = new BlockDamagedEvent(Type.BLOCK_DAMAGED, block, BlockDamageLevel.DIGGING, player); + event = new BlockDamageEvent(Type.BLOCK_DAMAGED, block, BlockDamageLevel.DIGGING, player); } server.getPluginManager().callEvent(event); if (!event.isCancelled()) { @@ -439,7 +439,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener { // CraftBukkit start - spawn proection moved to ItemBlock!!! CraftItemStack craftItem = new CraftItemStack(itemstack); CraftPlayer player = new CraftPlayer(server, e); - BlockRightClickedEvent brce = new BlockRightClickedEvent(Type.BLOCK_RIGHTCLICKED, blockClicked, blockFace, craftItem, player); + BlockRightClickEvent brce = new BlockRightClickEvent(Type.BLOCK_RIGHTCLICKED, blockClicked, blockFace, craftItem, player); server.getPluginManager().callEvent(brce); e.c.a(((EntityPlayer) (e)), ((World) (d.e)), itemstack, l, i1, j1, k1); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java old mode 100755 new mode 100644