Update to Minecraft 1.11

By: md_5 <git@md-5.net>
This commit is contained in:
Bukkit/Spigot
2016-11-17 12:40:59 +11:00
parent 06e0085b98
commit f1fb3d9462
59 changed files with 646 additions and 682 deletions

View File

@@ -19,11 +19,6 @@ public class BlockIgniteEvent extends BlockEvent implements Cancellable {
private final Block ignitingBlock;
private boolean cancel;
@Deprecated
public BlockIgniteEvent(final Block theBlock, final IgniteCause cause, final Player thePlayer) {
this(theBlock, cause, (Entity) thePlayer);
}
public BlockIgniteEvent(final Block theBlock, final IgniteCause cause, final Entity ignitingEntity) {
this(theBlock, cause, ignitingEntity, null);
}

View File

@@ -96,13 +96,6 @@ public class CreatureSpawnEvent extends EntityEvent implements Cancellable {
* When a creature spawns because of a lightning strike
*/
LIGHTNING,
/**
* When a creature is spawned by a player that is sleeping
*
* @deprecated No longer used
*/
@Deprecated
BED,
/**
* When a snowman is spawned by being built
*/

View File

@@ -3,7 +3,6 @@ package org.bukkit.event.entity;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
@@ -17,19 +16,6 @@ public class EntityChangeBlockEvent extends EntityEvent implements Cancellable {
private final Material to;
private final byte data;
/**
*
* @param what the LivingEntity causing the change
* @param block the block (before the change)
* @param to the future material being changed to
* @deprecated Provided as a backward compatibility before the data byte
* was provided, and type increased to all entities
*/
@Deprecated
public EntityChangeBlockEvent(final LivingEntity what, final Block block, final Material to) {
this (what, block, to, (byte) 0);
}
/**
*
* @param what the Entity causing the change

View File

@@ -12,11 +12,6 @@ import org.bukkit.entity.Entity;
public class EntityDamageByBlockEvent extends EntityDamageEvent {
private final Block damager;
@Deprecated
public EntityDamageByBlockEvent(final Block damager, final Entity damagee, final DamageCause cause, final int damage) {
this(damager, damagee, cause, (double) damage);
}
@Deprecated
public EntityDamageByBlockEvent(final Block damager, final Entity damagee, final DamageCause cause, final double damage) {
super(damagee, cause, damage);

View File

@@ -11,11 +11,6 @@ import org.bukkit.entity.Entity;
public class EntityDamageByEntityEvent extends EntityDamageEvent {
private final Entity damager;
@Deprecated
public EntityDamageByEntityEvent(final Entity damager, final Entity damagee, final DamageCause cause, final int damage) {
this(damager, damagee, cause, (double) damage);
}
@Deprecated
public EntityDamageByEntityEvent(final Entity damager, final Entity damagee, final DamageCause cause, final double damage) {
super(damagee, cause, damage);

View File

@@ -28,11 +28,6 @@ public class EntityDamageEvent extends EntityEvent implements Cancellable {
private boolean cancelled;
private final DamageCause cause;
@Deprecated
public EntityDamageEvent(final Entity damagee, final DamageCause cause, final int damage) {
this(damagee, cause, (double) damage);
}
@Deprecated
public EntityDamageEvent(final Entity damagee, final DamageCause cause, final double damage) {
this(damagee, cause, new EnumMap<DamageModifier, Double>(ImmutableMap.of(DamageModifier.BASE, damage)), new EnumMap<DamageModifier, Function<? super Double, Double>>(ImmutableMap.of(DamageModifier.BASE, ZERO)));
@@ -431,6 +426,13 @@ public class EntityDamageEvent extends EntityEvent implements Cancellable {
* <p>
* Damage: 1
*/
HOT_FLOOR
HOT_FLOOR,
/**
* Damage caused when an entity is colliding with too many entities due
* to the maxEntityCramming game rule.
* <p>
* Damage: 6
*/
CRAMMING
}
}

View File

@@ -14,11 +14,6 @@ public class EntityRegainHealthEvent extends EntityEvent implements Cancellable
private double amount;
private final RegainReason regainReason;
@Deprecated
public EntityRegainHealthEvent(final Entity entity, final int amount, final RegainReason regainReason) {
this(entity, (double) amount, regainReason);
}
public EntityRegainHealthEvent(final Entity entity, final double amount, final RegainReason regainReason) {
super(entity);
this.amount = amount;

View File

@@ -0,0 +1,45 @@
package org.bukkit.event.entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
/**
* Called when an entity dies and may have the opportunity to be resurrected.
* Will be called in a cancelled state if the entity does not have a totem
* equipped.
*/
public class EntityResurrectEvent extends EntityEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
//
private boolean cancelled;
public EntityResurrectEvent(LivingEntity what) {
super(what);
}
@Override
public LivingEntity getEntity() {
return (LivingEntity) entity;
}
@Override
public boolean isCancelled() {
return cancelled;
}
@Override
public void setCancelled(boolean cancelled) {
this.cancelled = cancelled;
}
@Override
public HandlerList getHandlers() {
return handlers;
}
public static HandlerList getHandlerList() {
return handlers;
}
}

View File

@@ -1,8 +1,8 @@
package org.bukkit.event.entity;
import org.bukkit.entity.Horse;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
import org.bukkit.entity.AbstractHorse;
/**
* Called when a horse jumps.
@@ -12,7 +12,7 @@ public class HorseJumpEvent extends EntityEvent implements Cancellable {
private boolean cancelled;
private float power;
public HorseJumpEvent(final Horse horse, final float power) {
public HorseJumpEvent(final AbstractHorse horse, final float power) {
super(horse);
this.power = power;
}
@@ -30,8 +30,8 @@ public class HorseJumpEvent extends EntityEvent implements Cancellable {
}
@Override
public Horse getEntity() {
return (Horse) entity;
public AbstractHorse getEntity() {
return (AbstractHorse) entity;
}
/**
@@ -47,7 +47,7 @@ public class HorseJumpEvent extends EntityEvent implements Cancellable {
* Power does not affect how high the horse is capable of jumping, only
* how much of its jumping capability will be used in this jump. To set
* the horse's overall jump strength, see {@link
* Horse#setJumpStrength(double)}.
* AbstractHorse#setJumpStrength(double)}.
*
* @return jump strength
*/

View File

@@ -11,11 +11,6 @@ import org.bukkit.inventory.Recipe;
public class CraftItemEvent extends InventoryClickEvent {
private Recipe recipe;
@Deprecated
public CraftItemEvent(Recipe recipe, InventoryView what, SlotType type, int slot, boolean right, boolean shift) {
this(recipe, what, type, slot, right ? (shift ? ClickType.SHIFT_RIGHT : ClickType.RIGHT) : (shift ? ClickType.SHIFT_LEFT : ClickType.LEFT), InventoryAction.PICKUP_ALL);
}
public CraftItemEvent(Recipe recipe, InventoryView what, SlotType type, int slot, ClickType click, InventoryAction action) {
super(what, type, slot, click, action);
this.recipe = recipe;

View File

@@ -53,11 +53,6 @@ public class InventoryClickEvent extends InventoryInteractEvent {
private ItemStack current = null;
private int hotbarKey = -1;
@Deprecated
public InventoryClickEvent(InventoryView view, SlotType type, int slot, boolean right, boolean shift) {
this(view, type, slot, right ? (shift ? ClickType.SHIFT_RIGHT : ClickType.RIGHT) : (shift ? ClickType.SHIFT_LEFT : ClickType.LEFT), InventoryAction.SWAP_WITH_CURSOR);
}
public InventoryClickEvent(InventoryView view, SlotType type, int slot, ClickType click, InventoryAction action) {
super(view);
this.slot_type = type;

View File

@@ -49,7 +49,6 @@ public class PlayerCommandPreprocessEvent extends PlayerEvent implements Cancell
private static final HandlerList handlers = new HandlerList();
private boolean cancel = false;
private String message;
private String format = "<%1$s> %2$s";
private final Set<Player> recipients;
public PlayerCommandPreprocessEvent(final Player player, final String message) {
@@ -110,38 +109,6 @@ public class PlayerCommandPreprocessEvent extends PlayerEvent implements Cancell
this.player = player;
}
/**
* Gets the format to use to display this chat message
*
* @deprecated This method is provided for backward compatibility with no
* guarantee to the use of the format.
* @return String.Format compatible format string
*/
@Deprecated
public String getFormat() {
return format;
}
/**
* Sets the format to use to display this chat message
*
* @deprecated This method is provided for backward compatibility with no
* guarantee to the effect of modifying the format.
* @param format String.Format compatible format string
*/
@Deprecated
public void setFormat(final String format) {
// Oh for a better way to do this!
try {
String.format(format, player, message);
} catch (RuntimeException ex) {
ex.fillInStackTrace();
throw ex;
}
this.format = format;
}
/**
* Gets a set of recipients that this chat message will be displayed to.
* <p>

View File

@@ -17,18 +17,6 @@ public class PlayerFishEvent extends PlayerEvent implements Cancellable {
private final State state;
private final Fish hookEntity;
/**
* @deprecated replaced by {@link #PlayerFishEvent(Player, Entity, Fish,
* State)} to include the {@link Fish} hook entity.
* @param player the player fishing
* @param entity the caught entity
* @param state the state of fishing
*/
@Deprecated
public PlayerFishEvent(final Player player, final Entity entity, final State state) {
this(player, entity, null, state);
}
public PlayerFishEvent(final Player player, final Entity entity, final Fish hookEntity, final State state) {
super(player);
this.entity = entity;

View File

@@ -1,44 +0,0 @@
package org.bukkit.event.player;
import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryOpenEvent;
import org.bukkit.inventory.Inventory;
/**
* Represents a player related inventory event; note that this event never
* actually did anything
*
* @deprecated Use {@link InventoryClickEvent} or {@link InventoryOpenEvent}
* instead, or one of the other inventory events in {@link
* org.bukkit.event.inventory}.
*/
@Deprecated
public class PlayerInventoryEvent extends PlayerEvent {
private static final HandlerList handlers = new HandlerList();
protected Inventory inventory;
public PlayerInventoryEvent(final Player player, final Inventory inventory) {
super(player);
this.inventory = inventory;
}
/**
* Gets the Inventory involved in this event
*
* @return Inventory
*/
public Inventory getInventory() {
return inventory;
}
@Override
public HandlerList getHandlers() {
return handlers;
}
public static HandlerList getHandlerList() {
return handlers;
}
}

View File

@@ -15,25 +15,6 @@ public class PlayerLoginEvent extends PlayerEvent {
private Result result = Result.ALLOWED;
private String message = "";
/**
* @deprecated Address should be provided in other constructor
* @param player The {@link Player} for this event
*/
@Deprecated
public PlayerLoginEvent(final Player player) {
this(player, "", null);
}
/**
* @deprecated Address should be provided in other constructor
* @param player The {@link Player} for this event
* @param hostname The hostname that was used to connect to the server
*/
@Deprecated
public PlayerLoginEvent(final Player player, final String hostname) {
this(player, hostname, null);
}
/**
* This constructor defaults message to an empty string, and result to
* ALLOWED
@@ -49,18 +30,6 @@ public class PlayerLoginEvent extends PlayerEvent {
this.address = address;
}
/**
* @deprecated Address and hostname should be provided in other
* constructor
* @param player The {@link Player} for this event
* @param result The result status for this event
* @param message The message to be displayed if result denies login
*/
@Deprecated
public PlayerLoginEvent(final Player player, final Result result, final String message) {
this(player, "", null, result, message);
}
/**
* This constructor pre-configures the event with a result and message
*