diff --git a/BauSystem/BauSystem_Main/build.gradle.kts b/BauSystem/BauSystem_Main/build.gradle.kts index 63d6f026..9ae53822 100644 --- a/BauSystem/BauSystem_Main/build.gradle.kts +++ b/BauSystem/BauSystem_Main/build.gradle.kts @@ -35,12 +35,16 @@ dependencies { annotationProcessor(libs.classindex) compileOnly(project(":SpigotCore", "default")) - compileOnly(libs.spigotapi) + compileOnly(libs.paperapi21) { + attributes { + // Very Hacky, but it works + attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 21) + } + } compileOnly(libs.axiom) compileOnly(libs.authlib) compileOnly(libs.viaapi) - compileOnly(libs.nms20) compileOnly(libs.fawe18) implementation(libs.luaj) diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/gui/editor/BauGuiEditor.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/gui/editor/BauGuiEditor.java index 733e7213..e40b01f3 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/gui/editor/BauGuiEditor.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/gui/editor/BauGuiEditor.java @@ -22,6 +22,7 @@ package de.steamwar.bausystem.features.gui.editor; import de.steamwar.bausystem.BauSystem; import de.steamwar.bausystem.features.gui.BauGUI; import de.steamwar.bausystem.linkage.specific.BauGuiItem; +import de.steamwar.core.TrickyTrialsWrapper; import de.steamwar.inventory.SWItem; import de.steamwar.inventory.SWListInv; import de.steamwar.linkage.Linked; @@ -72,7 +73,7 @@ public class BauGuiEditor implements Listener { inv.setItem(mapping.getSize() + 5, new SWItem(Material.BARRIER, BauSystem.MESSAGE.parse("GUI_EDITOR_ITEM_TRASH", p), Arrays.asList(BauSystem.MESSAGE.parse("GUI_EDITOR_ITEM_TRASH_LORE", p)), false, clickType -> { }).getItemStack()); - inv.setItem(mapping.getSize() + 6, new SWItem(Material.SCUTE, BauSystem.MESSAGE.parse("GUI_EDITOR_ITEM_MORE", p)).getItemStack()); + inv.setItem(mapping.getSize() + 6, new SWItem(TrickyTrialsWrapper.impl.getTurtleScute(), BauSystem.MESSAGE.parse("GUI_EDITOR_ITEM_MORE", p)).getItemStack()); inv.setItem(mapping.getSize() + 8, new SWItem(Material.ARROW, BauSystem.MESSAGE.parse("GUI_EDITOR_ITEM_CLOSE", p)).getItemStack()); p.openInventory(inv); diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/script/event/EventListener.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/script/event/EventListener.java index 3886c672..3eb099aa 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/script/event/EventListener.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/script/event/EventListener.java @@ -147,7 +147,7 @@ public class EventListener implements Listener { @EventHandler(priority = EventPriority.HIGH) public void onEntitySpawn(EntitySpawnEvent event) { - if (event.getEntityType().name().equals("tnt")) { + if (event.getEntityType() != TrickyTrialsWrapper.impl.getTntEntityType()) { return; } Region tntRegion = Region.getRegion(event.getLocation()); diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/gui/base/SimulatorBaseGui.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/gui/base/SimulatorBaseGui.java index 41f95a88..9e81340b 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/gui/base/SimulatorBaseGui.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/gui/base/SimulatorBaseGui.java @@ -22,6 +22,7 @@ package de.steamwar.bausystem.features.simulator.gui.base; import de.steamwar.bausystem.features.simulator.SimulatorWatcher; import de.steamwar.bausystem.features.simulator.data.Simulator; import de.steamwar.core.Core; +import de.steamwar.core.TrickyTrialsWrapper; import de.steamwar.inventory.SWInventory; import de.steamwar.inventory.SWItem; import org.bukkit.Bukkit; @@ -46,7 +47,7 @@ public abstract class SimulatorBaseGui { public final void open() { String newTitle = title(); - String originalTitle = player.getOpenInventory().getTitle(); + String originalTitle = TrickyTrialsWrapper.impl.getInventoryTitle(player.getOpenInventory()); if (inv != null && (Core.getVersion() > 19 || newTitle.equals(originalTitle))) { // TODO: Flickering is better but not gone! diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/team/boundary/BoundaryViewer.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/team/boundary/BoundaryViewer.java index 744ae0df..e2e1ec37 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/team/boundary/BoundaryViewer.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/team/boundary/BoundaryViewer.java @@ -23,6 +23,7 @@ import de.steamwar.bausystem.BauSystem; import de.steamwar.bausystem.region.Point; import de.steamwar.bausystem.region.Region; import de.steamwar.bausystem.region.utils.RegionType; +import de.steamwar.core.TrickyTrialsWrapper; import de.steamwar.linkage.Linked; import org.bukkit.Bukkit; import org.bukkit.Particle; @@ -56,7 +57,7 @@ public class BoundaryViewer implements Listener { } private void showRegion(Region region, Player player) { - drawCuboid(player, Particle.VILLAGER_HAPPY, region.getMinPoint(), region.getMaxPoint()); + drawCuboid(player, TrickyTrialsWrapper.impl.getVillagerHappyParticle(), region.getMinPoint(), region.getMaxPoint()); if (region.hasType(RegionType.TESTBLOCK)) { drawCuboid(player, Particle.END_ROD, region.getMinPointTestblockExtension(), region.getMaxPointTestblockExtension()); } diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/NightVisionBauGuiItem.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/NightVisionBauGuiItem.java index d9cab51e..03ebb495 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/NightVisionBauGuiItem.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/NightVisionBauGuiItem.java @@ -47,7 +47,6 @@ public class NightVisionBauGuiItem extends BauGuiItem { PotionMeta meta = (PotionMeta) itemStack.getItemMeta(); meta.setColor(PotionEffectType.NIGHT_VISION.getColor()); meta.setDisplayName(BauSystem.MESSAGE.parse("NIGHT_VISION_ITEM_ON", player)); - meta.addItemFlags(ItemFlag.HIDE_POTION_EFFECTS); meta.setCustomModelData(1); itemStack.setItemMeta(meta); return itemStack; diff --git a/CommonCore/SQL/src/de/steamwar/sql/NodeData.java b/CommonCore/SQL/src/de/steamwar/sql/NodeData.java index 52743811..33bb0020 100644 --- a/CommonCore/SQL/src/de/steamwar/sql/NodeData.java +++ b/CommonCore/SQL/src/de/steamwar/sql/NodeData.java @@ -71,7 +71,7 @@ public class NodeData { if(rs.wasNull() || schemData.available() == 0) { throw new SecurityException("SchemData is null"); } - return new GZIPInputStream(schemData); + return schemData; } catch (IOException e) { throw new SecurityException("SchemData is wrong", e); } diff --git a/SpigotCore/SpigotCore_14/src/de/steamwar/core/FlatteningWrapper14.java b/SpigotCore/SpigotCore_14/src/de/steamwar/core/FlatteningWrapper14.java index 1aec490e..b7a9bf7f 100644 --- a/SpigotCore/SpigotCore_14/src/de/steamwar/core/FlatteningWrapper14.java +++ b/SpigotCore/SpigotCore_14/src/de/steamwar/core/FlatteningWrapper14.java @@ -232,21 +232,9 @@ public class FlatteningWrapper14 implements FlatteningWrapper.IFlatteningWrapper scoreboardName.set(packet, ChatWrapper.impl.stringToChatComponent(title)); } - private static final Class scoreActionEnum; - private static final Reflection.FieldAccessor scoreAction; - private static final Object scoreActionChange; - - static { - if (Core.getVersion() < 21) { - scoreActionEnum = Reflection.getClass("{nms.server}.ScoreboardServer$Action"); - scoreAction = Reflection.getField(FlatteningWrapper.scoreboardScore, scoreActionEnum, 0); - scoreActionChange = scoreActionEnum.getEnumConstants()[0]; - } else { - scoreActionEnum = null; - scoreAction = null; - scoreActionChange = null; - } - } + private static final Class scoreActionEnum = Core.getVersion() < 21 ? Reflection.getClass("{nms.server}.ScoreboardServer$Action") : null; + private static final Reflection.FieldAccessor scoreAction = Core.getVersion() < 21 ? Reflection.getField(FlatteningWrapper.scoreboardScore, scoreActionEnum, 0) : null; + private static final Object scoreActionChange = Core.getVersion() < 21 ? scoreActionEnum.getEnumConstants()[0] : null; @Override public void setScoreAction(Object packet) { diff --git a/SpigotCore/SpigotCore_14/src/de/steamwar/core/TrickyTrialsWrapper14.java b/SpigotCore/SpigotCore_14/src/de/steamwar/core/TrickyTrialsWrapper14.java new file mode 100644 index 00000000..aa30ea37 --- /dev/null +++ b/SpigotCore/SpigotCore_14/src/de/steamwar/core/TrickyTrialsWrapper14.java @@ -0,0 +1,30 @@ +/* + * This file is a part of the SteamWar software. + * + * Copyright (C) 2024 SteamWar.de-Serverteam + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package de.steamwar.core; + +import org.bukkit.Material; + +public class TrickyTrialsWrapper14 extends TrickyTrialsWrapper8 { + + @Override + public Material getTurtleScute() { + return Material.SCUTE; + } +} diff --git a/SpigotCore/SpigotCore_14/src/de/steamwar/core/WorldEditWrapper14.java b/SpigotCore/SpigotCore_14/src/de/steamwar/core/WorldEditWrapper14.java index 1b48b638..d7138cca 100644 --- a/SpigotCore/SpigotCore_14/src/de/steamwar/core/WorldEditWrapper14.java +++ b/SpigotCore/SpigotCore_14/src/de/steamwar/core/WorldEditWrapper14.java @@ -54,8 +54,8 @@ import static com.google.common.base.Preconditions.checkNotNull; public class WorldEditWrapper14 implements WorldEditWrapper.IWorldEditWrapper { - private static final ClipboardFormat SCHEMATIC = ClipboardFormats.findByAlias("schematic"); - private static final ClipboardFormat SCHEM = ClipboardFormats.findByAlias("schem"); + private static final ClipboardFormat SCHEMATIC = BuiltInClipboardFormat.MCEDIT_SCHEMATIC; + private static final ClipboardFormat SCHEM = BuiltInClipboardFormat.SPONGE_SCHEMATIC; @Override public InputStream getPlayerClipboard(Player player, boolean schemFormat) { diff --git a/SpigotCore/SpigotCore_18/src/de/steamwar/core/WorldEditWrapper18.java b/SpigotCore/SpigotCore_18/src/de/steamwar/core/WorldEditWrapper18.java index 4942b2a1..54c7240b 100644 --- a/SpigotCore/SpigotCore_18/src/de/steamwar/core/WorldEditWrapper18.java +++ b/SpigotCore/SpigotCore_18/src/de/steamwar/core/WorldEditWrapper18.java @@ -19,10 +19,8 @@ package de.steamwar.core; -import com.sk89q.jnbt.NBTInputStream; import com.sk89q.worldedit.extent.clipboard.Clipboard; -import com.sk89q.worldedit.extent.clipboard.io.MCEditSchematicReader; -import com.sk89q.worldedit.extent.clipboard.io.SpongeSchematicReader; +import com.sk89q.worldedit.extent.clipboard.io.BuiltInClipboardFormat; import de.steamwar.sql.NoClipboardException; import java.io.IOException; @@ -34,9 +32,8 @@ public class WorldEditWrapper18 extends WorldEditWrapper14 { @SuppressWarnings("removal") public Clipboard getClipboard(InputStream is, boolean schemFormat) throws IOException { //Use FAWE reader due to FAWE capability of reading corrupt FAWE schems - NBTInputStream nbtStream = new NBTInputStream(is); try { - return (schemFormat ? new SpongeSchematicReader(nbtStream) : new MCEditSchematicReader(nbtStream)).read(); + return (schemFormat ? BuiltInClipboardFormat.FAST.getReader(is) : BuiltInClipboardFormat.MCEDIT_SCHEMATIC.getReader(is)).read(); } catch (NullPointerException e) { throw new NoClipboardException(); } diff --git a/SpigotCore/SpigotCore_21/src/de/steamwar/core/ChatWrapper21.java b/SpigotCore/SpigotCore_21/src/de/steamwar/core/ChatWrapper21.java new file mode 100644 index 00000000..760ba393 --- /dev/null +++ b/SpigotCore/SpigotCore_21/src/de/steamwar/core/ChatWrapper21.java @@ -0,0 +1,44 @@ +/* + * This file is a part of the SteamWar software. + * + * Copyright (C) 2024 SteamWar.de-Serverteam + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package de.steamwar.core; + +import net.minecraft.network.chat.IChatMutableComponent; +import net.minecraft.network.chat.contents.LiteralContents; +import net.minecraft.network.protocol.game.PacketPlayOutEntityMetadata; +import net.minecraft.network.syncher.DataWatcher; + +import java.util.ArrayList; + +public class ChatWrapper21 implements ChatWrapper { + @Override + public Object stringToChatComponent(String text) { + return IChatMutableComponent.a(LiteralContents.a(text)); + } + + @Override + public Object getDataWatcherPacket(int entityId, Object... dataWatcherKeyValues) { + ArrayList> nativeWatchers = new ArrayList<>(1); + for(int i = 0; i < dataWatcherKeyValues.length; i+=2) { + nativeWatchers.add(((DataWatcher.Item) BountifulWrapper.impl.getDataWatcherItem(dataWatcherKeyValues[i], dataWatcherKeyValues[i+1])).e()); + } + + return new PacketPlayOutEntityMetadata(entityId, nativeWatchers); + } +} diff --git a/SpigotCore/SpigotCore_21/src/de/steamwar/core/CraftbukkitWrapper21.java b/SpigotCore/SpigotCore_21/src/de/steamwar/core/CraftbukkitWrapper21.java new file mode 100644 index 00000000..2309a2a6 --- /dev/null +++ b/SpigotCore/SpigotCore_21/src/de/steamwar/core/CraftbukkitWrapper21.java @@ -0,0 +1,41 @@ +/* + * This file is a part of the SteamWar software. + * + * Copyright (C) 2024 SteamWar.de-Serverteam + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package de.steamwar.core; + +import com.comphenix.tinyprotocol.Reflection; +import com.comphenix.tinyprotocol.TinyProtocol; +import net.minecraft.network.protocol.game.ClientboundLevelChunkWithLightPacket; +import net.minecraft.world.level.World; +import net.minecraft.world.level.chunk.Chunk; +import net.minecraft.world.level.chunk.status.ChunkStatus; +import net.minecraft.world.level.lighting.LevelLightEngine; +import org.bukkit.entity.Player; + +public class CraftbukkitWrapper21 implements CraftbukkitWrapper.ICraftbukkitWrapper { + + private static final Reflection.MethodInvoker getHandle = Reflection.getMethod("{obc}.CraftChunk", "getHandle", ChunkStatus.class); + private static final Reflection.MethodInvoker getLightEngine = Reflection.getTypedMethod(World.class, null, LevelLightEngine.class); + + @Override + public void sendChunk(Player p, int chunkX, int chunkZ) { + Chunk chunk = (Chunk) getHandle.invoke(p.getWorld().getChunkAt(chunkX, chunkZ), ChunkStatus.n); + TinyProtocol.instance.sendPacket(p, new ClientboundLevelChunkWithLightPacket(chunk, (LevelLightEngine) getLightEngine.invoke(chunk.r), null, null, true)); + } +} diff --git a/SpigotCore/SpigotCore_21/src/de/steamwar/core/TrickyTrialsWrapper21.java b/SpigotCore/SpigotCore_21/src/de/steamwar/core/TrickyTrialsWrapper21.java index c1d1e4c6..00717405 100644 --- a/SpigotCore/SpigotCore_21/src/de/steamwar/core/TrickyTrialsWrapper21.java +++ b/SpigotCore/SpigotCore_21/src/de/steamwar/core/TrickyTrialsWrapper21.java @@ -19,8 +19,11 @@ package de.steamwar.core; +import org.bukkit.Material; +import org.bukkit.Particle; import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.EntityType; +import org.bukkit.inventory.InventoryView; public class TrickyTrialsWrapper21 implements TrickyTrialsWrapper { @Override @@ -32,4 +35,19 @@ public class TrickyTrialsWrapper21 implements TrickyTrialsWrapper { public Enchantment getUnbreakingEnchantment() { return Enchantment.UNBREAKING; } + + @Override + public Material getTurtleScute() { + return Material.TURTLE_SCUTE; + } + + @Override + public Particle getVillagerHappyParticle() { + return Particle.HAPPY_VILLAGER; + } + + @Override + public String getInventoryTitle(InventoryView view) { + return view.getTitle(); + } } diff --git a/SpigotCore/SpigotCore_8/src/de/steamwar/core/TrickyTrialsWrapper8.java b/SpigotCore/SpigotCore_8/src/de/steamwar/core/TrickyTrialsWrapper8.java index 6d7392dc..35b80c58 100644 --- a/SpigotCore/SpigotCore_8/src/de/steamwar/core/TrickyTrialsWrapper8.java +++ b/SpigotCore/SpigotCore_8/src/de/steamwar/core/TrickyTrialsWrapper8.java @@ -19,8 +19,10 @@ package de.steamwar.core; +import org.bukkit.Material; import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.EntityType; +import org.bukkit.inventory.InventoryView; public class TrickyTrialsWrapper8 implements TrickyTrialsWrapper { @Override @@ -32,4 +34,14 @@ public class TrickyTrialsWrapper8 implements TrickyTrialsWrapper { public Enchantment getUnbreakingEnchantment() { return Enchantment.DURABILITY; } + + @Override + public Material getTurtleScute() { + return Material.STONE; + } + + @Override + public String getInventoryTitle(InventoryView view) { + return view.getTitle(); + } } diff --git a/SpigotCore/SpigotCore_8/src/de/steamwar/core/WorldEditWrapper8.java b/SpigotCore/SpigotCore_8/src/de/steamwar/core/WorldEditWrapper8.java index 32f3faf7..ad9b40f9 100644 --- a/SpigotCore/SpigotCore_8/src/de/steamwar/core/WorldEditWrapper8.java +++ b/SpigotCore/SpigotCore_8/src/de/steamwar/core/WorldEditWrapper8.java @@ -43,6 +43,7 @@ import java.io.*; import java.util.*; import java.util.logging.Level; import java.util.stream.Collectors; +import java.util.zip.GZIPInputStream; public class WorldEditWrapper8 implements WorldEditWrapper.IWorldEditWrapper { @@ -88,7 +89,7 @@ public class WorldEditWrapper8 implements WorldEditWrapper.IWorldEditWrapper { WorldData world = new BukkitWorld(player.getWorld()).getWorldData(); Clipboard clipboard; try { - clipboard = getClipboard(is, schemFormat); + clipboard = getClipboard(new GZIPInputStream(is), schemFormat); } catch (IOException e) { throw new RuntimeException(e); } diff --git a/SpigotCore/SpigotCore_Main/build.gradle.kts b/SpigotCore/SpigotCore_Main/build.gradle.kts index 8329f671..88825bc9 100644 --- a/SpigotCore/SpigotCore_Main/build.gradle.kts +++ b/SpigotCore/SpigotCore_Main/build.gradle.kts @@ -32,12 +32,7 @@ dependencies { compileOnly(libs.worldedit12) - compileOnly(libs.paperapi21) { - attributes { - // Very Hacky, but it works - attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 21) - } - } + compileOnly(libs.spigotapi) compileOnly(libs.netty) compileOnly(libs.authlib) compileOnly(libs.viaapi) diff --git a/SpigotCore/SpigotCore_Main/src/de/steamwar/core/TrickyTrialsWrapper.java b/SpigotCore/SpigotCore_Main/src/de/steamwar/core/TrickyTrialsWrapper.java index d678244c..7c2cfc4d 100644 --- a/SpigotCore/SpigotCore_Main/src/de/steamwar/core/TrickyTrialsWrapper.java +++ b/SpigotCore/SpigotCore_Main/src/de/steamwar/core/TrickyTrialsWrapper.java @@ -19,8 +19,11 @@ package de.steamwar.core; +import org.bukkit.Material; +import org.bukkit.Particle; import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.EntityType; +import org.bukkit.inventory.InventoryView; public interface TrickyTrialsWrapper { TrickyTrialsWrapper impl = VersionDependent.getVersionImpl(Core.getInstance()); @@ -28,4 +31,12 @@ public interface TrickyTrialsWrapper { EntityType getTntEntityType(); Enchantment getUnbreakingEnchantment(); + + Material getTurtleScute(); + + default Particle getVillagerHappyParticle() { + return Particle.VILLAGER_HAPPY; + } + + String getInventoryTitle(InventoryView view); } diff --git a/SpigotCore/SpigotCore_Main/src/de/steamwar/inventory/SWInventory.java b/SpigotCore/SpigotCore_Main/src/de/steamwar/inventory/SWInventory.java index 94a8cf3a..11fe1ec6 100644 --- a/SpigotCore/SpigotCore_Main/src/de/steamwar/inventory/SWInventory.java +++ b/SpigotCore/SpigotCore_Main/src/de/steamwar/inventory/SWInventory.java @@ -20,6 +20,7 @@ package de.steamwar.inventory; import de.steamwar.core.Core; +import de.steamwar.core.TrickyTrialsWrapper; import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.entity.Player; @@ -138,7 +139,7 @@ public class SWInventory implements Listener { public void open() { InventoryView view = player.openInventory(inventory); - title = view.getTitle(); + title = TrickyTrialsWrapper.impl.getInventoryTitle(view); Core.getInstance().getLogger().info("[SWINV] Opened " + title + " for " + player.getName()); if(!open) { Bukkit.getPluginManager().registerEvents(this, Core.getInstance()); @@ -153,7 +154,7 @@ public class SWInventory implements Listener { if (callbacks.containsKey(e.getRawSlot()) && callbacks.get(e.getRawSlot()) != null) { e.setCancelled(true); - Core.getInstance().getLogger().info("[SWINV] " + e.getWhoClicked().getName() + " " + e.getClick().name() + " clicked " + e.getRawSlot() + " on " + (e.getCurrentItem() != null ? e.getCurrentItem().getItemMeta().getDisplayName() : "[EMPTY]") + " in " + e.getView().getTitle()); + Core.getInstance().getLogger().info("[SWINV] " + e.getWhoClicked().getName() + " " + e.getClick().name() + " clicked " + e.getRawSlot() + " on " + (e.getCurrentItem() != null ? e.getCurrentItem().getItemMeta().getDisplayName() : "[EMPTY]") + " in " + TrickyTrialsWrapper.impl.getInventoryTitle(e.getView())); callbacks.get(e.getRawSlot()).accept(e); } } diff --git a/settings.gradle.kts b/settings.gradle.kts index 7c1d761a..a531b252 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -119,7 +119,7 @@ dependencyResolutionManagement { library("datafixer", "com.mojang:datafixerupper:4.0.26") library("brigadier", "com.mojang:brigadier:1.0.18") library("viaapi", "com.viaversion:viaversion-api:4.3.1") - library("anvilgui", "net.wesjd:anvilgui:1.7.0-SNAPSHOT") + library("anvilgui", "net.wesjd:anvilgui:1.10.3-SNAPSHOT") library("nms8", "de.steamwar:spigot:1.8") library("nms9", "de.steamwar:spigot:1.9")