removed some deprecated functions.

This commit is contained in:
Brianna O'Keefe 2018-09-05 19:12:41 -04:00
parent cbe12c0039
commit b2ebbdc45a
2 changed files with 7 additions and 72 deletions

View File

@ -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

View File

@ -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);