mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-27 15:00:13 +01:00
Properly fix JavaDoc linting issues
Fixes our own, and upstream's, issues with the stricter Java 8 JavaDoc linter. Also removes the destroystokyo-release maven repository. I'm not sure why I added it originally, but it's unnecessary now.
This commit is contained in:
parent
a22ed886b5
commit
3b5e6cd48f
12 changed files with 520 additions and 125 deletions
|
@ -6,7 +6,7 @@ Subject: [PATCH] Add configuration option to prevent player names from being
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index 4c20a1be..b7f0d5d9 100644
|
||||
index 498dfd33..4f27b9f2 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -0,0 +0,0 @@ public final class Bukkit {
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Add fromBottle flag to Experience Orbs
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/ExperienceOrb.java b/src/main/java/org/bukkit/entity/ExperienceOrb.java
|
||||
index c286edfd..bcb68fa7 100644
|
||||
index c286edfd..e8a83c06 100644
|
||||
--- a/src/main/java/org/bukkit/entity/ExperienceOrb.java
|
||||
+++ b/src/main/java/org/bukkit/entity/ExperienceOrb.java
|
||||
@@ -0,0 +0,0 @@ public interface ExperienceOrb extends Entity {
|
||||
|
@ -14,7 +14,9 @@ index c286edfd..bcb68fa7 100644
|
|||
public void setExperience(int value);
|
||||
+
|
||||
+ /**
|
||||
+ * Check if this orb was spawned from a ThrownExpBottle
|
||||
+ * Check if this orb was spawned from a {@link ThrownExpBottle}
|
||||
+ *
|
||||
+ * @return if orb was spawned from a bottle
|
||||
+ */
|
||||
+ public boolean isFromBottle();
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ Subject: [PATCH] Allow Reloading of Command Aliases
|
|||
Reload the aliases stored in commands.yml
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index 4a725d79..4c20a1be 100644
|
||||
index 4a725d79..498dfd33 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -0,0 +0,0 @@ public final class Bukkit {
|
||||
|
@ -16,6 +16,8 @@ index 4a725d79..4c20a1be 100644
|
|||
+
|
||||
+ /**
|
||||
+ * Reload the Command Aliases in commands.yml
|
||||
+ *
|
||||
+ * @return Whether the reload was successful
|
||||
+ */
|
||||
+ public static boolean reloadCommandAliases() {
|
||||
+ return server.reloadCommandAliases();
|
||||
|
@ -35,7 +37,7 @@ index 3c550d06..4f077b7c 100644
|
|||
+ boolean reloadCommandAliases(); // Paper
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/command/CommandMap.java b/src/main/java/org/bukkit/command/CommandMap.java
|
||||
index 30d60247..d8a75607 100644
|
||||
index 30d60247..938959aa 100644
|
||||
--- a/src/main/java/org/bukkit/command/CommandMap.java
|
||||
+++ b/src/main/java/org/bukkit/command/CommandMap.java
|
||||
@@ -0,0 +0,0 @@ public interface CommandMap {
|
||||
|
@ -45,8 +47,9 @@ index 30d60247..d8a75607 100644
|
|||
+
|
||||
+ // Paper start - Expose Known Commands
|
||||
+ /**
|
||||
+ * Return a Map (String -> Command) of Known Commands
|
||||
+ * @return Known Commands
|
||||
+ * Return a Map of known commands
|
||||
+ *
|
||||
+ * @return known commands
|
||||
+ */
|
||||
+ public java.util.Map<String, Command> getKnownCommands();
|
||||
+ // Paper end
|
||||
|
|
|
@ -5,14 +5,23 @@ Subject: [PATCH] Custom replacement for eaten items
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/event/player/PlayerItemConsumeEvent.java b/src/main/java/org/bukkit/event/player/PlayerItemConsumeEvent.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
index 8ab76b1d..7d28155b 100644
|
||||
--- a/src/main/java/org/bukkit/event/player/PlayerItemConsumeEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/player/PlayerItemConsumeEvent.java
|
||||
@@ -0,0 +0,0 @@ import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
+import javax.annotation.Nullable;
|
||||
+
|
||||
/**
|
||||
* This event will fire when a player is finishing consuming an item (food,
|
||||
* potion, milk bucket).
|
||||
@@ -0,0 +0,0 @@ public class PlayerItemConsumeEvent extends PlayerEvent implements Cancellable {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private boolean isCancelled = false;
|
||||
private ItemStack item;
|
||||
+ private ItemStack replacement; // Paper
|
||||
+ @Nullable private ItemStack replacement; // Paper
|
||||
|
||||
/**
|
||||
* @param player the player consuming
|
||||
|
@ -24,7 +33,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ /**
|
||||
+ * Return the custom item stack that will replace the consumed item, or null if no
|
||||
+ * custom replacement has been set (which means the default replacement will be used).
|
||||
+ *
|
||||
+ * @return The custom item stack that will replace the consumed item or null
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ public ItemStack getReplacement() {
|
||||
+ return this.replacement;
|
||||
+ }
|
||||
|
@ -32,8 +44,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ /**
|
||||
+ * Set a custom item stack to replace the consumed item. Pass null to clear any custom
|
||||
+ * stack that has been set and use the default replacement.
|
||||
+ *
|
||||
+ * @param replacement Replacement item to set, null to clear any custom stack and use default
|
||||
+ */
|
||||
+ public void setReplacement(ItemStack replacement) {
|
||||
+ public void setReplacement(@Nullable ItemStack replacement) {
|
||||
+ this.replacement = replacement;
|
||||
+ }
|
||||
+ // Paper end
|
||||
|
|
|
@ -0,0 +1,359 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Zach Brown <1254957+zachbr@users.noreply.github.com>
|
||||
Date: Sat, 10 Jun 2017 16:59:40 -0500
|
||||
Subject: [PATCH] Fix upstream javadoc warnings and errors
|
||||
|
||||
Upstream still refuses to use Java 8 with the API so they are likely unaware these are even issues.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/NamespacedKey.java b/src/main/java/org/bukkit/NamespacedKey.java
|
||||
index 9597a9d8..478f2c3c 100644
|
||||
--- a/src/main/java/org/bukkit/NamespacedKey.java
|
||||
+++ b/src/main/java/org/bukkit/NamespacedKey.java
|
||||
@@ -0,0 +0,0 @@ public final class NamespacedKey {
|
||||
/**
|
||||
* Create a key in a specific namespace.
|
||||
*
|
||||
- * @param namespace
|
||||
- * @param key
|
||||
+ * @param namespace String representing a grouping of keys
|
||||
+ * @param key Name for this specific key
|
||||
* @deprecated should never be used by plugins, for internal use only!!
|
||||
*/
|
||||
@Deprecated
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index 4abdbadf..dd0dcb16 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable {
|
||||
* @param count the number of particles
|
||||
* @param data the data to use for the particle or null,
|
||||
* the type of this depends on {@link Particle#getDataType()}
|
||||
+ * @param <T> Type
|
||||
*/
|
||||
public <T> void spawnParticle(Particle particle, Location location, int count, T data);
|
||||
|
||||
@@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable {
|
||||
* @param count the number of particles
|
||||
* @param data the data to use for the particle or null,
|
||||
* the type of this depends on {@link Particle#getDataType()}
|
||||
+ * @param <T> Type
|
||||
*/
|
||||
public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, T data);
|
||||
|
||||
@@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable {
|
||||
* @param offsetZ the maximum random offset on the Z axis
|
||||
* @param data the data to use for the particle or null,
|
||||
* the type of this depends on {@link Particle#getDataType()}
|
||||
+ * @param <T> Type
|
||||
*/
|
||||
public <T> void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, T data);
|
||||
|
||||
@@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable {
|
||||
* @param offsetZ the maximum random offset on the Z axis
|
||||
* @param data the data to use for the particle or null,
|
||||
* the type of this depends on {@link Particle#getDataType()}
|
||||
+ * @param <T> Type
|
||||
*/
|
||||
public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, T data);
|
||||
|
||||
@@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable {
|
||||
* particle used (normally speed)
|
||||
* @param data the data to use for the particle or null,
|
||||
* the type of this depends on {@link Particle#getDataType()}
|
||||
+ * @param <T> Type
|
||||
*/
|
||||
public <T> void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data);
|
||||
|
||||
@@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable {
|
||||
* particle used (normally speed)
|
||||
* @param data the data to use for the particle or null,
|
||||
* the type of this depends on {@link Particle#getDataType()}
|
||||
+ * @param <T> Type
|
||||
*/
|
||||
public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data);
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/AbstractHorse.java b/src/main/java/org/bukkit/entity/AbstractHorse.java
|
||||
index 0e615711..e912299b 100644
|
||||
--- a/src/main/java/org/bukkit/entity/AbstractHorse.java
|
||||
+++ b/src/main/java/org/bukkit/entity/AbstractHorse.java
|
||||
@@ -0,0 +0,0 @@ public interface AbstractHorse extends Animals, Vehicle, InventoryHolder, Tameab
|
||||
public Horse.Variant getVariant();
|
||||
|
||||
/**
|
||||
- * @param variant
|
||||
+ * @param variant Variant to set
|
||||
* @deprecated you are required to spawn a different entity
|
||||
*/
|
||||
@Deprecated
|
||||
diff --git a/src/main/java/org/bukkit/entity/Guardian.java b/src/main/java/org/bukkit/entity/Guardian.java
|
||||
index 98af0563..ec6890ae 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Guardian.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Guardian.java
|
||||
@@ -0,0 +0,0 @@ public interface Guardian extends Monster {
|
||||
public boolean isElder();
|
||||
|
||||
/**
|
||||
- * @param shouldBeElder
|
||||
+ * @param shouldBeElder Sets whether the Guardian is an Elder
|
||||
* @deprecated Must spawn a new {@link ElderGuardian}.
|
||||
*/
|
||||
@Deprecated
|
||||
diff --git a/src/main/java/org/bukkit/entity/Horse.java b/src/main/java/org/bukkit/entity/Horse.java
|
||||
index cfce8fa5..8660070b 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Horse.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Horse.java
|
||||
@@ -0,0 +0,0 @@ public interface Horse extends AbstractHorse {
|
||||
public boolean isCarryingChest();
|
||||
|
||||
/**
|
||||
- * @param chest
|
||||
+ * @param chest Sets whether the Horse is carrying a chest
|
||||
* @deprecated see {@link ChestedHorse}
|
||||
*/
|
||||
@Deprecated
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 41ba6c11..0c3eb03f 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
|
||||
*
|
||||
* Use supplied alternative character to the section symbol to represent legacy color codes.
|
||||
*
|
||||
- * @param alternateChar Alternate symbol such as '&'
|
||||
+ * @param alternateChar Alternate symbol such as '&'
|
||||
* @param message The message to send
|
||||
*/
|
||||
public void sendActionBar(char alternateChar, String message);
|
||||
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
|
||||
/**
|
||||
* Update the subtitle of titles displayed to the player
|
||||
*
|
||||
+ * @param subtitle Subtitle to set
|
||||
* @deprecated Use {@link #updateTitle(Title)}
|
||||
*/
|
||||
@Deprecated
|
||||
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
|
||||
/**
|
||||
* Update the subtitle of titles displayed to the player
|
||||
*
|
||||
+ * @param subtitle Subtitle to set
|
||||
* @deprecated Use {@link #updateTitle(Title)}
|
||||
*/
|
||||
@Deprecated
|
||||
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
|
||||
/**
|
||||
* Show the given title to the player, along with the last subtitle set, using the last set times
|
||||
*
|
||||
+ * @param title Title to set
|
||||
* @deprecated Use {@link #sendTitle(Title)} or {@link #updateTitle(Title)}
|
||||
*/
|
||||
@Deprecated
|
||||
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
|
||||
/**
|
||||
* Show the given title to the player, along with the last subtitle set, using the last set times
|
||||
*
|
||||
+ * @param title Title to set
|
||||
* @deprecated Use {@link #sendTitle(Title)} or {@link #updateTitle(Title)}
|
||||
*/
|
||||
@Deprecated
|
||||
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
|
||||
* @param count the number of particles
|
||||
* @param data the data to use for the particle or null,
|
||||
* the type of this depends on {@link Particle#getDataType()}
|
||||
+ * @param <T> Type
|
||||
*/
|
||||
public <T> void spawnParticle(Particle particle, Location location, int count, T data);
|
||||
|
||||
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
|
||||
* @param count the number of particles
|
||||
* @param data the data to use for the particle or null,
|
||||
* the type of this depends on {@link Particle#getDataType()}
|
||||
+ * @param <T> Type
|
||||
*/
|
||||
public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, T data);
|
||||
|
||||
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
|
||||
* @param offsetZ the maximum random offset on the Z axis
|
||||
* @param data the data to use for the particle or null,
|
||||
* the type of this depends on {@link Particle#getDataType()}
|
||||
+ * @param <T> Type
|
||||
*/
|
||||
public <T> void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, T data);
|
||||
|
||||
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
|
||||
* @param offsetZ the maximum random offset on the Z axis
|
||||
* @param data the data to use for the particle or null,
|
||||
* the type of this depends on {@link Particle#getDataType()}
|
||||
+ * @param <T> Type
|
||||
*/
|
||||
public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, T data);
|
||||
|
||||
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
|
||||
* particle used (normally speed)
|
||||
* @param data the data to use for the particle or null,
|
||||
* the type of this depends on {@link Particle#getDataType()}
|
||||
+ * @param <T> Type
|
||||
*/
|
||||
public <T> void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data);
|
||||
|
||||
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
|
||||
* particle used (normally speed)
|
||||
* @param data the data to use for the particle or null,
|
||||
* the type of this depends on {@link Particle#getDataType()}
|
||||
+ * @param <T> Type
|
||||
*/
|
||||
public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data);
|
||||
|
||||
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
|
||||
* Gets player locale language.
|
||||
*
|
||||
* @return the player's client language settings
|
||||
- * @deprecated Use {@link Player#getLocale()
|
||||
+ * @deprecated Use {@link Player#getLocale()}
|
||||
*/
|
||||
@Deprecated
|
||||
public String getLocale()
|
||||
diff --git a/src/main/java/org/bukkit/entity/Skeleton.java b/src/main/java/org/bukkit/entity/Skeleton.java
|
||||
index 2a02ab85..e33d00b3 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Skeleton.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Skeleton.java
|
||||
@@ -0,0 +0,0 @@ public interface Skeleton extends Monster {
|
||||
public SkeletonType getSkeletonType();
|
||||
|
||||
/**
|
||||
+ * @param type Type to set
|
||||
* @deprecated Must spawn a new subtype variant
|
||||
*/
|
||||
@Deprecated
|
||||
diff --git a/src/main/java/org/bukkit/entity/Zombie.java b/src/main/java/org/bukkit/entity/Zombie.java
|
||||
index cf53ea22..62923379 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Zombie.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Zombie.java
|
||||
@@ -0,0 +0,0 @@ public interface Zombie extends Monster {
|
||||
public boolean isVillager();
|
||||
|
||||
/**
|
||||
- * @param flag
|
||||
+ * @param flag Sets whether the Zombie is a villager
|
||||
* @deprecated must spawn {@link ZombieVillager}.
|
||||
*/
|
||||
@Deprecated
|
||||
public void setVillager(boolean flag);
|
||||
|
||||
/**
|
||||
- * @param profession
|
||||
+ * @param profession Sets the ZombieVillager's profession
|
||||
* @see ZombieVillager#getVillagerProfession()
|
||||
*/
|
||||
@Deprecated
|
||||
diff --git a/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java b/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java
|
||||
index de4fb37f..f1de2af6 100644
|
||||
--- a/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java
|
||||
@@ -0,0 +0,0 @@ public class PlayerLoginEvent extends PlayerEvent {
|
||||
* @param hostname The hostname that was used to connect to the server
|
||||
* @param address The address the player used to connect, provided for
|
||||
* timing issues
|
||||
+ * @param realAddress The unspoofed, actual address, that the player used to connect
|
||||
*/
|
||||
public PlayerLoginEvent(final Player player, final String hostname, final InetAddress address, final InetAddress realAddress) { // Spigot
|
||||
super(player);
|
||||
@@ -0,0 +0,0 @@ public class PlayerLoginEvent extends PlayerEvent {
|
||||
* timing issues
|
||||
* @param result The result status for this event
|
||||
* @param message The message to be displayed if result denies login
|
||||
+ * @param realAddress The unspoofed, actual address, that the player used to connect
|
||||
*/
|
||||
public PlayerLoginEvent(final Player player, String hostname, final InetAddress address, final Result result, final String message, final InetAddress realAddress) { // Spigot
|
||||
this(player, hostname, address, realAddress); // Spigot
|
||||
diff --git a/src/main/java/org/bukkit/inventory/Merchant.java b/src/main/java/org/bukkit/inventory/Merchant.java
|
||||
index c8e68570..45431b36 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/Merchant.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/Merchant.java
|
||||
@@ -0,0 +0,0 @@ public interface Merchant {
|
||||
*
|
||||
* @param i the index
|
||||
* @return the recipe
|
||||
- * @throws IndexOutOfBoundsException
|
||||
+ * @throws IndexOutOfBoundsException Throws when specified index is larger than Merchant's inventory
|
||||
*/
|
||||
MerchantRecipe getRecipe(int i) throws IndexOutOfBoundsException;
|
||||
|
||||
@@ -0,0 +0,0 @@ public interface Merchant {
|
||||
*
|
||||
* @param i the index
|
||||
* @param recipe the recipe
|
||||
- * @throws IndexOutOfBoundsException
|
||||
+ * @throws IndexOutOfBoundsException Throws when specified index is larger than Merchant's inventory
|
||||
*/
|
||||
void setRecipe(int i, MerchantRecipe recipe) throws IndexOutOfBoundsException;
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/potion/Potion.java b/src/main/java/org/bukkit/potion/Potion.java
|
||||
index 7aa5a2d1..54d85d0c 100644
|
||||
--- a/src/main/java/org/bukkit/potion/Potion.java
|
||||
+++ b/src/main/java/org/bukkit/potion/Potion.java
|
||||
@@ -0,0 +0,0 @@ public class Potion {
|
||||
}
|
||||
|
||||
/**
|
||||
+ * @param name Unused, always uses {@link PotionType#WATER}
|
||||
* @deprecated
|
||||
*/
|
||||
@Deprecated
|
||||
diff --git a/src/main/java/org/bukkit/potion/PotionBrewer.java b/src/main/java/org/bukkit/potion/PotionBrewer.java
|
||||
index 40f8d12b..33d19228 100644
|
||||
--- a/src/main/java/org/bukkit/potion/PotionBrewer.java
|
||||
+++ b/src/main/java/org/bukkit/potion/PotionBrewer.java
|
||||
@@ -0,0 +0,0 @@ public interface PotionBrewer {
|
||||
* a potion with the given type.
|
||||
*
|
||||
* @param type The type of the potion
|
||||
+ * @param upgraded Whether the potion is upgraded
|
||||
+ * @param extended Whether the potion is extended
|
||||
* @return The list of effects
|
||||
*/
|
||||
public Collection<PotionEffect> getEffects(PotionType type, boolean upgraded, boolean extended);
|
||||
diff --git a/src/main/java/org/bukkit/potion/PotionType.java b/src/main/java/org/bukkit/potion/PotionType.java
|
||||
index 60470b88..76313d4d 100644
|
||||
--- a/src/main/java/org/bukkit/potion/PotionType.java
|
||||
+++ b/src/main/java/org/bukkit/potion/PotionType.java
|
||||
@@ -0,0 +0,0 @@ public enum PotionType {
|
||||
}
|
||||
|
||||
/**
|
||||
+ * @return Damage value associated with this PotionType, broken
|
||||
* @deprecated Non-functional
|
||||
*/
|
||||
@Deprecated
|
||||
@@ -0,0 +0,0 @@ public enum PotionType {
|
||||
}
|
||||
|
||||
/**
|
||||
+ * @param damage Damage value associated with a PotionType
|
||||
+ * @return PotionType for given damage value, broken
|
||||
* @deprecated Non-functional
|
||||
*/
|
||||
@Deprecated
|
||||
@@ -0,0 +0,0 @@ public enum PotionType {
|
||||
}
|
||||
|
||||
/**
|
||||
+ * @param effectType EffectType
|
||||
+ * @return Associated PotionType
|
||||
* @deprecated Misleading
|
||||
*/
|
||||
@Deprecated
|
||||
diff --git a/src/main/java/org/bukkit/scoreboard/Team.java b/src/main/java/org/bukkit/scoreboard/Team.java
|
||||
index 170ae21a..c0de37a7 100644
|
||||
--- a/src/main/java/org/bukkit/scoreboard/Team.java
|
||||
+++ b/src/main/java/org/bukkit/scoreboard/Team.java
|
||||
@@ -0,0 +0,0 @@ public interface Team {
|
||||
* names are handled by prefixes / suffixes.
|
||||
*
|
||||
* @return team color, defaults to {@link ChatColor#RESET}
|
||||
- * @throws IllegalStateException
|
||||
+ * @throws IllegalStateException if this team has been unregistered
|
||||
*/
|
||||
ChatColor getColor() throws IllegalStateException;
|
||||
|
||||
--
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] POM changes
|
|||
|
||||
|
||||
diff --git a/pom.xml b/pom.xml
|
||||
index ecb870a0..48c2e544 100644
|
||||
index ecb870a0..968f9091 100644
|
||||
--- a/pom.xml
|
||||
+++ b/pom.xml
|
||||
@@ -0,0 +0,0 @@
|
||||
|
@ -37,7 +37,6 @@ index ecb870a0..48c2e544 100644
|
|||
- <maven.compiler.source>1.6</maven.compiler.source>
|
||||
- <maven.compiler.target>1.6</maven.compiler.target>
|
||||
+ <!-- Paper - Bump to 1.8 - Because Duh... -->
|
||||
+ <additionalparam>-Xdoclint:none</additionalparam>
|
||||
+ <maven.compiler.source>1.8</maven.compiler.source>
|
||||
+ <maven.compiler.target>1.8</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
|
|
|
@ -6,7 +6,7 @@ Subject: [PATCH] Player Tab List and Title APIs
|
|||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/Title.java b/src/main/java/com/destroystokyo/paper/Title.java
|
||||
new file mode 100644
|
||||
index 00000000..e1ecd447
|
||||
index 00000000..3c2b63db
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/Title.java
|
||||
@@ -0,0 +0,0 @@
|
||||
|
@ -23,7 +23,7 @@ index 00000000..e1ecd447
|
|||
+
|
||||
+/**
|
||||
+ * Represents a title to may be sent to a {@link Player}.
|
||||
+ * <p>
|
||||
+ *
|
||||
+ * <p>A title can be sent without subtitle text.</p>
|
||||
+ */
|
||||
+public final class Title {
|
||||
|
@ -49,7 +49,7 @@ index 00000000..e1ecd447
|
|||
+
|
||||
+ /**
|
||||
+ * Create a title with the default time values and no subtitle.
|
||||
+ * <p>
|
||||
+ *
|
||||
+ * <p>Times use default values.</p>
|
||||
+ *
|
||||
+ * @param title the main text of the title
|
||||
|
@ -61,7 +61,7 @@ index 00000000..e1ecd447
|
|||
+
|
||||
+ /**
|
||||
+ * Create a title with the default time values and no subtitle.
|
||||
+ * <p>
|
||||
+ *
|
||||
+ * <p>Times use default values.</p>
|
||||
+ *
|
||||
+ * @param title the main text of the title
|
||||
|
@ -73,7 +73,7 @@ index 00000000..e1ecd447
|
|||
+
|
||||
+ /**
|
||||
+ * Create a title with the default time values and no subtitle.
|
||||
+ * <p>
|
||||
+ *
|
||||
+ * <p>Times use default values.</p>
|
||||
+ *
|
||||
+ * @param title the main text of the title
|
||||
|
@ -85,7 +85,7 @@ index 00000000..e1ecd447
|
|||
+
|
||||
+ /**
|
||||
+ * Create a title with the default time values.
|
||||
+ * <p>
|
||||
+ *
|
||||
+ * <p>Times use default values.</p>
|
||||
+ *
|
||||
+ * @param title the main text of the title
|
||||
|
@ -97,7 +97,7 @@ index 00000000..e1ecd447
|
|||
+
|
||||
+ /**
|
||||
+ * Create a title with the default time values.
|
||||
+ * <p>
|
||||
+ *
|
||||
+ * <p>Times use default values.</p>
|
||||
+ *
|
||||
+ * @param title the main text of the title
|
||||
|
@ -109,7 +109,7 @@ index 00000000..e1ecd447
|
|||
+
|
||||
+ /**
|
||||
+ * Create a title with the default time values.
|
||||
+ * <p>
|
||||
+ *
|
||||
+ * <p>Times use default values.</p>
|
||||
+ *
|
||||
+ * @param title the main text of the title
|
||||
|
@ -162,7 +162,7 @@ index 00000000..e1ecd447
|
|||
+
|
||||
+ /**
|
||||
+ * Creates a new title.
|
||||
+ * <p>
|
||||
+ *
|
||||
+ * <p>It is recommended to the {@link BaseComponent} constrctors.</p>
|
||||
+ *
|
||||
+ * @param title the main text of the title
|
||||
|
@ -201,7 +201,7 @@ index 00000000..e1ecd447
|
|||
+
|
||||
+ /**
|
||||
+ * Gets the number of ticks to fade in.
|
||||
+ * <p>
|
||||
+ *
|
||||
+ * <p>The returned value is never negative.</p>
|
||||
+ *
|
||||
+ * @return the number of ticks to fade in
|
||||
|
@ -212,7 +212,7 @@ index 00000000..e1ecd447
|
|||
+
|
||||
+ /**
|
||||
+ * Gets the number of ticks to stay.
|
||||
+ * <p>
|
||||
+ *
|
||||
+ * <p>The returned value is never negative.</p>
|
||||
+ *
|
||||
+ * @return the number of ticks to stay
|
||||
|
@ -223,7 +223,7 @@ index 00000000..e1ecd447
|
|||
+
|
||||
+ /**
|
||||
+ * Gets the number of ticks to fade out.
|
||||
+ * <p>
|
||||
+ *
|
||||
+ * <p>The returned value is never negative.</p>
|
||||
+ *
|
||||
+ * @return the number of ticks to fade out
|
||||
|
@ -272,7 +272,7 @@ index 00000000..e1ecd447
|
|||
+
|
||||
+ /**
|
||||
+ * Sets the title to the given text.
|
||||
+ * <p>
|
||||
+ *
|
||||
+ * <p>It is recommended to the {@link BaseComponent} methods.</p>
|
||||
+ *
|
||||
+ * @param title the title text
|
||||
|
@ -306,7 +306,7 @@ index 00000000..e1ecd447
|
|||
+
|
||||
+ /**
|
||||
+ * Sets the subtitle to the given text.
|
||||
+ * <p>
|
||||
+ *
|
||||
+ * <p>It is recommended to the {@link BaseComponent} methods.</p>
|
||||
+ *
|
||||
+ * @param subtitle the title text
|
||||
|
@ -369,7 +369,7 @@ index 00000000..e1ecd447
|
|||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 7e3e3b7f..d19a928d 100644
|
||||
index dc593801..993abc13 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -0,0 +0,0 @@ package org.bukkit.entity;
|
||||
|
@ -472,7 +472,7 @@ index 7e3e3b7f..d19a928d 100644
|
|||
+
|
||||
+ /**
|
||||
+ * Show the title to the player, overriding any previously displayed title.
|
||||
+ * <p>
|
||||
+ *
|
||||
+ * <p>This method overrides any previous title, use {@link #updateTitle(Title)} to change the existing one.</p>
|
||||
+ *
|
||||
+ * @param title the title to send
|
||||
|
@ -482,7 +482,7 @@ index 7e3e3b7f..d19a928d 100644
|
|||
+
|
||||
+ /**
|
||||
+ * Show the title to the player, overriding any previously displayed title.
|
||||
+ * <p>
|
||||
+ *
|
||||
+ * <p>This method doesn't override previous titles, but changes their values.</p>
|
||||
+ *
|
||||
+ * @param title the title to send
|
||||
|
|
|
@ -7,7 +7,7 @@ Allows you to access the Gateway being used in a teleport event
|
|||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerTeleportEndGatewayEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerTeleportEndGatewayEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
|
||||
index 00000000..bdefbc9f
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerTeleportEndGatewayEvent.java
|
||||
@@ -0,0 +0,0 @@
|
||||
|
@ -31,7 +31,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+
|
||||
+ /**
|
||||
+ * The gateway triggering the teleport
|
||||
+ * @return
|
||||
+ *
|
||||
+ * @return EndGateway used
|
||||
+ */
|
||||
+ public EndGateway getGateway() {
|
||||
+ return gateway;
|
||||
|
|
|
@ -161,7 +161,7 @@ index 00000000..8c43e206
|
|||
+}
|
||||
diff --git a/src/main/java/co/aikar/timings/TimedEventExecutor.java b/src/main/java/co/aikar/timings/TimedEventExecutor.java
|
||||
new file mode 100644
|
||||
index 00000000..96057fc7
|
||||
index 00000000..feddcdbd
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/co/aikar/timings/TimedEventExecutor.java
|
||||
@@ -0,0 +0,0 @@
|
||||
|
@ -207,10 +207,10 @@ index 00000000..96057fc7
|
|||
+ /**
|
||||
+ * Wraps an event executor and associates a timing handler to it.
|
||||
+ *
|
||||
+ * @param executor
|
||||
+ * @param plugin
|
||||
+ * @param method
|
||||
+ * @param eventClass
|
||||
+ * @param executor Executor to wrap
|
||||
+ * @param plugin Owning plugin
|
||||
+ * @param method EventHandler method
|
||||
+ * @param eventClass Owning class
|
||||
+ */
|
||||
+ public TimedEventExecutor(EventExecutor executor, Plugin plugin, Method method, Class<? extends Event> eventClass) {
|
||||
+ this.executor = executor;
|
||||
|
@ -248,7 +248,7 @@ index 00000000..96057fc7
|
|||
+}
|
||||
diff --git a/src/main/java/co/aikar/timings/Timing.java b/src/main/java/co/aikar/timings/Timing.java
|
||||
new file mode 100644
|
||||
index 00000000..8b2d1b82
|
||||
index 00000000..b2260104
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/co/aikar/timings/Timing.java
|
||||
@@ -0,0 +0,0 @@
|
||||
|
@ -283,6 +283,8 @@ index 00000000..8b2d1b82
|
|||
+public interface Timing extends AutoCloseable {
|
||||
+ /**
|
||||
+ * Starts timing the execution until {@link #stopTiming()} is called.
|
||||
+ *
|
||||
+ * @return Timing
|
||||
+ */
|
||||
+ Timing startTiming();
|
||||
+
|
||||
|
@ -297,6 +299,8 @@ index 00000000..8b2d1b82
|
|||
+ * Starts timing the execution until {@link #stopTiming()} is called.
|
||||
+ *
|
||||
+ * But only if we are on the primary thread.
|
||||
+ *
|
||||
+ * @return Timing
|
||||
+ */
|
||||
+ Timing startTimingIfSync();
|
||||
+
|
||||
|
@ -1184,7 +1188,7 @@ index 00000000..623dda49
|
|||
+}
|
||||
diff --git a/src/main/java/co/aikar/timings/Timings.java b/src/main/java/co/aikar/timings/Timings.java
|
||||
new file mode 100644
|
||||
index 00000000..0571c9e7
|
||||
index 00000000..32e4bb1e
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/co/aikar/timings/Timings.java
|
||||
@@ -0,0 +0,0 @@
|
||||
|
@ -1333,8 +1337,8 @@ index 00000000..0571c9e7
|
|||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets whether or not the Timings should monitor at Verbose level.
|
||||
+ * <p/>
|
||||
+ * <p>Sets whether or not the Timings should monitor at Verbose level.</p>
|
||||
+ *
|
||||
+ * When Verbose is disabled, high-frequency timings will not be available.
|
||||
+ * Calling this will reset timing data.
|
||||
+ *
|
||||
|
@ -2284,7 +2288,7 @@ index 00000000..5edaba12
|
|||
+}
|
||||
diff --git a/src/main/java/co/aikar/util/JSONUtil.java b/src/main/java/co/aikar/util/JSONUtil.java
|
||||
new file mode 100644
|
||||
index 00000000..5fdf7c4c
|
||||
index 00000000..96274975
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/co/aikar/util/JSONUtil.java
|
||||
@@ -0,0 +0,0 @@
|
||||
|
@ -2310,9 +2314,10 @@ index 00000000..5fdf7c4c
|
|||
+
|
||||
+ /**
|
||||
+ * Creates a key/value "JSONPair" object
|
||||
+ * @param key
|
||||
+ * @param obj
|
||||
+ * @return
|
||||
+ *
|
||||
+ * @param key Key to use
|
||||
+ * @param obj Value to use
|
||||
+ * @return JSONPair
|
||||
+ */
|
||||
+ public static JSONPair pair(String key, Object obj) {
|
||||
+ return new JSONPair(key, obj);
|
||||
|
@ -2323,9 +2328,10 @@ index 00000000..5fdf7c4c
|
|||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Creates a new JSON object from multiple JsonPair key/value pairs
|
||||
+ * @param data
|
||||
+ * @return
|
||||
+ * Creates a new JSON object from multiple JSONPair key/value pairs
|
||||
+ *
|
||||
+ * @param data JSONPairs
|
||||
+ * @return Map
|
||||
+ */
|
||||
+ public static Map createObject(JSONPair... data) {
|
||||
+ return appendObjectData(new LinkedHashMap(), data);
|
||||
|
@ -2333,9 +2339,10 @@ index 00000000..5fdf7c4c
|
|||
+
|
||||
+ /**
|
||||
+ * This appends multiple key/value Obj pairs into a JSON Object
|
||||
+ * @param parent
|
||||
+ * @param data
|
||||
+ * @return
|
||||
+ *
|
||||
+ * @param parent Map to be appended to
|
||||
+ * @param data Data to append
|
||||
+ * @return Map
|
||||
+ */
|
||||
+ public static Map appendObjectData(Map parent, JSONPair... data) {
|
||||
+ for (JSONPair JSONPair : data) {
|
||||
|
@ -2346,8 +2353,9 @@ index 00000000..5fdf7c4c
|
|||
+
|
||||
+ /**
|
||||
+ * This builds a JSON array from a set of data
|
||||
+ * @param data
|
||||
+ * @return
|
||||
+ *
|
||||
+ * @param data Data to build JSON array from
|
||||
+ * @return List
|
||||
+ */
|
||||
+ public static List toArray(Object... data) {
|
||||
+ return Lists.newArrayList(data);
|
||||
|
@ -2355,10 +2363,11 @@ index 00000000..5fdf7c4c
|
|||
+
|
||||
+ /**
|
||||
+ * These help build a single JSON array using a mapper function
|
||||
+ * @param collection
|
||||
+ * @param mapper
|
||||
+ * @param <E>
|
||||
+ * @return
|
||||
+ *
|
||||
+ * @param collection Collection to apply to
|
||||
+ * @param mapper Mapper to apply
|
||||
+ * @param <E> Element Type
|
||||
+ * @return List
|
||||
+ */
|
||||
+ public static <E> List toArrayMapper(E[] collection, Function<E, Object> mapper) {
|
||||
+ return toArrayMapper(Lists.newArrayList(collection), mapper);
|
||||
|
@ -2377,10 +2386,11 @@ index 00000000..5fdf7c4c
|
|||
+
|
||||
+ /**
|
||||
+ * These help build a single JSON Object from a collection, using a mapper function
|
||||
+ * @param collection
|
||||
+ * @param mapper
|
||||
+ * @param <E>
|
||||
+ * @return
|
||||
+ *
|
||||
+ * @param collection Collection to apply to
|
||||
+ * @param mapper Mapper to apply
|
||||
+ * @param <E> Element Type
|
||||
+ * @return Map
|
||||
+ */
|
||||
+ public static <E> Map toObjectMapper(E[] collection, Function<E, JSONPair> mapper) {
|
||||
+ return toObjectMapper(Lists.newArrayList(collection), mapper);
|
||||
|
@ -2413,7 +2423,7 @@ index 00000000..5fdf7c4c
|
|||
+}
|
||||
diff --git a/src/main/java/co/aikar/util/LoadingIntMap.java b/src/main/java/co/aikar/util/LoadingIntMap.java
|
||||
new file mode 100644
|
||||
index 00000000..79fa9d52
|
||||
index 00000000..24eae4be
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/co/aikar/util/LoadingIntMap.java
|
||||
@@ -0,0 +0,0 @@
|
||||
|
@ -2476,7 +2486,8 @@ index 00000000..79fa9d52
|
|||
+
|
||||
+ /**
|
||||
+ * Due to java stuff, you will need to cast it to (Function) for some cases
|
||||
+ * @param <T>
|
||||
+ *
|
||||
+ * @param <T> Type
|
||||
+ */
|
||||
+ public abstract static class Feeder <T> implements Function<T, T> {
|
||||
+ @Override
|
||||
|
@ -2489,7 +2500,7 @@ index 00000000..79fa9d52
|
|||
+}
|
||||
diff --git a/src/main/java/co/aikar/util/LoadingMap.java b/src/main/java/co/aikar/util/LoadingMap.java
|
||||
new file mode 100644
|
||||
index 00000000..a9f29199
|
||||
index 00000000..1474384e
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/co/aikar/util/LoadingMap.java
|
||||
@@ -0,0 +0,0 @@
|
||||
|
@ -2554,8 +2565,8 @@ index 00000000..a9f29199
|
|||
+
|
||||
+ /**
|
||||
+ * Initializes an auto loading map using specified loader and backing map
|
||||
+ * @param backingMap
|
||||
+ * @param loader
|
||||
+ * @param backingMap Map to wrap
|
||||
+ * @param loader Loader
|
||||
+ */
|
||||
+ public LoadingMap(Map<K, V> backingMap, Function<K, V> loader) {
|
||||
+ this.backingMap = backingMap;
|
||||
|
@ -2564,11 +2575,12 @@ index 00000000..a9f29199
|
|||
+
|
||||
+ /**
|
||||
+ * Creates a new LoadingMap with the specified map and loader
|
||||
+ * @param backingMap
|
||||
+ * @param loader
|
||||
+ * @param <K>
|
||||
+ * @param <V>
|
||||
+ * @return
|
||||
+ *
|
||||
+ * @param backingMap Actual map being used.
|
||||
+ * @param loader Loader to use
|
||||
+ * @param <K> Key Type of the Map
|
||||
+ * @param <V> Value Type of the Map
|
||||
+ * @return Map
|
||||
+ */
|
||||
+ public static <K, V> Map<K, V> of(Map<K, V> backingMap, Function<K, V> loader) {
|
||||
+ return new LoadingMap<K, V>(backingMap, loader);
|
||||
|
@ -2616,11 +2628,12 @@ index 00000000..a9f29199
|
|||
+ * @see #newAutoMap
|
||||
+ *
|
||||
+ * new Auto initializing map using a HashMap.
|
||||
+ * @param keyClass
|
||||
+ * @param valueClass
|
||||
+ * @param <K>
|
||||
+ * @param <V>
|
||||
+ * @return
|
||||
+ *
|
||||
+ * @param keyClass Class used for the K generic
|
||||
+ * @param valueClass Class used for the V generic
|
||||
+ * @param <K> Key Type of the Map
|
||||
+ * @param <V> Value Type of the Map
|
||||
+ * @return Map that auto instantiates on .get()
|
||||
+ */
|
||||
+ public static <K, V> Map<K, V> newHashAutoMap(final Class<? extends K> keyClass, final Class<? extends V> valueClass) {
|
||||
+ return newAutoMap(new HashMap<K, V>(), keyClass, valueClass);
|
||||
|
@ -2630,10 +2643,11 @@ index 00000000..a9f29199
|
|||
+ * @see #newAutoMap
|
||||
+ *
|
||||
+ * new Auto initializing map using a HashMap.
|
||||
+ * @param valueClass
|
||||
+ * @param <K>
|
||||
+ * @param <V>
|
||||
+ * @return
|
||||
+ *
|
||||
+ * @param valueClass Class used for the V generic
|
||||
+ * @param <K> Key Type of the Map
|
||||
+ * @param <V> Value Type of the Map
|
||||
+ * @return Map that auto instantiates on .get()
|
||||
+ */
|
||||
+ public static <K, V> Map<K, V> newHashAutoMap(final Class<? extends V> valueClass) {
|
||||
+ return newHashAutoMap(null, valueClass);
|
||||
|
@ -2644,13 +2658,13 @@ index 00000000..a9f29199
|
|||
+ *
|
||||
+ * new Auto initializing map using a HashMap.
|
||||
+ *
|
||||
+ * @param keyClass
|
||||
+ * @param valueClass
|
||||
+ * @param initialCapacity
|
||||
+ * @param loadFactor
|
||||
+ * @param <K>
|
||||
+ * @param <V>
|
||||
+ * @return
|
||||
+ * @param keyClass Class used for the K generic
|
||||
+ * @param valueClass Class used for the V generic
|
||||
+ * @param initialCapacity Initial capacity to use
|
||||
+ * @param loadFactor Load factor to use
|
||||
+ * @param <K> Key Type of the Map
|
||||
+ * @param <V> Value Type of the Map
|
||||
+ * @return Map that auto instantiates on .get()
|
||||
+ */
|
||||
+ public static <K, V> Map<K, V> newHashAutoMap(final Class<? extends K> keyClass, final Class<? extends V> valueClass, int initialCapacity, float loadFactor) {
|
||||
+ return newAutoMap(new HashMap<K, V>(initialCapacity, loadFactor), keyClass, valueClass);
|
||||
|
@ -2661,12 +2675,12 @@ index 00000000..a9f29199
|
|||
+ *
|
||||
+ * new Auto initializing map using a HashMap.
|
||||
+ *
|
||||
+ * @param valueClass
|
||||
+ * @param initialCapacity
|
||||
+ * @param loadFactor
|
||||
+ * @param <K>
|
||||
+ * @param <V>
|
||||
+ * @return
|
||||
+ * @param valueClass Class used for the V generic
|
||||
+ * @param initialCapacity Initial capacity to use
|
||||
+ * @param loadFactor Load factor to use
|
||||
+ * @param <K> Key Type of the Map
|
||||
+ * @param <V> Value Type of the Map
|
||||
+ * @return Map that auto instantiates on .get()
|
||||
+ */
|
||||
+ public static <K, V> Map<K, V> newHashAutoMap(final Class<? extends V> valueClass, int initialCapacity, float loadFactor) {
|
||||
+ return newHashAutoMap(null, valueClass, initialCapacity, loadFactor);
|
||||
|
@ -2674,10 +2688,11 @@ index 00000000..a9f29199
|
|||
+
|
||||
+ /**
|
||||
+ * Initializes an auto loading map using a HashMap
|
||||
+ * @param loader
|
||||
+ * @param <K>
|
||||
+ * @param <V>
|
||||
+ * @return
|
||||
+ *
|
||||
+ * @param loader Loader to use
|
||||
+ * @param <K> Key Type of the Map
|
||||
+ * @param <V> Value Type of the Map
|
||||
+ * @return Map
|
||||
+ */
|
||||
+ public static <K, V> Map<K, V> newHashMap(Function<K, V> loader) {
|
||||
+ return new LoadingMap<K, V>(new HashMap<K, V>(), loader);
|
||||
|
@ -2685,12 +2700,13 @@ index 00000000..a9f29199
|
|||
+
|
||||
+ /**
|
||||
+ * Initializes an auto loading map using a HashMap
|
||||
+ * @param loader
|
||||
+ * @param initialCapacity
|
||||
+ * @param loadFactor
|
||||
+ * @param <K>
|
||||
+ * @param <V>
|
||||
+ * @return
|
||||
+ *
|
||||
+ * @param loader Loader to use
|
||||
+ * @param initialCapacity Initial capacity to use
|
||||
+ * @param loadFactor Load factor to use
|
||||
+ * @param <K> Key Type of the Map
|
||||
+ * @param <V> Value Type of the Map
|
||||
+ * @return Map
|
||||
+ */
|
||||
+ public static <K, V> Map<K, V> newHashMap(Function<K, V> loader, int initialCapacity, float loadFactor) {
|
||||
+ return new LoadingMap<K, V>(new HashMap<K, V>(initialCapacity, loadFactor), loader);
|
||||
|
@ -2698,10 +2714,11 @@ index 00000000..a9f29199
|
|||
+
|
||||
+ /**
|
||||
+ * Initializes an auto loading map using an Identity HashMap
|
||||
+ * @param loader
|
||||
+ * @param <K>
|
||||
+ * @param <V>
|
||||
+ * @return
|
||||
+ *
|
||||
+ * @param loader Loader to use
|
||||
+ * @param <K> Key Type of the Map
|
||||
+ * @param <V> Value Type of the Map
|
||||
+ * @return Map
|
||||
+ */
|
||||
+ public static <K, V> Map<K, V> newIdentityHashMap(Function<K, V> loader) {
|
||||
+ return new LoadingMap<K, V>(new IdentityHashMap<K, V>(), loader);
|
||||
|
@ -2709,11 +2726,12 @@ index 00000000..a9f29199
|
|||
+
|
||||
+ /**
|
||||
+ * Initializes an auto loading map using an Identity HashMap
|
||||
+ * @param loader
|
||||
+ * @param initialCapacity
|
||||
+ * @param <K>
|
||||
+ * @param <V>
|
||||
+ * @return
|
||||
+ *
|
||||
+ * @param loader Loader to use
|
||||
+ * @param initialCapacity Initial capacity to use
|
||||
+ * @param <K> Key Type of the Map
|
||||
+ * @param <V> Value Type of the Map
|
||||
+ * @return Map
|
||||
+ */
|
||||
+ public static <K, V> Map<K, V> newIdentityHashMap(Function<K, V> loader, int initialCapacity) {
|
||||
+ return new LoadingMap<K, V>(new IdentityHashMap<K, V>(initialCapacity), loader);
|
||||
|
@ -2814,7 +2832,8 @@ index 00000000..a9f29199
|
|||
+
|
||||
+ /**
|
||||
+ * Due to java stuff, you will need to cast it to (Function) for some cases
|
||||
+ * @param <T>
|
||||
+ *
|
||||
+ * @param <T> Type
|
||||
+ */
|
||||
+ public abstract static class Feeder <T> implements Function<T, T> {
|
||||
+ @Override
|
||||
|
@ -2827,7 +2846,7 @@ index 00000000..a9f29199
|
|||
+}
|
||||
diff --git a/src/main/java/co/aikar/util/MRUMapCache.java b/src/main/java/co/aikar/util/MRUMapCache.java
|
||||
new file mode 100644
|
||||
index 00000000..3a288d2a
|
||||
index 00000000..df592d85
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/co/aikar/util/MRUMapCache.java
|
||||
@@ -0,0 +0,0 @@
|
||||
|
@ -2863,8 +2882,9 @@ index 00000000..3a288d2a
|
|||
+
|
||||
+/**
|
||||
+ * Implements a Most Recently Used cache in front of a backing map, to quickly access the last accessed result.
|
||||
+ * @param <K>
|
||||
+ * @param <V>
|
||||
+ *
|
||||
+ * @param <K> Key Type of the Map
|
||||
+ * @param <V> Value Type of the Map
|
||||
+ */
|
||||
+public class MRUMapCache<K, V> extends AbstractMap<K, V> {
|
||||
+ final Map<K, V> backingMap;
|
||||
|
@ -2922,10 +2942,11 @@ index 00000000..3a288d2a
|
|||
+
|
||||
+ /**
|
||||
+ * Wraps the specified map with a most recently used cache
|
||||
+ * @param map
|
||||
+ * @param <K>
|
||||
+ * @param <V>
|
||||
+ * @return
|
||||
+ *
|
||||
+ * @param map Map to be wrapped
|
||||
+ * @param <K> Key Type of the Map
|
||||
+ * @param <V> Value Type of the Map
|
||||
+ * @return Map
|
||||
+ */
|
||||
+ public static <K, V> Map<K, V> of(Map<K, V> map) {
|
||||
+ return new MRUMapCache<K, V>(map);
|
||||
|
|
|
@ -6,7 +6,7 @@ Subject: [PATCH] Use ASM for event executors.
|
|||
Uses method handles for private or static methods.
|
||||
|
||||
diff --git a/pom.xml b/pom.xml
|
||||
index 5336fe55..a9009636 100644
|
||||
index 04168f66..862910e0 100644
|
||||
--- a/pom.xml
|
||||
+++ b/pom.xml
|
||||
@@ -0,0 +0,0 @@
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] add Trove and FastUtil to Bukkit
|
|||
|
||||
|
||||
diff --git a/pom.xml b/pom.xml
|
||||
index 48c2e544..5336fe55 100644
|
||||
index 968f9091..04168f66 100644
|
||||
--- a/pom.xml
|
||||
+++ b/pom.xml
|
||||
@@ -0,0 +0,0 @@
|
||||
|
|
4
pom.xml
4
pom.xml
|
@ -40,10 +40,6 @@
|
|||
<id>aikar</id>
|
||||
<url>http://ci.emc.gs/nexus/content/groups/aikar/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>destroystokyo-releases</id>
|
||||
<url>https://repo.destroystokyo.com/repository/maven-releases/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<distributionManagement>
|
||||
|
|
Loading…
Reference in a new issue