Revert "IntelliJ IDEA Cleanup: Remove unused imports, migration aids..."
* Revert "Some improvements to the settings menu" This reverts commit8c9ec25ce8
. * Revert "IntelliJ IDEA Cleanup: Remove unused imports, migration aids..." This reverts commitbe006d02c3
.
This commit is contained in:
parent
8c9ec25ce8
commit
7c906bdfb8
|
@ -197,7 +197,7 @@ public class HttpClient implements Connectable {
|
|||
}
|
||||
}
|
||||
|
||||
return this.executorService.submit(new RequestCallable<>(request, returnType, options));
|
||||
return this.executorService.submit(new RequestCallable<T>(request, returnType, options));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -13,6 +13,8 @@ import tc.oc.api.message.types.FindMultiRequest;
|
|||
import tc.oc.api.message.types.FindMultiResponse;
|
||||
import tc.oc.api.message.types.FindRequest;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
|
||||
public class HttpQueryService<Complete extends Model> implements QueryService<Complete> {
|
||||
|
||||
@Inject private ModelMeta<Complete, ?> meta;
|
||||
|
|
|
@ -16,7 +16,7 @@ public class Consume {
|
|||
this.durable = durable;
|
||||
this.exclusive = exclusive;
|
||||
this.autoDelete = autoDelete;
|
||||
this.arguments = arguments != null ? arguments : Collections.emptyMap();
|
||||
this.arguments = arguments != null ? arguments : Collections.<String, Object>emptyMap();
|
||||
}
|
||||
|
||||
public String name() {
|
||||
|
|
|
@ -20,7 +20,7 @@ public class Metadata extends AMQP.BasicProperties {
|
|||
public static final String MODEL_NAME = "model_name";
|
||||
|
||||
public static Map<String, Object> nonNullHeaders(Map<String, Object> headers) {
|
||||
return headers != null ? headers : Collections.emptyMap();
|
||||
return headers != null ? headers : Collections.<String, Object>emptyMap();
|
||||
}
|
||||
|
||||
public static Map<String, Object> getHeaders(AMQP.BasicProperties props) {
|
||||
|
|
|
@ -126,7 +126,7 @@ public class Queue implements MessageQueue, Connectable, Suspendable {
|
|||
logger.fine("Declaring queue");
|
||||
client.getChannel().queueDeclare(consume.name(), consume.durable(), consume.exclusive(), consume.autoDelete(), consume.arguments());
|
||||
dispatcher = new MultiDispatcher();
|
||||
consumerTag = client.getChannel().basicConsume(consume.name(), false, "", false, true, Collections.emptyMap(), dispatcher);
|
||||
consumerTag = client.getChannel().basicConsume(consume.name(), false, "", false, true, Collections.<String, Object>emptyMap(), dispatcher);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -11,6 +11,7 @@ import tc.oc.api.docs.PlayerId;
|
|||
import tc.oc.api.docs.SemanticVersion;
|
||||
import tc.oc.api.docs.UserId;
|
||||
import tc.oc.api.docs.virtual.MapDoc;
|
||||
import tc.oc.api.docs.virtual.MatchDoc;
|
||||
import tc.oc.commons.core.inject.Manifest;
|
||||
|
||||
public class TypeAdaptersManifest extends Manifest {
|
||||
|
|
|
@ -14,6 +14,7 @@ import tc.oc.api.document.DocumentGenerator;
|
|||
import tc.oc.api.document.DocumentRegistry;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static tc.oc.test.Assert.*;
|
||||
|
||||
@Serialize interface Empty extends Document {}
|
||||
@Serialize interface RequiredPrimitive extends Document { int woot(); }
|
||||
|
|
|
@ -85,7 +85,7 @@ public class DocumentSerializationTest extends ApiTest {
|
|||
}
|
||||
|
||||
@Override public List<List<Integer>> values() {
|
||||
return ImmutableList.of(
|
||||
return ImmutableList.<List<Integer>>of(
|
||||
ImmutableList.of(1, 2, 3),
|
||||
ImmutableList.of(4, 5, 6)
|
||||
);
|
||||
|
|
|
@ -1,8 +1,15 @@
|
|||
package tc.oc.api.bukkit;
|
||||
|
||||
import com.google.inject.TypeLiteral;
|
||||
import org.bukkit.entity.Player;
|
||||
import tc.oc.api.ApiManifest;
|
||||
import tc.oc.api.bukkit.friends.OnlineFriends;
|
||||
import tc.oc.api.bukkit.users.BukkitUserStore;
|
||||
import tc.oc.api.bukkit.users.Users;
|
||||
import tc.oc.api.minecraft.MinecraftApiManifest;
|
||||
import tc.oc.api.minecraft.users.UserStore;
|
||||
import tc.oc.commons.bukkit.inject.BukkitPluginManifest;
|
||||
import tc.oc.commons.core.inject.HybridManifest;
|
||||
|
||||
public final class BukkitApiManifest extends HybridManifest {
|
||||
|
||||
|
|
|
@ -1,5 +1,12 @@
|
|||
package tc.oc.api.bukkit.event;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.event.player.PlayerEvent;
|
||||
import tc.oc.api.docs.User;
|
||||
|
||||
public class UserUpdateEvent extends PlayerEvent {
|
||||
|
||||
private final @Nullable User before;
|
||||
|
|
|
@ -3,6 +3,11 @@ package tc.oc.api.bukkit.friends;
|
|||
import java.util.function.Predicate;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import tc.oc.api.docs.UserId;
|
||||
import tc.oc.commons.core.util.Predicates;
|
||||
|
||||
/**
|
||||
* Map of friend relationships for currently online players.
|
||||
* At least one of the two given players must be online to guarantee no false negatives.
|
||||
|
|
|
@ -4,9 +4,19 @@ import java.util.Collection;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Stream;
|
||||
import javax.annotation.Nullable;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventBus;
|
||||
import tc.oc.api.bukkit.event.UserUpdateEvent;
|
||||
import tc.oc.api.bukkit.friends.OnlineFriends;
|
||||
import tc.oc.api.docs.User;
|
||||
import tc.oc.api.docs.UserId;
|
||||
import tc.oc.api.minecraft.users.UserStore;
|
||||
import tc.oc.api.users.UserService;
|
||||
import tc.oc.minecraft.scheduler.MainThreadExecutor;
|
||||
|
||||
@Singleton
|
||||
public class BukkitUserStore extends UserStore<Player> implements OnlinePlayers, OnlineFriends {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
package tc.oc.api.bukkit.users;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public interface OnlinePlayers extends tc.oc.api.minecraft.users.OnlinePlayers<Player> {}
|
||||
|
|
|
@ -1,5 +1,14 @@
|
|||
package tc.oc.api.bukkit.users;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import tc.oc.api.docs.PlayerId;
|
||||
import tc.oc.api.docs.UserId;
|
||||
|
||||
public class Users {
|
||||
|
||||
@Inject private static BukkitUserStore userStore;
|
||||
|
|
|
@ -6,6 +6,8 @@ import java.util.UUID;
|
|||
import java.util.stream.Stream;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import tc.oc.api.docs.PlayerId;
|
||||
import tc.oc.api.docs.User;
|
||||
import tc.oc.api.docs.UserId;
|
||||
import tc.oc.minecraft.api.entity.Player;
|
||||
|
||||
|
|
|
@ -63,6 +63,7 @@ import tc.oc.commons.bukkit.respack.ResourcePackManager;
|
|||
import tc.oc.commons.bukkit.restart.RestartCommands;
|
||||
import tc.oc.commons.bukkit.sessions.SessionListener;
|
||||
import tc.oc.commons.bukkit.settings.SettingManifest;
|
||||
import tc.oc.commons.bukkit.stats.StatsCommands;
|
||||
import tc.oc.commons.bukkit.stats.StatsManifest;
|
||||
import tc.oc.commons.bukkit.suspend.SuspendListener;
|
||||
import tc.oc.commons.bukkit.tablist.PlayerTabEntry;
|
||||
|
|
|
@ -5,10 +5,12 @@ import javax.inject.Inject;
|
|||
import me.anxuiz.settings.Setting;
|
||||
import me.anxuiz.settings.SettingBuilder;
|
||||
import me.anxuiz.settings.types.BooleanType;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import tc.oc.commons.bukkit.broadcast.model.BroadcastPrefix;
|
||||
import tc.oc.commons.bukkit.settings.SettingManagerProvider;
|
||||
import tc.oc.commons.bukkit.util.ItemCreator;
|
||||
|
||||
public class BroadcastSettings {
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ import me.anxuiz.settings.Setting;
|
|||
import me.anxuiz.settings.SettingBuilder;
|
||||
import me.anxuiz.settings.types.BooleanType;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.ConsoleCommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
@ -27,6 +28,7 @@ import org.bukkit.permissions.Permission;
|
|||
import org.bukkit.permissions.PermissionDefault;
|
||||
import tc.oc.api.bukkit.users.OnlinePlayers;
|
||||
import tc.oc.commons.bukkit.settings.SettingManagerProvider;
|
||||
import tc.oc.commons.bukkit.util.ItemCreator;
|
||||
import tc.oc.commons.core.commands.Commands;
|
||||
|
||||
@Singleton
|
||||
|
|
|
@ -6,6 +6,7 @@ import com.sk89q.minecraft.util.commands.CommandException;
|
|||
import com.sk89q.minecraft.util.commands.CommandPermissions;
|
||||
import com.sk89q.minecraft.util.commands.NestedCommand;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Skin;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import tc.oc.commons.core.commands.Commands;
|
||||
|
|
|
@ -10,6 +10,7 @@ import com.sk89q.minecraft.util.commands.CommandPermissions;
|
|||
import com.sk89q.minecraft.util.commands.NestedCommand;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.craftbukkit.event.AsyncClientConnectEvent;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package tc.oc.commons.bukkit.event;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EntityAction;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.event.player.PlayerEvent;
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import javax.annotation.Nullable;
|
|||
import net.md_5.bungee.api.chat.BaseComponent;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.event.PlayerAction;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package tc.oc.commons.bukkit.flairs;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Stream;
|
||||
import javax.inject.Inject;
|
||||
|
|
|
@ -2,6 +2,7 @@ package tc.oc.commons.bukkit.freeze;
|
|||
|
||||
import java.time.Duration;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.WeakHashMap;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
@ -17,6 +18,7 @@ import org.bukkit.event.player.PlayerQuitEvent;
|
|||
import org.bukkit.event.world.WorldUnloadEvent;
|
||||
import tc.oc.commons.bukkit.event.CoarsePlayerMoveEvent;
|
||||
import tc.oc.commons.bukkit.util.NMSHacks;
|
||||
import tc.oc.commons.core.collection.WeakHashSet;
|
||||
import tc.oc.commons.core.plugin.PluginFacet;
|
||||
import tc.oc.commons.core.util.Pair;
|
||||
import tc.oc.minecraft.api.scheduler.Tickable;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package tc.oc.commons.bukkit.gui.interfaces;
|
||||
|
||||
import tc.oc.commons.bukkit.gui.Interface;
|
||||
import tc.oc.commons.bukkit.gui.buttons.Button;
|
||||
import tc.oc.commons.bukkit.gui.buttons.empty.EmptyButton;
|
||||
import tc.oc.commons.bukkit.gui.buttons.nextPage.NextPageButton;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package tc.oc.commons.bukkit.gui.interfaces.render;
|
||||
|
||||
import tc.oc.commons.bukkit.gui.Interface;
|
||||
import tc.oc.commons.bukkit.gui.buttons.Button;
|
||||
import tc.oc.commons.bukkit.gui.interfaces.ChestInterface;
|
||||
import tc.oc.commons.bukkit.util.ItemCreator;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package tc.oc.commons.bukkit.gui.interfaces.render.text;
|
||||
|
||||
import tc.oc.commons.bukkit.gui.Interface;
|
||||
import tc.oc.commons.bukkit.gui.buttons.Button;
|
||||
import tc.oc.commons.bukkit.gui.interfaces.render.ChestRenderInterface;
|
||||
import tc.oc.commons.bukkit.gui.interfaces.render.Coordinate;
|
||||
|
|
|
@ -14,7 +14,7 @@ public interface Hologram {
|
|||
* @param plugin The plugin responsible for the hologram.
|
||||
* @param content The content to be displayed.
|
||||
*/
|
||||
void setContent(Plugin plugin, HologramContent content);
|
||||
public void setContent(Plugin plugin, HologramContent content);
|
||||
|
||||
/**
|
||||
* Displays the hologram to the specified player.
|
||||
|
@ -22,14 +22,14 @@ public interface Hologram {
|
|||
* @param player The player.
|
||||
* @throws java.lang.IllegalStateException If no content has been set.
|
||||
*/
|
||||
void show(Player player) throws IllegalStateException;
|
||||
public void show(Player player) throws IllegalStateException;
|
||||
|
||||
/**
|
||||
* Hides the hologram from the specified player.
|
||||
*
|
||||
* @param player The player.
|
||||
*/
|
||||
void hide(Player player);
|
||||
public void hide(Player player);
|
||||
|
||||
HologramContent getContent();
|
||||
public HologramContent getContent();
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ import javax.inject.Singleton;
|
|||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerLocaleChangeEvent;
|
||||
import tc.oc.api.bukkit.users.BukkitUserStore;
|
||||
import tc.oc.api.docs.virtual.UserDoc;
|
||||
import tc.oc.api.users.UserService;
|
||||
|
|
|
@ -13,7 +13,9 @@ import com.google.common.cache.Cache;
|
|||
import com.google.common.cache.CacheBuilder;
|
||||
import net.md_5.bungee.api.chat.BaseComponent;
|
||||
import net.md_5.bungee.api.chat.TranslatableComponent;
|
||||
import org.apache.commons.lang3.mutable.MutableBoolean;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventBus;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
|
|
|
@ -9,6 +9,7 @@ import javax.inject.Singleton;
|
|||
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventBus;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
|
|
|
@ -6,6 +6,7 @@ import javax.inject.Singleton;
|
|||
|
||||
import com.google.common.cache.Cache;
|
||||
import com.google.common.cache.CacheBuilder;
|
||||
import org.bukkit.Skin;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scoreboard.Scoreboard;
|
||||
import org.bukkit.scoreboard.Team;
|
||||
|
|
|
@ -4,6 +4,8 @@ import me.anxuiz.settings.Setting;
|
|||
import me.anxuiz.settings.SettingBuilder;
|
||||
import me.anxuiz.settings.types.EnumType;
|
||||
import me.anxuiz.settings.types.Name;
|
||||
import org.bukkit.Material;
|
||||
import tc.oc.commons.bukkit.util.ItemCreator;
|
||||
|
||||
public class PunishmentMessageSetting {
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ package tc.oc.commons.bukkit.raindrops;
|
|||
|
||||
import org.bukkit.permissions.Permission;
|
||||
import org.bukkit.permissions.PermissionDefault;
|
||||
import org.bukkit.permissions.PermissionBinder;
|
||||
import tc.oc.commons.core.inject.HybridManifest;
|
||||
import tc.oc.commons.core.plugin.PluginFacetBinder;
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ import net.md_5.bungee.api.chat.BaseComponent;
|
|||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventBus;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import java.time.Duration;
|
||||
|
|
|
@ -3,6 +3,8 @@ package tc.oc.commons.bukkit.settings;
|
|||
import me.anxuiz.settings.Setting;
|
||||
import me.anxuiz.settings.SettingBuilder;
|
||||
import me.anxuiz.settings.types.BooleanType;
|
||||
import org.bukkit.Material;
|
||||
import tc.oc.commons.bukkit.util.ItemCreator;
|
||||
|
||||
/**
|
||||
* TODO: Not implemented yet
|
||||
|
|
|
@ -5,7 +5,9 @@ import javax.annotation.Nullable;
|
|||
import javax.inject.Inject;
|
||||
|
||||
import net.md_5.bungee.api.chat.BaseComponent;
|
||||
import org.bukkit.Skin;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.player.PlayerSkinPartsChangeEvent;
|
||||
import tc.oc.commons.bukkit.chat.NameStyle;
|
||||
import tc.oc.commons.bukkit.chat.PlayerComponent;
|
||||
import tc.oc.commons.bukkit.nick.Identity;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package tc.oc.commons.bukkit.tablist;
|
||||
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Skin;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
|
|
@ -2,6 +2,7 @@ package tc.oc.commons.bukkit.tablist;
|
|||
|
||||
import net.md_5.bungee.api.chat.BaseComponent;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Skin;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
|
|
@ -7,6 +7,7 @@ import org.bukkit.event.Listener;
|
|||
import org.bukkit.event.player.PlayerChangedWorldEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.event.player.PlayerRespawnEvent;
|
||||
import org.bukkit.event.player.PlayerSkinPartsChangeEvent;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import tc.oc.commons.bukkit.nick.PlayerIdentityChangeEvent;
|
||||
import tc.oc.commons.core.logging.ClassLogger;
|
||||
|
@ -48,7 +49,7 @@ public class TabManager implements Listener {
|
|||
final DefaultMapAdapter<Player, TabView> enabledViews;
|
||||
|
||||
final DefaultMapAdapter<Player, TabEntry> playerEntries;
|
||||
final Map<Integer, TabEntry> blankEntries = new DefaultMapAdapter<>(new BlankTabEntry.Factory(), true);
|
||||
final Map<Integer, TabEntry> blankEntries = new DefaultMapAdapter<Integer, TabEntry>(new BlankTabEntry.Factory(), true);
|
||||
|
||||
boolean dirty;
|
||||
|
||||
|
|
|
@ -7,6 +7,8 @@ import java.util.List;
|
|||
import javax.inject.Inject;
|
||||
|
||||
import net.md_5.bungee.api.chat.BaseComponent;
|
||||
import net.minecraft.server.Packet;
|
||||
import net.minecraft.server.PacketPlayOutPlayerInfo;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import tc.oc.commons.bukkit.chat.ComponentRenderContext;
|
||||
|
|
|
@ -79,22 +79,14 @@ public class TokenCommands implements Commands {
|
|||
CommandFutureCallback.onSuccess(sender, args, result -> {
|
||||
result.user.player_id();
|
||||
String type = args.getString(1).toLowerCase();
|
||||
switch (type) {
|
||||
case "setnext":
|
||||
case "map":
|
||||
TokenUtil.giveMapTokens(result.user, numberOfTokens);
|
||||
break;
|
||||
case "mutation":
|
||||
case "mt":
|
||||
TokenUtil.giveMutationTokens(result.user, numberOfTokens);
|
||||
break;
|
||||
case "droplets":
|
||||
case "raindrops":
|
||||
case "rds":
|
||||
RaindropUtil.giveRaindrops(result.user, numberOfTokens, null);
|
||||
break;
|
||||
default:
|
||||
throw new CommandUsageException(ChatColor.RED + "/givetokens [player] [setnext|mutation] [count]");
|
||||
if (type.equals("setnext") || type.equals("map")) {
|
||||
TokenUtil.giveMapTokens(result.user, numberOfTokens);
|
||||
} else if (type.equals("mutation") || type.equals("mt")) {
|
||||
TokenUtil.giveMutationTokens(result.user, numberOfTokens);
|
||||
} else if (type.equals("droplets") || type.equals("raindrops") || type.equals("rds")) {
|
||||
RaindropUtil.giveRaindrops(result.user, numberOfTokens, null);
|
||||
} else {
|
||||
throw new CommandUsageException(ChatColor.RED + "/givetokens [player] [setnext|mutation] [count]");
|
||||
}
|
||||
})
|
||||
);
|
||||
|
|
|
@ -7,6 +7,7 @@ import javax.inject.Singleton;
|
|||
|
||||
import com.google.common.util.concurrent.ListenableFuture;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventBus;
|
||||
import tc.oc.api.bukkit.users.BukkitUserStore;
|
||||
import tc.oc.api.docs.Trophy;
|
||||
import tc.oc.api.docs.User;
|
||||
|
|
|
@ -4,7 +4,9 @@ import me.anxuiz.settings.Setting;
|
|||
import me.anxuiz.settings.SettingBuilder;
|
||||
import me.anxuiz.settings.types.EnumType;
|
||||
import me.anxuiz.settings.types.Name;
|
||||
import org.bukkit.Material;
|
||||
import tc.oc.commons.bukkit.nick.Familiarity;
|
||||
import tc.oc.commons.bukkit.util.ItemCreator;
|
||||
|
||||
public class JoinMessageSetting {
|
||||
private static final Setting inst = new SettingBuilder()
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package tc.oc.commons.bukkit.util;
|
||||
|
||||
import net.minecraft.server.NBTTagCompound;
|
||||
import org.bukkit.Color;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
|
|
@ -4,9 +4,11 @@ import me.anxuiz.settings.Setting;
|
|||
import me.anxuiz.settings.SettingBuilder;
|
||||
import me.anxuiz.settings.types.EnumType;
|
||||
import me.anxuiz.settings.types.Name;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import tc.oc.commons.bukkit.nick.Familiarity;
|
||||
import tc.oc.commons.bukkit.nick.Identity;
|
||||
import tc.oc.commons.bukkit.util.ItemCreator;
|
||||
|
||||
public class WhisperSettings {
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package tc.oc.commons.bukkit.geometry;
|
||||
|
||||
import org.bukkit.util.ImVector;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package tc.oc.commons.bukkit.geometry;
|
||||
|
||||
import org.bukkit.util.ImVector;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
|
|
@ -8,6 +8,7 @@ import org.junit.Test;
|
|||
import tc.oc.commons.core.localization.Locales;
|
||||
|
||||
import static tc.oc.test.Assert.*;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
public class LocalesTest {
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import java.util.Comparator;
|
|||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.stream.Stream;
|
||||
|
@ -19,6 +20,8 @@ import tc.oc.commons.core.logging.Loggers;
|
|||
import tc.oc.commons.core.plugin.PluginFacet;
|
||||
import tc.oc.commons.core.stream.BiStream;
|
||||
|
||||
import static java.util.stream.Collectors.toSet;
|
||||
|
||||
/**
|
||||
* Track available lobbies and choose the best lobby to receive players at any given time
|
||||
*/
|
||||
|
|
|
@ -7,6 +7,7 @@ import javax.inject.Inject;
|
|||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.configuration.Configuration;
|
||||
import org.bukkit.geometry.Cuboid;
|
||||
import org.bukkit.util.Vector;
|
||||
import tc.oc.commons.bukkit.configuration.ConfigUtils;
|
||||
import tc.oc.commons.bukkit.logging.MapdevLogger;
|
||||
|
|
|
@ -1,8 +1,16 @@
|
|||
package tc.oc.lobby.bukkit;
|
||||
|
||||
import me.anxuiz.settings.*;
|
||||
import me.anxuiz.settings.bukkit.PlayerSettingCallback;
|
||||
import me.anxuiz.settings.bukkit.PlayerSettings;
|
||||
import me.anxuiz.settings.types.EnumType;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import tc.oc.commons.bukkit.hologram.Hologram;
|
||||
import tc.oc.commons.bukkit.hologram.content.HologramAnimation;
|
||||
import tc.oc.commons.bukkit.util.ItemCreator;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class Settings {
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ import org.bukkit.event.player.PlayerInteractEvent;
|
|||
import org.bukkit.event.player.PlayerMoveEvent;
|
||||
import org.bukkit.event.world.ChunkLoadEvent;
|
||||
import org.bukkit.material.MaterialData;
|
||||
import org.bukkit.util.RayBlockIntersection;
|
||||
import tc.oc.api.docs.Arena;
|
||||
import tc.oc.api.docs.Game;
|
||||
import tc.oc.api.docs.Server;
|
||||
|
|
|
@ -2,10 +2,14 @@ package tc.oc.lobby.bukkit;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.server.*;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.craftbukkit.entity.CraftPlayer;
|
||||
import org.bukkit.craftbukkit.scoreboard.CraftObjective;
|
||||
import org.bukkit.craftbukkit.scoreboard.CraftScoreboard;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
|
|
@ -14,6 +14,7 @@ import org.bukkit.Sound;
|
|||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.EventRegistry;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
|
|
|
@ -3,7 +3,10 @@ package tc.oc.lobby.bukkit.gizmos.rocket;
|
|||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.server.Packet;
|
||||
import net.minecraft.server.PacketPlayOutEntity;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.craftbukkit.entity.CraftPlayer;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Firework;
|
||||
import org.bukkit.entity.Player;
|
||||
|
|
|
@ -14,17 +14,21 @@ import org.bukkit.boss.BarColor;
|
|||
import org.bukkit.boss.BarStyle;
|
||||
import org.bukkit.boss.BossBar;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventBus;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||
import org.bukkit.event.player.PlayerInitialSpawnEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerMoveEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.event.player.PlayerRespawnEvent;
|
||||
import org.bukkit.permissions.PermissionAttachmentInfo;
|
||||
import org.bukkit.geometry.Cuboid;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import tc.oc.api.bukkit.users.OnlinePlayers;
|
||||
import tc.oc.api.docs.User;
|
||||
import tc.oc.api.docs.virtual.ServerDoc;
|
||||
|
@ -42,6 +46,7 @@ import tc.oc.commons.core.chat.Components;
|
|||
import tc.oc.commons.core.format.GeneralFormatter;
|
||||
import tc.oc.commons.core.plugin.PluginFacet;
|
||||
import tc.oc.commons.core.restart.RequestRestartEvent;
|
||||
import tc.oc.commons.core.util.TimeUtils;
|
||||
import tc.oc.lobby.bukkit.LobbyConfig;
|
||||
import tc.oc.lobby.bukkit.Utils;
|
||||
import tc.oc.commons.bukkit.chat.Links;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package tc.oc.lobby.bukkit.portals;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import org.bukkit.geometry.Cuboid;
|
||||
import tc.oc.commons.bukkit.teleport.Navigator;
|
||||
|
||||
public class Portal {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package tc.oc.lobby.bukkit.portals;
|
||||
|
||||
import org.bukkit.geometry.Cuboid;
|
||||
import tc.oc.commons.bukkit.config.ExternalConfiguration;
|
||||
import tc.oc.commons.bukkit.configuration.ConfigUtils;
|
||||
import tc.oc.commons.bukkit.teleport.Navigator;
|
||||
|
|
|
@ -11,6 +11,7 @@ import javax.inject.Inject;
|
|||
import javax.inject.Singleton;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.Duration;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
|
|
|
@ -2,6 +2,7 @@ package tc.oc.pgm.animation;
|
|||
|
||||
import com.google.inject.assistedinject.Assisted;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.util.ImVector;
|
||||
import tc.oc.commons.core.inject.InnerFactory;
|
||||
import tc.oc.pgm.features.FeatureDefinition;
|
||||
import tc.oc.pgm.features.FeatureFactory;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package tc.oc.pgm.animation;
|
||||
|
||||
import com.google.common.collect.Range;
|
||||
import org.bukkit.util.ImVector;
|
||||
import org.bukkit.util.Vector;
|
||||
import org.jdom2.Document;
|
||||
import org.jdom2.Element;
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
package tc.oc.pgm.animation;
|
||||
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.BlockImage;
|
||||
import org.bukkit.geometry.Cuboid;
|
||||
import org.bukkit.region.BlockRegion;
|
||||
import org.bukkit.region.CuboidBlockRegion;
|
||||
import org.bukkit.util.ImVector;
|
||||
import org.bukkit.util.Vector;
|
||||
import tc.oc.pgm.features.FeatureDefinition;
|
||||
import tc.oc.pgm.features.FeatureFactory;
|
||||
|
|
|
@ -19,6 +19,7 @@ import org.bukkit.event.EventHandler;
|
|||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.player.PlayerAttackEntityEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.inventory.ItemFlag;
|
||||
|
|
|
@ -16,9 +16,11 @@ import org.bukkit.event.EventPriority;
|
|||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.BlockBreakEvent;
|
||||
import org.bukkit.event.entity.EntityChangeBlockEvent;
|
||||
import org.bukkit.event.entity.EntityDespawnInVoidEvent;
|
||||
import org.bukkit.event.entity.EntityExplodeEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.material.MaterialData;
|
||||
import org.bukkit.util.RayBlockIntersection;
|
||||
import org.bukkit.util.Vector;
|
||||
import tc.oc.commons.bukkit.util.BlockUtils;
|
||||
import tc.oc.commons.bukkit.util.NMSHacks;
|
||||
|
|
|
@ -31,7 +31,7 @@ public class BlockDropsRuleSet {
|
|||
private final ImmutableList<BlockDropsRule> rules;
|
||||
|
||||
public BlockDropsRuleSet() {
|
||||
this(ImmutableList.of());
|
||||
this(ImmutableList.<BlockDropsRule>of());
|
||||
}
|
||||
|
||||
public BlockDropsRuleSet(List<BlockDropsRule> rules) {
|
||||
|
|
|
@ -14,6 +14,7 @@ import javax.inject.Inject;
|
|||
import org.bukkit.event.EventException;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.server.ServerSuspendEvent;
|
||||
import tc.oc.commons.core.IterableUtils;
|
||||
import tc.oc.commons.core.concurrent.SerializingExecutor;
|
||||
import tc.oc.commons.core.logging.Loggers;
|
||||
|
|
|
@ -3,6 +3,9 @@ package tc.oc.pgm.damage;
|
|||
import me.anxuiz.settings.Setting;
|
||||
import me.anxuiz.settings.SettingBuilder;
|
||||
import me.anxuiz.settings.types.BooleanType;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import tc.oc.commons.bukkit.util.ItemCreator;
|
||||
|
||||
public class DamageSettings {
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import javax.inject.Inject;
|
|||
|
||||
import com.google.common.collect.ImmutableSetMultimap;
|
||||
import com.google.common.collect.SetMultimap;
|
||||
import com.google.common.collect.Sets;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
|
@ -18,6 +19,8 @@ import tc.oc.pgm.match.MatchPlayer;
|
|||
import tc.oc.pgm.match.MatchScope;
|
||||
import tc.oc.pgm.match.ParticipantState;
|
||||
import tc.oc.pgm.match.PlayerRelation;
|
||||
import tc.oc.pgm.mutation.Mutation;
|
||||
import tc.oc.pgm.mutation.MutationMatchModule;
|
||||
import tc.oc.pgm.tracker.BlockResolver;
|
||||
import tc.oc.pgm.tracker.EventResolver;
|
||||
import tc.oc.pgm.tracker.damage.DamageInfo;
|
||||
|
|
|
@ -7,6 +7,7 @@ import gnu.trove.map.hash.TIntObjectHashMap;
|
|||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerUseUnknownEntityEvent;
|
||||
import tc.oc.pgm.events.ListenerScope;
|
||||
import tc.oc.pgm.match.Match;
|
||||
import tc.oc.pgm.match.MatchModule;
|
||||
|
|
|
@ -10,6 +10,8 @@ import org.bukkit.entity.Entity;
|
|||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.EquipmentSlot;
|
||||
import org.bukkit.geometry.Cuboid;
|
||||
import org.bukkit.geometry.Ray;
|
||||
import tc.oc.commons.bukkit.util.NMSHacks;
|
||||
import tc.oc.pgm.map.MapInfo;
|
||||
import tc.oc.pgm.match.Match;
|
||||
|
|
|
@ -4,7 +4,9 @@ import me.anxuiz.settings.Setting;
|
|||
import me.anxuiz.settings.SettingBuilder;
|
||||
import me.anxuiz.settings.types.EnumType;
|
||||
import me.anxuiz.settings.types.Name;
|
||||
import org.bukkit.Material;
|
||||
import tc.oc.commons.bukkit.nick.Familiarity;
|
||||
import tc.oc.commons.bukkit.util.ItemCreator;
|
||||
|
||||
public class DeathMessageSetting {
|
||||
private static final Setting inst = new SettingBuilder()
|
||||
|
|
|
@ -4,6 +4,8 @@ import me.anxuiz.settings.Setting;
|
|||
import me.anxuiz.settings.SettingBuilder;
|
||||
import me.anxuiz.settings.TypeParseException;
|
||||
import me.anxuiz.settings.types.BooleanType;
|
||||
import org.bukkit.Material;
|
||||
import tc.oc.commons.bukkit.util.ItemCreator;
|
||||
|
||||
public class HighlightDeathMessageSetting {
|
||||
private static final Setting INSTANCE = new SettingBuilder()
|
||||
|
|
|
@ -530,7 +530,7 @@ public class Destroyable extends TouchableGoal<DestroyableFactory> implements In
|
|||
return this.contributions;
|
||||
}
|
||||
|
||||
Map<MatchPlayerState, Integer> playerDamage = new DefaultMapAdapter<>(new HashMap<>(), 0);
|
||||
Map<MatchPlayerState, Integer> playerDamage = new DefaultMapAdapter<>(new HashMap<MatchPlayerState, Integer>(), 0);
|
||||
|
||||
int totalDamage = 0;
|
||||
for(DestroyableHealthChange change : this.events) {
|
||||
|
|
|
@ -28,6 +28,7 @@ import org.bukkit.event.player.PlayerBucketEmptyEvent;
|
|||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.util.BlockVector;
|
||||
import org.bukkit.util.Vector;
|
||||
import tc.oc.commons.bukkit.event.CoarsePlayerMoveEvent;
|
||||
import tc.oc.commons.bukkit.event.GeneralizingEvent;
|
||||
import tc.oc.commons.bukkit.util.BlockStateUtils;
|
||||
|
|
|
@ -10,6 +10,7 @@ import org.bukkit.event.HandlerList;
|
|||
import org.bukkit.event.block.BlockBreakEvent;
|
||||
import org.bukkit.event.block.BlockIgniteEvent;
|
||||
import org.bukkit.event.block.BlockPlaceEvent;
|
||||
import org.bukkit.event.entity.ExplosionPrimeByEntityEvent;
|
||||
import org.bukkit.event.player.PlayerBucketEmptyEvent;
|
||||
import org.bukkit.event.player.PlayerBucketFillEvent;
|
||||
import org.bukkit.material.MaterialData;
|
||||
|
|
|
@ -12,5 +12,5 @@ import tc.oc.pgm.match.MatchScope;
|
|||
@Target({ElementType.TYPE, ElementType.METHOD})
|
||||
@Inherited
|
||||
public @interface ListenerScope {
|
||||
MatchScope value();
|
||||
public MatchScope value();
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package tc.oc.pgm.events;
|
||||
|
||||
import org.bukkit.Physical;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.event.Event;
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ import org.bukkit.entity.FallingBlock;
|
|||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.BlockFallEvent;
|
||||
import org.bukkit.material.MaterialData;
|
||||
import org.bukkit.scheduler.BukkitTask;
|
||||
import tc.oc.commons.bukkit.util.LongDeque;
|
||||
|
|
|
@ -3,8 +3,10 @@ package tc.oc.pgm.ffa;
|
|||
import com.sk89q.minecraft.util.commands.*;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import tc.oc.pgm.PGM;
|
||||
import tc.oc.pgm.commands.CommandUtils;
|
||||
import tc.oc.pgm.match.MatchPlayer;
|
||||
import tc.oc.pgm.teams.Team;
|
||||
|
||||
public class FreeForAllCommands {
|
||||
private FreeForAllCommands() {}
|
||||
|
|
|
@ -181,7 +181,7 @@ public class Tribute implements Competitor {
|
|||
@Override
|
||||
public Set<PlayerId> getPastPlayers() {
|
||||
return getMatch().isCommitted() ? Collections.singleton(playerId)
|
||||
: Collections.emptySet();
|
||||
: Collections.<PlayerId>emptySet();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -8,6 +8,7 @@ import java.util.Map;
|
|||
import java.util.Set;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.logging.Level;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import com.google.common.collect.HashBasedTable;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
@ -28,6 +29,7 @@ import tc.oc.pgm.victory.RankingsChangeEvent;
|
|||
import tc.oc.pgm.filters.query.IQuery;
|
||||
import tc.oc.pgm.flag.event.FlagStateChangeEvent;
|
||||
import tc.oc.pgm.goals.events.GoalCompleteEvent;
|
||||
import tc.oc.pgm.match.Match;
|
||||
import tc.oc.pgm.match.MatchModule;
|
||||
import tc.oc.pgm.match.MatchPlayer;
|
||||
import tc.oc.pgm.match.MatchScope;
|
||||
|
|
|
@ -3,6 +3,7 @@ package tc.oc.pgm.filters;
|
|||
import java.util.function.Predicate;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import org.bukkit.inventory.ImItemStack;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import tc.oc.commons.core.inspect.Inspectable;
|
||||
import tc.oc.pgm.kits.tag.ItemTags;
|
||||
|
|
|
@ -8,6 +8,7 @@ import org.bukkit.Material;
|
|||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EntityAction;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.block.BlockBreakEvent;
|
||||
import org.bukkit.event.block.BlockBurnEvent;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package tc.oc.pgm.filters.matcher.player;
|
||||
|
||||
import com.google.common.cache.LoadingCache;
|
||||
import org.bukkit.PoseFlag;
|
||||
import tc.oc.commons.core.util.CacheUtils;
|
||||
import tc.oc.pgm.filters.Filter;
|
||||
import tc.oc.pgm.filters.matcher.TypedFilter;
|
||||
|
|
|
@ -26,7 +26,7 @@ public class ChainFilter extends MultiFilterFunction {
|
|||
* Return a reversed chain, so later filters have priority over earlier ones
|
||||
*/
|
||||
public static Filter reverse(List<? extends Filter> filters) {
|
||||
return IterableUtils.unify(filters, StaticFilter.ABSTAIN, multi -> new ChainFilter(Lists.reverse(ImmutableList.copyOf(multi))));
|
||||
return IterableUtils.<Filter>unify(filters, StaticFilter.ABSTAIN, multi -> new ChainFilter(Lists.reverse(ImmutableList.copyOf(multi))));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -6,10 +6,12 @@ import javax.inject.Inject;
|
|||
import javax.inject.Provider;
|
||||
|
||||
import com.google.common.collect.Range;
|
||||
import org.bukkit.PoseFlag;
|
||||
import org.bukkit.attribute.Attribute;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.event.entity.CreatureSpawnEvent;
|
||||
import org.bukkit.inventory.ImItemStack;
|
||||
import org.jdom2.Element;
|
||||
import tc.oc.api.docs.SemanticVersion;
|
||||
import tc.oc.commons.bukkit.localization.MessageTemplate;
|
||||
|
|
|
@ -7,6 +7,7 @@ import org.bukkit.World;
|
|||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.material.MaterialData;
|
||||
import org.bukkit.util.ImVector;
|
||||
import tc.oc.pgm.PGM;
|
||||
import tc.oc.pgm.match.Match;
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package tc.oc.pgm.filters.query;
|
||||
|
||||
import org.bukkit.EntityLocation;
|
||||
import org.bukkit.entity.Entity;
|
||||
import tc.oc.pgm.PGM;
|
||||
import tc.oc.pgm.match.Match;
|
||||
|
|
|
@ -2,6 +2,7 @@ package tc.oc.pgm.filters.query;
|
|||
|
||||
import java.util.Optional;
|
||||
|
||||
import org.bukkit.EntityLocation;
|
||||
import tc.oc.api.docs.PlayerId;
|
||||
import tc.oc.pgm.match.Match;
|
||||
import tc.oc.pgm.match.MatchPlayer;
|
||||
|
|
|
@ -3,7 +3,9 @@ package tc.oc.pgm.filters.query;
|
|||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.EntityLocation;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.PoseFlag;
|
||||
|
||||
public interface IEntityQuery extends IEntityTypeQuery, ILocationQuery, IPoseQuery {
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package tc.oc.pgm.filters.query;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.util.ImVector;
|
||||
|
||||
public interface ILocationQuery extends IMatchQuery {
|
||||
|
||||
|
|
|
@ -2,6 +2,8 @@ package tc.oc.pgm.filters.query;
|
|||
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.PoseFlag;
|
||||
|
||||
public interface IPoseQuery extends IMatchQuery {
|
||||
|
||||
Set<PoseFlag> getPose();
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package tc.oc.pgm.filters.query;
|
||||
|
||||
import org.bukkit.EntityLocation;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.util.ImVector;
|
||||
|
||||
public class PlayerQueryWithLocation implements ForwardingPlayerQuery {
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ import org.bukkit.block.Block;
|
|||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.geometry.Cuboid;
|
||||
import tc.oc.commons.bukkit.util.BlockUtils;
|
||||
import tc.oc.commons.bukkit.util.BukkitUtils;
|
||||
import tc.oc.pgm.controlpoint.events.ControllerChangeEvent;
|
||||
|
|
|
@ -122,7 +122,7 @@ public class Flag extends TouchableGoal<FlagDefinition> implements Listener {
|
|||
final TeamMatchModule tmm = match.getMatchModule(TeamMatchModule.class);
|
||||
|
||||
this.owner = definition.owner()
|
||||
.map(tmm::team) // Do not use a method ref here, it will NPE if tmm is null
|
||||
.map(def -> tmm.team(def)) // Do not use a method ref here, it will NPE if tmm is null
|
||||
.orElse(null);
|
||||
|
||||
this.capturers = Lazy.from(
|
||||
|
@ -136,7 +136,7 @@ public class Flag extends TouchableGoal<FlagDefinition> implements Listener {
|
|||
() -> nets.stream()
|
||||
.flatMap(net -> Optionals.stream(net.returnPost()
|
||||
.flatMap(Post::owner)))
|
||||
.map(tmm::team)
|
||||
.map(def -> tmm.team(def))
|
||||
.collect(Collectors.toSet())
|
||||
);
|
||||
|
||||
|
@ -145,7 +145,7 @@ public class Flag extends TouchableGoal<FlagDefinition> implements Listener {
|
|||
.flatMap(net -> Optionals.stream(net.returnPost()))
|
||||
.filter(Post::isPermanent)
|
||||
.flatMap(post -> Optionals.stream(post.owner()))
|
||||
.map(tmm::team)
|
||||
.map(def -> tmm.team(def))
|
||||
.collect(Collectors.toSet())
|
||||
);
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import java.util.Map;
|
|||
|
||||
import com.google.common.collect.Multimap;
|
||||
import tc.oc.pgm.match.Competitor;
|
||||
import tc.oc.pgm.match.Match;
|
||||
import tc.oc.pgm.victory.AbstractVictoryCondition;
|
||||
|
||||
// TODO: Break this down into multiple chainable conditions i.e. completions, touches, proximity, etc.
|
||||
|
|
|
@ -7,7 +7,7 @@ import tc.oc.pgm.xml.InvalidXMLException;
|
|||
import tc.oc.pgm.xml.Node;
|
||||
|
||||
public class ProximityMetric {
|
||||
public enum Type {
|
||||
public static enum Type {
|
||||
CLOSEST_PLAYER("closest player"),
|
||||
CLOSEST_BLOCK("closest block"),
|
||||
CLOSEST_KILL("closest kill");
|
||||
|
|
|
@ -24,6 +24,7 @@ import org.bukkit.event.entity.EntityRegainHealthEvent;
|
|||
import org.bukkit.event.entity.FoodLevelChangeEvent;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.event.inventory.InventoryClickedEvent;
|
||||
import org.bukkit.event.inventory.InventoryCloseEvent;
|
||||
import org.bukkit.event.inventory.InventoryDragEvent;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
|
|
|
@ -8,6 +8,7 @@ import javax.annotation.Nullable;
|
|||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.attribute.ItemAttributeModifier;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.bukkit.inventory.meta.PotionMeta;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue