Generic cleanup of warnings, whitespace and style.
By: Erik Broes <erikbroes@grum.nl>
This commit is contained in:
@@ -6,13 +6,14 @@ import org.bukkit.event.Cancellable;
|
||||
|
||||
/**
|
||||
* Called when a block is broken by a player.
|
||||
*<p />
|
||||
* <p />
|
||||
* Note:
|
||||
* Plugins wanting to simulate a traditional block drop should set the block to air and utilise their own methods for determining
|
||||
* what the default drop for the block being broken is and what to do about it, if anything.
|
||||
*<p />
|
||||
* <p />
|
||||
* If a Block Break event is cancelled, the block will not break.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class BlockBreakEvent extends BlockEvent implements Cancellable {
|
||||
|
||||
private Player player;
|
||||
|
||||
@@ -5,9 +5,10 @@ import org.bukkit.event.Cancellable;
|
||||
|
||||
/**
|
||||
* Called when a block is destroyed as a result of being burnt by fire.
|
||||
*<p />
|
||||
* <p />
|
||||
* If a Block Burn event is cancelled, the block will not be destroyed as a result of being burnt by fire.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class BlockBurnEvent extends BlockEvent implements Cancellable {
|
||||
private boolean cancelled;
|
||||
|
||||
|
||||
@@ -5,13 +5,14 @@ import org.bukkit.Material;
|
||||
|
||||
/**
|
||||
* Called when we try to place a block, to see if we can build it here or not.
|
||||
*<p />
|
||||
* <p />
|
||||
* Note:
|
||||
* <ul>
|
||||
* <li>The Block returned by getBlock() is the block we are trying to place on, not the block we are trying to place.</li>
|
||||
* <li>If you want to figure out what is being placed, use {@link #getMaterial()} or {@link #getMaterialId()} instead.</li>
|
||||
* <li>The Block returned by getBlock() is the block we are trying to place on, not the block we are trying to place.</li>
|
||||
* <li>If you want to figure out what is being placed, use {@link #getMaterial()} or {@link #getMaterialId()} instead.</li>
|
||||
* </ul>
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class BlockCanBuildEvent extends BlockEvent {
|
||||
protected boolean buildable;
|
||||
protected int material;
|
||||
|
||||
@@ -10,6 +10,7 @@ import org.bukkit.inventory.ItemStack;
|
||||
* <p />
|
||||
* If a Block Damage event is cancelled, the block will not be damaged.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class BlockDamageEvent extends BlockEvent implements Cancellable {
|
||||
private Player player;
|
||||
private boolean instaBreak;
|
||||
|
||||
@@ -7,9 +7,10 @@ import org.bukkit.util.Vector;
|
||||
|
||||
/**
|
||||
* Called when an item is dispensed from a block.
|
||||
*<p />
|
||||
* <p />
|
||||
* If a Block Dispense event is cancelled, the block will not dispense the item.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class BlockDispenseEvent extends BlockEvent implements Cancellable {
|
||||
|
||||
private boolean cancelled = false;
|
||||
@@ -43,7 +44,7 @@ public class BlockDispenseEvent extends BlockEvent implements Cancellable {
|
||||
|
||||
/**
|
||||
* Gets the velocity.
|
||||
*<p />
|
||||
* <p />
|
||||
* Note: Modifying the returned Vector will not change the velocity, you must use {@link #setVelocity(org.bukkit.util.Vector)} instead.
|
||||
*
|
||||
* @return A Vector for the dispensed item's velocity
|
||||
|
||||
@@ -6,6 +6,7 @@ import org.bukkit.event.Event;
|
||||
/**
|
||||
* Represents a block related event.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class BlockEvent extends Event {
|
||||
protected Block block;
|
||||
|
||||
|
||||
@@ -3,17 +3,19 @@ package org.bukkit.event.block;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
||||
/**
|
||||
* Called when a block fades, melts or disappears based on world conditions
|
||||
* <p />
|
||||
* Examples:
|
||||
* <ul>
|
||||
* <li>Snow melting due to being near a light source.</li>
|
||||
* <li>Ice melting due to being near a light source.</li>
|
||||
* <li>Snow melting due to being near a light source.</li>
|
||||
* <li>Ice melting due to being near a light source.</li>
|
||||
* </ul>
|
||||
* <p />
|
||||
* If a Block Fade event is cancelled, the block will not fade, melt or disappear.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class BlockFadeEvent extends BlockEvent implements Cancellable {
|
||||
private boolean cancelled;
|
||||
private BlockState newState;
|
||||
|
||||
@@ -7,16 +7,18 @@ import org.bukkit.event.Cancellable;
|
||||
/**
|
||||
* Called when a block is formed or spreads based on world conditions.
|
||||
* Use {@link BlockSpreadEvent} to catch blocks that actually spread and don't just "randomly" form.
|
||||
*<p />
|
||||
* <p />
|
||||
* Examples:
|
||||
*<ul>
|
||||
* <li>Snow forming due to a snow storm.</li>
|
||||
* <li>Ice forming in a snowy Biome like Taiga or Tundra.</li>
|
||||
* <ul>
|
||||
* <li>Snow forming due to a snow storm.</li>
|
||||
* <li>Ice forming in a snowy Biome like Taiga or Tundra.</li>
|
||||
* </ul>
|
||||
*<p />
|
||||
* <p />
|
||||
* If a Block Form event is cancelled, the block will not be formed.
|
||||
*
|
||||
* @see BlockSpreadEvent
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class BlockFormEvent extends BlockEvent implements Cancellable {
|
||||
private boolean cancelled;
|
||||
private BlockState newState;
|
||||
|
||||
@@ -6,9 +6,10 @@ import org.bukkit.event.Cancellable;
|
||||
|
||||
/**
|
||||
* Represents events with a source block and a destination block, currently only applies to liquid (lava and water).
|
||||
*<p />
|
||||
* <p />
|
||||
* If a Block From To event is cancelled, the block will not move (the liquid will not flow).
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class BlockFromToEvent extends BlockEvent implements Cancellable {
|
||||
protected Block to;
|
||||
protected BlockFace face;
|
||||
|
||||
@@ -7,9 +7,10 @@ import org.bukkit.event.Event;
|
||||
|
||||
/**
|
||||
* Called when a block is ignited. If you want to catch when a Player places fire, you need to use {@link BlockPlaceEvent}.
|
||||
*<p />
|
||||
* <p />
|
||||
* If a Block Ignite event is cancelled, the block will not be ignited.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class BlockIgniteEvent extends BlockEvent implements Cancellable {
|
||||
private IgniteCause cause;
|
||||
private boolean cancel;
|
||||
|
||||
@@ -23,11 +23,11 @@ public class BlockListener implements Listener {
|
||||
|
||||
/**
|
||||
* Called when we try to place a block, to see if we can build it here or not.
|
||||
*<p />
|
||||
* <p />
|
||||
* Note:
|
||||
* <ul>
|
||||
* <li>The Block returned by getBlock() is the block we are trying to place on, not the block we are trying to place.</li>
|
||||
* <li>If you want to figure out what is being placed, use {@link BlockCanBuildEvent#getMaterial()} or {@link BlockCanBuildEvent#getMaterialId()} instead.</li>
|
||||
* <li>The Block returned by getBlock() is the block we are trying to place on, not the block we are trying to place.</li>
|
||||
* <li>If you want to figure out what is being placed, use {@link BlockCanBuildEvent#getMaterial()} or {@link BlockCanBuildEvent#getMaterialId()} instead.</li>
|
||||
* </ul>
|
||||
*
|
||||
* @param event Relevant event details
|
||||
@@ -36,7 +36,7 @@ public class BlockListener implements Listener {
|
||||
|
||||
/**
|
||||
* Represents events with a source block and a destination block, currently only applies to liquid (lava and water).
|
||||
*<p />
|
||||
* <p />
|
||||
* If a Block From To event is cancelled, the block will not move (the liquid will not flow).
|
||||
*
|
||||
* @param event Relevant event details
|
||||
@@ -45,7 +45,7 @@ public class BlockListener implements Listener {
|
||||
|
||||
/**
|
||||
* Called when a block is ignited. If you want to catch when a Player places fire, you need to use {@link BlockPlaceEvent}.
|
||||
*<p />
|
||||
* <p />
|
||||
* If a Block Ignite event is cancelled, the block will not be ignited.
|
||||
*
|
||||
* @param event Relevant event details
|
||||
@@ -61,7 +61,7 @@ public class BlockListener implements Listener {
|
||||
|
||||
/**
|
||||
* Called when a block is placed by a player.
|
||||
*<p />
|
||||
* <p />
|
||||
* If a Block Place event is cancelled, the block will not be placed.
|
||||
*
|
||||
* @param event Relevant event details
|
||||
@@ -79,7 +79,7 @@ public class BlockListener implements Listener {
|
||||
|
||||
/**
|
||||
* Called when leaves are decaying naturally.
|
||||
*<p />
|
||||
* <p />
|
||||
* If a Leaves Decay event is cancelled, the leaves will not decay.
|
||||
*
|
||||
* @param event Relevant event details
|
||||
@@ -97,7 +97,7 @@ public class BlockListener implements Listener {
|
||||
|
||||
/**
|
||||
* Called when a block is destroyed as a result of being burnt by fire.
|
||||
*<p />
|
||||
* <p />
|
||||
* If a Block Burn event is cancelled, the block will not be destroyed as a result of being burnt by fire.
|
||||
*
|
||||
* @param event Relevant event details
|
||||
@@ -106,11 +106,11 @@ public class BlockListener implements Listener {
|
||||
|
||||
/**
|
||||
* Called when a block is broken by a player.
|
||||
*<p />
|
||||
* <p />
|
||||
* Note:
|
||||
* Plugins wanting to simulate a traditional block drop should set the block to air and utilise their own methods for determining
|
||||
* what the default drop for the block being broken is and what to do about it, if anything.
|
||||
*<p />
|
||||
* <p />
|
||||
* If a Block Break event is cancelled, the block will not break.
|
||||
*
|
||||
* @param event Relevant event details
|
||||
@@ -120,13 +120,13 @@ public class BlockListener implements Listener {
|
||||
/**
|
||||
* Called when a block is formed or spreads based on world conditions.
|
||||
* Use {@link BlockSpreadEvent} to catch blocks that actually spread and don't just "randomly" form.
|
||||
*<p />
|
||||
* <p />
|
||||
* Examples:
|
||||
*<ul>
|
||||
* <li>Snow forming due to a snow storm.</li>
|
||||
* <li>Ice forming in a snowy Biome like Tiga or Tundra.</li>
|
||||
* <ul>
|
||||
* <li>Snow forming due to a snow storm.</li>
|
||||
* <li>Ice forming in a snowy Biome like Tiga or Tundra.</li>
|
||||
* </ul>
|
||||
*<p />
|
||||
* <p />
|
||||
* If a Block Form event is cancelled, the block will not be formed or will not spread.
|
||||
*
|
||||
* @see BlockSpreadEvent
|
||||
@@ -137,13 +137,13 @@ public class BlockListener implements Listener {
|
||||
/**
|
||||
* Called when a block spreads based on world conditions.
|
||||
* Use {@link BlockFormEvent} to catch blocks that "randomly" form instead of actually spread.
|
||||
*<p />
|
||||
* <p />
|
||||
* Examples:
|
||||
*<ul>
|
||||
* <li>Mushrooms spreading.</li>
|
||||
* <li>Fire spreading.</li>
|
||||
* <ul>
|
||||
* <li>Mushrooms spreading.</li>
|
||||
* <li>Fire spreading.</li>
|
||||
* </ul>
|
||||
*<p />
|
||||
* <p />
|
||||
* If a Block Spread event is cancelled, the block will not spread.
|
||||
*
|
||||
* @param event Relevant event details
|
||||
@@ -155,8 +155,8 @@ public class BlockListener implements Listener {
|
||||
* <p />
|
||||
* Examples:
|
||||
* <ul>
|
||||
* <li>Snow melting due to being near a light source.</li>
|
||||
* <li>Ice melting due to being near a light source.</li>
|
||||
* <li>Snow melting due to being near a light source.</li>
|
||||
* <li>Ice melting due to being near a light source.</li>
|
||||
* </ul>
|
||||
* <p />
|
||||
* If a Block Fade event is cancelled, the block will not fade, melt or disappear.
|
||||
@@ -167,7 +167,7 @@ public class BlockListener implements Listener {
|
||||
|
||||
/**
|
||||
* Called when an item is dispensed from a block.
|
||||
*<p />
|
||||
* <p />
|
||||
* If a Block Dispense event is cancelled, the block will not dispense the item.
|
||||
*
|
||||
* @param event Relevant event details
|
||||
|
||||
@@ -7,6 +7,7 @@ import org.bukkit.event.Cancellable;
|
||||
/**
|
||||
* Thrown when a block physics check is called
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class BlockPhysicsEvent extends BlockEvent implements Cancellable {
|
||||
private final int changed;
|
||||
private boolean cancel = false;
|
||||
|
||||
@@ -4,9 +4,9 @@ import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.material.PistonBaseMaterial;
|
||||
|
||||
public abstract class BlockPistonEvent extends BlockEvent implements Cancellable {
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class BlockPistonEvent extends BlockEvent implements Cancellable {
|
||||
private boolean cancelled;
|
||||
private BlockFace direction;
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import java.util.List;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class BlockPistonExtendEvent extends BlockPistonEvent {
|
||||
private int length;
|
||||
private List<Block> blocks;
|
||||
|
||||
@@ -4,6 +4,7 @@ import org.bukkit.Location;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class BlockPistonRetractEvent extends BlockPistonEvent {
|
||||
public BlockPistonRetractEvent(Block block, BlockFace direction) {
|
||||
super(Type.BLOCK_PISTON_RETRACT, block, direction);
|
||||
|
||||
@@ -8,9 +8,10 @@ import org.bukkit.inventory.ItemStack;
|
||||
|
||||
/**
|
||||
* Called when a block is placed by a player.
|
||||
*<p />
|
||||
* <p />
|
||||
* If a Block Place event is cancelled, the block will not be placed.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class BlockPlaceEvent extends BlockEvent implements Cancellable {
|
||||
protected boolean cancel;
|
||||
protected boolean canBuild;
|
||||
|
||||
@@ -5,6 +5,7 @@ import org.bukkit.block.Block;
|
||||
/**
|
||||
* Called when a redstone current changes
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class BlockRedstoneEvent extends BlockEvent {
|
||||
private int oldCurrent;
|
||||
private int newCurrent;
|
||||
|
||||
@@ -2,19 +2,22 @@ package org.bukkit.event.block;
|
||||
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockState;
|
||||
|
||||
/**
|
||||
* Called when a block spreads based on world conditions.
|
||||
* Use {@link BlockFormEvent} to catch blocks that "randomly" form instead of actually spread.
|
||||
*<p />
|
||||
* <p />
|
||||
* Examples:
|
||||
*<ul>
|
||||
* <li>Mushrooms spreading.</li>
|
||||
* <li>Fire spreading.</li>
|
||||
* <ul>
|
||||
* <li>Mushrooms spreading.</li>
|
||||
* <li>Fire spreading.</li>
|
||||
* </ul>
|
||||
*<p />
|
||||
* <p />
|
||||
* If a Block Spread event is cancelled, the block will not spread.
|
||||
*
|
||||
* @see BlockFormEvent
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class BlockSpreadEvent extends BlockFormEvent {
|
||||
private Block source;
|
||||
|
||||
|
||||
@@ -5,9 +5,10 @@ import org.bukkit.event.Cancellable;
|
||||
|
||||
/**
|
||||
* Called when leaves are decaying naturally.
|
||||
*<p />
|
||||
* <p />
|
||||
* If a Leaves Decay event is cancelled, the leaves will not decay.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class LeavesDecayEvent extends BlockEvent implements Cancellable {
|
||||
private boolean cancel = false;
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import org.bukkit.event.Cancellable;
|
||||
* <p />
|
||||
* If a Sign Change event is cancelled, the sign will not be changed.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class SignChangeEvent extends BlockEvent implements Cancellable {
|
||||
private boolean cancel = false;
|
||||
private Player player;
|
||||
|
||||
Reference in New Issue
Block a user