mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-05 18:27:17 +01:00
Add Override annotations where appropriate
By: md_5 <git@md-5.net>
This commit is contained in:
parent
d66310a2f1
commit
82854b7bd7
176 changed files with 503 additions and 0 deletions
|
@ -317,6 +317,7 @@ public final class Color implements ConfigurationSerializable {
|
|||
return asRGB() ^ Color.class.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public Map<String, Object> serialize() {
|
||||
return ImmutableMap.<String, Object>of(
|
||||
|
|
|
@ -599,6 +599,7 @@ public class Location implements Cloneable, ConfigurationSerializable {
|
|||
return NumberConversions.floor(loc);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Utility
|
||||
@NotNull
|
||||
public Map<String, Object> serialize() {
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
@Override
|
||||
@Nullable
|
||||
public String getName();
|
||||
|
||||
|
@ -33,6 +34,7 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
|
|||
*
|
||||
* @return Player UUID
|
||||
*/
|
||||
@Override
|
||||
@NotNull
|
||||
public UUID getUniqueId();
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ public class DoubleChest implements InventoryHolder {
|
|||
inventory = chest;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public Inventory getInventory() {
|
||||
return inventory;
|
||||
|
|
|
@ -102,6 +102,7 @@ public final class PluginCommand extends Command implements PluginIdentifiableCo
|
|||
*
|
||||
* @return Plugin that owns this command
|
||||
*/
|
||||
@Override
|
||||
@NotNull
|
||||
public Plugin getPlugin() {
|
||||
return owningPlugin;
|
||||
|
|
|
@ -45,6 +45,7 @@ public class SimpleCommandMap implements CommandMap {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void registerAll(@NotNull String fallbackPrefix, @NotNull List<Command> commands) {
|
||||
if (commands != null) {
|
||||
for (Command c : commands) {
|
||||
|
@ -56,6 +57,7 @@ public class SimpleCommandMap implements CommandMap {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public boolean register(@NotNull String fallbackPrefix, @NotNull Command command) {
|
||||
return register(command.getName(), fallbackPrefix, command);
|
||||
}
|
||||
|
@ -63,6 +65,7 @@ public class SimpleCommandMap implements CommandMap {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public boolean register(@NotNull String label, @NotNull String fallbackPrefix, @NotNull Command command) {
|
||||
label = label.toLowerCase(java.util.Locale.ENGLISH).trim();
|
||||
fallbackPrefix = fallbackPrefix.toLowerCase(java.util.Locale.ENGLISH).trim();
|
||||
|
@ -125,6 +128,7 @@ public class SimpleCommandMap implements CommandMap {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public boolean dispatch(@NotNull CommandSender sender, @NotNull String commandLine) throws CommandException {
|
||||
String[] args = commandLine.split(" ");
|
||||
|
||||
|
@ -152,6 +156,7 @@ public class SimpleCommandMap implements CommandMap {
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void clearCommands() {
|
||||
for (Map.Entry<String, Command> entry : knownCommands.entrySet()) {
|
||||
entry.getValue().unregister(this);
|
||||
|
@ -160,17 +165,20 @@ public class SimpleCommandMap implements CommandMap {
|
|||
setDefaultCommands();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public Command getCommand(@NotNull String name) {
|
||||
Command target = knownCommands.get(name.toLowerCase(java.util.Locale.ENGLISH));
|
||||
return target;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public List<String> tabComplete(@NotNull CommandSender sender, @NotNull String cmdLine) {
|
||||
return tabComplete(sender, cmdLine, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public List<String> tabComplete(@NotNull CommandSender sender, @NotNull String cmdLine, @Nullable Location location) {
|
||||
Validate.notNull(sender, "Sender cannot be null");
|
||||
|
|
|
@ -22,6 +22,7 @@ public interface Configuration extends ConfigurationSection {
|
|||
* @param value Value to set the default to.
|
||||
* @throws IllegalArgumentException Thrown if path is null.
|
||||
*/
|
||||
@Override
|
||||
public void addDefault(@NotNull String path, @Nullable Object value);
|
||||
|
||||
/**
|
||||
|
|
|
@ -41,6 +41,7 @@ public class MemoryConfiguration extends MemorySection implements Configuration
|
|||
defaults.set(path, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDefaults(@NotNull Map<String, Object> defaults) {
|
||||
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) {
|
||||
Validate.notNull(defaults, "Defaults may not be null");
|
||||
|
||||
addDefaults(defaults.getValues(true));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDefaults(@NotNull Configuration defaults) {
|
||||
Validate.notNull(defaults, "Defaults may not be null");
|
||||
|
||||
this.defaults = defaults;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public Configuration getDefaults() {
|
||||
return defaults;
|
||||
|
@ -72,6 +76,7 @@ public class MemoryConfiguration extends MemorySection implements Configuration
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public MemoryConfigurationOptions options() {
|
||||
if (options == null) {
|
||||
|
|
|
@ -69,6 +69,7 @@ public class MemorySection implements ConfigurationSection {
|
|||
this.fullPath = createPath(parent, path);
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public Set<String> getKeys(boolean deep) {
|
||||
Set<String> result = new LinkedHashSet<String>();
|
||||
|
@ -87,6 +88,7 @@ public class MemorySection implements ConfigurationSection {
|
|||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public Map<String, Object> getValues(boolean deep) {
|
||||
Map<String, Object> result = new LinkedHashMap<String, Object>();
|
||||
|
@ -105,14 +107,17 @@ public class MemorySection implements ConfigurationSection {
|
|||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean contains(@NotNull String path) {
|
||||
return contains(path, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean contains(@NotNull String path, boolean ignoreDefault) {
|
||||
return ((ignoreDefault) ? get(path, null) : get(path)) != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSet(@NotNull String path) {
|
||||
Configuration root = getRoot();
|
||||
if (root == null) {
|
||||
|
@ -124,26 +129,31 @@ public class MemorySection implements ConfigurationSection {
|
|||
return get(path, null) != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getCurrentPath() {
|
||||
return fullPath;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getName() {
|
||||
return path;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public Configuration getRoot() {
|
||||
return root;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public ConfigurationSection getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDefault(@NotNull String path, @Nullable Object value) {
|
||||
Validate.notNull(path, "Path cannot be null");
|
||||
|
||||
|
@ -157,6 +167,7 @@ public class MemorySection implements ConfigurationSection {
|
|||
root.addDefault(createPath(this, path), value);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public ConfigurationSection getDefaultSection() {
|
||||
Configuration root = getRoot();
|
||||
|
@ -171,6 +182,7 @@ public class MemorySection implements ConfigurationSection {
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void set(@NotNull String path, @Nullable Object value) {
|
||||
Validate.notEmpty(path, "Cannot set to an empty path");
|
||||
|
||||
|
@ -210,11 +222,13 @@ public class MemorySection implements ConfigurationSection {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public Object get(@NotNull String path) {
|
||||
return get(path, getDefault(path));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public Object get(@NotNull String path, @Nullable Object def) {
|
||||
Validate.notNull(path, "Path cannot be null");
|
||||
|
@ -248,6 +262,7 @@ public class MemorySection implements ConfigurationSection {
|
|||
return section.get(key, def);
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public ConfigurationSection createSection(@NotNull String path) {
|
||||
Validate.notEmpty(path, "Cannot create section at empty path");
|
||||
|
@ -280,6 +295,7 @@ public class MemorySection implements ConfigurationSection {
|
|||
return section.createSection(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public ConfigurationSection createSection(@NotNull String path, @NotNull Map<?, ?> map) {
|
||||
ConfigurationSection section = createSection(path);
|
||||
|
@ -296,101 +312,120 @@ public class MemorySection implements ConfigurationSection {
|
|||
}
|
||||
|
||||
// Primitives
|
||||
@Override
|
||||
@Nullable
|
||||
public String getString(@NotNull String path) {
|
||||
Object def = getDefault(path);
|
||||
return getString(path, def != null ? def.toString() : null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public String getString(@NotNull String path, @Nullable String def) {
|
||||
Object val = get(path, def);
|
||||
return (val != null) ? val.toString() : def;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isString(@NotNull String path) {
|
||||
Object val = get(path);
|
||||
return val instanceof String;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInt(@NotNull String path) {
|
||||
Object def = getDefault(path);
|
||||
return getInt(path, (def instanceof Number) ? toInt(def) : 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInt(@NotNull String path, int def) {
|
||||
Object val = get(path, def);
|
||||
return (val instanceof Number) ? toInt(val) : def;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInt(@NotNull String path) {
|
||||
Object val = get(path);
|
||||
return val instanceof Integer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getBoolean(@NotNull String path) {
|
||||
Object def = getDefault(path);
|
||||
return getBoolean(path, (def instanceof Boolean) ? (Boolean) def : false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getBoolean(@NotNull String path, boolean def) {
|
||||
Object val = get(path, def);
|
||||
return (val instanceof Boolean) ? (Boolean) val : def;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBoolean(@NotNull String path) {
|
||||
Object val = get(path);
|
||||
return val instanceof Boolean;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getDouble(@NotNull String path) {
|
||||
Object def = getDefault(path);
|
||||
return getDouble(path, (def instanceof Number) ? toDouble(def) : 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getDouble(@NotNull String path, double def) {
|
||||
Object val = get(path, def);
|
||||
return (val instanceof Number) ? toDouble(val) : def;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDouble(@NotNull String path) {
|
||||
Object val = get(path);
|
||||
return val instanceof Double;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getLong(@NotNull String path) {
|
||||
Object def = getDefault(path);
|
||||
return getLong(path, (def instanceof Number) ? toLong(def) : 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getLong(@NotNull String path, long def) {
|
||||
Object val = get(path, def);
|
||||
return (val instanceof Number) ? toLong(val) : def;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isLong(@NotNull String path) {
|
||||
Object val = get(path);
|
||||
return val instanceof Long;
|
||||
}
|
||||
|
||||
// Java
|
||||
@Override
|
||||
@Nullable
|
||||
public List<?> getList(@NotNull String path) {
|
||||
Object def = getDefault(path);
|
||||
return getList(path, (def instanceof List) ? (List<?>) def : null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public List<?> getList(@NotNull String path, @Nullable List<?> def) {
|
||||
Object val = get(path, def);
|
||||
return (List<?>) ((val instanceof List) ? val : def);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isList(@NotNull String path) {
|
||||
Object val = get(path);
|
||||
return val instanceof List;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public List<String> getStringList(@NotNull String path) {
|
||||
List<?> list = getList(path);
|
||||
|
@ -410,6 +445,7 @@ public class MemorySection implements ConfigurationSection {
|
|||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public List<Integer> getIntegerList(@NotNull String path) {
|
||||
List<?> list = getList(path);
|
||||
|
@ -438,6 +474,7 @@ public class MemorySection implements ConfigurationSection {
|
|||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public List<Boolean> getBooleanList(@NotNull String path) {
|
||||
List<?> list = getList(path);
|
||||
|
@ -463,6 +500,7 @@ public class MemorySection implements ConfigurationSection {
|
|||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public List<Double> getDoubleList(@NotNull String path) {
|
||||
List<?> list = getList(path);
|
||||
|
@ -491,6 +529,7 @@ public class MemorySection implements ConfigurationSection {
|
|||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public List<Float> getFloatList(@NotNull String path) {
|
||||
List<?> list = getList(path);
|
||||
|
@ -519,6 +558,7 @@ public class MemorySection implements ConfigurationSection {
|
|||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public List<Long> getLongList(@NotNull String path) {
|
||||
List<?> list = getList(path);
|
||||
|
@ -547,6 +587,7 @@ public class MemorySection implements ConfigurationSection {
|
|||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public List<Byte> getByteList(@NotNull String path) {
|
||||
List<?> list = getList(path);
|
||||
|
@ -575,6 +616,7 @@ public class MemorySection implements ConfigurationSection {
|
|||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public List<Character> getCharacterList(@NotNull String path) {
|
||||
List<?> list = getList(path);
|
||||
|
@ -602,6 +644,7 @@ public class MemorySection implements ConfigurationSection {
|
|||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public List<Short> getShortList(@NotNull String path) {
|
||||
List<?> list = getList(path);
|
||||
|
@ -630,6 +673,7 @@ public class MemorySection implements ConfigurationSection {
|
|||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public List<Map<?, ?>> getMapList(@NotNull String path) {
|
||||
List<?> list = getList(path);
|
||||
|
@ -677,62 +721,75 @@ public class MemorySection implements ConfigurationSection {
|
|||
return getObject(path, clazz, def);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public Vector getVector(@NotNull String path) {
|
||||
return getSerializable(path, Vector.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public Vector getVector(@NotNull String path, @Nullable Vector def) {
|
||||
return getSerializable(path, Vector.class, def);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVector(@NotNull String path) {
|
||||
return getSerializable(path, Vector.class) != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public OfflinePlayer getOfflinePlayer(@NotNull String path) {
|
||||
return getSerializable(path, OfflinePlayer.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public OfflinePlayer getOfflinePlayer(@NotNull String path, @Nullable OfflinePlayer def) {
|
||||
return getSerializable(path, OfflinePlayer.class, def);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOfflinePlayer(@NotNull String path) {
|
||||
return getSerializable(path, OfflinePlayer.class) != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public ItemStack getItemStack(@NotNull String path) {
|
||||
return getSerializable(path, ItemStack.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public ItemStack getItemStack(@NotNull String path, @Nullable ItemStack def) {
|
||||
return getSerializable(path, ItemStack.class, def);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemStack(@NotNull String path) {
|
||||
return getSerializable(path, ItemStack.class) != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public Color getColor(@NotNull String path) {
|
||||
return getSerializable(path, Color.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public Color getColor(@NotNull String path, @Nullable Color def) {
|
||||
return getSerializable(path, Color.class, def);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isColor(@NotNull String path) {
|
||||
return getSerializable(path, Color.class) != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public ConfigurationSection getConfigurationSection(@NotNull String path) {
|
||||
Object val = get(path, null);
|
||||
|
@ -744,6 +801,7 @@ public class MemorySection implements ConfigurationSection {
|
|||
return (val instanceof ConfigurationSection) ? createSection(path) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isConfigurationSection(@NotNull String path) {
|
||||
Object val = get(path);
|
||||
return val instanceof ConfigurationSection;
|
||||
|
|
|
@ -225,6 +225,7 @@ public class ConversationFactory {
|
|||
|
||||
private class NotPlayerMessagePrompt extends MessagePrompt {
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getPromptText(@NotNull ConversationContext context) {
|
||||
return playerOnlyMessage;
|
||||
|
|
|
@ -19,12 +19,15 @@ public class ExactMatchConversationCanceller implements ConversationCanceller {
|
|||
this.escapeSequence = escapeSequence;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setConversation(@NotNull Conversation conversation) {}
|
||||
|
||||
@Override
|
||||
public boolean cancelBasedOnInput(@NotNull ConversationContext context, @NotNull String input) {
|
||||
return input.equals(escapeSequence);
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public ConversationCanceller clone() {
|
||||
return new ExactMatchConversationCanceller(escapeSequence);
|
||||
|
|
|
@ -24,11 +24,13 @@ public class InactivityConversationCanceller implements ConversationCanceller {
|
|||
this.timeoutSeconds = timeoutSeconds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setConversation(@NotNull Conversation conversation) {
|
||||
this.conversation = conversation;
|
||||
startTimer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean cancelBasedOnInput(@NotNull ConversationContext context, @NotNull String input) {
|
||||
// Reset the inactivity timer
|
||||
stopTimer();
|
||||
|
@ -36,6 +38,7 @@ public class InactivityConversationCanceller implements ConversationCanceller {
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public ConversationCanceller clone() {
|
||||
return new InactivityConversationCanceller(plugin, timeoutSeconds);
|
||||
|
@ -46,6 +49,7 @@ public class InactivityConversationCanceller implements ConversationCanceller {
|
|||
*/
|
||||
private void startTimer() {
|
||||
taskId = plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (conversation.getState() == Conversation.ConversationState.UNSTARTED) {
|
||||
startTimer();
|
||||
|
|
|
@ -8,14 +8,17 @@ import org.jetbrains.annotations.NotNull;
|
|||
* abandoned by programmatically calling the abandon() method on it.
|
||||
*/
|
||||
public class ManuallyAbandonedConversationCanceller implements ConversationCanceller {
|
||||
@Override
|
||||
public void setConversation(@NotNull Conversation conversation) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean cancelBasedOnInput(@NotNull ConversationContext context, @NotNull String input) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public ConversationCanceller clone() {
|
||||
throw new UnsupportedOperationException();
|
||||
|
|
|
@ -19,6 +19,7 @@ public abstract class MessagePrompt implements Prompt {
|
|||
* @param context Context information about the conversation.
|
||||
* @return Always false.
|
||||
*/
|
||||
@Override
|
||||
public boolean blocksForInput(@NotNull ConversationContext context) {
|
||||
return false;
|
||||
}
|
||||
|
@ -31,6 +32,7 @@ public abstract class MessagePrompt implements Prompt {
|
|||
* @param input Ignored.
|
||||
* @return The next prompt in the prompt graph.
|
||||
*/
|
||||
@Override
|
||||
@Nullable
|
||||
public Prompt acceptInput(@NotNull ConversationContext context, @Nullable String input) {
|
||||
return getNextPrompt(context);
|
||||
|
|
|
@ -14,6 +14,7 @@ public class NullConversationPrefix implements ConversationPrefix {
|
|||
* @param context Context information about the conversation.
|
||||
* @return An empty string.
|
||||
*/
|
||||
@Override
|
||||
@NotNull
|
||||
public String getPrefix(@NotNull ConversationContext context) {
|
||||
return "";
|
||||
|
|
|
@ -34,6 +34,7 @@ public class PluginNameConversationPrefix implements ConversationPrefix {
|
|||
* @param context Context information about the conversation.
|
||||
* @return An empty string.
|
||||
*/
|
||||
@Override
|
||||
@NotNull
|
||||
public String getPrefix(@NotNull ConversationContext context) {
|
||||
return cachedPrefix;
|
||||
|
|
|
@ -14,6 +14,7 @@ public abstract class StringPrompt implements Prompt {
|
|||
* @param context Context information about the conversation.
|
||||
* @return True.
|
||||
*/
|
||||
@Override
|
||||
public boolean blocksForInput(@NotNull ConversationContext context) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ public abstract class ValidatingPrompt implements Prompt {
|
|||
* @param input The input text from the user.
|
||||
* @return This prompt or the next Prompt in the prompt graph.
|
||||
*/
|
||||
@Override
|
||||
@Nullable
|
||||
public Prompt acceptInput(@NotNull ConversationContext context, @Nullable String input) {
|
||||
if (isInputValid(context, input)) {
|
||||
|
@ -43,6 +44,7 @@ public abstract class ValidatingPrompt implements Prompt {
|
|||
* @param context Context information about the conversation.
|
||||
* @return True.
|
||||
*/
|
||||
@Override
|
||||
public boolean blocksForInput(@NotNull ConversationContext context) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ import org.jetbrains.annotations.NotNull;
|
|||
* Represents an ender dragon part
|
||||
*/
|
||||
public interface EnderDragonPart extends ComplexEntityPart, Damageable {
|
||||
@Override
|
||||
@NotNull
|
||||
public EnderDragon getParent();
|
||||
}
|
||||
|
|
|
@ -223,6 +223,7 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
|||
*
|
||||
* @return Server instance running this Entity
|
||||
*/
|
||||
@Override
|
||||
@NotNull
|
||||
public Server getServer();
|
||||
|
||||
|
|
|
@ -138,6 +138,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
|||
*
|
||||
* @param message Message to be displayed
|
||||
*/
|
||||
@Override
|
||||
public void sendRawMessage(@NotNull String message);
|
||||
|
||||
/**
|
||||
|
|
|
@ -13,6 +13,7 @@ public interface Vehicle extends Entity {
|
|||
*
|
||||
* @return velocity vector
|
||||
*/
|
||||
@Override
|
||||
@NotNull
|
||||
public Vector getVelocity();
|
||||
|
||||
|
@ -21,5 +22,6 @@ public interface Vehicle extends Entity {
|
|||
*
|
||||
* @param vel velocity vector
|
||||
*/
|
||||
@Override
|
||||
public void setVelocity(@NotNull Vector vel);
|
||||
}
|
||||
|
|
|
@ -66,10 +66,12 @@ public class BlockBreakEvent extends BlockExpEvent implements Cancellable {
|
|||
return this.dropItems;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
|
|
@ -38,10 +38,12 @@ public class BlockBurnEvent extends BlockEvent implements Cancellable {
|
|||
return ignitingBlock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancelled = cancel;
|
||||
}
|
||||
|
|
|
@ -67,10 +67,12 @@ public class BlockDamageEvent extends BlockEvent implements Cancellable {
|
|||
return itemstack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
|
|
@ -68,10 +68,12 @@ public class BlockDispenseEvent extends BlockEvent implements Cancellable {
|
|||
velocity = vel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
cancelled = cancel;
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@ public class BlockExpEvent extends BlockEvent {
|
|||
this.exp = exp;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
|
|
|
@ -22,10 +22,12 @@ public class BlockExplodeEvent extends BlockEvent implements Cancellable {
|
|||
this.cancel = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
|
|
@ -44,10 +44,12 @@ public class BlockFadeEvent extends BlockEvent implements Cancellable {
|
|||
return newState;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancelled = cancel;
|
||||
}
|
||||
|
|
|
@ -55,10 +55,12 @@ public class BlockFromToEvent extends BlockEvent implements Cancellable {
|
|||
return to;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
|
|
@ -41,14 +41,17 @@ public class BlockGrowEvent extends BlockEvent implements Cancellable {
|
|||
return newState;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancelled = cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
|
|
|
@ -37,10 +37,12 @@ public class BlockIgniteEvent extends BlockEvent implements Cancellable {
|
|||
this.cancel = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
|
|
@ -64,10 +64,12 @@ public class BlockPhysicsEvent extends BlockEvent implements Cancellable {
|
|||
return changed.getMaterial();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
|
|
@ -18,10 +18,12 @@ public abstract class BlockPistonEvent extends BlockEvent implements Cancellable
|
|||
this.direction = direction;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return this.cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancelled) {
|
||||
this.cancelled = cancelled;
|
||||
}
|
||||
|
|
|
@ -40,10 +40,12 @@ public class BlockPlaceEvent extends BlockEvent implements Cancellable {
|
|||
cancel = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
|
|
@ -18,10 +18,12 @@ public class LeavesDecayEvent extends BlockEvent implements Cancellable {
|
|||
super(block);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
|
|
@ -24,10 +24,12 @@ public class NotePlayEvent extends BlockEvent implements Cancellable {
|
|||
this.note = note;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancelled = cancel;
|
||||
}
|
||||
|
|
|
@ -70,10 +70,12 @@ public class SignChangeEvent extends BlockEvent implements Cancellable {
|
|||
lines[index] = line;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
|
|
@ -106,10 +106,12 @@ public class EnchantItemEvent extends InventoryEvent implements Cancellable {
|
|||
return button;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancelled = cancel;
|
||||
}
|
||||
|
|
|
@ -28,10 +28,12 @@ public class CreeperPowerEvent extends EntityEvent implements Cancellable {
|
|||
this.cause = cause;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return canceled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
canceled = cancel;
|
||||
}
|
||||
|
|
|
@ -34,10 +34,12 @@ public class EntityChangeBlockEvent extends EntityEvent implements Cancellable {
|
|||
return block;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
|
|
@ -21,10 +21,12 @@ public class EntityCombustEvent extends EntityEvent implements Cancellable {
|
|||
this.cancel = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
|
|
@ -40,10 +40,12 @@ public class EntityCreatePortalEvent extends EntityEvent implements Cancellable
|
|||
return blocks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancelled = cancel;
|
||||
}
|
||||
|
|
|
@ -43,10 +43,12 @@ public class EntityDamageEvent extends EntityEvent implements Cancellable {
|
|||
this.modifierFunctions = modifierFunctions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
cancelled = cancel;
|
||||
}
|
||||
|
|
|
@ -26,10 +26,12 @@ public class EntityExplodeEvent extends EntityEvent implements Cancellable {
|
|||
this.cancel = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
|
|
@ -19,10 +19,12 @@ public class EntityInteractEvent extends EntityEvent implements Cancellable {
|
|||
this.block = block;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
cancelled = cancel;
|
||||
}
|
||||
|
|
|
@ -46,10 +46,12 @@ public class EntityPickupItemEvent extends EntityEvent implements Cancellable {
|
|||
return remaining;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
|
|
@ -69,10 +69,12 @@ public class EntityShootBowEvent extends EntityEvent implements Cancellable {
|
|||
return force;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
cancelled = cancel;
|
||||
}
|
||||
|
|
|
@ -25,10 +25,12 @@ public class EntityTameEvent extends EntityEvent implements Cancellable {
|
|||
return (LivingEntity) entity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
cancelled = cancel;
|
||||
}
|
||||
|
|
|
@ -21,10 +21,12 @@ public class EntityTargetEvent extends EntityEvent implements Cancellable {
|
|||
this.reason = reason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ public class EntityTargetLivingEntityEvent extends EntityTargetEvent{
|
|||
super(entity, target, reason);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public LivingEntity getTarget() {
|
||||
return (LivingEntity) super.getTarget();
|
||||
|
@ -29,6 +30,7 @@ public class EntityTargetLivingEntityEvent extends EntityTargetEvent{
|
|||
*
|
||||
* @param target The entity to target
|
||||
*/
|
||||
@Override
|
||||
public void setTarget(@Nullable Entity target) {
|
||||
if (target == null || target instanceof LivingEntity) {
|
||||
super.setTarget(target);
|
||||
|
|
|
@ -26,10 +26,12 @@ public class EntityTeleportEvent extends EntityEvent implements Cancellable {
|
|||
this.cancel = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
|
|
@ -26,10 +26,12 @@ public class ExplosionPrimeEvent extends EntityEvent implements Cancellable {
|
|||
this(explosive, explosive.getYield(), explosive.isIncendiary());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
|
|
@ -49,10 +49,12 @@ public class FoodLevelChangeEvent extends EntityEvent implements Cancellable {
|
|||
this.level = level;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ public class HorseJumpEvent extends EntityEvent implements Cancellable {
|
|||
this.power = power;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
@ -25,6 +26,7 @@ public class HorseJumpEvent extends EntityEvent implements Cancellable {
|
|||
/**
|
||||
* @deprecated horse jumping was moved client side.
|
||||
*/
|
||||
@Override
|
||||
@Deprecated
|
||||
public void setCancelled(boolean cancel) {
|
||||
cancelled = cancel;
|
||||
|
|
|
@ -23,10 +23,12 @@ public class ItemDespawnEvent extends EntityEvent implements Cancellable {
|
|||
location = loc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return canceled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
canceled = cancel;
|
||||
}
|
||||
|
|
|
@ -24,10 +24,12 @@ public class PigZapEvent extends EntityTransformEvent implements Cancellable {
|
|||
this.pigzombie = pigzombie;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return canceled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
canceled = cancel;
|
||||
}
|
||||
|
|
|
@ -64,10 +64,12 @@ public class PlayerLeashEntityEvent extends Event implements Cancellable {
|
|||
return handlers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return this.cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancelled = cancel;
|
||||
}
|
||||
|
|
|
@ -78,10 +78,12 @@ public class PotionSplashEvent extends ProjectileHitEvent implements Cancellable
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
cancelled = cancel;
|
||||
}
|
||||
|
|
|
@ -15,10 +15,12 @@ public class ProjectileLaunchEvent extends EntitySpawnEvent implements Cancellab
|
|||
super(what);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
cancelled = cancel;
|
||||
}
|
||||
|
|
|
@ -20,10 +20,12 @@ public class SheepDyeWoolEvent extends EntityEvent implements Cancellable {
|
|||
this.color = color;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
|
|
@ -17,10 +17,12 @@ public class SheepRegrowWoolEvent extends EntityEvent implements Cancellable {
|
|||
this.cancel = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
|
|
@ -18,10 +18,12 @@ public class SlimeSplitEvent extends EntityEvent implements Cancellable {
|
|||
this.count = count;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
|
|
@ -28,10 +28,12 @@ public class HangingBreakEvent extends HangingEvent implements Cancellable {
|
|||
return cause;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancelled = cancel;
|
||||
}
|
||||
|
|
|
@ -56,10 +56,12 @@ public class HangingPlaceEvent extends HangingEvent implements Cancellable {
|
|||
return blockFace;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancelled = cancel;
|
||||
}
|
||||
|
|
|
@ -42,10 +42,12 @@ public class BrewEvent extends BlockEvent implements Cancellable {
|
|||
return fuelLevel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
cancelled = cancel;
|
||||
}
|
||||
|
|
|
@ -71,10 +71,12 @@ public class FurnaceBurnEvent extends BlockEvent implements Cancellable {
|
|||
this.burning = burning;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancelled = cancel;
|
||||
}
|
||||
|
|
|
@ -18,11 +18,13 @@ public class InventoryCreativeEvent extends InventoryClickEvent {
|
|||
this.item = newItem;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public ItemStack getCursor() {
|
||||
return item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCursor(@NotNull ItemStack item) {
|
||||
this.item = item;
|
||||
}
|
||||
|
|
|
@ -59,6 +59,7 @@ public abstract class InventoryInteractEvent extends InventoryEvent implements C
|
|||
*
|
||||
* @return whether the event is cancelled
|
||||
*/
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
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
|
||||
*/
|
||||
@Override
|
||||
public void setCancelled(boolean toCancel) {
|
||||
setResult(toCancel ? Result.DENY : Result.ALLOW);
|
||||
}
|
||||
|
|
|
@ -94,10 +94,12 @@ public class InventoryMoveItemEvent extends Event implements Cancellable {
|
|||
return didSourceInitiate ? sourceInventory : destinationInventory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancelled = cancel;
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@ public class InventoryOpenEvent extends InventoryEvent implements Cancellable {
|
|||
*
|
||||
* @return true if this event is cancelled
|
||||
*/
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
@ -50,6 +51,7 @@ public class InventoryOpenEvent extends InventoryEvent implements Cancellable {
|
|||
*
|
||||
* @param cancel true if you wish to cancel this event
|
||||
*/
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
cancelled = cancel;
|
||||
}
|
||||
|
|
|
@ -42,10 +42,12 @@ public class InventoryPickupItemEvent extends Event implements Cancellable {
|
|||
return item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancelled = cancel;
|
||||
}
|
||||
|
|
|
@ -124,10 +124,12 @@ public class AsyncPlayerChatEvent extends PlayerEvent implements Cancellable {
|
|||
return recipients;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
|
|
@ -30,10 +30,12 @@ public class PlayerAchievementAwardedEvent extends PlayerEvent implements Cancel
|
|||
return achievement;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return isCancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.isCancelled = cancel;
|
||||
}
|
||||
|
|
|
@ -35,10 +35,12 @@ public class PlayerAnimationEvent extends PlayerEvent implements Cancellable {
|
|||
return animationType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return this.isCancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.isCancelled = cancel;
|
||||
}
|
||||
|
|
|
@ -76,10 +76,12 @@ public abstract class PlayerBucketEvent extends PlayerEvent implements Cancellab
|
|||
return blockFace;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancelled = cancel;
|
||||
}
|
||||
|
|
|
@ -42,10 +42,12 @@ public class PlayerChatEvent extends PlayerEvent implements Cancellable {
|
|||
this.recipients = recipients;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
|
|
@ -63,10 +63,12 @@ public class PlayerCommandPreprocessEvent extends PlayerEvent implements Cancell
|
|||
this.message = message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
|
|
@ -29,10 +29,12 @@ public class PlayerDropItemEvent extends PlayerEvent implements Cancellable {
|
|||
return drop;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
|
|
@ -122,10 +122,12 @@ public class PlayerEditBookEvent extends PlayerEvent implements Cancellable {
|
|||
return handlers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
|
|
@ -50,10 +50,12 @@ public class PlayerFishEvent extends PlayerEvent implements Cancellable {
|
|||
return hookEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
|
|
@ -19,10 +19,12 @@ public class PlayerGameModeChangeEvent extends PlayerEvent implements Cancellabl
|
|||
this.newGameMode = newGameMode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancelled = cancel;
|
||||
}
|
||||
|
|
|
@ -26,10 +26,12 @@ public class PlayerInteractEntityEvent extends PlayerEvent implements Cancellabl
|
|||
this.hand = hand;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancelled = cancel;
|
||||
}
|
||||
|
|
|
@ -88,6 +88,7 @@ public class PlayerInteractEvent extends PlayerEvent implements Cancellable {
|
|||
*
|
||||
* @param cancel true if you wish to cancel this event
|
||||
*/
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
setUseInteractedBlock(cancel ? Result.DENY : useInteractedBlock() == Result.DENY ? Result.DEFAULT : useInteractedBlock());
|
||||
setUseItemInHand(cancel ? Result.DENY : useItemInHand() == Result.DENY ? Result.DEFAULT : useItemInHand());
|
||||
|
|
|
@ -58,10 +58,12 @@ public class PlayerItemConsumeEvent extends PlayerEvent implements Cancellable {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return this.isCancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.isCancelled = cancel;
|
||||
}
|
||||
|
|
|
@ -38,10 +38,12 @@ public class PlayerItemHeldEvent extends PlayerEvent implements Cancellable {
|
|||
return current;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
|
|
@ -41,10 +41,12 @@ public class PlayerKickEvent extends PlayerEvent implements Cancellable {
|
|||
return leaveMessage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@ public class PlayerMoveEvent extends PlayerEvent implements Cancellable {
|
|||
*
|
||||
* @return true if this event is cancelled
|
||||
*/
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
@ -47,6 +48,7 @@ public class PlayerMoveEvent extends PlayerEvent implements Cancellable {
|
|||
*
|
||||
* @param cancel true if you wish to cancel this event
|
||||
*/
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
|
|
@ -45,10 +45,12 @@ public class PlayerPickupItemEvent extends PlayerEvent implements Cancellable {
|
|||
return remaining;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
|
|
@ -20,10 +20,12 @@ public class PlayerShearEntityEvent extends PlayerEvent implements Cancellable {
|
|||
this.what = what;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
|
|
@ -102,10 +102,12 @@ public class PlayerStatisticIncrementEvent extends PlayerEvent implements Cancel
|
|||
return material;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return isCancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.isCancelled = cancel;
|
||||
}
|
||||
|
|
|
@ -27,10 +27,12 @@ public class PlayerToggleFlightEvent extends PlayerEvent implements Cancellable
|
|||
return isFlying;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
|
|
@ -27,10 +27,12 @@ public class PlayerToggleSneakEvent extends PlayerEvent implements Cancellable {
|
|||
return isSneaking;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
|
|
@ -27,10 +27,12 @@ public class PlayerToggleSprintEvent extends PlayerEvent implements Cancellable
|
|||
return isSprinting;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
|
|
@ -28,10 +28,12 @@ public class PlayerUnleashEntityEvent extends EntityUnleashEvent implements Canc
|
|||
return player;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancelled = cancel;
|
||||
}
|
||||
|
|
|
@ -19,10 +19,12 @@ public class PlayerVelocityEvent extends PlayerEvent implements Cancellable {
|
|||
this.velocity = velocity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
|
|
@ -50,10 +50,12 @@ public class VehicleDamageEvent extends VehicleEvent implements Cancellable {
|
|||
this.damage = damage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancelled = cancel;
|
||||
}
|
||||
|
|
|
@ -32,10 +32,12 @@ public class VehicleDestroyEvent extends VehicleEvent implements Cancellable {
|
|||
return attacker;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancelled = cancel;
|
||||
}
|
||||
|
|
|
@ -29,10 +29,12 @@ public class VehicleEnterEvent extends VehicleEvent implements Cancellable {
|
|||
return entered;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancelled = cancel;
|
||||
}
|
||||
|
|
|
@ -26,10 +26,12 @@ public class VehicleEntityCollisionEvent extends VehicleCollisionEvent implement
|
|||
return entity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancelled = cancel;
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue