forked from SteamWar/SteamWar
Bausystem geht™️
This commit is contained in:
@@ -35,12 +35,16 @@ dependencies {
|
|||||||
annotationProcessor(libs.classindex)
|
annotationProcessor(libs.classindex)
|
||||||
compileOnly(project(":SpigotCore", "default"))
|
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.axiom)
|
||||||
compileOnly(libs.authlib)
|
compileOnly(libs.authlib)
|
||||||
compileOnly(libs.viaapi)
|
compileOnly(libs.viaapi)
|
||||||
|
|
||||||
compileOnly(libs.nms20)
|
|
||||||
compileOnly(libs.fawe18)
|
compileOnly(libs.fawe18)
|
||||||
|
|
||||||
implementation(libs.luaj)
|
implementation(libs.luaj)
|
||||||
|
|||||||
+2
-1
@@ -22,6 +22,7 @@ package de.steamwar.bausystem.features.gui.editor;
|
|||||||
import de.steamwar.bausystem.BauSystem;
|
import de.steamwar.bausystem.BauSystem;
|
||||||
import de.steamwar.bausystem.features.gui.BauGUI;
|
import de.steamwar.bausystem.features.gui.BauGUI;
|
||||||
import de.steamwar.bausystem.linkage.specific.BauGuiItem;
|
import de.steamwar.bausystem.linkage.specific.BauGuiItem;
|
||||||
|
import de.steamwar.core.TrickyTrialsWrapper;
|
||||||
import de.steamwar.inventory.SWItem;
|
import de.steamwar.inventory.SWItem;
|
||||||
import de.steamwar.inventory.SWListInv;
|
import de.steamwar.inventory.SWListInv;
|
||||||
import de.steamwar.linkage.Linked;
|
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 -> {
|
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());
|
}).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());
|
inv.setItem(mapping.getSize() + 8, new SWItem(Material.ARROW, BauSystem.MESSAGE.parse("GUI_EDITOR_ITEM_CLOSE", p)).getItemStack());
|
||||||
|
|
||||||
p.openInventory(inv);
|
p.openInventory(inv);
|
||||||
|
|||||||
+1
-1
@@ -147,7 +147,7 @@ public class EventListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGH)
|
@EventHandler(priority = EventPriority.HIGH)
|
||||||
public void onEntitySpawn(EntitySpawnEvent event) {
|
public void onEntitySpawn(EntitySpawnEvent event) {
|
||||||
if (event.getEntityType().name().equals("tnt")) {
|
if (event.getEntityType() != TrickyTrialsWrapper.impl.getTntEntityType()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Region tntRegion = Region.getRegion(event.getLocation());
|
Region tntRegion = Region.getRegion(event.getLocation());
|
||||||
|
|||||||
+2
-1
@@ -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.SimulatorWatcher;
|
||||||
import de.steamwar.bausystem.features.simulator.data.Simulator;
|
import de.steamwar.bausystem.features.simulator.data.Simulator;
|
||||||
import de.steamwar.core.Core;
|
import de.steamwar.core.Core;
|
||||||
|
import de.steamwar.core.TrickyTrialsWrapper;
|
||||||
import de.steamwar.inventory.SWInventory;
|
import de.steamwar.inventory.SWInventory;
|
||||||
import de.steamwar.inventory.SWItem;
|
import de.steamwar.inventory.SWItem;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
@@ -46,7 +47,7 @@ public abstract class SimulatorBaseGui {
|
|||||||
|
|
||||||
public final void open() {
|
public final void open() {
|
||||||
String newTitle = title();
|
String newTitle = title();
|
||||||
String originalTitle = player.getOpenInventory().getTitle();
|
String originalTitle = TrickyTrialsWrapper.impl.getInventoryTitle(player.getOpenInventory());
|
||||||
|
|
||||||
if (inv != null && (Core.getVersion() > 19 || newTitle.equals(originalTitle))) {
|
if (inv != null && (Core.getVersion() > 19 || newTitle.equals(originalTitle))) {
|
||||||
// TODO: Flickering is better but not gone!
|
// TODO: Flickering is better but not gone!
|
||||||
|
|||||||
+2
-1
@@ -23,6 +23,7 @@ import de.steamwar.bausystem.BauSystem;
|
|||||||
import de.steamwar.bausystem.region.Point;
|
import de.steamwar.bausystem.region.Point;
|
||||||
import de.steamwar.bausystem.region.Region;
|
import de.steamwar.bausystem.region.Region;
|
||||||
import de.steamwar.bausystem.region.utils.RegionType;
|
import de.steamwar.bausystem.region.utils.RegionType;
|
||||||
|
import de.steamwar.core.TrickyTrialsWrapper;
|
||||||
import de.steamwar.linkage.Linked;
|
import de.steamwar.linkage.Linked;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Particle;
|
import org.bukkit.Particle;
|
||||||
@@ -56,7 +57,7 @@ public class BoundaryViewer implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void showRegion(Region region, Player player) {
|
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)) {
|
if (region.hasType(RegionType.TESTBLOCK)) {
|
||||||
drawCuboid(player, Particle.END_ROD, region.getMinPointTestblockExtension(), region.getMaxPointTestblockExtension());
|
drawCuboid(player, Particle.END_ROD, region.getMinPointTestblockExtension(), region.getMaxPointTestblockExtension());
|
||||||
}
|
}
|
||||||
|
|||||||
-1
@@ -47,7 +47,6 @@ public class NightVisionBauGuiItem extends BauGuiItem {
|
|||||||
PotionMeta meta = (PotionMeta) itemStack.getItemMeta();
|
PotionMeta meta = (PotionMeta) itemStack.getItemMeta();
|
||||||
meta.setColor(PotionEffectType.NIGHT_VISION.getColor());
|
meta.setColor(PotionEffectType.NIGHT_VISION.getColor());
|
||||||
meta.setDisplayName(BauSystem.MESSAGE.parse("NIGHT_VISION_ITEM_ON", player));
|
meta.setDisplayName(BauSystem.MESSAGE.parse("NIGHT_VISION_ITEM_ON", player));
|
||||||
meta.addItemFlags(ItemFlag.HIDE_POTION_EFFECTS);
|
|
||||||
meta.setCustomModelData(1);
|
meta.setCustomModelData(1);
|
||||||
itemStack.setItemMeta(meta);
|
itemStack.setItemMeta(meta);
|
||||||
return itemStack;
|
return itemStack;
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ public class NodeData {
|
|||||||
if(rs.wasNull() || schemData.available() == 0) {
|
if(rs.wasNull() || schemData.available() == 0) {
|
||||||
throw new SecurityException("SchemData is null");
|
throw new SecurityException("SchemData is null");
|
||||||
}
|
}
|
||||||
return new GZIPInputStream(schemData);
|
return schemData;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new SecurityException("SchemData is wrong", e);
|
throw new SecurityException("SchemData is wrong", e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -232,21 +232,9 @@ public class FlatteningWrapper14 implements FlatteningWrapper.IFlatteningWrapper
|
|||||||
scoreboardName.set(packet, ChatWrapper.impl.stringToChatComponent(title));
|
scoreboardName.set(packet, ChatWrapper.impl.stringToChatComponent(title));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final Class<?> scoreActionEnum;
|
private static final Class<?> scoreActionEnum = Core.getVersion() < 21 ? Reflection.getClass("{nms.server}.ScoreboardServer$Action") : null;
|
||||||
private static final Reflection.FieldAccessor<?> scoreAction;
|
private static final Reflection.FieldAccessor<?> scoreAction = Core.getVersion() < 21 ? Reflection.getField(FlatteningWrapper.scoreboardScore, scoreActionEnum, 0) : null;
|
||||||
private static final Object scoreActionChange;
|
private static final Object scoreActionChange = Core.getVersion() < 21 ? scoreActionEnum.getEnumConstants()[0] : null;
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setScoreAction(Object packet) {
|
public void setScoreAction(Object packet) {
|
||||||
|
|||||||
@@ -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 <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package de.steamwar.core;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
|
||||||
|
public class TrickyTrialsWrapper14 extends TrickyTrialsWrapper8 {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Material getTurtleScute() {
|
||||||
|
return Material.SCUTE;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -54,8 +54,8 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
|||||||
|
|
||||||
public class WorldEditWrapper14 implements WorldEditWrapper.IWorldEditWrapper {
|
public class WorldEditWrapper14 implements WorldEditWrapper.IWorldEditWrapper {
|
||||||
|
|
||||||
private static final ClipboardFormat SCHEMATIC = ClipboardFormats.findByAlias("schematic");
|
private static final ClipboardFormat SCHEMATIC = BuiltInClipboardFormat.MCEDIT_SCHEMATIC;
|
||||||
private static final ClipboardFormat SCHEM = ClipboardFormats.findByAlias("schem");
|
private static final ClipboardFormat SCHEM = BuiltInClipboardFormat.SPONGE_SCHEMATIC;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public InputStream getPlayerClipboard(Player player, boolean schemFormat) {
|
public InputStream getPlayerClipboard(Player player, boolean schemFormat) {
|
||||||
|
|||||||
@@ -19,10 +19,8 @@
|
|||||||
|
|
||||||
package de.steamwar.core;
|
package de.steamwar.core;
|
||||||
|
|
||||||
import com.sk89q.jnbt.NBTInputStream;
|
|
||||||
import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
||||||
import com.sk89q.worldedit.extent.clipboard.io.MCEditSchematicReader;
|
import com.sk89q.worldedit.extent.clipboard.io.BuiltInClipboardFormat;
|
||||||
import com.sk89q.worldedit.extent.clipboard.io.SpongeSchematicReader;
|
|
||||||
import de.steamwar.sql.NoClipboardException;
|
import de.steamwar.sql.NoClipboardException;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -34,9 +32,8 @@ public class WorldEditWrapper18 extends WorldEditWrapper14 {
|
|||||||
@SuppressWarnings("removal")
|
@SuppressWarnings("removal")
|
||||||
public Clipboard getClipboard(InputStream is, boolean schemFormat) throws IOException {
|
public Clipboard getClipboard(InputStream is, boolean schemFormat) throws IOException {
|
||||||
//Use FAWE reader due to FAWE capability of reading corrupt FAWE schems
|
//Use FAWE reader due to FAWE capability of reading corrupt FAWE schems
|
||||||
NBTInputStream nbtStream = new NBTInputStream(is);
|
|
||||||
try {
|
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) {
|
} catch (NullPointerException e) {
|
||||||
throw new NoClipboardException();
|
throw new NoClipboardException();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
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<DataWatcher.c<?>> 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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 <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -19,8 +19,11 @@
|
|||||||
|
|
||||||
package de.steamwar.core;
|
package de.steamwar.core;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.Particle;
|
||||||
import org.bukkit.enchantments.Enchantment;
|
import org.bukkit.enchantments.Enchantment;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
|
import org.bukkit.inventory.InventoryView;
|
||||||
|
|
||||||
public class TrickyTrialsWrapper21 implements TrickyTrialsWrapper {
|
public class TrickyTrialsWrapper21 implements TrickyTrialsWrapper {
|
||||||
@Override
|
@Override
|
||||||
@@ -32,4 +35,19 @@ public class TrickyTrialsWrapper21 implements TrickyTrialsWrapper {
|
|||||||
public Enchantment getUnbreakingEnchantment() {
|
public Enchantment getUnbreakingEnchantment() {
|
||||||
return Enchantment.UNBREAKING;
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,8 +19,10 @@
|
|||||||
|
|
||||||
package de.steamwar.core;
|
package de.steamwar.core;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
import org.bukkit.enchantments.Enchantment;
|
import org.bukkit.enchantments.Enchantment;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
|
import org.bukkit.inventory.InventoryView;
|
||||||
|
|
||||||
public class TrickyTrialsWrapper8 implements TrickyTrialsWrapper {
|
public class TrickyTrialsWrapper8 implements TrickyTrialsWrapper {
|
||||||
@Override
|
@Override
|
||||||
@@ -32,4 +34,14 @@ public class TrickyTrialsWrapper8 implements TrickyTrialsWrapper {
|
|||||||
public Enchantment getUnbreakingEnchantment() {
|
public Enchantment getUnbreakingEnchantment() {
|
||||||
return Enchantment.DURABILITY;
|
return Enchantment.DURABILITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Material getTurtleScute() {
|
||||||
|
return Material.STONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getInventoryTitle(InventoryView view) {
|
||||||
|
return view.getTitle();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ import java.io.*;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.zip.GZIPInputStream;
|
||||||
|
|
||||||
public class WorldEditWrapper8 implements WorldEditWrapper.IWorldEditWrapper {
|
public class WorldEditWrapper8 implements WorldEditWrapper.IWorldEditWrapper {
|
||||||
|
|
||||||
@@ -88,7 +89,7 @@ public class WorldEditWrapper8 implements WorldEditWrapper.IWorldEditWrapper {
|
|||||||
WorldData world = new BukkitWorld(player.getWorld()).getWorldData();
|
WorldData world = new BukkitWorld(player.getWorld()).getWorldData();
|
||||||
Clipboard clipboard;
|
Clipboard clipboard;
|
||||||
try {
|
try {
|
||||||
clipboard = getClipboard(is, schemFormat);
|
clipboard = getClipboard(new GZIPInputStream(is), schemFormat);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,12 +32,7 @@ dependencies {
|
|||||||
|
|
||||||
compileOnly(libs.worldedit12)
|
compileOnly(libs.worldedit12)
|
||||||
|
|
||||||
compileOnly(libs.paperapi21) {
|
compileOnly(libs.spigotapi)
|
||||||
attributes {
|
|
||||||
// Very Hacky, but it works
|
|
||||||
attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 21)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
compileOnly(libs.netty)
|
compileOnly(libs.netty)
|
||||||
compileOnly(libs.authlib)
|
compileOnly(libs.authlib)
|
||||||
compileOnly(libs.viaapi)
|
compileOnly(libs.viaapi)
|
||||||
|
|||||||
@@ -19,8 +19,11 @@
|
|||||||
|
|
||||||
package de.steamwar.core;
|
package de.steamwar.core;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.Particle;
|
||||||
import org.bukkit.enchantments.Enchantment;
|
import org.bukkit.enchantments.Enchantment;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
|
import org.bukkit.inventory.InventoryView;
|
||||||
|
|
||||||
public interface TrickyTrialsWrapper {
|
public interface TrickyTrialsWrapper {
|
||||||
TrickyTrialsWrapper impl = VersionDependent.getVersionImpl(Core.getInstance());
|
TrickyTrialsWrapper impl = VersionDependent.getVersionImpl(Core.getInstance());
|
||||||
@@ -28,4 +31,12 @@ public interface TrickyTrialsWrapper {
|
|||||||
EntityType getTntEntityType();
|
EntityType getTntEntityType();
|
||||||
|
|
||||||
Enchantment getUnbreakingEnchantment();
|
Enchantment getUnbreakingEnchantment();
|
||||||
|
|
||||||
|
Material getTurtleScute();
|
||||||
|
|
||||||
|
default Particle getVillagerHappyParticle() {
|
||||||
|
return Particle.VILLAGER_HAPPY;
|
||||||
|
}
|
||||||
|
|
||||||
|
String getInventoryTitle(InventoryView view);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
package de.steamwar.inventory;
|
package de.steamwar.inventory;
|
||||||
|
|
||||||
import de.steamwar.core.Core;
|
import de.steamwar.core.Core;
|
||||||
|
import de.steamwar.core.TrickyTrialsWrapper;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@@ -138,7 +139,7 @@ public class SWInventory implements Listener {
|
|||||||
|
|
||||||
public void open() {
|
public void open() {
|
||||||
InventoryView view = player.openInventory(inventory);
|
InventoryView view = player.openInventory(inventory);
|
||||||
title = view.getTitle();
|
title = TrickyTrialsWrapper.impl.getInventoryTitle(view);
|
||||||
Core.getInstance().getLogger().info("[SWINV] Opened " + title + " for " + player.getName());
|
Core.getInstance().getLogger().info("[SWINV] Opened " + title + " for " + player.getName());
|
||||||
if(!open) {
|
if(!open) {
|
||||||
Bukkit.getPluginManager().registerEvents(this, Core.getInstance());
|
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) {
|
if (callbacks.containsKey(e.getRawSlot()) && callbacks.get(e.getRawSlot()) != null) {
|
||||||
e.setCancelled(true);
|
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);
|
callbacks.get(e.getRawSlot()).accept(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -119,7 +119,7 @@ dependencyResolutionManagement {
|
|||||||
library("datafixer", "com.mojang:datafixerupper:4.0.26")
|
library("datafixer", "com.mojang:datafixerupper:4.0.26")
|
||||||
library("brigadier", "com.mojang:brigadier:1.0.18")
|
library("brigadier", "com.mojang:brigadier:1.0.18")
|
||||||
library("viaapi", "com.viaversion:viaversion-api:4.3.1")
|
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("nms8", "de.steamwar:spigot:1.8")
|
||||||
library("nms9", "de.steamwar:spigot:1.9")
|
library("nms9", "de.steamwar:spigot:1.9")
|
||||||
|
|||||||
Reference in New Issue
Block a user