Add Override annotations where appropriate

By: md_5 <git@md-5.net>
This commit is contained in:
Bukkit/Spigot 2019-04-28 11:37:52 +10:00
parent d66310a2f1
commit 82854b7bd7
176 changed files with 503 additions and 0 deletions

View file

@ -317,6 +317,7 @@ public final class Color implements ConfigurationSerializable {
return asRGB() ^ Color.class.hashCode(); return asRGB() ^ Color.class.hashCode();
} }
@Override
@NotNull @NotNull
public Map<String, Object> serialize() { public Map<String, Object> serialize() {
return ImmutableMap.<String, Object>of( return ImmutableMap.<String, Object>of(

View file

@ -599,6 +599,7 @@ public class Location implements Cloneable, ConfigurationSerializable {
return NumberConversions.floor(loc); return NumberConversions.floor(loc);
} }
@Override
@Utility @Utility
@NotNull @NotNull
public Map<String, Object> serialize() { public Map<String, Object> serialize() {

View file

@ -25,6 +25,7 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
* *
* @return Player name or null if we have not seen a name for this player yet * @return Player name or null if we have not seen a name for this player yet
*/ */
@Override
@Nullable @Nullable
public String getName(); public String getName();
@ -33,6 +34,7 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
* *
* @return Player UUID * @return Player UUID
*/ */
@Override
@NotNull @NotNull
public UUID getUniqueId(); public UUID getUniqueId();

View file

@ -18,6 +18,7 @@ public class DoubleChest implements InventoryHolder {
inventory = chest; inventory = chest;
} }
@Override
@NotNull @NotNull
public Inventory getInventory() { public Inventory getInventory() {
return inventory; return inventory;

View file

@ -102,6 +102,7 @@ public final class PluginCommand extends Command implements PluginIdentifiableCo
* *
* @return Plugin that owns this command * @return Plugin that owns this command
*/ */
@Override
@NotNull @NotNull
public Plugin getPlugin() { public Plugin getPlugin() {
return owningPlugin; return owningPlugin;

View file

@ -45,6 +45,7 @@ public class SimpleCommandMap implements CommandMap {
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override
public void registerAll(@NotNull String fallbackPrefix, @NotNull List<Command> commands) { public void registerAll(@NotNull String fallbackPrefix, @NotNull List<Command> commands) {
if (commands != null) { if (commands != null) {
for (Command c : commands) { for (Command c : commands) {
@ -56,6 +57,7 @@ public class SimpleCommandMap implements CommandMap {
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override
public boolean register(@NotNull String fallbackPrefix, @NotNull Command command) { public boolean register(@NotNull String fallbackPrefix, @NotNull Command command) {
return register(command.getName(), fallbackPrefix, command); return register(command.getName(), fallbackPrefix, command);
} }
@ -63,6 +65,7 @@ public class SimpleCommandMap implements CommandMap {
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override
public boolean register(@NotNull String label, @NotNull String fallbackPrefix, @NotNull Command command) { public boolean register(@NotNull String label, @NotNull String fallbackPrefix, @NotNull Command command) {
label = label.toLowerCase(java.util.Locale.ENGLISH).trim(); label = label.toLowerCase(java.util.Locale.ENGLISH).trim();
fallbackPrefix = fallbackPrefix.toLowerCase(java.util.Locale.ENGLISH).trim(); fallbackPrefix = fallbackPrefix.toLowerCase(java.util.Locale.ENGLISH).trim();
@ -125,6 +128,7 @@ public class SimpleCommandMap implements CommandMap {
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override
public boolean dispatch(@NotNull CommandSender sender, @NotNull String commandLine) throws CommandException { public boolean dispatch(@NotNull CommandSender sender, @NotNull String commandLine) throws CommandException {
String[] args = commandLine.split(" "); String[] args = commandLine.split(" ");
@ -152,6 +156,7 @@ public class SimpleCommandMap implements CommandMap {
return true; return true;
} }
@Override
public synchronized void clearCommands() { public synchronized void clearCommands() {
for (Map.Entry<String, Command> entry : knownCommands.entrySet()) { for (Map.Entry<String, Command> entry : knownCommands.entrySet()) {
entry.getValue().unregister(this); entry.getValue().unregister(this);
@ -160,17 +165,20 @@ public class SimpleCommandMap implements CommandMap {
setDefaultCommands(); setDefaultCommands();
} }
@Override
@Nullable @Nullable
public Command getCommand(@NotNull String name) { public Command getCommand(@NotNull String name) {
Command target = knownCommands.get(name.toLowerCase(java.util.Locale.ENGLISH)); Command target = knownCommands.get(name.toLowerCase(java.util.Locale.ENGLISH));
return target; return target;
} }
@Override
@Nullable @Nullable
public List<String> tabComplete(@NotNull CommandSender sender, @NotNull String cmdLine) { public List<String> tabComplete(@NotNull CommandSender sender, @NotNull String cmdLine) {
return tabComplete(sender, cmdLine, null); return tabComplete(sender, cmdLine, null);
} }
@Override
@Nullable @Nullable
public List<String> tabComplete(@NotNull CommandSender sender, @NotNull String cmdLine, @Nullable Location location) { public List<String> tabComplete(@NotNull CommandSender sender, @NotNull String cmdLine, @Nullable Location location) {
Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(sender, "Sender cannot be null");

View file

@ -22,6 +22,7 @@ public interface Configuration extends ConfigurationSection {
* @param value Value to set the default to. * @param value Value to set the default to.
* @throws IllegalArgumentException Thrown if path is null. * @throws IllegalArgumentException Thrown if path is null.
*/ */
@Override
public void addDefault(@NotNull String path, @Nullable Object value); public void addDefault(@NotNull String path, @Nullable Object value);
/** /**

View file

@ -41,6 +41,7 @@ public class MemoryConfiguration extends MemorySection implements Configuration
defaults.set(path, value); defaults.set(path, value);
} }
@Override
public void addDefaults(@NotNull Map<String, Object> defaults) { public void addDefaults(@NotNull Map<String, Object> defaults) {
Validate.notNull(defaults, "Defaults may not be null"); Validate.notNull(defaults, "Defaults may not be null");
@ -49,18 +50,21 @@ public class MemoryConfiguration extends MemorySection implements Configuration
} }
} }
@Override
public void addDefaults(@NotNull Configuration defaults) { public void addDefaults(@NotNull Configuration defaults) {
Validate.notNull(defaults, "Defaults may not be null"); Validate.notNull(defaults, "Defaults may not be null");
addDefaults(defaults.getValues(true)); addDefaults(defaults.getValues(true));
} }
@Override
public void setDefaults(@NotNull Configuration defaults) { public void setDefaults(@NotNull Configuration defaults) {
Validate.notNull(defaults, "Defaults may not be null"); Validate.notNull(defaults, "Defaults may not be null");
this.defaults = defaults; this.defaults = defaults;
} }
@Override
@Nullable @Nullable
public Configuration getDefaults() { public Configuration getDefaults() {
return defaults; return defaults;
@ -72,6 +76,7 @@ public class MemoryConfiguration extends MemorySection implements Configuration
return null; return null;
} }
@Override
@NotNull @NotNull
public MemoryConfigurationOptions options() { public MemoryConfigurationOptions options() {
if (options == null) { if (options == null) {

View file

@ -69,6 +69,7 @@ public class MemorySection implements ConfigurationSection {
this.fullPath = createPath(parent, path); this.fullPath = createPath(parent, path);
} }
@Override
@NotNull @NotNull
public Set<String> getKeys(boolean deep) { public Set<String> getKeys(boolean deep) {
Set<String> result = new LinkedHashSet<String>(); Set<String> result = new LinkedHashSet<String>();
@ -87,6 +88,7 @@ public class MemorySection implements ConfigurationSection {
return result; return result;
} }
@Override
@NotNull @NotNull
public Map<String, Object> getValues(boolean deep) { public Map<String, Object> getValues(boolean deep) {
Map<String, Object> result = new LinkedHashMap<String, Object>(); Map<String, Object> result = new LinkedHashMap<String, Object>();
@ -105,14 +107,17 @@ public class MemorySection implements ConfigurationSection {
return result; return result;
} }
@Override
public boolean contains(@NotNull String path) { public boolean contains(@NotNull String path) {
return contains(path, false); return contains(path, false);
} }
@Override
public boolean contains(@NotNull String path, boolean ignoreDefault) { public boolean contains(@NotNull String path, boolean ignoreDefault) {
return ((ignoreDefault) ? get(path, null) : get(path)) != null; return ((ignoreDefault) ? get(path, null) : get(path)) != null;
} }
@Override
public boolean isSet(@NotNull String path) { public boolean isSet(@NotNull String path) {
Configuration root = getRoot(); Configuration root = getRoot();
if (root == null) { if (root == null) {
@ -124,26 +129,31 @@ public class MemorySection implements ConfigurationSection {
return get(path, null) != null; return get(path, null) != null;
} }
@Override
@NotNull @NotNull
public String getCurrentPath() { public String getCurrentPath() {
return fullPath; return fullPath;
} }
@Override
@NotNull @NotNull
public String getName() { public String getName() {
return path; return path;
} }
@Override
@Nullable @Nullable
public Configuration getRoot() { public Configuration getRoot() {
return root; return root;
} }
@Override
@Nullable @Nullable
public ConfigurationSection getParent() { public ConfigurationSection getParent() {
return parent; return parent;
} }
@Override
public void addDefault(@NotNull String path, @Nullable Object value) { public void addDefault(@NotNull String path, @Nullable Object value) {
Validate.notNull(path, "Path cannot be null"); Validate.notNull(path, "Path cannot be null");
@ -157,6 +167,7 @@ public class MemorySection implements ConfigurationSection {
root.addDefault(createPath(this, path), value); root.addDefault(createPath(this, path), value);
} }
@Override
@Nullable @Nullable
public ConfigurationSection getDefaultSection() { public ConfigurationSection getDefaultSection() {
Configuration root = getRoot(); Configuration root = getRoot();
@ -171,6 +182,7 @@ public class MemorySection implements ConfigurationSection {
return null; return null;
} }
@Override
public void set(@NotNull String path, @Nullable Object value) { public void set(@NotNull String path, @Nullable Object value) {
Validate.notEmpty(path, "Cannot set to an empty path"); Validate.notEmpty(path, "Cannot set to an empty path");
@ -210,11 +222,13 @@ public class MemorySection implements ConfigurationSection {
} }
} }
@Override
@Nullable @Nullable
public Object get(@NotNull String path) { public Object get(@NotNull String path) {
return get(path, getDefault(path)); return get(path, getDefault(path));
} }
@Override
@Nullable @Nullable
public Object get(@NotNull String path, @Nullable Object def) { public Object get(@NotNull String path, @Nullable Object def) {
Validate.notNull(path, "Path cannot be null"); Validate.notNull(path, "Path cannot be null");
@ -248,6 +262,7 @@ public class MemorySection implements ConfigurationSection {
return section.get(key, def); return section.get(key, def);
} }
@Override
@NotNull @NotNull
public ConfigurationSection createSection(@NotNull String path) { public ConfigurationSection createSection(@NotNull String path) {
Validate.notEmpty(path, "Cannot create section at empty path"); Validate.notEmpty(path, "Cannot create section at empty path");
@ -280,6 +295,7 @@ public class MemorySection implements ConfigurationSection {
return section.createSection(key); return section.createSection(key);
} }
@Override
@NotNull @NotNull
public ConfigurationSection createSection(@NotNull String path, @NotNull Map<?, ?> map) { public ConfigurationSection createSection(@NotNull String path, @NotNull Map<?, ?> map) {
ConfigurationSection section = createSection(path); ConfigurationSection section = createSection(path);
@ -296,101 +312,120 @@ public class MemorySection implements ConfigurationSection {
} }
// Primitives // Primitives
@Override
@Nullable @Nullable
public String getString(@NotNull String path) { public String getString(@NotNull String path) {
Object def = getDefault(path); Object def = getDefault(path);
return getString(path, def != null ? def.toString() : null); return getString(path, def != null ? def.toString() : null);
} }
@Override
@Nullable @Nullable
public String getString(@NotNull String path, @Nullable String def) { public String getString(@NotNull String path, @Nullable String def) {
Object val = get(path, def); Object val = get(path, def);
return (val != null) ? val.toString() : def; return (val != null) ? val.toString() : def;
} }
@Override
public boolean isString(@NotNull String path) { public boolean isString(@NotNull String path) {
Object val = get(path); Object val = get(path);
return val instanceof String; return val instanceof String;
} }
@Override
public int getInt(@NotNull String path) { public int getInt(@NotNull String path) {
Object def = getDefault(path); Object def = getDefault(path);
return getInt(path, (def instanceof Number) ? toInt(def) : 0); return getInt(path, (def instanceof Number) ? toInt(def) : 0);
} }
@Override
public int getInt(@NotNull String path, int def) { public int getInt(@NotNull String path, int def) {
Object val = get(path, def); Object val = get(path, def);
return (val instanceof Number) ? toInt(val) : def; return (val instanceof Number) ? toInt(val) : def;
} }
@Override
public boolean isInt(@NotNull String path) { public boolean isInt(@NotNull String path) {
Object val = get(path); Object val = get(path);
return val instanceof Integer; return val instanceof Integer;
} }
@Override
public boolean getBoolean(@NotNull String path) { public boolean getBoolean(@NotNull String path) {
Object def = getDefault(path); Object def = getDefault(path);
return getBoolean(path, (def instanceof Boolean) ? (Boolean) def : false); return getBoolean(path, (def instanceof Boolean) ? (Boolean) def : false);
} }
@Override
public boolean getBoolean(@NotNull String path, boolean def) { public boolean getBoolean(@NotNull String path, boolean def) {
Object val = get(path, def); Object val = get(path, def);
return (val instanceof Boolean) ? (Boolean) val : def; return (val instanceof Boolean) ? (Boolean) val : def;
} }
@Override
public boolean isBoolean(@NotNull String path) { public boolean isBoolean(@NotNull String path) {
Object val = get(path); Object val = get(path);
return val instanceof Boolean; return val instanceof Boolean;
} }
@Override
public double getDouble(@NotNull String path) { public double getDouble(@NotNull String path) {
Object def = getDefault(path); Object def = getDefault(path);
return getDouble(path, (def instanceof Number) ? toDouble(def) : 0); return getDouble(path, (def instanceof Number) ? toDouble(def) : 0);
} }
@Override
public double getDouble(@NotNull String path, double def) { public double getDouble(@NotNull String path, double def) {
Object val = get(path, def); Object val = get(path, def);
return (val instanceof Number) ? toDouble(val) : def; return (val instanceof Number) ? toDouble(val) : def;
} }
@Override
public boolean isDouble(@NotNull String path) { public boolean isDouble(@NotNull String path) {
Object val = get(path); Object val = get(path);
return val instanceof Double; return val instanceof Double;
} }
@Override
public long getLong(@NotNull String path) { public long getLong(@NotNull String path) {
Object def = getDefault(path); Object def = getDefault(path);
return getLong(path, (def instanceof Number) ? toLong(def) : 0); return getLong(path, (def instanceof Number) ? toLong(def) : 0);
} }
@Override
public long getLong(@NotNull String path, long def) { public long getLong(@NotNull String path, long def) {
Object val = get(path, def); Object val = get(path, def);
return (val instanceof Number) ? toLong(val) : def; return (val instanceof Number) ? toLong(val) : def;
} }
@Override
public boolean isLong(@NotNull String path) { public boolean isLong(@NotNull String path) {
Object val = get(path); Object val = get(path);
return val instanceof Long; return val instanceof Long;
} }
// Java // Java
@Override
@Nullable @Nullable
public List<?> getList(@NotNull String path) { public List<?> getList(@NotNull String path) {
Object def = getDefault(path); Object def = getDefault(path);
return getList(path, (def instanceof List) ? (List<?>) def : null); return getList(path, (def instanceof List) ? (List<?>) def : null);
} }
@Override
@Nullable @Nullable
public List<?> getList(@NotNull String path, @Nullable List<?> def) { public List<?> getList(@NotNull String path, @Nullable List<?> def) {
Object val = get(path, def); Object val = get(path, def);
return (List<?>) ((val instanceof List) ? val : def); return (List<?>) ((val instanceof List) ? val : def);
} }
@Override
public boolean isList(@NotNull String path) { public boolean isList(@NotNull String path) {
Object val = get(path); Object val = get(path);
return val instanceof List; return val instanceof List;
} }
@Override
@NotNull @NotNull
public List<String> getStringList(@NotNull String path) { public List<String> getStringList(@NotNull String path) {
List<?> list = getList(path); List<?> list = getList(path);
@ -410,6 +445,7 @@ public class MemorySection implements ConfigurationSection {
return result; return result;
} }
@Override
@NotNull @NotNull
public List<Integer> getIntegerList(@NotNull String path) { public List<Integer> getIntegerList(@NotNull String path) {
List<?> list = getList(path); List<?> list = getList(path);
@ -438,6 +474,7 @@ public class MemorySection implements ConfigurationSection {
return result; return result;
} }
@Override
@NotNull @NotNull
public List<Boolean> getBooleanList(@NotNull String path) { public List<Boolean> getBooleanList(@NotNull String path) {
List<?> list = getList(path); List<?> list = getList(path);
@ -463,6 +500,7 @@ public class MemorySection implements ConfigurationSection {
return result; return result;
} }
@Override
@NotNull @NotNull
public List<Double> getDoubleList(@NotNull String path) { public List<Double> getDoubleList(@NotNull String path) {
List<?> list = getList(path); List<?> list = getList(path);
@ -491,6 +529,7 @@ public class MemorySection implements ConfigurationSection {
return result; return result;
} }
@Override
@NotNull @NotNull
public List<Float> getFloatList(@NotNull String path) { public List<Float> getFloatList(@NotNull String path) {
List<?> list = getList(path); List<?> list = getList(path);
@ -519,6 +558,7 @@ public class MemorySection implements ConfigurationSection {
return result; return result;
} }
@Override
@NotNull @NotNull
public List<Long> getLongList(@NotNull String path) { public List<Long> getLongList(@NotNull String path) {
List<?> list = getList(path); List<?> list = getList(path);
@ -547,6 +587,7 @@ public class MemorySection implements ConfigurationSection {
return result; return result;
} }
@Override
@NotNull @NotNull
public List<Byte> getByteList(@NotNull String path) { public List<Byte> getByteList(@NotNull String path) {
List<?> list = getList(path); List<?> list = getList(path);
@ -575,6 +616,7 @@ public class MemorySection implements ConfigurationSection {
return result; return result;
} }
@Override
@NotNull @NotNull
public List<Character> getCharacterList(@NotNull String path) { public List<Character> getCharacterList(@NotNull String path) {
List<?> list = getList(path); List<?> list = getList(path);
@ -602,6 +644,7 @@ public class MemorySection implements ConfigurationSection {
return result; return result;
} }
@Override
@NotNull @NotNull
public List<Short> getShortList(@NotNull String path) { public List<Short> getShortList(@NotNull String path) {
List<?> list = getList(path); List<?> list = getList(path);
@ -630,6 +673,7 @@ public class MemorySection implements ConfigurationSection {
return result; return result;
} }
@Override
@NotNull @NotNull
public List<Map<?, ?>> getMapList(@NotNull String path) { public List<Map<?, ?>> getMapList(@NotNull String path) {
List<?> list = getList(path); List<?> list = getList(path);
@ -677,62 +721,75 @@ public class MemorySection implements ConfigurationSection {
return getObject(path, clazz, def); return getObject(path, clazz, def);
} }
@Override
@Nullable @Nullable
public Vector getVector(@NotNull String path) { public Vector getVector(@NotNull String path) {
return getSerializable(path, Vector.class); return getSerializable(path, Vector.class);
} }
@Override
@Nullable @Nullable
public Vector getVector(@NotNull String path, @Nullable Vector def) { public Vector getVector(@NotNull String path, @Nullable Vector def) {
return getSerializable(path, Vector.class, def); return getSerializable(path, Vector.class, def);
} }
@Override
public boolean isVector(@NotNull String path) { public boolean isVector(@NotNull String path) {
return getSerializable(path, Vector.class) != null; return getSerializable(path, Vector.class) != null;
} }
@Override
@Nullable @Nullable
public OfflinePlayer getOfflinePlayer(@NotNull String path) { public OfflinePlayer getOfflinePlayer(@NotNull String path) {
return getSerializable(path, OfflinePlayer.class); return getSerializable(path, OfflinePlayer.class);
} }
@Override
@Nullable @Nullable
public OfflinePlayer getOfflinePlayer(@NotNull String path, @Nullable OfflinePlayer def) { public OfflinePlayer getOfflinePlayer(@NotNull String path, @Nullable OfflinePlayer def) {
return getSerializable(path, OfflinePlayer.class, def); return getSerializable(path, OfflinePlayer.class, def);
} }
@Override
public boolean isOfflinePlayer(@NotNull String path) { public boolean isOfflinePlayer(@NotNull String path) {
return getSerializable(path, OfflinePlayer.class) != null; return getSerializable(path, OfflinePlayer.class) != null;
} }
@Override
@Nullable @Nullable
public ItemStack getItemStack(@NotNull String path) { public ItemStack getItemStack(@NotNull String path) {
return getSerializable(path, ItemStack.class); return getSerializable(path, ItemStack.class);
} }
@Override
@Nullable @Nullable
public ItemStack getItemStack(@NotNull String path, @Nullable ItemStack def) { public ItemStack getItemStack(@NotNull String path, @Nullable ItemStack def) {
return getSerializable(path, ItemStack.class, def); return getSerializable(path, ItemStack.class, def);
} }
@Override
public boolean isItemStack(@NotNull String path) { public boolean isItemStack(@NotNull String path) {
return getSerializable(path, ItemStack.class) != null; return getSerializable(path, ItemStack.class) != null;
} }
@Override
@Nullable @Nullable
public Color getColor(@NotNull String path) { public Color getColor(@NotNull String path) {
return getSerializable(path, Color.class); return getSerializable(path, Color.class);
} }
@Override
@Nullable @Nullable
public Color getColor(@NotNull String path, @Nullable Color def) { public Color getColor(@NotNull String path, @Nullable Color def) {
return getSerializable(path, Color.class, def); return getSerializable(path, Color.class, def);
} }
@Override
public boolean isColor(@NotNull String path) { public boolean isColor(@NotNull String path) {
return getSerializable(path, Color.class) != null; return getSerializable(path, Color.class) != null;
} }
@Override
@Nullable @Nullable
public ConfigurationSection getConfigurationSection(@NotNull String path) { public ConfigurationSection getConfigurationSection(@NotNull String path) {
Object val = get(path, null); Object val = get(path, null);
@ -744,6 +801,7 @@ public class MemorySection implements ConfigurationSection {
return (val instanceof ConfigurationSection) ? createSection(path) : null; return (val instanceof ConfigurationSection) ? createSection(path) : null;
} }
@Override
public boolean isConfigurationSection(@NotNull String path) { public boolean isConfigurationSection(@NotNull String path) {
Object val = get(path); Object val = get(path);
return val instanceof ConfigurationSection; return val instanceof ConfigurationSection;

View file

@ -225,6 +225,7 @@ public class ConversationFactory {
private class NotPlayerMessagePrompt extends MessagePrompt { private class NotPlayerMessagePrompt extends MessagePrompt {
@Override
@NotNull @NotNull
public String getPromptText(@NotNull ConversationContext context) { public String getPromptText(@NotNull ConversationContext context) {
return playerOnlyMessage; return playerOnlyMessage;

View file

@ -19,12 +19,15 @@ public class ExactMatchConversationCanceller implements ConversationCanceller {
this.escapeSequence = escapeSequence; this.escapeSequence = escapeSequence;
} }
@Override
public void setConversation(@NotNull Conversation conversation) {} public void setConversation(@NotNull Conversation conversation) {}
@Override
public boolean cancelBasedOnInput(@NotNull ConversationContext context, @NotNull String input) { public boolean cancelBasedOnInput(@NotNull ConversationContext context, @NotNull String input) {
return input.equals(escapeSequence); return input.equals(escapeSequence);
} }
@Override
@NotNull @NotNull
public ConversationCanceller clone() { public ConversationCanceller clone() {
return new ExactMatchConversationCanceller(escapeSequence); return new ExactMatchConversationCanceller(escapeSequence);

View file

@ -24,11 +24,13 @@ public class InactivityConversationCanceller implements ConversationCanceller {
this.timeoutSeconds = timeoutSeconds; this.timeoutSeconds = timeoutSeconds;
} }
@Override
public void setConversation(@NotNull Conversation conversation) { public void setConversation(@NotNull Conversation conversation) {
this.conversation = conversation; this.conversation = conversation;
startTimer(); startTimer();
} }
@Override
public boolean cancelBasedOnInput(@NotNull ConversationContext context, @NotNull String input) { public boolean cancelBasedOnInput(@NotNull ConversationContext context, @NotNull String input) {
// Reset the inactivity timer // Reset the inactivity timer
stopTimer(); stopTimer();
@ -36,6 +38,7 @@ public class InactivityConversationCanceller implements ConversationCanceller {
return false; return false;
} }
@Override
@NotNull @NotNull
public ConversationCanceller clone() { public ConversationCanceller clone() {
return new InactivityConversationCanceller(plugin, timeoutSeconds); return new InactivityConversationCanceller(plugin, timeoutSeconds);
@ -46,6 +49,7 @@ public class InactivityConversationCanceller implements ConversationCanceller {
*/ */
private void startTimer() { private void startTimer() {
taskId = plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() { taskId = plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
@Override
public void run() { public void run() {
if (conversation.getState() == Conversation.ConversationState.UNSTARTED) { if (conversation.getState() == Conversation.ConversationState.UNSTARTED) {
startTimer(); startTimer();

View file

@ -8,14 +8,17 @@ import org.jetbrains.annotations.NotNull;
* abandoned by programmatically calling the abandon() method on it. * abandoned by programmatically calling the abandon() method on it.
*/ */
public class ManuallyAbandonedConversationCanceller implements ConversationCanceller { public class ManuallyAbandonedConversationCanceller implements ConversationCanceller {
@Override
public void setConversation(@NotNull Conversation conversation) { public void setConversation(@NotNull Conversation conversation) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
@Override
public boolean cancelBasedOnInput(@NotNull ConversationContext context, @NotNull String input) { public boolean cancelBasedOnInput(@NotNull ConversationContext context, @NotNull String input) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
@Override
@NotNull @NotNull
public ConversationCanceller clone() { public ConversationCanceller clone() {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();

View file

@ -19,6 +19,7 @@ public abstract class MessagePrompt implements Prompt {
* @param context Context information about the conversation. * @param context Context information about the conversation.
* @return Always false. * @return Always false.
*/ */
@Override
public boolean blocksForInput(@NotNull ConversationContext context) { public boolean blocksForInput(@NotNull ConversationContext context) {
return false; return false;
} }
@ -31,6 +32,7 @@ public abstract class MessagePrompt implements Prompt {
* @param input Ignored. * @param input Ignored.
* @return The next prompt in the prompt graph. * @return The next prompt in the prompt graph.
*/ */
@Override
@Nullable @Nullable
public Prompt acceptInput(@NotNull ConversationContext context, @Nullable String input) { public Prompt acceptInput(@NotNull ConversationContext context, @Nullable String input) {
return getNextPrompt(context); return getNextPrompt(context);

View file

@ -14,6 +14,7 @@ public class NullConversationPrefix implements ConversationPrefix {
* @param context Context information about the conversation. * @param context Context information about the conversation.
* @return An empty string. * @return An empty string.
*/ */
@Override
@NotNull @NotNull
public String getPrefix(@NotNull ConversationContext context) { public String getPrefix(@NotNull ConversationContext context) {
return ""; return "";

View file

@ -34,6 +34,7 @@ public class PluginNameConversationPrefix implements ConversationPrefix {
* @param context Context information about the conversation. * @param context Context information about the conversation.
* @return An empty string. * @return An empty string.
*/ */
@Override
@NotNull @NotNull
public String getPrefix(@NotNull ConversationContext context) { public String getPrefix(@NotNull ConversationContext context) {
return cachedPrefix; return cachedPrefix;

View file

@ -14,6 +14,7 @@ public abstract class StringPrompt implements Prompt {
* @param context Context information about the conversation. * @param context Context information about the conversation.
* @return True. * @return True.
*/ */
@Override
public boolean blocksForInput(@NotNull ConversationContext context) { public boolean blocksForInput(@NotNull ConversationContext context) {
return true; return true;
} }

View file

@ -23,6 +23,7 @@ public abstract class ValidatingPrompt implements Prompt {
* @param input The input text from the user. * @param input The input text from the user.
* @return This prompt or the next Prompt in the prompt graph. * @return This prompt or the next Prompt in the prompt graph.
*/ */
@Override
@Nullable @Nullable
public Prompt acceptInput(@NotNull ConversationContext context, @Nullable String input) { public Prompt acceptInput(@NotNull ConversationContext context, @Nullable String input) {
if (isInputValid(context, input)) { if (isInputValid(context, input)) {
@ -43,6 +44,7 @@ public abstract class ValidatingPrompt implements Prompt {
* @param context Context information about the conversation. * @param context Context information about the conversation.
* @return True. * @return True.
*/ */
@Override
public boolean blocksForInput(@NotNull ConversationContext context) { public boolean blocksForInput(@NotNull ConversationContext context) {
return true; return true;
} }

View file

@ -6,6 +6,7 @@ import org.jetbrains.annotations.NotNull;
* Represents an ender dragon part * Represents an ender dragon part
*/ */
public interface EnderDragonPart extends ComplexEntityPart, Damageable { public interface EnderDragonPart extends ComplexEntityPart, Damageable {
@Override
@NotNull @NotNull
public EnderDragon getParent(); public EnderDragon getParent();
} }

View file

@ -223,6 +223,7 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
* *
* @return Server instance running this Entity * @return Server instance running this Entity
*/ */
@Override
@NotNull @NotNull
public Server getServer(); public Server getServer();

View file

@ -138,6 +138,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* *
* @param message Message to be displayed * @param message Message to be displayed
*/ */
@Override
public void sendRawMessage(@NotNull String message); public void sendRawMessage(@NotNull String message);
/** /**

View file

@ -13,6 +13,7 @@ public interface Vehicle extends Entity {
* *
* @return velocity vector * @return velocity vector
*/ */
@Override
@NotNull @NotNull
public Vector getVelocity(); public Vector getVelocity();
@ -21,5 +22,6 @@ public interface Vehicle extends Entity {
* *
* @param vel velocity vector * @param vel velocity vector
*/ */
@Override
public void setVelocity(@NotNull Vector vel); public void setVelocity(@NotNull Vector vel);
} }

View file

@ -66,10 +66,12 @@ public class BlockBreakEvent extends BlockExpEvent implements Cancellable {
return this.dropItems; return this.dropItems;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancel; return cancel;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancel = cancel; this.cancel = cancel;
} }

View file

@ -38,10 +38,12 @@ public class BlockBurnEvent extends BlockEvent implements Cancellable {
return ignitingBlock; return ignitingBlock;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancelled; return cancelled;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancelled = cancel; this.cancelled = cancel;
} }

View file

@ -67,10 +67,12 @@ public class BlockDamageEvent extends BlockEvent implements Cancellable {
return itemstack; return itemstack;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancel; return cancel;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancel = cancel; this.cancel = cancel;
} }

View file

@ -68,10 +68,12 @@ public class BlockDispenseEvent extends BlockEvent implements Cancellable {
velocity = vel; velocity = vel;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancelled; return cancelled;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
cancelled = cancel; cancelled = cancel;
} }

View file

@ -36,6 +36,7 @@ public class BlockExpEvent extends BlockEvent {
this.exp = exp; this.exp = exp;
} }
@Override
@NotNull @NotNull
public HandlerList getHandlers() { public HandlerList getHandlers() {
return handlers; return handlers;

View file

@ -22,10 +22,12 @@ public class BlockExplodeEvent extends BlockEvent implements Cancellable {
this.cancel = false; this.cancel = false;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancel; return cancel;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancel = cancel; this.cancel = cancel;
} }

View file

@ -44,10 +44,12 @@ public class BlockFadeEvent extends BlockEvent implements Cancellable {
return newState; return newState;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancelled; return cancelled;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancelled = cancel; this.cancelled = cancel;
} }

View file

@ -55,10 +55,12 @@ public class BlockFromToEvent extends BlockEvent implements Cancellable {
return to; return to;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancel; return cancel;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancel = cancel; this.cancel = cancel;
} }

View file

@ -41,14 +41,17 @@ public class BlockGrowEvent extends BlockEvent implements Cancellable {
return newState; return newState;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancelled; return cancelled;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancelled = cancel; this.cancelled = cancel;
} }
@Override
@NotNull @NotNull
public HandlerList getHandlers() { public HandlerList getHandlers() {
return handlers; return handlers;

View file

@ -37,10 +37,12 @@ public class BlockIgniteEvent extends BlockEvent implements Cancellable {
this.cancel = false; this.cancel = false;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancel; return cancel;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancel = cancel; this.cancel = cancel;
} }

View file

@ -64,10 +64,12 @@ public class BlockPhysicsEvent extends BlockEvent implements Cancellable {
return changed.getMaterial(); return changed.getMaterial();
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancel; return cancel;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancel = cancel; this.cancel = cancel;
} }

View file

@ -18,10 +18,12 @@ public abstract class BlockPistonEvent extends BlockEvent implements Cancellable
this.direction = direction; this.direction = direction;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return this.cancelled; return this.cancelled;
} }
@Override
public void setCancelled(boolean cancelled) { public void setCancelled(boolean cancelled) {
this.cancelled = cancelled; this.cancelled = cancelled;
} }

View file

@ -40,10 +40,12 @@ public class BlockPlaceEvent extends BlockEvent implements Cancellable {
cancel = false; cancel = false;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancel; return cancel;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancel = cancel; this.cancel = cancel;
} }

View file

@ -18,10 +18,12 @@ public class LeavesDecayEvent extends BlockEvent implements Cancellable {
super(block); super(block);
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancel; return cancel;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancel = cancel; this.cancel = cancel;
} }

View file

@ -24,10 +24,12 @@ public class NotePlayEvent extends BlockEvent implements Cancellable {
this.note = note; this.note = note;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancelled; return cancelled;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancelled = cancel; this.cancelled = cancel;
} }

View file

@ -70,10 +70,12 @@ public class SignChangeEvent extends BlockEvent implements Cancellable {
lines[index] = line; lines[index] = line;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancel; return cancel;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancel = cancel; this.cancel = cancel;
} }

View file

@ -106,10 +106,12 @@ public class EnchantItemEvent extends InventoryEvent implements Cancellable {
return button; return button;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancelled; return cancelled;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancelled = cancel; this.cancelled = cancel;
} }

View file

@ -28,10 +28,12 @@ public class CreeperPowerEvent extends EntityEvent implements Cancellable {
this.cause = cause; this.cause = cause;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return canceled; return canceled;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
canceled = cancel; canceled = cancel;
} }

View file

@ -34,10 +34,12 @@ public class EntityChangeBlockEvent extends EntityEvent implements Cancellable {
return block; return block;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancel; return cancel;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancel = cancel; this.cancel = cancel;
} }

View file

@ -21,10 +21,12 @@ public class EntityCombustEvent extends EntityEvent implements Cancellable {
this.cancel = false; this.cancel = false;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancel; return cancel;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancel = cancel; this.cancel = cancel;
} }

View file

@ -40,10 +40,12 @@ public class EntityCreatePortalEvent extends EntityEvent implements Cancellable
return blocks; return blocks;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancelled; return cancelled;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancelled = cancel; this.cancelled = cancel;
} }

View file

@ -43,10 +43,12 @@ public class EntityDamageEvent extends EntityEvent implements Cancellable {
this.modifierFunctions = modifierFunctions; this.modifierFunctions = modifierFunctions;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancelled; return cancelled;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
cancelled = cancel; cancelled = cancel;
} }

View file

@ -26,10 +26,12 @@ public class EntityExplodeEvent extends EntityEvent implements Cancellable {
this.cancel = false; this.cancel = false;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancel; return cancel;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancel = cancel; this.cancel = cancel;
} }

View file

@ -19,10 +19,12 @@ public class EntityInteractEvent extends EntityEvent implements Cancellable {
this.block = block; this.block = block;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancelled; return cancelled;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
cancelled = cancel; cancelled = cancel;
} }

View file

@ -46,10 +46,12 @@ public class EntityPickupItemEvent extends EntityEvent implements Cancellable {
return remaining; return remaining;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancel; return cancel;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancel = cancel; this.cancel = cancel;
} }

View file

@ -69,10 +69,12 @@ public class EntityShootBowEvent extends EntityEvent implements Cancellable {
return force; return force;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancelled; return cancelled;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
cancelled = cancel; cancelled = cancel;
} }

View file

@ -25,10 +25,12 @@ public class EntityTameEvent extends EntityEvent implements Cancellable {
return (LivingEntity) entity; return (LivingEntity) entity;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancelled; return cancelled;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
cancelled = cancel; cancelled = cancel;
} }

View file

@ -21,10 +21,12 @@ public class EntityTargetEvent extends EntityEvent implements Cancellable {
this.reason = reason; this.reason = reason;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancel; return cancel;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancel = cancel; this.cancel = cancel;
} }

View file

@ -14,6 +14,7 @@ public class EntityTargetLivingEntityEvent extends EntityTargetEvent{
super(entity, target, reason); super(entity, target, reason);
} }
@Override
@Nullable @Nullable
public LivingEntity getTarget() { public LivingEntity getTarget() {
return (LivingEntity) super.getTarget(); return (LivingEntity) super.getTarget();
@ -29,6 +30,7 @@ public class EntityTargetLivingEntityEvent extends EntityTargetEvent{
* *
* @param target The entity to target * @param target The entity to target
*/ */
@Override
public void setTarget(@Nullable Entity target) { public void setTarget(@Nullable Entity target) {
if (target == null || target instanceof LivingEntity) { if (target == null || target instanceof LivingEntity) {
super.setTarget(target); super.setTarget(target);

View file

@ -26,10 +26,12 @@ public class EntityTeleportEvent extends EntityEvent implements Cancellable {
this.cancel = false; this.cancel = false;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancel; return cancel;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancel = cancel; this.cancel = cancel;
} }

View file

@ -26,10 +26,12 @@ public class ExplosionPrimeEvent extends EntityEvent implements Cancellable {
this(explosive, explosive.getYield(), explosive.isIncendiary()); this(explosive, explosive.getYield(), explosive.isIncendiary());
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancel; return cancel;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancel = cancel; this.cancel = cancel;
} }

View file

@ -49,10 +49,12 @@ public class FoodLevelChangeEvent extends EntityEvent implements Cancellable {
this.level = level; this.level = level;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancel; return cancel;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancel = cancel; this.cancel = cancel;
} }

View file

@ -18,6 +18,7 @@ public class HorseJumpEvent extends EntityEvent implements Cancellable {
this.power = power; this.power = power;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancelled; return cancelled;
} }
@ -25,6 +26,7 @@ public class HorseJumpEvent extends EntityEvent implements Cancellable {
/** /**
* @deprecated horse jumping was moved client side. * @deprecated horse jumping was moved client side.
*/ */
@Override
@Deprecated @Deprecated
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
cancelled = cancel; cancelled = cancel;

View file

@ -23,10 +23,12 @@ public class ItemDespawnEvent extends EntityEvent implements Cancellable {
location = loc; location = loc;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return canceled; return canceled;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
canceled = cancel; canceled = cancel;
} }

View file

@ -24,10 +24,12 @@ public class PigZapEvent extends EntityTransformEvent implements Cancellable {
this.pigzombie = pigzombie; this.pigzombie = pigzombie;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return canceled; return canceled;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
canceled = cancel; canceled = cancel;
} }

View file

@ -64,10 +64,12 @@ public class PlayerLeashEntityEvent extends Event implements Cancellable {
return handlers; return handlers;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return this.cancelled; return this.cancelled;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancelled = cancel; this.cancelled = cancel;
} }

View file

@ -78,10 +78,12 @@ public class PotionSplashEvent extends ProjectileHitEvent implements Cancellable
} }
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancelled; return cancelled;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
cancelled = cancel; cancelled = cancel;
} }

View file

@ -15,10 +15,12 @@ public class ProjectileLaunchEvent extends EntitySpawnEvent implements Cancellab
super(what); super(what);
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancelled; return cancelled;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
cancelled = cancel; cancelled = cancel;
} }

View file

@ -20,10 +20,12 @@ public class SheepDyeWoolEvent extends EntityEvent implements Cancellable {
this.color = color; this.color = color;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancel; return cancel;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancel = cancel; this.cancel = cancel;
} }

View file

@ -17,10 +17,12 @@ public class SheepRegrowWoolEvent extends EntityEvent implements Cancellable {
this.cancel = false; this.cancel = false;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancel; return cancel;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancel = cancel; this.cancel = cancel;
} }

View file

@ -18,10 +18,12 @@ public class SlimeSplitEvent extends EntityEvent implements Cancellable {
this.count = count; this.count = count;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancel; return cancel;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancel = cancel; this.cancel = cancel;
} }

View file

@ -28,10 +28,12 @@ public class HangingBreakEvent extends HangingEvent implements Cancellable {
return cause; return cause;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancelled; return cancelled;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancelled = cancel; this.cancelled = cancel;
} }

View file

@ -56,10 +56,12 @@ public class HangingPlaceEvent extends HangingEvent implements Cancellable {
return blockFace; return blockFace;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancelled; return cancelled;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancelled = cancel; this.cancelled = cancel;
} }

View file

@ -42,10 +42,12 @@ public class BrewEvent extends BlockEvent implements Cancellable {
return fuelLevel; return fuelLevel;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancelled; return cancelled;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
cancelled = cancel; cancelled = cancel;
} }

View file

@ -71,10 +71,12 @@ public class FurnaceBurnEvent extends BlockEvent implements Cancellable {
this.burning = burning; this.burning = burning;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancelled; return cancelled;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancelled = cancel; this.cancelled = cancel;
} }

View file

@ -18,11 +18,13 @@ public class InventoryCreativeEvent extends InventoryClickEvent {
this.item = newItem; this.item = newItem;
} }
@Override
@NotNull @NotNull
public ItemStack getCursor() { public ItemStack getCursor() {
return item; return item;
} }
@Override
public void setCursor(@NotNull ItemStack item) { public void setCursor(@NotNull ItemStack item) {
this.item = item; this.item = item;
} }

View file

@ -59,6 +59,7 @@ public abstract class InventoryInteractEvent extends InventoryEvent implements C
* *
* @return whether the event is cancelled * @return whether the event is cancelled
*/ */
@Override
public boolean isCancelled() { public boolean isCancelled() {
return getResult() == Result.DENY; return getResult() == Result.DENY;
} }
@ -72,6 +73,7 @@ public abstract class InventoryInteractEvent extends InventoryEvent implements C
* *
* @param toCancel result becomes DENY if true, ALLOW if false * @param toCancel result becomes DENY if true, ALLOW if false
*/ */
@Override
public void setCancelled(boolean toCancel) { public void setCancelled(boolean toCancel) {
setResult(toCancel ? Result.DENY : Result.ALLOW); setResult(toCancel ? Result.DENY : Result.ALLOW);
} }

View file

@ -94,10 +94,12 @@ public class InventoryMoveItemEvent extends Event implements Cancellable {
return didSourceInitiate ? sourceInventory : destinationInventory; return didSourceInitiate ? sourceInventory : destinationInventory;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancelled; return cancelled;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancelled = cancel; this.cancelled = cancel;
} }

View file

@ -37,6 +37,7 @@ public class InventoryOpenEvent extends InventoryEvent implements Cancellable {
* *
* @return true if this event is cancelled * @return true if this event is cancelled
*/ */
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancelled; return cancelled;
} }
@ -50,6 +51,7 @@ public class InventoryOpenEvent extends InventoryEvent implements Cancellable {
* *
* @param cancel true if you wish to cancel this event * @param cancel true if you wish to cancel this event
*/ */
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
cancelled = cancel; cancelled = cancel;
} }

View file

@ -42,10 +42,12 @@ public class InventoryPickupItemEvent extends Event implements Cancellable {
return item; return item;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancelled; return cancelled;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancelled = cancel; this.cancelled = cancel;
} }

View file

@ -124,10 +124,12 @@ public class AsyncPlayerChatEvent extends PlayerEvent implements Cancellable {
return recipients; return recipients;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancel; return cancel;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancel = cancel; this.cancel = cancel;
} }

View file

@ -30,10 +30,12 @@ public class PlayerAchievementAwardedEvent extends PlayerEvent implements Cancel
return achievement; return achievement;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return isCancelled; return isCancelled;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.isCancelled = cancel; this.isCancelled = cancel;
} }

View file

@ -35,10 +35,12 @@ public class PlayerAnimationEvent extends PlayerEvent implements Cancellable {
return animationType; return animationType;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return this.isCancelled; return this.isCancelled;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.isCancelled = cancel; this.isCancelled = cancel;
} }

View file

@ -76,10 +76,12 @@ public abstract class PlayerBucketEvent extends PlayerEvent implements Cancellab
return blockFace; return blockFace;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancelled; return cancelled;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancelled = cancel; this.cancelled = cancel;
} }

View file

@ -42,10 +42,12 @@ public class PlayerChatEvent extends PlayerEvent implements Cancellable {
this.recipients = recipients; this.recipients = recipients;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancel; return cancel;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancel = cancel; this.cancel = cancel;
} }

View file

@ -63,10 +63,12 @@ public class PlayerCommandPreprocessEvent extends PlayerEvent implements Cancell
this.message = message; this.message = message;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancel; return cancel;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancel = cancel; this.cancel = cancel;
} }

View file

@ -29,10 +29,12 @@ public class PlayerDropItemEvent extends PlayerEvent implements Cancellable {
return drop; return drop;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancel; return cancel;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancel = cancel; this.cancel = cancel;
} }

View file

@ -122,10 +122,12 @@ public class PlayerEditBookEvent extends PlayerEvent implements Cancellable {
return handlers; return handlers;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancel; return cancel;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancel = cancel; this.cancel = cancel;
} }

View file

@ -50,10 +50,12 @@ public class PlayerFishEvent extends PlayerEvent implements Cancellable {
return hookEntity; return hookEntity;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancel; return cancel;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancel = cancel; this.cancel = cancel;
} }

View file

@ -19,10 +19,12 @@ public class PlayerGameModeChangeEvent extends PlayerEvent implements Cancellabl
this.newGameMode = newGameMode; this.newGameMode = newGameMode;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancelled; return cancelled;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancelled = cancel; this.cancelled = cancel;
} }

View file

@ -26,10 +26,12 @@ public class PlayerInteractEntityEvent extends PlayerEvent implements Cancellabl
this.hand = hand; this.hand = hand;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancelled; return cancelled;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancelled = cancel; this.cancelled = cancel;
} }

View file

@ -88,6 +88,7 @@ public class PlayerInteractEvent extends PlayerEvent implements Cancellable {
* *
* @param cancel true if you wish to cancel this event * @param cancel true if you wish to cancel this event
*/ */
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
setUseInteractedBlock(cancel ? Result.DENY : useInteractedBlock() == Result.DENY ? Result.DEFAULT : useInteractedBlock()); setUseInteractedBlock(cancel ? Result.DENY : useInteractedBlock() == Result.DENY ? Result.DEFAULT : useInteractedBlock());
setUseItemInHand(cancel ? Result.DENY : useItemInHand() == Result.DENY ? Result.DEFAULT : useItemInHand()); setUseItemInHand(cancel ? Result.DENY : useItemInHand() == Result.DENY ? Result.DEFAULT : useItemInHand());

View file

@ -58,10 +58,12 @@ public class PlayerItemConsumeEvent extends PlayerEvent implements Cancellable {
} }
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return this.isCancelled; return this.isCancelled;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.isCancelled = cancel; this.isCancelled = cancel;
} }

