@@ -1,26 +1,28 @@
|
||||
package org.bukkit.event.entity;
|
||||
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
||||
/**
|
||||
* Stores data for entities standing inside a portal block
|
||||
*/
|
||||
public class EntityPortalEnterEvent extends EntityEvent {
|
||||
|
||||
private Location location;
|
||||
|
||||
public EntityPortalEnterEvent(Entity entity, Location location) {
|
||||
super(Type.ENTITY_PORTAL_ENTER, entity);
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
/*
|
||||
* Gets the portal block the entity is touching
|
||||
* @return The portal block the entity is touching
|
||||
*/
|
||||
public Location getLocation() {
|
||||
return location;
|
||||
}
|
||||
}
|
||||
package org.bukkit.event.entity;
|
||||
|
||||
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
||||
|
||||
/**
|
||||
* Stores data for entities standing inside a portal block
|
||||
*/
|
||||
public class EntityPortalEnterEvent extends EntityEvent {
|
||||
|
||||
private Location location;
|
||||
|
||||
public EntityPortalEnterEvent(Entity entity, Location location) {
|
||||
super(Type.ENTITY_PORTAL_ENTER, entity);
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
/*
|
||||
* Gets the portal block the entity is touching
|
||||
* @return The portal block the entity is touching
|
||||
*/
|
||||
public Location getLocation() {
|
||||
return location;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,22 +1,25 @@
|
||||
package org.bukkit.event.player;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.block.Block;
|
||||
|
||||
/**
|
||||
* Called when a player completes the portaling process by standing in a portal
|
||||
*/
|
||||
public class PlayerPortalEvent extends PlayerTeleportEvent {
|
||||
private boolean useTravelAgent = true;
|
||||
public PlayerPortalEvent(Player player, Location from, Location to) {
|
||||
super(Type.PLAYER_PORTAL, player, from, to);
|
||||
}
|
||||
|
||||
public void useTravelAgent(boolean useTravelAgent){
|
||||
this.useTravelAgent = useTravelAgent;
|
||||
}
|
||||
public boolean useTravelAgent(){
|
||||
return useTravelAgent;
|
||||
}
|
||||
}
|
||||
package org.bukkit.event.player;
|
||||
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.block.Block;
|
||||
|
||||
|
||||
/**
|
||||
* Called when a player completes the portaling process by standing in a portal
|
||||
*/
|
||||
public class PlayerPortalEvent extends PlayerTeleportEvent {
|
||||
private boolean useTravelAgent = true;
|
||||
public PlayerPortalEvent(Player player, Location from, Location to) {
|
||||
super(Type.PLAYER_PORTAL, player, from, to);
|
||||
}
|
||||
|
||||
public void useTravelAgent(boolean useTravelAgent) {
|
||||
this.useTravelAgent = useTravelAgent;
|
||||
}
|
||||
|
||||
public boolean useTravelAgent() {
|
||||
return useTravelAgent;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,43 +1,45 @@
|
||||
package org.bukkit.event.world;
|
||||
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Called when the world attempts to create a matching end to a portal
|
||||
*/
|
||||
public class PortalCreateEvent extends WorldEvent implements Cancellable {
|
||||
private boolean cancel = false;
|
||||
private ArrayList<Block> blocks = new ArrayList<Block>();
|
||||
|
||||
public PortalCreateEvent(final ArrayList<Block> blocks, final World world) {
|
||||
super(Type.PORTAL_CREATE, world);
|
||||
this.blocks = blocks;
|
||||
}
|
||||
|
||||
public ArrayList<Block> getBlocks(){
|
||||
return this.blocks;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the cancellation state of this event. A canceled event will not
|
||||
* be executed in the server, but will still pass to other plugins
|
||||
*
|
||||
* @return true if this event is canceled
|
||||
*/
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the cancellation state of this event. A canceled event will not
|
||||
* be executed in the server, but will still pass to other plugins
|
||||
*
|
||||
* @param cancel true if you wish to cancel this event
|
||||
*/
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
}
|
||||
package org.bukkit.event.world;
|
||||
|
||||
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
||||
/**
|
||||
* Called when the world attempts to create a matching end to a portal
|
||||
*/
|
||||
public class PortalCreateEvent extends WorldEvent implements Cancellable {
|
||||
private boolean cancel = false;
|
||||
private ArrayList<Block> blocks = new ArrayList<Block>();
|
||||
|
||||
public PortalCreateEvent(final ArrayList<Block> blocks, final World world) {
|
||||
super(Type.PORTAL_CREATE, world);
|
||||
this.blocks = blocks;
|
||||
}
|
||||
|
||||
public ArrayList<Block> getBlocks() {
|
||||
return this.blocks;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the cancellation state of this event. A canceled event will not
|
||||
* be executed in the server, but will still pass to other plugins
|
||||
*
|
||||
* @return true if this event is canceled
|
||||
*/
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the cancellation state of this event. A canceled event will not
|
||||
* be executed in the server, but will still pass to other plugins
|
||||
*
|
||||
* @param cancel true if you wish to cancel this event
|
||||
*/
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user