mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-30 19:40:37 +01:00
Events should be present tense, not paste tense.
By: Erik Broes <erikbroes@grum.nl>
This commit is contained in:
parent
965b8731e1
commit
3a76f4d8dd
14 changed files with 43 additions and 43 deletions
paper-api/src/main/java/org/bukkit
World.java
event
Event.java
block
entity
EntityDamageByBlockEvent.javaEntityDamageByEntityEvent.javaEntityDamageEvent.javaEntityListener.java
world
plugin/java
0
paper-api/src/main/java/org/bukkit/World.java
Executable file → Normal file
0
paper-api/src/main/java/org/bukkit/World.java
Executable file → Normal file
|
@ -214,7 +214,7 @@ public abstract class Event {
|
|||
/**
|
||||
* 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),
|
||||
|
||||
|
@ -257,14 +257,14 @@ public abstract class Event {
|
|||
/**
|
||||
* 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),
|
||||
|
||||
/**
|
||||
* 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),
|
||||
|
||||
|
@ -366,14 +366,14 @@ public abstract class Event {
|
|||
* If a new chunk is being generated for loading, it will call
|
||||
* 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),
|
||||
|
||||
/**
|
||||
* Called when a chunk is unloaded
|
||||
*
|
||||
* @see org.bukkit.event.world.ChunkUnloadedEvent
|
||||
* @see org.bukkit.event.world.ChunkUnloadeEvent
|
||||
*/
|
||||
CHUNK_UNLOADED (Category.WORLD),
|
||||
|
||||
|
@ -407,21 +407,21 @@ public abstract class Event {
|
|||
* Called when a LivingEntity is damaged by the environment (for example,
|
||||
* falling or lava)
|
||||
*
|
||||
* @see org.bukkit.event.entity.EntityDamagedByBlockEvent
|
||||
* @see org.bukkit.event.entity.EntityDamageByBlockEvent
|
||||
*/
|
||||
ENTITY_DAMAGEDBY_BLOCK (Category.LIVING_ENTITY),
|
||||
|
||||
/**
|
||||
* 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),
|
||||
|
||||
/**
|
||||
* 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),
|
||||
|
||||
|
|
|
@ -8,12 +8,12 @@ import org.bukkit.event.Cancellable;
|
|||
/**
|
||||
* @author tkelly
|
||||
*/
|
||||
public class BlockDamagedEvent extends BlockEvent implements Cancellable {
|
||||
public class BlockDamageEvent extends BlockEvent implements Cancellable {
|
||||
private Player player;
|
||||
private BlockDamageLevel damageLevel;
|
||||
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);
|
||||
this.damageLevel = level;
|
||||
this.player = player;
|
|
@ -19,7 +19,7 @@ public class BlockListener implements Listener {
|
|||
*
|
||||
* @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
|
||||
*/
|
||||
public void onBlockPlaced(BlockPlacedEvent event) {
|
||||
public void onBlockPlaced(BlockPlaceEvent event) {
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -73,7 +73,7 @@ public class BlockListener implements Listener {
|
|||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onBlockRightClicked(BlockRightClickedEvent event) {
|
||||
public void onBlockRightClicked(BlockRightClickEvent event) {
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -8,14 +8,14 @@ import org.bukkit.event.Cancellable;
|
|||
/**
|
||||
* Not implemented yet
|
||||
*/
|
||||
public class BlockPlacedEvent extends BlockEvent implements Cancellable {
|
||||
public class BlockPlaceEvent extends BlockEvent implements Cancellable {
|
||||
protected boolean cancel;
|
||||
protected boolean canBuild;
|
||||
protected Block placedAgainst;
|
||||
protected ItemStack itemInHand;
|
||||
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);
|
||||
this.placedAgainst = placedAgainst;
|
||||
this.itemInHand = itemInHand;
|
|
@ -8,13 +8,13 @@ import org.bukkit.Player;
|
|||
/**
|
||||
* Not implemented yet
|
||||
*/
|
||||
public class BlockRightClickedEvent extends BlockEvent {
|
||||
public class BlockRightClickEvent extends BlockEvent {
|
||||
protected Block clickedBlock;
|
||||
protected BlockFace direction;
|
||||
protected ItemStack itemInHand;
|
||||
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);
|
||||
this.clickedBlock = placedAgainst;
|
||||
this.direction = direction;
|
|
@ -8,11 +8,11 @@ import org.bukkit.event.Event;
|
|||
/**
|
||||
* 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;
|
||||
|
||||
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);
|
||||
this.damager = damager;
|
|
@ -7,11 +7,11 @@ import org.bukkit.event.Event;
|
|||
/**
|
||||
* 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;
|
||||
|
||||
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);
|
||||
this.damager = damager;
|
|
@ -7,20 +7,20 @@ import org.bukkit.event.Event;
|
|||
/**
|
||||
* Stores data for damage events
|
||||
*/
|
||||
public class EntityDamagedEvent extends EntityEvent implements Cancellable {
|
||||
public class EntityDamageEvent extends EntityEvent implements Cancellable {
|
||||
|
||||
private int damage;
|
||||
private boolean cancelled;
|
||||
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);
|
||||
this.cause = cause;
|
||||
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);
|
||||
this.cause = cause;
|
|
@ -9,10 +9,10 @@ public class EntityListener implements Listener {
|
|||
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) {
|
||||
|
|
|
@ -6,10 +6,10 @@ import org.bukkit.Chunk;
|
|||
/**
|
||||
* Called when a chunk is loaded
|
||||
*/
|
||||
public class ChunkLoadedEvent extends WorldEvent {
|
||||
public class ChunkLoadEvent extends WorldEvent {
|
||||
private final Chunk chunk;
|
||||
|
||||
public ChunkLoadedEvent(final Type type, final Chunk chunk) {
|
||||
public ChunkLoadEvent(final Type type, final Chunk chunk) {
|
||||
super(type, chunk.getWorld());
|
||||
|
||||
this.chunk = chunk;
|
|
@ -7,10 +7,10 @@ import org.bukkit.event.Cancellable;
|
|||
/**
|
||||
* Called when a chunk is unloaded
|
||||
*/
|
||||
public class ChunkUnloadedEvent extends ChunkLoadedEvent implements Cancellable {
|
||||
public class ChunkUnloadEvent extends ChunkLoadEvent implements Cancellable {
|
||||
private boolean cancel = false;
|
||||
|
||||
public ChunkUnloadedEvent(final Type type, final Chunk chunk) {
|
||||
public ChunkUnloadEvent(final Type type, final Chunk chunk) {
|
||||
super(type, chunk);
|
||||
}
|
||||
|
|
@ -12,7 +12,7 @@ public class WorldListener implements Listener {
|
|||
*
|
||||
* @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
|
||||
*/
|
||||
public void onChunkUnloaded(ChunkUnloadedEvent event) {
|
||||
public void onChunkUnloaded(ChunkUnloadEvent event) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,15 +19,15 @@ import org.bukkit.event.Event;
|
|||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.*;
|
||||
import org.bukkit.event.entity.EntityCombustEvent;
|
||||
import org.bukkit.event.entity.EntityDamagedByBlockEvent;
|
||||
import org.bukkit.event.entity.EntityDamagedByEntityEvent;
|
||||
import org.bukkit.event.entity.EntityDamageByBlockEvent;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.bukkit.event.entity.EntityListener;
|
||||
import org.bukkit.event.player.*;
|
||||
import org.bukkit.event.server.PluginEvent;
|
||||
import org.bukkit.event.server.ServerListener;
|
||||
import org.bukkit.event.vehicle.*;
|
||||
import org.bukkit.event.world.ChunkLoadedEvent;
|
||||
import org.bukkit.event.world.ChunkUnloadedEvent;
|
||||
import org.bukkit.event.world.ChunkLoadEvent;
|
||||
import org.bukkit.event.world.ChunkUnloadEvent;
|
||||
import org.bukkit.event.world.WorldListener;
|
||||
import org.bukkit.plugin.*;
|
||||
|
||||
|
@ -163,13 +163,13 @@ public final class JavaPluginLoader implements PluginLoader {
|
|||
trueListener.onBlockCanBuild((BlockCanBuildEvent)event);
|
||||
break;
|
||||
case BLOCK_RIGHTCLICKED:
|
||||
trueListener.onBlockRightClicked((BlockRightClickedEvent) event);
|
||||
trueListener.onBlockRightClicked((BlockRightClickEvent) event);
|
||||
break;
|
||||
case BLOCK_PLACED:
|
||||
trueListener.onBlockPlaced((BlockPlacedEvent)event);
|
||||
trueListener.onBlockPlaced((BlockPlaceEvent)event);
|
||||
break;
|
||||
case BLOCK_DAMAGED:
|
||||
trueListener.onBlockDamaged((BlockDamagedEvent)event);
|
||||
trueListener.onBlockDamaged((BlockDamageEvent)event);
|
||||
break;
|
||||
case BLOCK_INTERACT:
|
||||
trueListener.onBlockInteracted((BlockInteractEvent)event);
|
||||
|
@ -200,10 +200,10 @@ public final class JavaPluginLoader implements PluginLoader {
|
|||
|
||||
switch (event.getType()) {
|
||||
case CHUNK_LOADED:
|
||||
trueListener.onChunkLoaded((ChunkLoadedEvent)event);
|
||||
trueListener.onChunkLoaded((ChunkLoadEvent)event);
|
||||
break;
|
||||
case CHUNK_UNLOADED:
|
||||
trueListener.onChunkUnloaded((ChunkUnloadedEvent)event);
|
||||
trueListener.onChunkUnloaded((ChunkUnloadEvent)event);
|
||||
break;
|
||||
}
|
||||
} else if(listener instanceof EntityListener) {
|
||||
|
@ -211,10 +211,10 @@ public final class JavaPluginLoader implements PluginLoader {
|
|||
switch(event.getType())
|
||||
{
|
||||
case ENTITY_DAMAGEDBY_BLOCK:
|
||||
trueListener.onEntityDamagedByBlock((EntityDamagedByBlockEvent)event);
|
||||
trueListener.onEntityDamageByBlock((EntityDamageByBlockEvent)event);
|
||||
break;
|
||||
case ENTITY_DAMAGEDBY_ENTITY:
|
||||
trueListener.onEntityDamagedByEntity((EntityDamagedByEntityEvent)event);
|
||||
trueListener.onEntityDamageByEntity((EntityDamageByEntityEvent)event);
|
||||
break;
|
||||
case ENTITY_DEATH:
|
||||
// TODO: ENTITY_DEATH hook
|
||||
|
|
Loading…
Add table
Reference in a new issue