1
0
Fork 0
mirror of https://github.com/PaperMC/Paper.git synced 2025-02-23 13:08:32 +01:00

Events should be present tense, not paste tense.

By: Erik Broes <erikbroes@grum.nl>
This commit is contained in:
Bukkit/Spigot 2011-01-15 21:23:53 +01:00
parent 965b8731e1
commit 3a76f4d8dd
14 changed files with 43 additions and 43 deletions

0
paper-api/src/main/java/org/bukkit/World.java Executable file → Normal file
View file

View file

@ -214,7 +214,7 @@ public abstract class Event {
/** /**
* Called when a block is damaged (hit by a player) * Called when a block is damaged (hit by a player)
* *
* @see org.bukkit.event.block.BlockDamagedEvent * @see org.bukkit.event.block.BlockDamageEvent
*/ */
BLOCK_DAMAGED (Category.BLOCK), BLOCK_DAMAGED (Category.BLOCK),
@ -257,14 +257,14 @@ public abstract class Event {
/** /**
* Called when a player is attempting to place a block * Called when a player is attempting to place a block
* *
* @see org.bukkit.event.block.BlockRightClickedEvent * @see org.bukkit.event.block.BlockRightClickeEvent
*/ */
BLOCK_RIGHTCLICKED (Category.BLOCK), BLOCK_RIGHTCLICKED (Category.BLOCK),
/** /**
* Called when a player is attempting to place a block * Called when a player is attempting to place a block
* *
* @see org.bukkit.event.block.BlockPlacedEvent * @see org.bukkit.event.block.BlockPlaceEvent
*/ */
BLOCK_PLACED (Category.BLOCK), BLOCK_PLACED (Category.BLOCK),
@ -366,14 +366,14 @@ public abstract class Event {
* If a new chunk is being generated for loading, it will call * If a new chunk is being generated for loading, it will call
* Type.CHUNK_GENERATION and then Type.CHUNK_LOADED upon completion * Type.CHUNK_GENERATION and then Type.CHUNK_LOADED upon completion
* *
* @see org.bukkit.event.world.ChunkLoadedEvent * @see org.bukkit.event.world.ChunkLoadeEvent
*/ */
CHUNK_LOADED (Category.WORLD), CHUNK_LOADED (Category.WORLD),
/** /**
* Called when a chunk is unloaded * Called when a chunk is unloaded
* *
* @see org.bukkit.event.world.ChunkUnloadedEvent * @see org.bukkit.event.world.ChunkUnloadeEvent
*/ */
CHUNK_UNLOADED (Category.WORLD), CHUNK_UNLOADED (Category.WORLD),
@ -407,21 +407,21 @@ public abstract class Event {
* Called when a LivingEntity is damaged by the environment (for example, * Called when a LivingEntity is damaged by the environment (for example,
* falling or lava) * falling or lava)
* *
* @see org.bukkit.event.entity.EntityDamagedByBlockEvent * @see org.bukkit.event.entity.EntityDamageByBlockEvent
*/ */
ENTITY_DAMAGEDBY_BLOCK (Category.LIVING_ENTITY), ENTITY_DAMAGEDBY_BLOCK (Category.LIVING_ENTITY),
/** /**
* Called when a LivingEntity is damaged by another LivingEntity * Called when a LivingEntity is damaged by another LivingEntity
* *
* @see org.bukkit.event.entity.EntityDamagedByEntityEvent * @see org.bukkit.event.entity.EntityDamageByEntityEvent
*/ */
ENTITY_DAMAGEDBY_ENTITY (Category.LIVING_ENTITY), ENTITY_DAMAGEDBY_ENTITY (Category.LIVING_ENTITY),
/** /**
* Called when a LivingEntity is damaged with no source. * Called when a LivingEntity is damaged with no source.
* *
* @see org.bukkit.event.entity.EntityDamagedEvent * @see org.bukkit.event.entity.EntityDamageEvent
*/ */
ENTITY_DAMAGED(Category.LIVING_ENTITY), ENTITY_DAMAGED(Category.LIVING_ENTITY),

View file

@ -8,12 +8,12 @@ import org.bukkit.event.Cancellable;
/** /**
* @author tkelly * @author tkelly
*/ */
public class BlockDamagedEvent extends BlockEvent implements Cancellable { public class BlockDamageEvent extends BlockEvent implements Cancellable {
private Player player; private Player player;
private BlockDamageLevel damageLevel; private BlockDamageLevel damageLevel;
private boolean cancel; private boolean cancel;
public BlockDamagedEvent(Type type, Block block, BlockDamageLevel level, Player player) { public BlockDamageEvent(Type type, Block block, BlockDamageLevel level, Player player) {
super(type, block); super(type, block);
this.damageLevel = level; this.damageLevel = level;
this.player = player; this.player = player;

View file

@ -19,7 +19,7 @@ public class BlockListener implements Listener {
* *
* @param event Relevant event details * @param event Relevant event details
*/ */
public void onBlockDamaged(BlockDamagedEvent event) { public void onBlockDamaged(BlockDamageEvent event) {
} }
/** /**
@ -57,7 +57,7 @@ public class BlockListener implements Listener {
* *
* @param event Relevant event details * @param event Relevant event details
*/ */
public void onBlockPlaced(BlockPlacedEvent event) { public void onBlockPlaced(BlockPlaceEvent event) {
} }
/** /**
@ -73,7 +73,7 @@ public class BlockListener implements Listener {
* *
* @param event Relevant event details * @param event Relevant event details
*/ */
public void onBlockRightClicked(BlockRightClickedEvent event) { public void onBlockRightClicked(BlockRightClickEvent event) {
} }
/** /**

View file

@ -8,14 +8,14 @@ import org.bukkit.event.Cancellable;
/** /**
* Not implemented yet * Not implemented yet
*/ */
public class BlockPlacedEvent extends BlockEvent implements Cancellable { public class BlockPlaceEvent extends BlockEvent implements Cancellable {
protected boolean cancel; protected boolean cancel;
protected boolean canBuild; protected boolean canBuild;
protected Block placedAgainst; protected Block placedAgainst;
protected ItemStack itemInHand; protected ItemStack itemInHand;
protected Player player; protected Player player;
public BlockPlacedEvent(Type type, Block placedBlock, Block placedAgainst, ItemStack itemInHand, Player thePlayer, boolean canBuild) { public BlockPlaceEvent(Type type, Block placedBlock, Block placedAgainst, ItemStack itemInHand, Player thePlayer, boolean canBuild) {
super(type, placedBlock); super(type, placedBlock);
this.placedAgainst = placedAgainst; this.placedAgainst = placedAgainst;
this.itemInHand = itemInHand; this.itemInHand = itemInHand;

View file

@ -8,13 +8,13 @@ import org.bukkit.Player;
/** /**
* Not implemented yet * Not implemented yet
*/ */
public class BlockRightClickedEvent extends BlockEvent { public class BlockRightClickEvent extends BlockEvent {
protected Block clickedBlock; protected Block clickedBlock;
protected BlockFace direction; protected BlockFace direction;
protected ItemStack itemInHand; protected ItemStack itemInHand;
protected Player player; protected Player player;
public BlockRightClickedEvent(Type type, Block placedAgainst, BlockFace direction, ItemStack itemInHand, Player thePlayer) { public BlockRightClickEvent(Type type, Block placedAgainst, BlockFace direction, ItemStack itemInHand, Player thePlayer) {
super(type, placedAgainst); super(type, placedAgainst);
this.clickedBlock = placedAgainst; this.clickedBlock = placedAgainst;
this.direction = direction; this.direction = direction;

View file

@ -8,11 +8,11 @@ import org.bukkit.event.Event;
/** /**
* Stores details for damage events where the damager is a block * Stores details for damage events where the damager is a block
*/ */
public class EntityDamagedByBlockEvent extends EntityDamagedEvent implements Cancellable { public class EntityDamageByBlockEvent extends EntityDamageEvent implements Cancellable {
private Block damager; private Block damager;
public EntityDamagedByBlockEvent(Block damager, Entity damagee, DamageCause cause, int damage) public EntityDamageByBlockEvent(Block damager, Entity damagee, DamageCause cause, int damage)
{ {
super(Event.Type.ENTITY_DAMAGEDBY_BLOCK, damagee, cause, damage); super(Event.Type.ENTITY_DAMAGEDBY_BLOCK, damagee, cause, damage);
this.damager = damager; this.damager = damager;

View file

@ -7,11 +7,11 @@ import org.bukkit.event.Event;
/** /**
* Stores details for damage events where the damager is a block * Stores details for damage events where the damager is a block
*/ */
public class EntityDamagedByEntityEvent extends EntityDamagedEvent implements Cancellable { public class EntityDamageByEntityEvent extends EntityDamageEvent implements Cancellable {
private Entity damager; private Entity damager;
public EntityDamagedByEntityEvent(Entity damager, Entity damagee, DamageCause cause, int damage) public EntityDamageByEntityEvent(Entity damager, Entity damagee, DamageCause cause, int damage)
{ {
super(Event.Type.ENTITY_DAMAGEDBY_ENTITY, damagee, cause, damage); super(Event.Type.ENTITY_DAMAGEDBY_ENTITY, damagee, cause, damage);
this.damager = damager; this.damager = damager;

View file

@ -7,20 +7,20 @@ import org.bukkit.event.Event;
/** /**
* Stores data for damage events * Stores data for damage events
*/ */
public class EntityDamagedEvent extends EntityEvent implements Cancellable { public class EntityDamageEvent extends EntityEvent implements Cancellable {
private int damage; private int damage;
private boolean cancelled; private boolean cancelled;
private DamageCause cause; private DamageCause cause;
public EntityDamagedEvent(Entity damagee, DamageCause cause, int damage) public EntityDamageEvent(Entity damagee, DamageCause cause, int damage)
{ {
super(Event.Type.ENTITY_DAMAGED, damagee); super(Event.Type.ENTITY_DAMAGED, damagee);
this.cause = cause; this.cause = cause;
this.damage = damage; this.damage = damage;
} }
protected EntityDamagedEvent(Event.Type type, Entity damagee, DamageCause cause, int damage) protected EntityDamageEvent(Event.Type type, Entity damagee, DamageCause cause, int damage)
{ {
super(type, damagee); super(type, damagee);
this.cause = cause; this.cause = cause;

View file

@ -9,10 +9,10 @@ public class EntityListener implements Listener {
public EntityListener() { public EntityListener() {
} }
public void onEntityDamagedByBlock(EntityDamagedByBlockEvent event) { public void onEntityDamageByBlock(EntityDamageByBlockEvent event) {
} }
public void onEntityDamagedByEntity(EntityDamagedByEntityEvent event) { public void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
} }
public void onEntityCombust(EntityCombustEvent event) { public void onEntityCombust(EntityCombustEvent event) {

View file

@ -6,10 +6,10 @@ import org.bukkit.Chunk;
/** /**
* Called when a chunk is loaded * Called when a chunk is loaded
*/ */
public class ChunkLoadedEvent extends WorldEvent { public class ChunkLoadEvent extends WorldEvent {
private final Chunk chunk; private final Chunk chunk;
public ChunkLoadedEvent(final Type type, final Chunk chunk) { public ChunkLoadEvent(final Type type, final Chunk chunk) {
super(type, chunk.getWorld()); super(type, chunk.getWorld());
this.chunk = chunk; this.chunk = chunk;

View file

@ -7,10 +7,10 @@ import org.bukkit.event.Cancellable;
/** /**
* Called when a chunk is unloaded * Called when a chunk is unloaded
*/ */
public class ChunkUnloadedEvent extends ChunkLoadedEvent implements Cancellable { public class ChunkUnloadEvent extends ChunkLoadEvent implements Cancellable {
private boolean cancel = false; private boolean cancel = false;
public ChunkUnloadedEvent(final Type type, final Chunk chunk) { public ChunkUnloadEvent(final Type type, final Chunk chunk) {
super(type, chunk); super(type, chunk);
} }

View file

@ -12,7 +12,7 @@ public class WorldListener implements Listener {
* *
* @param event Relevant event details * @param event Relevant event details
*/ */
public void onChunkLoaded(ChunkLoadedEvent event) { public void onChunkLoaded(ChunkLoadEvent event) {
} }
/** /**
@ -20,6 +20,6 @@ public class WorldListener implements Listener {
* *
* @param event Relevant event details * @param event Relevant event details
*/ */
public void onChunkUnloaded(ChunkUnloadedEvent event) { public void onChunkUnloaded(ChunkUnloadEvent event) {
} }
} }

View file

@ -19,15 +19,15 @@ import org.bukkit.event.Event;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
import org.bukkit.event.block.*; import org.bukkit.event.block.*;
import org.bukkit.event.entity.EntityCombustEvent; import org.bukkit.event.entity.EntityCombustEvent;
import org.bukkit.event.entity.EntityDamagedByBlockEvent; import org.bukkit.event.entity.EntityDamageByBlockEvent;
import org.bukkit.event.entity.EntityDamagedByEntityEvent; import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityListener; import org.bukkit.event.entity.EntityListener;
import org.bukkit.event.player.*; import org.bukkit.event.player.*;
import org.bukkit.event.server.PluginEvent; import org.bukkit.event.server.PluginEvent;
import org.bukkit.event.server.ServerListener; import org.bukkit.event.server.ServerListener;
import org.bukkit.event.vehicle.*; import org.bukkit.event.vehicle.*;
import org.bukkit.event.world.ChunkLoadedEvent; import org.bukkit.event.world.ChunkLoadEvent;
import org.bukkit.event.world.ChunkUnloadedEvent; import org.bukkit.event.world.ChunkUnloadEvent;
import org.bukkit.event.world.WorldListener; import org.bukkit.event.world.WorldListener;
import org.bukkit.plugin.*; import org.bukkit.plugin.*;
@ -163,13 +163,13 @@ public final class JavaPluginLoader implements PluginLoader {
trueListener.onBlockCanBuild((BlockCanBuildEvent)event); trueListener.onBlockCanBuild((BlockCanBuildEvent)event);
break; break;
case BLOCK_RIGHTCLICKED: case BLOCK_RIGHTCLICKED:
trueListener.onBlockRightClicked((BlockRightClickedEvent) event); trueListener.onBlockRightClicked((BlockRightClickEvent) event);
break; break;
case BLOCK_PLACED: case BLOCK_PLACED:
trueListener.onBlockPlaced((BlockPlacedEvent)event); trueListener.onBlockPlaced((BlockPlaceEvent)event);
break; break;
case BLOCK_DAMAGED: case BLOCK_DAMAGED:
trueListener.onBlockDamaged((BlockDamagedEvent)event); trueListener.onBlockDamaged((BlockDamageEvent)event);
break; break;
case BLOCK_INTERACT: case BLOCK_INTERACT:
trueListener.onBlockInteracted((BlockInteractEvent)event); trueListener.onBlockInteracted((BlockInteractEvent)event);
@ -200,10 +200,10 @@ public final class JavaPluginLoader implements PluginLoader {
switch (event.getType()) { switch (event.getType()) {
case CHUNK_LOADED: case CHUNK_LOADED:
trueListener.onChunkLoaded((ChunkLoadedEvent)event); trueListener.onChunkLoaded((ChunkLoadEvent)event);
break; break;
case CHUNK_UNLOADED: case CHUNK_UNLOADED:
trueListener.onChunkUnloaded((ChunkUnloadedEvent)event); trueListener.onChunkUnloaded((ChunkUnloadEvent)event);
break; break;
} }
} else if(listener instanceof EntityListener) { } else if(listener instanceof EntityListener) {
@ -211,10 +211,10 @@ public final class JavaPluginLoader implements PluginLoader {
switch(event.getType()) switch(event.getType())
{ {
case ENTITY_DAMAGEDBY_BLOCK: case ENTITY_DAMAGEDBY_BLOCK:
trueListener.onEntityDamagedByBlock((EntityDamagedByBlockEvent)event); trueListener.onEntityDamageByBlock((EntityDamageByBlockEvent)event);
break; break;
case ENTITY_DAMAGEDBY_ENTITY: case ENTITY_DAMAGEDBY_ENTITY:
trueListener.onEntityDamagedByEntity((EntityDamagedByEntityEvent)event); trueListener.onEntityDamageByEntity((EntityDamageByEntityEvent)event);
break; break;
case ENTITY_DEATH: case ENTITY_DEATH:
// TODO: ENTITY_DEATH hook // TODO: ENTITY_DEATH hook