Minor cleanup
This commit is contained in:
parent
5b93123ed1
commit
67336168fb
54 changed files with 48 additions and 76 deletions
|
|
@ -31,7 +31,6 @@ import org.bukkit.potion.PotionType;
|
|||
|
||||
import net.coreprotect.config.ConfigHandler;
|
||||
import net.coreprotect.utility.BlockUtils;
|
||||
import net.coreprotect.utility.Util;
|
||||
|
||||
public class BukkitAdapter implements BukkitInterface {
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ import net.coreprotect.model.BlockGroup;
|
|||
import net.coreprotect.utility.ItemUtils;
|
||||
import net.coreprotect.utility.MaterialUtils;
|
||||
|
||||
public class Bukkit_v1_17 extends BukkitAdapter implements BukkitInterface {
|
||||
public class Bukkit_v1_17 extends BukkitAdapter {
|
||||
|
||||
public Bukkit_v1_17() {
|
||||
BlockGroup.TRACK_ANY = new HashSet<>(Arrays.asList(Material.PISTON_HEAD, Material.LEVER, Material.BELL, Material.SMALL_AMETHYST_BUD, Material.MEDIUM_AMETHYST_BUD, Material.LARGE_AMETHYST_BUD, Material.AMETHYST_CLUSTER, Material.GLOW_LICHEN));
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ package net.coreprotect.bukkit;
|
|||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.MerchantRecipe;
|
||||
|
||||
public class Bukkit_v1_18 extends Bukkit_v1_17 implements BukkitInterface {
|
||||
public class Bukkit_v1_18 extends Bukkit_v1_17 {
|
||||
|
||||
private Boolean hasAdjust = null;
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import org.bukkit.entity.Tadpole;
|
|||
|
||||
import net.coreprotect.model.BlockGroup;
|
||||
|
||||
public class Bukkit_v1_19 extends Bukkit_v1_18 implements BukkitInterface {
|
||||
public class Bukkit_v1_19 extends Bukkit_v1_18 {
|
||||
|
||||
public Bukkit_v1_19() {
|
||||
BlockGroup.TRACK_TOP = new HashSet<>(Arrays.asList(Material.TORCH, Material.REDSTONE_TORCH, Material.BAMBOO, Material.BAMBOO_SAPLING, Material.CORNFLOWER, Material.LILY_OF_THE_VALLEY, Material.WITHER_ROSE, Material.SWEET_BERRY_BUSH, Material.SCAFFOLDING, Material.OAK_SAPLING, Material.SPRUCE_SAPLING, Material.BIRCH_SAPLING, Material.JUNGLE_SAPLING, Material.MANGROVE_PROPAGULE, Material.ACACIA_SAPLING, Material.DARK_OAK_SAPLING, Material.POWERED_RAIL, Material.DETECTOR_RAIL, Material.FERN, Material.DEAD_BUSH, Material.DANDELION, Material.POPPY, Material.BLUE_ORCHID, Material.ALLIUM, Material.AZURE_BLUET, Material.RED_TULIP, Material.ORANGE_TULIP, Material.WHITE_TULIP, Material.PINK_TULIP, Material.OXEYE_DAISY, Material.BROWN_MUSHROOM, Material.RED_MUSHROOM, Material.REDSTONE_WIRE, Material.WHEAT, Material.MANGROVE_SIGN, Material.ACACIA_SIGN, Material.BIRCH_SIGN, Material.DARK_OAK_SIGN, Material.JUNGLE_SIGN, Material.OAK_SIGN, Material.SPRUCE_SIGN, Material.WHITE_BANNER, Material.ORANGE_BANNER, Material.MAGENTA_BANNER, Material.LIGHT_BLUE_BANNER, Material.YELLOW_BANNER, Material.LIME_BANNER, Material.PINK_BANNER, Material.GRAY_BANNER, Material.LIGHT_GRAY_BANNER, Material.CYAN_BANNER, Material.PURPLE_BANNER, Material.BLUE_BANNER, Material.BROWN_BANNER, Material.GREEN_BANNER, Material.RED_BANNER, Material.BLACK_BANNER, Material.RAIL, Material.IRON_DOOR, Material.SNOW, Material.CACTUS, Material.SUGAR_CANE, Material.REPEATER, Material.PUMPKIN_STEM, Material.MELON_STEM, Material.CARROT, Material.POTATO, Material.COMPARATOR, Material.ACTIVATOR_RAIL, Material.SUNFLOWER, Material.LILAC, Material.TALL_GRASS, Material.LARGE_FERN, Material.ROSE_BUSH, Material.PEONY, Material.NETHER_WART, Material.CHORUS_PLANT, Material.CHORUS_FLOWER, Material.KELP, Material.SOUL_TORCH, Material.TWISTING_VINES, Material.CRIMSON_FUNGUS, Material.WARPED_FUNGUS, Material.CRIMSON_ROOTS, Material.WARPED_ROOTS, Material.NETHER_SPROUTS, Material.CRIMSON_SIGN, Material.WARPED_SIGN, Material.AZALEA, Material.FLOWERING_AZALEA, Material.SMALL_DRIPLEAF, Material.BIG_DRIPLEAF));
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import org.bukkit.potion.PotionType;
|
|||
|
||||
import net.coreprotect.model.BlockGroup;
|
||||
|
||||
public class Bukkit_v1_20 extends Bukkit_v1_19 implements BukkitInterface {
|
||||
public class Bukkit_v1_20 extends Bukkit_v1_19 {
|
||||
|
||||
private Boolean hasClickedPosition = null;
|
||||
private Boolean hasBasePotionType = null;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ import java.nio.file.Files;
|
|||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.WeakHashMap;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ import net.coreprotect.utility.BlockUtils;
|
|||
import net.coreprotect.utility.Chat;
|
||||
import net.coreprotect.utility.ItemUtils;
|
||||
import net.coreprotect.utility.MaterialUtils;
|
||||
import net.coreprotect.utility.Util;
|
||||
|
||||
public class ContainerRollback extends Rollback {
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ import net.coreprotect.database.statement.BlockStatement;
|
|||
import net.coreprotect.database.statement.UserStatement;
|
||||
import net.coreprotect.event.CoreProtectPreLogEvent;
|
||||
import net.coreprotect.thread.CacheHandler;
|
||||
import net.coreprotect.utility.Util;
|
||||
import net.coreprotect.utility.WorldUtils;
|
||||
|
||||
public class BlockBreakLogger {
|
||||
|
|
|
|||
|
|
@ -16,9 +16,7 @@ import net.coreprotect.database.statement.BlockStatement;
|
|||
import net.coreprotect.database.statement.UserStatement;
|
||||
import net.coreprotect.event.CoreProtectPreLogEvent;
|
||||
import net.coreprotect.thread.CacheHandler;
|
||||
import net.coreprotect.utility.BlockUtils;
|
||||
import net.coreprotect.utility.MaterialUtils;
|
||||
import net.coreprotect.utility.Util;
|
||||
import net.coreprotect.utility.WorldUtils;
|
||||
|
||||
public class BlockPlaceLogger {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ import org.bukkit.Location;
|
|||
|
||||
import net.coreprotect.config.ConfigHandler;
|
||||
import net.coreprotect.database.statement.ChatStatement;
|
||||
import net.coreprotect.utility.Util;
|
||||
import net.coreprotect.utility.WorldUtils;
|
||||
|
||||
public class ChatLogger {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ import net.coreprotect.config.ConfigHandler;
|
|||
import net.coreprotect.database.statement.CommandStatement;
|
||||
import net.coreprotect.database.statement.UserStatement;
|
||||
import net.coreprotect.event.CoreProtectPreLogEvent;
|
||||
import net.coreprotect.utility.Util;
|
||||
import net.coreprotect.utility.WorldUtils;
|
||||
|
||||
public class CommandLogger {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import org.bukkit.inventory.ItemStack;
|
|||
|
||||
import net.coreprotect.config.ConfigHandler;
|
||||
import net.coreprotect.utility.ItemUtils;
|
||||
import net.coreprotect.utility.Util;
|
||||
|
||||
public class ContainerBreakLogger {
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ import net.coreprotect.event.CoreProtectPreLogEvent;
|
|||
import net.coreprotect.utility.BlockUtils;
|
||||
import net.coreprotect.utility.ItemUtils;
|
||||
import net.coreprotect.utility.MaterialUtils;
|
||||
import net.coreprotect.utility.Util;
|
||||
import net.coreprotect.utility.WorldUtils;
|
||||
import net.coreprotect.utility.serialize.ItemMetaHandler;
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ import net.coreprotect.database.statement.BlockStatement;
|
|||
import net.coreprotect.database.statement.EntityStatement;
|
||||
import net.coreprotect.database.statement.UserStatement;
|
||||
import net.coreprotect.event.CoreProtectPreLogEvent;
|
||||
import net.coreprotect.utility.Util;
|
||||
import net.coreprotect.utility.WorldUtils;
|
||||
|
||||
public class EntityKillLogger {
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ import net.coreprotect.event.CoreProtectPreLogEvent;
|
|||
import net.coreprotect.utility.BlockUtils;
|
||||
import net.coreprotect.utility.ItemUtils;
|
||||
import net.coreprotect.utility.MaterialUtils;
|
||||
import net.coreprotect.utility.Util;
|
||||
import net.coreprotect.utility.WorldUtils;
|
||||
import net.coreprotect.utility.serialize.ItemMetaHandler;
|
||||
|
||||
|
|
|
|||
|
|
@ -13,9 +13,7 @@ import net.coreprotect.config.ConfigHandler;
|
|||
import net.coreprotect.database.statement.BlockStatement;
|
||||
import net.coreprotect.database.statement.UserStatement;
|
||||
import net.coreprotect.event.CoreProtectPreLogEvent;
|
||||
import net.coreprotect.utility.BlockUtils;
|
||||
import net.coreprotect.utility.MaterialUtils;
|
||||
import net.coreprotect.utility.Util;
|
||||
import net.coreprotect.utility.WorldUtils;
|
||||
|
||||
public class PlayerInteractLogger {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ import net.coreprotect.config.ConfigHandler;
|
|||
import net.coreprotect.database.statement.BlockStatement;
|
||||
import net.coreprotect.database.statement.UserStatement;
|
||||
import net.coreprotect.event.CoreProtectPreLogEvent;
|
||||
import net.coreprotect.utility.Util;
|
||||
import net.coreprotect.utility.WorldUtils;
|
||||
|
||||
public class PlayerKillLogger {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ import org.bukkit.Location;
|
|||
|
||||
import net.coreprotect.config.ConfigHandler;
|
||||
import net.coreprotect.database.statement.SessionStatement;
|
||||
import net.coreprotect.utility.Util;
|
||||
import net.coreprotect.utility.WorldUtils;
|
||||
|
||||
public class PlayerSessionLogger {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ import net.coreprotect.config.ConfigHandler;
|
|||
import net.coreprotect.database.statement.SignStatement;
|
||||
import net.coreprotect.database.statement.UserStatement;
|
||||
import net.coreprotect.event.CoreProtectPreLogEvent;
|
||||
import net.coreprotect.utility.Util;
|
||||
import net.coreprotect.utility.WorldUtils;
|
||||
|
||||
public class SignTextLogger {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ import net.coreprotect.database.Database;
|
|||
import net.coreprotect.database.statement.SkullStatement;
|
||||
import net.coreprotect.paper.PaperAdapter;
|
||||
import net.coreprotect.utility.MaterialUtils;
|
||||
import net.coreprotect.utility.Util;
|
||||
|
||||
public class SkullBreakLogger {
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ import net.coreprotect.utility.Color;
|
|||
import net.coreprotect.utility.ItemUtils;
|
||||
import net.coreprotect.utility.MaterialUtils;
|
||||
import net.coreprotect.utility.StringUtils;
|
||||
import net.coreprotect.utility.Util;
|
||||
import net.coreprotect.utility.WorldUtils;
|
||||
|
||||
public class ChestTransactionLookup {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ import net.coreprotect.utility.ChatUtils;
|
|||
import net.coreprotect.utility.Color;
|
||||
import net.coreprotect.utility.MaterialUtils;
|
||||
import net.coreprotect.utility.StringUtils;
|
||||
import net.coreprotect.utility.Util;
|
||||
import net.coreprotect.utility.WorldUtils;
|
||||
|
||||
public class InteractionLookup {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ import net.coreprotect.language.Selector;
|
|||
import net.coreprotect.listener.channel.PluginChannelListener;
|
||||
import net.coreprotect.utility.ChatUtils;
|
||||
import net.coreprotect.utility.Color;
|
||||
import net.coreprotect.utility.Util;
|
||||
import net.coreprotect.utility.WorldUtils;
|
||||
|
||||
public class SignMessageLookup {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package net.coreprotect.database.statement;
|
|||
import java.sql.PreparedStatement;
|
||||
import java.util.List;
|
||||
|
||||
import net.coreprotect.utility.Util;
|
||||
import net.coreprotect.utility.BlockUtils;
|
||||
import net.coreprotect.utility.ItemUtils;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package net.coreprotect.database.statement;
|
|||
import java.sql.PreparedStatement;
|
||||
|
||||
import net.coreprotect.utility.ItemUtils;
|
||||
import net.coreprotect.utility.Util;
|
||||
|
||||
public class ContainerStatement {
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package net.coreprotect.database.statement;
|
|||
import java.sql.PreparedStatement;
|
||||
|
||||
import net.coreprotect.utility.ItemUtils;
|
||||
import net.coreprotect.utility.Util;
|
||||
|
||||
public class ItemStatement {
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import java.util.regex.Pattern;
|
|||
import net.coreprotect.utility.ChatMessage;
|
||||
import net.coreprotect.utility.Color;
|
||||
import net.coreprotect.utility.StringUtils;
|
||||
import net.coreprotect.utility.Util;
|
||||
|
||||
public enum Phrase {
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ import net.coreprotect.database.Database;
|
|||
import net.coreprotect.model.BlockGroup;
|
||||
import net.coreprotect.paper.PaperAdapter;
|
||||
import net.coreprotect.utility.BlockUtils;
|
||||
import net.coreprotect.utility.Util;
|
||||
|
||||
public final class BlockBreakListener extends Queue implements Listener {
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ import net.coreprotect.config.Config;
|
|||
import net.coreprotect.consumer.Queue;
|
||||
import net.coreprotect.database.Lookup;
|
||||
import net.coreprotect.thread.CacheHandler;
|
||||
import net.coreprotect.utility.Util;
|
||||
import net.coreprotect.utility.WorldUtils;
|
||||
|
||||
public final class BlockFormListener extends Queue implements Listener {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ import net.coreprotect.config.Config;
|
|||
import net.coreprotect.consumer.Queue;
|
||||
import net.coreprotect.database.Lookup;
|
||||
import net.coreprotect.thread.CacheHandler;
|
||||
import net.coreprotect.utility.Util;
|
||||
import net.coreprotect.utility.WorldUtils;
|
||||
|
||||
public final class BlockFromToListener extends Queue implements Listener {
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ import net.coreprotect.database.logger.ItemLogger;
|
|||
import net.coreprotect.listener.player.ProjectileLaunchListener;
|
||||
import net.coreprotect.model.BlockGroup;
|
||||
import net.coreprotect.thread.CacheHandler;
|
||||
import net.coreprotect.utility.Util;
|
||||
import net.coreprotect.utility.WorldUtils;
|
||||
|
||||
public final class BlockIgniteListener extends Queue implements Listener {
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ import org.bukkit.event.block.BlockPistonRetractEvent;
|
|||
import net.coreprotect.config.Config;
|
||||
import net.coreprotect.consumer.Queue;
|
||||
import net.coreprotect.thread.CacheHandler;
|
||||
import net.coreprotect.utility.Util;
|
||||
import net.coreprotect.utility.WorldUtils;
|
||||
|
||||
public final class BlockPistonListener extends Queue implements Listener {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import org.bukkit.entity.Player;
|
|||
import net.coreprotect.bukkit.BukkitAdapter;
|
||||
import net.coreprotect.model.BlockGroup;
|
||||
import net.coreprotect.thread.CacheHandler;
|
||||
import net.coreprotect.utility.Util;
|
||||
import net.coreprotect.utility.WorldUtils;
|
||||
|
||||
public class BlockUtil {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ import org.bukkit.inventory.ItemStack;
|
|||
import net.coreprotect.consumer.Queue;
|
||||
import net.coreprotect.listener.player.PlayerDropItemListener;
|
||||
import net.coreprotect.thread.CacheHandler;
|
||||
import net.coreprotect.utility.Util;
|
||||
import net.coreprotect.utility.WorldUtils;
|
||||
|
||||
public final class CampfireStartListener extends Queue implements Listener {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ import net.coreprotect.language.Phrase;
|
|||
import net.coreprotect.language.Selector;
|
||||
import net.coreprotect.utility.Chat;
|
||||
import net.coreprotect.utility.Color;
|
||||
import net.coreprotect.utility.Util;
|
||||
import net.coreprotect.utility.WorldUtils;
|
||||
|
||||
public class PluginChannelListener implements Listener {
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ import net.coreprotect.config.ConfigHandler;
|
|||
import net.coreprotect.consumer.Queue;
|
||||
import net.coreprotect.listener.block.BlockUtil;
|
||||
import net.coreprotect.utility.EntityUtils;
|
||||
import net.coreprotect.utility.Util;
|
||||
|
||||
public final class CreatureSpawnListener extends Queue implements Listener {
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@ import net.coreprotect.database.Database;
|
|||
import net.coreprotect.listener.player.PlayerInteractEntityListener;
|
||||
import net.coreprotect.thread.Scheduler;
|
||||
import net.coreprotect.utility.ItemUtils;
|
||||
import net.coreprotect.utility.Util;
|
||||
|
||||
public final class EntityDamageByEntityListener extends Queue implements Listener {
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ import net.coreprotect.model.BlockGroup;
|
|||
import net.coreprotect.utility.Chat;
|
||||
import net.coreprotect.utility.Color;
|
||||
import net.coreprotect.utility.ItemUtils;
|
||||
import net.coreprotect.utility.Util;
|
||||
|
||||
public final class ArmorStandManipulateListener extends Queue implements Listener {
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ import net.coreprotect.CoreProtect;
|
|||
import net.coreprotect.consumer.Queue;
|
||||
import net.coreprotect.thread.CacheHandler;
|
||||
import net.coreprotect.thread.Scheduler;
|
||||
import net.coreprotect.utility.Util;
|
||||
import net.coreprotect.utility.WorldUtils;
|
||||
|
||||
public final class FoodLevelChangeListener extends Queue implements Listener {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ import net.coreprotect.config.Config;
|
|||
import net.coreprotect.config.ConfigHandler;
|
||||
import net.coreprotect.thread.Scheduler;
|
||||
import net.coreprotect.utility.ItemUtils;
|
||||
import net.coreprotect.utility.Util;
|
||||
|
||||
public final class HopperPullListener {
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ import net.coreprotect.config.Config;
|
|||
import net.coreprotect.config.ConfigHandler;
|
||||
import net.coreprotect.thread.Scheduler;
|
||||
import net.coreprotect.utility.ItemUtils;
|
||||
import net.coreprotect.utility.Util;
|
||||
|
||||
public final class HopperPushListener {
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ import org.bukkit.inventory.BlockInventoryHolder;
|
|||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.InventoryHolder;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.EnchantmentStorageMeta;
|
||||
|
||||
import net.coreprotect.CoreProtect;
|
||||
import net.coreprotect.config.Config;
|
||||
|
|
@ -35,7 +34,6 @@ import net.coreprotect.model.BlockGroup;
|
|||
import net.coreprotect.paper.PaperAdapter;
|
||||
import net.coreprotect.thread.Scheduler;
|
||||
import net.coreprotect.utility.ItemUtils;
|
||||
import net.coreprotect.utility.Util;
|
||||
import net.coreprotect.utility.Validate;
|
||||
import us.lynuxcraft.deadsilenceiv.advancedchests.AdvancedChestsAPI;
|
||||
import us.lynuxcraft.deadsilenceiv.advancedchests.chest.AdvancedChest;
|
||||
|
|
@ -87,17 +85,20 @@ public final class InventoryChangeListener extends Queue implements Listener {
|
|||
if (containerType != null) {
|
||||
type = containerType;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
InventoryHolder inventoryHolder = inventory.getHolder();
|
||||
if (inventoryHolder == null) {
|
||||
if (CoreProtect.getInstance().isAdvancedChestsEnabled()) {
|
||||
AdvancedChest<?, ?> advancedChest = AdvancedChestsAPI.getInventoryManager().getAdvancedChest(inventory);
|
||||
if (advancedChest != null) {
|
||||
playerLocation = advancedChest.getLocation();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -107,7 +108,8 @@ public final class InventoryChangeListener extends Queue implements Listener {
|
|||
if (BlockGroup.CONTAINERS.contains(type)) {
|
||||
playerLocation = state.getLocation();
|
||||
}
|
||||
} else if (inventoryHolder instanceof DoubleChest) {
|
||||
}
|
||||
else if (inventoryHolder instanceof DoubleChest) {
|
||||
DoubleChest state = (DoubleChest) inventoryHolder;
|
||||
playerLocation = state.getLocation();
|
||||
}
|
||||
|
|
@ -232,7 +234,7 @@ public final class InventoryChangeListener extends Queue implements Listener {
|
|||
return;
|
||||
}
|
||||
if (CoreProtect.getInstance().isAdvancedChestsEnabled()) {
|
||||
AdvancedChest<?,?> chest = AdvancedChestsAPI.getInventoryManager().getAdvancedChest(inventory);
|
||||
AdvancedChest<?, ?> chest = AdvancedChestsAPI.getInventoryManager().getAdvancedChest(inventory);
|
||||
if (chest != null) {
|
||||
location = chest.getLocation();
|
||||
}
|
||||
|
|
@ -272,53 +274,55 @@ public final class InventoryChangeListener extends Queue implements Listener {
|
|||
|
||||
/**
|
||||
* Checks for anvil operations to properly track enchanted item results
|
||||
* @param event The inventory click event
|
||||
*
|
||||
* @param event
|
||||
* The inventory click event
|
||||
* @return true if this was an anvil result operation that was handled, false otherwise
|
||||
*/
|
||||
private boolean checkAnvilOperation(InventoryClickEvent event) {
|
||||
if (event.getInventory().getType() != InventoryType.ANVIL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// Only process result slot clicks in anvils (slot 2)
|
||||
if (event.getRawSlot() != 2) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// Ensure we have a valid player and item
|
||||
Player player = (Player) event.getWhoClicked();
|
||||
ItemStack resultItem = event.getCurrentItem();
|
||||
if (resultItem == null || resultItem.getType() == Material.AIR) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// Get the input items (slots 0 and 1 in the anvil)
|
||||
ItemStack firstItem = event.getInventory().getItem(0);
|
||||
ItemStack secondItem = event.getInventory().getItem(1);
|
||||
|
||||
|
||||
if (firstItem == null || secondItem == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// Process the enchantment operation
|
||||
Location location = player.getLocation();
|
||||
String loggingItemId = player.getName().toLowerCase(Locale.ROOT) + "." + location.getBlockX() + "." + location.getBlockY() + "." + location.getBlockZ();
|
||||
int itemId = getItemId(loggingItemId);
|
||||
|
||||
|
||||
// Log the input items as removed
|
||||
List<ItemStack> removedItems = new ArrayList<>();
|
||||
removedItems.add(firstItem.clone());
|
||||
removedItems.add(secondItem.clone());
|
||||
ConfigHandler.itemsDestroy.put(loggingItemId, removedItems);
|
||||
|
||||
|
||||
// Log the output item as created
|
||||
List<ItemStack> createdItems = new ArrayList<>();
|
||||
createdItems.add(resultItem.clone());
|
||||
ConfigHandler.itemsCreate.put(loggingItemId, createdItems);
|
||||
|
||||
|
||||
int time = (int) (System.currentTimeMillis() / 1000L) + 1;
|
||||
Queue.queueItemTransaction(player.getName(), location.clone(), time, 0, itemId);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -328,7 +332,7 @@ public final class InventoryChangeListener extends Queue implements Listener {
|
|||
if (inventoryAction == InventoryAction.NOTHING) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Check if this is an anvil operation first
|
||||
if (checkAnvilOperation(event)) {
|
||||
return;
|
||||
|
|
@ -360,10 +364,11 @@ public final class InventoryChangeListener extends Queue implements Listener {
|
|||
if ((!(inventoryHolder instanceof BlockInventoryHolder || inventoryHolder instanceof DoubleChest)) && !enderChest && !advancedChest) {
|
||||
return;
|
||||
}
|
||||
if(advancedChest && event.getSlot() > inventory.getSize() - 10){
|
||||
if (advancedChest && event.getSlot() > inventory.getSize() - 10) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
// Perform standard inventory holder check on primary inventory
|
||||
Inventory inventory = event.getInventory();
|
||||
if (inventory == null) {
|
||||
|
|
@ -376,7 +381,7 @@ public final class InventoryChangeListener extends Queue implements Listener {
|
|||
if ((!(inventoryHolder instanceof BlockInventoryHolder || inventoryHolder instanceof DoubleChest)) && !enderChest && !advancedChest) {
|
||||
return;
|
||||
}
|
||||
if(advancedChest && event.getSlot() > inventory.getSize() - 10){
|
||||
if (advancedChest && event.getSlot() > inventory.getSize() - 10) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ import net.coreprotect.config.Config;
|
|||
import net.coreprotect.config.ConfigHandler;
|
||||
import net.coreprotect.consumer.Queue;
|
||||
import net.coreprotect.thread.CacheHandler;
|
||||
import net.coreprotect.utility.Util;
|
||||
import net.coreprotect.utility.WorldUtils;
|
||||
|
||||
public final class PlayerBucketEmptyListener extends Queue implements Listener {
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ import net.coreprotect.consumer.Queue;
|
|||
import net.coreprotect.database.logger.ItemLogger;
|
||||
import net.coreprotect.model.BlockGroup;
|
||||
import net.coreprotect.utility.ItemUtils;
|
||||
import net.coreprotect.utility.Util;
|
||||
|
||||
public final class PlayerInteractEntityListener extends Queue implements Listener {
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ import net.coreprotect.config.ConfigHandler;
|
|||
import net.coreprotect.consumer.Queue;
|
||||
import net.coreprotect.database.logger.ItemLogger;
|
||||
import net.coreprotect.utility.EntityUtils;
|
||||
import net.coreprotect.utility.Util;
|
||||
|
||||
public final class ProjectileLaunchListener extends Queue implements Listener {
|
||||
|
||||
|
|
@ -103,7 +102,7 @@ public final class ProjectileLaunchListener extends Queue implements Listener {
|
|||
if (!(event.getEntity() instanceof Player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
ItemStack itemStack = event.getConsumable();
|
||||
playerLaunchProjectile(event.getEntity().getLocation(), event.getEntity().getName(), itemStack, 1, 1, 0, ItemLogger.ITEM_SHOOT);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import org.bukkit.entity.Entity;
|
|||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.InventoryHolder;
|
||||
|
||||
public class PaperHandler extends PaperAdapter implements PaperInterface {
|
||||
public class PaperHandler extends PaperAdapter {
|
||||
|
||||
@Override
|
||||
public boolean isStopping(Server server) {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import org.bukkit.block.Sign;
|
|||
|
||||
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
|
||||
|
||||
public class Paper_v1_17 extends PaperHandler implements PaperInterface {
|
||||
public class Paper_v1_17 extends PaperHandler {
|
||||
|
||||
@Override
|
||||
public String getLine(Sign sign, int line) {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import com.destroystokyo.paper.profile.PlayerProfile;
|
|||
import net.coreprotect.config.Config;
|
||||
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
|
||||
|
||||
public class Paper_v1_20 extends Paper_v1_17 implements PaperInterface {
|
||||
public class Paper_v1_20 extends Paper_v1_17 {
|
||||
|
||||
@Override
|
||||
public String getLine(Sign sign, int line) {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ import net.coreprotect.config.Config;
|
|||
import net.coreprotect.config.ConfigHandler;
|
||||
import net.coreprotect.database.Database;
|
||||
import net.coreprotect.patch.Patch;
|
||||
import net.coreprotect.utility.Util;
|
||||
import net.coreprotect.utility.BlockUtils;
|
||||
import net.coreprotect.utility.MaterialUtils;
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ import net.coreprotect.language.Selector;
|
|||
import net.coreprotect.patch.Patch;
|
||||
import net.coreprotect.utility.Chat;
|
||||
import net.coreprotect.utility.MaterialUtils;
|
||||
import net.coreprotect.utility.Util;
|
||||
|
||||
public class __2_19_0 {
|
||||
|
||||
|
|
|
|||
|
|
@ -62,7 +62,6 @@ import net.coreprotect.bukkit.BukkitAdapter;
|
|||
import net.coreprotect.database.rollback.Rollback;
|
||||
import net.coreprotect.thread.CacheHandler;
|
||||
import net.coreprotect.thread.Scheduler;
|
||||
import net.coreprotect.utility.Util;
|
||||
import net.coreprotect.utility.WorldUtils;
|
||||
|
||||
public class EntityUtil {
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ import com.sk89q.worldedit.world.block.BlockStateHolder;
|
|||
|
||||
import net.coreprotect.config.Config;
|
||||
import net.coreprotect.utility.ItemUtils;
|
||||
import net.coreprotect.utility.Util;
|
||||
|
||||
public class CoreProtectLogger extends AbstractDelegateExtent {
|
||||
private final Actor eventActor;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue