forked from SpigotMC/Spigot-API
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
142 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 28 additions & 26 deletions
54
src/main/java/org/bukkit/event/entity/EntityPortalEnterEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} |
47 changes: 25 additions & 22 deletions
47
src/main/java/org/bukkit/event/player/PlayerPortalEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} |
88 changes: 45 additions & 43 deletions
88
src/main/java/org/bukkit/event/world/PortalCreateEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.