Skip to content

Commit

Permalink
clean import
Browse files Browse the repository at this point in the history
  • Loading branch information
Mgazul committed Oct 23, 2023
1 parent 42dafbc commit 07597dc
Show file tree
Hide file tree
Showing 88 changed files with 189 additions and 283 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
package com.destroystokyo.paper.event.entity;

import com.google.common.base.Preconditions;
import java.util.Collections;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LightningStrike;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
import org.bukkit.event.entity.EntityTransformEvent;
import org.jetbrains.annotations.NotNull;

import java.util.Collections;

/**
* Fired when lightning strikes an entity
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
package com.destroystokyo.paper.event.executor;

import com.destroystokyo.paper.util.SneakyThrow;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.reflect.Method;
import org.bukkit.event.Event;
import org.bukkit.event.EventException;
import org.bukkit.event.Listener;
import org.bukkit.plugin.EventExecutor;
import org.jetbrains.annotations.NotNull;

import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.reflect.Method;

public class MethodHandleEventExecutor implements EventExecutor {
private final Class<? extends Event> eventClass;
private final MethodHandle handle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@

import com.destroystokyo.paper.util.SneakyThrow;
import com.google.common.base.Preconditions;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import org.bukkit.event.Event;
import org.bukkit.event.EventException;
import org.bukkit.event.Listener;
import org.bukkit.plugin.EventExecutor;
import org.jetbrains.annotations.NotNull;

import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;

public class StaticMethodHandleEventExecutor implements EventExecutor {
private final Class<? extends Event> eventClass;
private final MethodHandle handle;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
package com.destroystokyo.paper.event.executor.asm;

import java.lang.reflect.Method;
import java.util.concurrent.atomic.AtomicInteger;
import org.bukkit.plugin.EventExecutor;
import org.jetbrains.annotations.NotNull;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Type;
import org.objectweb.asm.commons.GeneratorAdapter;

import java.lang.reflect.Method;
import java.util.concurrent.atomic.AtomicInteger;

import static org.objectweb.asm.Opcodes.ACC_PUBLIC;
import static org.objectweb.asm.Opcodes.INVOKEINTERFACE;
import static org.objectweb.asm.Opcodes.INVOKESPECIAL;
import static org.objectweb.asm.Opcodes.INVOKEVIRTUAL;
import static org.objectweb.asm.Opcodes.V1_8;
import org.objectweb.asm.Type;
import org.objectweb.asm.commons.GeneratorAdapter;

public class ASMEventExecutorGenerator {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

import com.google.common.base.Preconditions;
import com.google.common.collect.MapMaker;
import org.jetbrains.annotations.NotNull;

import java.util.concurrent.ConcurrentMap;
import org.jetbrains.annotations.NotNull;

public class SafeClassDefiner implements ClassDefiner {
/* default */ static final SafeClassDefiner INSTANCE = new SafeClassDefiner();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
package com.destroystokyo.paper.event.player;

import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList;
import org.bukkit.event.player.PlayerEvent;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

import org.bukkit.Material;
import static org.bukkit.Material.CARVED_PUMPKIN;
import static org.bukkit.Material.CHAINMAIL_BOOTS;
import static org.bukkit.Material.CHAINMAIL_CHESTPLATE;
Expand Down Expand Up @@ -47,6 +39,12 @@
import static org.bukkit.Material.TURTLE_HELMET;
import static org.bukkit.Material.WITHER_SKELETON_SKULL;
import static org.bukkit.Material.ZOMBIE_HEAD;
import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList;
import org.bukkit.event.player.PlayerEvent;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/**
* Called when the player themselves change their armor items
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package com.destroystokyo.paper.exception;

import static com.google.common.base.Preconditions.checkNotNull;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;

import static com.google.common.base.Preconditions.checkNotNull;

/**
* Thrown when a command throws an exception
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package com.destroystokyo.paper.exception;

import static com.google.common.base.Preconditions.checkNotNull;
import org.bukkit.event.Event;
import org.bukkit.event.Listener;
import org.bukkit.plugin.Plugin;

import static com.google.common.base.Preconditions.checkNotNull;

/**
* Exception thrown when a server event listener throws an exception
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package com.destroystokyo.paper.exception;

import org.bukkit.plugin.Plugin;

import static com.google.common.base.Preconditions.checkNotNull;
import org.bukkit.plugin.Plugin;

/**
* Wrapper exception for all cases to which a plugin can be immediately blamed for
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package com.destroystokyo.paper.exception;

import org.bukkit.scheduler.BukkitTask;

import static com.google.common.base.Preconditions.checkNotNull;
import org.bukkit.scheduler.BukkitTask;

/**
* Thrown when a plugin's scheduler fails with an exception
Expand Down
11 changes: 5 additions & 6 deletions src/main/java/com/destroystokyo/paper/proxy/VelocityProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@
import com.mohistmc.banner.config.BannerConfig;
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.properties.Property;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.player.ProfilePublicKey;

import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.net.InetAddress;
import java.security.InvalidKeyException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.UUID;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.player.ProfilePublicKey;

public class VelocityProxy {
private static final int SUPPORTED_FORWARDING_VERSION = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap;
import it.unimi.dsi.fastutil.longs.Long2ObjectMap;
import it.unimi.dsi.fastutil.objects.ObjectBidirectionalIterator;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package com.destroystokyo.paper.util.maplist;

import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap;
import net.minecraft.world.entity.Entity;

import java.util.Arrays;
import java.util.Iterator;
import java.util.NoSuchElementException;
import net.minecraft.world.entity.Entity;

// list with O(1) remove & contains
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

import it.unimi.dsi.fastutil.longs.LongIterator;
import it.unimi.dsi.fastutil.shorts.Short2LongOpenHashMap;
import java.util.Arrays;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.chunk.GlobalPalette;

import java.util.Arrays;

/**
* @author Spottedleaf
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.destroystokyo.paper.util.maplist;

import it.unimi.dsi.fastutil.objects.Reference2IntOpenHashMap;

import java.util.Arrays;
import java.util.Iterator;
import java.util.NoSuchElementException;
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/com/mohistmc/banner/BannerMCStart.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@
import com.mohistmc.banner.util.I18n;
import com.mohistmc.i18n.i18n;
import io.izzel.arclight.mixin.injector.EjectorInfo;
import java.util.Scanner;
import net.fabricmc.loader.api.FabricLoader;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.spongepowered.asm.mixin.injection.struct.InjectionInfo;

import java.util.Scanner;

public class BannerMCStart {

public static i18n I18N;
Expand Down
17 changes: 8 additions & 9 deletions src/main/java/com/mohistmc/banner/Metrics.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@

import com.mohistmc.banner.api.ServerAPI;
import com.mohistmc.banner.bukkit.BukkitExtraConstants;
import net.minecraft.util.thread.NamedThreadFactory;
import org.bukkit.Bukkit;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.Plugin;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.spigotmc.SpigotConfig;

import javax.net.ssl.HttpsURLConnection;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.File;
Expand All @@ -29,6 +20,14 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.zip.GZIPOutputStream;
import javax.net.ssl.HttpsURLConnection;
import net.minecraft.util.thread.NamedThreadFactory;
import org.bukkit.Bukkit;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.Plugin;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.spigotmc.SpigotConfig;

/**
* bStats collects some data for plugin authors.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
package com.mohistmc.banner.bukkit;

import java.util.ArrayList;
import java.util.List;
import java.util.Spliterator;
import java.util.function.Consumer;
import net.minecraft.world.Container;
import org.bukkit.craftbukkit.v1_20_R1.inventory.CraftInventory;
import org.bukkit.entity.HumanEntity;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;

import java.util.ArrayList;
import java.util.List;
import java.util.Spliterator;
import java.util.function.Consumer;

public class BannerLecternInventory extends CraftInventory {

public List<HumanEntity> transaction = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package com.mohistmc.banner.bukkit;


import java.net.InetSocketAddress;
import java.util.Iterator;
import java.util.NoSuchElementException;
import net.minecraft.network.Connection;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.ServerPlayer;
Expand All @@ -12,10 +15,6 @@
import org.bukkit.util.CachedServerIcon;
import org.jetbrains.annotations.NotNull;

import java.net.InetSocketAddress;
import java.util.Iterator;
import java.util.NoSuchElementException;

public class BannerServerListPingEvent extends ServerListPingEvent {

public CraftIconCache icon;
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/com/mohistmc/banner/bukkit/BukkitContainer.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.mohistmc.banner.bukkit;

import java.util.ArrayList;
import java.util.List;
import net.minecraft.world.Container;
import net.minecraft.world.SimpleContainer;
import net.minecraft.world.entity.player.Player;
Expand All @@ -18,9 +20,6 @@
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;

import java.util.ArrayList;
import java.util.List;

public class BukkitContainer {

/*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.mohistmc.banner.bukkit;

import java.util.Collection;
import java.util.Comparator;
import java.util.List;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.nbt.CompoundTag;
Expand Down Expand Up @@ -36,10 +39,6 @@
import org.bukkit.event.entity.CreatureSpawnEvent;
import org.bukkit.event.entity.EntityTransformEvent;

import java.util.Collection;
import java.util.Comparator;
import java.util.List;

public class BukkitExtraConstants {

public static TreeType treeType; // CraftBukkit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
package com.mohistmc.banner.bukkit;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Stack;
import java.util.concurrent.atomic.AtomicReference;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.PositionImpl;
Expand All @@ -17,12 +22,6 @@
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.entity.EntityPotionEffectEvent;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Stack;
import java.util.concurrent.atomic.AtomicReference;

public class BukkitSnapshotCaptures {

private static boolean banner$stopGlide = false;
Expand Down
Loading

0 comments on commit 07597dc

Please sign in to comment.