Commits vergleichen
1 Commits
master
...
BauGUICust
Autor | SHA1 | Datum | |
---|---|---|---|
|
3984098883 |
8
.gitignore
vendored
8
.gitignore
vendored
@ -1,7 +1,5 @@
|
|||||||
# Build files
|
# Package Files
|
||||||
*.jar
|
*.jar
|
||||||
**/bin
|
|
||||||
**/build
|
|
||||||
|
|
||||||
# Gradle
|
# Gradle
|
||||||
.gradle
|
.gradle
|
||||||
@ -12,10 +10,6 @@ steamwar.properties
|
|||||||
# IntelliJ IDEA
|
# IntelliJ IDEA
|
||||||
.idea
|
.idea
|
||||||
*.iml
|
*.iml
|
||||||
plugin.yml
|
|
||||||
|
|
||||||
# Other
|
# Other
|
||||||
lib
|
lib
|
||||||
|
|
||||||
#linkage
|
|
||||||
LinkageUtils.java
|
|
@ -27,8 +27,8 @@ version '1.0'
|
|||||||
|
|
||||||
compileJava.options.encoding = 'UTF-8'
|
compileJava.options.encoding = 'UTF-8'
|
||||||
|
|
||||||
sourceCompatibility = 17
|
sourceCompatibility = 1.8
|
||||||
targetCompatibility = 17
|
targetCompatibility = 1.8
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
main {
|
main {
|
||||||
@ -48,9 +48,9 @@ dependencies {
|
|||||||
annotationProcessor 'org.projectlombok:lombok:1.18.22'
|
annotationProcessor 'org.projectlombok:lombok:1.18.22'
|
||||||
testAnnotationProcessor 'org.projectlombok:lombok:1.18.22'
|
testAnnotationProcessor 'org.projectlombok:lombok:1.18.22'
|
||||||
|
|
||||||
implementation project(":BauSystem_Main")
|
implementation project(":BauSystem_API")
|
||||||
|
|
||||||
compileOnly swdep('Spigot-1.15')
|
compileOnly files("${projectDir}/../lib/Spigot-1.15.jar")
|
||||||
compileOnly swdep('WorldEdit-1.15')
|
compileOnly files("${projectDir}/../lib/WorldEdit-1.15.jar")
|
||||||
compileOnly swdep('SpigotCore')
|
compileOnly files("${projectDir}/../lib/ProtocolLib.jar")
|
||||||
}
|
}
|
20
BauSystem_15/settings.gradle
Normale Datei
20
BauSystem_15/settings.gradle
Normale Datei
@ -0,0 +1,20 @@
|
|||||||
|
/*
|
||||||
|
* This file is a part of the SteamWar software.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2020 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/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
rootProject.name = 'BauSystem_15'
|
@ -0,0 +1,81 @@
|
|||||||
|
/*
|
||||||
|
* This file is a part of the SteamWar software.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2021 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.bausystem.features.detonator;
|
||||||
|
|
||||||
|
import net.minecraft.server.v1_15_R1.*;
|
||||||
|
import org.bukkit.World;
|
||||||
|
import org.bukkit.craftbukkit.v1_15_R1.CraftWorld;
|
||||||
|
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
class DetonatorEntity_15 extends EntityFallingBlock implements AbstractDetonatorEntity {
|
||||||
|
|
||||||
|
private static final Vec3D ZERO = new Vec3D(0, 0, 0);
|
||||||
|
private final Vector position;
|
||||||
|
private int references = 0;
|
||||||
|
|
||||||
|
public DetonatorEntity_15(World world, Vector position) {
|
||||||
|
super(((CraftWorld) world).getHandle(), position.getX(), position.getY(), position.getZ(), Blocks.RED_STAINED_GLASS.getBlockData());
|
||||||
|
this.position = position;
|
||||||
|
|
||||||
|
this.h(true);
|
||||||
|
this.setNoGravity(true);
|
||||||
|
this.ticksLived = -12000;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void display(Player player) {
|
||||||
|
if (references++ > 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
PacketPlayOutSpawnEntity packetPlayOutSpawnEntity = new PacketPlayOutSpawnEntity(getId(), getUniqueID(), position.getX(), position.getY(), position.getZ(), 0, 0, EntityTypes.FALLING_BLOCK, Block.getCombinedId(Blocks.RED_STAINED_GLASS.getBlockData()), ZERO);
|
||||||
|
PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().playerConnection;
|
||||||
|
playerConnection.sendPacket(packetPlayOutSpawnEntity);
|
||||||
|
|
||||||
|
PacketPlayOutEntityMetadata packetPlayOutEntityMetadata = new PacketPlayOutEntityMetadata(getId(), datawatcher, true);
|
||||||
|
playerConnection.sendPacket(packetPlayOutEntityMetadata);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hide(Player player, boolean force) {
|
||||||
|
if (!force && --references > 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
sendDestroy(player);
|
||||||
|
die();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendDestroy(Player player) {
|
||||||
|
PacketPlayOutEntityDestroy packetPlayOutEntityDestroy = new PacketPlayOutEntityDestroy(getId());
|
||||||
|
((CraftPlayer) player).getHandle().playerConnection.sendPacket(packetPlayOutEntityDestroy);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void sendEntity(Player player) {
|
||||||
|
display(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void sendEntityDestroy(Player player) {
|
||||||
|
hide(player, false);
|
||||||
|
}
|
||||||
|
}
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of the SteamWar software.
|
* This file is a part of the SteamWar software.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2023 SteamWar.de-Serverteam
|
* Copyright (C) 2021 SteamWar.de-Serverteam
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Affero General Public License as published by
|
||||||
@ -17,18 +17,14 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.steamwar.bausystem.features.killchecker;
|
package de.steamwar.bausystem.features.detonator;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import org.bukkit.World;
|
||||||
import lombok.Data;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
@Data
|
public class Detonator_15 {
|
||||||
@AllArgsConstructor
|
|
||||||
public class Cuboid {
|
static AbstractDetonatorEntity constructEntity(World world, Vector position) {
|
||||||
private double x;
|
return new DetonatorEntity_15(world, position);
|
||||||
private double y;
|
}
|
||||||
private double z;
|
|
||||||
private double dx;
|
|
||||||
private double dy;
|
|
||||||
private double dz;
|
|
||||||
}
|
}
|
@ -0,0 +1,53 @@
|
|||||||
|
/*
|
||||||
|
* This file is a part of the SteamWar software.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2021 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.bausystem.features.other;
|
||||||
|
|
||||||
|
import lombok.experimental.UtilityClass;
|
||||||
|
import net.minecraft.server.v1_15_R1.EnumGamemode;
|
||||||
|
import net.minecraft.server.v1_15_R1.PlayerInteractManager;
|
||||||
|
import org.bukkit.GameMode;
|
||||||
|
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
|
||||||
|
@UtilityClass
|
||||||
|
public class NoClipCommand_15 {
|
||||||
|
|
||||||
|
private Field gameModeField;
|
||||||
|
|
||||||
|
public void setGameModeInternal(Player player, GameMode gameMode) {
|
||||||
|
CraftPlayer craftPlayer = (CraftPlayer) player;
|
||||||
|
EnumGamemode enumGamemode = EnumGamemode.getById(gameMode.getValue());
|
||||||
|
try {
|
||||||
|
checkCache();
|
||||||
|
gameModeField.set(craftPlayer.getHandle().playerInteractManager, enumGamemode);
|
||||||
|
} catch (NoSuchFieldException | IllegalAccessException e) {
|
||||||
|
throw new SecurityException("Could not find Field?");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkCache() throws NoSuchFieldException {
|
||||||
|
if (gameModeField == null) {
|
||||||
|
gameModeField = PlayerInteractManager.class.getDeclaredField("gamemode");
|
||||||
|
gameModeField.setAccessible(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package de.steamwar.bausystem.features.script;
|
||||||
|
|
||||||
|
import lombok.experimental.UtilityClass;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
@UtilityClass
|
||||||
|
public class ScriptListener_15 {
|
||||||
|
|
||||||
|
static boolean isNoBook(ItemStack item) {
|
||||||
|
return item.getType() != Material.WRITABLE_BOOK && item.getType() != Material.WRITTEN_BOOK;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,65 @@
|
|||||||
|
/*
|
||||||
|
This file is a part of the SteamWar software.
|
||||||
|
|
||||||
|
Copyright (C) 2020 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.bausystem.features.simulator;
|
||||||
|
|
||||||
|
import de.steamwar.bausystem.shared.BaseEntity_15;
|
||||||
|
import de.steamwar.bausystem.shared.ReferenceCounter;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.World;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
class SimulatorEntity_15 extends BaseEntity_15 implements AbstractSimulatorEntity {
|
||||||
|
|
||||||
|
private ReferenceCounter referenceCounter = new ReferenceCounter();
|
||||||
|
|
||||||
|
public SimulatorEntity_15(World world, Vector position, boolean highlight) {
|
||||||
|
super(world, position, highlight ? Material.WHITE_STAINED_GLASS : Material.TNT);
|
||||||
|
|
||||||
|
this.setNoGravity(true);
|
||||||
|
this.ticksLived = -12000;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void display(Player player) {
|
||||||
|
if (referenceCounter.increment() > 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
sendEntity(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setPosition(Vector position) {
|
||||||
|
this.position = position;
|
||||||
|
setPosition(position.getX(), position.getY(), position.getZ());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hide(Player player, boolean force) {
|
||||||
|
if (!force && referenceCounter.decrement() > 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
sendEntityDestroy(player);
|
||||||
|
die();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
/*
|
||||||
|
This file is a part of the SteamWar software.
|
||||||
|
|
||||||
|
Copyright (C) 2020 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.bausystem.features.simulator;
|
||||||
|
|
||||||
|
import org.bukkit.World;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
public class Simulator_15 {
|
||||||
|
|
||||||
|
public static AbstractSimulatorEntity create(World world, Vector tntPosition, boolean highlight) {
|
||||||
|
return new SimulatorEntity_15(world, tntPosition, highlight);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,53 @@
|
|||||||
|
/*
|
||||||
|
* This file is a part of the SteamWar software.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2021 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.bausystem.features.slaves;
|
||||||
|
|
||||||
|
import lombok.experimental.UtilityClass;
|
||||||
|
import net.minecraft.server.v1_15_R1.WorldGenVines;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
@UtilityClass
|
||||||
|
public class MaterialUtils_15 {
|
||||||
|
|
||||||
|
private static Set<Material> unpushable = new HashSet<>(Arrays.asList(Material.BARRIER, Material.BEACON, Material.COMMAND_BLOCK, Material.CHAIN_COMMAND_BLOCK, Material.REPEATING_COMMAND_BLOCK, Material.ENCHANTING_TABLE, Material.END_GATEWAY, Material.END_PORTAL, Material.ENDER_CHEST, Material.GRINDSTONE, Material.JIGSAW, Material.JUKEBOX, Material.NETHER_PORTAL, Material.OBSIDIAN, Material.STRUCTURE_VOID, Material.BARREL, Material.BEEHIVE, Material.BEE_NEST, Material.BLAST_FURNACE, Material.BREWING_STAND, Material.CHEST, Material.DAYLIGHT_DETECTOR, Material.DISPENSER, Material.DROPPER, Material.FURNACE, Material.HOPPER, Material.LECTERN, Material.SMOKER, Material.TRAPPED_CHEST));
|
||||||
|
|
||||||
|
// TODO: FLOWER
|
||||||
|
private static Set<Material> breaking = new HashSet<>(Arrays.asList(Material.BAMBOO, Material.CACTUS, Material.CAKE, Material.CARVED_PUMPKIN, Material.CHORUS_FLOWER, Material.CHORUS_PLANT, Material.COBWEB, Material.COCOA, Material.DRAGON_EGG, Material.FIRE, Material.FLOWER_POT, Material.JACK_O_LANTERN, Material.LADDER, Material.LAVA, Material.LAVA, Material.LEVER, Material.LILY_PAD, Material.MELON, Material.NETHER_WART, Material.PUMPKIN, Material.COMPARATOR, Material.REDSTONE_WIRE, Material.REPEATER, Material.TORCH, Material.STRUCTURE_VOID, Material.SCAFFOLDING, Material.SEA_PICKLE, Material.SNOW, Material.SUGAR_CANE, Material.TORCH, Material.TRIPWIRE, Material.TRIPWIRE_HOOK, Material.TURTLE_EGG, Material.VINE, Material.WATER, Material.WHEAT));
|
||||||
|
|
||||||
|
static boolean isUnpusheable(Material material) {
|
||||||
|
if (unpushable.contains(material)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
String name = material.name();
|
||||||
|
return name.contains("BANNER") || name.contains("SIGN");
|
||||||
|
}
|
||||||
|
|
||||||
|
static boolean isBreakingOnPush(Material material) {
|
||||||
|
if (breaking.contains(material)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
String name = material.name();
|
||||||
|
return name.contains("BED") || name.contains("BUTTON") || name.contains("CARPET") || (name.contains("DOOR") && !name.contains("TRAPDOOR")) || name.contains("HEAD") || name.contains("LEAVES") || name.contains("MUSHROOM") || name.contains("PRESSURE_PLATE") || name.contains("SHULKER_BOX");
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
/*
|
||||||
|
* This file is a part of the SteamWar software.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2021 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.bausystem.features.tpslimit;
|
||||||
|
|
||||||
|
import lombok.experimental.UtilityClass;
|
||||||
|
import net.minecraft.server.v1_15_R1.*;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.World;
|
||||||
|
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftEntity;
|
||||||
|
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.entity.TNTPrimed;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@UtilityClass
|
||||||
|
public class TPSLimit_15 {
|
||||||
|
|
||||||
|
private static List<Packet<?>> packets = new ArrayList<>();
|
||||||
|
private static final Vec3D noMotion = new Vec3D(0, 0, 0);
|
||||||
|
|
||||||
|
static void createTickCache(World world) {
|
||||||
|
packets.clear();
|
||||||
|
world.getEntities().stream().filter(entity -> !(entity instanceof Player)).forEach(entity -> {
|
||||||
|
packets.add(new PacketPlayOutEntityVelocity(entity.getEntityId(), noMotion));
|
||||||
|
packets.add(new PacketPlayOutEntityTeleport(((CraftEntity) entity).getHandle()));
|
||||||
|
|
||||||
|
if (entity instanceof TNTPrimed) {
|
||||||
|
net.minecraft.server.v1_15_R1.Entity serverEntity = ((CraftEntity) entity).getHandle();
|
||||||
|
packets.add(new PacketPlayOutEntityMetadata(serverEntity.getId(), serverEntity.getDataWatcher(), true));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
static void sendTickPackets() {
|
||||||
|
Bukkit.getOnlinePlayers().forEach(player -> {
|
||||||
|
PlayerConnection connection = ((CraftPlayer) player).getHandle().playerConnection;
|
||||||
|
for (Packet<?> p : packets) {
|
||||||
|
connection.sendPacket(p);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
/*
|
||||||
|
* This file is a part of the SteamWar software.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2021 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.bausystem.features.tpslimit;
|
||||||
|
|
||||||
|
import lombok.experimental.UtilityClass;
|
||||||
|
import net.minecraft.server.v1_15_R1.SystemUtils;
|
||||||
|
|
||||||
|
import java.util.function.LongSupplier;
|
||||||
|
|
||||||
|
@UtilityClass
|
||||||
|
public class TPSUtils_15 {
|
||||||
|
|
||||||
|
public static void init(LongSupplier longSupplier) {
|
||||||
|
SystemUtils.a = () -> System.nanoTime() + longSupplier.getAsLong();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,59 @@
|
|||||||
|
/*
|
||||||
|
This file is a part of the SteamWar software.
|
||||||
|
|
||||||
|
Copyright (C) 2020 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.bausystem.features.tracer;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.World;
|
||||||
|
import org.bukkit.block.Block;
|
||||||
|
import org.bukkit.block.data.BlockData;
|
||||||
|
import org.bukkit.block.data.Waterlogged;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
public class TNTTracer_15 {
|
||||||
|
|
||||||
|
public static AbstractTraceEntity create(World world, Vector tntPosition, boolean tnt) {
|
||||||
|
return new TraceEntity_15(world, tntPosition, tnt);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean inWater(World world, Vector tntPosition) {
|
||||||
|
Block block = world.getBlockAt(tntPosition.getBlockX(), tntPosition.getBlockY(), tntPosition.getBlockZ());
|
||||||
|
if (block.getType() == Material.WATER)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
BlockData data = block.getBlockData();
|
||||||
|
if (!(data instanceof Waterlogged))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return ((Waterlogged) data).isWaterlogged();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Material getTraceShowMaterial() {
|
||||||
|
return Material.LIME_CONCRETE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Material getTraceHideMaterial() {
|
||||||
|
return Material.RED_CONCRETE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Material getTraceXZMaterial() {
|
||||||
|
return Material.QUARTZ_SLAB;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,72 @@
|
|||||||
|
/*
|
||||||
|
This file is a part of the SteamWar software.
|
||||||
|
|
||||||
|
Copyright (C) 2020 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.bausystem.features.tracer;
|
||||||
|
|
||||||
|
import de.steamwar.bausystem.shared.BaseEntity_15;
|
||||||
|
import de.steamwar.bausystem.shared.ReferenceCounter;
|
||||||
|
import net.minecraft.server.v1_15_R1.ChatComponentText;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.World;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
class TraceEntity_15 extends BaseEntity_15 implements AbstractTraceEntity {
|
||||||
|
|
||||||
|
private boolean exploded = false;
|
||||||
|
private ReferenceCounter referenceCounter = new ReferenceCounter();
|
||||||
|
|
||||||
|
public TraceEntity_15(World world, Vector position, boolean tnt) {
|
||||||
|
super(world, position, tnt ? Material.TNT : Material.WHITE_STAINED_GLASS);
|
||||||
|
|
||||||
|
this.setNoGravity(true);
|
||||||
|
this.ticksLived = -12000;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void display(Player player, boolean exploded, int ticks) {
|
||||||
|
if (ticks != -1) {
|
||||||
|
this.setCustomNameVisible(true);
|
||||||
|
this.setCustomName(new ChatComponentText(ticks + ""));
|
||||||
|
}
|
||||||
|
if (!this.exploded && exploded) {
|
||||||
|
this.setCustomNameVisible(true);
|
||||||
|
this.setCustomName(new ChatComponentText("Bumm"));
|
||||||
|
this.exploded = true;
|
||||||
|
if (referenceCounter.increment() > 0) {
|
||||||
|
sendEntityDestroy(player);
|
||||||
|
}
|
||||||
|
} else if (referenceCounter.increment() > 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
sendEntity(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hide(Player player, boolean force) {
|
||||||
|
if (!force && referenceCounter.decrement() > 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
sendEntityDestroy(player);
|
||||||
|
die();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package de.steamwar.bausystem.features.util;
|
||||||
|
|
||||||
|
import com.sk89q.worldedit.bukkit.BukkitWorld;
|
||||||
|
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
|
||||||
|
import com.sk89q.worldedit.regions.selector.CuboidRegionSelector;
|
||||||
|
import com.sk89q.worldedit.world.World;
|
||||||
|
import de.steamwar.bausystem.region.Point;
|
||||||
|
import de.steamwar.bausystem.region.RegionUtils_15;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
public class SelectCommand_15 {
|
||||||
|
|
||||||
|
static final WorldEditPlugin WORLDEDIT_PLUGIN = ((WorldEditPlugin) Bukkit.getPluginManager().getPlugin("WorldEdit"));
|
||||||
|
static final World BUKKITWORLD = new BukkitWorld(Bukkit.getWorlds().get(0));
|
||||||
|
|
||||||
|
static void setSelection(Player p, Point minPoint, Point maxPoint) {
|
||||||
|
WORLDEDIT_PLUGIN.getSession(p).setRegionSelector(BUKKITWORLD, new CuboidRegionSelector(BUKKITWORLD, RegionUtils_15.toBlockVector3(minPoint), RegionUtils_15.toBlockVector3(maxPoint)));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,59 @@
|
|||||||
|
/*
|
||||||
|
* This file is a part of the SteamWar software.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2021 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.bausystem.features.warp;
|
||||||
|
|
||||||
|
import de.steamwar.bausystem.shared.BaseArmorStand_15;
|
||||||
|
import net.minecraft.server.v1_15_R1.ChatComponentText;
|
||||||
|
import org.bukkit.World;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
public class WarpEntity_15 extends BaseArmorStand_15 implements AbstractWarpEntity {
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
public WarpEntity_15(World world, Vector position, String name) {
|
||||||
|
super(world, position);
|
||||||
|
setInvisible(true);
|
||||||
|
setSmall(true);
|
||||||
|
this.name = name;
|
||||||
|
this.setNoGravity(true);
|
||||||
|
this.ticksLived = -12000;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void display(Player player) {
|
||||||
|
this.setCustomNameVisible(true);
|
||||||
|
this.setCustomName(new ChatComponentText(name));
|
||||||
|
sendEntity(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hide(Player player) {
|
||||||
|
sendEntityDestroy(player);
|
||||||
|
die();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
/*
|
||||||
|
* This file is a part of the SteamWar software.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2021 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.bausystem.features.warp;
|
||||||
|
|
||||||
|
import org.bukkit.World;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
public class WarpListener_15 {
|
||||||
|
|
||||||
|
public static AbstractWarpEntity create(World world, Vector position, String name) {
|
||||||
|
return new WarpEntity_15(world, position, name);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,67 @@
|
|||||||
|
/*
|
||||||
|
* This file is a part of the SteamWar software.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2021 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.bausystem.features.world;
|
||||||
|
|
||||||
|
import net.minecraft.server.v1_15_R1.NBTBase;
|
||||||
|
import net.minecraft.server.v1_15_R1.NBTTagCompound;
|
||||||
|
import net.minecraft.server.v1_15_R1.NBTTagList;
|
||||||
|
import org.bukkit.craftbukkit.v1_15_R1.inventory.CraftItemStack;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
public class InventoryListener_15 {
|
||||||
|
|
||||||
|
private static final int threshold = 2048;
|
||||||
|
|
||||||
|
public static boolean checkItemStack(ItemStack item) {
|
||||||
|
net.minecraft.server.v1_15_R1.ItemStack nmsItem = CraftItemStack.asNMSCopy(item);
|
||||||
|
NBTTagCompound tag = nmsItem.getTag();
|
||||||
|
if (tag != null && tag.hasKey("BlockEntityTag")) {
|
||||||
|
NBTTagCompound blockTag = tag.getCompound("BlockEntityTag");
|
||||||
|
if (blockTag.hasKey("Items")) {
|
||||||
|
return drillDown(blockTag.getList("Items", 10), 0, 0) > threshold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static int drillDown(NBTTagList items, int layer, int start) {
|
||||||
|
if (layer > 2) return start + threshold;
|
||||||
|
int invalid = start;
|
||||||
|
for (NBTBase nbtBase : items) {
|
||||||
|
if (!(nbtBase instanceof NBTTagCompound))
|
||||||
|
continue;
|
||||||
|
NBTTagCompound slot = (NBTTagCompound) nbtBase;
|
||||||
|
if (slot.hasKey("tag")) {
|
||||||
|
invalid += slot.getByte("Count");
|
||||||
|
NBTTagCompound iTag = slot.getCompound("tag");
|
||||||
|
if (iTag.hasKey("BlockEntityTag")) {
|
||||||
|
NBTTagCompound blockTag = iTag.getCompound("BlockEntityTag");
|
||||||
|
if (blockTag.hasKey("Items")) {
|
||||||
|
invalid = drillDown(blockTag.getList("Items", 10), layer + 1, invalid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (invalid > threshold)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return invalid;
|
||||||
|
}
|
||||||
|
}
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of the SteamWar software.
|
* This file is a part of the SteamWar software.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2022 SteamWar.de-Serverteam
|
* Copyright (C) 2021 SteamWar.de-Serverteam
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Affero General Public License as published by
|
||||||
@ -17,17 +17,17 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.steamwar.bausystem.features.worldedit.utils;
|
package de.steamwar.bausystem.features.world;
|
||||||
|
|
||||||
import com.fastasyncworldedit.core.extension.factory.parser.RichParser;
|
|
||||||
import com.sk89q.worldedit.WorldEdit;
|
import com.sk89q.worldedit.WorldEdit;
|
||||||
import com.sk89q.worldedit.function.mask.Mask;
|
|
||||||
import de.steamwar.bausystem.utils.WorldEditUtils;
|
|
||||||
|
|
||||||
public abstract class FAWEMaskParser extends RichParser<Mask> {
|
public class WorldEditListener_15 {
|
||||||
|
|
||||||
protected FAWEMaskParser(String... aliases) {
|
static boolean isWorldEditCommand(String command) {
|
||||||
super(WorldEdit.getInstance(), aliases);
|
if (command.startsWith("/")) {
|
||||||
WorldEditUtils.addMaskParser(this);
|
command = command.replaceFirst("/", "");
|
||||||
|
}
|
||||||
|
command = command.toLowerCase();
|
||||||
|
return WorldEdit.getInstance().getPlatformManager().getPlatformCommandManager().getCommandManager().containsCommand(command);
|
||||||
}
|
}
|
||||||
}
|
}
|
31
BauSystem_15/src/de/steamwar/bausystem/region/RegionUtils_15.java
Normale Datei
31
BauSystem_15/src/de/steamwar/bausystem/region/RegionUtils_15.java
Normale Datei
@ -0,0 +1,31 @@
|
|||||||
|
/*
|
||||||
|
* This file is a part of the SteamWar software.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2021 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.bausystem.region;
|
||||||
|
|
||||||
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
|
import lombok.experimental.UtilityClass;
|
||||||
|
|
||||||
|
@UtilityClass
|
||||||
|
public class RegionUtils_15 {
|
||||||
|
|
||||||
|
public BlockVector3 toBlockVector3(Point point) {
|
||||||
|
return BlockVector3.at(point.getX(), point.getY(), point.getZ());
|
||||||
|
}
|
||||||
|
}
|
231
BauSystem_15/src/de/steamwar/bausystem/region/Region_15.java
Normale Datei
231
BauSystem_15/src/de/steamwar/bausystem/region/Region_15.java
Normale Datei
@ -0,0 +1,231 @@
|
|||||||
|
/*
|
||||||
|
* This file is a part of the SteamWar software.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2021 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.bausystem.region;
|
||||||
|
|
||||||
|
import com.sk89q.worldedit.EditSession;
|
||||||
|
import com.sk89q.worldedit.WorldEdit;
|
||||||
|
import com.sk89q.worldedit.WorldEditException;
|
||||||
|
import com.sk89q.worldedit.bukkit.BukkitWorld;
|
||||||
|
import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard;
|
||||||
|
import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
||||||
|
import com.sk89q.worldedit.extent.clipboard.io.BuiltInClipboardFormat;
|
||||||
|
import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormats;
|
||||||
|
import com.sk89q.worldedit.extent.clipboard.io.ClipboardReader;
|
||||||
|
import com.sk89q.worldedit.extent.clipboard.io.ClipboardWriter;
|
||||||
|
import com.sk89q.worldedit.function.mask.AbstractExtentMask;
|
||||||
|
import com.sk89q.worldedit.function.mask.Mask2D;
|
||||||
|
import com.sk89q.worldedit.function.operation.ForwardExtentCopy;
|
||||||
|
import com.sk89q.worldedit.function.operation.Operations;
|
||||||
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
|
import com.sk89q.worldedit.math.transform.AffineTransform;
|
||||||
|
import com.sk89q.worldedit.regions.CuboidRegion;
|
||||||
|
import com.sk89q.worldedit.session.ClipboardHolder;
|
||||||
|
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||||
|
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||||
|
import lombok.experimental.UtilityClass;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
|
||||||
|
@UtilityClass
|
||||||
|
public class Region_15 {
|
||||||
|
|
||||||
|
private static final BaseBlock WOOL = Objects.requireNonNull(BlockTypes.PINK_WOOL).getDefaultState().toBaseBlock();
|
||||||
|
private static final BaseBlock WOOL2 = Objects.requireNonNull(BlockTypes.YELLOW_WOOL).getDefaultState().toBaseBlock();
|
||||||
|
private static final BaseBlock CLAY = Objects.requireNonNull(BlockTypes.PINK_TERRACOTTA).getDefaultState().toBaseBlock();
|
||||||
|
private static final BaseBlock CLAY2 = Objects.requireNonNull(BlockTypes.YELLOW_TERRACOTTA).getDefaultState().toBaseBlock();
|
||||||
|
private static final BaseBlock GLAZED = Objects.requireNonNull(BlockTypes.PINK_GLAZED_TERRACOTTA).getDefaultState().toBaseBlock();
|
||||||
|
private static final BaseBlock GLASS = Objects.requireNonNull(BlockTypes.PINK_STAINED_GLASS).getDefaultState().toBaseBlock();
|
||||||
|
private static final BaseBlock GLASS2 = Objects.requireNonNull(BlockTypes.YELLOW_STAINED_GLASS).getDefaultState().toBaseBlock();
|
||||||
|
private static final BaseBlock GLASS_PANE = Objects.requireNonNull(BlockTypes.PINK_STAINED_GLASS_PANE).getDefaultState().toBaseBlock();
|
||||||
|
private static final BaseBlock GLASS_PANE2 = Objects.requireNonNull(BlockTypes.YELLOW_STAINED_GLASS_PANE).getDefaultState().toBaseBlock();
|
||||||
|
private static final BaseBlock CONCRETE = Objects.requireNonNull(BlockTypes.PINK_CONCRETE).getDefaultState().toBaseBlock();
|
||||||
|
private static final BaseBlock CONCRETE2 = Objects.requireNonNull(BlockTypes.YELLOW_CONCRETE).getDefaultState().toBaseBlock();
|
||||||
|
private static final BaseBlock CONCRETE_POWDER = Objects.requireNonNull(BlockTypes.PINK_CONCRETE_POWDER).getDefaultState().toBaseBlock();
|
||||||
|
private static final BaseBlock CARPET = Objects.requireNonNull(BlockTypes.PINK_CARPET).getDefaultState().toBaseBlock();
|
||||||
|
|
||||||
|
private Map<String, Long> timing = new HashMap<>();
|
||||||
|
|
||||||
|
public void start(String name) {
|
||||||
|
timing.put(name, System.currentTimeMillis());
|
||||||
|
}
|
||||||
|
|
||||||
|
public long stop(String name) {
|
||||||
|
return System.currentTimeMillis() - timing.getOrDefault(name, System.currentTimeMillis());
|
||||||
|
}
|
||||||
|
|
||||||
|
EditSession paste(File file, Point pastePoint, PasteOptions pasteOptions) {
|
||||||
|
start("clipboardLoad");
|
||||||
|
Clipboard clipboard;
|
||||||
|
try (ClipboardReader reader = Objects.requireNonNull(ClipboardFormats.findByFile(file)).getReader(new FileInputStream(file))) {
|
||||||
|
clipboard = reader.read();
|
||||||
|
} catch (NullPointerException | IOException e) {
|
||||||
|
throw new SecurityException("Bausystem schematic not found", e);
|
||||||
|
}
|
||||||
|
System.out.println("Clipboard Load: " + stop("clipboardLoad"));
|
||||||
|
|
||||||
|
start("paste");
|
||||||
|
EditSession editSession = paste(clipboard, pastePoint, pasteOptions);
|
||||||
|
System.out.println("Paste: " + stop("paste"));
|
||||||
|
return editSession;
|
||||||
|
}
|
||||||
|
|
||||||
|
EditSession paste(Clipboard clipboard, Point pastePoint, PasteOptions pasteOptions) {
|
||||||
|
try (EditSession e = WorldEdit.getInstance().getEditSessionFactory().getEditSession(new BukkitWorld(Bukkit.getWorlds().get(0)), -1)) {
|
||||||
|
start("changeColor");
|
||||||
|
if (pasteOptions.getColor() != Color.YELLOW) {
|
||||||
|
changeColor(clipboard, pasteOptions.getColor());
|
||||||
|
}
|
||||||
|
if (pasteOptions.isOnlyColors()) {
|
||||||
|
Set<String> blocks = new HashSet<>();
|
||||||
|
blocks.add("minecraft:" + pasteOptions.getColor().name().toLowerCase() + "_wool");
|
||||||
|
blocks.add("minecraft:" + pasteOptions.getColor().name().toLowerCase() + "_terracotta");
|
||||||
|
blocks.add("minecraft:" + pasteOptions.getColor().name().toLowerCase() + "_glazed_terracotta");
|
||||||
|
blocks.add("minecraft:" + pasteOptions.getColor().name().toLowerCase() + "_stained_glass");
|
||||||
|
blocks.add("minecraft:" + pasteOptions.getColor().name().toLowerCase() + "_stained_glass_pane");
|
||||||
|
blocks.add("minecraft:" + pasteOptions.getColor().name().toLowerCase() + "_concrete");
|
||||||
|
blocks.add("minecraft:" + pasteOptions.getColor().name().toLowerCase() + "_concrete_powder");
|
||||||
|
blocks.add("minecraft:" + pasteOptions.getColor().name().toLowerCase() + "_carpet");
|
||||||
|
|
||||||
|
e.setMask(new AbstractExtentMask(clipboard) {
|
||||||
|
@Override
|
||||||
|
public boolean test(BlockVector3 blockVector3) {
|
||||||
|
BaseBlock block = getExtent().getFullBlock(blockVector3);
|
||||||
|
String blockName = block.toString().toLowerCase();
|
||||||
|
return blocks.contains(blockName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public Mask2D toMask2D() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
System.out.println("ChangeColor: " + stop("changeColor"));
|
||||||
|
|
||||||
|
start("transform");
|
||||||
|
ClipboardHolder ch = new ClipboardHolder(clipboard);
|
||||||
|
BlockVector3 dimensions = clipboard.getDimensions();
|
||||||
|
BlockVector3 v = BlockVector3.at(pastePoint.getX(), pastePoint.getY(), pastePoint.getZ());
|
||||||
|
BlockVector3 offset = clipboard.getRegion().getMinimumPoint().subtract(clipboard.getOrigin());
|
||||||
|
if (pasteOptions.isRotate()) {
|
||||||
|
ch.setTransform(new AffineTransform().rotateY(180));
|
||||||
|
v = v.add(dimensions.getX() / 2, 0, dimensions.getZ() / 2).subtract(offset.multiply(-1, 1, -1)).subtract(0, 0, 1);
|
||||||
|
} else {
|
||||||
|
v = v.subtract(dimensions.getX() / 2, 0, dimensions.getZ() / 2).subtract(offset);
|
||||||
|
}
|
||||||
|
System.out.println("Transform: " + stop("transform"));
|
||||||
|
|
||||||
|
start("reset");
|
||||||
|
if (pasteOptions.isReset()) {
|
||||||
|
e.setBlocks(new CuboidRegion(RegionUtils_15.toBlockVector3(pasteOptions.getMinPoint()), RegionUtils_15.toBlockVector3(pasteOptions.getMaxPoint())), Objects.requireNonNull(BlockTypes.AIR).getDefaultState().toBaseBlock());
|
||||||
|
if (pasteOptions.getWaterLevel() != 0) {
|
||||||
|
e.setBlocks(new CuboidRegion(RegionUtils_15.toBlockVector3(pasteOptions.getMinPoint()), RegionUtils_15.toBlockVector3(pasteOptions.getMaxPoint()).withY(pasteOptions.getWaterLevel())), Objects.requireNonNull(BlockTypes.WATER).getDefaultState().toBaseBlock());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
System.out.println("Reset: " + stop("reset"));
|
||||||
|
start("operation");
|
||||||
|
Operations.completeBlindly(ch.createPaste(e).to(v).ignoreAirBlocks(pasteOptions.isIgnoreAir()).build());
|
||||||
|
System.out.println("Operation: " + stop("operation"));
|
||||||
|
return e;
|
||||||
|
} catch (WorldEditException e) {
|
||||||
|
throw new SecurityException(e.getMessage(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void changeColor(Clipboard clipboard, Color color) throws WorldEditException {
|
||||||
|
BlockVector3 minimum = clipboard.getRegion().getMinimumPoint();
|
||||||
|
BaseBlock wool = Objects.requireNonNull(BlockTypes.get(color.name().toLowerCase() + "_wool")).getDefaultState().toBaseBlock();
|
||||||
|
BaseBlock clay = Objects.requireNonNull(BlockTypes.get(color.name().toLowerCase() + "_terracotta")).getDefaultState().toBaseBlock();
|
||||||
|
BaseBlock glazed = Objects.requireNonNull(BlockTypes.get(color.name().toLowerCase() + "_glazed_terracotta")).getDefaultState().toBaseBlock();
|
||||||
|
BaseBlock glass = Objects.requireNonNull(BlockTypes.get(color.name().toLowerCase() + "_stained_glass")).getDefaultState().toBaseBlock();
|
||||||
|
BaseBlock glassPane = Objects.requireNonNull(BlockTypes.get(color.name().toLowerCase() + "_stained_glass_pane")).getDefaultState().toBaseBlock();
|
||||||
|
BaseBlock carpet = Objects.requireNonNull(BlockTypes.get(color.name().toLowerCase() + "_carpet")).getDefaultState().toBaseBlock();
|
||||||
|
BaseBlock concrete = Objects.requireNonNull(BlockTypes.get(color.name().toLowerCase() + "_concrete")).getDefaultState().toBaseBlock();
|
||||||
|
BaseBlock concretePowder = Objects.requireNonNull(BlockTypes.get(color.name().toLowerCase() + "_concrete_powder")).getDefaultState().toBaseBlock();
|
||||||
|
|
||||||
|
for (int x = 0; x < clipboard.getDimensions().getX(); x++) {
|
||||||
|
for (int y = 0; y < clipboard.getDimensions().getY(); y++) {
|
||||||
|
for (int z = 0; z < clipboard.getDimensions().getZ(); z++) {
|
||||||
|
BlockVector3 pos = minimum.add(x, y, z);
|
||||||
|
BaseBlock block = clipboard.getFullBlock(pos);
|
||||||
|
if (block.equals(WOOL)) {
|
||||||
|
clipboard.setBlock(pos, wool);
|
||||||
|
} else if (block.equals(WOOL2)) {
|
||||||
|
clipboard.setBlock(pos, wool);
|
||||||
|
} else if (block.equals(CLAY)) {
|
||||||
|
clipboard.setBlock(pos, clay);
|
||||||
|
} else if (block.equals(CLAY2)) {
|
||||||
|
clipboard.setBlock(pos, clay);
|
||||||
|
} else if (block.equals(GLAZED)) {
|
||||||
|
clipboard.setBlock(pos, glazed);
|
||||||
|
} else if (block.equals(GLASS)) {
|
||||||
|
clipboard.setBlock(pos, glass);
|
||||||
|
} else if (block.equals(GLASS2)) {
|
||||||
|
clipboard.setBlock(pos, glass);
|
||||||
|
} else if (block.equals(GLASS_PANE)) {
|
||||||
|
clipboard.setBlock(pos, glassPane);
|
||||||
|
} else if (block.equals(GLASS_PANE2)) {
|
||||||
|
clipboard.setBlock(pos, glassPane);
|
||||||
|
} else if (block.equals(CARPET)) {
|
||||||
|
clipboard.setBlock(pos, carpet);
|
||||||
|
} else if (block.equals(CONCRETE)) {
|
||||||
|
clipboard.setBlock(pos, concrete);
|
||||||
|
} else if (block.equals(CONCRETE2)) {
|
||||||
|
clipboard.setBlock(pos, concrete);
|
||||||
|
} else if (block.equals(CONCRETE_POWDER)) {
|
||||||
|
clipboard.setBlock(pos, concretePowder);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean backup(Point minPoint, Point maxPoint, File file) {
|
||||||
|
BukkitWorld bukkitWorld = new BukkitWorld(Bukkit.getWorlds().get(0));
|
||||||
|
CuboidRegion region = new CuboidRegion(bukkitWorld, RegionUtils_15.toBlockVector3(minPoint), RegionUtils_15.toBlockVector3(maxPoint));
|
||||||
|
BlockArrayClipboard clipboard = new BlockArrayClipboard(region);
|
||||||
|
try (EditSession e = WorldEdit.getInstance().getEditSessionFactory().getEditSession(bukkitWorld, -1)) {
|
||||||
|
ForwardExtentCopy copy = new ForwardExtentCopy(
|
||||||
|
e, region, clipboard, region.getMinimumPoint()
|
||||||
|
);
|
||||||
|
|
||||||
|
copy.setCopyingEntities(false);
|
||||||
|
copy.setCopyingBiomes(false);
|
||||||
|
|
||||||
|
Operations.complete(copy);
|
||||||
|
|
||||||
|
try (ClipboardWriter writer = BuiltInClipboardFormat.SPONGE_SCHEMATIC.getWriter(new FileOutputStream(file))) {
|
||||||
|
writer.write(clipboard);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
} catch (WorldEditException | IOException e) {
|
||||||
|
Bukkit.getLogger().log(Level.SEVERE, e.getMessage(), e);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
56
BauSystem_15/src/de/steamwar/bausystem/shared/BaseArmorStand_15.java
Normale Datei
56
BauSystem_15/src/de/steamwar/bausystem/shared/BaseArmorStand_15.java
Normale Datei
@ -0,0 +1,56 @@
|
|||||||
|
/*
|
||||||
|
* This file is a part of the SteamWar software.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2021 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.bausystem.shared;
|
||||||
|
|
||||||
|
import net.minecraft.server.v1_15_R1.*;
|
||||||
|
import org.bukkit.World;
|
||||||
|
import org.bukkit.craftbukkit.v1_15_R1.CraftWorld;
|
||||||
|
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
public class BaseArmorStand_15 extends EntityArmorStand implements AbstractEntity {
|
||||||
|
|
||||||
|
private static final Vec3D ZERO = new Vec3D(0, 0, 0);
|
||||||
|
|
||||||
|
protected Vector position;
|
||||||
|
|
||||||
|
public BaseArmorStand_15(World world, Vector position) {
|
||||||
|
super(((CraftWorld) world).getHandle(), position.getX(), position.getY(), position.getZ());
|
||||||
|
|
||||||
|
this.position = position;
|
||||||
|
setNoGravity(true);
|
||||||
|
ticksLived = -12000;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void sendEntity(Player player) {
|
||||||
|
PacketPlayOutSpawnEntity packetPlayOutSpawnEntity = new PacketPlayOutSpawnEntity(getId(), getUniqueID(), position.getX(), position.getY(), position.getZ(), 0, 0, EntityTypes.ARMOR_STAND, 0, ZERO);
|
||||||
|
PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().playerConnection;
|
||||||
|
playerConnection.sendPacket(packetPlayOutSpawnEntity);
|
||||||
|
|
||||||
|
PacketPlayOutEntityMetadata packetPlayOutEntityMetadata = new PacketPlayOutEntityMetadata(getId(), datawatcher, true);
|
||||||
|
playerConnection.sendPacket(packetPlayOutEntityMetadata);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void sendEntityDestroy(Player player) {
|
||||||
|
PacketPlayOutEntityDestroy packetPlayOutEntityDestroy = new PacketPlayOutEntityDestroy(getId());
|
||||||
|
((CraftPlayer) player).getHandle().playerConnection.sendPacket(packetPlayOutEntityDestroy);
|
||||||
|
}
|
||||||
|
}
|
60
BauSystem_15/src/de/steamwar/bausystem/shared/BaseEntity_15.java
Normale Datei
60
BauSystem_15/src/de/steamwar/bausystem/shared/BaseEntity_15.java
Normale Datei
@ -0,0 +1,60 @@
|
|||||||
|
/*
|
||||||
|
* This file is a part of the SteamWar software.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2021 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.bausystem.shared;
|
||||||
|
|
||||||
|
import net.minecraft.server.v1_15_R1.*;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.World;
|
||||||
|
import org.bukkit.craftbukkit.v1_15_R1.CraftWorld;
|
||||||
|
import org.bukkit.craftbukkit.v1_15_R1.block.data.CraftBlockData;
|
||||||
|
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
public class BaseEntity_15 extends EntityFallingBlock implements AbstractEntity {
|
||||||
|
|
||||||
|
private static final Vec3D ZERO = new Vec3D(0, 0, 0);
|
||||||
|
|
||||||
|
private final IBlockData iBlockData;
|
||||||
|
protected Vector position;
|
||||||
|
|
||||||
|
public BaseEntity_15(World world, Vector position, Material blockType) {
|
||||||
|
super(((CraftWorld) world).getHandle(), position.getX(), position.getY(), position.getZ(), ((CraftBlockData) blockType.createBlockData()).getState());
|
||||||
|
this.iBlockData = ((CraftBlockData) blockType.createBlockData()).getState();
|
||||||
|
this.position = position;
|
||||||
|
|
||||||
|
this.setNoGravity(true);
|
||||||
|
this.ticksLived = -12000;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void sendEntity(Player player) {
|
||||||
|
PacketPlayOutSpawnEntity packetPlayOutSpawnEntity = new PacketPlayOutSpawnEntity(getId(), getUniqueID(), position.getX(), position.getY(), position.getZ(), 0, 0, EntityTypes.FALLING_BLOCK, Block.getCombinedId(iBlockData), ZERO);
|
||||||
|
PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().playerConnection;
|
||||||
|
playerConnection.sendPacket(packetPlayOutSpawnEntity);
|
||||||
|
|
||||||
|
PacketPlayOutEntityMetadata packetPlayOutEntityMetadata = new PacketPlayOutEntityMetadata(getId(), datawatcher, true);
|
||||||
|
playerConnection.sendPacket(packetPlayOutEntityMetadata);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void sendEntityDestroy(Player player) {
|
||||||
|
PacketPlayOutEntityDestroy packetPlayOutEntityDestroy = new PacketPlayOutEntityDestroy(getId());
|
||||||
|
((CraftPlayer) player).getHandle().playerConnection.sendPacket(packetPlayOutEntityDestroy);
|
||||||
|
}
|
||||||
|
}
|
@ -1,243 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of the SteamWar software.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2022 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.bausystem.utils;
|
|
||||||
|
|
||||||
import com.sk89q.worldedit.EditSession;
|
|
||||||
import com.sk89q.worldedit.WorldEdit;
|
|
||||||
import com.sk89q.worldedit.WorldEditException;
|
|
||||||
import com.sk89q.worldedit.bukkit.BukkitWorld;
|
|
||||||
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
|
|
||||||
import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard;
|
|
||||||
import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
|
||||||
import com.sk89q.worldedit.extent.clipboard.io.BuiltInClipboardFormat;
|
|
||||||
import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormats;
|
|
||||||
import com.sk89q.worldedit.extent.clipboard.io.ClipboardReader;
|
|
||||||
import com.sk89q.worldedit.extent.clipboard.io.ClipboardWriter;
|
|
||||||
import com.sk89q.worldedit.function.mask.Mask;
|
|
||||||
import com.sk89q.worldedit.function.mask.Mask2D;
|
|
||||||
import com.sk89q.worldedit.function.operation.ForwardExtentCopy;
|
|
||||||
import com.sk89q.worldedit.function.operation.Operations;
|
|
||||||
import com.sk89q.worldedit.math.BlockVector3;
|
|
||||||
import com.sk89q.worldedit.math.transform.AffineTransform;
|
|
||||||
import com.sk89q.worldedit.regions.CuboidRegion;
|
|
||||||
import com.sk89q.worldedit.regions.selector.CuboidRegionSelector;
|
|
||||||
import com.sk89q.worldedit.session.ClipboardHolder;
|
|
||||||
import com.sk89q.worldedit.world.World;
|
|
||||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
|
||||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
|
||||||
import de.steamwar.bausystem.region.Point;
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.block.Block;
|
|
||||||
import org.bukkit.block.data.BlockData;
|
|
||||||
import org.bukkit.block.data.Waterlogged;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
|
||||||
import org.bukkit.util.Vector;
|
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
|
||||||
import java.util.function.BiPredicate;
|
|
||||||
import java.util.logging.Level;
|
|
||||||
|
|
||||||
public class FlatteningWrapper15 implements FlatteningWrapper {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isNoBook(ItemStack item) {
|
|
||||||
return item.getType() != Material.WRITABLE_BOOK && item.getType() != Material.WRITTEN_BOOK;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static final Set<Material> unpushable = new HashSet<>(Arrays.asList(Material.BARRIER, Material.BEACON, Material.COMMAND_BLOCK, Material.CHAIN_COMMAND_BLOCK, Material.REPEATING_COMMAND_BLOCK, Material.ENCHANTING_TABLE, Material.END_GATEWAY, Material.END_PORTAL, Material.ENDER_CHEST, Material.GRINDSTONE, Material.JIGSAW, Material.JUKEBOX, Material.NETHER_PORTAL, Material.OBSIDIAN, Material.STRUCTURE_VOID, Material.BARREL, Material.BEEHIVE, Material.BEE_NEST, Material.BLAST_FURNACE, Material.BREWING_STAND, Material.CHEST, Material.DAYLIGHT_DETECTOR, Material.DISPENSER, Material.DROPPER, Material.FURNACE, Material.HOPPER, Material.LECTERN, Material.SMOKER, Material.TRAPPED_CHEST));
|
|
||||||
|
|
||||||
// TODO: FLOWER
|
|
||||||
private static final Set<Material> breaking = new HashSet<>(Arrays.asList(Material.BAMBOO, Material.CACTUS, Material.CAKE, Material.CARVED_PUMPKIN, Material.CHORUS_FLOWER, Material.CHORUS_PLANT, Material.COBWEB, Material.COCOA, Material.DRAGON_EGG, Material.FIRE, Material.FLOWER_POT, Material.JACK_O_LANTERN, Material.LADDER, Material.LAVA, Material.LAVA, Material.LEVER, Material.LILY_PAD, Material.MELON, Material.NETHER_WART, Material.PUMPKIN, Material.COMPARATOR, Material.REDSTONE_WIRE, Material.REPEATER, Material.TORCH, Material.STRUCTURE_VOID, Material.SCAFFOLDING, Material.SEA_PICKLE, Material.SNOW, Material.SUGAR_CANE, Material.TORCH, Material.TRIPWIRE, Material.TRIPWIRE_HOOK, Material.TURTLE_EGG, Material.VINE, Material.WATER, Material.WHEAT));
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isUnpusheable(Material material) {
|
|
||||||
if (unpushable.contains(material)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
String name = material.name();
|
|
||||||
return name.contains("BANNER") || name.contains("SIGN");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isBreakingOnPush(Material material) {
|
|
||||||
if (breaking.contains(material)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
String name = material.name();
|
|
||||||
return name.contains("BED") || name.contains("BUTTON") || name.contains("CARPET") || (name.contains("DOOR") && !name.contains("TRAPDOOR")) || name.contains("HEAD") || name.contains("LEAVES") || name.contains("MUSHROOM") || name.contains("PRESSURE_PLATE") || name.contains("SHULKER_BOX");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isWorldEditCommand(String command) {
|
|
||||||
if (command.startsWith("/")) {
|
|
||||||
command = command.replaceFirst("/", "");
|
|
||||||
}
|
|
||||||
command = command.toLowerCase();
|
|
||||||
return WorldEdit.getInstance().getPlatformManager().getPlatformCommandManager().getCommandManager().containsCommand(command);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static final WorldEditPlugin WORLDEDIT_PLUGIN = Objects.requireNonNull((WorldEditPlugin) Bukkit.getPluginManager().getPlugin("WorldEdit"));
|
|
||||||
private static final World BUKKITWORLD = new BukkitWorld(Bukkit.getWorlds().get(0));
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setSelection(Player p, Point minPoint, Point maxPoint) {
|
|
||||||
WORLDEDIT_PLUGIN.getSession(p).setRegionSelector(BUKKITWORLD, new CuboidRegionSelector(BUKKITWORLD, toBlockVector3(minPoint), toBlockVector3(maxPoint)));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Clipboard loadSchematic(File file) {
|
|
||||||
Clipboard clipboard;
|
|
||||||
try (ClipboardReader reader = Objects.requireNonNull(ClipboardFormats.findByFile(file)).getReader(new FileInputStream(file))) {
|
|
||||||
clipboard = reader.read();
|
|
||||||
} catch (NullPointerException | IOException e) {
|
|
||||||
throw new SecurityException("Bausystem schematic not found", e);
|
|
||||||
}
|
|
||||||
return clipboard;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public EditSession paste(PasteBuilder pasteBuilder) {
|
|
||||||
try (EditSession e = WorldEdit.getInstance().getEditSessionFactory().getEditSession(new BukkitWorld(Bukkit.getWorlds().get(0)), -1)) {
|
|
||||||
Clipboard clipboard = pasteBuilder.getClipboard();
|
|
||||||
|
|
||||||
if (!pasteBuilder.getMappers().isEmpty()) {
|
|
||||||
BlockVector3 minimum = clipboard.getRegion().getMinimumPoint();
|
|
||||||
for (int x = 0; x < clipboard.getDimensions().getX(); x++) {
|
|
||||||
for (int y = 0; y < clipboard.getDimensions().getY(); y++) {
|
|
||||||
for (int z = 0; z < clipboard.getDimensions().getZ(); z++) {
|
|
||||||
BlockVector3 pos = minimum.add(x, y, z);
|
|
||||||
pasteBuilder.getMappers().forEach(mapper -> mapper.accept(clipboard, pos));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
AtomicReference<BlockVector3> pastePoint = new AtomicReference<>();
|
|
||||||
if (!pasteBuilder.getPredicates().isEmpty()) {
|
|
||||||
e.setMask(new Mask() {
|
|
||||||
@Override
|
|
||||||
public boolean test(BlockVector3 blockVector3) {
|
|
||||||
BaseBlock block = clipboard.getFullBlock(blockVector3.subtract(pastePoint.get()).add(clipboard.getRegion().getMinimumPoint()));
|
|
||||||
String blockName = block.getBlockType().toString().toLowerCase();
|
|
||||||
for (BiPredicate<BaseBlock, String> predicate : pasteBuilder.getPredicates()) {
|
|
||||||
if (!predicate.test(block, blockName)) return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Mask copy() {
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nullable
|
|
||||||
@Override
|
|
||||||
public Mask2D toMask2D() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
ClipboardHolder ch = new ClipboardHolder(clipboard);
|
|
||||||
BlockVector3 dimensions = clipboard.getDimensions();
|
|
||||||
BlockVector3 v = BlockVector3.at(pasteBuilder.getPastPoint().getX(), pasteBuilder.getPastPoint().getY(), pasteBuilder.getPastPoint().getZ());
|
|
||||||
BlockVector3 offset = clipboard.getRegion().getMinimumPoint().subtract(clipboard.getOrigin());
|
|
||||||
if (pasteBuilder.isRotate()) {
|
|
||||||
ch.setTransform(new AffineTransform().rotateY(180));
|
|
||||||
v = v.add(dimensions.getX() / 2, 0, dimensions.getZ() / 2).subtract(offset.multiply(-1, 1, -1)).subtract(0, 0, 1);
|
|
||||||
} else {
|
|
||||||
v = v.subtract(dimensions.getX() / 2, 0, dimensions.getZ() / 2).subtract(offset);
|
|
||||||
}
|
|
||||||
pastePoint.set(v);
|
|
||||||
|
|
||||||
if (pasteBuilder.isReset()) {
|
|
||||||
e.setBlocks(new CuboidRegion(toBlockVector3(pasteBuilder.getMinPoint()), toBlockVector3(pasteBuilder.getMaxPoint())), Objects.requireNonNull(BlockTypes.AIR).getDefaultState().toBaseBlock());
|
|
||||||
if (pasteBuilder.getWaterLevel() != 0) {
|
|
||||||
e.setBlocks(new CuboidRegion(toBlockVector3(pasteBuilder.getMinPoint()), toBlockVector3(pasteBuilder.getMaxPoint()).withY(pasteBuilder.getWaterLevel())), Objects.requireNonNull(BlockTypes.WATER).getDefaultState().toBaseBlock());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Operations.completeBlindly(ch.createPaste(e).to(v).ignoreAirBlocks(pasteBuilder.isIgnoreAir()).build());
|
|
||||||
return e;
|
|
||||||
} catch (WorldEditException e) {
|
|
||||||
throw new SecurityException(e.getMessage(), e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Clipboard copy(Point minPoint, Point maxPoint, Point copyPoint) {
|
|
||||||
BukkitWorld bukkitWorld = new BukkitWorld(Bukkit.getWorlds().get(0));
|
|
||||||
CuboidRegion region = new CuboidRegion(bukkitWorld, toBlockVector3(minPoint), toBlockVector3(maxPoint));
|
|
||||||
BlockArrayClipboard clipboard = new BlockArrayClipboard(region);
|
|
||||||
try (EditSession e = WorldEdit.getInstance().getEditSessionFactory().getEditSession(bukkitWorld, -1)) {
|
|
||||||
ForwardExtentCopy copy = new ForwardExtentCopy(
|
|
||||||
e, region, clipboard, region.getMinimumPoint()
|
|
||||||
);
|
|
||||||
|
|
||||||
copy.setCopyingEntities(false);
|
|
||||||
copy.setCopyingBiomes(false);
|
|
||||||
|
|
||||||
Operations.complete(copy);
|
|
||||||
clipboard.setOrigin(toBlockVector3(copyPoint));
|
|
||||||
return clipboard;
|
|
||||||
} catch (WorldEditException e) {
|
|
||||||
Bukkit.getLogger().log(Level.SEVERE, e.getMessage(), e);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean backup(Point minPoint, Point maxPoint, File file) {
|
|
||||||
Clipboard clipboard = copy(minPoint, maxPoint, minPoint);
|
|
||||||
try (ClipboardWriter writer = BuiltInClipboardFormat.SPONGE_SCHEMATIC.getWriter(new FileOutputStream(file))) {
|
|
||||||
writer.write(clipboard);
|
|
||||||
return true;
|
|
||||||
} catch (IOException e) {
|
|
||||||
Bukkit.getLogger().log(Level.SEVERE, e.getMessage(), e);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private BlockVector3 toBlockVector3(Point point) {
|
|
||||||
return BlockVector3.at(point.getX(), point.getY(), point.getZ());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean inWater(org.bukkit.World world, Vector tntPosition) {
|
|
||||||
Block block = world.getBlockAt(tntPosition.getBlockX(), tntPosition.getBlockY(), tntPosition.getBlockZ());
|
|
||||||
if (block.getType() == Material.WATER)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
BlockData data = block.getBlockData();
|
|
||||||
if (!(data instanceof Waterlogged))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return ((Waterlogged) data).isWaterlogged();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,135 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of the SteamWar software.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2022 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.bausystem.utils;
|
|
||||||
|
|
||||||
import com.comphenix.tinyprotocol.Reflection;
|
|
||||||
import de.steamwar.bausystem.features.util.NoClipCommand;
|
|
||||||
import net.minecraft.server.v1_15_R1.*;
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.GameMode;
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.World;
|
|
||||||
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftEntity;
|
|
||||||
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer;
|
|
||||||
import org.bukkit.craftbukkit.v1_15_R1.inventory.CraftItemStack;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.entity.TNTPrimed;
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.function.LongSupplier;
|
|
||||||
|
|
||||||
public class NMSWrapper15 implements NMSWrapper {
|
|
||||||
|
|
||||||
private static final Reflection.FieldAccessor<EnumGamemode> playerGameMode = Reflection.getField(PlayerInteractManager.class, EnumGamemode.class, 0);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
public void setInternalGameMode(Player player, GameMode gameMode) {
|
|
||||||
playerGameMode.set(((CraftPlayer) player).getHandle().playerInteractManager, EnumGamemode.getById(gameMode.getValue()));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setSlotToItemStack(Player player, Object o) {
|
|
||||||
PacketPlayInSetCreativeSlot packetPlayInSetCreativeSlot = (PacketPlayInSetCreativeSlot) o;
|
|
||||||
int index = packetPlayInSetCreativeSlot.b();
|
|
||||||
if (index >= 36 && index <= 44) {
|
|
||||||
index -= 36;
|
|
||||||
} else if (index > 44) {
|
|
||||||
index -= 5;
|
|
||||||
} else if (index <= 8) {
|
|
||||||
index = index - 8 + 36;
|
|
||||||
}
|
|
||||||
player.getInventory().setItem(index, CraftItemStack.asBukkitCopy(packetPlayInSetCreativeSlot.getItemStack()));
|
|
||||||
if (index < 9) player.getInventory().setHeldItemSlot(index);
|
|
||||||
player.updateInventory();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static final Reflection.FieldAccessor<Integer> gameStateChangeReason = Reflection.getField(NoClipCommand.gameStateChange, int.class, 0);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setGameStateChangeReason(Object packet) {
|
|
||||||
gameStateChangeReason.set(packet, 3);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setPlayerBuildAbilities(Player player) {
|
|
||||||
((CraftPlayer) player).getHandle().abilities.mayBuild = true;
|
|
||||||
((CraftPlayer) player).getHandle().abilities.canInstantlyBuild = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Material pathMaterial() {
|
|
||||||
return Material.GRASS_PATH;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static final int threshold = 2048;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean checkItemStack(ItemStack item) {
|
|
||||||
net.minecraft.server.v1_15_R1.ItemStack nmsItem = CraftItemStack.asNMSCopy(item);
|
|
||||||
NBTTagCompound tag = nmsItem.getTag();
|
|
||||||
if (tag != null && tag.hasKey("BlockEntityTag")) {
|
|
||||||
NBTTagCompound blockTag = tag.getCompound("BlockEntityTag");
|
|
||||||
if (blockTag.hasKey("Items")) {
|
|
||||||
return drillDown(blockTag.getList("Items", 10), 0, 0) > threshold;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private int drillDown(NBTTagList items, int layer, int start) {
|
|
||||||
if (layer > 2) return start + threshold;
|
|
||||||
int invalid = start;
|
|
||||||
for (NBTBase nbtBase : items) {
|
|
||||||
if (!(nbtBase instanceof NBTTagCompound))
|
|
||||||
continue;
|
|
||||||
NBTTagCompound slot = (NBTTagCompound) nbtBase;
|
|
||||||
if (slot.hasKey("tag")) {
|
|
||||||
invalid += slot.getByte("Count");
|
|
||||||
NBTTagCompound iTag = slot.getCompound("tag");
|
|
||||||
if (iTag.hasKey("BlockEntityTag")) {
|
|
||||||
NBTTagCompound blockTag = iTag.getCompound("BlockEntityTag");
|
|
||||||
if (blockTag.hasKey("Items")) {
|
|
||||||
invalid = drillDown(blockTag.getList("Items", 10), layer + 1, invalid);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (invalid > threshold)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return invalid;
|
|
||||||
}
|
|
||||||
|
|
||||||
private final Class<?> explosionPacket = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutExplosion");
|
|
||||||
private final Reflection.FieldAccessor<Double> a = Reflection.getField(explosionPacket, double.class, 0);
|
|
||||||
private final Reflection.FieldAccessor<Double> b = Reflection.getField(explosionPacket, double.class, 1);
|
|
||||||
private final Reflection.FieldAccessor<Double> c = Reflection.getField(explosionPacket, double.class, 2);
|
|
||||||
private final Reflection.FieldAccessor<Float> d = Reflection.getField(explosionPacket, float.class, 0);
|
|
||||||
private final Reflection.FieldAccessor<List> e = Reflection.getField(explosionPacket, List.class, 0);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Object resetExplosionKnockback(Object packet) {
|
|
||||||
PacketPlayOutExplosion packetPlayOutExplosion = (PacketPlayOutExplosion) packet;
|
|
||||||
return new PacketPlayOutExplosion(a.get(packetPlayOutExplosion), b.get(packetPlayOutExplosion), c.get(packetPlayOutExplosion), d.get(packetPlayOutExplosion), e.get(packetPlayOutExplosion), Vec3D.a);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,43 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of the SteamWar software.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2023 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.bausystem.utils;
|
|
||||||
|
|
||||||
import org.bukkit.Material;
|
|
||||||
|
|
||||||
public class PlaceItemWrapper15 implements PlaceItemWrapper {
|
|
||||||
|
|
||||||
public PlaceItemWrapper15() {
|
|
||||||
for (Material material : Material.values()) {
|
|
||||||
if (!material.isBlock()) continue;
|
|
||||||
if (material.isLegacy()) continue;
|
|
||||||
|
|
||||||
String nonWall = material.name().replace("_WALL_", "").replace("WALL_", "").replace("_WALL", "");
|
|
||||||
try {
|
|
||||||
Material nonWallMaterial = Material.valueOf(nonWall);
|
|
||||||
if (nonWallMaterial != material && nonWallMaterial.isItem() && !nonWallMaterial.isBlock()) {
|
|
||||||
BLOCK_MATERIAL_TO_WALL_BLOCK_MATERIAL.put(nonWallMaterial, material);
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
// Ignore
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ITEM_MATERIAL_TO_BLOCK_MATERIAL.put(Material.REDSTONE, Material.REDSTONE_WIRE);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,59 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of the SteamWar software.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2022 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.bausystem.utils;
|
|
||||||
|
|
||||||
import com.comphenix.tinyprotocol.Reflection;
|
|
||||||
import de.steamwar.bausystem.utils.PlayerMovementWrapper;
|
|
||||||
import net.minecraft.server.v1_15_R1.EntityPlayer;
|
|
||||||
import net.minecraft.server.v1_15_R1.PacketPlayInFlying;
|
|
||||||
import net.minecraft.server.v1_15_R1.PacketPlayOutEntity;
|
|
||||||
import net.minecraft.server.v1_15_R1.PacketPlayOutEntityTeleport;
|
|
||||||
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
public class PlayerMovementWrapper15 implements PlayerMovementWrapper {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setPosition(Player player, Object object) {
|
|
||||||
PacketPlayInFlying packetPlayInFlying = ((PacketPlayInFlying) object);
|
|
||||||
EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
|
|
||||||
if (Float.isNaN(packetPlayInFlying.a(Float.NaN))) {
|
|
||||||
entityPlayer.e(packetPlayInFlying.a(0.0), packetPlayInFlying.b(0.0), packetPlayInFlying.c(0.0));
|
|
||||||
} else {
|
|
||||||
entityPlayer.setLocation(packetPlayInFlying.a(0.0), packetPlayInFlying.b(0.0), packetPlayInFlying.c(0.0), packetPlayInFlying.a(0F), packetPlayInFlying.b(0F));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Object convertToOut(Player player, Object object) {
|
|
||||||
PacketPlayInFlying packetPlayInFlying = ((PacketPlayInFlying) object);
|
|
||||||
Object packet = Reflection.newInstance(teleportPacket);
|
|
||||||
teleportEntity.set(packet, player.getEntityId());
|
|
||||||
teleportPosition.set(packet, packetPlayInFlying.a(0.0), packetPlayInFlying.b(0.0), packetPlayInFlying.c(0.0));
|
|
||||||
if (Float.isNaN(packetPlayInFlying.a(Float.NaN))) {
|
|
||||||
teleportYaw.set(packet, rotToByte(player.getLocation().getYaw()));
|
|
||||||
teleportPitch.set(packet, rotToByte(player.getLocation().getPitch()));
|
|
||||||
} else {
|
|
||||||
teleportYaw.set(packet, rotToByte(packetPlayInFlying.a(0.0F)));
|
|
||||||
teleportPitch.set(packet, rotToByte(packetPlayInFlying.b(0.0F)));
|
|
||||||
}
|
|
||||||
return packet;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of the SteamWar software.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2023 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.bausystem.utils;
|
|
||||||
|
|
||||||
public class TickListener15 implements TickListener {
|
|
||||||
}
|
|
@ -1,63 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of the SteamWar software.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2020 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/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
plugins {
|
|
||||||
id 'base'
|
|
||||||
id 'java'
|
|
||||||
}
|
|
||||||
|
|
||||||
group 'steamwar'
|
|
||||||
version '1.0'
|
|
||||||
|
|
||||||
compileJava.options.encoding = 'UTF-8'
|
|
||||||
|
|
||||||
sourceCompatibility = 17
|
|
||||||
targetCompatibility = 17
|
|
||||||
|
|
||||||
sourceSets {
|
|
||||||
main {
|
|
||||||
java {
|
|
||||||
srcDirs = ['src/']
|
|
||||||
}
|
|
||||||
resources {
|
|
||||||
srcDirs = ['src/']
|
|
||||||
exclude '**/*.java', '**/*.kt'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
compileOnly 'org.projectlombok:lombok:1.18.22'
|
|
||||||
testCompileOnly 'org.projectlombok:lombok:1.18.22'
|
|
||||||
annotationProcessor 'org.projectlombok:lombok:1.18.22'
|
|
||||||
testAnnotationProcessor 'org.projectlombok:lombok:1.18.22'
|
|
||||||
|
|
||||||
implementation project(":BauSystem_Main")
|
|
||||||
|
|
||||||
compileOnly 'org.spigotmc:spigot-api:1.18-R0.1-SNAPSHOT'
|
|
||||||
compileOnly 'it.unimi.dsi:fastutil:8.5.6'
|
|
||||||
compileOnly 'com.mojang:datafixerupper:4.0.26'
|
|
||||||
compileOnly 'io.netty:netty-all:4.1.68.Final'
|
|
||||||
compileOnly 'com.mojang:authlib:1.5.25'
|
|
||||||
compileOnly 'com.mojang:brigadier:1.0.18'
|
|
||||||
|
|
||||||
compileOnly swdep('Spigot-1.18')
|
|
||||||
compileOnly swdep('WorldEdit-1.15')
|
|
||||||
compileOnly swdep('SpigotCore')
|
|
||||||
}
|
|
@ -1,145 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of the SteamWar software.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2022 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.bausystem.utils;
|
|
||||||
|
|
||||||
import com.comphenix.tinyprotocol.Reflection;
|
|
||||||
import com.comphenix.tinyprotocol.TinyProtocol;
|
|
||||||
import de.steamwar.bausystem.features.util.NoClipCommand;
|
|
||||||
import net.minecraft.SystemUtils;
|
|
||||||
import net.minecraft.nbt.NBTBase;
|
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
|
||||||
import net.minecraft.nbt.NBTTagList;
|
|
||||||
import net.minecraft.network.protocol.Packet;
|
|
||||||
import net.minecraft.network.protocol.game.*;
|
|
||||||
import net.minecraft.server.level.PlayerInteractManager;
|
|
||||||
import net.minecraft.world.level.EnumGamemode;
|
|
||||||
import net.minecraft.world.phys.Vec3D;
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.GameMode;
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.World;
|
|
||||||
import org.bukkit.craftbukkit.v1_18_R2.entity.CraftEntity;
|
|
||||||
import org.bukkit.craftbukkit.v1_18_R2.entity.CraftPlayer;
|
|
||||||
import org.bukkit.craftbukkit.v1_18_R2.inventory.CraftItemStack;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.entity.TNTPrimed;
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.function.LongSupplier;
|
|
||||||
|
|
||||||
public class NMSWrapper18 implements NMSWrapper {
|
|
||||||
|
|
||||||
private static final Reflection.FieldAccessor<EnumGamemode> playerGameMode = Reflection.getField(PlayerInteractManager.class, EnumGamemode.class, 0);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
public void setInternalGameMode(Player player, GameMode gameMode) {
|
|
||||||
playerGameMode.set(((CraftPlayer) player).getHandle().d, EnumGamemode.a(gameMode.getValue()));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setSlotToItemStack(Player player, Object o) {
|
|
||||||
PacketPlayInSetCreativeSlot packetPlayInSetCreativeSlot = (PacketPlayInSetCreativeSlot) o;
|
|
||||||
int index = packetPlayInSetCreativeSlot.b();
|
|
||||||
if (index >= 36 && index <= 44) {
|
|
||||||
index -= 36;
|
|
||||||
} else if (index > 44) {
|
|
||||||
index -= 5;
|
|
||||||
} else if (index <= 8) {
|
|
||||||
index = index - 8 + 36;
|
|
||||||
}
|
|
||||||
player.getInventory().setItem(index, CraftItemStack.asBukkitCopy(packetPlayInSetCreativeSlot.c()));
|
|
||||||
if (index < 9) player.getInventory().setHeldItemSlot(index);
|
|
||||||
player.updateInventory();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static final Reflection.FieldAccessor<PacketPlayOutGameStateChange.a> gameStateChangeReason = Reflection.getField(NoClipCommand.gameStateChange, PacketPlayOutGameStateChange.a.class, 12);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setGameStateChangeReason(Object packet) {
|
|
||||||
gameStateChangeReason.set(packet, PacketPlayOutGameStateChange.d);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setPlayerBuildAbilities(Player player) {
|
|
||||||
((CraftPlayer) player).getHandle().fs().d = true;
|
|
||||||
((CraftPlayer) player).getHandle().fs().e = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Material pathMaterial() {
|
|
||||||
return Material.DIRT_PATH;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static final int threshold = 2048;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean checkItemStack(ItemStack item) {
|
|
||||||
net.minecraft.world.item.ItemStack nmsItem = CraftItemStack.asNMSCopy(item);
|
|
||||||
NBTTagCompound tag = nmsItem.t();
|
|
||||||
if (tag != null && tag.e("BlockEntityTag")) {
|
|
||||||
NBTTagCompound blockTag = tag.p("BlockEntityTag");
|
|
||||||
if (blockTag.e("Items")) {
|
|
||||||
return drillDown(blockTag.c("Items", 10), 0, 0) > threshold;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private int drillDown(NBTTagList items, int layer, int start) {
|
|
||||||
if (layer > 2) return start + threshold;
|
|
||||||
int invalid = start;
|
|
||||||
for (NBTBase nbtBase : items) {
|
|
||||||
if (!(nbtBase instanceof NBTTagCompound))
|
|
||||||
continue;
|
|
||||||
NBTTagCompound slot = (NBTTagCompound) nbtBase;
|
|
||||||
if (slot.e("tag")) {
|
|
||||||
invalid += slot.f("Count");
|
|
||||||
NBTTagCompound iTag = slot.p("tag");
|
|
||||||
if (iTag.e("BlockEntityTag")) {
|
|
||||||
NBTTagCompound blockTag = iTag.p("BlockEntityTag");
|
|
||||||
if (blockTag.e("Items")) {
|
|
||||||
invalid = drillDown(blockTag.c("Items", 10), layer + 1, invalid);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (invalid > threshold)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return invalid;
|
|
||||||
}
|
|
||||||
|
|
||||||
private final Class<?> explosionPacket = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutExplosion");
|
|
||||||
private final Reflection.FieldAccessor<Double> a = Reflection.getField(explosionPacket, double.class, 0);
|
|
||||||
private final Reflection.FieldAccessor<Double> b = Reflection.getField(explosionPacket, double.class, 1);
|
|
||||||
private final Reflection.FieldAccessor<Double> c = Reflection.getField(explosionPacket, double.class, 2);
|
|
||||||
private final Reflection.FieldAccessor<Float> d = Reflection.getField(explosionPacket, float.class, 0);
|
|
||||||
private final Reflection.FieldAccessor<List> e = Reflection.getField(explosionPacket, List.class, 0);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Object resetExplosionKnockback(Object packet) {
|
|
||||||
PacketPlayOutExplosion packetPlayOutExplosion = (PacketPlayOutExplosion) packet;
|
|
||||||
return new PacketPlayOutExplosion(a.get(packetPlayOutExplosion), b.get(packetPlayOutExplosion), c.get(packetPlayOutExplosion), d.get(packetPlayOutExplosion), e.get(packetPlayOutExplosion), null);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,57 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of the SteamWar software.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2022 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.bausystem.utils;
|
|
||||||
|
|
||||||
import com.comphenix.tinyprotocol.Reflection;
|
|
||||||
import de.steamwar.bausystem.utils.PlayerMovementWrapper;
|
|
||||||
import net.minecraft.network.protocol.game.PacketPlayInFlying;
|
|
||||||
import net.minecraft.server.level.EntityPlayer;
|
|
||||||
import org.bukkit.craftbukkit.v1_18_R2.entity.CraftPlayer;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
public class PlayerMovementWrapper18 implements PlayerMovementWrapper {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setPosition(Player player, Object object) {
|
|
||||||
PacketPlayInFlying packetPlayInFlying = ((PacketPlayInFlying) object);
|
|
||||||
EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
|
|
||||||
if (packetPlayInFlying.h) {
|
|
||||||
entityPlayer.b(packetPlayInFlying.a, packetPlayInFlying.b, packetPlayInFlying.c, packetPlayInFlying.d, packetPlayInFlying.e);
|
|
||||||
} else {
|
|
||||||
entityPlayer.e(packetPlayInFlying.a, packetPlayInFlying.b, packetPlayInFlying.c);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Object convertToOut(Player player, Object object) {
|
|
||||||
PacketPlayInFlying packetPlayInFlying = ((PacketPlayInFlying) object);
|
|
||||||
Object packet = Reflection.newInstance(teleportPacket);
|
|
||||||
teleportEntity.set(packet, player.getEntityId());
|
|
||||||
teleportPosition.set(packet, packetPlayInFlying.a, packetPlayInFlying.b, packetPlayInFlying.c);
|
|
||||||
if (packetPlayInFlying.h) {
|
|
||||||
teleportYaw.set(packet, rotToByte(player.getLocation().getYaw()));
|
|
||||||
teleportPitch.set(packet, rotToByte(player.getLocation().getPitch()));
|
|
||||||
} else {
|
|
||||||
teleportYaw.set(packet, rotToByte(packetPlayInFlying.d));
|
|
||||||
teleportPitch.set(packet, rotToByte(packetPlayInFlying.e));
|
|
||||||
}
|
|
||||||
return packet;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,64 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of the SteamWar software.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2020 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/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
plugins {
|
|
||||||
id 'base'
|
|
||||||
id 'java'
|
|
||||||
}
|
|
||||||
|
|
||||||
group 'steamwar'
|
|
||||||
version '1.0'
|
|
||||||
|
|
||||||
compileJava.options.encoding = 'UTF-8'
|
|
||||||
|
|
||||||
sourceCompatibility = 17
|
|
||||||
targetCompatibility = 17
|
|
||||||
|
|
||||||
sourceSets {
|
|
||||||
main {
|
|
||||||
java {
|
|
||||||
srcDirs = ['src/']
|
|
||||||
}
|
|
||||||
resources {
|
|
||||||
srcDirs = ['src/']
|
|
||||||
exclude '**/*.java', '**/*.kt'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
compileOnly 'org.projectlombok:lombok:1.18.22'
|
|
||||||
testCompileOnly 'org.projectlombok:lombok:1.18.22'
|
|
||||||
annotationProcessor 'org.projectlombok:lombok:1.18.22'
|
|
||||||
testAnnotationProcessor 'org.projectlombok:lombok:1.18.22'
|
|
||||||
|
|
||||||
implementation project(":BauSystem_Main")
|
|
||||||
|
|
||||||
compileOnly 'org.spigotmc:spigot-api:1.19-R0.1-SNAPSHOT'
|
|
||||||
compileOnly 'io.papermc.paper:paper-api:1.19.2-R0.1-SNAPSHOT'
|
|
||||||
compileOnly 'it.unimi.dsi:fastutil:8.5.6'
|
|
||||||
compileOnly 'com.mojang:datafixerupper:4.0.26'
|
|
||||||
compileOnly 'io.netty:netty-all:4.1.68.Final'
|
|
||||||
compileOnly 'com.mojang:authlib:1.5.25'
|
|
||||||
compileOnly 'com.mojang:brigadier:1.0.18'
|
|
||||||
|
|
||||||
compileOnly swdep('Spigot-1.19')
|
|
||||||
compileOnly swdep('WorldEdit-1.15')
|
|
||||||
compileOnly swdep('SpigotCore')
|
|
||||||
}
|
|
@ -1,145 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of the SteamWar software.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2022 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.bausystem.utils;
|
|
||||||
|
|
||||||
import com.comphenix.tinyprotocol.Reflection;
|
|
||||||
import com.comphenix.tinyprotocol.TinyProtocol;
|
|
||||||
import de.steamwar.bausystem.features.util.NoClipCommand;
|
|
||||||
import net.minecraft.SystemUtils;
|
|
||||||
import net.minecraft.nbt.NBTBase;
|
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
|
||||||
import net.minecraft.nbt.NBTTagList;
|
|
||||||
import net.minecraft.network.protocol.Packet;
|
|
||||||
import net.minecraft.network.protocol.game.*;
|
|
||||||
import net.minecraft.network.syncher.DataWatcher;
|
|
||||||
import net.minecraft.server.level.PlayerInteractManager;
|
|
||||||
import net.minecraft.world.level.EnumGamemode;
|
|
||||||
import net.minecraft.world.phys.Vec3D;
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.GameMode;
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.World;
|
|
||||||
import org.bukkit.craftbukkit.v1_19_R2.entity.CraftEntity;
|
|
||||||
import org.bukkit.craftbukkit.v1_19_R2.entity.CraftPlayer;
|
|
||||||
import org.bukkit.craftbukkit.v1_19_R2.inventory.CraftItemStack;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.entity.TNTPrimed;
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.function.LongSupplier;
|
|
||||||
|
|
||||||
public class NMSWrapper19 implements NMSWrapper {
|
|
||||||
|
|
||||||
private static final Reflection.FieldAccessor<EnumGamemode> playerGameMode = Reflection.getField(PlayerInteractManager.class, EnumGamemode.class, 0);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
public void setInternalGameMode(Player player, GameMode gameMode) {
|
|
||||||
playerGameMode.set(((CraftPlayer) player).getHandle().d, EnumGamemode.a(gameMode.getValue()));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setSlotToItemStack(Player player, Object o) {
|
|
||||||
PacketPlayInSetCreativeSlot packetPlayInSetCreativeSlot = (PacketPlayInSetCreativeSlot) o;
|
|
||||||
int index = packetPlayInSetCreativeSlot.b();
|
|
||||||
if (index >= 36 && index <= 44) {
|
|
||||||
index -= 36;
|
|
||||||
} else if (index > 44) {
|
|
||||||
index -= 5;
|
|
||||||
} else if (index <= 8) {
|
|
||||||
index = index - 8 + 36;
|
|
||||||
}
|
|
||||||
player.getInventory().setItem(index, CraftItemStack.asBukkitCopy(packetPlayInSetCreativeSlot.c()));
|
|
||||||
if (index < 9) player.getInventory().setHeldItemSlot(index);
|
|
||||||
player.updateInventory();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static final Reflection.FieldAccessor<PacketPlayOutGameStateChange.a> gameStateChangeReason = Reflection.getField(NoClipCommand.gameStateChange, PacketPlayOutGameStateChange.a.class, 12);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setGameStateChangeReason(Object packet) {
|
|
||||||
gameStateChangeReason.set(packet, PacketPlayOutGameStateChange.d);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setPlayerBuildAbilities(Player player) {
|
|
||||||
((CraftPlayer) player).getHandle().fF().d = true;
|
|
||||||
((CraftPlayer) player).getHandle().fF().e = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Material pathMaterial() {
|
|
||||||
return Material.DIRT_PATH;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static final int threshold = 2048;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean checkItemStack(ItemStack item) {
|
|
||||||
net.minecraft.world.item.ItemStack nmsItem = CraftItemStack.asNMSCopy(item);
|
|
||||||
NBTTagCompound tag = nmsItem.v();
|
|
||||||
if (tag != null && tag.e("BlockEntityTag")) {
|
|
||||||
NBTTagCompound blockTag = tag.p("BlockEntityTag");
|
|
||||||
if (blockTag.e("Items")) {
|
|
||||||
return drillDown(blockTag.c("Items", 10), 0, 0) > threshold;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private int drillDown(NBTTagList items, int layer, int start) {
|
|
||||||
if (layer > 2) return start + threshold;
|
|
||||||
int invalid = start;
|
|
||||||
for (NBTBase nbtBase : items) {
|
|
||||||
if (!(nbtBase instanceof NBTTagCompound))
|
|
||||||
continue;
|
|
||||||
NBTTagCompound slot = (NBTTagCompound) nbtBase;
|
|
||||||
if (slot.e("tag")) {
|
|
||||||
invalid += slot.f("Count");
|
|
||||||
NBTTagCompound iTag = slot.p("tag");
|
|
||||||
if (iTag.e("BlockEntityTag")) {
|
|
||||||
NBTTagCompound blockTag = iTag.p("BlockEntityTag");
|
|
||||||
if (blockTag.e("Items")) {
|
|
||||||
invalid = drillDown(blockTag.c("Items", 10), layer + 1, invalid);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (invalid > threshold)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return invalid;
|
|
||||||
}
|
|
||||||
|
|
||||||
private final Class<?> explosionPacket = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutExplosion");
|
|
||||||
private final Reflection.FieldAccessor<Double> a = Reflection.getField(explosionPacket, double.class, 0);
|
|
||||||
private final Reflection.FieldAccessor<Double> b = Reflection.getField(explosionPacket, double.class, 1);
|
|
||||||
private final Reflection.FieldAccessor<Double> c = Reflection.getField(explosionPacket, double.class, 2);
|
|
||||||
private final Reflection.FieldAccessor<Float> d = Reflection.getField(explosionPacket, float.class, 0);
|
|
||||||
private final Reflection.FieldAccessor<List> e = Reflection.getField(explosionPacket, List.class, 0);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Object resetExplosionKnockback(Object packet) {
|
|
||||||
PacketPlayOutExplosion packetPlayOutExplosion = (PacketPlayOutExplosion) packet;
|
|
||||||
return new PacketPlayOutExplosion(a.get(packetPlayOutExplosion), b.get(packetPlayOutExplosion), c.get(packetPlayOutExplosion), d.get(packetPlayOutExplosion), e.get(packetPlayOutExplosion), null);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,61 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of the SteamWar software.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2022 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.bausystem.utils;
|
|
||||||
|
|
||||||
import com.comphenix.tinyprotocol.Reflection;
|
|
||||||
import net.minecraft.network.protocol.game.PacketPlayInFlying;
|
|
||||||
import net.minecraft.server.level.EntityPlayer;
|
|
||||||
import org.bukkit.Location;
|
|
||||||
import org.bukkit.craftbukkit.v1_19_R2.entity.CraftPlayer;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
public class PlayerMovementWrapper19 implements PlayerMovementWrapper {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setPosition(Player player, Object object) {
|
|
||||||
PacketPlayInFlying packetPlayInFlying = ((PacketPlayInFlying) object);
|
|
||||||
EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
|
|
||||||
if (packetPlayInFlying.h) {
|
|
||||||
entityPlayer.b(packetPlayInFlying.a, packetPlayInFlying.b, packetPlayInFlying.c, packetPlayInFlying.d, packetPlayInFlying.e);
|
|
||||||
} else {
|
|
||||||
entityPlayer.e(packetPlayInFlying.a, packetPlayInFlying.b, packetPlayInFlying.c);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Object convertToOut(Player player, Object object) {
|
|
||||||
PacketPlayInFlying packetPlayInFlying = ((PacketPlayInFlying) object);
|
|
||||||
Object packet = Reflection.newInstance(teleportPacket);
|
|
||||||
teleportEntity.set(packet, player.getEntityId());
|
|
||||||
teleportPosition.set(packet, packetPlayInFlying.a, packetPlayInFlying.b, packetPlayInFlying.c);
|
|
||||||
if (packetPlayInFlying.h) {
|
|
||||||
teleportYaw.set(packet, rotToByte(player.getLocation().getYaw()));
|
|
||||||
teleportPitch.set(packet, rotToByte(player.getLocation().getPitch()));
|
|
||||||
} else {
|
|
||||||
teleportYaw.set(packet, rotToByte(packetPlayInFlying.d));
|
|
||||||
teleportPitch.set(packet, rotToByte(packetPlayInFlying.e));
|
|
||||||
}
|
|
||||||
return packet;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,51 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of the SteamWar software.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2023 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.bausystem.utils;
|
|
||||||
|
|
||||||
import com.destroystokyo.paper.event.server.ServerTickEndEvent;
|
|
||||||
import com.destroystokyo.paper.event.server.ServerTickStartEvent;
|
|
||||||
import de.steamwar.bausystem.BauSystem;
|
|
||||||
import de.steamwar.bausystem.features.tpslimit.TPSFreezeUtils;
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.event.EventHandler;
|
|
||||||
import org.bukkit.event.Listener;
|
|
||||||
|
|
||||||
public class TickListener19 implements TickListener, Listener {
|
|
||||||
|
|
||||||
private boolean tickStartRan = false;
|
|
||||||
|
|
||||||
public TickListener19() {
|
|
||||||
Bukkit.getPluginManager().registerEvents(this, BauSystem.getInstance());
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onServerTickStart(ServerTickStartEvent event) {
|
|
||||||
if (TPSFreezeUtils.isFrozen()) return;
|
|
||||||
Bukkit.getPluginManager().callEvent(new TickStartEvent());
|
|
||||||
tickStartRan = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onServerTickEnd(ServerTickEndEvent event) {
|
|
||||||
if (!tickStartRan) return;
|
|
||||||
Bukkit.getPluginManager().callEvent(new TickEndEvent());
|
|
||||||
tickStartRan = false;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,62 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of the SteamWar software.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2020 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/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
plugins {
|
|
||||||
id 'base'
|
|
||||||
id 'java'
|
|
||||||
}
|
|
||||||
|
|
||||||
group 'steamwar'
|
|
||||||
version '1.0'
|
|
||||||
|
|
||||||
compileJava.options.encoding = 'UTF-8'
|
|
||||||
|
|
||||||
sourceCompatibility = 17
|
|
||||||
targetCompatibility = 17
|
|
||||||
|
|
||||||
sourceSets {
|
|
||||||
main {
|
|
||||||
java {
|
|
||||||
srcDirs = ['src/']
|
|
||||||
}
|
|
||||||
resources {
|
|
||||||
srcDirs = ['src/']
|
|
||||||
exclude '**/*.java', '**/*.kt'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
compileOnly 'org.projectlombok:lombok:1.18.22'
|
|
||||||
testCompileOnly 'org.projectlombok:lombok:1.18.22'
|
|
||||||
annotationProcessor 'org.projectlombok:lombok:1.18.22'
|
|
||||||
testAnnotationProcessor 'org.projectlombok:lombok:1.18.22'
|
|
||||||
|
|
||||||
implementation project(":BauSystem_Main")
|
|
||||||
|
|
||||||
compileOnly 'org.spigotmc:spigot-api:1.20-R0.1-SNAPSHOT'
|
|
||||||
compileOnly 'it.unimi.dsi:fastutil:8.5.6'
|
|
||||||
compileOnly 'com.mojang:datafixerupper:4.0.26'
|
|
||||||
compileOnly 'io.netty:netty-all:4.1.68.Final'
|
|
||||||
compileOnly 'com.mojang:authlib:1.5.25'
|
|
||||||
compileOnly 'com.mojang:brigadier:1.0.18'
|
|
||||||
|
|
||||||
compileOnly swdep('Spigot-1.20')
|
|
||||||
compileOnly swdep('SpigotCore')
|
|
||||||
}
|
|
@ -1,136 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of the SteamWar software.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2022 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.bausystem.utils;
|
|
||||||
|
|
||||||
import com.comphenix.tinyprotocol.Reflection;
|
|
||||||
import de.steamwar.bausystem.features.util.NoClipCommand;
|
|
||||||
import net.minecraft.nbt.NBTBase;
|
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
|
||||||
import net.minecraft.nbt.NBTTagList;
|
|
||||||
import net.minecraft.network.protocol.game.PacketPlayInSetCreativeSlot;
|
|
||||||
import net.minecraft.network.protocol.game.PacketPlayOutExplosion;
|
|
||||||
import net.minecraft.network.protocol.game.PacketPlayOutGameStateChange;
|
|
||||||
import net.minecraft.server.level.PlayerInteractManager;
|
|
||||||
import net.minecraft.world.level.EnumGamemode;
|
|
||||||
import org.bukkit.GameMode;
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftPlayer;
|
|
||||||
import org.bukkit.craftbukkit.v1_20_R1.inventory.CraftItemStack;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class NMSWrapper20 implements NMSWrapper {
|
|
||||||
|
|
||||||
private static final Reflection.FieldAccessor<EnumGamemode> playerGameMode = Reflection.getField(PlayerInteractManager.class, EnumGamemode.class, 0);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
public void setInternalGameMode(Player player, GameMode gameMode) {
|
|
||||||
playerGameMode.set(((CraftPlayer) player).getHandle().e, EnumGamemode.a(gameMode.getValue()));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setSlotToItemStack(Player player, Object o) {
|
|
||||||
PacketPlayInSetCreativeSlot packetPlayInSetCreativeSlot = (PacketPlayInSetCreativeSlot) o;
|
|
||||||
int index = packetPlayInSetCreativeSlot.a();
|
|
||||||
if (index >= 36 && index <= 44) {
|
|
||||||
index -= 36;
|
|
||||||
} else if (index > 44) {
|
|
||||||
index -= 5;
|
|
||||||
} else if (index <= 8) {
|
|
||||||
index = index - 8 + 36;
|
|
||||||
}
|
|
||||||
player.getInventory().setItem(index, CraftItemStack.asBukkitCopy(packetPlayInSetCreativeSlot.c()));
|
|
||||||
if (index < 9) player.getInventory().setHeldItemSlot(index);
|
|
||||||
player.updateInventory();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static final Reflection.FieldAccessor<PacketPlayOutGameStateChange.a> gameStateChangeReason = Reflection.getField(NoClipCommand.gameStateChange, PacketPlayOutGameStateChange.a.class, 12);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setGameStateChangeReason(Object packet) {
|
|
||||||
gameStateChangeReason.set(packet, PacketPlayOutGameStateChange.d);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setPlayerBuildAbilities(Player player) {
|
|
||||||
((CraftPlayer) player).getHandle().fO().d = true;
|
|
||||||
((CraftPlayer) player).getHandle().fO().e = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Material pathMaterial() {
|
|
||||||
return Material.DIRT_PATH;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static final int threshold = 2048;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean checkItemStack(ItemStack item) {
|
|
||||||
net.minecraft.world.item.ItemStack nmsItem = CraftItemStack.asNMSCopy(item);
|
|
||||||
NBTTagCompound tag = nmsItem.v();
|
|
||||||
if (tag != null && tag.e("BlockEntityTag")) {
|
|
||||||
NBTTagCompound blockTag = tag.p("BlockEntityTag");
|
|
||||||
if (blockTag.e("Items")) {
|
|
||||||
return drillDown(blockTag.c("Items", 10), 0, 0) > threshold;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private int drillDown(NBTTagList items, int layer, int start) {
|
|
||||||
if (layer > 2) return start + threshold;
|
|
||||||
int invalid = start;
|
|
||||||
for (NBTBase nbtBase : items) {
|
|
||||||
if (!(nbtBase instanceof NBTTagCompound))
|
|
||||||
continue;
|
|
||||||
NBTTagCompound slot = (NBTTagCompound) nbtBase;
|
|
||||||
if (slot.e("tag")) {
|
|
||||||
invalid += slot.f("Count");
|
|
||||||
NBTTagCompound iTag = slot.p("tag");
|
|
||||||
if (iTag.e("BlockEntityTag")) {
|
|
||||||
NBTTagCompound blockTag = iTag.p("BlockEntityTag");
|
|
||||||
if (blockTag.e("Items")) {
|
|
||||||
invalid = drillDown(blockTag.c("Items", 10), layer + 1, invalid);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (invalid > threshold)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return invalid;
|
|
||||||
}
|
|
||||||
|
|
||||||
private final Class<?> explosionPacket = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutExplosion");
|
|
||||||
private final Reflection.FieldAccessor<Double> a = Reflection.getField(explosionPacket, double.class, 0);
|
|
||||||
private final Reflection.FieldAccessor<Double> b = Reflection.getField(explosionPacket, double.class, 1);
|
|
||||||
private final Reflection.FieldAccessor<Double> c = Reflection.getField(explosionPacket, double.class, 2);
|
|
||||||
private final Reflection.FieldAccessor<Float> d = Reflection.getField(explosionPacket, float.class, 0);
|
|
||||||
private final Reflection.FieldAccessor<List> e = Reflection.getField(explosionPacket, List.class, 0);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Object resetExplosionKnockback(Object packet) {
|
|
||||||
PacketPlayOutExplosion packetPlayOutExplosion = (PacketPlayOutExplosion) packet;
|
|
||||||
return new PacketPlayOutExplosion(a.get(packetPlayOutExplosion), b.get(packetPlayOutExplosion), c.get(packetPlayOutExplosion), d.get(packetPlayOutExplosion), e.get(packetPlayOutExplosion), null);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,43 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of the SteamWar software.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2023 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.bausystem.utils;
|
|
||||||
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.block.data.BlockData;
|
|
||||||
|
|
||||||
public class PlaceItemWrapper20 implements PlaceItemWrapper {
|
|
||||||
|
|
||||||
public PlaceItemWrapper20() {
|
|
||||||
for (Material material : Material.values()) {
|
|
||||||
if (!material.isBlock()) continue;
|
|
||||||
if (material.isLegacy()) continue;
|
|
||||||
BlockData blockData = material.createBlockData();
|
|
||||||
Material placementMaterial = blockData.getPlacementMaterial();
|
|
||||||
if (material == placementMaterial) continue;
|
|
||||||
if (placementMaterial == Material.AIR) continue;
|
|
||||||
if (placementMaterial.isItem() && !placementMaterial.isBlock()) {
|
|
||||||
ITEM_MATERIAL_TO_BLOCK_MATERIAL.put(placementMaterial, material);
|
|
||||||
}
|
|
||||||
if (material.name().contains("WALL")) {
|
|
||||||
BLOCK_MATERIAL_TO_WALL_BLOCK_MATERIAL.put(placementMaterial, material);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,62 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of the SteamWar software.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2022 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.bausystem.utils;
|
|
||||||
|
|
||||||
import com.comphenix.tinyprotocol.Reflection;
|
|
||||||
import net.minecraft.network.protocol.game.PacketPlayInFlying;
|
|
||||||
import net.minecraft.network.protocol.game.PacketPlayOutEntityTeleport;
|
|
||||||
import net.minecraft.server.level.EntityPlayer;
|
|
||||||
import org.bukkit.Location;
|
|
||||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftPlayer;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
public class PlayerMovementWrapper20 implements PlayerMovementWrapper {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setPosition(Player player, Object object) {
|
|
||||||
PacketPlayInFlying packetPlayInFlying = ((PacketPlayInFlying) object);
|
|
||||||
EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
|
|
||||||
if (packetPlayInFlying.h) {
|
|
||||||
entityPlayer.b(packetPlayInFlying.a, packetPlayInFlying.b, packetPlayInFlying.c, packetPlayInFlying.d, packetPlayInFlying.e);
|
|
||||||
} else {
|
|
||||||
entityPlayer.e(packetPlayInFlying.a, packetPlayInFlying.b, packetPlayInFlying.c);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Object convertToOut(Player player, Object object) {
|
|
||||||
PacketPlayInFlying packetPlayInFlying = ((PacketPlayInFlying) object);
|
|
||||||
Object packet = Reflection.newInstance(teleportPacket);
|
|
||||||
teleportEntity.set(packet, player.getEntityId());
|
|
||||||
teleportPosition.set(packet, packetPlayInFlying.a, packetPlayInFlying.b, packetPlayInFlying.c);
|
|
||||||
if (packetPlayInFlying.h) {
|
|
||||||
teleportYaw.set(packet, rotToByte(player.getLocation().getYaw()));
|
|
||||||
teleportPitch.set(packet, rotToByte(player.getLocation().getPitch()));
|
|
||||||
} else {
|
|
||||||
teleportYaw.set(packet, rotToByte(packetPlayInFlying.d));
|
|
||||||
teleportPitch.set(packet, rotToByte(packetPlayInFlying.e));
|
|
||||||
}
|
|
||||||
return packet;
|
|
||||||
}
|
|
||||||
}
|
|
@ -27,8 +27,8 @@ version '1.0'
|
|||||||
|
|
||||||
compileJava.options.encoding = 'UTF-8'
|
compileJava.options.encoding = 'UTF-8'
|
||||||
|
|
||||||
sourceCompatibility = 17
|
sourceCompatibility = 1.8
|
||||||
targetCompatibility = 17
|
targetCompatibility = 1.8
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
main {
|
main {
|
||||||
@ -43,5 +43,10 @@ sourceSets {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly swdep('SpigotCore')
|
compileOnly 'org.projectlombok:lombok:1.18.22'
|
||||||
|
testCompileOnly 'org.projectlombok:lombok:1.18.22'
|
||||||
|
annotationProcessor 'org.projectlombok:lombok:1.18.22'
|
||||||
|
testAnnotationProcessor 'org.projectlombok:lombok:1.18.22'
|
||||||
|
|
||||||
|
compileOnly files("${projectDir}/../lib/Spigot-1.15.jar")
|
||||||
}
|
}
|
20
BauSystem_API/settings.gradle
Normale Datei
20
BauSystem_API/settings.gradle
Normale Datei
@ -0,0 +1,20 @@
|
|||||||
|
/*
|
||||||
|
* This file is a part of the SteamWar software.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2020 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/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
rootProject.name = 'BauSystem_API'
|
@ -19,7 +19,6 @@
|
|||||||
|
|
||||||
package de.steamwar.bausystem;
|
package de.steamwar.bausystem;
|
||||||
|
|
||||||
import de.steamwar.inventory.SWItem;
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.experimental.UtilityClass;
|
import lombok.experimental.UtilityClass;
|
||||||
@ -30,7 +29,6 @@ import org.bukkit.Material;
|
|||||||
import org.bukkit.NamespacedKey;
|
import org.bukkit.NamespacedKey;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.ItemMeta;
|
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
@ -61,13 +59,6 @@ public class SWUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static SWItem setCustomModelData(SWItem item, int customModelData) {
|
|
||||||
ItemMeta itemMeta = item.getItemMeta();
|
|
||||||
itemMeta.setCustomModelData(customModelData);
|
|
||||||
item.setItemMeta(itemMeta);
|
|
||||||
return item;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void sendToActionbar(Player p, String message) {
|
public static void sendToActionbar(Player p, String message) {
|
||||||
p.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(message));
|
p.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(message));
|
||||||
}
|
}
|
@ -0,0 +1,35 @@
|
|||||||
|
/*
|
||||||
|
* This file is a part of the SteamWar software.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2021 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.bausystem.features.detonator;
|
||||||
|
|
||||||
|
import de.steamwar.bausystem.shared.AbstractEntity;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
public interface AbstractDetonatorEntity extends AbstractEntity {
|
||||||
|
|
||||||
|
void display(Player player);
|
||||||
|
|
||||||
|
boolean hide(Player player, boolean always);
|
||||||
|
|
||||||
|
int getId();
|
||||||
|
|
||||||
|
Entity getBukkitEntity();
|
||||||
|
}
|
@ -0,0 +1,38 @@
|
|||||||
|
/*
|
||||||
|
This file is a part of the SteamWar software.
|
||||||
|
|
||||||
|
Copyright (C) 2020 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.bausystem.features.simulator;
|
||||||
|
|
||||||
|
import de.steamwar.bausystem.shared.AbstractEntity;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
public interface AbstractSimulatorEntity extends AbstractEntity {
|
||||||
|
|
||||||
|
void display(Player player);
|
||||||
|
|
||||||
|
void setPosition(Vector position);
|
||||||
|
|
||||||
|
boolean hide(Player player, boolean always);
|
||||||
|
|
||||||
|
int getId();
|
||||||
|
|
||||||
|
Entity getBukkitEntity();
|
||||||
|
}
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of the SteamWar software.
|
* This file is a part of the SteamWar software.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2023 SteamWar.de-Serverteam
|
* Copyright (C) 2021 SteamWar.de-Serverteam
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Affero General Public License as published by
|
||||||
@ -17,15 +17,14 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.steamwar.bausystem.features.loader.elements;
|
package de.steamwar.bausystem.features.tracer;
|
||||||
|
|
||||||
import de.steamwar.inventory.SWItem;
|
import de.steamwar.bausystem.shared.AbstractEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import java.util.function.Consumer;
|
public interface AbstractTraceEntity extends AbstractEntity {
|
||||||
|
|
||||||
public interface LoaderElement {
|
void display(Player player, boolean exploded, int ticks);
|
||||||
SWItem menu(Player player);
|
|
||||||
void execute(Consumer<Long> delay);
|
boolean hide(Player player, boolean always);
|
||||||
void click(Player player, Runnable backAction);
|
|
||||||
}
|
}
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of the SteamWar software.
|
* This file is a part of the SteamWar software.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2023 SteamWar.de-Serverteam
|
* Copyright (C) 2021 SteamWar.de-Serverteam
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Affero General Public License as published by
|
||||||
@ -17,21 +17,16 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.steamwar.bausystem.utils;
|
package de.steamwar.bausystem.features.warp;
|
||||||
|
|
||||||
import de.steamwar.bausystem.region.Region;
|
import de.steamwar.bausystem.shared.AbstractEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
public interface ScoreboardElement {
|
public interface AbstractWarpEntity extends AbstractEntity {
|
||||||
ScoreboardGroup getGroup();
|
|
||||||
int order();
|
|
||||||
|
|
||||||
String get(Region region, Player p);
|
void display(Player player);
|
||||||
|
|
||||||
enum ScoreboardGroup {
|
void setName(String name);
|
||||||
HEADER,
|
|
||||||
REGION,
|
boolean hide(Player player);
|
||||||
OTHER,
|
|
||||||
FOOTER
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of the SteamWar software.
|
* This file is a part of the SteamWar software.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2022 SteamWar.de-Serverteam
|
* Copyright (C) 2021 SteamWar.de-Serverteam
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Affero General Public License as published by
|
||||||
@ -17,24 +17,54 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.steamwar.linkage.types;
|
package de.steamwar.bausystem.region;
|
||||||
|
|
||||||
import de.steamwar.linkage.LinkageType;
|
import lombok.AllArgsConstructor;
|
||||||
import de.steamwar.linkage.plan.BuildPlan;
|
import lombok.Builder;
|
||||||
import de.steamwar.linkage.plan.MethodBuilder;
|
import lombok.Getter;
|
||||||
|
|
||||||
import javax.lang.model.element.TypeElement;
|
@Getter
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class PasteOptions {
|
||||||
|
|
||||||
public class ConfigConverter_GENERIC implements LinkageType {
|
/**
|
||||||
|
* Used in 1.15
|
||||||
|
*/
|
||||||
|
private final boolean rotate;
|
||||||
|
|
||||||
@Override
|
/**
|
||||||
public String method() {
|
* Used in 1.15
|
||||||
return "link";
|
*/
|
||||||
}
|
private final boolean ignoreAir;
|
||||||
|
|
||||||
@Override
|
/**
|
||||||
public void generateCode(BuildPlan buildPlan, MethodBuilder methodBuilder, String s, TypeElement typeElement) {
|
* Used in 1.15
|
||||||
buildPlan.addImport("de.steamwar.bausystem.configplayer.Config");
|
*/
|
||||||
methodBuilder.addLine("Config.addConfigConverter(" + s + ");");
|
private final Color color;
|
||||||
}
|
|
||||||
|
/**
|
||||||
|
* Used in 1.15
|
||||||
|
*/
|
||||||
|
private final boolean onlyColors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used in 1.15
|
||||||
|
*/
|
||||||
|
private final boolean reset;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used in 1.15
|
||||||
|
*/
|
||||||
|
private final Point minPoint;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used in 1.15
|
||||||
|
*/
|
||||||
|
private final Point maxPoint;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used in 1.15
|
||||||
|
*/
|
||||||
|
private final int waterLevel;
|
||||||
}
|
}
|
@ -19,7 +19,6 @@
|
|||||||
|
|
||||||
package de.steamwar.bausystem.region;
|
package de.steamwar.bausystem.region;
|
||||||
|
|
||||||
import com.sk89q.worldedit.math.BlockVector3;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
@ -42,10 +41,6 @@ public class Point {
|
|||||||
return new Point(location.getBlockX(), location.getBlockY(), location.getBlockZ());
|
return new Point(location.getBlockX(), location.getBlockY(), location.getBlockZ());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Point fromBlockVector3(final BlockVector3 blockVector3) {
|
|
||||||
return new Point(blockVector3.getBlockX(), blockVector3.getBlockY(), blockVector3.getBlockZ());
|
|
||||||
}
|
|
||||||
|
|
||||||
public Point add(int x, int y, int z) {
|
public Point add(int x, int y, int z) {
|
||||||
return new Point(this.x + x, this.y + y, this.z + z);
|
return new Point(this.x + x, this.y + y, this.z + z);
|
||||||
}
|
}
|
||||||
@ -54,10 +49,6 @@ public class Point {
|
|||||||
return new Point(this.x - x, this.y - y, this.z - z);
|
return new Point(this.x - x, this.y - y, this.z - z);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Point divide(int factor) {
|
|
||||||
return new Point(x / factor, y / factor, z / factor);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Location toLocation(World world) {
|
public Location toLocation(World world) {
|
||||||
return new Location(world, x, y, z);
|
return new Location(world, x, y, z);
|
||||||
}
|
}
|
27
BauSystem_API/src/de/steamwar/bausystem/shared/AbstractEntity.java
Normale Datei
27
BauSystem_API/src/de/steamwar/bausystem/shared/AbstractEntity.java
Normale Datei
@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
* This file is a part of the SteamWar software.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2021 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.bausystem.shared;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
public interface AbstractEntity {
|
||||||
|
void sendEntity(Player player);
|
||||||
|
void sendEntityDestroy(Player player);
|
||||||
|
}
|
@ -1,40 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of the SteamWar software.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2022 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.linkage.types;
|
|
||||||
|
|
||||||
import de.steamwar.linkage.LinkageType;
|
|
||||||
import de.steamwar.linkage.plan.BuildPlan;
|
|
||||||
import de.steamwar.linkage.plan.MethodBuilder;
|
|
||||||
|
|
||||||
import javax.lang.model.element.TypeElement;
|
|
||||||
|
|
||||||
public class BauGuiItem_GENERIC implements LinkageType {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String method() {
|
|
||||||
return "linkGUIItems";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void generateCode(BuildPlan buildPlan, MethodBuilder methodBuilder, String s, TypeElement typeElement) {
|
|
||||||
buildPlan.addImport("de.steamwar.bausystem.features.gui.BauGUI");
|
|
||||||
methodBuilder.addLine("BauGUI.addItem(" + s + ");");
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,41 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of the SteamWar software.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2022 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.linkage.types;
|
|
||||||
|
|
||||||
import de.steamwar.linkage.LinkageType;
|
|
||||||
import de.steamwar.linkage.plan.BuildPlan;
|
|
||||||
import de.steamwar.linkage.plan.MethodBuilder;
|
|
||||||
|
|
||||||
import javax.lang.model.element.TypeElement;
|
|
||||||
|
|
||||||
public class FAWEMaskParser_GENERIC implements LinkageType {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String method() {
|
|
||||||
return "link";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void generateCode(BuildPlan buildPlan, MethodBuilder methodBuilder, String s, TypeElement typeElement) {
|
|
||||||
methodBuilder.addLine("if (org.bukkit.Bukkit.getPluginManager().getPlugin(\"FastAsyncWorldEdit\") != null) {");
|
|
||||||
methodBuilder.addLine(" " + s + ";");
|
|
||||||
methodBuilder.addLine("}");
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,41 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of the SteamWar software.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2022 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.linkage.types;
|
|
||||||
|
|
||||||
import de.steamwar.linkage.LinkageType;
|
|
||||||
import de.steamwar.linkage.plan.BuildPlan;
|
|
||||||
import de.steamwar.linkage.plan.MethodBuilder;
|
|
||||||
|
|
||||||
import javax.lang.model.element.TypeElement;
|
|
||||||
|
|
||||||
public class FAWEPatternParser_GENERIC implements LinkageType {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String method() {
|
|
||||||
return "link";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void generateCode(BuildPlan buildPlan, MethodBuilder methodBuilder, String s, TypeElement typeElement) {
|
|
||||||
methodBuilder.addLine("if (org.bukkit.Bukkit.getPluginManager().getPlugin(\"FastAsyncWorldEdit\") != null) {");
|
|
||||||
methodBuilder.addLine(" " + s + ";");
|
|
||||||
methodBuilder.addLine("}");
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,40 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of the SteamWar software.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2023 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.linkage.types;
|
|
||||||
|
|
||||||
import de.steamwar.linkage.LinkageType;
|
|
||||||
import de.steamwar.linkage.plan.BuildPlan;
|
|
||||||
import de.steamwar.linkage.plan.MethodBuilder;
|
|
||||||
|
|
||||||
import javax.lang.model.element.TypeElement;
|
|
||||||
|
|
||||||
public class LuaLib_GENERIC implements LinkageType {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String method() {
|
|
||||||
return "link";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void generateCode(BuildPlan buildPlan, MethodBuilder methodBuilder, String s, TypeElement typeElement) {
|
|
||||||
buildPlan.addImport("de.steamwar.bausystem.features.script.lua.SteamWarLuaPlugin");
|
|
||||||
methodBuilder.addLine("SteamWarLuaPlugin.add(" + s + ");");
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,40 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of the SteamWar software.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2022 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.linkage.types;
|
|
||||||
|
|
||||||
import de.steamwar.linkage.LinkageType;
|
|
||||||
import de.steamwar.linkage.plan.BuildPlan;
|
|
||||||
import de.steamwar.linkage.plan.MethodBuilder;
|
|
||||||
|
|
||||||
import javax.lang.model.element.TypeElement;
|
|
||||||
|
|
||||||
public class PanzernAlgorithm_GENERIC implements LinkageType {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String method() {
|
|
||||||
return "linkPanzern";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void generateCode(BuildPlan buildPlan, MethodBuilder methodBuilder, String s, TypeElement typeElement) {
|
|
||||||
buildPlan.addImport("de.steamwar.bausystem.features.slaves.panzern.Panzern");
|
|
||||||
methodBuilder.addLine("Panzern.add(" + s + ");");
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,40 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of the SteamWar software.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2023 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.linkage.types;
|
|
||||||
|
|
||||||
import de.steamwar.linkage.LinkageType;
|
|
||||||
import de.steamwar.linkage.plan.BuildPlan;
|
|
||||||
import de.steamwar.linkage.plan.MethodBuilder;
|
|
||||||
|
|
||||||
import javax.lang.model.element.TypeElement;
|
|
||||||
|
|
||||||
public class ScoreboardElement_GENERIC implements LinkageType {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String method() {
|
|
||||||
return "link";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void generateCode(BuildPlan buildPlan, MethodBuilder methodBuilder, String s, TypeElement typeElement) {
|
|
||||||
buildPlan.addImport("de.steamwar.bausystem.features.world.BauScoreboard");
|
|
||||||
methodBuilder.addLine("BauScoreboard.addElement(" + s + ");");
|
|
||||||
}
|
|
||||||
}
|
|
@ -27,13 +27,13 @@ version '1.0'
|
|||||||
|
|
||||||
compileJava.options.encoding = 'UTF-8'
|
compileJava.options.encoding = 'UTF-8'
|
||||||
|
|
||||||
sourceCompatibility = 17
|
sourceCompatibility = 1.8
|
||||||
targetCompatibility = 17
|
targetCompatibility = 1.8
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
main {
|
main {
|
||||||
java {
|
java {
|
||||||
srcDirs = ['src/', 'build/generated/sources/annotationProcessor/java/main/']
|
srcDirs = ['src/']
|
||||||
}
|
}
|
||||||
resources {
|
resources {
|
||||||
srcDirs = ['src/']
|
srcDirs = ['src/']
|
||||||
@ -43,27 +43,23 @@ sourceSets {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
// implementation 'yoyosource:YAPION:0.25.3'
|
implementation project(":BauSystem_15")
|
||||||
implementation files("${projectDir}/../libs/YAPION-SNAPSHOT.jar")
|
implementation project(":BauSystem_API")
|
||||||
|
|
||||||
|
implementation 'yoyosource:YAPION:0.25.3'
|
||||||
|
// implementation files("${projectDir}/../lib/YAPION-SNAPSHOT.jar")
|
||||||
|
|
||||||
compileOnly 'org.projectlombok:lombok:1.18.22'
|
compileOnly 'org.projectlombok:lombok:1.18.22'
|
||||||
testCompileOnly 'org.projectlombok:lombok:1.18.22'
|
testCompileOnly 'org.projectlombok:lombok:1.18.22'
|
||||||
annotationProcessor 'org.projectlombok:lombok:1.18.22'
|
annotationProcessor 'org.projectlombok:lombok:1.18.22'
|
||||||
testAnnotationProcessor 'org.projectlombok:lombok:1.18.22'
|
testAnnotationProcessor 'org.projectlombok:lombok:1.18.22'
|
||||||
|
|
||||||
implementation project(":BauSystem_Linkage")
|
implementation 'org.atteo.classindex:classindex:3.11'
|
||||||
annotationProcessor project(":BauSystem_Linkage")
|
testImplementation 'org.atteo.classindex:classindex:3.11'
|
||||||
|
annotationProcessor 'org.atteo.classindex:classindex:3.11'
|
||||||
|
testAnnotationProcessor 'org.atteo.classindex:classindex:3.11'
|
||||||
|
|
||||||
compileOnly 'org.spigotmc:spigot-api:1.20-R0.1-SNAPSHOT'
|
compileOnly files("${projectDir}/../lib/Spigot-1.15.jar")
|
||||||
compileOnly 'com.mojang:authlib:1.5.25'
|
compileOnly files("${projectDir}/../lib/WorldEdit-1.15.jar")
|
||||||
compileOnly 'io.netty:netty-all:4.1.68.Final'
|
compileOnly files("${projectDir}/../lib/SpigotCore.jar")
|
||||||
|
|
||||||
compileOnly swdep('Spigot-1.20')
|
|
||||||
compileOnly swdep('SpigotCore')
|
|
||||||
annotationProcessor swdep('SpigotCore')
|
|
||||||
|
|
||||||
compileOnly swdep('FastAsyncWorldEdit-1.18')
|
|
||||||
compileOnly swdep('AxiomPaper')
|
|
||||||
|
|
||||||
implementation 'org.luaj:luaj-jse:3.0.1'
|
|
||||||
}
|
}
|
20
BauSystem_Main/settings.gradle
Normale Datei
20
BauSystem_Main/settings.gradle
Normale Datei
@ -0,0 +1,20 @@
|
|||||||
|
/*
|
||||||
|
* This file is a part of the SteamWar software.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2020 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/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
rootProject.name = 'BauSystem_Main'
|
Datei-Diff unterdrückt, da er zu groß ist
Diff laden
@ -1,955 +0,0 @@
|
|||||||
#
|
|
||||||
# This file is a part of the SteamWar software.
|
|
||||||
#
|
|
||||||
# Copyright (C) 2021 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/>.
|
|
||||||
#
|
|
||||||
PREFIX=§eBau§8System§8»
|
|
||||||
TIME=HH:mm:ss
|
|
||||||
DATE=........
|
|
||||||
COMMAND_HELP_HEAD=§7---=== (§e{0}§7) ===---
|
|
||||||
ONLY_SCHEMS=§cDu kannst hier keinen Ordner angeben
|
|
||||||
PAGE_LIST=§e Seite ({0}/{1}) »»
|
|
||||||
LIST_PREVIOUS_PAGE=§eVorherige Seite
|
|
||||||
LIST_NEXT_PAGE=§eNächste Seite
|
|
||||||
# Permission
|
|
||||||
NO_PERMISSION=Du darfst dies hier nicht nutzen
|
|
||||||
SPECTATOR=§fZuschauer
|
|
||||||
# Scoreboard
|
|
||||||
SCOREBOARD_TIME=Uhrzeit
|
|
||||||
SCOREBOARD_REGION=Region
|
|
||||||
SCOREBOARD_TRACE=Trace
|
|
||||||
SCOREBOARD_LOADER=Loader
|
|
||||||
SCOREBOARD_TPS=TPS
|
|
||||||
SCOREBOARD_TPS_FROZEN=§eEingefroren
|
|
||||||
SCOREBOARD_TRACE_TICKS=Ticks
|
|
||||||
SCOREBOARD_TECHHIDER=TechHider§8: §aAn
|
|
||||||
SCOREBOARD_XRAY=XRay§8: §aAn
|
|
||||||
SCOREBOARD_LOCK_TEAM=Bau Lock§8: §eTeam
|
|
||||||
SCOREBOARD_LOCK_TEAM_AND_SERVERTEAM=Bau Lock§8: §e(Server-) Team
|
|
||||||
SCOREBOARD_LOCK_SERVERTEAM=Bau Lock§8: §eServerteam
|
|
||||||
SCOREBOARD_LOCK_NOBODY=Bau Lock§8: §cNiemand
|
|
||||||
# Flags
|
|
||||||
FLAG_COLOR=Color
|
|
||||||
FLAG_TNT=TNT
|
|
||||||
FLAG_FIRE=Fire
|
|
||||||
FLAG_FREEZE=Freeze
|
|
||||||
FLAG_PROTECT=Protect
|
|
||||||
FLAG_ITEMS=Items
|
|
||||||
FLAG_FIRE_ALLOW=§can
|
|
||||||
FLAG_FIRE_DENY=§aaus
|
|
||||||
FLAG_FREEZE_ACTIVE=§aan
|
|
||||||
FLAG_FREEZE_INACTIVE=§caus
|
|
||||||
FLAG_PROTECT_ACTIVE=§aan
|
|
||||||
FLAG_PROTECT_INACTIVE=§caus
|
|
||||||
FLAG_TNT_ALLOW=§aan
|
|
||||||
FLAG_TNT_DENY=§caus
|
|
||||||
FLAG_TNT_ONLY_TB=§7Kein §eBaurahmen
|
|
||||||
FLAG_TNT_ONLY_BUILD=§7Kein §eTestblock
|
|
||||||
FLAG_ITEMS_ACTIVE=§aan
|
|
||||||
FLAG_ITEMS_INACTIVE=§caus
|
|
||||||
FLAG_COLOR_WHITE=§fWeiß
|
|
||||||
FLAG_COLOR_ORANGE=§6Orange
|
|
||||||
FLAG_COLOR_MAGENTA=§dMagenta
|
|
||||||
FLAG_COLOR_LIGHT_BLUE=§bHellblau
|
|
||||||
FLAG_COLOR_YELLOW=§eGelb
|
|
||||||
FLAG_COLOR_LIME=§aHellgrün
|
|
||||||
## This cannot be converted
|
|
||||||
FLAG_COLOR_PINK=§ePink
|
|
||||||
FLAG_COLOR_GRAY=§8Grau
|
|
||||||
FLAG_COLOR_LIGHT_GRAY=§7Hellgrau
|
|
||||||
FLAG_COLOR_CYAN=§3Cyan
|
|
||||||
FLAG_COLOR_PURPLE=§5Lila
|
|
||||||
FLAG_COLOR_BLUE=§1Blau
|
|
||||||
## This cannot be converted
|
|
||||||
FLAG_COLOR_BROWN=§eBraun
|
|
||||||
FLAG_COLOR_GREEN=§2Grün
|
|
||||||
FLAG_COLOR_RED=§cRot
|
|
||||||
FLAG_COLOR_BLACK=§0Schwarz
|
|
||||||
# Region
|
|
||||||
REGION_TYPE_NORMAL=Normal
|
|
||||||
REGION_TYPE_BUILD=Baubereich
|
|
||||||
REGION_TYPE_ONLY_TB=Testblock
|
|
||||||
# AttributesCopy
|
|
||||||
ATTRIBUTES_CANT_COPY=§cDu musst den Item Type in der Hand halten wo du auch drauf guckst.
|
|
||||||
ATTRIBUTES_NO_COPY=§cKeine Attribute kopiert.
|
|
||||||
ATTRIBUTES_COPIED=§eAttribute kopiert.
|
|
||||||
ATTRIBUTE_REMOVE_ALL=§eAlle Attribute entfernt.
|
|
||||||
ATTRIBUTE_REMOVE_SINGLE=§eAttribut §7{0}§e entfernt.
|
|
||||||
ATTRIBUTE_REMOVE_NOT_FOUND=§cAttribut nicht gefunden
|
|
||||||
# AutoStart
|
|
||||||
AUTOSTART_COMMAND_HELP=§8/§etimer §8- §7Legt den AutostartTimer ins Inventar
|
|
||||||
AUTOSTART_ITEM_NAME=§eAutostartTimer
|
|
||||||
AUTOSTART_ITEM_LORE=§eRechtsklick Block §8- §7Starte den Timer
|
|
||||||
AUTOSTART_MESSAGE_NO_REGION=§cDu befindest dich derzeit in keiner Region
|
|
||||||
AUTOSTART_MESSAGE_RESET=§eDer AutostartTimer wurde zurückgesetzt
|
|
||||||
AUTOSTART_MESSAGE_START=§eAutostartTimer gestartet
|
|
||||||
AUTOSTART_MESSAGE_RESULT1=§eZeit §7bis zur §eExplosion §7am Gegner§8:§e {0}§7 in game ticks
|
|
||||||
AUTOSTART_MESSAGE_RESULT2=§7Zeitdifferenz in §egame ticks §7bis {0} Sekunden§8:§e {1}
|
|
||||||
AUTOSTART_MESSAGE_RESULT3=§7Positiv, wenn zu wenig, negativ wenn zu viel
|
|
||||||
# Backup
|
|
||||||
BACKUP_HELP_CREATE=§8/§ebackup create §8- §7Erstelle ein Backup der Region
|
|
||||||
BACKUP_HELP_LOAD=§8/§ebackup load §8[§7BackupName§8] §8- §7 Lade ein Backup
|
|
||||||
BACKUP_HELP_LIST=§8/§ebackup list §8- §7Liste alle Backups der Region auf
|
|
||||||
BACKUP_HELP_GUI=§8/§ebackup gui §8- §7Öffne die Backups in einer GUI
|
|
||||||
BACKUP_REGION_NO_REGION=§cDu bist in keiner Region
|
|
||||||
BACKUP_CREATE_SUCCESS=§7Das Backup wurde erstellt
|
|
||||||
BACKUP_CREATE_FAILURE=§cDas Backup erstellen ist schiefgegangen
|
|
||||||
BACKUP_CREATE_NO_CHANGE=§7Die Region hat keine Veränderung
|
|
||||||
BACKUP_LIST_HEAD=§7---=== (§eBackup §7{0}§7) ===---
|
|
||||||
BACKUP_LIST_ENTRY=§7{0} §e[Laden]
|
|
||||||
BACKUP_LOAD_FAILURE=§cDas Backup laden ist schiefgegangen
|
|
||||||
BACKUP_LOAD=§7Backup geladen
|
|
||||||
BACKUP_INV_NAME=§eBackup
|
|
||||||
BACKUP_ITEM_NAME=§eBackup §7von §e{0}
|
|
||||||
BACKUP_LORE=§eKlicken zum Laden
|
|
||||||
# Bau
|
|
||||||
BAU_COMMAND_HELP_INFO=§8/§ebau info §8- §7Alias für §8/§ebauinfo
|
|
||||||
BAU_INFO_ITEM_NAME=§eBau-Management
|
|
||||||
## This is used in BauInfoBauGuiItem.java
|
|
||||||
BAU_INFO_ITEM_LORE_TNT=§7TNT§8: §e{0}
|
|
||||||
BAU_INFO_ITEM_LORE_FREEZE=§7Freeze§8: §e{0}
|
|
||||||
BAU_INFO_ITEM_LORE_DAMAGE=§7Damage§8: §e{0}
|
|
||||||
BAU_INFO_ITEM_LORE_FIRE=§7Feuer§8: §e{0}
|
|
||||||
BAU_INFO_ITEM_LORE_COLOR=§7Farbe§8: §e{0}
|
|
||||||
BAU_INFO_ITEM_LORE_PROTECT=§7Protect§8: §e{0}
|
|
||||||
BAU_INFO_COMMAND_HELP=§8/§ebauinfo §8- §7Gibt Informationen über den Bau
|
|
||||||
BAU_INFO_COMMAND_OWNER=§7Besitzer§8: §e{0}
|
|
||||||
BAU_INFO_COMMAND_MEMBER=§7{0} §8[§7{1}§8]§8: §e{2}
|
|
||||||
BAU_INFO_COMMAND_FLAG=§7{0}§8: §7{1}
|
|
||||||
BAU_INFO_COMMAND_TPS=§7TPS§8:§e
|
|
||||||
# Countingwand
|
|
||||||
COUNTINGWAND_COMMAND_HELP=§8/§ecountingwand §8- §7Gibt dir ein CountingWand
|
|
||||||
COUNTINGWAND_ITEM_NAME=§eZollstock
|
|
||||||
COUNTINGWAND_ITEM_LORE1=§eLinksklick §8- §7Setzt die 1. Position
|
|
||||||
COUNTINGWAND_ITEM_LORE2=§eRechtsklick §8- §7Setzt die 2. Position
|
|
||||||
COUNTINGWAND_MESSAGE_RCLICK=§7Erste Position bei: §8[§7{0}§8, §7{1}§8, §7{2}§8] ({3}§8) ({4}§8)
|
|
||||||
COUNTINGWAND_MESSAGE_LCLICK=§7Zweite Position bei: §8[§7{0}§8, §7{1}§8, §7{2}§8] ({3}§8) ({4}§8)
|
|
||||||
COUNTINGWAND_MESSAGE_VOLUME=§e{0}
|
|
||||||
COUNTINGWAND_MESSAGE_DIMENSION=§e{0}§8, §e{1}§8, §e{2}
|
|
||||||
# Design Endstone
|
|
||||||
DESIGN_ENDSTONE_COMMAND_HELP=§8/§edesign endstone §8- §7Zeige End Stone im Design
|
|
||||||
DESIGN_ENDSTONE_REGION_ERROR=§cDiese Region hat keinen Baubereich
|
|
||||||
DESIGN_ENDSTONE_ENABLE=§aEndstone im Design ist angezeigt
|
|
||||||
DESIGN_ENDSTONE_DISABLE=§cEndstone im Design ist versteckt
|
|
||||||
# Detonator
|
|
||||||
DETONATOR_LOC_REMOVE=§e{0} entfernt
|
|
||||||
DETONATOR_LOC_ADD=§e{0} hinzugefügt
|
|
||||||
DETONATOR_BUTTON_SWITCH=Hebel
|
|
||||||
DETONATOR_BUTTON_WOOD_BUTTON=Knopf
|
|
||||||
DETONATOR_BUTTON_STONE_BUTTON=Knopf
|
|
||||||
DETONATOR_BUTTON_PRESSURE_PLATE=Druckplatte
|
|
||||||
DETONATOR_BUTTON_WEIGHTED-PRESSURE_PLATE=Druckplatte
|
|
||||||
DETONATOR_BUTTON_TRIPWIRE=Tripwire
|
|
||||||
DETONATOR_BUTTON_NOTEBLOCK=Noteblock
|
|
||||||
DETONATOR_BUTTON_DAYLIGHTSENSOR=Tageslichtsensor
|
|
||||||
DETONATOR_BUTTON_POWERABLE=Aktivierbarer Block
|
|
||||||
DETONATOR_BUTTON_INVALID=Invalider
|
|
||||||
DETONATOR_WAND_NAME=§eFernzünder
|
|
||||||
DETONATOR_WAND_LORE_1=§eLinks Klick §8- §7Setzte einen Punkt zum Aktivieren
|
|
||||||
DETONATOR_WAND_LORE_2=§eLinks Klick + Shift §8- §eFüge einen Punkt hinzu
|
|
||||||
DETONATOR_WAND_LORE_3=§eRechts Klick §8- §eLöse alle Punkte aus
|
|
||||||
DETONATOR_HELP_WAND=§8/§edetonator wand §8-§7 Gibt den Fernzünder
|
|
||||||
DETONATOR_HELP_CLICK=§8/§edetonator click §8-§7 Aktiviere einen Fernzünder (Haupthand -> Hotbar -> Inventar)
|
|
||||||
DETONATOR_HELP_CLEAR=§8/§edetonator clear §8-§7 Cleare einen Fernzünder
|
|
||||||
DETONATOR_HELP_AUTOSTART=§8/§edetonator autostart §8-§7 Automatisch den Autostarttester Aktivieren
|
|
||||||
DETONATOR_AUTOSTART_ENABLE=§7Autostart beim detonate §aangeschaltet
|
|
||||||
DETONATOR_AUTOSTART_DISABLE=§7Autostart beim detonate §causgeschaltet
|
|
||||||
DETONATOR_POINT_ACT=§eEinen Punkt ausgelöst
|
|
||||||
DETONATOR_POINTS_ACT=§e{0} Punkte ausgelöst
|
|
||||||
DETONATOR_INVALID_POINT=§cEin Punkt konnte nicht ausgeführt werden
|
|
||||||
DETONATOR_INVALID_POINTS=§c{0} Punkte konnten nicht ausgeführt werden
|
|
||||||
DETONATOR_INVALID_BLOCK=§eDer Block konnte nicht hinzugefügt werden
|
|
||||||
# Hotbar
|
|
||||||
HOTBAR_HELP_GENERIC=§7Speichert eine Hotbar. Diese wird beim Joinen eines Bauserver, wo du ein Leeres Inventar hast geladen.
|
|
||||||
HOTBAR_HELP_SAVE=§8/§ehotbar save §8-§7 Speicher deine Aktuelle Hotbar
|
|
||||||
HOTBAR_HELP_LOAD=§8/§ehotbar load §8-§7 Lade deine Standard Hotbar
|
|
||||||
HOTBAR_HELP_SHOW=§8/§ehotbar show §8-§7 Zeigt dir deine Standard Hotbar
|
|
||||||
HOTBAR_SAVED=§7Deine Hotbar wurde als Standard gespeichert
|
|
||||||
HOTBAR_LOADED=§7Deine Standard Hotbar wurde geladen
|
|
||||||
HOTBAR_INVENTORY=Standard Hotbar
|
|
||||||
# GUI
|
|
||||||
GUI_EDITOR_ITEM_NAME=§eGui Editor
|
|
||||||
GUI_NAME=Bau GUI
|
|
||||||
GUI_ITEM_LORE1=§7Du kannst dieses Item zum Öffnen der BauGUI nutzen
|
|
||||||
GUI_ITEM_LORE2=§7oder Doppel F (Swap hands) drücken.
|
|
||||||
GUI_EDITOR_TITLE=Bau GUI Editor
|
|
||||||
GUI_EDITOR_ITEM_ROW_P=§e+1 Zeile
|
|
||||||
GUI_EDITOR_ITEM_ROW_M=§e-1 Zeile
|
|
||||||
GUI_EDITOR_ITEM_TRASH=§cTrashcan
|
|
||||||
GUI_EDITOR_ITEM_TRASH_LORE=§7Item hier rein Legen
|
|
||||||
GUI_EDITOR_ITEM_MORE=§eMehr Items
|
|
||||||
GUI_EDITOR_ITEM_CLOSE=§eSchließen
|
|
||||||
GUI_EDITOR_TITLE_MORE=Item auswählen
|
|
||||||
# Script
|
|
||||||
## CustomScript
|
|
||||||
SCRIPT_HOTKEY_ITEM_NAME=§7Hotkey§8: §e{0}
|
|
||||||
SCRIPT_EVENT_ITEM_NAME=§7Event§8: §e{0}
|
|
||||||
SCRIPT_COMMAND_ITEM_NAME=§7Befehl§8: §e/{0}
|
|
||||||
SCRIPT_ERROR_ONLY_IN_GLOBAL=§cDieses Skript kann nur als globales Skript ausgeführt werden
|
|
||||||
## Script Menu GUI
|
|
||||||
SCRIPT_MENU_GUI_ITEM_LORE_1=§7Klicke zum rausnehmen
|
|
||||||
SCRIPT_MENU_GUI_ITEM_LORE_2=§7Shiftklick zum kopieren
|
|
||||||
SCRIPT_MENU_GUI_ITEM_LORE_3=§7Rechtsklick zum editieren
|
|
||||||
SCRIPT_MENU_GUI_ITEM_LORE_4=§7Mittelklick zum anschauen
|
|
||||||
SCRIPT_MENU_GUI_NAME=§eSkript-Menü
|
|
||||||
SCRIPT_MENU_GUI_ITEM_ADD_NAME=§eHinzufügen
|
|
||||||
SCRIPT_MENU_GUI_ITEM_ADD_LORE=§7Klicke mit einem Buch zum hinzufügen
|
|
||||||
SCRIPT_DEPRECATED=§cDie Funktion §e{0}§c ist veraltet und wird demnächst entfernt. Bitte benutze §e{1}§c.
|
|
||||||
# Shield Printing
|
|
||||||
SHIELD_PRINTING_HELP_START=§8/§eshieldprinting start §8- §7Starte das Schild drucken
|
|
||||||
SHIELD_PRINTING_HELP_COPY=§8/§eshieldprinting copy §8- §7Kopiert die Schilder
|
|
||||||
SHIELD_PRINTING_HELP_APPLY=§8/§eshieldprinting apply §8- §7Wendet die Schilder an
|
|
||||||
SHIELD_PRINTING_HELP_STOP=§8/§eshieldprinting stop §8- §7Stoppt das Schild drucken
|
|
||||||
SHIELD_PRINTING_HELP_STEP_1=§81. §7Füge die Schematic in die Welt ein
|
|
||||||
SHIELD_PRINTING_HELP_STEP_2=§82. §7Starte das Schild drucken mit §8/§eshieldprinting start
|
|
||||||
SHIELD_PRINTING_HELP_STEP_3=§83. §7Warte bis alle Schilde ausgefahren sind
|
|
||||||
SHIELD_PRINTING_HELP_STEP_4=§84. §7Editiere die Schilde wenn nötig
|
|
||||||
SHIELD_PRINTING_HELP_STEP_5=§85. §7Kopiere das gedruckte mit §8/§eshieldprinting copy
|
|
||||||
SHIELD_PRINTING_HELP_STEP_6=§86. §7Füge die originale Schematic wieder ein
|
|
||||||
SHIELD_PRINTING_HELP_STEP_7=§87. §7Wende das gedruckte mit §8/§eshieldprinting apply§7 an
|
|
||||||
SHIELD_PRINTING_NO_REGION=§cDu bist in keiner Region.
|
|
||||||
SHIELD_PRINTING_NOT_RUNNING=§cShield printing ist nicht aktiv.
|
|
||||||
SHIELD_PRINTING_BOSSBAR=§fBewegungen: {0}
|
|
||||||
SHIELD_PRINTING_BOSSBAR_COPIED=§fBewegungen: {0} Kopiert: {1}
|
|
||||||
SHIELD_PRINTING_GUI_NAME=§7Schild Drucken
|
|
||||||
SHIELD_PRINTING_GUI_APPLY=§aAnwenden
|
|
||||||
SHIELD_PRINTING_GUI_STATE_PREVIOUS=§7R-Click§8: §7Vorherige
|
|
||||||
SHIELD_PRINTING_GUI_STATE_NEXT=§7L-Click§8: §7Nächste
|
|
||||||
SHIELD_PRINTING_GUI_STATE_ACTIVE=§e> §7{0}
|
|
||||||
SHIELD_PRINTING_GUI_STATE_INACTIVE=§8> §7{0}
|
|
||||||
SHIELD_PRINTING_GUI_STATE_FROM_ORIGINAL=Original
|
|
||||||
SHIELD_PRINTING_GUI_STATE_FROM_COPY=Kopie
|
|
||||||
SHIELD_PRINTING_GUI_STATE_ALWAYS_ON=An
|
|
||||||
SHIELD_PRINTING_GUI_STATE_ALWAYS_OFF=Aus
|
|
||||||
SHIELD_PRINTING_GUI_STATE_ALWAYS_OPEN=Offen
|
|
||||||
SHIELD_PRINTING_GUI_STATE_ALWAYS_CLOSED=Geschlossen
|
|
||||||
SHIELD_PRINTING_GUI_STATE_FENCE=§7{0} §fZaun Verbindungen
|
|
||||||
SHIELD_PRINTING_GUI_STATE_OPENABLE=§7{0} §fGeöffnet
|
|
||||||
SHIELD_PRINTING_GUI_STATE_PISTON=§7{0} §fAusgefahren
|
|
||||||
SHIELD_PRINTING_GUI_STATE_POWERABLE=§7{0} §fAktiviert
|
|
||||||
SHIELD_PRINTING_GUI_STATE_WALL=§7{0} §fWand Verbindungen
|
|
||||||
SHIELD_PRINTING_START=§aShield printing wurde gestartet.
|
|
||||||
SHIELD_PRINTING_COPY=§aSchilde wurden kopiert.
|
|
||||||
SHIELD_PRINTING_APPLY=§aSchilde wurden angewendet.
|
|
||||||
SHIELD_PRINTING_STOP=§aShield printing wurde gestoppt.
|
|
||||||
# Unsign Book
|
|
||||||
UNSIGN_HELP=§8/§eunsign §8- §7Mache ein Buch beschreibbar
|
|
||||||
# Simulator
|
|
||||||
SIMULATOR_HELP=§8/§esimulator §8-§7 Legt dir den Simulatorstab ins Inventar
|
|
||||||
SIMULATOR_CREATE_HELP=§8/§esimulator create §8[§7name§8] §8-§7 Erstelle einen neuen Simulator
|
|
||||||
SIMULATOR_CHANGE_HELP=§8/§esimulator change §8-§7 Wechsel zu einem anderen Simulator
|
|
||||||
SIMULATOR_DELETE_HELP=§8/§esimulator delete §8[§7name§8] §8-§7 Löscht den Simulator
|
|
||||||
SIMULATOR_START_HELP=§8/§esimulator start §8[§7name§8] §8-§7 Startet die Simulation
|
|
||||||
SIMULATOR_COPY_HELP=§8/§esimulator copy §8[§7to-copy§8] §8[§7name§8] §8-§7 Kopiert einen Simulator
|
|
||||||
SIMULATOR_GUI_ITEM_NAME=§eTNT Simulator
|
|
||||||
SIMULATOR_NO_SIM_IN_HAND=§cKein Simulator Item gewählt
|
|
||||||
SIMULATOR_GUI_SELECT_SIM=Simulator wählen
|
|
||||||
SIMULATOR_GUI_CREATE_SIM=§eSimulator erstellen
|
|
||||||
SIMULATOR_GUI_CREATE_SIM_GUI=Simulator erstellen
|
|
||||||
SIMULATOR_NAME_ALREADY_EXISTS=§cSimulator existiert bereits
|
|
||||||
SIMULATOR_NAME_INVALID=§cUngültiger Name
|
|
||||||
SIMULATOR_ERROR_COPY=§cFehler beim kopieren
|
|
||||||
SIMULATOR_NOT_EXISTS=§cSimulator existiert nicht
|
|
||||||
SIMULATOR_CREATE=§aSimulator erstellt
|
|
||||||
SIMULATOR_EDIT_LOCATION=§7Editiere Positionen
|
|
||||||
SIMULATOR_EDIT_PROPERTIES=§7Editiere Eigenschaften
|
|
||||||
SIMULATOR_EDIT_OTHER=§7Editiere Andere
|
|
||||||
SIMULATOR_EDIT_GROUP=§7Editiere Gruppe
|
|
||||||
SIMULATOR_EDIT_GROUP_MENU=§eEditiere Gruppe
|
|
||||||
SIMULATOR_WAND_NAME=§eKanonensimulator
|
|
||||||
SIMULATOR_WAND_NAME_SELECTED=§7Kanonensimulator §8- §e{0}
|
|
||||||
SIMULATOR_WAND_LORE_1=§eRechtsklick §8- §7Füge eine Position hinzu
|
|
||||||
SIMULATOR_WAND_LORE_2=§eSneaken §8- §7Freie Bewegung
|
|
||||||
SIMULATOR_WAND_LORE_3=§eLinksklick §8- §7Starte die Simulation
|
|
||||||
SIMULATOR_WAND_LORE_4=§eRechtsklick Luft §8- §7Öffne die GUI
|
|
||||||
SIMULATOR_WAND_LORE_5=§eDoppel Shift §8- §7Wechsel zwischen TNT und Redstone Block
|
|
||||||
SIMULATOR_REGION_FROZEN=§cSimulator kann nicht in eingefrorenen Regionen genutzt werden
|
|
||||||
## Other
|
|
||||||
SIMULATOR_PLUS_ONE=§7+1
|
|
||||||
SIMULATOR_PLUS_PIXEL_SHIFT=§eShift §7Click für §e+0,0625
|
|
||||||
SIMULATOR_PLUS_FIVE_SHIFT=§eShift §7Click für §e+5
|
|
||||||
SIMULATOR_MINUS_ONE=§7-1
|
|
||||||
SIMULATOR_MINUS_PIXEL_SHIFT=§eShift §7Click für §e-0,0625
|
|
||||||
SIMULATOR_MINUS_FIVE_SHIFT=§eShift §7Click für §e-5
|
|
||||||
SIMULATOR_POSITION_X=§7x-Position
|
|
||||||
SIMULATOR_POSITION_Y=§7y-Position
|
|
||||||
SIMULATOR_POSITION_Z=§7z-Position
|
|
||||||
SIMULATOR_BACK=§eZurück
|
|
||||||
SIMULATOR_GUI_TOTAL_TNT=§7Gesamt TNT§8: §e{0}
|
|
||||||
SIMULATOR_DELETED=§cSimulator gelöscht
|
|
||||||
## GUI
|
|
||||||
SIMULATOR_POSITION_EDIT=§ePosition bearbeiten
|
|
||||||
SIMULATOR_POSITION_ADD=§ePosition setzen
|
|
||||||
SIMULATOR_GUI_TNT_SPAWN_NAME=§eTNT
|
|
||||||
SIMULATOR_GUI_TNT_SPAWN_LORE_1=§7TNT-Anzahl§8: §e{0}
|
|
||||||
SIMULATOR_GUI_TNT_SPAWN_LORE_3=§7Lebensdauer§8: §e{0}
|
|
||||||
SIMULATOR_GUI_TNT_GROUP_NAME=§eTNT Gruppe
|
|
||||||
SIMULATOR_GUI_TNT_GROUP_LORE_1=§7Elementanzahl§8: §e{0}
|
|
||||||
SIMULATOR_GUI_TNT_DISABLED=§cDisabled
|
|
||||||
SIMULATOR_GUI_NAME=Kanonensimulator
|
|
||||||
SIMULATOR_GUI_DELETE=§cTNT löschen
|
|
||||||
SIMULATOR_GUI_AUTO_TRACE=§eAutoTrace§8: §7{0}
|
|
||||||
SIMULATOR_GUI_MOVE_ALL=§eAlle Verschieben
|
|
||||||
SIMULATOR_ALIGNMENT_CENTER=§7Verschiebung§8: §eMitte
|
|
||||||
SIMULATOR_ALIGNMENT_POSITIVE_X=§7Verschiebung§8: §ePositive X
|
|
||||||
SIMULATOR_ALIGNMENT_NEGATIVE_X=§7Verschiebung§8: §eNegative X
|
|
||||||
SIMULATOR_ALIGNMENT_POSITIVE_Z=§7Verschiebung§8: §ePositive Z
|
|
||||||
SIMULATOR_ALIGNMENT_NEGATIVE_Z=§7Verschiebung§8: §eNegative Z
|
|
||||||
SIMULATOR_MOVE_ALL_GUI_NAME=TNT Verschieben
|
|
||||||
SIMULATOR_TNT_SPAWN_GUI_NAME=TNT konfigurieren {0}
|
|
||||||
SIMULATOR_TNT_SPAWN_LORE=§eZum Ändern klicken
|
|
||||||
SIMULATOR_TNT_SPAWN_COUNT=§7TNT-Anzahl §8- §e{0}
|
|
||||||
SIMULATOR_TNT_SPAWN_COUNT_ANVIL_GUI_NAME=Anzahl TNT
|
|
||||||
SIMULATOR_TNT_SPAWN_TICK=§7Tick §8- §e{0}
|
|
||||||
SIMULATOR_TNT_SPAWN_TICK_ANVIL_GUI_NAME=Tick Offset
|
|
||||||
SIMULATOR_TNT_SPAWN_FUSE=§7Lebensdauer §8- §e{0}
|
|
||||||
SIMULATOR_TNT_SPAWN_FUSE_ANVIL_GUI_NAME=Fuse-Ticks
|
|
||||||
SIMULATOR_TNT_SPAWN_VELOCITY_NAME=§7TNT
|
|
||||||
SIMULATOR_TNT_SPAWN_VELOCITY_X=§7TNT §eSprung X §8- {0}
|
|
||||||
SIMULATOR_TNT_SPAWN_VELOCITY_Y=§7TNT §eSprung Y §8- {0}
|
|
||||||
SIMULATOR_TNT_SPAWN_VELOCITY_Z=§7TNT §eSprung Z §8- {0}
|
|
||||||
SIMULATOR_TNT_SPAWN_VELOCITY_ON=§aan
|
|
||||||
SIMULATOR_TNT_SPAWN_VELOCITY_OFF=§caus
|
|
||||||
SIMULATOR_TNT_SPAWN_POSITION_X=§7x-Position §8- §e{0}
|
|
||||||
SIMULATOR_TNT_SPAWN_POSITION_Y=§7y-Position §8- §e{0}
|
|
||||||
SIMULATOR_TNT_SPAWN_POSITION_Z=§7z-Position §8- §e{0}
|
|
||||||
SIMULATOR_TNT_SPAWN_ACTIVATED_WITH=§7Gezündet durch §8- §e{0}
|
|
||||||
SIMULATOR_TNT_SPAWN_ACTIVATED_WITH_COMPARATOR=Comparator
|
|
||||||
SIMULATOR_TNT_SPAWN_ACTIVATED_WITH_REPEATER=Repeater
|
|
||||||
SIMULATOR_TNT_SPAWN_ACTIVATED_WITH_OBSERVER=Observer
|
|
||||||
SIMULATOR_TNT_SPAWN_MATERIAL=§eMaterial
|
|
||||||
SIMULATOR_TNT_SPAWN_MATERIAL_LORE_1=§7Jetziges Material§8: §e{0}
|
|
||||||
SIMULATOR_TNT_SPAWN_MATERIAL_LORE_2=§eLink-Click §7Zum ändern
|
|
||||||
SIMULATOR_TNT_SPAWN_MATERIAL_LORE_3=§eRechts-Click §7Zum zurücksetzten
|
|
||||||
SIMULATOR_MATERIAL_GUI_NAME=Material ändern
|
|
||||||
SIMULATOR_MATERIAL_CLICK=§eKlicken zum wählen
|
|
||||||
SIMULATOR_TNT_SPAWN_ADD_IGNITION_PHASE=§eZündphase hinzufügen
|
|
||||||
SIMULATOR_TNT_SPAWN_ADD_TNT=§eTNT hinzufügen
|
|
||||||
SIMULATOR_TNT_SPAWN_REMOVE_TNT=§cEntfernen
|
|
||||||
SIMULATOR_TNT_SPAWN_POSITION_ANVIL_GUI_NAME=Position
|
|
||||||
# SmartPlace
|
|
||||||
SMART_PLACE_HELP=§8/§esmartplace §8-§7 Toggled SmartPlace
|
|
||||||
SMART_PLACE_INFO=§7Plaziert rotierbare Blöcke beim §esneaken§7 von dir §eweg§7.
|
|
||||||
SMART_PLACE_ENABLE=§aSmartPlace aktiviert
|
|
||||||
SMART_PLACE_DISABLE=§cSmartPlace deaktiviert
|
|
||||||
# InventoryFiller
|
|
||||||
INVENTORY_FILL_HELP=§8/§einventoryfill §8- §7Toggled InventoryFill
|
|
||||||
INVENTORY_FILL_INFO=§7Hilft dir, Behälter zu füllen, indem du sie beim sneaken ansiehst und den Gegenstand fallen lässt. Oder scrolle einfach auf einen Behälter, um die Menge des gehaltenen Gegenstandes darin zu ändern.
|
|
||||||
INVENTORY_FILL_ENABLE=§aInventoryFiller activated
|
|
||||||
INVENTORY_FILL_DISABLE=§cInventoryFiller deactivated
|
|
||||||
# Killchecker
|
|
||||||
KILLCHECKER_HELP_ENABLE=§8/§ekillchecker enable §8- §7Aktiviert Killchecker / Berechnet kills neu
|
|
||||||
KILLCHECKER_HELP_DISABLE=§8/§ekillchecker disable §8- §7Deaktiviert Killchecker
|
|
||||||
KILLCHECKER_INFO=§7Zeigt Überlappungen der Kanonen Kills im Baubereich an.
|
|
||||||
KILLCHECKER_INFO2=§7Nur farbige Blöcke wie Wolle, Terracotta, Stained Glass und Concrete wird gezählt.
|
|
||||||
KILLCHECKER_ENABLE=§aKillchecker aktiviert
|
|
||||||
KILLCHECKER_DISABLE=§cKillchecker deaktiviert
|
|
||||||
KILLCHECKER_BOSSBAR=§e§l{0} §7(§e{1}%§7) §e§l{2}§7 Kanonnen
|
|
||||||
# BlockCounter
|
|
||||||
BLOCK_COUNTER_HELP_TOGGLE=§8/§eblockcounter §8- §7Wechsel zwischen an und aus
|
|
||||||
BLOCK_COUNTER_HELP_ENABLE=§8/§eblockcounter enable §8- §7Schalte den BlockCounter an
|
|
||||||
BLOCK_COUNTER_HELP_DISABLE=§8/§eblockcounter disable §8- §7Schalte den BlockCounter aus
|
|
||||||
BLOCK_COUNTER_MESSAGE=§7Schaden §8> §e{0} §7Blöcke §e{1} §7TNT §e{2} §7Blöcke/TNT §e{3} §7Blöcke/tick
|
|
||||||
BLOCK_COUNTER_MESSAGE_SECOND=§7Schaden §8> §e{0} §7Blöcke §e{1} §7TNT §e{2} §7Blöcke/TNT §e{3} §7Blöcke/s
|
|
||||||
BLOCK_COUNTER_ENABLE=§7BlockCounter angemacht
|
|
||||||
BLOCK_COUNTER_DISABLE=§7BlockCounter ausgemacht
|
|
||||||
# DepthCounter
|
|
||||||
DEPTH_COUNTER_MESSAGE=§7Tiefe §8> §7
|
|
||||||
# TPSLimit
|
|
||||||
TPSLIMIT_FREEZE_HELP=§8/§etpslimit 0 §8-§7 Friere TPS ein
|
|
||||||
TPSLIMIT_LIMIT_HELP=§8/§etpslimit §8[§720>x>0.5§8] §8-§7 Verlangsame die TPS
|
|
||||||
TPSLIMIT_WARP_HELP=§8/§etpslimit §8[§7x>20§8] §8-§7 Beschleunige die TPS
|
|
||||||
TPSLIMIT_DEFAULT_HELP=§8/§etpslimit default §8-§7 Setze die TPS auf 20
|
|
||||||
TPSLIMIT_HELP=§8/§etpslimit §8-§7 Zeige die jetzige TPS
|
|
||||||
TICK_FREEZE_HELP=§8/§etick rate 0 §8-§7 Friere TPS ein
|
|
||||||
TICK_FREEZE_HELP_2=§8/§etick freeze §8-§7 Friere TPS ein
|
|
||||||
TICK_UNFREEZE_HELP=§8/§etick unfreeze §8-§7 Setze die TPS auf 20
|
|
||||||
TICK_LIMIT_HELP=§8/§etick rate §8[§720>x>0.5§8] §8-§7 Verlangsame die TPS
|
|
||||||
TICK_WARP_HELP=§8/§etick rate §8[§7x>20§8] §8-§7 Beschleunige die TPS
|
|
||||||
TICK_DEFAULT_HELP=§8/§etick rate default §8-§7 Setze die TPS auf 20
|
|
||||||
TICK_HELP=§8/§etick rate §8-§7 Zeige die jetzige TPS
|
|
||||||
TICK_STEPPING_HELP=§8/§etick step §8<§7Ticks§8> §8-§7 Spule n ticks oder 1 vor
|
|
||||||
TICK_WARPING_HELP=§8/§etick warp §8<§7Ticks§8> §8<§7TPS§8> §8-§7 Warpe n ticks oder 1 vor
|
|
||||||
TICK_BOSSBAR=§e{0}§8/§7{1} gesprungen
|
|
||||||
TPSLIMIT_GUI_ITEM_NAME=§eTPS Limiter
|
|
||||||
TPSLIMIT_GUI_ITEM_LORE=§7Aktuell: §e{0}
|
|
||||||
TPSLIMIT_ANVIL_GUI=Neues TPS Limit
|
|
||||||
TPSLIMIT_CURRENT=§7Jetziges TPS limit§8: §e{0}
|
|
||||||
TPSLIMIT_SET=§eTPS limit auf {0} gesetzt.
|
|
||||||
TPSLIMIT_FROZEN=§eTPS eingefroren.
|
|
||||||
# Trace
|
|
||||||
TRACE_RECORD=§aan
|
|
||||||
TRACE_HAS_TRACES=§ehat Traces
|
|
||||||
TRACE_MESSAGE_START=§aTNT-Tracer gestartet
|
|
||||||
TRACE_MESSAGE_AUTO_START=§eAuto TNT-Tracer gestartet
|
|
||||||
TRACE_MESSAGE_AUTO_STOP=§cAuto TNT-Tracer gestoppt
|
|
||||||
TRACE_MESSAGE_STOP=§cTNT-Tracer gestoppt
|
|
||||||
TRACE_MESSAGE_CLEAR=§cAlle TNT-Positionen gelöscht
|
|
||||||
TRACE_MESSAGE_CLICK_ISOLATE=§eKlicken zum §aisolieren§8/§causblenden
|
|
||||||
TRACE_MESSAGE_SHOW_AT=§aTNT-positions angezeigt bei {0}
|
|
||||||
TRACE_MESSAGE_SHOW_FROM=§aAll TNT-positions angezeigt von {0}
|
|
||||||
TRACE_MESSAGE_SHOW_FROM_TO=§aAll TNT-positions angezeigt von {0} bis {1}
|
|
||||||
TRACE_MESSAGE_BROADCAST=§e{0} teilte seinen Trace-Show-Status.
|
|
||||||
TRACE_MESSAGE_BROADCAST_HOVER=§eZum Ansehen klicken.
|
|
||||||
TRACE_MESSAGE_FOLLOW=§aSie folgen nun {0} Trace show state
|
|
||||||
TRACE_MESSAGE_FOLLOW_SELF=§cSie können sich selbst nicht folgen!
|
|
||||||
TRACE_MESSAGE_UNFOLLOW=§cSie folgen nicht mehr dem Status einer Trace-Show
|
|
||||||
TRACE_MESSAGE_SHOW_TO_SMALLER=§cBis muss größer als von sein
|
|
||||||
TRACE_MESSAGE_ISOLATE=§eTNT Positionen wurden isoliert
|
|
||||||
TRACE_COMMAND_HELP_BROADCAST=§8/§etrace broadcast §8- §7Teilt den aktuellen Trace-Show-Status mit anderen
|
|
||||||
TRACE_COMMAND_HELP_FOLLOW=§8/§etrace follow §8[§ePlayer§8] §8- §7Verfolgen eines Spielers Status anzeigen
|
|
||||||
TRACE_COMMAND_HELP_UNFOLLOW=§8/§etrace unfollow §8- §7Den Status der Trace-Anzeige aufheben
|
|
||||||
TRACE_COMMAND_HELP_START=§8/§etrace start §8- §7Startet die Aufnahme aller TNT-Positionen
|
|
||||||
TRACE_COMMAND_HELP_STOP=§8/§etrace stop §8- §7Stoppt den TNT-Tracer
|
|
||||||
TRACE_COMMAND_HELP_AUTO=§8/§etrace toggleauto §8- §7Automatischer Aufnahmenstart
|
|
||||||
TRACE_COMMAND_HELP_SHOW=§8/§etrace show §8<§eParameter§8> - §7Zeigt alle TNT-Positionen
|
|
||||||
TRACE_COMMAND_HELP_SHOW_AT=§8/§etrace show §8(§etime§8|§7fuse§8) §7at §8<§eTIME§8> - §7Zeigt alle TNT-Positionen bei §8<§eTIME§8> an
|
|
||||||
TRACE_COMMAND_HELP_SHOW_FROM=§8/§etrace show §8(§etime§8|§7fuse§8) §7from §8<§eFROM§8> - §7Zeigt alle TNT-Positionen von §8<§eFROM§8>
|
|
||||||
TRACE_COMMAND_HELP_SHOW_FROM_TO=§8/§etrace show §8(§etime§8|§7fuse§8) §7from §8<§eFROM§8> §7to §8<§eTO§8> - §7Zeigt alle TNT-Positionen zwischen §8<§eFROM§8> und §8<§eTO§8>
|
|
||||||
TRACE_COMMAND_HELP_HIDE=§8/§etrace hide §8- §7Versteckt alle TNT-Positionen
|
|
||||||
TRACE_COMMAND_HELP_DELETE=§8/§etrace delete §8- §7Löscht alle TNT-Positionen
|
|
||||||
TRACE_COMMAND_HELP_ISOLATE=§8/§etrace isolate §8[§eTrace§8] §8[§eTNT§8] §8- §7Isoliert spezifische TNTs des Traces
|
|
||||||
TRACE_GUI_ITEM_NAME=§eTracer
|
|
||||||
TRACE_GUI_ITEM_LORE=§7Status§8: {0}
|
|
||||||
TRACE_GUI_NAME=Tracer Gui
|
|
||||||
TRACE_GUI_TRACE_INACTIVE=§eTracer Starten
|
|
||||||
TRACE_GUI_TRACE_ACTIVE=§eTracer Stoppen
|
|
||||||
TRACE_GUI_TRACE_ACTIVE_AUTO=§eAuto-Trace ist Aktiv
|
|
||||||
TRACE_GUI_AUTO_TRACE_INACTIVE=§eAuto-Tracer Aktivieren
|
|
||||||
TRACE_GUI_AUTO_TRACE_ACTIVE=§eAuto-Tracer Deaktivieren
|
|
||||||
TRACE_GUI_DELETE=§eTrace Löschen
|
|
||||||
# Loader
|
|
||||||
LOADER_SETUP=§eEinrichtung
|
|
||||||
LOADER_RUNNING=§aLaufend
|
|
||||||
LOADER_PAUSE=§7Pausiert
|
|
||||||
LOADER_END=§8Beendet
|
|
||||||
LOADER_SINGLE=§aEinmal
|
|
||||||
LOADER_MESSAGE_INTERACT=§e{0} hinzugefügt {1}
|
|
||||||
LOADER_BUTTON_TNT=TNT
|
|
||||||
LOADER_BUTTON_SWITCH=Hebel
|
|
||||||
LOADER_BUTTON_WOOD_BUTTON=Holzknopf
|
|
||||||
LOADER_BUTTON_STONE_BUTTON=Steinknopf
|
|
||||||
LOADER_BUTTON_PRESSURE_PLATE=Druckplatte
|
|
||||||
LOADER_BUTTON_WEIGHTED_PRESSURE_PLATE=Druckplatte
|
|
||||||
LOADER_BUTTON_TRIPWIRE=Tripwire
|
|
||||||
LOADER_BUTTON_NOTEBLOCK=Noteblock
|
|
||||||
LOADER_BUTTON_DAYLIGHT_DETECTOR=Tageslichtsensor
|
|
||||||
LOADER_BUTTON_COMPARATOR=Comparator
|
|
||||||
LOADER_BUTTON_REPEATER=Repeater
|
|
||||||
LOADER_BUTTON_LECTERN=Lectern
|
|
||||||
LOADER_BUTTON_TRAPDOOR=Trapdoor
|
|
||||||
LOADER_BUTTON_DOOR=Door
|
|
||||||
LOADER_BUTTON_FENCEGATE=Fencegate
|
|
||||||
LOADER_HELP_SETUP=§8/§eloader setup §8- §7Startet die Aufnahme der Aktionen
|
|
||||||
LOADER_SETUP_STOP_FIRST=§cBitte stoppe zuerst den Loader
|
|
||||||
LOADER_HELP_START=§8/§eloader start §8- §7Spielt die zuvor aufgenommenen Aktionen ab
|
|
||||||
LOADER_HELP_SINGLE=§8/§eloader single §8- §7Spielt die zuvor aufgenommenen Aktionen einmal ab
|
|
||||||
LOADER_HELP_PAUSE=§8/§7loader pause §8- §7Pausiert das Abspielen
|
|
||||||
LOADER_HELP_GUI=§8/§7loader settings §8- §7Zeigt die Einstellungen an
|
|
||||||
LOADER_HELP_STOP=§8/§eloader stop §8- §7Stoppt die Aufnahme bzw. das Abspielen
|
|
||||||
LOADER_HELP_WAIT=§8/§7loader wait §8[§7Ticks§8] - §7Setzt die Wartezeit zwischen Schüssen
|
|
||||||
LOADER_HELP_SPEED=§8/§7loader speed §8[§7Ticks§8] - §7Setzt die Wartezeit zwischen Aktionen
|
|
||||||
LOADER_NO_LOADER=§cDu hast noch keinen Loader. Erstelle dir einen mit /loader setup
|
|
||||||
LOADER_NEW=§7Belade und feuer einmal die Kanone ab, um den Loader zu initialisieren.
|
|
||||||
LOADER_HOW_TO_START=§7Führe dann /§eloader start§7 um den Loader zu starten
|
|
||||||
LOADER_ACTIVE=§7Der Loader ist nun aktiviert.
|
|
||||||
LOADER_STOP=§7Der Loader ist nun gestoppt.
|
|
||||||
LOADER_SINGLE_CMD=§7Der Loader spielt nun einmal ab.
|
|
||||||
LOADER_PAUSED=§7Der Loader ist nun pausiert.
|
|
||||||
LOADER_SMALL_TIME=§cDie Wartezeit ist zu klein
|
|
||||||
LOADER_NEW_TIME=§7Die Schusswartezeit ist nun: {0}
|
|
||||||
LOADER_NEW_LOAD_TIME=§7Die Setzwartezeit ist nun: {0}
|
|
||||||
LOADER_NOTHING_RECORDED=§cEs wurden keine Elemente aufgenommen!
|
|
||||||
LOADER_GUI_TITLE=Loader Einstellungen
|
|
||||||
LOADER_GUI_SHOW_ALL=Zeige alles
|
|
||||||
LOADER_GUI_SHOW_INTERACTIONS=Zeige Interaktionen
|
|
||||||
LOADER_GUI_SHOW_WAITS=Zeige Wartezeiten
|
|
||||||
LOADER_GUI_SHOW_WAITS_BETWEEN_TNT=Zeige Wartezeiten zwischen TNT
|
|
||||||
LOADER_GUI_SHOW_TNT=Zeige TNT
|
|
||||||
LOADER_GUI_SHOW_WAITS_SET_ALL=§7Wait Time alle
|
|
||||||
LOADER_GUI_SHOW_WAITS_TITLE=§7Wartezeit
|
|
||||||
LOADER_GUI_SETTINGS_TITLE=Einstellungen
|
|
||||||
LOADER_GUI_COPY_TITLE=Anzahl Kopien
|
|
||||||
LOADER_GUI_SETTINGS_BACK=§8Zurück
|
|
||||||
LOADER_GUI_SETTINGS_COPY=§7Kopieren
|
|
||||||
LOADER_GUI_SETTINGS_DELETE=§cLöschen
|
|
||||||
LOADER_GUI_WAIT_TITLE=Wartezeit
|
|
||||||
LOADER_GUI_WAIT_BACK=§8Zurück
|
|
||||||
LOADER_GUI_CLICK_TO_EDIT=§7Klicke zum editieren
|
|
||||||
LOADER_GUI_ITEM_NAME=§7{0}§8: §e{1}
|
|
||||||
LOADER_SETTING_NAME=§7{0}
|
|
||||||
LOADER_SETTING_MODES=§7Modi§8: §e{0}
|
|
||||||
LOADER_SETTING_POWER=§7Redstone Stärke§8: §e{0}
|
|
||||||
LOADER_SETTING_TICKS=§7Ticks§8: §e{0}
|
|
||||||
LOADER_SETTING_REPEATER=§7Repeater§8: §e{0}
|
|
||||||
LOADER_SETTING_WAIT=§7Wartezeit§8: §e{0} Tick(s)
|
|
||||||
LOADER_SETTING_WAIT_NAME=Wartezeit
|
|
||||||
LOADER_SETTING_TICKS_NAME=Ticks
|
|
||||||
LOADER_SETTING_TICKS_REMOVE_ONE=§c-1
|
|
||||||
LOADER_SETTING_TICKS_REMOVE_ONE_SHIFT=§7Shift§8: §c-5
|
|
||||||
LOADER_SETTING_TICKS_ADD_ONE=§a+1
|
|
||||||
LOADER_SETTING_TICKS_ADD_ONE_SHIFT=§7Shift§8: §a+5
|
|
||||||
LOADER_SETTING_TNT_NAME=§cTNT
|
|
||||||
LOADER_SETTING_TNT_X=§7X§8: §e{0}
|
|
||||||
LOADER_SETTING_TNT_Y=§7Y§8: §e{0}
|
|
||||||
LOADER_SETTING_TNT_Z=§7Z§8: §e{0}
|
|
||||||
LOADER_INTERACTION_NOOP=NOOP
|
|
||||||
LOADER_INTERACTION_PLACE=Platzieren
|
|
||||||
LOADER_INTERACTION_INTERACT=Interagiere
|
|
||||||
LOADER_INTERACTION_POWERED=Aktiviert
|
|
||||||
LOADER_INTERACTION_UNPOWERED=Deaktiviert
|
|
||||||
LOADER_INTERACTION_PAGE_PREV=Vorherige Seite
|
|
||||||
LOADER_INTERACTION_PAGE_NEXT=Nächste Seite
|
|
||||||
LOADER_INTERACTION_PAGE=Seite {0}
|
|
||||||
LOADER_INTERACTION_ACTIVE=Aktiviert
|
|
||||||
LOADER_INTERACTION_INACTIVE=Deaktiviert
|
|
||||||
LOADER_INTERACTION_WAIT_FOR=Darauf warten
|
|
||||||
LOADER_INTERACTION_NO_WAIT_FOR=Nicht darauf warten
|
|
||||||
LOADER_INTERACTION_OPEN=Geöffnet
|
|
||||||
LOADER_INTERACTION_CLOSED=Geschlossen
|
|
||||||
LOADER_INTERACTION_COMPARE=Vergleichen
|
|
||||||
LOADER_INTERACTION_SUBTRACT=Subtrahieren
|
|
||||||
# Loadtimer
|
|
||||||
LOADTIMER_HELP_OVERVIEW=§7Messe dich und deine Freunde beim Beladen einer Kanone und bekomme informationen über die Kanone
|
|
||||||
LOADTIMER_HELP_START_1=§8/§eloadtimer start §8-§7 Startet den einfachen Loadtimer
|
|
||||||
LOADTIMER_HELP_START_2=§8/§7loadtimer start §8[§7full/half§8] - §7Starte den Timer in einem bestimmten Modus
|
|
||||||
LOADTIMER_HELP_START_3=§7Loadtimer Modis: Full -> Misst vom ersten TNT bis zur Treib-Explosion, kann somit besser die Schuss Frequent berechnen. Half -> Misst nur bis zur Aktivierung
|
|
||||||
LOADTIMER_HELP_STOP=§8/§eloadtimer stop §8-§7 Stoppe den Aktuellen Loadtimer
|
|
||||||
LOADTIMER_GUI_GLOBAL=§eLoadtimer gibt es nicht in der Global Region!
|
|
||||||
LOADTIMER_GUI_STOP=§eLoadtimer stoppen
|
|
||||||
LOADTIMER_GUI_START=§eLoadtimer starten
|
|
||||||
LOADTIMER_GUI_TITLE=Loadtimer Modus
|
|
||||||
LOADTIMER_GUI_FULL=§eFull
|
|
||||||
LOADTIMER_GUI_HALF=§eHalf
|
|
||||||
LOADTIMER_WAITING=§7Platziere ein TNT zum starten...
|
|
||||||
LOADTIMER_BOSSBAR=§7Tick: §e{0}§7(§e{1}§7) Zeit: §e{2}s §7Tnt: §e{3} §7Blöcke
|
|
||||||
LOADTIMER_ACTIVATED=§7Warte auf Zündung
|
|
||||||
LOADTIMER_IGNITION=§7Warte auf Explosion
|
|
||||||
LOADTIMER_SUMARY_HEAD=§7---=== (§eLoadtimer-Auswertung§7) ===---
|
|
||||||
LOADTIMER_SUMARY_PLAYERTABLE_HEAD=§7Spieler: §eTNT §7(§eTNT/s§7)
|
|
||||||
LOADTIMER_SUMARY_PLAYERTABLE_PLAYER=§7{0}: §e{1} §7(§e{2}/s§7)
|
|
||||||
LOADTIMER_SUMARY_PLAYERTABLE_ALL=Insgesamt
|
|
||||||
LOADTIMER_SUMARY_TIMES_HEAD=§7Zeiten: §eSekunden §7(§eTicks§7)
|
|
||||||
LOADTIMER_SUMARY_TIMES_START=§7 || §7Start!
|
|
||||||
LOADTIMER_SUMARY_TIMES_ACTIVATION=§7 || Aktivierung: §e{0}s §7(§e{1}t§7)
|
|
||||||
LOADTIMER_SUMARY_TIMES_IGNITION=§7 || Zündung: §e{0}s §7(§e{1}t§7)
|
|
||||||
LOADTIMER_SUMARY_TIMES_EXPLOSION=§7 || Explosion: §e{0}s §7(§e{1}t§7)
|
|
||||||
LOADTIMER_SUMARY_TIMES_LAST=§7\\/
|
|
||||||
LOADTIMER_SUMARY_STATS_HEAD=§7Kanonen-Stats§8:
|
|
||||||
LOADTIMER_SUMARY_STATS_TNT=§7TNT: §e{0}
|
|
||||||
LOADTIMER_SUMARY_STATS_FREQ=§7Belade Frequenz: §e{0}/m§8, §7Schuss Frequenz: §e{1}/m
|
|
||||||
# Observer
|
|
||||||
OBSERVER_HELP=§7Rechts-Klicke einen Observer um den Trace zu bekommen. Hierfür müssen Flammenpartikel an sein. Die Partikel werden im Block angezeigt.
|
|
||||||
OBSERVER_HELP_ENABLE=§8/§eobserver enable §8-§7 Aktiviere den Observer Tracer
|
|
||||||
OBSERVER_HELP_DISABLE=§8/§eobserver disable §8-§7 Deaktiviere den Observer Tracer
|
|
||||||
OBSERVER_HELP_DELETE=§8/§eobserver delete §8-§7 Lösche den Observer Tracer
|
|
||||||
OBSERVER_HELP_RETRACE=§8/§eobserver retrace §8-§7 Retrace den Observer Tracer
|
|
||||||
OBSERVER_ENABLE=§7Observer Trace gestartet
|
|
||||||
OBSERVER_DISABLE=§7Observer Trace gestoppt
|
|
||||||
OBSERVER_DELETE=§7Observer Trace gelöscht
|
|
||||||
OBSERVER_RETRACE_DONE=§7Observer Trace neu berechnet
|
|
||||||
OBSERVER_RETRACE_NO_TRACE=§7Kein Observer Trace zum neu berechnen
|
|
||||||
# Other
|
|
||||||
OTHER_ITEMS_TELEPORT_NAME=§eTeleporter
|
|
||||||
OTHER_ITEMS_TELEPORT_GUI_NAME=Teleportieren
|
|
||||||
OTHER_ITEMS_TELEPORT_PLAYER_OFFLINE=§cDer Spieler ist Offline
|
|
||||||
OTHER_ITEMS_CLEAR_NAME=§eClear
|
|
||||||
OTHER_ITEMS_DECLUTTER_NAME=§eDeclutter
|
|
||||||
OTHER_ITEMS_GAMEMODE_NAME=§eGamemode
|
|
||||||
OTHER_ITEMS_GAMEMODE_LORE_1=§eRechts-Click§8:§7 Umschalten zwischen Creative und Spectator
|
|
||||||
OTHER_ITEMS_GAMEMODE_LORE_2=§eLinks-Click§8:§7 Umschalten zwischen Survival und Adventure
|
|
||||||
OTHER_ITEMS_KILLALL_NAME=§eKillAll
|
|
||||||
OTHER_ITEMS_KILLALL_LORE_1=§eOhne Shift§8:§7 nur die Region
|
|
||||||
OTHER_ITEMS_KILLALL_LORE_2=§eMit Shift§8:§7 Global
|
|
||||||
OTHER_ITEMS_INVENTORY_FILL_LORE_ACTIVE=§aAktiviert
|
|
||||||
OTHER_ITEMS_INVENTORY_FILL_LORE_INACTIVE=§aDeaktiviert
|
|
||||||
OTHER_SLOT_INVALID_SLOT=§cInvalider Slot
|
|
||||||
OTHER_NOCLIP_SLOT_INFO=§7Mit /slot kannst du den ausgewählten Slot ändern und einen anderen Block in den Slot nehmen.
|
|
||||||
OTHER_NOCLIP_SLOT_HELP_PICK=§8/§eslot pick §8-§7 Lege den angeguckten Block ins Inventar
|
|
||||||
OTHER_NOCLIP_SLOT_HELP_DROP=§8/§eslot drop §8-§7 Cleared deinen Slot
|
|
||||||
OTHER_CLEAR_HELP_SELF=§8/§eclear §8- §7Leere dein Inventar
|
|
||||||
OTHER_CLEAR_HELP_PLAYER=§8/§eclear §8[§7Player§8] §8- §7Leere ein Spieler Inventar
|
|
||||||
OTHER_CLEAR_CLEARED=§7Dein Inventar wurde geleert.
|
|
||||||
OTHER_CLEAR_FROM=§7Dein Inventar wurde von {0} §7geleert.
|
|
||||||
OTHER_CLEAR_TO=§7Das Inventar von {0} §7wurde geleert.
|
|
||||||
OTHER_DECLUTTER_HELP=§8/§edeclutter §8- §7Räume dein Inventar auf
|
|
||||||
OTHER_DECLUTTER_DONE=§aDein Inventar wurde aufgeräumt.
|
|
||||||
OTHER_GAMEMODE_UNKNOWN=§cUnbekannter Spielmodus.
|
|
||||||
OTHER_GAMEMODE_POSSIBLE=§cMögliche Spielmodi: survival, adventure, creative, specator.
|
|
||||||
OTHER_KILLALL_HELP_SELF=§8/§ekillall §8- §7Entferne alle Entities aus deiner Region
|
|
||||||
OTHER_KILLALL_HELP_ALL=§8/§ekillall §8[§7Global§8/Local§7] §8- §7Entferne alle Entities aus deiner Region oder global
|
|
||||||
OTHER_KILLALL_REGION=§a{0} Entities aus der Region entfernt
|
|
||||||
OTHER_KILLALL_GLOBAL=§a{0} Entities aus der Welt entfernt
|
|
||||||
OTHER_TELEPORT_HELP=§8/§etp §8[§7Player§8] §8-§7 Teleportiere dich zu einem Spieler
|
|
||||||
OTHER_TELEPORT_SELF_0=§cSei eins mit dir selbst!
|
|
||||||
OTHER_TELEPORT_SELF_1=§cDu brauchst Leute zum spielen? Wir haben auch einen TeamSpeak!
|
|
||||||
OTHER_TELEPORT_SELF_2=§cNoch zu reisende Blöcke: 0; ETA: 0:00
|
|
||||||
OTHER_TELEPORT_SELF_3=§cEin wenig bewegung muss ein.
|
|
||||||
OTHER_TELEPORT_SELF_4=§cFür eine solche Distanz?
|
|
||||||
OTHER_TIME_HELP=§8/§etime §8<§7Zeit 0=Morgen§8, §76000=Mittag§8, §718000=Mitternacht§8> - §7Setzt die Zeit auf dem Bau
|
|
||||||
OTHER_TIME_INVALID=§cBitte gib eine Zahl zwischen 0 und 24000 an
|
|
||||||
OTHER_TIME_RESULT=§7§oWhooosh
|
|
||||||
OTHER_TPS_HEAD=§7TPS: 1s 10s 1m 5m 10m
|
|
||||||
OTHER_TPS_MESSAGE=§7 §e{0}§7 §e{1}§7 §e{2}§7 §e{3}§7 §e{4}
|
|
||||||
OTHER_TPS_SINGLE=§8TPS: §e{0}
|
|
||||||
OTHER_BIND_HELP=§8/§ebind §8[§7Command§8] §8-§e Binde ein Befehl auf Item Interaktion
|
|
||||||
OTHER_BIND_ERROR=§cFalscher oder unbekannter Befehl
|
|
||||||
OTHER_BIND_UNBINDABLE=§cBefehl konnte nicht gebunden werden
|
|
||||||
OTHER_BIND_MESSAGE_BIND=§7Befehl §e{0} §7ans Item gebunden
|
|
||||||
OTHER_BIND_MESSAGE_UNBIND=§7Befehl entbunden
|
|
||||||
# DebugStick
|
|
||||||
DEBUG_STICK_COMMAND_HELP=§8/§edebugstick §8-§7 Erhalte einen DebugStick
|
|
||||||
DEBUG_STICK_NAME=§eDebugstick
|
|
||||||
#Skull Gui
|
|
||||||
SKULL_GUI_ITEM_NAME=§eSpieler Köpfe
|
|
||||||
ANVIL_INV_NAME=Spieler name
|
|
||||||
# StructureVoid
|
|
||||||
STRUCTURE_VOID_COMMAND_HELP=§8/§estructureVoid §8-§7 Erhalte ein StructureVoid
|
|
||||||
# Dragon Egg
|
|
||||||
DRAGON_EGG_COMMAND_HELP=§8/§edragonegg §8-§7 Erhalte ein Drachenei
|
|
||||||
# NightVision
|
|
||||||
NIGHT_VISION_HELP=§8/§enightvision §8-§7 Schalte Nightvision an oder aus.
|
|
||||||
NIGHT_VISION_OFF=§eNightvision deaktiviert
|
|
||||||
NIGHT_VISION_ON=§eNightvision aktiviert
|
|
||||||
NIGHT_VISION_ITEM_ON=§7Nightvision: §eAktiviert
|
|
||||||
NIGHT_VISION_ITEM_OFF=§7Nightvision: §eDeaktiviert
|
|
||||||
#Navigation Wand
|
|
||||||
NAVIGATION_WAND=§eNavigation Wand
|
|
||||||
NAVIGATION_WAND_LEFT_CLICK=§eLeft click: jump to location
|
|
||||||
NAVIGATION_WAND_RIGHT_CLICK=§eRight click: pass through walls
|
|
||||||
# Material
|
|
||||||
MATERIAL_SEARCH_PROPERTY_TRUE=§aHat
|
|
||||||
MATERIAL_SEARCH_PROPERTY_FALSE=§cHat nicht
|
|
||||||
MATERIAL_SEARCH_PROPERTY_IGNORE=§eEgal
|
|
||||||
MATERIAL_INV_NAME=§eMaterial {0}/{1}
|
|
||||||
MATERIAL_SEARCH=§eSuchen
|
|
||||||
MATERIAL_BACK=§eZurück
|
|
||||||
MATERIAL_SEARCH_NAME=§eName
|
|
||||||
MATERIAL_SEARCH_TRANSPARENT=§eTransparent
|
|
||||||
MATERIAL_SEARCH_SOLID=§eSolide
|
|
||||||
MATERIAL_SEARCH_GRAVITY=§eFallend
|
|
||||||
MATERIAL_SEARCH_OCCLUDING=§eOccluding
|
|
||||||
MATERIAL_SEARCH_INTERACTEABLE=§eInterargierbar
|
|
||||||
MATERIAL_SEARCH_FLAMMABLE=§eFlammbar
|
|
||||||
MATERIAL_SEARCH_BURNABLE=§eBrennbar
|
|
||||||
MATERIAL_SEARCH_WATERLOGGABLE=§eWasserspeicherbar
|
|
||||||
MATERIAL_SEARCH_BLASTRESISTANCE=§eBlast Resistance
|
|
||||||
MATERIAL_SEARCH_VALUE=§8: §e{0}
|
|
||||||
MATERIAL_BLAST_RESISTANCE=§8- §eBlast Resistance§8: §7{0}
|
|
||||||
MATERIAL_HARDNESS=§8- §eHärte§8: §7{0}
|
|
||||||
MATERIAL_TNT_BREAKABLE=§8- §eZerstörbar durch TNT
|
|
||||||
MATERIAL_TNT_UNBREAKABLE=§8- §eNicht Zerstörbar durch TNT
|
|
||||||
MATERIAL_TRANSPARENT=§8- §eTransparenter Block
|
|
||||||
MATERIAL_SOLID=§8- §eSolider Block
|
|
||||||
MATERIAL_GRAVITY=§8- §eFallender Block
|
|
||||||
MATERIAL_OCCLUDING=§8- §eOccluding Block
|
|
||||||
MATERIAL_INTERACTABLE=§8- §eInterargierbarer Block
|
|
||||||
MATERIAL_FLAMMABLE=§8- §eFlammbarer Block
|
|
||||||
MATERIAL_BURNABLE=§8- §eBrennbarer Block
|
|
||||||
MATERIAL_WATERLOGGABLE=§8- §eWasserspeicherbarer Block
|
|
||||||
# Region Items
|
|
||||||
REGION_ITEM_COLOR=§7Color: §e{0}
|
|
||||||
REGION_ITEM_COLOR_CHOOSE=Farbe Wählen
|
|
||||||
REGION_ITEM_FIRE_ALLOW=§7Feuer: §eEingeschaltet
|
|
||||||
REGION_ITEM_FIRE_DISALLOW=§7Feuer: §eAusgeschaltet
|
|
||||||
REGION_ITEM_FREEZE_ALLOW=§7Freeze: §eEingeschaltet
|
|
||||||
REGION_ITEM_FREEZE_DISALLOW=§7Freeze: §eAusgeschaltet
|
|
||||||
REGION_ITEM_PROTECT_ALLOW=§7Protect: §eEingeschaltet
|
|
||||||
REGION_ITEM_PROTECT_DISALLOW=§7Protect: §eAusgeschaltet
|
|
||||||
REGION_ITEM_RESET=§eReset
|
|
||||||
REGION_ITEM_TESTBLOCK=§eTestblock
|
|
||||||
REGION_ITEM_TNT_OFF=§7TNT: §eAusgeschaltet
|
|
||||||
REGION_ITEM_TNT_ONLY_TB=§7TNT: §enur Testblock
|
|
||||||
REGION_ITEM_TNT_ONLY_BUILD=§7TNT: §enur Baubereich
|
|
||||||
REGION_ITEM_TNT_ON=§7TNT: §eEingeschaltet
|
|
||||||
REGION_ITEM_SELECTOR_TITLE=Tnt Modus
|
|
||||||
REGION_ITEM_SELECTOR_ON=§eEinschalten
|
|
||||||
REGION_ITEM_SELECTOR_ONLY_TB=§enur Testblock
|
|
||||||
REGION_ITEM_SELECTOR_ONLY_BUILD=§enur Baubereich
|
|
||||||
REGION_ITEM_SELECTOR_OFF=§eAusschalten
|
|
||||||
#Region
|
|
||||||
REGION_COLOR_HELP_COLOR=§8/§ecolor §8[§7Color§8] §8- §7Setze die Farbe der Region
|
|
||||||
REGION_COLOR_HELP_COLOR_TYPE=§8/§ecolor §8[§7Color§8] §8[§7Type§8] §8- §7Setze die Farbe der Region oder Global
|
|
||||||
REGION_COLOR_GLOBAL=§7Alle Regions farben auf §e{0}§7 gesetzt
|
|
||||||
REGION_COLOR_NO_REGION=§cDu befindest dich derzeit in keiner Region
|
|
||||||
REGION_FIRE_HELP=§8/§efire §8- §7Toggle Feuerschaden
|
|
||||||
REGION_FIRE_ENABLED=§cRegions Feuerschaden deaktiviert
|
|
||||||
REGION_FIRE_DISABLED=§aRegions Feuerschaden aktiviert
|
|
||||||
REGION_FREEZE_HELP=§8/§efreeze §8- §7Toggle Freeze
|
|
||||||
REGION_FREEZE_ENABLED=§cRegion eingefroren
|
|
||||||
REGION_FREEZE_DISABLED=§aRegion aufgetaut
|
|
||||||
REGION_ITEMS_HELP=§8/§eitems §8- §7Toggle Items
|
|
||||||
REGION_ITEMS_ENABLED=§aItems aktiviert in dieser Region
|
|
||||||
REGION_ITEMS_DISABLED=§cItems deaktiviert in dieser Region
|
|
||||||
REGION_PROTECT_HELP=§8/§eprotect §8- §7Schütze die Region
|
|
||||||
REGION_PROTECT_DISABLE=§cBoden Schutz aufgehoben
|
|
||||||
REGION_PROTECT_ENABLE=§aBoden geschützt
|
|
||||||
REGION_PROTECT_FALSE_REGION=§cDu befindest dich derzeit in keiner (M)WG-Region
|
|
||||||
REGION_NO_GRAVITY_HELP = §8/§enogravity §8- §7Toggle NoGravity
|
|
||||||
REGION_NO_GRAVITY_ENABLED = §aNoGravity aktiviert in dieser Region
|
|
||||||
REGION_NO_GRAVITY_DISABLED = §cNoGravity deaktiviert in dieser Region
|
|
||||||
REGION_REGION_HELP_UNDO=§8/§eregion undo §8- §7Mache die letzten 20 /testblock oder /reset rückgängig
|
|
||||||
REGION_REGION_HELP_REDO=§8/§eregion redo §8- §7Wiederhole die letzten 20 §8/§7rg undo
|
|
||||||
REGION_REGION_HELP_RESTORE=§8/§eregion restore §8- §7Setzte die Region zurück, ohne das Gebaute zu löschen
|
|
||||||
REGION_REGION_HELP_RESTORE_SCHEMATIC=§8/§eregion restore §8[§7Schematic§8] §8- §7Setzte die Region zurück, ohne das Gebaute zu löschen
|
|
||||||
REGION_REGION_HELP_COPYPOINT=§8/§eregion copypoint §8- §7Teleportiere dich zum Regions Kopierpunkt
|
|
||||||
REGION_REGION_HELP_TESTBLOCKPOINT=§8/§eregion testblockpoint §8- §7Teleportiere dich zum Regions Testblockpunkt
|
|
||||||
REGION_REGION_HELP_CHANGESKIN_INFO=§8/§eregion changeskin §8- §7Gebe den Regions Skin aus
|
|
||||||
REGION_REGION_HELP_CHANGESKIN=§8/§eregion changeskin §8[§7Skin§8] §8- §8Setzte den Regions Skin
|
|
||||||
REGION_REGION_HELP_COPY=§8/§eregion copy [-e] [-s] §8- §8Kopieren des Baubereichs optional mit Erweiterungen oder Auswahl am Kopierpunkt
|
|
||||||
REGION_REGION_HELP_PASTE=§8/§eregion paste [-a] [-s] §8[§7Skin§8] §8- §8Einfügen am Kopierpunkt optional ohne Luft und Auswahl des eingefügten Bereichs
|
|
||||||
REGION_REGION_NOTHING_UNDO=§cNichts zum rückgängig machen
|
|
||||||
REGION_REGION_UNDID=§7Letzte Aktion rückgangig gemacht
|
|
||||||
REGION_REGION_NOTHING_REDO=§cNichts zum wiederhohlen
|
|
||||||
REGION_REGION_REDID=§7Letzte Aktion wiederhohlt
|
|
||||||
REGION_REGION_RESTORED=§7Region zurückgesetzt
|
|
||||||
REGION_REGION_FAILED_RESTORE=§cFehler beim Zurücksetzen der Region
|
|
||||||
REGION_REGION_COLORED=§7Region umgefärbt
|
|
||||||
REGION_REGION_COLORED_FAILED=§7Nutze §e/rg restore§7 um manuell die Farbe zu ändern
|
|
||||||
REGION_REGION_FAILED_COLORED=§cFehler beim umfärben der Region
|
|
||||||
REGION_REGION_TP_COPY=§7Zum Kopierpunkt teleportiert
|
|
||||||
REGION_REGION_TP_TEST_BLOCK=§7Zum Testblock teleportiert
|
|
||||||
REGION_REGION_TP_UNKNOWN=§cNicht definierter Teleportierpunkt
|
|
||||||
REGION_REGION_NO_REGION=§cDu bist in keiner Region
|
|
||||||
REGION_REGION_NO_BUILD=§cDiese Region hat kein Baugebiet
|
|
||||||
REGION_REGION_COPY_DONE=§eBauregion oder Selektion kopiert
|
|
||||||
REGION_REGION_PASTE_DONE=§eBauregion oder Selektion eingefügt
|
|
||||||
REGION_REGION_CHANGESKIN_INFO=§7Regions Skin ist §e{0}
|
|
||||||
REGION_REGION_CHANGESKIN_INFO_CREATOR=§7Skin erstellt von §e{0}
|
|
||||||
REGION_REGION_CHANGESKIN_UNKNOWN=§cRegions Skin ist nicht valide
|
|
||||||
REGION_REGION_CHANGESKIN_INVALID=§cRegions Skin ist nicht erlaubt hier
|
|
||||||
REGION_REGION_CHANGESKIN_CHANGE=§7Regions Skin ist auf §e{0}§7 geändert
|
|
||||||
REGION_REGION_CHANGESKIN_CHANGE_UPDATE=§7Klicke §e§lHIER §7um den Skin anzuwenden
|
|
||||||
REGION_REGION_CHANGESKIN_CHANGE_UPDATE_HOVER=§8/§ereset
|
|
||||||
REGION_RESET_HELP_RESET=§8/§ereset §8- §7Setzte die Region zurück
|
|
||||||
REGION_RESET_HELP_SCHEMATIC=§8/§ereset §8[§7Schematic§8] §8- §7Setzte die Region mit einer Schematic zurück
|
|
||||||
REGION_RESET_RESETED=§7Region zurückgesetzt
|
|
||||||
REGION_RESET_ERROR=§cFehler beim Zurücksetzen der Region
|
|
||||||
REGION_RESET_NO_REGION=§cDu befindest dich derzeit in keiner Region
|
|
||||||
REGION_TB_HELP_RESET=§8/§etestblock §8- §7Setzte den Testblock zurück
|
|
||||||
REGION_TB_HELP_RESET_EXTENSION=§8/§etestblock §8[§7ExtensionType§8] §8- §7Setzte den Testblock zurück
|
|
||||||
REGION_TB_HELP_SCHEMATIC=§8/§etestblock §8[§7Schematic§8] §8- §7Setzte den Testblock mit einer Schematic zurück
|
|
||||||
REGION_TB_HELP_SCHEMATIC_EXTENSION=§8/§etestblock §8[§7Schematic§8] §8[§7ExtensionType§8] §8- §7Setzte den Testblock mit einer Schematic zurück
|
|
||||||
REGION_TB_DONE=§7Testblock zurückgesetzt
|
|
||||||
REGION_TB_ERROR=§cFehler beim Zurücksetzen des Testblocks
|
|
||||||
REGION_TB_NO_REGION=§cDu befindest dich derzeit in keiner Region
|
|
||||||
REGION_TB_NO_SCHEMSHARING=§cDu kannst aktuell keine Schematics teilen bis {0}.
|
|
||||||
REGION_TB_NO_SCHEMRECEIVING=§cDer Besitzer dieses Bauservers kann keine Schematics erhalten bis {0}.
|
|
||||||
REGION_TNT_HELP=§8/§etnt §8- §7Ändere das TNT verhalten
|
|
||||||
REGION_TNT_HELP_MODE=§8/§etnt §8[§7Mode§8] §8- §7Setzte das TNT verhalten auf einen Modus
|
|
||||||
REGION_TNT_ON=§aTNT-Schaden aktiviert
|
|
||||||
REGION_TNT_OFF=§cTNT-Schaden deaktiviert
|
|
||||||
REGION_TNT_TB=§aTNT-Schaden außerhalb Baurahmen aktiviert
|
|
||||||
REGION_TNT_BUILD_DESTROY=§cEine Explosion hätte Blöcke im Baubereich zerstört
|
|
||||||
REGION_TNT_TB_DESTROY=§cEine Explosion hätte Blöcke im Testblockbereich zerstört
|
|
||||||
AFK_KICK_MESSAGE=§cAuf diesem Server ist seit 15 Minuten nichts passiert.
|
|
||||||
AFK_WARNING_MESSAGE=§cDieser Server wird bei weiterer Inaktivität in einer Minute gestoppt
|
|
||||||
SKIN_HELP=§8/§eskin §8[§7Kuerzel§8] §8[§7Creator§8|§epublic§8] §8[§7Name...§8] §8- §7Erstellt die Skin Schematics. 'public' als Creator nutzen für keinen Creator, danach die nachricht an YoyoNow kopieren (mit Click kopieren)
|
|
||||||
SKIN_NO_REGION=§7Du steht in keiner Region, welche mit einem Skin versehen werden kann
|
|
||||||
SKIN_ALREADY_EXISTS=§cDieser Skin existiert in der Form bereits
|
|
||||||
SKIN_MESSAGE=§7Skin erstellt
|
|
||||||
SKIN_MESSAGE_HOVER=§eKlicken zum kopieren für YoyoNow und an diesen senden
|
|
||||||
# Panzern
|
|
||||||
PANZERN_HELP=§8/§epanzern §8[§7Block§8] §8[§7Slab§8] §8- §7Panzer deine WorldEdit Auswahl
|
|
||||||
PANZERN_PREPARE1=§71. Gucke nochmal nach, ob Läufe auch bis zur Panzergrenze führen.
|
|
||||||
PANZERN_PREPARE2=§72. Teppich in Gänge auf dem Boden vereinfacht das panzern.
|
|
||||||
PANZERN_PREPARE3=§73. Schildtechnik sollte explizit eingeschlossen sein.
|
|
||||||
PANZERN_PREPARE4=§74. Innerhalb der zu panzernden Region zu stehen, beim Befehlausführen kann das Panzern verbessern.
|
|
||||||
PANZERN_NO_WORLDEDIT=§cDu hast keine WorldEdit Selection
|
|
||||||
PANZERN_PROGRESS=§e{0} §7Blöcke übrig, §e{1} §7Blöcke pro Sekunde, §e{2} §7Block Delta
|
|
||||||
PANZERN_DONE=§aZuende gepanzert
|
|
||||||
# Laufbau
|
|
||||||
LAUFBAU_HELP=§8/§elaufbau §8[§7smallest§8|§7blastresistant§8] §8- §7Baue einen Lauf in deiner WorldEdit Auswahl mit den Traces
|
|
||||||
LAUFBAU_HELP_SETTINGS=§8/§elaufbau settings §8- §7Öffnet die Settings GUI
|
|
||||||
LAUFBAU_PREPARE1=§71. Trace die Kanonen so oft wie nötig, in allen Modi.
|
|
||||||
LAUFBAU_PREPARE2=§72. Versuche alle Fails aus dem Trace zu löschen.
|
|
||||||
LAUFBAU_NO_WORLDEDIT=§cDu hast keine WorldEdit Selection
|
|
||||||
LAUFBAU_STATE_FILTERING_TRACES=Traces filtern
|
|
||||||
LAUFBAU_STATE_PROCESSING_TRACES=Traces verbinden
|
|
||||||
LAUFBAU_STATE_CREATE_LAUF=Lauf erstellen
|
|
||||||
LAUFBAU_SIMPLE_PROGRESS=§e{0}§8: §e{1}§8/§e{2} §7Übrige Zeit §8: §e{3}
|
|
||||||
LAUFBAU_DONE=§aZuende gebaut
|
|
||||||
LAUFBAU_SETTINGS_GUI_NAME=§eLaufbau
|
|
||||||
LAUFBAU_SETTINGS_ACTIVE=§aAktiv
|
|
||||||
LAUFBAU_SETTINGS_INACTIVE=§cInaktiv
|
|
||||||
LAUFBAU_SETTINGS_MIXED=§e{0}§8/§e{1} §aAktiv
|
|
||||||
LAUFBAU_SETTINGS_GUI_BACK=§eBack
|
|
||||||
LAUFBAU_SETTINGS_TOGGLE=§eClick §8-§7 Toggle
|
|
||||||
LAUFBAU_SETTINGS_ADVANCED=§eMiddle-Click §8-§7 Erweiterte Einstellung
|
|
||||||
LAUFBAU_BLOCK_COBWEB=§eCobweb
|
|
||||||
LAUFBAU_BLOCK_GRASS_PATH=§eGrass Path
|
|
||||||
LAUFBAU_BLOCK_SOUL_SAND=§eSoul Sand
|
|
||||||
LAUFBAU_BLOCK_COCOA=§eCocoa
|
|
||||||
LAUFBAU_BLOCK_TURTLE_EGG=§eTurtle Eggs
|
|
||||||
LAUFBAU_BLOCK_CHEST=§eChest
|
|
||||||
LAUFBAU_BLOCK_SNOW=§eSnow Layer
|
|
||||||
LAUFBAU_BLOCK_PLAYER_WALL_HEAD=§ePlayer Wall Head
|
|
||||||
LAUFBAU_BLOCK_STONECUTTER=§eStonecutter
|
|
||||||
LAUFBAU_BLOCK_PLAYER_HEAD=§ePlayer Head
|
|
||||||
LAUFBAU_BLOCK_CAKE=§eCake
|
|
||||||
LAUFBAU_BLOCK_END_STONE_BRICK_SLAB=§eEndstone Brick Slabs
|
|
||||||
LAUFBAU_BLOCK_SEA_PICKLE=§eSea Pickles
|
|
||||||
LAUFBAU_BLOCK_CAMPFIRE=§eCampfire
|
|
||||||
LAUFBAU_BLOCK_FLOWER_POT=§eFlower Pot
|
|
||||||
LAUFBAU_BLOCK_IRON_TRAPDOOR=§eIron Trapdoor
|
|
||||||
LAUFBAU_BLOCK_LILY_PAD=§eLily Pad
|
|
||||||
LAUFBAU_BLOCK_WHITE_CARPET=§eCarpet
|
|
||||||
LAUFBAU_BLOCK_END_ROD=§eEnd Rod
|
|
||||||
LAUFBAU_BLOCK_LIGHTNING_ROD=§eLightning Rod
|
|
||||||
LAUFBAU_BLOCK_CONDUIT=§eConduit
|
|
||||||
LAUFBAU_BLOCK_BREWING_STAND=§eBrewing Stand
|
|
||||||
LAUFBAU_BLOCK_BELL=§eBell
|
|
||||||
LAUFBAU_BLOCK_GRINDSTONE=§eGrindstone
|
|
||||||
LAUFBAU_BLOCK_HOPPER=§eHopper
|
|
||||||
LAUFBAU_BLOCK_LANTERN=§eLantern
|
|
||||||
LAUFBAU_BLOCK_END_STONE_BRICK_STAIRS=§eEndstone Brick Stairs
|
|
||||||
LAUFBAU_BLOCK_CHORUS_PLANT=§eChorus Plant
|
|
||||||
LAUFBAU_BLOCK_NETHER_BRICK_FENCE=§eNether Brick Fence
|
|
||||||
LAUFBAU_BLOCK_IRON_BARS=§eIron Bars
|
|
||||||
LAUFBAU_BLOCK_END_STONE_BRICK_WALL=§eEndstone Brick Walls
|
|
||||||
LAUFBAU_BLOCK_CHAIN=§eChain
|
|
||||||
LAUFBAU_BLOCK_BIG_DRIP_LEAF=§eBig Drip Leaf
|
|
||||||
LAUFBAU_BLOCK_DRAGON_EGG=§eDragon Egg
|
|
||||||
LAUFBAU_BLOCK_AZALEA=§eAzalea
|
|
||||||
LAUFBAU_BLOCK_CANDLE=§eKerze
|
|
||||||
LAUFBAU_BLOCK_CANDLE_CAKE=§eKuchen mit Kerze
|
|
||||||
LAUFBAU_BLOCK_LECTERN=§eLectern
|
|
||||||
LAUFBAU_FACING_NORTH=§8-§7 Richtung Norden
|
|
||||||
LAUFBAU_FACING_SOUTH=§8-§7 Richtung Süden
|
|
||||||
LAUFBAU_FACING_WEST=§8-§7 Richtung Westen
|
|
||||||
LAUFBAU_FACING_EAST=§8-§7 Richtung Osten
|
|
||||||
LAUFBAU_FACING_UP=§8-§7 Richtung Oben
|
|
||||||
LAUFBAU_FACING_DOWN=§8-§7 Richtung Unten
|
|
||||||
LAUFBAU_COUNT_1=§8-§7 Anzahl 1
|
|
||||||
LAUFBAU_COUNT_2=§8-§7 Anzahl 2
|
|
||||||
LAUFBAU_COUNT_3=§8-§7 Anzahl 3
|
|
||||||
LAUFBAU_COUNT_4=§8-§7 Anzahl 4
|
|
||||||
LAUFBAU_LAYERS_8=§8-§7 Ebenen 8
|
|
||||||
LAUFBAU_LAYERS_7=§8-§7 Ebenen 7
|
|
||||||
LAUFBAU_LAYERS_6=§8-§7 Ebenen 6
|
|
||||||
LAUFBAU_LAYERS_3=§8-§7 Ebenen 3
|
|
||||||
LAUFBAU_LAYERS_2=§8-§7 Ebenen 2
|
|
||||||
LAUFBAU_TYPE_BOTTOM=§8-§7 Type Unten
|
|
||||||
LAUFBAU_TYPE_TOP=§8-§7 Type Oben
|
|
||||||
LAUFBAU_HALF_BOTTOM=§8-§7 Hälfte Unten
|
|
||||||
LAUFBAU_HALF_TOP=§8-§7 Hälfte Oben
|
|
||||||
LAUFBAU_OPEN=§8-§7 Geöffnet
|
|
||||||
LAUFBAU_ATTACHMENT_CEILING=§8-§7 Befestigung Decke
|
|
||||||
LAUFBAU_ATTACHMENT_FLOOR=§8-§7 Befestigung Boden
|
|
||||||
LAUFBAU_ATTACHMENT_DOUBLE_WALL=§8-§7 Befestigung beidseitige Wand
|
|
||||||
LAUFBAU_ATTACHMENT_SINGLE_WALL=§8-§7 Befestigung einseitige Wand
|
|
||||||
LAUFBAU_ATTACHMENT_WALL=§8-§7 Befestigung Wand
|
|
||||||
LAUFBAU_CONNECTION_FLOOR=§8-§7 Verbindung Boden
|
|
||||||
LAUFBAU_CONNECTION_NORTH=§8-§7 Verbindung Norden
|
|
||||||
LAUFBAU_CONNECTION_SOUTH=§8-§7 Verbindung Süden
|
|
||||||
LAUFBAU_CONNECTION_EAST=§8-§7 Verbindung Osten
|
|
||||||
LAUFBAU_CONNECTION_WEST=§8-§7 Verbindung Westen
|
|
||||||
LAUFBAU_CONNECTION_DOWN=§8-§7 Verbindung Unten
|
|
||||||
LAUFBAU_CONNECTION_UP=§8-§7 Verbindung Oben
|
|
||||||
LAUFBAU_HANGING=§8-§7 hängend
|
|
||||||
LAUFBAU_SHAPE_STRAIGHT=§8-§7 Form gerade
|
|
||||||
LAUFBAU_SHAPE_OUTER_LEFT=§8-§7 Form äußere links
|
|
||||||
LAUFBAU_SHAPE_INNER_LEFT=§8-§7 Form innere links
|
|
||||||
LAUFBAU_TILT_NONE=§8-§7 Neigung keine
|
|
||||||
LAUFBAU_TILT_PARTIAL=§8-§7 Neigung teilweise
|
|
||||||
# UTILS
|
|
||||||
SELECT_HELP=§8/§eselect §8[§7RegionsTyp§8] §8- §7Wähle einen RegionsTyp aus
|
|
||||||
SELECT_EXTENSION_HELP=§8/§eselect §8[§7RegionsTyp§8] §8[§7Extension§8] §8- §7Wähle einen RegionsTyp aus mit oder ohne Extension
|
|
||||||
SELECT_GLOBAL_REGION=§cDie globale Region kannst du nicht auswählen
|
|
||||||
SELECT_NO_TYPE=§cDiese Region hat keinen {0}
|
|
||||||
SELECT_NO_EXTENSION=§cDiese Region hat keine Ausfahrmaße
|
|
||||||
SELECT_MESSAGE=§7WorldEdit auswahl auf {0}, {1}, {2} und {3}, {4}, {5} gesetzt
|
|
||||||
SKULL_HELP=§8/§eskull §8[§eSpieler§8] §8-§7 Gibt einen SpielerKopf
|
|
||||||
SKULL_INVALID=§cUngültiger Spieler
|
|
||||||
SKULL_ITEM=§e{0}§8s Kopf
|
|
||||||
SPEED_HELP=§8/§espeed §8[§71§8-§710§8|§edefault§8] §8-§7 Setzte deine Flug- und Laufgeschindigkeit.
|
|
||||||
SPEED_CURRENT=§7Aktuelle geschwindigkeit§8: §e{0}
|
|
||||||
SPEED_TOO_SMALL=§c{0} ist zu klein
|
|
||||||
SPEED_TOO_HIGH=§c{0} ist zu hoch
|
|
||||||
SPEED_ITEM=§eGeschwindigkeit
|
|
||||||
SPEED_ITEM_LORE=§7Aktuell: §e
|
|
||||||
SPEED_TAB_NAME=Geschwindigkeit eingeben
|
|
||||||
WORLDEDIT_WAND=WorldEdit Wand
|
|
||||||
WORLDEDIT_LEFTCLICK=Left click: select pos #1
|
|
||||||
WORLDEDIT_RIGHTCLICK=Right click: select pos #2
|
|
||||||
TNT_CLICK_HEADER=§8---=== §eTNT §8===---
|
|
||||||
TNT_CLICK_ORDER=§eEntity Order§8: §e{0}
|
|
||||||
TNT_CLICK_FUSE_TIME=§eFuseTime§8: §e{0}
|
|
||||||
TNT_CLICK_POSITION_X=§7Position §eX§8: §e{0}
|
|
||||||
TNT_CLICK_POSITION_Y=§7Position §eY§8: §e{0}
|
|
||||||
TNT_CLICK_POSITION_Z=§7Position §eZ§8: §e{0}
|
|
||||||
TNT_CLICK_VELOCITY_X=§7Velocity §eX§8: §e{0}
|
|
||||||
TNT_CLICK_VELOCITY_Y=§7Velocity §eY§8: §e{0}
|
|
||||||
TNT_CLICK_VELOCITY_Z=§7Velocity §eZ§8: §e{0}
|
|
||||||
TNT_CLICK_COUNT=§7Anzahl §8: §e{0}
|
|
||||||
TNT_CLICK_ISOLATE=§eIsolieren
|
|
||||||
SELECT_ITEM_CHOOSE_EXTENSION=Extension auswählen
|
|
||||||
SELECT_ITEM_CHOOSE_SELECTION=Auswahl auswählen
|
|
||||||
SELECT_ITEM_NORMAL_EXTENSION=§eNormal
|
|
||||||
SELECT_ITEM_EXTENDED_EXTENSION=§eAusgefahren
|
|
||||||
SELECT_ITEM_SELECT=§eSelect
|
|
||||||
SELECT_ITEM_AUSWAHL=§7Auswahl: §7{0} {1}
|
|
||||||
SELECT_ITEM_RIGHT_CLICK=§7Rechtklick zum ändern
|
|
||||||
SELECT_ITEM_BAURAHMEN=§eBaurahmen
|
|
||||||
SELECT_ITEM_BAUPLATTFORM=§eBauplattform
|
|
||||||
SELECT_ITEM_TESTBLOCK=§eTestblock
|
|
||||||
CHESTFILLER_FILLED=§eKiste gefüllt
|
|
||||||
PISTON_HELP_1=§7Rechts Klick auf Piston mit einem Slime Ball berechnet dir die bewegten Blöcke.
|
|
||||||
PISTON_HELP_2=§7Die Anzahl ist Rot, wenn ein unmovable Block vorhanden ist.
|
|
||||||
PISTON_HELP_3=§7Die Anzahl ist Gelb, wenn zu viele Blöcke vorhanden sind.
|
|
||||||
PISTON_INFO=§7Bewegte Blöcke {0}{1}§8/§712
|
|
||||||
# Warp
|
|
||||||
WARP_LOC_X=§7X§8: §e{0}
|
|
||||||
WARP_LOC_Y=§7Y§8: §e{0}
|
|
||||||
WARP_LOC_Z=§7Z§8: §e{0}
|
|
||||||
WARP_EXISTS=§7Ein Warp mit dem namen §e{0} §7existiert bereits
|
|
||||||
WARP_NAME_RESERVED=§7Du kannst nicht §c{0} §7als name für einen Warp nutzen
|
|
||||||
WARP_CREATED=§7Der Warp §e{0} §7wurde erstellt
|
|
||||||
WARP_DELETE_HOVER=§e{0} §7löschen
|
|
||||||
WARP_DELETED=§e{0} §7wurde gelöscht
|
|
||||||
WARP_TELEPORT_HOVER=§7Zu §e{0} §7teleportieren
|
|
||||||
WARP_MATERIAL_CHOOSE=Material auswählen
|
|
||||||
WARP_GUI_NAME=Warps
|
|
||||||
WARP_GUI_NO=§cHier gibt es noch keine Warps
|
|
||||||
WARP_GUI_DISTANCE=§7Distanz: §e{0} §7Blöcke
|
|
||||||
WARP_GUI_LCLICK=§7Links klicken zum teleportieren
|
|
||||||
WARP_GUI_RCLICK=§7Rechts klicken zum editieren
|
|
||||||
WARP_INFO_NAME=§7Name: §e{0}
|
|
||||||
WARP_HELP_ADD=§8/§ewarp add §8[§7Name§8] §8- §7Erstelle einen neuen Warp Punkt
|
|
||||||
WARP_HELP_TELEPORT=§8/§ewarp §8[§7Name§8] §8- §7Teleportiere dich zu einen Warp-Punkt
|
|
||||||
WARP_HELP_INFO=§8/§ewarp info §8[§7Name§8] §8- §7Infos zu einem Punkt
|
|
||||||
WARP_HELP_DELETE=§8/§ewarp delete §8[§7Name§8] §8- §7Lösche einen Warp
|
|
||||||
WARP_HELP_GUI=§8/§ewarp gui §8- §7Öffne die Warp-GUI
|
|
||||||
WARP_HELP_LIST=§8/§ewarp list §8- §7Liste alle Warp-Punkt auf
|
|
||||||
# WORLD
|
|
||||||
STOP_HELP=§8/§estop §8- §7Stoppt den Server
|
|
||||||
STOP_MESSAGE=§eDer Server wird gestoppt
|
|
||||||
KICKALL_HELP=§8/§ekickall §8- §7Kickt alle Spieler vom Server außer den Owner
|
|
||||||
# Techhider
|
|
||||||
TECHHIDER_HELP=§8/§etechhider §8- §7Techhider umschalten
|
|
||||||
TECHHIDER_GLOBAL=§cKein Techhider in der globalen region
|
|
||||||
TECHHIDER_ON=§aTechhider aktiviert
|
|
||||||
TECHHIDER_OFF=§cTechHider deaktiviert
|
|
||||||
# XRAY
|
|
||||||
XRAY_HELP=§8/§exray §8- §7Xray umschalten
|
|
||||||
XRAY_GLOBAL=§cKein Xray in der globalen region
|
|
||||||
XRAY_ON=§aXray aktiviert
|
|
||||||
XRAY_OFF=§cXray deaktiviert
|
|
||||||
# WorldEdit
|
|
||||||
COLORREPLACE_HELP=§8//§ecolorreplace §8[§7color§8] §8[§7color§8] §8- §7Ersetzt eine Farbe mit einer anderen
|
|
||||||
TYPEREPLACE_HELP=§8//§etyreplace §8[§7type§8] §8[§7type§8] §8- §7Ersetzt einen Blockgruppe mit einer anderen
|
|
||||||
# Schematics
|
|
||||||
SCHEMATIC_GUI_ITEM=§eSchematics
|
|
0
BauSystem_Main/src/BauSystem_en.properties
Normale Datei
0
BauSystem_Main/src/BauSystem_en.properties
Normale Datei
@ -19,46 +19,47 @@
|
|||||||
|
|
||||||
package de.steamwar.bausystem;
|
package de.steamwar.bausystem;
|
||||||
|
|
||||||
import com.comphenix.tinyprotocol.TinyProtocol;
|
|
||||||
import de.steamwar.bausystem.configplayer.Config;
|
import de.steamwar.bausystem.configplayer.Config;
|
||||||
import de.steamwar.bausystem.features.tpslimit.TPSFreezeUtils;
|
|
||||||
import de.steamwar.bausystem.linkage.LinkageUtils;
|
import de.steamwar.bausystem.linkage.LinkageUtils;
|
||||||
import de.steamwar.bausystem.region.loader.PrototypeLoader;
|
import de.steamwar.bausystem.region.loader.PrototypeLoader;
|
||||||
import de.steamwar.bausystem.region.loader.RegionLoader;
|
import de.steamwar.bausystem.region.loader.RegionLoader;
|
||||||
import de.steamwar.bausystem.region.loader.Updater;
|
import de.steamwar.bausystem.region.loader.Updater;
|
||||||
import de.steamwar.bausystem.utils.TickListener;
|
import de.steamwar.bausystem.utils.ProtocolAPI;
|
||||||
import de.steamwar.bausystem.worlddata.WorldData;
|
import de.steamwar.bausystem.worlddata.WorldData;
|
||||||
import de.steamwar.command.AbstractValidator;
|
|
||||||
import de.steamwar.command.SWCommandUtils;
|
|
||||||
import de.steamwar.message.Message;
|
import de.steamwar.message.Message;
|
||||||
|
import de.steamwar.scoreboard.SWScoreboard;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.World;
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.plugin.Plugin;
|
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
import org.bukkit.scheduler.BukkitRunnable;
|
|
||||||
import org.bukkit.scheduler.BukkitTask;
|
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.io.PrintStream;
|
import java.io.PrintStream;
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.nio.file.Files;
|
||||||
import java.util.function.Consumer;
|
import java.nio.file.Path;
|
||||||
|
import java.nio.file.attribute.BasicFileAttributes;
|
||||||
|
import java.nio.file.attribute.FileTime;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
public class BauSystem extends JavaPlugin implements Listener {
|
public class BauSystem extends JavaPlugin implements Listener {
|
||||||
|
|
||||||
// This should be treated as final!
|
// This should be treated as final!
|
||||||
public static Message MESSAGE;
|
public static Message MESSAGE;
|
||||||
public static final boolean DEV_SERVER = !System.getProperty("user.home").endsWith("minecraft");
|
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private static BauSystem instance;
|
private static BauSystem instance;
|
||||||
|
|
||||||
|
private World world;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
|
SWScoreboard.class.getName();
|
||||||
|
world = Bukkit.getWorlds().get(0);
|
||||||
|
fixBauSystem();
|
||||||
|
|
||||||
// LOGGER
|
// LOGGER
|
||||||
fixLogging();
|
fixLogging();
|
||||||
|
|
||||||
@ -73,40 +74,13 @@ public class BauSystem extends JavaPlugin implements Listener {
|
|||||||
} catch (SecurityException e) {
|
} catch (SecurityException e) {
|
||||||
Bukkit.getLogger().log(Level.SEVERE, e.getMessage(), e);
|
Bukkit.getLogger().log(Level.SEVERE, e.getMessage(), e);
|
||||||
Bukkit.shutdown();
|
Bukkit.shutdown();
|
||||||
System.exit(1);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
new Updater(PrototypeLoader.file, PrototypeLoader::load);
|
new Updater(PrototypeLoader.file, PrototypeLoader::load);
|
||||||
new Updater(RegionLoader.file, RegionLoader::load);
|
new Updater(RegionLoader.file, RegionLoader::load);
|
||||||
|
|
||||||
SWCommandUtils.addValidator(Player.class, validator(Permission.BUILD));
|
|
||||||
SWCommandUtils.addValidator(CommandSender.class, validator(Permission.BUILD));
|
|
||||||
SWCommandUtils.addValidator("supervisor", validator(Permission.SUPERVISOR));
|
|
||||||
SWCommandUtils.addValidator("owner", validator(Permission.OWNER));
|
|
||||||
|
|
||||||
try {
|
|
||||||
LinkageUtils.link();
|
LinkageUtils.link();
|
||||||
} catch (Exception e) {
|
|
||||||
Bukkit.getLogger().log(Level.SEVERE, e.getMessage(), e);
|
|
||||||
Bukkit.shutdown();
|
|
||||||
System.exit(1);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
TickListener.impl.init();
|
|
||||||
}
|
|
||||||
|
|
||||||
private <T extends CommandSender> AbstractValidator<T, ?> validator(Permission permission) {
|
|
||||||
return (commandSender, object, messageSender) -> {
|
|
||||||
if (commandSender instanceof Player) {
|
|
||||||
if (permission.hasPermission((Player) commandSender)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
messageSender.send("NO_PERMISSION");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -115,7 +89,7 @@ public class BauSystem extends JavaPlugin implements Listener {
|
|||||||
|
|
||||||
WorldData.write();
|
WorldData.write();
|
||||||
Config.getInstance().saveAll();
|
Config.getInstance().saveAll();
|
||||||
TinyProtocol.instance.close();
|
ProtocolAPI.tinyProtocol.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void fixLogging() {
|
private void fixLogging() {
|
||||||
@ -139,44 +113,59 @@ public class BauSystem extends JavaPlugin implements Listener {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static BukkitTask runTaskLater(Plugin plugin, Runnable runnable, long delay) {
|
private void fixBauSystem() {
|
||||||
return new BukkitRunnable() {
|
if (!new File(world.getWorldFolder(), "sections.yml").exists()) {
|
||||||
private int counter = 1;
|
try {
|
||||||
|
Path path = new File(world.getWorldFolder(), "region").toPath();
|
||||||
@Override
|
BasicFileAttributes attributes = Files.readAttributes(path, BasicFileAttributes.class);
|
||||||
public void run() {
|
FileTime creationTime = attributes.creationTime();
|
||||||
if (TPSFreezeUtils.isFrozen()) return;
|
long millis = creationTime.toMillis();
|
||||||
if (counter >= delay) {
|
if (millis < 1611081960) {
|
||||||
runnable.run();
|
createLink("sections3.yml", "sections.yml");
|
||||||
cancel();
|
} else {
|
||||||
|
createLink("sections4.yml", "sections.yml");
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
Bukkit.getLogger().log(Level.SEVERE, e.getMessage(), e);
|
||||||
|
Bukkit.shutdown();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
counter++;
|
|
||||||
}
|
}
|
||||||
}.runTaskTimer(plugin, 0, 1);
|
int number = -1;
|
||||||
}
|
try {
|
||||||
|
String string = new File(world.getWorldFolder(), "sections.yml").getCanonicalPath();
|
||||||
public static BukkitTask runTaskTimer(Plugin plugin, Runnable runnable, long delay, long period) {
|
if (string.endsWith("/sections2.yml")) number = 2;
|
||||||
return new BukkitRunnable() {
|
if (string.endsWith("/sections3.yml")) number = 3;
|
||||||
private int counter = 1;
|
if (string.endsWith("/sections4.yml")) number = 4;
|
||||||
private boolean first = true;
|
Bukkit.getLogger().log(Level.INFO, "SectionFile: " + string);
|
||||||
|
} catch (IOException e) {
|
||||||
@Override
|
Bukkit.getLogger().log(Level.SEVERE, e.getMessage(), e);
|
||||||
public void run() {
|
Bukkit.shutdown();
|
||||||
if (TPSFreezeUtils.isFrozen()) return;
|
|
||||||
if (counter >= (first ? delay : period)) {
|
|
||||||
first = false;
|
|
||||||
runnable.run();
|
|
||||||
counter = 1;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
counter++;
|
if (number == -1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!new File(world.getWorldFolder(),"prototypes.yapion").exists()) {
|
||||||
|
createLink("prototypes" + number + ".yapion", "prototypes.yapion");
|
||||||
|
}
|
||||||
|
if (!new File(world.getWorldFolder(),"regions.yapion").exists()) {
|
||||||
|
createLink("regions" + number + ".yapion", "regions.yapion");
|
||||||
}
|
}
|
||||||
}.runTaskTimer(plugin, 0, 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void runTaskTimer(Plugin plugin, Consumer<BukkitTask> consumer, long delay, long period) {
|
private void createLink(String source, String destination) {
|
||||||
AtomicReference<BukkitTask> task = new AtomicReference<>();
|
try {
|
||||||
task.set(runTaskTimer(plugin, () -> consumer.accept(task.get()), delay, period));
|
Bukkit.getLogger().log(Level.INFO, "Executing: ln -s /home/minecraft/server/Bau15/{0} {1}", new String[]{source, destination});
|
||||||
|
ProcessBuilder processBuilder = new ProcessBuilder("ln", "-s", "/home/minecraft/server/Bau15/" + source, destination);
|
||||||
|
processBuilder.directory(world.getWorldFolder());
|
||||||
|
processBuilder.inheritIO();
|
||||||
|
|
||||||
|
Process process = processBuilder.start();
|
||||||
|
process.waitFor();
|
||||||
|
} catch (IOException | InterruptedException e) {
|
||||||
|
Thread.currentThread().interrupt();
|
||||||
|
Bukkit.shutdown();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -20,77 +20,72 @@
|
|||||||
package de.steamwar.bausystem;
|
package de.steamwar.bausystem;
|
||||||
|
|
||||||
import de.steamwar.bausystem.config.BauServer;
|
import de.steamwar.bausystem.config.BauServer;
|
||||||
import de.steamwar.bausystem.features.world.BauMemberUpdate;
|
|
||||||
import de.steamwar.bausystem.utils.BauMemberUpdateEvent;
|
|
||||||
import de.steamwar.sql.BauweltMember;
|
import de.steamwar.sql.BauweltMember;
|
||||||
import de.steamwar.sql.SteamwarUser;
|
import de.steamwar.sql.SteamwarUser;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.function.BiConsumer;
|
||||||
import java.util.Set;
|
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
|
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
|
@RequiredArgsConstructor
|
||||||
public enum Permission {
|
public enum Permission {
|
||||||
|
|
||||||
OWNER(bauweltMember -> false),
|
WORLD(BauweltMember::isWorld, (player, target) -> {
|
||||||
SUPERVISOR(bauweltMember -> {
|
target.setWorld(!target.isWorld());
|
||||||
return bauweltMember.isSupervisor();
|
sendMessages(player, target.isWorld(), target, "PERMISSION_WORLD");
|
||||||
}),
|
}),
|
||||||
BUILD(bauweltMember -> {
|
WORLDEDIT(BauweltMember::isWorldEdit, (player, target) -> {
|
||||||
if (isTempOnlySpectator(bauweltMember)) return false;
|
target.setWorldEdit(!target.isWorldEdit());
|
||||||
return bauweltMember.isBuild() || SUPERVISOR.permissionPredicate.test(bauweltMember);
|
sendMessages(player, target.isWorldEdit(), target, "PERMISSION_WORLD_EDIT");
|
||||||
}),
|
}),
|
||||||
/**
|
MEMBER(bauweltMember -> true),
|
||||||
* Only used for {@link BauMemberUpdate}
|
OWNER(bauweltMember -> false);
|
||||||
*/
|
|
||||||
REAL_SPECTATOR(bauweltMember -> {
|
|
||||||
return !bauweltMember.isBuild() && !bauweltMember.isSupervisor();
|
|
||||||
}),
|
|
||||||
/**
|
|
||||||
* Primarily used for {@link de.steamwar.bausystem.linkage.specific.GuiItem}
|
|
||||||
*/
|
|
||||||
MEMBER(bauweltMember -> {
|
|
||||||
return true;
|
|
||||||
});
|
|
||||||
|
|
||||||
private static final Set<Integer> TEMP_ONLY_SPECTATOR = new HashSet<>();
|
|
||||||
|
|
||||||
private static boolean isTempOnlySpectator(BauweltMember bauweltMember) {
|
|
||||||
return TEMP_ONLY_SPECTATOR.contains(bauweltMember.getMemberID());
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean isTempOnlySpectator(Player player) {
|
|
||||||
return TEMP_ONLY_SPECTATOR.contains(SteamwarUser.get(player.getUniqueId()).getId());
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void forceOnlySpectator(Player player) {
|
|
||||||
TEMP_ONLY_SPECTATOR.add(SteamwarUser.get(player.getUniqueId()).getId());
|
|
||||||
BauMemberUpdate.baumemberUpdate();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Only used by {@link BauMemberUpdate}
|
|
||||||
*/
|
|
||||||
public static void removeForceOnlySpectator(Player player) {
|
|
||||||
TEMP_ONLY_SPECTATOR.remove(SteamwarUser.get(player.getUniqueId()).getId());
|
|
||||||
}
|
|
||||||
|
|
||||||
private final Predicate<BauweltMember> permissionPredicate;
|
private final Predicate<BauweltMember> permissionPredicate;
|
||||||
|
private BiConsumer<Player, BauweltMember> permissionChange = (player, bauweltMember) -> {};
|
||||||
public boolean hasPermission(BauweltMember bauweltMember) {
|
|
||||||
if (bauweltMember == null) return false;
|
|
||||||
return permissionPredicate.test(bauweltMember);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean hasPermission(Player member) {
|
public boolean hasPermission(Player member) {
|
||||||
if (SteamwarUser.get(member.getUniqueId()).getId() == BauServer.getInstance().getOwnerID()) {
|
if (member.getUniqueId().equals(BauServer.getInstance().getOwner())) {
|
||||||
return this != REAL_SPECTATOR;
|
return true;
|
||||||
}
|
}
|
||||||
BauweltMember bauweltMember = BauweltMember.getBauMember(BauServer.getInstance().getOwner(), member.getUniqueId());
|
|
||||||
if (bauweltMember == null) return this == REAL_SPECTATOR;
|
BauweltMember bauMember = BauweltMember.getBauMember(BauServer.getInstance().getOwner(), member.getUniqueId());
|
||||||
return permissionPredicate.test(bauweltMember);
|
if (bauMember == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return permissionPredicate.test(bauMember);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean hasPermission(Player member, Permission permission) {
|
||||||
|
return permission.hasPermission(member);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void sendMessages(Player player, boolean ableTo, BauweltMember target, String what) {
|
||||||
|
Player targetPlayer = Bukkit.getPlayer(SteamwarUser.get(target.getMemberID()).getUUID());
|
||||||
|
if (targetPlayer != null) {
|
||||||
|
if (ableTo) {
|
||||||
|
BauSystem.MESSAGE.send("PERMISSION_CHANGE_OTHER_ENABLE", targetPlayer, player.getName(), BauSystem.MESSAGE.parse(what, targetPlayer));
|
||||||
|
} else {
|
||||||
|
BauSystem.MESSAGE.send("PERMISSION_CHANGE_OTHER_DISABLE", targetPlayer, player.getName(), BauSystem.MESSAGE.parse(what, targetPlayer));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ableTo) {
|
||||||
|
BauSystem.MESSAGE.send("PERMISSION_CHANGE_YOU_ENABLE", player, BauSystem.MESSAGE.parse(what, player));
|
||||||
|
} else {
|
||||||
|
BauSystem.MESSAGE.send("PERMISSION_CHANGE_YOU_DISABLE", player, BauSystem.MESSAGE.parse(what, player));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void toggle(Player player, BauweltMember target) {
|
||||||
|
permissionChange.accept(player, target);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void toggle(Player player, BauweltMember target, Permission permission) {
|
||||||
|
permission.toggle(player, target);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -19,14 +19,15 @@
|
|||||||
|
|
||||||
package de.steamwar.bausystem.config;
|
package de.steamwar.bausystem.config;
|
||||||
|
|
||||||
import de.steamwar.linkage.Linked;
|
import de.steamwar.bausystem.linkage.LinkageType;
|
||||||
import de.steamwar.providers.BauServerInfo;
|
import de.steamwar.bausystem.linkage.Linked;
|
||||||
import de.steamwar.sql.SteamwarUser;
|
import de.steamwar.sql.SteamwarUser;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
@Linked
|
@Linked(LinkageType.PLAIN)
|
||||||
public class BauServer {
|
public class BauServer {
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@ -34,19 +35,30 @@ public class BauServer {
|
|||||||
|
|
||||||
public BauServer() {
|
public BauServer() {
|
||||||
instance = this;
|
instance = this;
|
||||||
|
|
||||||
|
try {
|
||||||
|
owner = UUID.fromString(Bukkit.getWorlds().get(0).getName());
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
owner = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Integer owner;
|
private UUID owner;
|
||||||
|
|
||||||
public UUID getOwner() {
|
public UUID getOwner() {
|
||||||
return SteamwarUser.get(getOwnerID()).getUUID();
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getOwnerID() {
|
|
||||||
//Lazy loading to improve startup time of the server in 1.15
|
//Lazy loading to improve startup time of the server in 1.15
|
||||||
if (owner == null) {
|
if (owner == null) {
|
||||||
owner = BauServerInfo.getOwnerId();
|
try {
|
||||||
|
owner = SteamwarUser.get(Integer.parseInt(Bukkit.getWorlds().get(0).getName())).getUUID();
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
Bukkit.shutdown();
|
||||||
|
throw new SecurityException("owner is not a UserID", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return owner;
|
return owner;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getOwnerID() {
|
||||||
|
return SteamwarUser.get(getOwner()).getId();
|
||||||
|
}
|
||||||
}
|
}
|
@ -20,7 +20,8 @@
|
|||||||
package de.steamwar.bausystem.configplayer;
|
package de.steamwar.bausystem.configplayer;
|
||||||
|
|
||||||
import de.steamwar.bausystem.configplayer.serializer.ConfigurationSerializableSerializer;
|
import de.steamwar.bausystem.configplayer.serializer.ConfigurationSerializableSerializer;
|
||||||
import de.steamwar.linkage.Linked;
|
import de.steamwar.bausystem.linkage.LinkageType;
|
||||||
|
import de.steamwar.bausystem.linkage.Linked;
|
||||||
import de.steamwar.sql.UserConfig;
|
import de.steamwar.sql.UserConfig;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
@ -39,7 +40,7 @@ import java.util.Map;
|
|||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
@Linked
|
@Linked(LinkageType.LISTENER)
|
||||||
public class Config implements Listener {
|
public class Config implements Listener {
|
||||||
|
|
||||||
static {
|
static {
|
||||||
@ -97,7 +98,7 @@ public class Config implements Listener {
|
|||||||
|
|
||||||
public void saveAll() {
|
public void saveAll() {
|
||||||
playerConfigurations.forEach((uuid, yapionObject) -> {
|
playerConfigurations.forEach((uuid, yapionObject) -> {
|
||||||
String string = yapionObject.toYAPION(new StringOutput()).getResult().replaceAll("\\+", "\\");
|
String string = yapionObject.toYAPION(new StringOutput()).getResult();
|
||||||
UserConfig.updatePlayerConfig(uuid, "bausystem", string);
|
UserConfig.updatePlayerConfig(uuid, "bausystem", string);
|
||||||
});
|
});
|
||||||
playerConfigurations.clear();
|
playerConfigurations.clear();
|
||||||
@ -112,7 +113,7 @@ public class Config implements Listener {
|
|||||||
UUID uuid = player.getUniqueId();
|
UUID uuid = player.getUniqueId();
|
||||||
if (playerConfigurations.containsKey(uuid)) {
|
if (playerConfigurations.containsKey(uuid)) {
|
||||||
YAPIONObject yapionObject = playerConfigurations.get(uuid);
|
YAPIONObject yapionObject = playerConfigurations.get(uuid);
|
||||||
String string = yapionObject.toYAPION(new StringOutput()).getResult().replaceAll("\\\\+", "\\\\");
|
String string = yapionObject.toYAPION(new StringOutput()).getResult();
|
||||||
UserConfig.updatePlayerConfig(uuid, "bausystem", string);
|
UserConfig.updatePlayerConfig(uuid, "bausystem", string);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,112 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of the SteamWar software.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2022 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.bausystem.features.attributescopy;
|
|
||||||
|
|
||||||
import de.steamwar.bausystem.BauSystem;
|
|
||||||
import de.steamwar.command.PreviousArguments;
|
|
||||||
import de.steamwar.command.SWCommand;
|
|
||||||
import de.steamwar.command.TypeMapper;
|
|
||||||
import de.steamwar.linkage.Linked;
|
|
||||||
import de.steamwar.linkage.MinVersion;
|
|
||||||
import org.bukkit.command.CommandSender;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
|
||||||
import org.bukkit.inventory.meta.ItemMeta;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
@Linked
|
|
||||||
public class AttributeRemoveCommand extends SWCommand {
|
|
||||||
|
|
||||||
public AttributeRemoveCommand() {
|
|
||||||
super("removeattribute", "attributesremove");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Register({"all"})
|
|
||||||
@Register({"*"})
|
|
||||||
public void genericCommand(@Validator Player player) {
|
|
||||||
ItemStack itemStack = player.getInventory().getItemInMainHand();
|
|
||||||
ItemMeta itemMeta = itemStack.getItemMeta();
|
|
||||||
itemMeta.setLore(new ArrayList<>());
|
|
||||||
itemStack.setItemMeta(itemMeta);
|
|
||||||
BauSystem.MESSAGE.send("ATTRIBUTE_REMOVE_ALL", player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Register(description = "ATTRIBUTE_REMOVE_COMMAND_HELP")
|
|
||||||
public void genericCommand(@Validator Player player, @Mapper("attribute") String attribute) {
|
|
||||||
ItemStack itemStack = player.getInventory().getItemInMainHand();
|
|
||||||
ItemMeta itemMeta = itemStack.getItemMeta();
|
|
||||||
if (itemMeta == null) {
|
|
||||||
BauSystem.MESSAGE.send("ATTRIBUTE_REMOVE_NOT_FOUND", player);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
List<String> lore = itemMeta.getLore();
|
|
||||||
if (lore == null) {
|
|
||||||
BauSystem.MESSAGE.send("ATTRIBUTE_REMOVE_NOT_FOUND", player);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (lore.isEmpty()) {
|
|
||||||
BauSystem.MESSAGE.send("ATTRIBUTE_REMOVE_NOT_FOUND", player);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!lore.get(0).equals("§eAttributes§8:")) {
|
|
||||||
BauSystem.MESSAGE.send("ATTRIBUTE_REMOVE_NOT_FOUND", player);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
lore.removeIf(s -> s.startsWith("§8-§7 " + attribute + "§8:"));
|
|
||||||
if (lore.size() == 1) {
|
|
||||||
itemStack.setItemMeta(null);
|
|
||||||
} else {
|
|
||||||
itemMeta.setLore(lore);
|
|
||||||
itemStack.setItemMeta(itemMeta);
|
|
||||||
}
|
|
||||||
BauSystem.MESSAGE.send("ATTRIBUTE_REMOVE_SINGLE", player, attribute);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Mapper(value = "attribute", local = true)
|
|
||||||
public TypeMapper<String> attribute() {
|
|
||||||
return new TypeMapper<String>() {
|
|
||||||
@Override
|
|
||||||
public Collection<String> tabCompletes(CommandSender commandSender, PreviousArguments previousArguments, String s) {
|
|
||||||
Player player = (Player) commandSender;
|
|
||||||
ItemStack itemStack = player.getInventory().getItemInMainHand();
|
|
||||||
ItemMeta itemMeta = itemStack.getItemMeta();
|
|
||||||
if (itemMeta == null) return null;
|
|
||||||
List<String> lore = itemMeta.getLore();
|
|
||||||
if (lore == null) return null;
|
|
||||||
if (lore.isEmpty()) return null;
|
|
||||||
if (!lore.get(0).equals("§eAttributes§8:")) return null;
|
|
||||||
return lore.stream()
|
|
||||||
.skip(1)
|
|
||||||
.map(s1 -> s1.substring(6))
|
|
||||||
.map(s1 -> s1.substring(0, s1.indexOf("§8:")))
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String map(CommandSender commandSender, PreviousArguments previousArguments, String s) {
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,128 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of the SteamWar software.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2023 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.bausystem.features.attributescopy;
|
|
||||||
|
|
||||||
import lombok.experimental.UtilityClass;
|
|
||||||
import org.bukkit.block.data.BlockData;
|
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@UtilityClass
|
|
||||||
public class AttributeUtils {
|
|
||||||
|
|
||||||
private Map<Method, String> names = new HashMap<>();
|
|
||||||
private Map<Class<?>, List<Method>> getters = new HashMap<>();
|
|
||||||
private Map<Class<?>, Map<String, Method>> setters = new HashMap<>();
|
|
||||||
|
|
||||||
private void generate(BlockData blockData) {
|
|
||||||
Class<? extends BlockData> clazz = blockData.getClass();
|
|
||||||
if (getters.containsKey(clazz) && setters.containsKey(clazz)) return;
|
|
||||||
|
|
||||||
Map<String, List<Method>> methods = new HashMap<>();
|
|
||||||
for (Method declaredMethod : clazz.getMethods()) {
|
|
||||||
String s = declaredMethod.getName();
|
|
||||||
if (s.startsWith("get") && declaredMethod.getParameterCount() == 0) {
|
|
||||||
methods.computeIfAbsent(s.substring(3), aClass -> new ArrayList<>()).add(declaredMethod);
|
|
||||||
} else if (s.startsWith("is") && declaredMethod.getParameterCount() == 0) {
|
|
||||||
methods.computeIfAbsent(s.substring(2), aClass -> new ArrayList<>()).add(declaredMethod);
|
|
||||||
} else if (s.startsWith("set") && declaredMethod.getParameterCount() == 1) {
|
|
||||||
methods.computeIfAbsent(s.substring(3), aClass -> new ArrayList<>()).add(declaredMethod);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (Map.Entry<String, List<Method>> entry : methods.entrySet()) {
|
|
||||||
if (entry.getValue().size() != 2) continue;
|
|
||||||
for (Method method : entry.getValue()) {
|
|
||||||
names.put(method, entry.getKey());
|
|
||||||
if (method.getName().startsWith("is") || method.getName().startsWith("get")) {
|
|
||||||
getters.computeIfAbsent(clazz, aClass -> new ArrayList<>()).add(method);
|
|
||||||
} else {
|
|
||||||
setters.computeIfAbsent(clazz, aClass -> new HashMap<>()).put(entry.getKey(), method);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void copy(BlockData blockData, List<String> attributes) {
|
|
||||||
generate(blockData);
|
|
||||||
|
|
||||||
getters.getOrDefault(blockData.getClass(), new ArrayList<>()).forEach(method -> {
|
|
||||||
try {
|
|
||||||
Object invoke = method.invoke(blockData);
|
|
||||||
if (invoke != null) {
|
|
||||||
attributes.add("§8-§7 " + names.get(method) + "§8:§7 " + convert(invoke));
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public void paste(BlockData blockData, List<String> attributes) {
|
|
||||||
generate(blockData);
|
|
||||||
|
|
||||||
for (String attribute : attributes) {
|
|
||||||
String[] split = attribute.split("§8:§7 ");
|
|
||||||
if (split.length != 2) continue;
|
|
||||||
String name = split[0].substring(6);
|
|
||||||
String value = split[1];
|
|
||||||
Method method = setters.getOrDefault(blockData.getClass(), new HashMap<>()).get(name);
|
|
||||||
if (method == null) continue;
|
|
||||||
try {
|
|
||||||
method.invoke(blockData, convert(value, method.getParameterTypes()[0]));
|
|
||||||
} catch (Exception e) {
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private String convert(Object o) {
|
|
||||||
if (o.getClass().isEnum()) {
|
|
||||||
return ((Enum<?>) o).name();
|
|
||||||
} else {
|
|
||||||
return o.toString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private Object convert(String s, Class<?> type) {
|
|
||||||
if (type.isEnum()) {
|
|
||||||
return Enum.valueOf((Class<? extends Enum>) type, s);
|
|
||||||
} else if (type == int.class || type == Integer.class) {
|
|
||||||
return Integer.parseInt(s);
|
|
||||||
} else if (type == double.class || type == Double.class) {
|
|
||||||
return Double.parseDouble(s);
|
|
||||||
} else if (type == float.class || type == Float.class) {
|
|
||||||
return Float.parseFloat(s);
|
|
||||||
} else if (type == long.class || type == Long.class) {
|
|
||||||
return Long.parseLong(s);
|
|
||||||
} else if (type == short.class || type == Short.class) {
|
|
||||||
return Short.parseShort(s);
|
|
||||||
} else if (type == byte.class || type == Byte.class) {
|
|
||||||
return Byte.parseByte(s);
|
|
||||||
} else if (type == boolean.class || type == Boolean.class) {
|
|
||||||
return Boolean.parseBoolean(s);
|
|
||||||
} else {
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,88 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of the SteamWar software.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2022 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.bausystem.features.attributescopy;
|
|
||||||
|
|
||||||
import de.steamwar.bausystem.BauSystem;
|
|
||||||
import de.steamwar.command.SWCommand;
|
|
||||||
import de.steamwar.linkage.Linked;
|
|
||||||
import org.bukkit.FluidCollisionMode;
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.block.Block;
|
|
||||||
import org.bukkit.block.data.BlockData;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
|
||||||
import org.bukkit.inventory.meta.ItemMeta;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Linked
|
|
||||||
public class AttributesCopyCommand extends SWCommand {
|
|
||||||
|
|
||||||
public AttributesCopyCommand() {
|
|
||||||
super("copyattributes", "attributescopy", "ac");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Register
|
|
||||||
public void genericCommand(@Validator Player player) {
|
|
||||||
Block block = player.getTargetBlockExact(8, FluidCollisionMode.ALWAYS);
|
|
||||||
if (block == null) return;
|
|
||||||
ItemStack mainHand = player.getInventory().getItemInMainHand();
|
|
||||||
|
|
||||||
if (!(block.getType().isItem() && block.getType() == mainHand.getType() || isSame(block, mainHand))) {
|
|
||||||
BauSystem.MESSAGE.send("ATTRIBUTES_CANT_COPY", player);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
BlockData blockData = block.getBlockData();
|
|
||||||
List<String> attributesToCopy = new ArrayList<>();
|
|
||||||
if (block.getType() != mainHand.getType()) {
|
|
||||||
attributesToCopy.add("§8-§7 Material§8:§7 " + block.getType().name());
|
|
||||||
}
|
|
||||||
AttributeUtils.copy(blockData, attributesToCopy);
|
|
||||||
if (attributesToCopy.isEmpty()) {
|
|
||||||
BauSystem.MESSAGE.send("ATTRIBUTES_NO_COPY", player);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
ItemMeta itemMeta = mainHand.getItemMeta();
|
|
||||||
List<String> lore = new ArrayList<>(attributesToCopy);
|
|
||||||
lore.add(0, "§eAttributes§8:");
|
|
||||||
itemMeta.setLore(lore);
|
|
||||||
mainHand.setItemMeta(itemMeta);
|
|
||||||
player.getInventory().setItemInMainHand(mainHand);
|
|
||||||
BauSystem.MESSAGE.send("ATTRIBUTES_COPIED", player);
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean isSame(Block block, ItemStack itemStack) {
|
|
||||||
if (itemStack.getType() == Material.REDSTONE && block.getType() == Material.REDSTONE_WIRE) return true;
|
|
||||||
if (itemStack.getType() == Material.PLAYER_HEAD && block.getType() == Material.PLAYER_WALL_HEAD) return true;
|
|
||||||
if (itemStack.getType() == Material.ZOMBIE_HEAD && block.getType() == Material.ZOMBIE_WALL_HEAD) return true;
|
|
||||||
if (itemStack.getType() == Material.CREEPER_HEAD && block.getType() == Material.CREEPER_WALL_HEAD) return true;
|
|
||||||
if (itemStack.getType() == Material.DRAGON_HEAD && block.getType() == Material.DRAGON_WALL_HEAD) return true;
|
|
||||||
if (itemStack.getType() == Material.SKELETON_SKULL && block.getType() == Material.SKELETON_WALL_SKULL) return true;
|
|
||||||
if (itemStack.getType() == Material.WITHER_SKELETON_SKULL && block.getType() == Material.WITHER_SKELETON_WALL_SKULL) return true;
|
|
||||||
if (itemStack.getType() == Material.TORCH && block.getType() == Material.WALL_TORCH) return true;
|
|
||||||
if (itemStack.getType() == Material.SOUL_TORCH && block.getType() == Material.SOUL_WALL_TORCH) return true;
|
|
||||||
if (itemStack.getType() == Material.REDSTONE_TORCH && block.getType() == Material.REDSTONE_WALL_TORCH) return true;
|
|
||||||
if (itemStack.getType() == Material.WHEAT_SEEDS && block.getType() == Material.WHEAT) return true;
|
|
||||||
if (itemStack.getType().name().contains("_BANNER") && block.getType().name().contains("_WALL_BANNER")) return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,88 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of the SteamWar software.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2022 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.bausystem.features.attributescopy;
|
|
||||||
|
|
||||||
import de.steamwar.bausystem.BauSystem;
|
|
||||||
import de.steamwar.bausystem.Permission;
|
|
||||||
import de.steamwar.linkage.Linked;
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.OfflinePlayer;
|
|
||||||
import org.bukkit.block.Block;
|
|
||||||
import org.bukkit.block.Skull;
|
|
||||||
import org.bukkit.block.data.BlockData;
|
|
||||||
import org.bukkit.event.EventHandler;
|
|
||||||
import org.bukkit.event.Listener;
|
|
||||||
import org.bukkit.event.block.BlockPlaceEvent;
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
|
||||||
import org.bukkit.inventory.meta.ItemMeta;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Linked
|
|
||||||
public class AttributesPlaceListener implements Listener {
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onBlockPlace(BlockPlaceEvent event) {
|
|
||||||
if(!Permission.BUILD.hasPermission(event.getPlayer())) return;
|
|
||||||
ItemStack itemStack = event.getItemInHand();
|
|
||||||
ItemMeta itemMeta = itemStack.getItemMeta();
|
|
||||||
if (itemMeta == null) return;
|
|
||||||
List<String> strings = itemMeta.getLore();
|
|
||||||
if (strings == null) return;
|
|
||||||
if (strings.isEmpty()) return;
|
|
||||||
if (!strings.get(0).equals("§eAttributes§8:")) return;
|
|
||||||
Material type = event.getBlock().getType();
|
|
||||||
OfflinePlayer offlinePlayer = null;
|
|
||||||
if (event.getBlock().getState() instanceof Skull) {
|
|
||||||
Skull skull = (Skull) event.getBlock().getState();
|
|
||||||
offlinePlayer = skull.getOwningPlayer();
|
|
||||||
}
|
|
||||||
OfflinePlayer finalPlayerProfile = offlinePlayer;
|
|
||||||
event.setCancelled(true);
|
|
||||||
Bukkit.getScheduler().runTaskLater(BauSystem.getInstance(), () -> {
|
|
||||||
Material material = strings.stream()
|
|
||||||
.filter(s -> s.startsWith("§8-§7 Material§8:§7 "))
|
|
||||||
.map(s -> s.replace("§8-§7 Material§8:§7 ", ""))
|
|
||||||
.map(String::toUpperCase)
|
|
||||||
.map(s -> {
|
|
||||||
try {
|
|
||||||
return Material.valueOf(s);
|
|
||||||
} catch (Exception e) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.findFirst()
|
|
||||||
.orElse(type);
|
|
||||||
event.getBlock().setType(material, false);
|
|
||||||
Block block = event.getBlock();
|
|
||||||
BlockData blockData = block.getBlockData();
|
|
||||||
Bukkit.getScheduler().runTaskLater(BauSystem.getInstance(), () -> {
|
|
||||||
if (block.getState() instanceof Skull && finalPlayerProfile != null) {
|
|
||||||
Skull skull = (Skull) block.getState();
|
|
||||||
skull.setOwningPlayer(finalPlayerProfile);
|
|
||||||
skull.update(true, false);
|
|
||||||
}
|
|
||||||
}, 1);
|
|
||||||
AttributeUtils.paste(blockData, strings);
|
|
||||||
block.setBlockData(blockData, false);
|
|
||||||
}, 1);
|
|
||||||
}
|
|
||||||
}
|
|
@ -20,11 +20,12 @@
|
|||||||
package de.steamwar.bausystem.features.autostart;
|
package de.steamwar.bausystem.features.autostart;
|
||||||
|
|
||||||
import de.steamwar.bausystem.SWUtils;
|
import de.steamwar.bausystem.SWUtils;
|
||||||
|
import de.steamwar.bausystem.linkage.LinkageType;
|
||||||
|
import de.steamwar.bausystem.linkage.Linked;
|
||||||
import de.steamwar.command.SWCommand;
|
import de.steamwar.command.SWCommand;
|
||||||
import de.steamwar.linkage.Linked;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
@Linked
|
@Linked(LinkageType.COMMAND)
|
||||||
public class AutoStartCommand extends SWCommand {
|
public class AutoStartCommand extends SWCommand {
|
||||||
|
|
||||||
public AutoStartCommand() {
|
public AutoStartCommand() {
|
||||||
@ -32,7 +33,7 @@ public class AutoStartCommand extends SWCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Register(description = "AUTOSTART_COMMAND_HELP")
|
@Register(description = "AUTOSTART_COMMAND_HELP")
|
||||||
public void genericCommand(@Validator Player p) {
|
public void genericCommand(Player p) {
|
||||||
SWUtils.giveItemToPlayer(p, AutostartListener.getWandItem(p));
|
SWUtils.giveItemToPlayer(p, AutostartListener.getWandItem(p));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,14 +20,15 @@
|
|||||||
package de.steamwar.bausystem.features.autostart;
|
package de.steamwar.bausystem.features.autostart;
|
||||||
|
|
||||||
import de.steamwar.bausystem.Permission;
|
import de.steamwar.bausystem.Permission;
|
||||||
|
import de.steamwar.bausystem.linkage.LinkageType;
|
||||||
|
import de.steamwar.bausystem.linkage.Linked;
|
||||||
import de.steamwar.bausystem.linkage.specific.BauGuiItem;
|
import de.steamwar.bausystem.linkage.specific.BauGuiItem;
|
||||||
import de.steamwar.linkage.Linked;
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.inventory.ClickType;
|
import org.bukkit.event.inventory.ClickType;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
@Linked
|
@Linked(LinkageType.BAU_GUI_ITEM)
|
||||||
public class AutoStartGuiItem extends BauGuiItem {
|
public class AutoStartGuiItem extends BauGuiItem {
|
||||||
|
|
||||||
public AutoStartGuiItem() {
|
public AutoStartGuiItem() {
|
||||||
@ -50,6 +51,6 @@ public class AutoStartGuiItem extends BauGuiItem {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Permission permission() {
|
public Permission permission() {
|
||||||
return Permission.BUILD;
|
return Permission.MEMBER;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,34 +20,31 @@
|
|||||||
package de.steamwar.bausystem.features.autostart;
|
package de.steamwar.bausystem.features.autostart;
|
||||||
|
|
||||||
import de.steamwar.bausystem.BauSystem;
|
import de.steamwar.bausystem.BauSystem;
|
||||||
import de.steamwar.bausystem.Permission;
|
|
||||||
import de.steamwar.bausystem.features.tpslimit.TPSUtils;
|
import de.steamwar.bausystem.features.tpslimit.TPSUtils;
|
||||||
|
import de.steamwar.bausystem.linkage.LinkageType;
|
||||||
|
import de.steamwar.bausystem.linkage.Linked;
|
||||||
import de.steamwar.bausystem.region.Region;
|
import de.steamwar.bausystem.region.Region;
|
||||||
import de.steamwar.bausystem.region.RegionUtils;
|
import de.steamwar.bausystem.region.RegionUtils;
|
||||||
import de.steamwar.bausystem.region.utils.RegionExtensionType;
|
import de.steamwar.bausystem.region.utils.RegionExtensionType;
|
||||||
import de.steamwar.bausystem.region.utils.RegionType;
|
import de.steamwar.bausystem.region.utils.RegionType;
|
||||||
import de.steamwar.bausystem.utils.ItemUtils;
|
import de.steamwar.bausystem.utils.ItemUtils;
|
||||||
import de.steamwar.inventory.SWItem;
|
import de.steamwar.inventory.SWItem;
|
||||||
import de.steamwar.linkage.Linked;
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.data.type.Chest;
|
|
||||||
import org.bukkit.configuration.file.FileConfiguration;
|
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.entity.EntityExplodeEvent;
|
import org.bukkit.event.entity.EntityExplodeEvent;
|
||||||
import org.bukkit.event.inventory.InventoryCloseEvent;
|
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.Arrays;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@Linked
|
@Linked(LinkageType.LISTENER)
|
||||||
public class AutostartListener implements Listener {
|
public class AutostartListener implements Listener {
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@ -68,42 +65,15 @@ public class AutostartListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerInteract(PlayerInteractEvent event) {
|
public void onPlayerInteract(PlayerInteractEvent event) {
|
||||||
if(!Permission.BUILD.hasPermission(event.getPlayer())) return;
|
|
||||||
if (!ItemUtils.isItem(event.getItem(), "autostart")) {
|
if (!ItemUtils.isItem(event.getItem(), "autostart")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (event.getClickedBlock() == null) {
|
if (event.getClickedBlock() == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (event.getClickedBlock().getBlockData() instanceof Chest) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (event.getClickedBlock().getType() == Material.BEDROCK) {
|
|
||||||
event.getClickedBlock().setType(Material.SLIME_BLOCK);
|
|
||||||
Bukkit.getScheduler().runTaskLater(BauSystem.getInstance(), () -> {
|
|
||||||
event.getClickedBlock().setType(Material.BEDROCK, false);
|
|
||||||
}, 1);
|
|
||||||
}
|
|
||||||
activate(event.getPlayer());
|
activate(event.getPlayer());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onInventoryClose(InventoryCloseEvent event) {
|
|
||||||
if (!(event.getPlayer() instanceof Player)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(!Permission.BUILD.hasPermission((Player) event.getPlayer())) return;
|
|
||||||
if (!ItemUtils.isItem(event.getPlayer().getInventory().getItemInMainHand(), "autostart")) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (event.getInventory().getLocation() == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (event.getInventory().getLocation().getBlock().getBlockData() instanceof Chest) {
|
|
||||||
activate((Player) event.getPlayer());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void activate(Player player) {
|
public void activate(Player player) {
|
||||||
Region region = Region.getRegion(player.getLocation());
|
Region region = Region.getRegion(player.getLocation());
|
||||||
if (region.isGlobal()) {
|
if (region.isGlobal()) {
|
||||||
@ -119,7 +89,7 @@ public class AutostartListener implements Listener {
|
|||||||
} else {
|
} else {
|
||||||
BauSystem.MESSAGE.send("AUTOSTART_MESSAGE_START", player);
|
BauSystem.MESSAGE.send("AUTOSTART_MESSAGE_START", player);
|
||||||
}
|
}
|
||||||
regionStartTime.put(region, TPSUtils.currentRealTick.get());
|
regionStartTime.put(region, TPSUtils.currentTick.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
@ -127,24 +97,17 @@ public class AutostartListener implements Listener {
|
|||||||
if (regionStartTime.isEmpty()) {
|
if (regionStartTime.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
event.blockList().forEach(block -> {
|
event.blockList().forEach(block -> {
|
||||||
Region region = Region.getRegion(block.getLocation());
|
Region region = Region.getRegion(block.getLocation());
|
||||||
if (!regionStartTime.containsKey(region)) return;
|
if (!regionStartTime.containsKey(region)) return;
|
||||||
if (!region.hasType(RegionType.TESTBLOCK)) return;
|
if (!region.hasType(RegionType.TESTBLOCK)) return;
|
||||||
if (!region.inRegion(block.getLocation(), RegionType.TESTBLOCK, RegionExtensionType.EXTENSION)) return;
|
if (!region.inRegion(block.getLocation(), RegionType.TESTBLOCK, RegionExtensionType.EXTENSION)) return;
|
||||||
long tickDiff = TPSUtils.currentRealTick.get() - regionStartTime.remove(region);
|
long tickDiff = TPSUtils.currentTick.get() - regionStartTime.remove(region);
|
||||||
long preFightDurationInSeconds = getPreFightDurationInSeconds(region);
|
RegionUtils.message(region, player -> {
|
||||||
RegionUtils.message(region, "AUTOSTART_MESSAGE_RESULT1", tickDiff);
|
return BauSystem.MESSAGE.parse("AUTOSTART_MESSAGE_RESULT1", player, new SimpleDateFormat(BauSystem.MESSAGE.parse("AUTOSTART_MESSAGE_DATE_PATTERN", player)).format(new Date(tickDiff * 50)));
|
||||||
RegionUtils.message(region, "AUTOSTART_MESSAGE_RESULT2", preFightDurationInSeconds, ((preFightDurationInSeconds * 20) - tickDiff));
|
});
|
||||||
|
RegionUtils.message(region, "AUTOSTART_MESSAGE_RESULT2", 30, (600 - tickDiff));
|
||||||
RegionUtils.message(region, "AUTOSTART_MESSAGE_RESULT3");
|
RegionUtils.message(region, "AUTOSTART_MESSAGE_RESULT3");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getPreFightDurationInSeconds(Region region) {
|
|
||||||
File file = region.gameModeConfig();
|
|
||||||
if (file == null) return 30;
|
|
||||||
FileConfiguration config = YamlConfiguration.loadConfiguration(file);
|
|
||||||
return config.getInt("Times.PreFightDuration", 30);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -19,22 +19,15 @@
|
|||||||
|
|
||||||
package de.steamwar.bausystem.features.backup;
|
package de.steamwar.bausystem.features.backup;
|
||||||
|
|
||||||
import com.sk89q.worldedit.EditSession;
|
|
||||||
import de.steamwar.bausystem.BauSystem;
|
import de.steamwar.bausystem.BauSystem;
|
||||||
import de.steamwar.bausystem.Permission;
|
import de.steamwar.bausystem.Permission;
|
||||||
import de.steamwar.bausystem.region.Color;
|
import de.steamwar.bausystem.linkage.LinkageType;
|
||||||
|
import de.steamwar.bausystem.linkage.Linked;
|
||||||
import de.steamwar.bausystem.region.Region;
|
import de.steamwar.bausystem.region.Region;
|
||||||
import de.steamwar.bausystem.region.flags.Flag;
|
|
||||||
import de.steamwar.bausystem.region.flags.flagvalues.ColorMode;
|
|
||||||
import de.steamwar.bausystem.region.tags.Tag;
|
import de.steamwar.bausystem.region.tags.Tag;
|
||||||
import de.steamwar.bausystem.utils.PasteBuilder;
|
import de.steamwar.command.*;
|
||||||
import de.steamwar.command.SWCommand;
|
|
||||||
import de.steamwar.command.SWCommandUtils;
|
|
||||||
import de.steamwar.command.TypeMapper;
|
|
||||||
import de.steamwar.command.TypeValidator;
|
|
||||||
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 net.md_5.bungee.api.chat.ClickEvent;
|
import net.md_5.bungee.api.chat.ClickEvent;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -46,7 +39,7 @@ import java.util.Collections;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Linked
|
@Linked(LinkageType.COMMAND)
|
||||||
public class BackupCommand extends SWCommand {
|
public class BackupCommand extends SWCommand {
|
||||||
|
|
||||||
public BackupCommand() {
|
public BackupCommand() {
|
||||||
@ -62,7 +55,7 @@ public class BackupCommand extends SWCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Register(value = "create", description = "BACKUP_HELP_CREATE")
|
@Register(value = "create", description = "BACKUP_HELP_CREATE")
|
||||||
public void backupCreate(@Validator("owner") Player p) {
|
public void backupCreate(@Guard Player p) {
|
||||||
Region region = Region.getRegion(p.getLocation());
|
Region region = Region.getRegion(p.getLocation());
|
||||||
if (checkGlobalRegion(region, p)) {
|
if (checkGlobalRegion(region, p)) {
|
||||||
return;
|
return;
|
||||||
@ -79,7 +72,7 @@ public class BackupCommand extends SWCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Register(value = "load", description = "BACKUP_HELP_LOAD")
|
@Register(value = "load", description = "BACKUP_HELP_LOAD")
|
||||||
public void backupLoad(@Validator("owner") Player p, @Mapper("backupName") String backupName) {
|
public void backupLoad(@Guard Player p, @Mapper("backupName") String backupName) {
|
||||||
Region region = Region.getRegion(p.getLocation());
|
Region region = Region.getRegion(p.getLocation());
|
||||||
if (checkGlobalRegion(region, p)) {
|
if (checkGlobalRegion(region, p)) {
|
||||||
return;
|
return;
|
||||||
@ -90,13 +83,7 @@ public class BackupCommand extends SWCommand {
|
|||||||
BauSystem.MESSAGE.send("BACKUP_LOAD_FAILURE", p);
|
BauSystem.MESSAGE.send("BACKUP_LOAD_FAILURE", p);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
EditSession editSession = new PasteBuilder(new PasteBuilder.FileProvider(backupFile))
|
region.reset(backupFile);
|
||||||
.pastePoint(region.getMinPoint().add(region.getPrototype().getSizeX() / 2, 0, region.getPrototype().getSizeZ() / 2))
|
|
||||||
.minPoint(region.getMinPoint())
|
|
||||||
.maxPoint(region.getMaxPoint())
|
|
||||||
.waterLevel(region.getWaterLevel())
|
|
||||||
.run();
|
|
||||||
region.remember(editSession);
|
|
||||||
BauSystem.MESSAGE.send("BACKUP_LOAD", p);
|
BauSystem.MESSAGE.send("BACKUP_LOAD", p);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,7 +117,7 @@ public class BackupCommand extends SWCommand {
|
|||||||
}
|
}
|
||||||
SWListInv<String> swListInv = new SWListInv<>(p, BauSystem.MESSAGE.parse("BACKUP_INV_NAME", p), swListEntries, (clickType, s) -> {
|
SWListInv<String> swListInv = new SWListInv<>(p, BauSystem.MESSAGE.parse("BACKUP_INV_NAME", p), swListEntries, (clickType, s) -> {
|
||||||
p.getOpenInventory().close();
|
p.getOpenInventory().close();
|
||||||
p.performCommand("backup load " + s);
|
backupLoad(p, s);
|
||||||
});
|
});
|
||||||
swListInv.open();
|
swListInv.open();
|
||||||
}
|
}
|
||||||
@ -140,6 +127,20 @@ public class BackupCommand extends SWCommand {
|
|||||||
return SWCommandUtils.createMapper(s -> s, (commandSender, s) -> listBackup((Player) commandSender));
|
return SWCommandUtils.createMapper(s -> s, (commandSender, s) -> listBackup((Player) commandSender));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ClassGuard(value = Player.class, local = true)
|
||||||
|
public GuardChecker backupGuard() {
|
||||||
|
return (commandSender, guardCheckType, strings, s) -> {
|
||||||
|
Player player = (Player) commandSender;
|
||||||
|
if (Permission.hasPermission(player, Permission.WORLDEDIT)) {
|
||||||
|
return GuardResult.ALLOWED;
|
||||||
|
}
|
||||||
|
if (guardCheckType != GuardCheckType.TAB_COMPLETE) {
|
||||||
|
BauSystem.MESSAGE.send("BACKUP_NO_PERMS", player);
|
||||||
|
}
|
||||||
|
return GuardResult.DENIED;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
private List<String> listBackup(Player p) {
|
private List<String> listBackup(Player p) {
|
||||||
Region region = Region.getRegion(p.getLocation());
|
Region region = Region.getRegion(p.getLocation());
|
||||||
if (checkGlobalRegion(region, p)) {
|
if (checkGlobalRegion(region, p)) {
|
||||||
|
138
BauSystem_Main/src/de/steamwar/bausystem/features/bau/BauCommand.java
Normale Datei
138
BauSystem_Main/src/de/steamwar/bausystem/features/bau/BauCommand.java
Normale Datei
@ -0,0 +1,138 @@
|
|||||||
|
/*
|
||||||
|
* This file is a part of the SteamWar software.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2021 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.bausystem.features.bau;
|
||||||
|
|
||||||
|
import de.steamwar.bausystem.BauSystem;
|
||||||
|
import de.steamwar.bausystem.Permission;
|
||||||
|
import de.steamwar.bausystem.config.BauServer;
|
||||||
|
import de.steamwar.bausystem.linkage.LinkageType;
|
||||||
|
import de.steamwar.bausystem.linkage.Linked;
|
||||||
|
import de.steamwar.bausystem.linkage.LinkedInstance;
|
||||||
|
import de.steamwar.command.*;
|
||||||
|
import de.steamwar.sql.BauweltMember;
|
||||||
|
import de.steamwar.sql.SteamwarUser;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@Linked(LinkageType.COMMAND)
|
||||||
|
public class BauCommand extends SWCommand {
|
||||||
|
|
||||||
|
@LinkedInstance
|
||||||
|
private BauServer bauServer;
|
||||||
|
|
||||||
|
@LinkedInstance
|
||||||
|
private InfoCommand infoCommand;
|
||||||
|
|
||||||
|
public BauCommand() {
|
||||||
|
super("bau", "b", "gs");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Register(value = "info", description = "BAU_COMMAND_HELP_INFO")
|
||||||
|
public void infoCommand(Player p) {
|
||||||
|
infoCommand.sendBauInfo(p);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Register(value = "togglewe", description = "BAU_COMMAND_HELP_TOGGLEWE")
|
||||||
|
public void toggleWECommand(@Guard Player p, SteamwarUser user) {
|
||||||
|
onToggleWE(p, user);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Register(value = "toggleworld", description = "BAU_COMMAND_HELP_TOGGLEWORLD")
|
||||||
|
public void toggleWorldCommand(@Guard Player p, SteamwarUser user) {
|
||||||
|
onToggleWorld(p, user);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Register("delmember")
|
||||||
|
public void delMemberCommand(Player p, SteamwarUser user) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Register("addmember")
|
||||||
|
public void addMemberCommand(Player p, String s) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onToggleWE(Player p, SteamwarUser id) {
|
||||||
|
if (negativeToggleCheck(p, id)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
BauweltMember target = BauweltMember.getBauMember(bauServer.getOwnerID(), id.getId());
|
||||||
|
Permission.WORLDEDIT.toggle(p, target);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onToggleWorld(Player p, SteamwarUser id) {
|
||||||
|
if (negativeToggleCheck(p, id)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
BauweltMember target = BauweltMember.getBauMember(bauServer.getOwnerID(), id.getId());
|
||||||
|
Permission.WORLD.toggle(p, target);
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean negativeToggleCheck(Player p, SteamwarUser id) {
|
||||||
|
if (id == null) {
|
||||||
|
BauSystem.MESSAGE.send("BAU_UNKNOWN_PLAYER", p);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
BauweltMember target = BauweltMember.getBauMember(bauServer.getOwnerID(), id.getId());
|
||||||
|
if (target == null) {
|
||||||
|
BauSystem.MESSAGE.send("BAU_NO_PLAYER", p);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ClassMapper(value = SteamwarUser.class, local = true)
|
||||||
|
private TypeMapper<SteamwarUser> steamwarUserTypeMapper() {
|
||||||
|
return SWCommandUtils.createMapper(s -> BauweltMember.getMembers(bauServer.getOwnerID())
|
||||||
|
.stream()
|
||||||
|
.map(m -> SteamwarUser.get(m.getMemberID()))
|
||||||
|
.filter(u -> u.getUserName().equals(s))
|
||||||
|
.findFirst()
|
||||||
|
.orElse(null),
|
||||||
|
(c, s) -> {
|
||||||
|
if (!(c instanceof Player)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
Player p = (Player) c;
|
||||||
|
return BauweltMember.getMembers(SteamwarUser.get(p.getUniqueId()).getId())
|
||||||
|
.stream()
|
||||||
|
.map(m -> SteamwarUser.get(m.getMemberID()).getUserName())
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@ClassGuard(value = Player.class, local = true)
|
||||||
|
public GuardChecker bauGuard() {
|
||||||
|
return (commandSender, guardCheckType, strings, s) -> {
|
||||||
|
Player p = (Player) commandSender;
|
||||||
|
if (!bauServer.getOwner().equals(p.getUniqueId())) {
|
||||||
|
if (guardCheckType != GuardCheckType.TAB_COMPLETE) {
|
||||||
|
BauSystem.MESSAGE.send("BAU_NO_WORLD", p);
|
||||||
|
}
|
||||||
|
return GuardResult.DENIED;
|
||||||
|
}
|
||||||
|
return GuardResult.ALLOWED;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
@ -22,14 +22,13 @@ package de.steamwar.bausystem.features.bau;
|
|||||||
import de.steamwar.bausystem.BauSystem;
|
import de.steamwar.bausystem.BauSystem;
|
||||||
import de.steamwar.bausystem.Permission;
|
import de.steamwar.bausystem.Permission;
|
||||||
import de.steamwar.bausystem.config.BauServer;
|
import de.steamwar.bausystem.config.BauServer;
|
||||||
|
import de.steamwar.bausystem.linkage.LinkageType;
|
||||||
|
import de.steamwar.bausystem.linkage.Linked;
|
||||||
import de.steamwar.bausystem.linkage.specific.BauGuiItem;
|
import de.steamwar.bausystem.linkage.specific.BauGuiItem;
|
||||||
import de.steamwar.bausystem.region.Region;
|
import de.steamwar.bausystem.region.Region;
|
||||||
import de.steamwar.bausystem.region.flags.Flag;
|
import de.steamwar.bausystem.region.flags.Flag;
|
||||||
import de.steamwar.core.Core;
|
|
||||||
import de.steamwar.inventory.SWItem;
|
import de.steamwar.inventory.SWItem;
|
||||||
import de.steamwar.linkage.Linked;
|
|
||||||
import de.steamwar.sql.SteamwarUser;
|
import de.steamwar.sql.SteamwarUser;
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.inventory.ClickType;
|
import org.bukkit.event.inventory.ClickType;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
@ -37,7 +36,7 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Linked
|
@Linked(LinkageType.BAU_GUI_ITEM)
|
||||||
public class BauInfoBauGuiItem extends BauGuiItem {
|
public class BauInfoBauGuiItem extends BauGuiItem {
|
||||||
|
|
||||||
public BauInfoBauGuiItem() {
|
public BauInfoBauGuiItem() {
|
||||||
@ -46,12 +45,7 @@ public class BauInfoBauGuiItem extends BauGuiItem {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getItem(Player player) {
|
public ItemStack getItem(Player player) {
|
||||||
SWItem itemStack;
|
SWItem itemStack = SWItem.getPlayerSkull(SteamwarUser.get(BauServer.getInstance().getOwner()).getUserName());
|
||||||
if (!player.getName().endsWith("⍇")) {
|
|
||||||
itemStack = SWItem.getPlayerSkull(SteamwarUser.get(BauServer.getInstance().getOwner()).getUserName());
|
|
||||||
} else {
|
|
||||||
itemStack = new SWItem(Material.PLAYER_HEAD, "");
|
|
||||||
}
|
|
||||||
itemStack.setName(BauSystem.MESSAGE.parse("BAU_INFO_ITEM_NAME", player));
|
itemStack.setName(BauSystem.MESSAGE.parse("BAU_INFO_ITEM_NAME", player));
|
||||||
Region region = Region.getRegion(player.getLocation());
|
Region region = Region.getRegion(player.getLocation());
|
||||||
List<String> stringList = new ArrayList<>();
|
List<String> stringList = new ArrayList<>();
|
||||||
@ -59,9 +53,6 @@ public class BauInfoBauGuiItem extends BauGuiItem {
|
|||||||
if (flag == Flag.PROTECT && region.getFloorLevel() == 0) {
|
if (flag == Flag.PROTECT && region.getFloorLevel() == 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (flag == Flag.ITEMS && Core.getVersion() < 19) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
Flag.Value<?> value = region.get(flag);
|
Flag.Value<?> value = region.get(flag);
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
stringList.add(BauSystem.MESSAGE.parse("BAU_INFO_ITEM_LORE_" + flag.name(), player, BauSystem.MESSAGE.parse(value.getChatValue(), player)));
|
stringList.add(BauSystem.MESSAGE.parse("BAU_INFO_ITEM_LORE_" + flag.name(), player, BauSystem.MESSAGE.parse(value.getChatValue(), player)));
|
||||||
|
@ -1,73 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of the SteamWar software.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2023 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.bausystem.features.bau;
|
|
||||||
|
|
||||||
import de.steamwar.bausystem.BauSystem;
|
|
||||||
import de.steamwar.bausystem.Permission;
|
|
||||||
import de.steamwar.command.PreviousArguments;
|
|
||||||
import de.steamwar.command.SWCommand;
|
|
||||||
import de.steamwar.command.TypeMapper;
|
|
||||||
import de.steamwar.linkage.Linked;
|
|
||||||
import de.steamwar.techhider.TechHider;
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.command.CommandSender;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
@Linked
|
|
||||||
public class ForceSpectatorCommand extends SWCommand {
|
|
||||||
|
|
||||||
public ForceSpectatorCommand() {
|
|
||||||
super("forcespectator");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Register
|
|
||||||
public void forceSpectator(@Validator("supervisor") Player player, @Mapper("builder") Player other) {
|
|
||||||
Permission.forceOnlySpectator(other);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Mapper("builder")
|
|
||||||
public TypeMapper<Player> spectatorMapper() {
|
|
||||||
return new TypeMapper<>() {
|
|
||||||
@Override
|
|
||||||
public Player map(CommandSender commandSender, String[] previousArguments, String s) {
|
|
||||||
Player player = Bukkit.getPlayer(s);
|
|
||||||
if (player == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
if (Permission.BUILD.hasPermission(player) && !Permission.SUPERVISOR.hasPermission(player)) {
|
|
||||||
return player;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Collection<String> tabCompletes(CommandSender sender, PreviousArguments previousArguments, String s) {
|
|
||||||
return Bukkit.getOnlinePlayers().stream()
|
|
||||||
.filter(Permission.BUILD::hasPermission)
|
|
||||||
.filter(player -> !Permission.SUPERVISOR.hasPermission(player))
|
|
||||||
.map(Player::getName)
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,32 +1,44 @@
|
|||||||
package de.steamwar.bausystem.features.bau;
|
package de.steamwar.bausystem.features.bau;
|
||||||
|
|
||||||
import de.steamwar.bausystem.BauSystem;
|
import de.steamwar.bausystem.BauSystem;
|
||||||
import de.steamwar.bausystem.Permission;
|
|
||||||
import de.steamwar.bausystem.config.BauServer;
|
import de.steamwar.bausystem.config.BauServer;
|
||||||
|
import de.steamwar.bausystem.features.tpslimit.TPSWarpUtils;
|
||||||
|
import de.steamwar.bausystem.linkage.LinkageType;
|
||||||
|
import de.steamwar.bausystem.linkage.Linked;
|
||||||
|
import de.steamwar.bausystem.linkage.LinkedInstance;
|
||||||
import de.steamwar.bausystem.region.Region;
|
import de.steamwar.bausystem.region.Region;
|
||||||
import de.steamwar.bausystem.region.flags.Flag;
|
import de.steamwar.bausystem.region.flags.Flag;
|
||||||
import de.steamwar.command.SWCommand;
|
import de.steamwar.command.SWCommand;
|
||||||
import de.steamwar.core.TPSWatcher;
|
import de.steamwar.core.TPSWatcher;
|
||||||
import de.steamwar.linkage.Linked;
|
|
||||||
import de.steamwar.linkage.LinkedInstance;
|
|
||||||
import de.steamwar.sql.BauweltMember;
|
import de.steamwar.sql.BauweltMember;
|
||||||
import de.steamwar.sql.SteamwarUser;
|
import de.steamwar.sql.SteamwarUser;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.List;
|
||||||
|
|
||||||
@Linked
|
import static de.steamwar.bausystem.features.tpslimit.TPSWarpUtils.getTps;
|
||||||
|
|
||||||
|
@Linked(LinkageType.COMMAND)
|
||||||
public class InfoCommand extends SWCommand {
|
public class InfoCommand extends SWCommand {
|
||||||
|
|
||||||
@LinkedInstance
|
@LinkedInstance
|
||||||
public BauServer bauServer;
|
private BauServer bauServer;
|
||||||
|
|
||||||
public InfoCommand() {
|
public InfoCommand() {
|
||||||
super("bauinfo");
|
super("bauinfo");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Register(description = "BAU_INFO_COMMAND_HELP")
|
@Register(help = true)
|
||||||
|
public void genericHelp(Player p, String... args) {
|
||||||
|
BauSystem.MESSAGE.send("BAU_INFO_COMMAND_HELP", p);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Register
|
||||||
public void genericCommand(Player p) {
|
public void genericCommand(Player p) {
|
||||||
|
sendBauInfo(p);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void sendBauInfo(Player p) {
|
||||||
BauSystem.MESSAGE.send("BAU_INFO_COMMAND_OWNER", p, SteamwarUser.get(bauServer.getOwnerID()).getUserName());
|
BauSystem.MESSAGE.send("BAU_INFO_COMMAND_OWNER", p, SteamwarUser.get(bauServer.getOwnerID()).getUserName());
|
||||||
Region region = Region.getRegion(p.getLocation());
|
Region region = Region.getRegion(p.getLocation());
|
||||||
for (Flag flag : Flag.getFlags()) {
|
for (Flag flag : Flag.getFlags()) {
|
||||||
@ -39,48 +51,29 @@ public class InfoCommand extends SWCommand {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Permission.BUILD.hasPermission(p)) {
|
|
||||||
List<BauweltMember> members = BauweltMember.getMembers(bauServer.getOwnerID());
|
List<BauweltMember> members = BauweltMember.getMembers(bauServer.getOwnerID());
|
||||||
Map<Permission, List<BauweltMember>> memberByPermission = new HashMap<>();
|
StringBuilder membermessage = new StringBuilder();
|
||||||
members.forEach(member -> {
|
membermessage.append(BauSystem.MESSAGE.parsePrefixed("BAU_INFO_COMMAND_MEMBER", p));
|
||||||
if (Permission.SUPERVISOR.hasPermission(member)) {
|
|
||||||
memberByPermission.computeIfAbsent(Permission.SUPERVISOR, __ -> new ArrayList<>()).add(member);
|
for (BauweltMember member : members) {
|
||||||
} else if (Permission.BUILD.hasPermission(member)) {
|
membermessage.append(BauSystem.MESSAGE.parse("BAU_INFO_MEMBER_INFO", p,
|
||||||
memberByPermission.computeIfAbsent(Permission.BUILD, __ -> new ArrayList<>()).add(member);
|
SteamwarUser.get(member.getMemberID()).getUserName(),
|
||||||
} else {
|
member.isWorldEdit() ? BauSystem.MESSAGE.parse("BAU_INFO_MEMBER_WE_ALLOW", p) : BauSystem.MESSAGE.parse("BAU_INFO_MEMBER_WE_DISALLOW", p),
|
||||||
memberByPermission.computeIfAbsent(Permission.MEMBER, __ -> new ArrayList<>()).add(member);
|
member.isWorld() ? BauSystem.MESSAGE.parse("BAU_INFO_MEMBER_WORLD_ALLOW", p) : BauSystem.MESSAGE.parse("BAU_INFO_MEMBER_WORLD_DISALLOW", p)
|
||||||
}
|
));
|
||||||
});
|
|
||||||
|
|
||||||
List<BauweltMember> supervisor = memberByPermission.getOrDefault(Permission.SUPERVISOR, Collections.emptyList());
|
|
||||||
BauSystem.MESSAGE.send("BAU_INFO_COMMAND_MEMBER", p, "§eSupervisor", supervisor.size(), supervisor.isEmpty() ? "§8<none>" : joining(supervisor));
|
|
||||||
|
|
||||||
List<BauweltMember> builder = memberByPermission.getOrDefault(Permission.BUILD, Collections.emptyList());
|
|
||||||
BauSystem.MESSAGE.send("BAU_INFO_COMMAND_MEMBER", p, "§6Builder", builder.size(), builder.isEmpty() ? "§8<none>" : joining(builder));
|
|
||||||
|
|
||||||
List<BauweltMember> spectator = memberByPermission.getOrDefault(Permission.MEMBER, Collections.emptyList());
|
|
||||||
BauSystem.MESSAGE.send("BAU_INFO_COMMAND_MEMBER", p, "§7Spectator", spectator.size(), spectator.isEmpty() ? "§8<none>" : joining(spectator));
|
|
||||||
}
|
}
|
||||||
|
p.sendMessage(membermessage.toString());
|
||||||
|
|
||||||
StringBuilder tpsMessage = new StringBuilder();
|
StringBuilder tpsMessage = new StringBuilder();
|
||||||
tpsMessage.append(BauSystem.MESSAGE.parsePrefixed("BAU_INFO_COMMAND_TPS", p));
|
tpsMessage.append(BauSystem.MESSAGE.parsePrefixed("BAU_INFO_COMMAND_TPS", p));
|
||||||
tpsMessage.append(" ").append(TPSWatcher.getTPS(TPSWatcher.TPSType.ONE_SECOND));
|
tpsMessage.append(" ").append(getTps(TPSWatcher.TPSType.ONE_SECOND));
|
||||||
tpsMessage.append(" ").append(TPSWatcher.getTPS(TPSWatcher.TPSType.TEN_SECONDS));
|
tpsMessage.append(" ").append(getTps(TPSWatcher.TPSType.TEN_SECONDS));
|
||||||
|
if (!TPSWarpUtils.isWarping()) {
|
||||||
tpsMessage.append(" ").append(TPSWatcher.getTPS(TPSWatcher.TPSType.ONE_MINUTE));
|
tpsMessage.append(" ").append(TPSWatcher.getTPS(TPSWatcher.TPSType.ONE_MINUTE));
|
||||||
tpsMessage.append(" ").append(TPSWatcher.getTPS(TPSWatcher.TPSType.FIVE_MINUTES));
|
tpsMessage.append(" ").append(TPSWatcher.getTPS(TPSWatcher.TPSType.FIVE_MINUTES));
|
||||||
tpsMessage.append(" ").append(TPSWatcher.getTPS(TPSWatcher.TPSType.TEN_MINUTES));
|
tpsMessage.append(" ").append(TPSWatcher.getTPS(TPSWatcher.TPSType.TEN_MINUTES));
|
||||||
|
}
|
||||||
p.sendMessage(tpsMessage.toString());
|
p.sendMessage(tpsMessage.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
private String joining(List<BauweltMember> bauweltMembers) {
|
|
||||||
StringBuilder st = new StringBuilder();
|
|
||||||
for (int i = 0; i < bauweltMembers.size(); i++) {
|
|
||||||
if (i != 0) {
|
|
||||||
st.append("§8, ");
|
|
||||||
}
|
|
||||||
st.append("§7");
|
|
||||||
st.append(SteamwarUser.get(bauweltMembers.get(i).getMemberID()).getUserName());
|
|
||||||
}
|
|
||||||
return st.toString();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,96 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of the SteamWar software.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2023 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.bausystem.features.cannon;
|
|
||||||
|
|
||||||
import de.steamwar.bausystem.BauSystem;
|
|
||||||
import de.steamwar.bausystem.features.cannon.depth.Depth;
|
|
||||||
import de.steamwar.bausystem.features.cannon.depth.DepthManager;
|
|
||||||
import de.steamwar.bausystem.region.Region;
|
|
||||||
import de.steamwar.bausystem.region.utils.RegionType;
|
|
||||||
import de.steamwar.linkage.Linked;
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.entity.TNTPrimed;
|
|
||||||
import org.bukkit.event.EventHandler;
|
|
||||||
import org.bukkit.event.EventPriority;
|
|
||||||
import org.bukkit.event.Listener;
|
|
||||||
import org.bukkit.event.entity.EntityExplodeEvent;
|
|
||||||
import org.bukkit.util.Vector;
|
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
@Linked
|
|
||||||
public class CannonDetector implements Listener {
|
|
||||||
|
|
||||||
private Map<TNTPrimed, Vector> velocities = new HashMap<>();
|
|
||||||
private Map<TNTPrimed, Set<UUID>> propulsionOfProjectile = new HashMap<>();
|
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.LOW)
|
|
||||||
public void onEntityExplode(EntityExplodeEvent event) {
|
|
||||||
if (!(event.getEntity() instanceof TNTPrimed)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
TNTPrimed tnt = (TNTPrimed) event.getEntity();
|
|
||||||
propulsionOfProjectile.remove(tnt);
|
|
||||||
|
|
||||||
DepthManager.update(tnt, event.blockList());
|
|
||||||
|
|
||||||
List<TNTPrimed> tnts = Bukkit.getWorlds().get(0).getEntitiesByClass(TNTPrimed.class)
|
|
||||||
.stream()
|
|
||||||
.filter(entity -> entity != tnt)
|
|
||||||
.filter(entity -> entity.getFuseTicks() > 1)
|
|
||||||
.filter(entity -> entity.getLocation().distance(event.getLocation()) <= 8)
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
|
|
||||||
if (tnts.isEmpty()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean isEmpty = velocities.isEmpty();
|
|
||||||
tnts.forEach(tntPrimed -> {
|
|
||||||
velocities.put(tntPrimed, tntPrimed.getVelocity().clone());
|
|
||||||
propulsionOfProjectile.computeIfAbsent(tntPrimed, __ -> new HashSet<>()).add(tnt.getUniqueId());
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!isEmpty) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
BauSystem.runTaskLater(BauSystem.getInstance(), () -> {
|
|
||||||
Map<CannonKey, List<TNTPrimed>> grouped = new HashMap<>();
|
|
||||||
velocities.forEach((tntPrimed, vector) -> {
|
|
||||||
boolean xBiggest = Math.abs(vector.getX()) > Math.abs(vector.getZ());
|
|
||||||
boolean zBiggest = Math.abs(vector.getZ()) > Math.abs(vector.getX());
|
|
||||||
Vector vec = new Vector(xBiggest ? Math.signum(vector.getX()) : 0, Math.round(vector.getY() * 100), zBiggest ? Math.signum(vector.getZ()) : 0);
|
|
||||||
grouped.computeIfAbsent(new CannonKey(propulsionOfProjectile.get(tntPrimed), vec), ignored -> new ArrayList<>()).add(tntPrimed);
|
|
||||||
});
|
|
||||||
grouped.forEach((cannonKey, tntPrimeds) -> {
|
|
||||||
if (tntPrimeds.size() <= 5) return;
|
|
||||||
Region region = Region.getRegion(tntPrimeds.get(0).getLocation());
|
|
||||||
if (region.isGlobal()) return;
|
|
||||||
if (!region.hasType(RegionType.TESTBLOCK)) return;
|
|
||||||
Depth depth = new Depth(region);
|
|
||||||
DepthManager.init(tntPrimeds, depth);
|
|
||||||
});
|
|
||||||
velocities.clear();
|
|
||||||
}, 1);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,37 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of the SteamWar software.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2023 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.bausystem.features.cannon;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.Getter;
|
|
||||||
import org.bukkit.entity.TNTPrimed;
|
|
||||||
import org.bukkit.util.Vector;
|
|
||||||
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
@AllArgsConstructor
|
|
||||||
@EqualsAndHashCode
|
|
||||||
@Getter
|
|
||||||
public final class CannonKey {
|
|
||||||
private Set<UUID> propulsions;
|
|
||||||
private Vector velocityVector;
|
|
||||||
}
|
|
@ -1,109 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of the SteamWar software.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2023 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.bausystem.features.cannon.depth;
|
|
||||||
|
|
||||||
import de.steamwar.bausystem.BauSystem;
|
|
||||||
import de.steamwar.bausystem.region.Region;
|
|
||||||
import de.steamwar.bausystem.region.RegionUtils;
|
|
||||||
import de.steamwar.bausystem.region.utils.RegionExtensionType;
|
|
||||||
import de.steamwar.bausystem.region.utils.RegionType;
|
|
||||||
import net.md_5.bungee.api.chat.BaseComponent;
|
|
||||||
import net.md_5.bungee.api.chat.HoverEvent;
|
|
||||||
import net.md_5.bungee.api.chat.TextComponent;
|
|
||||||
import org.bukkit.block.Block;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.util.Vector;
|
|
||||||
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
public class Depth {
|
|
||||||
|
|
||||||
private Region region;
|
|
||||||
private Vector minVector = null;
|
|
||||||
private Vector maxVector = null;
|
|
||||||
private int tntCount = 0;
|
|
||||||
|
|
||||||
public Depth(Region region) {
|
|
||||||
this.region = region;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void update(List<Block> blocks) {
|
|
||||||
List<Block> blocksList = blocks.stream()
|
|
||||||
.filter(block -> region.inRegion(block.getLocation(), RegionType.TESTBLOCK, RegionExtensionType.EXTENSION))
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
tntCount++;
|
|
||||||
for (Block block : blocksList) {
|
|
||||||
internalUpdate(block);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void finish() {
|
|
||||||
if (maxVector == null || minVector == null) return;
|
|
||||||
Vector dimensions = maxVector.subtract(minVector);
|
|
||||||
dimensions.setX(Math.abs(dimensions.getX()));
|
|
||||||
dimensions.setY(Math.abs(dimensions.getY()));
|
|
||||||
dimensions.setZ(Math.abs(dimensions.getZ()));
|
|
||||||
|
|
||||||
RegionUtils.message(region, player -> {
|
|
||||||
player.spigot().sendMessage(getMessage(player, dimensions.getBlockX() + 1, dimensions.getBlockY() + 1, dimensions.getBlockZ() + 1, tntCount));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void internalUpdate(Block block) {
|
|
||||||
if (minVector == null) {
|
|
||||||
minVector = block.getLocation().toVector();
|
|
||||||
}
|
|
||||||
minVector.setX(Math.min(minVector.getX(), block.getX()));
|
|
||||||
minVector.setY(Math.min(minVector.getY(), block.getY()));
|
|
||||||
minVector.setZ(Math.min(minVector.getZ(), block.getZ()));
|
|
||||||
|
|
||||||
if (maxVector == null) {
|
|
||||||
maxVector = block.getLocation().toVector();
|
|
||||||
}
|
|
||||||
maxVector.setX(Math.max(maxVector.getX(), block.getX()));
|
|
||||||
maxVector.setY(Math.max(maxVector.getY(), block.getY()));
|
|
||||||
maxVector.setZ(Math.max(maxVector.getZ(), block.getZ()));
|
|
||||||
}
|
|
||||||
|
|
||||||
private static BaseComponent[] getMessage(Player player, int x, int y, int z, int tntCount) {
|
|
||||||
final Set<Integer> dimensions = new HashSet<>();
|
|
||||||
dimensions.add(x);
|
|
||||||
dimensions.add(y);
|
|
||||||
dimensions.add(z);
|
|
||||||
|
|
||||||
int max = getMax(dimensions);
|
|
||||||
|
|
||||||
TextComponent headerComponent = new TextComponent(BauSystem.MESSAGE.parse("DEPTH_COUNTER_MESSAGE", player));
|
|
||||||
|
|
||||||
TextComponent depthComponent = new TextComponent(BauSystem.MESSAGE.parse("DEPTH_COUNTER_COUNT", player, x == max ? "§e" : "§7", x, y == max ? "§e" : "§7", y, z == max ? "§e" : "§7", z));
|
|
||||||
depthComponent.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponent[]{new TextComponent(BauSystem.MESSAGE.parse("DEPTH_COUNTER_HOVER", player))}));
|
|
||||||
|
|
||||||
TextComponent tntComponent = new TextComponent(BauSystem.MESSAGE.parse("DEPTH_COUNTER_TNT", player, tntCount));
|
|
||||||
|
|
||||||
return new BaseComponent[]{headerComponent, depthComponent, tntComponent};
|
|
||||||
}
|
|
||||||
|
|
||||||
private static int getMax(Set<Integer> values) {
|
|
||||||
return values.stream().max(Integer::compare).orElse(0);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,48 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of the SteamWar software.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2023 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.bausystem.features.cannon.depth;
|
|
||||||
|
|
||||||
import lombok.experimental.UtilityClass;
|
|
||||||
import org.bukkit.block.Block;
|
|
||||||
import org.bukkit.entity.TNTPrimed;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@UtilityClass
|
|
||||||
public class DepthManager {
|
|
||||||
|
|
||||||
private Map<TNTPrimed, Depth> depths = new HashMap<>();
|
|
||||||
|
|
||||||
public void init(List<TNTPrimed> list, Depth depth) {
|
|
||||||
for (TNTPrimed tnt : list) {
|
|
||||||
depths.putIfAbsent(tnt, depth);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void update(TNTPrimed tnt, List<Block> blocks) {
|
|
||||||
Depth depth = depths.remove(tnt);
|
|
||||||
if (depth == null) return;
|
|
||||||
depth.update(blocks);
|
|
||||||
if (depths.containsValue(depth)) return;
|
|
||||||
depth.finish();
|
|
||||||
}
|
|
||||||
}
|
|
@ -28,7 +28,6 @@ import lombok.experimental.UtilityClass;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.ItemMeta;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@ -41,9 +40,6 @@ public class Countingwand {
|
|||||||
public static ItemStack getWandItem(Player player) {
|
public static ItemStack getWandItem(Player player) {
|
||||||
ItemStack itemStack = new SWItem(Material.STICK, BauSystem.MESSAGE.parse("COUNTINGWAND_ITEM_NAME", player), Arrays.asList(BauSystem.MESSAGE.parse("COUNTINGWAND_ITEM_LORE1", player), BauSystem.MESSAGE.parse("COUNTINGWAND_ITEM_LORE2", player)), false, null).getItemStack();
|
ItemStack itemStack = new SWItem(Material.STICK, BauSystem.MESSAGE.parse("COUNTINGWAND_ITEM_NAME", player), Arrays.asList(BauSystem.MESSAGE.parse("COUNTINGWAND_ITEM_LORE1", player), BauSystem.MESSAGE.parse("COUNTINGWAND_ITEM_LORE2", player)), false, null).getItemStack();
|
||||||
ItemUtils.setItem(itemStack, "countingwand");
|
ItemUtils.setItem(itemStack, "countingwand");
|
||||||
ItemMeta itemMeta = itemStack.getItemMeta();
|
|
||||||
itemMeta.setCustomModelData(1);
|
|
||||||
itemStack.setItemMeta(itemMeta);
|
|
||||||
return itemStack;
|
return itemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,12 +20,13 @@
|
|||||||
package de.steamwar.bausystem.features.countingwand;
|
package de.steamwar.bausystem.features.countingwand;
|
||||||
|
|
||||||
import de.steamwar.bausystem.SWUtils;
|
import de.steamwar.bausystem.SWUtils;
|
||||||
|
import de.steamwar.bausystem.linkage.LinkageType;
|
||||||
|
import de.steamwar.bausystem.linkage.Linked;
|
||||||
import de.steamwar.command.SWCommand;
|
import de.steamwar.command.SWCommand;
|
||||||
import de.steamwar.linkage.Linked;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
|
||||||
@Linked
|
@Linked(LinkageType.COMMAND)
|
||||||
public class CountingwandCommand extends SWCommand {
|
public class CountingwandCommand extends SWCommand {
|
||||||
|
|
||||||
public CountingwandCommand() {
|
public CountingwandCommand() {
|
||||||
|
@ -20,14 +20,15 @@
|
|||||||
package de.steamwar.bausystem.features.countingwand;
|
package de.steamwar.bausystem.features.countingwand;
|
||||||
|
|
||||||
import de.steamwar.bausystem.Permission;
|
import de.steamwar.bausystem.Permission;
|
||||||
|
import de.steamwar.bausystem.linkage.LinkageType;
|
||||||
|
import de.steamwar.bausystem.linkage.Linked;
|
||||||
import de.steamwar.bausystem.linkage.specific.BauGuiItem;
|
import de.steamwar.bausystem.linkage.specific.BauGuiItem;
|
||||||
import de.steamwar.linkage.Linked;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.inventory.ClickType;
|
import org.bukkit.event.inventory.ClickType;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
|
||||||
@Linked
|
@Linked(LinkageType.BAU_GUI_ITEM)
|
||||||
public class CountingwandGuiItem extends BauGuiItem {
|
public class CountingwandGuiItem extends BauGuiItem {
|
||||||
|
|
||||||
public CountingwandGuiItem() {
|
public CountingwandGuiItem() {
|
||||||
@ -48,6 +49,6 @@ public class CountingwandGuiItem extends BauGuiItem {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Permission permission() {
|
public Permission permission() {
|
||||||
return Permission.MEMBER;
|
return Permission.WORLDEDIT;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -19,8 +19,9 @@
|
|||||||
|
|
||||||
package de.steamwar.bausystem.features.countingwand;
|
package de.steamwar.bausystem.features.countingwand;
|
||||||
|
|
||||||
|
import de.steamwar.bausystem.linkage.LinkageType;
|
||||||
|
import de.steamwar.bausystem.linkage.Linked;
|
||||||
import de.steamwar.bausystem.region.Point;
|
import de.steamwar.bausystem.region.Point;
|
||||||
import de.steamwar.linkage.Linked;
|
|
||||||
import org.bukkit.FluidCollisionMode;
|
import org.bukkit.FluidCollisionMode;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
@ -33,7 +34,7 @@ import org.bukkit.util.RayTraceResult;
|
|||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
|
|
||||||
@Linked
|
@Linked(LinkageType.LISTENER)
|
||||||
public class CountingwandListener implements Listener {
|
public class CountingwandListener implements Listener {
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
|
@ -1,141 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of the SteamWar software.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2023 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.bausystem.features.design.endstone;
|
|
||||||
|
|
||||||
import de.steamwar.bausystem.BauSystem;
|
|
||||||
import de.steamwar.bausystem.region.Region;
|
|
||||||
import de.steamwar.entity.REntity;
|
|
||||||
import de.steamwar.entity.REntityServer;
|
|
||||||
import de.steamwar.entity.RFallingBlockEntity;
|
|
||||||
import net.md_5.bungee.api.ChatMessageType;
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.Location;
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.World;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
public class DesignEndStone {
|
|
||||||
|
|
||||||
private static final World WORLD = Bukkit.getWorlds().get(0);
|
|
||||||
|
|
||||||
private int minX, minY, minZ, maxX, maxY, maxZ;
|
|
||||||
private REntityServer entityServer = new REntityServer();
|
|
||||||
private List<REntity> entities = new ArrayList<>();
|
|
||||||
private Set<Location> locations = new HashSet<>();
|
|
||||||
private boolean wsOrAs;
|
|
||||||
private double maxBlastResistance;
|
|
||||||
|
|
||||||
public DesignEndStone(Region region) {
|
|
||||||
this.minX = region.getMinPointBuild().getX();
|
|
||||||
this.minY = region.getMinPointBuild().getY();
|
|
||||||
this.minZ = region.getMinPointBuild().getZ();
|
|
||||||
this.maxX = region.getMaxPointBuild().getX();
|
|
||||||
this.maxY = region.getMaxPointBuild().getY();
|
|
||||||
this.maxZ = region.getMaxPointBuild().getZ();
|
|
||||||
wsOrAs = region.getName().startsWith("ws") || region.getName().startsWith("as");
|
|
||||||
maxBlastResistance = wsOrAs ? 6.1 : 9.0;
|
|
||||||
|
|
||||||
entityServer.setCallback((player, rEntity, entityAction) -> {
|
|
||||||
if (entityAction != REntityServer.EntityAction.ATTACK) return;
|
|
||||||
Location location = new Location(WORLD, rEntity.getX(), rEntity.getY(), rEntity.getZ());
|
|
||||||
Bukkit.getScheduler().runTaskLater(BauSystem.getInstance(), () -> {
|
|
||||||
location.getBlock().breakNaturally();
|
|
||||||
calc();
|
|
||||||
}, 1);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public void calc() {
|
|
||||||
entities.forEach(REntity::die);
|
|
||||||
entities.clear();
|
|
||||||
locations.clear();
|
|
||||||
|
|
||||||
calc(minX, minY, minZ, maxX, maxY, minZ, 0, 0, 1, maxZ - minZ);
|
|
||||||
calc(minX, minY, maxZ, maxX, maxY, maxZ, 0, 0, -1, maxZ - minZ);
|
|
||||||
calc(minX, minY, minZ, minX, maxY, maxZ, 1, 0, 0, maxX - minX);
|
|
||||||
calc(maxX, minY, minZ, maxX, maxY, maxZ, -1, 0, 0, maxX - minX);
|
|
||||||
if (wsOrAs) {
|
|
||||||
calc(minX, minY, minZ, maxX, minY, maxZ, 0, 1, 0, maxY - minY + 1);
|
|
||||||
} else {
|
|
||||||
int airBlocks = 0;
|
|
||||||
double minAirBlocks = (maxX - minX) * (maxZ - minZ) * 0.1;
|
|
||||||
for (int x = minX; x < maxX; x++) {
|
|
||||||
for (int z = minZ; z < maxZ; z++) {
|
|
||||||
if (WORLD.getBlockAt(x, minY, z).getType().isAir()) {
|
|
||||||
airBlocks++;
|
|
||||||
if (airBlocks > minAirBlocks) break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (airBlocks > minAirBlocks) {
|
|
||||||
calc(minX, minY, minZ, maxX, minY, maxZ, 0, 1, 0, maxY - minY + 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
calc(minX, maxY, minZ, maxX, maxY, maxZ, 0, -1, 0, maxY - minY + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void calc(int minX, int minY, int minZ, int maxX, int maxY, int maxZ, int dirX, int dirY, int dirZ, int steps) {
|
|
||||||
for (int x = minX; x <= maxX; x++) {
|
|
||||||
for (int y = minY; y <= maxY; y++) {
|
|
||||||
for (int z = minZ; z <= maxZ; z++) {
|
|
||||||
for (int step = 0; step < steps; step++) {
|
|
||||||
int cx = x + step * dirX;
|
|
||||||
int cy = y + step * dirY;
|
|
||||||
int cz = z + step * dirZ;
|
|
||||||
Material material = WORLD.getBlockAt(cx, cy, cz).getType();
|
|
||||||
|
|
||||||
if (material != Material.WATER && material != Material.LAVA && material.getBlastResistance() >= maxBlastResistance) {
|
|
||||||
Location location = new Location(WORLD, cx + 0.5, cy, cz + 0.5);
|
|
||||||
if (!locations.add(location)) break;
|
|
||||||
RFallingBlockEntity entity = new RFallingBlockEntity(entityServer, location, Material.RED_STAINED_GLASS);
|
|
||||||
entity.setNoGravity(true);
|
|
||||||
entity.setGlowing(true);
|
|
||||||
entities.add(entity);
|
|
||||||
break;
|
|
||||||
} else if (!material.isAir() && material != Material.WATER && material != Material.LAVA) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void toggle(Player player) {
|
|
||||||
if (entityServer.getPlayers().contains(player)) {
|
|
||||||
entityServer.removePlayer(player);
|
|
||||||
BauSystem.MESSAGE.sendPrefixless("DESIGN_ENDSTONE_DISABLE", player, ChatMessageType.ACTION_BAR);
|
|
||||||
} else {
|
|
||||||
entityServer.addPlayer(player);
|
|
||||||
calc();
|
|
||||||
BauSystem.MESSAGE.sendPrefixless("DESIGN_ENDSTONE_ENABLE", player, ChatMessageType.ACTION_BAR);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean removePlayer(Player player) {
|
|
||||||
entityServer.removePlayer(player);
|
|
||||||
return entityServer.getPlayers().isEmpty();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,97 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of the SteamWar software.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2023 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.bausystem.features.design.endstone;
|
|
||||||
|
|
||||||
import de.steamwar.bausystem.BauSystem;
|
|
||||||
import de.steamwar.bausystem.region.Region;
|
|
||||||
import de.steamwar.bausystem.region.utils.RegionType;
|
|
||||||
import de.steamwar.bausystem.utils.BauMemberUpdateEvent;
|
|
||||||
import de.steamwar.command.SWCommand;
|
|
||||||
import de.steamwar.linkage.Linked;
|
|
||||||
import org.bukkit.Location;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.EventHandler;
|
|
||||||
import org.bukkit.event.Listener;
|
|
||||||
import org.bukkit.event.block.BlockBreakEvent;
|
|
||||||
import org.bukkit.event.block.BlockPlaceEvent;
|
|
||||||
import org.bukkit.event.player.PlayerQuitEvent;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@Linked
|
|
||||||
public class DesignEndStoneCommand extends SWCommand implements Listener {
|
|
||||||
|
|
||||||
public DesignEndStoneCommand() {
|
|
||||||
super("designendstone");
|
|
||||||
}
|
|
||||||
|
|
||||||
private Map<Region, DesignEndStone> designEndStoneMap = new HashMap<>();
|
|
||||||
|
|
||||||
@Register(description = "DESIGN_ENDSTONE_COMMAND_HELP")
|
|
||||||
public void genericCommand(@Validator Player player) {
|
|
||||||
Region region = Region.getRegion(player.getLocation());
|
|
||||||
if (!region.hasType(RegionType.BUILD)) {
|
|
||||||
BauSystem.MESSAGE.send("DESIGN_ENDSTONE_REGION_ERROR", player);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
designEndStoneMap.computeIfAbsent(region, DesignEndStone::new).toggle(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onPlayerQuit(PlayerQuitEvent event) {
|
|
||||||
disableDesignEndStone(event.getPlayer());
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onBauMemberUpdate(BauMemberUpdateEvent event) {
|
|
||||||
event.getNewSpectator().forEach(this::disableDesignEndStone);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void disableDesignEndStone(Player player) {
|
|
||||||
new HashSet<>(designEndStoneMap.entrySet()).forEach(regionDesignEndStoneEntry -> {
|
|
||||||
if (regionDesignEndStoneEntry.getValue().removePlayer(player)) {
|
|
||||||
designEndStoneMap.remove(regionDesignEndStoneEntry.getKey());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onBlockPlace(BlockPlaceEvent event) {
|
|
||||||
update(event.getBlock().getLocation());
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onBlockBreak(BlockBreakEvent event) {
|
|
||||||
BauSystem.runTaskLater(BauSystem.getInstance(), () -> {
|
|
||||||
update(event.getBlock().getLocation());
|
|
||||||
}, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void update(Location location) {
|
|
||||||
Region region = Region.getRegion(location);
|
|
||||||
DesignEndStone designEndStone = designEndStoneMap.get(region);
|
|
||||||
if (designEndStone == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
designEndStone.calc();
|
|
||||||
}
|
|
||||||
}
|
|
@ -25,8 +25,7 @@ import de.steamwar.bausystem.configplayer.Config;
|
|||||||
import de.steamwar.bausystem.features.autostart.AutostartListener;
|
import de.steamwar.bausystem.features.autostart.AutostartListener;
|
||||||
import de.steamwar.bausystem.features.detonator.storage.DetonatorStorage;
|
import de.steamwar.bausystem.features.detonator.storage.DetonatorStorage;
|
||||||
import de.steamwar.bausystem.features.detonator.storage.ItemStorage;
|
import de.steamwar.bausystem.features.detonator.storage.ItemStorage;
|
||||||
import de.steamwar.entity.REntityServer;
|
import de.steamwar.core.VersionedRunnable;
|
||||||
import de.steamwar.entity.RFallingBlockEntity;
|
|
||||||
import lombok.experimental.UtilityClass;
|
import lombok.experimental.UtilityClass;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
@ -41,11 +40,12 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@UtilityClass
|
@UtilityClass
|
||||||
public class Detonator {
|
public class Detonator {
|
||||||
|
|
||||||
private static final Map<Player, REntityServer> ENTITIES_MAP = new HashMap<>();
|
private static final Map<Player, List<AbstractDetonatorEntity>> ENTITIES_MAP = new HashMap<>();
|
||||||
private static final Vector HALF = new Vector(0.5, 0, 0.5);
|
private static final Vector HALF = new Vector(0.5, 0, 0.5);
|
||||||
|
|
||||||
public static boolean isDetonator(ItemStack itemStack) {
|
public static boolean isDetonator(ItemStack itemStack) {
|
||||||
@ -53,24 +53,21 @@ public class Detonator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void showDetonator(Player p, List<Location> locs) {
|
public static void showDetonator(Player p, List<Location> locs) {
|
||||||
if (ENTITIES_MAP.containsKey(p)) return;
|
List<Vector> vecs = locs.stream().map(Location::toVector).collect(Collectors.toList());
|
||||||
REntityServer entities = new REntityServer();
|
List<AbstractDetonatorEntity> entities = new LinkedList<>();
|
||||||
entities.setCallback((player, rEntity, entityAction) -> {
|
VersionedRunnable.call(new VersionedRunnable(() -> {
|
||||||
Vector vector = new Vector(rEntity.getX(), rEntity.getY(), rEntity.getZ());
|
vecs.forEach(vector -> entities.add(Detonator_15.constructEntity(p.getWorld(), vector.add(HALF))));
|
||||||
DetonatorListener.addLocationToDetonator(vector.toLocation(player.getWorld()).getBlock().getLocation(), player);
|
}, 15));
|
||||||
DetonatorListener.HAS_UPDATED.add(player);
|
entities.forEach(abstractDetonatorEntity -> abstractDetonatorEntity.display(p));
|
||||||
});
|
ENTITIES_MAP.putIfAbsent(p, entities);
|
||||||
entities.addPlayer(p);
|
|
||||||
ENTITIES_MAP.put(p, entities);
|
|
||||||
|
|
||||||
locs.forEach(location -> {
|
|
||||||
RFallingBlockEntity entity = new RFallingBlockEntity(entities, location.clone().add(HALF), Material.RED_STAINED_GLASS);
|
|
||||||
entity.setNoGravity(true);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void hideDetonator(Player p) {
|
public static void hideDetonator(Player p) {
|
||||||
ENTITIES_MAP.remove(p).close();
|
ENTITIES_MAP.remove(p).forEach(abstractDetonatorEntity -> abstractDetonatorEntity.hide(p, true));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<AbstractDetonatorEntity> getDetoEntities(Player p) {
|
||||||
|
return ENTITIES_MAP.getOrDefault(p, new ArrayList<>());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean hasActiveDetonatorShow(Player p) {
|
public static boolean hasActiveDetonatorShow(Player p) {
|
||||||
@ -199,23 +196,34 @@ public class Detonator {
|
|||||||
switch (block.getType()) {
|
switch (block.getType()) {
|
||||||
case LEVER:
|
case LEVER:
|
||||||
return Detoblock.SWITCH;
|
return Detoblock.SWITCH;
|
||||||
|
case ACACIA_BUTTON:
|
||||||
|
case BIRCH_BUTTON:
|
||||||
|
case DARK_OAK_BUTTON:
|
||||||
|
case JUNGLE_BUTTON:
|
||||||
|
case OAK_BUTTON:
|
||||||
|
case SPRUCE_BUTTON:
|
||||||
|
return Detoblock.WOOD_BUTTON;
|
||||||
|
case STONE_BUTTON:
|
||||||
|
return Detoblock.STONE_BUTTON;
|
||||||
|
case ACACIA_PRESSURE_PLATE:
|
||||||
|
case BIRCH_PRESSURE_PLATE:
|
||||||
|
case DARK_OAK_PRESSURE_PLATE:
|
||||||
|
case JUNGLE_PRESSURE_PLATE:
|
||||||
|
case OAK_PRESSURE_PLATE:
|
||||||
|
case SPRUCE_PRESSURE_PLATE:
|
||||||
|
case STONE_PRESSURE_PLATE:
|
||||||
|
return Detoblock.PRESSURE_PLATE;
|
||||||
|
case HEAVY_WEIGHTED_PRESSURE_PLATE:
|
||||||
|
case LIGHT_WEIGHTED_PRESSURE_PLATE:
|
||||||
|
return Detoblock.WEIGHTED_PRESSURE_PLATE;
|
||||||
case TRIPWIRE:
|
case TRIPWIRE:
|
||||||
return Detoblock.TRIPWIRE;
|
return Detoblock.TRIPWIRE;
|
||||||
case NOTE_BLOCK:
|
case NOTE_BLOCK:
|
||||||
return Detoblock.NOTEBLOCK;
|
return Detoblock.NOTEBLOCK;
|
||||||
case DAYLIGHT_DETECTOR:
|
case DAYLIGHT_DETECTOR:
|
||||||
return Detoblock.DAYLIGHTSENSOR;
|
return Detoblock.DAYLIGHTSENSOR;
|
||||||
case HEAVY_WEIGHTED_PRESSURE_PLATE:
|
|
||||||
case LIGHT_WEIGHTED_PRESSURE_PLATE:
|
|
||||||
return Detoblock.WEIGHTED_PRESSURE_PLATE;
|
|
||||||
default:
|
default:
|
||||||
if (block.getType().name().contains("STONE_BUTTON")) {
|
if (block.getBlockData() instanceof Powerable) {
|
||||||
return Detoblock.STONE_BUTTON;
|
|
||||||
} else if (block.getType().name().contains("BUTTON")) {
|
|
||||||
return Detoblock.WOOD_BUTTON;
|
|
||||||
} else if (block.getType().name().contains("PRESSURE_PLATE")) {
|
|
||||||
return Detoblock.PRESSURE_PLATE;
|
|
||||||
} else if (block.getBlockData() instanceof Powerable) {
|
|
||||||
return Detoblock.POWERABLE;
|
return Detoblock.POWERABLE;
|
||||||
} else {
|
} else {
|
||||||
return Detoblock.INVALID;
|
return Detoblock.INVALID;
|
||||||
|
@ -20,13 +20,14 @@
|
|||||||
package de.steamwar.bausystem.features.detonator;
|
package de.steamwar.bausystem.features.detonator;
|
||||||
|
|
||||||
import de.steamwar.bausystem.Permission;
|
import de.steamwar.bausystem.Permission;
|
||||||
|
import de.steamwar.bausystem.linkage.LinkageType;
|
||||||
|
import de.steamwar.bausystem.linkage.Linked;
|
||||||
import de.steamwar.bausystem.linkage.specific.BauGuiItem;
|
import de.steamwar.bausystem.linkage.specific.BauGuiItem;
|
||||||
import de.steamwar.linkage.Linked;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.inventory.ClickType;
|
import org.bukkit.event.inventory.ClickType;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
@Linked
|
@Linked(LinkageType.BAU_GUI_ITEM)
|
||||||
public class DetonatorBauGuiItem extends BauGuiItem {
|
public class DetonatorBauGuiItem extends BauGuiItem {
|
||||||
|
|
||||||
public DetonatorBauGuiItem() {
|
public DetonatorBauGuiItem() {
|
||||||
@ -47,6 +48,6 @@ public class DetonatorBauGuiItem extends BauGuiItem {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Permission permission() {
|
public Permission permission() {
|
||||||
return Permission.BUILD;
|
return Permission.MEMBER;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,9 +24,10 @@ import de.steamwar.bausystem.SWUtils;
|
|||||||
import de.steamwar.bausystem.configplayer.Config;
|
import de.steamwar.bausystem.configplayer.Config;
|
||||||
import de.steamwar.bausystem.features.detonator.storage.DetonatorStorage;
|
import de.steamwar.bausystem.features.detonator.storage.DetonatorStorage;
|
||||||
import de.steamwar.bausystem.features.detonator.storage.ItemStorage;
|
import de.steamwar.bausystem.features.detonator.storage.ItemStorage;
|
||||||
|
import de.steamwar.bausystem.linkage.LinkageType;
|
||||||
|
import de.steamwar.bausystem.linkage.Linked;
|
||||||
import de.steamwar.bausystem.utils.ItemUtils;
|
import de.steamwar.bausystem.utils.ItemUtils;
|
||||||
import de.steamwar.command.SWCommand;
|
import de.steamwar.command.SWCommand;
|
||||||
import de.steamwar.linkage.Linked;
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
@ -34,7 +35,7 @@ import org.bukkit.inventory.meta.ItemMeta;
|
|||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
@Linked
|
@Linked(LinkageType.COMMAND)
|
||||||
public class DetonatorCommand extends SWCommand {
|
public class DetonatorCommand extends SWCommand {
|
||||||
|
|
||||||
public static ItemStack getWAND(Player player) {
|
public static ItemStack getWAND(Player player) {
|
||||||
@ -46,24 +47,23 @@ public class DetonatorCommand extends SWCommand {
|
|||||||
meta.setLore(Arrays.asList(BauSystem.MESSAGE.parse("DETONATOR_WAND_LORE_1", player),
|
meta.setLore(Arrays.asList(BauSystem.MESSAGE.parse("DETONATOR_WAND_LORE_1", player),
|
||||||
BauSystem.MESSAGE.parse("DETONATOR_WAND_LORE_2", player),
|
BauSystem.MESSAGE.parse("DETONATOR_WAND_LORE_2", player),
|
||||||
BauSystem.MESSAGE.parse("DETONATOR_WAND_LORE_3", player)));
|
BauSystem.MESSAGE.parse("DETONATOR_WAND_LORE_3", player)));
|
||||||
meta.setCustomModelData(3);
|
|
||||||
|
|
||||||
wand.setItemMeta(meta);
|
wand.setItemMeta(meta);
|
||||||
ItemUtils.setItem(wand, "detonator");
|
ItemUtils.setItem(wand, "detonator");
|
||||||
return wand;
|
return wand;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DetonatorCommand() {
|
protected DetonatorCommand() {
|
||||||
super("detonator", "dt");
|
super("detonator", "dt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Register(value = "wand", description = "DETONATOR_HELP_WAND")
|
@Register(value = "wand", description = "DETONATOR_HELP_WAND")
|
||||||
public void giveWand(@Validator Player p) {
|
public void giveWand(Player p) {
|
||||||
SWUtils.giveItemToPlayer(p, getWAND(p));
|
SWUtils.giveItemToPlayer(p, getWAND(p));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Register(value = "click", description = "DETONATOR_HELP_CLICK")
|
@Register(value = "click", description = "DETONATOR_HELP_CLICK")
|
||||||
public void clickDetonator(@Validator Player p) {
|
public void clickDetonator(Player p) {
|
||||||
Detonator.activateDetonator(new ItemStorage(p));
|
Detonator.activateDetonator(new ItemStorage(p));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,12 +19,14 @@
|
|||||||
|
|
||||||
package de.steamwar.bausystem.features.detonator;
|
package de.steamwar.bausystem.features.detonator;
|
||||||
|
|
||||||
|
import com.comphenix.tinyprotocol.Reflection;
|
||||||
import de.steamwar.bausystem.BauSystem;
|
import de.steamwar.bausystem.BauSystem;
|
||||||
import de.steamwar.bausystem.Permission;
|
|
||||||
import de.steamwar.bausystem.SWUtils;
|
import de.steamwar.bausystem.SWUtils;
|
||||||
import de.steamwar.bausystem.features.detonator.storage.DetonatorStorage;
|
import de.steamwar.bausystem.features.detonator.storage.DetonatorStorage;
|
||||||
import de.steamwar.bausystem.features.detonator.storage.ItemStorage;
|
import de.steamwar.bausystem.features.detonator.storage.ItemStorage;
|
||||||
import de.steamwar.linkage.Linked;
|
import de.steamwar.bausystem.linkage.LinkageType;
|
||||||
|
import de.steamwar.bausystem.linkage.Linked;
|
||||||
|
import de.steamwar.bausystem.utils.ProtocolAPI;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
@ -37,14 +39,39 @@ import org.bukkit.event.player.PlayerMoveEvent;
|
|||||||
import org.bukkit.event.player.PlayerSwapHandItemsEvent;
|
import org.bukkit.event.player.PlayerSwapHandItemsEvent;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
@Linked
|
@Linked(LinkageType.LISTENER)
|
||||||
public class DetonatorListener implements Listener {
|
public class DetonatorListener implements Listener {
|
||||||
|
|
||||||
static final Set<Player> HAS_UPDATED = new HashSet<>();
|
public static final Class<?> useEntity = Reflection.getClass("{nms}.PacketPlayInUseEntity");
|
||||||
|
private static final Reflection.FieldAccessor<Integer> entityIdFieldAccessor = Reflection.getField(useEntity, int.class, 0);
|
||||||
|
|
||||||
static void addLocationToDetonator(Location location, Player p) {
|
private static final Set<Player> HAS_UPDATED = new HashSet<>();
|
||||||
|
|
||||||
|
public DetonatorListener() {
|
||||||
|
ProtocolAPI.setIncomingHandler(useEntity, (player, o) -> {
|
||||||
|
List<AbstractDetonatorEntity> entities = Detonator.getDetoEntities(player);
|
||||||
|
if (entities.isEmpty()) {
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
|
||||||
|
int entityId = entityIdFieldAccessor.get(o);
|
||||||
|
AbstractDetonatorEntity entity = entities.stream().filter(abstractDetonatorEntity -> abstractDetonatorEntity.getId() == entityId).findFirst().orElse(null);
|
||||||
|
|
||||||
|
if (entity == null) {
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
|
||||||
|
Location location = entity.getBukkitEntity().getLocation().getBlock().getLocation();
|
||||||
|
addLocationToDetonator(location, player);
|
||||||
|
HAS_UPDATED.add(player);
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void addLocationToDetonator(Location location, Player p) {
|
||||||
Detoblock detoblock = Detonator.getBlock(location.getBlock());
|
Detoblock detoblock = Detonator.getBlock(location.getBlock());
|
||||||
if (detoblock == Detoblock.INVALID) {
|
if (detoblock == Detoblock.INVALID) {
|
||||||
SWUtils.sendToActionbar(p, BauSystem.MESSAGE.parse("DETONATOR_INVALID_BLOCK", p));
|
SWUtils.sendToActionbar(p, BauSystem.MESSAGE.parse("DETONATOR_INVALID_BLOCK", p));
|
||||||
@ -66,7 +93,6 @@ public class DetonatorListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onBlockBreak(BlockBreakEvent event) {
|
public void onBlockBreak(BlockBreakEvent event) {
|
||||||
if(!Permission.BUILD.hasPermission(event.getPlayer())) return;
|
|
||||||
Player p = event.getPlayer();
|
Player p = event.getPlayer();
|
||||||
if (Detonator.isDetonator(p.getInventory().getItemInMainHand())) {
|
if (Detonator.isDetonator(p.getInventory().getItemInMainHand())) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
@ -77,7 +103,6 @@ public class DetonatorListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerInteract(PlayerInteractEvent event) {
|
public void onPlayerInteract(PlayerInteractEvent event) {
|
||||||
if(!Permission.BUILD.hasPermission(event.getPlayer())) return;
|
|
||||||
if (!Detonator.isDetonator(event.getItem())) {
|
if (!Detonator.isDetonator(event.getItem())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -92,7 +117,7 @@ public class DetonatorListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler(ignoreCancelled = true)
|
@EventHandler(ignoreCancelled = true)
|
||||||
public void onPlayerMove(PlayerMoveEvent event) {
|
public void onPlayerMove(PlayerMoveEvent event) {
|
||||||
if (!Permission.BUILD.hasPermission(event.getPlayer()) ||!Detonator.isDetonator(event.getPlayer().getInventory().getItemInMainHand())) {
|
if (!Detonator.isDetonator(event.getPlayer().getInventory().getItemInMainHand())) {
|
||||||
if (Detonator.hasActiveDetonatorShow(event.getPlayer())) {
|
if (Detonator.hasActiveDetonatorShow(event.getPlayer())) {
|
||||||
Detonator.hideDetonator(event.getPlayer());
|
Detonator.hideDetonator(event.getPlayer());
|
||||||
}
|
}
|
||||||
@ -113,7 +138,6 @@ public class DetonatorListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerItemHeld(PlayerItemHeldEvent event) {
|
public void onPlayerItemHeld(PlayerItemHeldEvent event) {
|
||||||
if(!Permission.BUILD.hasPermission(event.getPlayer())) return;
|
|
||||||
if (Detonator.isDetonator(event.getPlayer().getInventory().getItemInMainHand())) {
|
if (Detonator.isDetonator(event.getPlayer().getInventory().getItemInMainHand())) {
|
||||||
HAS_UPDATED.add(event.getPlayer());
|
HAS_UPDATED.add(event.getPlayer());
|
||||||
}
|
}
|
||||||
@ -121,7 +145,6 @@ public class DetonatorListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerSwapHandItems(PlayerSwapHandItemsEvent event) {
|
public void onPlayerSwapHandItems(PlayerSwapHandItemsEvent event) {
|
||||||
if(!Permission.BUILD.hasPermission(event.getPlayer())) return;
|
|
||||||
if (Detonator.isDetonator(event.getMainHandItem()) || Detonator.isDetonator(event.getOffHandItem())) {
|
if (Detonator.isDetonator(event.getMainHandItem()) || Detonator.isDetonator(event.getOffHandItem())) {
|
||||||
HAS_UPDATED.add(event.getPlayer());
|
HAS_UPDATED.add(event.getPlayer());
|
||||||
}
|
}
|
||||||
|
@ -23,9 +23,9 @@ import de.steamwar.bausystem.BauSystem;
|
|||||||
import de.steamwar.bausystem.Permission;
|
import de.steamwar.bausystem.Permission;
|
||||||
import de.steamwar.bausystem.SWUtils;
|
import de.steamwar.bausystem.SWUtils;
|
||||||
import de.steamwar.bausystem.features.gui.editor.BauGuiMapping;
|
import de.steamwar.bausystem.features.gui.editor.BauGuiMapping;
|
||||||
import de.steamwar.bausystem.linkage.LinkageUtils;
|
|
||||||
import de.steamwar.bausystem.linkage.specific.BauGuiItem;
|
import de.steamwar.bausystem.linkage.specific.BauGuiItem;
|
||||||
import de.steamwar.inventory.SWInventory;
|
import de.steamwar.inventory.SWInventory;
|
||||||
|
import lombok.Getter;
|
||||||
import lombok.experimental.UtilityClass;
|
import lombok.experimental.UtilityClass;
|
||||||
import net.md_5.bungee.api.ChatColor;
|
import net.md_5.bungee.api.ChatColor;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
@ -38,12 +38,8 @@ import java.util.*;
|
|||||||
@UtilityClass
|
@UtilityClass
|
||||||
public class BauGUI {
|
public class BauGUI {
|
||||||
|
|
||||||
private static final Map<Integer, BauGuiItem> ITEMS = new HashMap<>();
|
@Getter
|
||||||
|
private static final HashMap<Integer, BauGuiItem> ITEMS = new HashMap<>();
|
||||||
public static Map<Integer, BauGuiItem> getITEMS() {
|
|
||||||
if (ITEMS.isEmpty()) LinkageUtils.linkGUIItems();
|
|
||||||
return ITEMS;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static final Set<Player> OPEN_INVS = new HashSet<>();
|
private static final Set<Player> OPEN_INVS = new HashSet<>();
|
||||||
private static boolean updating = false;
|
private static boolean updating = false;
|
||||||
@ -69,7 +65,7 @@ public class BauGUI {
|
|||||||
}
|
}
|
||||||
BauGuiMapping mapping = BauGuiMapping.getGuiMapping(p);
|
BauGuiMapping mapping = BauGuiMapping.getGuiMapping(p);
|
||||||
SWInventory inv = new SWInventory(p, mapping.getSize(), BauSystem.MESSAGE.parse("GUI_NAME", p));
|
SWInventory inv = new SWInventory(p, mapping.getSize(), BauSystem.MESSAGE.parse("GUI_NAME", p));
|
||||||
getITEMS().values().forEach(item -> {
|
ITEMS.values().forEach(item -> {
|
||||||
if (!mapping.isShown(item.getId())) {
|
if (!mapping.isShown(item.getId())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -81,7 +77,7 @@ public class BauGUI {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
p.closeInventory();
|
p.closeInventory();
|
||||||
BauSystem.MESSAGE.send("NO_PERMISSION", p);
|
BauSystem.MESSAGE.send("GUI_NO_PERMISSION", p);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -108,13 +104,26 @@ public class BauGUI {
|
|||||||
if (!permission.hasPermission(p)) {
|
if (!permission.hasPermission(p)) {
|
||||||
List<String> lore = meta.getLore();
|
List<String> lore = meta.getLore();
|
||||||
if (lore == null) {
|
if (lore == null) {
|
||||||
lore = Collections.singletonList(BauSystem.MESSAGE.parse("NO_PERMISSION", p));
|
lore = Collections.singletonList(BauSystem.MESSAGE.parse(permissionString(permission), p));
|
||||||
} else {
|
} else {
|
||||||
lore.add(BauSystem.MESSAGE.parse("NO_PERMISSION", p));
|
lore.add(BauSystem.MESSAGE.parse(permissionString(permission), p));
|
||||||
}
|
}
|
||||||
meta.setLore(lore);
|
meta.setLore(lore);
|
||||||
}
|
}
|
||||||
itemStack.setItemMeta(meta);
|
itemStack.setItemMeta(meta);
|
||||||
return itemStack;
|
return itemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static String permissionString(Permission permission) {
|
||||||
|
switch (permission) {
|
||||||
|
case OWNER:
|
||||||
|
return "GUI_NO_OWNER";
|
||||||
|
case WORLD:
|
||||||
|
return "GUI_NO_WORLD";
|
||||||
|
case WORLDEDIT:
|
||||||
|
return "GUI_NO_WORLDEDIT";
|
||||||
|
default:
|
||||||
|
return "GUI_NO_MEMBER";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,16 +19,24 @@
|
|||||||
|
|
||||||
package de.steamwar.bausystem.features.gui;
|
package de.steamwar.bausystem.features.gui;
|
||||||
|
|
||||||
|
import de.steamwar.bausystem.BauSystem;
|
||||||
import de.steamwar.bausystem.features.gui.editor.BauGuiEditor;
|
import de.steamwar.bausystem.features.gui.editor.BauGuiEditor;
|
||||||
|
import de.steamwar.bausystem.features.gui.editor.BauGuiImportExport;
|
||||||
|
import de.steamwar.bausystem.features.gui.editor.BauGuiMapping;
|
||||||
|
import de.steamwar.bausystem.linkage.LinkageType;
|
||||||
|
import de.steamwar.bausystem.linkage.Linked;
|
||||||
import de.steamwar.command.SWCommand;
|
import de.steamwar.command.SWCommand;
|
||||||
import de.steamwar.inventory.SWItem;
|
import de.steamwar.inventory.SWItem;
|
||||||
import de.steamwar.linkage.Linked;
|
import net.md_5.bungee.api.ChatColor;
|
||||||
|
import net.md_5.bungee.api.chat.ClickEvent;
|
||||||
|
import net.md_5.bungee.api.chat.HoverEvent;
|
||||||
|
import net.md_5.bungee.api.chat.TextComponent;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
@Linked
|
@Linked(LinkageType.COMMAND)
|
||||||
public class BauGUICommand extends SWCommand {
|
public class BauGUICommand extends SWCommand {
|
||||||
|
|
||||||
public BauGUICommand() {
|
protected BauGUICommand() {
|
||||||
super("gui", "baugui", "g");
|
super("gui", "baugui", "g");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -46,4 +54,29 @@ public class BauGUICommand extends SWCommand {
|
|||||||
public void openEditor(Player p) {
|
public void openEditor(Player p) {
|
||||||
BauGuiEditor.openGuiEditor(p, new SWItem().getItemStack());
|
BauGuiEditor.openGuiEditor(p, new SWItem().getItemStack());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Register("export")
|
||||||
|
public void exportGui(Player p) {
|
||||||
|
String export = BauGuiImportExport.exportGui(BauGuiMapping.getGuiMapping(p));
|
||||||
|
TextComponent component = new TextComponent();
|
||||||
|
component.setColor(ChatColor.YELLOW);
|
||||||
|
component.setBold(true);
|
||||||
|
component.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.fromLegacyText(BauSystem.MESSAGE.parse("GUI_EXPORT_CODE_HOVER", p))));
|
||||||
|
component.setClickEvent(new ClickEvent(ClickEvent.Action.COPY_TO_CLIPBOARD, export));
|
||||||
|
component.setText(export);
|
||||||
|
BauSystem.MESSAGE.send("GUI_EXPORT_CODE", p);
|
||||||
|
p.spigot().sendMessage(component);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Register("import")
|
||||||
|
public void importGui(Player p, String code) {
|
||||||
|
try {
|
||||||
|
if (BauGuiImportExport.importGui(code, p)) {
|
||||||
|
BauSystem.MESSAGE.send("GUI_IMPORT_CODE_SUCCESSFUL", p);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
BauSystem.MESSAGE.send("GUI_IMPORT_INVALID_CODE", p);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,9 +21,10 @@ package de.steamwar.bausystem.features.gui;
|
|||||||
|
|
||||||
import de.steamwar.bausystem.BauSystem;
|
import de.steamwar.bausystem.BauSystem;
|
||||||
import de.steamwar.bausystem.Permission;
|
import de.steamwar.bausystem.Permission;
|
||||||
|
import de.steamwar.bausystem.linkage.LinkageType;
|
||||||
|
import de.steamwar.bausystem.linkage.Linked;
|
||||||
import de.steamwar.bausystem.linkage.specific.BauGuiItem;
|
import de.steamwar.bausystem.linkage.specific.BauGuiItem;
|
||||||
import de.steamwar.inventory.SWItem;
|
import de.steamwar.inventory.SWItem;
|
||||||
import de.steamwar.linkage.Linked;
|
|
||||||
import net.md_5.bungee.api.ChatColor;
|
import net.md_5.bungee.api.ChatColor;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -32,7 +33,7 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
@Linked
|
@Linked(LinkageType.BAU_GUI_ITEM)
|
||||||
public class BauGuiBauGuiItem extends BauGuiItem {
|
public class BauGuiBauGuiItem extends BauGuiItem {
|
||||||
|
|
||||||
public BauGuiBauGuiItem() {
|
public BauGuiBauGuiItem() {
|
||||||
|
@ -19,13 +19,14 @@
|
|||||||
|
|
||||||
package de.steamwar.bausystem.features.gui;
|
package de.steamwar.bausystem.features.gui;
|
||||||
|
|
||||||
import de.steamwar.linkage.Linked;
|
import de.steamwar.bausystem.linkage.LinkageType;
|
||||||
|
import de.steamwar.bausystem.linkage.Linked;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.block.Action;
|
import org.bukkit.event.block.Action;
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
|
|
||||||
@Linked
|
@Linked(LinkageType.LISTENER)
|
||||||
public class BauGuiListener implements Listener {
|
public class BauGuiListener implements Listener {
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
|
@ -21,10 +21,11 @@ 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.LinkageType;
|
||||||
|
import de.steamwar.bausystem.linkage.Linked;
|
||||||
import de.steamwar.bausystem.linkage.specific.BauGuiItem;
|
import de.steamwar.bausystem.linkage.specific.BauGuiItem;
|
||||||
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 lombok.Getter;
|
import lombok.Getter;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
@ -39,14 +40,13 @@ import org.bukkit.event.inventory.InventoryDragEvent;
|
|||||||
import org.bukkit.event.player.PlayerMoveEvent;
|
import org.bukkit.event.player.PlayerMoveEvent;
|
||||||
import org.bukkit.event.player.PlayerQuitEvent;
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
import org.bukkit.inventory.Inventory;
|
import org.bukkit.inventory.Inventory;
|
||||||
import org.bukkit.inventory.InventoryView;
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.ItemMeta;
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
import org.bukkit.persistence.PersistentDataType;
|
import org.bukkit.persistence.PersistentDataType;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
@Linked
|
@Linked(LinkageType.LISTENER)
|
||||||
public class BauGuiEditor implements Listener {
|
public class BauGuiEditor implements Listener {
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@ -73,7 +73,6 @@ 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(Material.SCUTE, 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);
|
p.openInventory(inv);
|
||||||
p.getOpenInventory().setCursor(cursor == null ? new SWItem().getItemStack() : cursor);
|
p.getOpenInventory().setCursor(cursor == null ? new SWItem().getItemStack() : cursor);
|
||||||
@ -157,10 +156,6 @@ public class BauGuiEditor implements Listener {
|
|||||||
});
|
});
|
||||||
inv.open();
|
inv.open();
|
||||||
break;
|
break;
|
||||||
case 8:
|
|
||||||
saveMapping(p);
|
|
||||||
BauGUI.openBauGui(p);
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -194,17 +189,14 @@ public class BauGuiEditor implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void saveMapping(Player p) {
|
private void saveMapping(Player p) {
|
||||||
saveMapping(p.getOpenInventory(), BauGuiMapping.getGuiMapping(p));
|
BauGuiMapping mapping = BauGuiMapping.getGuiMapping(p);
|
||||||
}
|
|
||||||
|
|
||||||
private void saveMapping(InventoryView view, BauGuiMapping mapping) {
|
|
||||||
if (mapping.isSaved()) {
|
if (mapping.isSaved()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
HashMap<Integer, Integer> newMapping = new HashMap<>();
|
HashMap<Integer, Integer> newMapping = new HashMap<>();
|
||||||
|
|
||||||
for (int i = 0; i < view.getTopInventory().getContents().length; i++) {
|
for (int i = 0; i < p.getOpenInventory().getTopInventory().getContents().length; i++) {
|
||||||
ItemStack itemStack = view.getTopInventory().getContents()[i];
|
ItemStack itemStack = p.getOpenInventory().getTopInventory().getContents()[i];
|
||||||
if (itemStack == null || itemStack.getType() == Material.AIR || i >= mapping.getSize()) continue;
|
if (itemStack == null || itemStack.getType() == Material.AIR || i >= mapping.getSize()) continue;
|
||||||
newMapping.put(getId(itemStack), i);
|
newMapping.put(getId(itemStack), i);
|
||||||
}
|
}
|
||||||
@ -227,7 +219,7 @@ public class BauGuiEditor implements Listener {
|
|||||||
|
|
||||||
Player p = (Player) event.getPlayer();
|
Player p = (Player) event.getPlayer();
|
||||||
|
|
||||||
saveMapping(event.getView(), BauGuiMapping.getGuiMapping(p));
|
saveMapping(p);
|
||||||
open_Edits.remove(p);
|
open_Edits.remove(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden Mehr anzeigen
In neuem Issue referenzieren
Einen Benutzer sperren