mirror of
https://github.com/craftaro/EpicSpawners.git
synced 2025-01-09 03:57:40 +08:00
removed some deprecated functions.
This commit is contained in:
parent
cbe12c0039
commit
b2ebbdc45a
@ -17,73 +17,8 @@ public class SpawnerPlaceEvent extends SpawnerEvent implements Cancellable {
|
||||
|
||||
private boolean canceled = false;
|
||||
|
||||
@Deprecated private final Location location;
|
||||
@Deprecated private final int multi;
|
||||
@Deprecated private String type;
|
||||
|
||||
/**
|
||||
* Fires when a spawner is placed into the game world.
|
||||
*
|
||||
* @param location location of spawner that was placed
|
||||
* @param player player who placed this spawner
|
||||
* @param type type of this spawner
|
||||
*
|
||||
* @deprecated Legacy code. See {@link #SpawnerPlaceEvent(Player, Spawner)}
|
||||
*/
|
||||
@Deprecated
|
||||
public SpawnerPlaceEvent(Location location, Player player, String type) {
|
||||
super(player, EpicSpawnersAPI.getSpawnerManager().getSpawnerFromWorld(location));
|
||||
|
||||
// Legacy
|
||||
this.location = location;
|
||||
this.multi = spawner.getSpawnerDataCount();
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public SpawnerPlaceEvent(Player player, Spawner spawner) {
|
||||
super(player, spawner);
|
||||
|
||||
// Legacy
|
||||
this.location = spawner.getLocation();
|
||||
this.multi = spawner.getSpawnerDataCount();
|
||||
this.type = spawner.getDisplayName();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the location at which the spawner was placed
|
||||
*
|
||||
* @return the placement location
|
||||
*
|
||||
* @deprecated Legacy API. See {@link Spawner#getLocation()}
|
||||
*/
|
||||
@Deprecated
|
||||
public Location getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the multiplier for this spawner.
|
||||
*
|
||||
* @return the multiplier for this spawner
|
||||
* @see #getSpawner()
|
||||
*
|
||||
* @deprecated Legacy API. See {@link Spawner#getSpawnerDataCount()}
|
||||
*/
|
||||
@Deprecated
|
||||
public int getMulti() {
|
||||
return multi;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the type of this spawner.
|
||||
*
|
||||
* @return the type of this spawner
|
||||
* @see #getSpawner()
|
||||
*
|
||||
* @deprecated Legacy API. See {@link Spawner#getDisplayName()}
|
||||
*/
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -111,13 +111,6 @@ public class BlockListeners implements Listener {
|
||||
|
||||
Player player = event.getPlayer();
|
||||
|
||||
SpawnerPlaceEvent placeEvent = new SpawnerPlaceEvent(player, spawner);
|
||||
Bukkit.getPluginManager().callEvent(placeEvent);
|
||||
if (placeEvent.isCancelled()) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
doLiquidRepel(event.getBlock(), true);
|
||||
|
||||
if (instance.getBlacklistHandler().isBlacklisted(player, true)) {
|
||||
@ -130,6 +123,13 @@ public class BlockListeners implements Listener {
|
||||
return;
|
||||
}
|
||||
|
||||
SpawnerPlaceEvent placeEvent = new SpawnerPlaceEvent(player, spawner);
|
||||
Bukkit.getPluginManager().callEvent(placeEvent);
|
||||
if (placeEvent.isCancelled()) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (spawnerData == null) {
|
||||
player.sendMessage(instance.getLocale().getMessage("event.block.broken"));
|
||||
event.setCancelled(true);
|
||||
|
Loading…
Reference in New Issue
Block a user