View file

@ -38,10 +38,12 @@ public class PlayerItemHeldEvent extends PlayerEvent implements Cancellable {
return current; return current;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancel; return cancel;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancel = cancel; this.cancel = cancel;
} }

View file

@ -41,10 +41,12 @@ public class PlayerKickEvent extends PlayerEvent implements Cancellable {
return leaveMessage; return leaveMessage;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancel; return cancel;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancel = cancel; this.cancel = cancel;
} }

View file

@ -33,6 +33,7 @@ public class PlayerMoveEvent extends PlayerEvent implements Cancellable {
* *
* @return true if this event is cancelled * @return true if this event is cancelled
*/ */
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancel; return cancel;
} }
@ -47,6 +48,7 @@ public class PlayerMoveEvent extends PlayerEvent implements Cancellable {
* *
* @param cancel true if you wish to cancel this event * @param cancel true if you wish to cancel this event
*/ */
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancel = cancel; this.cancel = cancel;
} }

View file

@ -45,10 +45,12 @@ public class PlayerPickupItemEvent extends PlayerEvent implements Cancellable {
return remaining; return remaining;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancel; return cancel;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancel = cancel; this.cancel = cancel;
} }

View file

@ -20,10 +20,12 @@ public class PlayerShearEntityEvent extends PlayerEvent implements Cancellable {
this.what = what; this.what = what;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancel; return cancel;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancel = cancel; this.cancel = cancel;
} }

