Fixing event names

Dieser Commit ist enthalten in:
Erik Broes 2011-03-18 22:57:22 +01:00
Ursprung 4c420e6aa8
Commit 437025a179
10 geänderte Dateien mit 22 neuen und 21 gelöschten Zeilen

Datei anzeigen

@ -99,7 +99,7 @@ public class BlockFlowing extends BlockFluids {
if (this.l(world, i, j - 1, k)) { if (this.l(world, i, j - 1, k)) {
// CraftBukkit start - send "down" to the server // CraftBukkit start - send "down" to the server
BlockFromToEvent event = new BlockFromToEvent(Type.BLOCK_FLOW, source, BlockFace.DOWN); BlockFromToEvent event = new BlockFromToEvent(Type.BLOCK_FROMTO, source, BlockFace.DOWN);
if (server != null) { if (server != null) {
server.getPluginManager().callEvent(event); server.getPluginManager().callEvent(event);
} }
@ -129,7 +129,7 @@ public class BlockFlowing extends BlockFluids {
int index = 0; int index = 0;
for (BlockFace currentFace: faces) { for (BlockFace currentFace: faces) {
if (aboolean[index]) { if (aboolean[index]) {
BlockFromToEvent event = new BlockFromToEvent(Type.BLOCK_FLOW, source, currentFace); BlockFromToEvent event = new BlockFromToEvent(Type.BLOCK_FROMTO, source, currentFace);
if (server != null) { if (server != null) {
server.getPluginManager().callEvent(event); server.getPluginManager().callEvent(event);

Datei anzeigen

@ -81,7 +81,7 @@ public class ChunkProviderServer implements IChunkProvider {
* the World constructor. We can't reliably alter that, so we have * the World constructor. We can't reliably alter that, so we have
* no way of creating a CraftWorld/CraftServer at that point. * no way of creating a CraftWorld/CraftServer at that point.
*/ */
server.getPluginManager().callEvent(new ChunkLoadEvent(Type.CHUNK_LOADED, chunk.bukkitChunk)); server.getPluginManager().callEvent(new ChunkLoadEvent(Type.CHUNK_LOAD, chunk.bukkitChunk));
} }
// CraftBukkit end // CraftBukkit end
@ -212,7 +212,7 @@ public class ChunkProviderServer implements IChunkProvider {
Chunk chunk = e.get(chunkcoordinates); Chunk chunk = e.get(chunkcoordinates);
if (chunk == null) continue; if (chunk == null) continue;
ChunkUnloadEvent event = new ChunkUnloadEvent(Type.CHUNK_UNLOADED, chunk.bukkitChunk); ChunkUnloadEvent event = new ChunkUnloadEvent(Type.CHUNK_UNLOAD, chunk.bukkitChunk);
server.getPluginManager().callEvent(event); server.getPluginManager().callEvent(event);
if (!event.isCancelled()) { if (!event.isCancelled()) {
g.getWorld().preserveChunk( (CraftChunk) chunk.bukkitChunk ); g.getWorld().preserveChunk( (CraftChunk) chunk.bukkitChunk );

Datei anzeigen

@ -3,7 +3,7 @@ package net.minecraft.server;
// CraftBukkit start // CraftBukkit start
import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.craftbukkit.entity.CraftEntity; import org.bukkit.craftbukkit.entity.CraftEntity;
import org.bukkit.event.entity.ExplosionPrimedEvent; import org.bukkit.event.entity.ExplosionPrimeEvent;
// CraftBukkit end // CraftBukkit end
public class EntityCreeper extends EntityMonster { public class EntityCreeper extends EntityMonster {
@ -85,9 +85,9 @@ public class EntityCreeper extends EntityMonster {
if (this.a >= 30) { if (this.a >= 30) {
// CraftBukkit start // CraftBukkit start
CraftServer server = ((WorldServer) this.world).getServer(); CraftServer server = ((WorldServer) this.world).getServer();
org.bukkit.event.Event.Type eventType = ExplosionPrimedEvent.Type.EXPLOSION_PRIMED; org.bukkit.event.Event.Type eventType = ExplosionPrimeEvent.Type.EXPLOSION_PRIME;
ExplosionPrimedEvent event = new ExplosionPrimedEvent(eventType, CraftEntity.getEntity(server, this), 3.0F, false); ExplosionPrimeEvent event = new ExplosionPrimeEvent(eventType, CraftEntity.getEntity(server, this), 3.0F, false);
server.getPluginManager().callEvent(event); server.getPluginManager().callEvent(event);
if (!event.isCancelled()) { if (!event.isCancelled()) {

Datei anzeigen

@ -8,7 +8,7 @@ import org.bukkit.craftbukkit.entity.CraftEntity;
import org.bukkit.event.entity.EntityDamageByProjectileEvent; import org.bukkit.event.entity.EntityDamageByProjectileEvent;
import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.entity.ExplosionPrimedEvent; import org.bukkit.event.entity.ExplosionPrimeEvent;
// CraftBukkit end // CraftBukkit end
public class EntityFireball extends Entity { public class EntityFireball extends Entity {
@ -149,9 +149,9 @@ public class EntityFireball extends Entity {
} }
CraftServer server = ((WorldServer) this.world).getServer(); CraftServer server = ((WorldServer) this.world).getServer();
org.bukkit.event.Event.Type eventType = ExplosionPrimedEvent.Type.EXPLOSION_PRIMED; org.bukkit.event.Event.Type eventType = ExplosionPrimeEvent.Type.EXPLOSION_PRIME;
ExplosionPrimedEvent event = new ExplosionPrimedEvent(eventType, CraftEntity.getEntity(server, this), 1.0F, false); ExplosionPrimeEvent event = new ExplosionPrimeEvent(eventType, CraftEntity.getEntity(server, this), 1.0F, false);
server.getPluginManager().callEvent(event); server.getPluginManager().callEvent(event);
if (!event.isCancelled()) { if (!event.isCancelled()) {
// give 'this' instead of (Entity) null so we know what causes the damage // give 'this' instead of (Entity) null so we know what causes the damage

Datei anzeigen

@ -3,7 +3,7 @@ package net.minecraft.server;
// CraftBukkit start // CraftBukkit start
import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.craftbukkit.entity.CraftEntity; import org.bukkit.craftbukkit.entity.CraftEntity;
import org.bukkit.event.entity.ExplosionPrimedEvent; import org.bukkit.event.entity.ExplosionPrimeEvent;
// CraftBukkit end // CraftBukkit end
public class EntityTNTPrimed extends Entity { public class EntityTNTPrimed extends Entity {
@ -69,9 +69,9 @@ public class EntityTNTPrimed extends Entity {
// CraftBukkit start // CraftBukkit start
CraftServer server = ((WorldServer) this.world).getServer(); CraftServer server = ((WorldServer) this.world).getServer();
org.bukkit.event.Event.Type eventType = ExplosionPrimedEvent.Type.EXPLOSION_PRIMED; org.bukkit.event.Event.Type eventType = ExplosionPrimeEvent.Type.EXPLOSION_PRIME;
ExplosionPrimedEvent event = new ExplosionPrimedEvent(eventType, CraftEntity.getEntity(server, this), f, false); ExplosionPrimeEvent event = new ExplosionPrimeEvent(eventType, CraftEntity.getEntity(server, this), f, false);
server.getPluginManager().callEvent(event); server.getPluginManager().callEvent(event);
if (!event.isCancelled()) { if (!event.isCancelled()) {

Datei anzeigen

@ -91,7 +91,7 @@ public class ItemBlock extends Item {
*/ */
if (world.setTypeIdAndData(i, j, k, a, a(itemstack.h()))) { // <-- world.b does this to place the block if (world.setTypeIdAndData(i, j, k, a, a(itemstack.h()))) { // <-- world.b does this to place the block
org.bukkit.Server server = ((WorldServer) world).getServer(); org.bukkit.Server server = ((WorldServer) world).getServer();
Type eventType = Type.BLOCK_PLACED; Type eventType = Type.BLOCK_PLACE;
org.bukkit.inventory.ItemStack itemInHand = new CraftItemStack(itemstack); org.bukkit.inventory.ItemStack itemInHand = new CraftItemStack(itemstack);
Player thePlayer = (entityhuman == null) ? null : (Player) entityhuman.getBukkitEntity(); Player thePlayer = (entityhuman == null) ? null : (Player) entityhuman.getBukkitEntity();

Datei anzeigen

@ -10,6 +10,7 @@ import org.bukkit.entity.Player;
import org.bukkit.event.Event.Type; import org.bukkit.event.Event.Type;
import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.event.player.PlayerVegetationPlantEvent;
// CraftBukkit end // CraftBukkit end
public class ItemReed extends Item { public class ItemReed extends Item {
@ -91,7 +92,7 @@ public class ItemReed extends Item {
*/ */
if (world.setTypeId(i, j, k, this.a)) { // <-- world.e does this to place the block if (world.setTypeId(i, j, k, this.a)) { // <-- world.e does this to place the block
org.bukkit.Server server = ((WorldServer) world).getServer(); org.bukkit.Server server = ((WorldServer) world).getServer();
Type eventType = Type.BLOCK_PLACED; Type eventType = Type.BLOCK_PLACE;
org.bukkit.inventory.ItemStack itemInHand = new CraftItemStack(itemstack); org.bukkit.inventory.ItemStack itemInHand = new CraftItemStack(itemstack);
Player thePlayer = (entityhuman == null) ? null : (Player) entityhuman.getBukkitEntity(); Player thePlayer = (entityhuman == null) ? null : (Player) entityhuman.getBukkitEntity();

Datei anzeigen

@ -212,7 +212,7 @@ public class MinecraftServer implements Runnable, ICommandListener {
world.a(true, (IProgressUpdate) null); world.a(true, (IProgressUpdate) null);
world.r(); world.r();
WorldEvent event = new WorldEvent( Event.Type.WORLD_SAVED, world.getWorld() ); WorldEvent event = new WorldEvent( Event.Type.WORLD_SAVE, world.getWorld() );
server.getPluginManager().callEvent( event ); server.getPluginManager().callEvent( event );
} }

Datei anzeigen

@ -351,9 +351,9 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
if ((blockId == Block.REDSTONE_WIRE.id && block.getData() > 0) || blockId == Block.REDSTONE_TORCH_ON.id) { if ((blockId == Block.REDSTONE_WIRE.id && block.getData() > 0) || blockId == Block.REDSTONE_TORCH_ON.id) {
server.getPluginManager().callEvent( new BlockRedstoneEvent(block, (blockId == Block.REDSTONE_WIRE.id ? block.getData() : 15), 0)); server.getPluginManager().callEvent( new BlockRedstoneEvent(block, (blockId == Block.REDSTONE_WIRE.id ? block.getData() : 15), 0));
} }
event = new BlockDamageEvent(Type.BLOCK_DAMAGED, block, BlockDamageLevel.BROKEN, player); event = new BlockDamageEvent(Type.BLOCK_DAMAGE, block, BlockDamageLevel.BROKEN, player);
} else { } else {
event = new BlockDamageEvent(Type.BLOCK_DAMAGED, block, BlockDamageLevel.STARTED, player); event = new BlockDamageEvent(Type.BLOCK_DAMAGE, block, BlockDamageLevel.STARTED, player);
} }
server.getPluginManager().callEvent(event); server.getPluginManager().callEvent(event);
if (!event.isCancelled()) { if (!event.isCancelled()) {
@ -364,7 +364,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
// CraftBukkit start - Get last block that the player hit // CraftBukkit start - Get last block that the player hit
// Otherwise the block is a Bedrock @(0,0,0) // Otherwise the block is a Bedrock @(0,0,0)
block = (CraftBlock) player.getWorld().getBlockAt(lastX, lastY, lastZ); block = (CraftBlock) player.getWorld().getBlockAt(lastX, lastY, lastZ);
BlockDamageEvent event = new BlockDamageEvent(Type.BLOCK_DAMAGED, block, BlockDamageLevel.STOPPED, player); BlockDamageEvent event = new BlockDamageEvent(Type.BLOCK_DAMAGE, block, BlockDamageLevel.STOPPED, player);
server.getPluginManager().callEvent(event); server.getPluginManager().callEvent(event);
if (!event.isCancelled()) { if (!event.isCancelled()) {
this.e.c.b(i, j, k); this.e.c.b(i, j, k);
@ -489,7 +489,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
} }
CraftItemStack craftItem = new CraftItemStack(itemstack); CraftItemStack craftItem = new CraftItemStack(itemstack);
Player player = getPlayer(); Player player = getPlayer();
BlockRightClickEvent event = new BlockRightClickEvent(Type.BLOCK_RIGHTCLICKED, blockClicked, blockFace, craftItem, player); BlockRightClickEvent event = new BlockRightClickEvent(Type.BLOCK_RIGHTCLICK, blockClicked, blockFace, craftItem, player);
server.getPluginManager().callEvent(event); server.getPluginManager().callEvent(event);
this.e.c.a(this.e, this.e.world, itemstack, i, j, k, l); this.e.c.a(this.e, this.e.world, itemstack, i, j, k, l);

Datei anzeigen

@ -332,7 +332,7 @@ public final class CraftServer implements Server {
protected void addWorld(World world) { protected void addWorld(World world) {
worlds.put(world.getName().toLowerCase(), world); worlds.put(world.getName().toLowerCase(), world);
pluginManager.callEvent(new WorldEvent(Type.WORLD_LOADED, world)); pluginManager.callEvent(new WorldEvent(Type.WORLD_LOAD, world));
} }
public Logger getLogger() { public Logger getLogger() {