View file

@ -102,10 +102,12 @@ public class PlayerStatisticIncrementEvent extends PlayerEvent implements Cancel
return material; return material;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return isCancelled; return isCancelled;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.isCancelled = cancel; this.isCancelled = cancel;
} }

View file

@ -27,10 +27,12 @@ public class PlayerToggleFlightEvent extends PlayerEvent implements Cancellable
return isFlying; return isFlying;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancel; return cancel;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancel = cancel; this.cancel = cancel;
} }

View file

@ -27,10 +27,12 @@ public class PlayerToggleSneakEvent extends PlayerEvent implements Cancellable {
return isSneaking; return isSneaking;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancel; return cancel;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancel = cancel; this.cancel = cancel;
} }

View file

@ -27,10 +27,12 @@ public class PlayerToggleSprintEvent extends PlayerEvent implements Cancellable
return isSprinting; return isSprinting;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancel; return cancel;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancel = cancel; this.cancel = cancel;
} }

View file

@ -28,10 +28,12 @@ public class PlayerUnleashEntityEvent extends EntityUnleashEvent implements Canc
return player; return player;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancelled; return cancelled;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancelled = cancel; this.cancelled = cancel;
} }

View file

@ -19,10 +19,12 @@ public class PlayerVelocityEvent extends PlayerEvent implements Cancellable {
this.velocity = velocity; this.velocity = velocity;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancel; return cancel;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancel = cancel; this.cancel = cancel;
} }

View file

@ -50,10 +50,12 @@ public class VehicleDamageEvent extends VehicleEvent implements Cancellable {
this.damage = damage; this.damage = damage;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancelled; return cancelled;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancelled = cancel; this.cancelled = cancel;
} }

View file

@ -32,10 +32,12 @@ public class VehicleDestroyEvent extends VehicleEvent implements Cancellable {
return attacker; return attacker;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancelled; return cancelled;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancelled = cancel; this.cancelled = cancel;
} }

View file

@ -29,10 +29,12 @@ public class VehicleEnterEvent extends VehicleEvent implements Cancellable {
return entered; return entered;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancelled; return cancelled;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancelled = cancel; this.cancelled = cancel;
} }

View file

@ -26,10 +26,12 @@ public class VehicleEntityCollisionEvent extends VehicleCollisionEvent implement
return entity; return entity;
} }
@Override
public boolean isCancelled() { public boolean isCancelled() {
return cancelled; return cancelled;
} }
@Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancelled = cancel; this.cancelled = cancel;
} }

Some files were not shown because too many files have changed in this diff Show more