SteamWar/BauSystem2.0
Archiviert
12
0

NoSchemSharing bug fix #193

Zusammengeführt
YoyoNow hat 11 Commits von NoSchemSharingWithTestBlock nach master 2023-07-26 20:44:35 +02:00 zusammengeführt
312 geänderte Dateien mit 8407 neuen und 14277 gelöschten Zeilen
Nur Änderungen aus Commit fdd579af5a werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -1,82 +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/>.
*/
package de.steamwar.bausystem.entities;
import de.steamwar.bausystem.features.detonator.AbstractDetonatorEntity;
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 DetonatorEntity15 extends EntityFallingBlock implements AbstractDetonatorEntity {
private static final Vec3D ZERO = new Vec3D(0, 0, 0);
private final Vector position;
private int references = 0;
public DetonatorEntity15(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);
}
}

Datei anzeigen

@ -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/>.
*/
package de.steamwar.bausystem.entities;
import de.steamwar.bausystem.features.simulator.AbstractSimulatorEntity;
import de.steamwar.bausystem.shared.BaseEntity15;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
public class SimulatorEntity15 extends BaseEntity15 implements AbstractSimulatorEntity {
private boolean printed = false;
public SimulatorEntity15(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 (printed) return;
printed = true;
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 (!printed) return false;
printed = false;
sendEntityDestroy(player);
die();
return true;
}
}

Datei anzeigen

@ -1,73 +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/>.
*/
package de.steamwar.bausystem.entities;
import de.steamwar.bausystem.features.tracer.AbstractTraceEntity;
import de.steamwar.bausystem.shared.BaseEntity15;
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;
public class TraceEntity15 extends BaseEntity15 implements AbstractTraceEntity {
private boolean exploded = false;
private ReferenceCounter referenceCounter = new ReferenceCounter();
public TraceEntity15(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;
}
}

Datei anzeigen

@ -1,80 +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/>.
*/
package de.steamwar.bausystem.entities;
import de.steamwar.bausystem.features.warp.AbstractWarpEntity;
import de.steamwar.bausystem.shared.BaseArmorStand15;
import net.minecraft.server.v1_15_R1.ChatComponentText;
import net.minecraft.server.v1_15_R1.PacketPlayOutEntityMetadata;
import net.minecraft.server.v1_15_R1.PacketPlayOutEntityTeleport;
import net.minecraft.server.v1_15_R1.PlayerConnection;
import org.bukkit.World;
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
public class WarpEntity15 extends BaseArmorStand15 implements AbstractWarpEntity {
public WarpEntity15(World world, Vector position, String name) {
super(world, position);
setInvisible(true);
setSmall(true);
setName(name);
this.setNoGravity(true);
this.ticksLived = -12000;
}
@Override
public void display(Player player) {
sendEntity(player);
}
@Override
public void setName(String name) {
this.setCustomNameVisible(true);
this.setCustomName(new ChatComponentText(name));
}
@Override
public boolean hide(Player player) {
sendEntityDestroy(player);
die();
return true;
}
@Override
public void sendMetaData(Player player) {
PacketPlayOutEntityMetadata packetPlayOutEntityMetadata = new PacketPlayOutEntityMetadata(getId(), datawatcher, true);
PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().playerConnection;
playerConnection.sendPacket(packetPlayOutEntityMetadata);
}
@Override
public void teleport(Player player, Vector position) {
setPositionRaw(position.getX(), position.getY(), position.getZ());
PacketPlayOutEntityTeleport packetPlayOutEntityTeleport = new PacketPlayOutEntityTeleport(this);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(packetPlayOutEntityTeleport);
}
@Override
public Vector getPosition() {
return new Vector(locX(), locY(), locZ());
}
}

Datei anzeigen

@ -1,56 +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/>.
*/
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 BaseArmorStand15 extends EntityArmorStand implements AbstractEntity {
private static final Vec3D ZERO = new Vec3D(0, 0, 0);
protected Vector position;
public BaseArmorStand15(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);
}
}

Datei anzeigen

@ -1,60 +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/>.
*/
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 BaseEntity15 extends EntityFallingBlock implements AbstractEntity {
private static final Vec3D ZERO = new Vec3D(0, 0, 0);
private final IBlockData iBlockData;
protected Vector position;
public BaseEntity15(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);
}
}

Datei anzeigen

@ -110,16 +110,11 @@ public class FlatteningWrapper15 implements FlatteningWrapper {
} }
private static final BaseBlock WOOL = Objects.requireNonNull(BlockTypes.PINK_WOOL).getDefaultState().toBaseBlock(); 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 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 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 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_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 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 CONCRETE_POWDER = Objects.requireNonNull(BlockTypes.PINK_CONCRETE_POWDER).getDefaultState().toBaseBlock();
private static final BaseBlock CARPET = Objects.requireNonNull(BlockTypes.PINK_CARPET).getDefaultState().toBaseBlock(); private static final BaseBlock CARPET = Objects.requireNonNull(BlockTypes.PINK_CARPET).getDefaultState().toBaseBlock();
@ -139,7 +134,7 @@ public class FlatteningWrapper15 implements FlatteningWrapper {
@Override @Override
public EditSession paste(Clipboard clipboard, Point pastePoint, PasteOptions pasteOptions) { public EditSession paste(Clipboard clipboard, Point pastePoint, PasteOptions pasteOptions) {
try (EditSession e = WorldEdit.getInstance().getEditSessionFactory().getEditSession(new BukkitWorld(Bukkit.getWorlds().get(0)), -1)) { try (EditSession e = WorldEdit.getInstance().getEditSessionFactory().getEditSession(new BukkitWorld(Bukkit.getWorlds().get(0)), -1)) {
if (pasteOptions.getColor() != Color.YELLOW) { if (pasteOptions.getColor() != Color.PINK) {
changeColor(clipboard, pasteOptions.getColor()); changeColor(clipboard, pasteOptions.getColor());
} }
if (pasteOptions.isOnlyColors()) { if (pasteOptions.isOnlyColors()) {
@ -216,28 +211,18 @@ public class FlatteningWrapper15 implements FlatteningWrapper {
BaseBlock block = clipboard.getFullBlock(pos); BaseBlock block = clipboard.getFullBlock(pos);
if (block.equals(WOOL)) { if (block.equals(WOOL)) {
clipboard.setBlock(pos, wool); clipboard.setBlock(pos, wool);
} else if (block.equals(WOOL2)) {
clipboard.setBlock(pos, wool);
} else if (block.equals(CLAY)) { } else if (block.equals(CLAY)) {
clipboard.setBlock(pos, clay); clipboard.setBlock(pos, clay);
} else if (block.equals(CLAY2)) {
clipboard.setBlock(pos, clay);
} else if (block.equals(GLAZED)) { } else if (block.equals(GLAZED)) {
clipboard.setBlock(pos, glazed); clipboard.setBlock(pos, glazed);
} else if (block.equals(GLASS)) { } else if (block.equals(GLASS)) {
clipboard.setBlock(pos, glass); clipboard.setBlock(pos, glass);
} else if (block.equals(GLASS2)) {
clipboard.setBlock(pos, glass);
} else if (block.equals(GLASS_PANE)) { } else if (block.equals(GLASS_PANE)) {
clipboard.setBlock(pos, glassPane); clipboard.setBlock(pos, glassPane);
} else if (block.equals(GLASS_PANE2)) {
clipboard.setBlock(pos, glassPane);
} else if (block.equals(CARPET)) { } else if (block.equals(CARPET)) {
clipboard.setBlock(pos, carpet); clipboard.setBlock(pos, carpet);
} else if (block.equals(CONCRETE)) { } else if (block.equals(CONCRETE)) {
clipboard.setBlock(pos, concrete); clipboard.setBlock(pos, concrete);
} else if (block.equals(CONCRETE2)) {
clipboard.setBlock(pos, concrete);
} else if (block.equals(CONCRETE_POWDER)) { } else if (block.equals(CONCRETE_POWDER)) {
clipboard.setBlock(pos, concretePowder); clipboard.setBlock(pos, concretePowder);
} }

Datei anzeigen

@ -20,20 +20,11 @@
package de.steamwar.bausystem.utils; package de.steamwar.bausystem.utils;
import com.comphenix.tinyprotocol.Reflection; import com.comphenix.tinyprotocol.Reflection;
import de.steamwar.bausystem.entities.DetonatorEntity15;
import de.steamwar.bausystem.entities.SimulatorEntity15;
import de.steamwar.bausystem.entities.TraceEntity15;
import de.steamwar.bausystem.features.detonator.AbstractDetonatorEntity;
import de.steamwar.bausystem.features.util.NoClipCommand; import de.steamwar.bausystem.features.util.NoClipCommand;
import de.steamwar.bausystem.features.simulator.AbstractSimulatorEntity;
import de.steamwar.bausystem.features.tracer.AbstractTraceEntity;
import de.steamwar.bausystem.features.warp.AbstractWarpEntity;
import de.steamwar.bausystem.entities.WarpEntity15;
import net.minecraft.server.v1_15_R1.*; import net.minecraft.server.v1_15_R1.*;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.GameMode; import org.bukkit.GameMode;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.Particle;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftEntity; 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.entity.CraftPlayer;
@ -41,7 +32,6 @@ import org.bukkit.craftbukkit.v1_15_R1.inventory.CraftItemStack;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.entity.TNTPrimed; import org.bukkit.entity.TNTPrimed;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.util.Vector;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -162,26 +152,6 @@ public class NMSWrapper15 implements NMSWrapper {
return invalid; return invalid;
} }
@Override
public AbstractWarpEntity createWarp(World world, Vector position, String name) {
return new WarpEntity15(world, position, name);
}
@Override
public AbstractSimulatorEntity createSimulator(World world, Vector tntPosition, boolean highlight) {
return new SimulatorEntity15(world, tntPosition, highlight);
}
@Override
public AbstractDetonatorEntity constructDetonator(World world, Vector position) {
return new DetonatorEntity15(world, position);
}
@Override
public AbstractTraceEntity createTrace(World world, Vector tntPosition, boolean tnt) {
return new TraceEntity15(world, tntPosition, tnt);
}
private final Class<?> explosionPacket = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutExplosion"); 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> a = Reflection.getField(explosionPacket, double.class, 0);
private final Reflection.FieldAccessor<Double> b = Reflection.getField(explosionPacket, double.class, 1); private final Reflection.FieldAccessor<Double> b = Reflection.getField(explosionPacket, double.class, 1);

Datei anzeigen

@ -1,33 +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.mojang.authlib.GameProfile;
import de.steamwar.bausystem.features.util.NoClipCommand;
public class ProtocolWrapper15 implements ProtocolWrapper {
private static final Reflection.ConstructorInvoker playerInfoDataConstructor = Reflection.getConstructor(NoClipCommand.playerInfoDataClass, NoClipCommand.playerInfoPacket, GameProfile.class, int.class, NoClipCommand.enumGamemode, NoClipCommand.iChatBaseComponent);
@Override
public Object playerInfoDataConstructor(Object packet, GameProfile profile, Object mode) {
return playerInfoDataConstructor.invoke(packet, profile, 0, mode, null);
}
}

Datei anzeigen

@ -1,95 +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/>.
*/
package de.steamwar.bausystem.entities;
import de.steamwar.bausystem.features.detonator.AbstractDetonatorEntity;
import net.minecraft.network.protocol.game.PacketPlayOutEntityDestroy;
import net.minecraft.network.protocol.game.PacketPlayOutEntityMetadata;
import net.minecraft.network.protocol.game.PacketPlayOutSpawnEntity;
import net.minecraft.server.network.PlayerConnection;
import net.minecraft.world.entity.EntityTypes;
import net.minecraft.world.entity.item.EntityFallingBlock;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.phys.Vec3D;
import org.bukkit.World;
import org.bukkit.craftbukkit.v1_18_R2.CraftWorld;
import org.bukkit.craftbukkit.v1_18_R2.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
public class DetonatorEntity18 extends EntityFallingBlock implements AbstractDetonatorEntity {
private static final Vec3D ZERO = new Vec3D(0, 0, 0);
private final Vector position;
private int references = 0;
public DetonatorEntity18(World world, Vector position) {
super(((CraftWorld) world).getHandle(), position.getX(), position.getY(), position.getZ(), Blocks.du.n());
this.position = position;
this.h(true);
this.e(true);
this.S = -12000;
}
@Override
public int getId() {
return ae();
}
@Override
public void display(Player player) {
if (references++ > 0)
return;
PacketPlayOutSpawnEntity packetPlayOutSpawnEntity = new PacketPlayOutSpawnEntity(getId(), cm(), position.getX(), position.getY(), position.getZ(), 0, 0, EntityTypes.C, Block.i(Blocks.du.n()), ZERO);
PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().b;
playerConnection.a(packetPlayOutSpawnEntity);
PacketPlayOutEntityMetadata packetPlayOutEntityMetadata = new PacketPlayOutEntityMetadata(getId(), Y, true);
playerConnection.a(packetPlayOutEntityMetadata);
}
@Override
public boolean hide(Player player, boolean force) {
if (!force && --references > 0)
return false;
sendDestroy(player);
ag();
return true;
}
private void sendDestroy(Player player) {
PacketPlayOutEntityDestroy packetPlayOutEntityDestroy = new PacketPlayOutEntityDestroy(getId());
((CraftPlayer) player).getHandle().b.a(packetPlayOutEntityDestroy);
}
@Override
public void sendEntity(Player player) {
display(player);
}
@Override
public void sendEntityDestroy(Player player) {
hide(player, false);
}
}

Datei anzeigen

@ -1,68 +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/>.
*/
package de.steamwar.bausystem.entities;
import de.steamwar.bausystem.features.simulator.AbstractSimulatorEntity;
import de.steamwar.bausystem.shared.BaseEntity18;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
public class SimulatorEntity18 extends BaseEntity18 implements AbstractSimulatorEntity {
private boolean printed = false;
public SimulatorEntity18(World world, Vector position, boolean highlight) {
super(world, position, highlight ? Material.WHITE_STAINED_GLASS : Material.TNT);
this.e(true);
this.S = -12000;
}
@Override
public int getId() {
return ae();
}
@Override
public void display(Player player) {
if (printed) return;
printed = true;
sendEntity(player);
}
@Override
public void setPosition(Vector position) {
this.position = position;
e(position.getX(), position.getY(), position.getZ());
}
@Override
public boolean hide(Player player, boolean force) {
if (!printed) return false;
printed = false;
sendEntityDestroy(player);
ag();
return true;
}
}

Datei anzeigen

@ -1,73 +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/>.
*/
package de.steamwar.bausystem.entities;
import de.steamwar.bausystem.features.tracer.AbstractTraceEntity;
import de.steamwar.bausystem.shared.BaseEntity18;
import de.steamwar.bausystem.shared.ReferenceCounter;
import net.minecraft.network.chat.ChatComponentText;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
public class TraceEntity18 extends BaseEntity18 implements AbstractTraceEntity {
private boolean exploded = false;
private ReferenceCounter referenceCounter = new ReferenceCounter();
public TraceEntity18(World world, Vector position, boolean tnt) {
super(world, position, tnt ? Material.TNT : Material.WHITE_STAINED_GLASS);
this.e(true);
this.S = -12000;
}
@Override
public void display(Player player, boolean exploded, int ticks) {
if (ticks != -1) {
this.n(true);
this.a(new ChatComponentText(ticks + ""));
}
if (!this.exploded && exploded) {
this.n(true);
this.a(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);
ag();
return true;
}
}

Datei anzeigen

@ -1,80 +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/>.
*/
package de.steamwar.bausystem.entities;
import de.steamwar.bausystem.features.warp.AbstractWarpEntity;
import de.steamwar.bausystem.shared.BaseArmorStand18;
import net.minecraft.network.chat.ChatComponentText;
import net.minecraft.network.protocol.game.PacketPlayOutEntityMetadata;
import net.minecraft.network.protocol.game.PacketPlayOutEntityTeleport;
import net.minecraft.server.network.PlayerConnection;
import org.bukkit.World;
import org.bukkit.craftbukkit.v1_18_R2.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
public class WarpEntity18 extends BaseArmorStand18 implements AbstractWarpEntity {
public WarpEntity18(World world, Vector position, String name) {
super(world, position);
this.j(true);
this.a(true);
setName(name);
this.e(true);
this.S = -12000;
}
@Override
public void display(Player player) {
sendEntity(player);
}
@Override
public void setName(String name) {
this.n(true);
this.a(new ChatComponentText(name));
}
@Override
public boolean hide(Player player) {
sendEntityDestroy(player);
ag();
return true;
}
@Override
public void sendMetaData(Player player) {
PacketPlayOutEntityMetadata packetPlayOutEntityMetadata = new PacketPlayOutEntityMetadata(ae(), Y, true);
PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().b;
playerConnection.a(packetPlayOutEntityMetadata);
}
@Override
public void teleport(Player player, Vector position) {
setPosRaw(position.getX(), position.getY(), position.getZ(), false);
PacketPlayOutEntityTeleport packetPlayOutEntityTeleport = new PacketPlayOutEntityTeleport(this);
((CraftPlayer) player).getHandle().b.a(packetPlayOutEntityTeleport);
}
@Override
public Vector getPosition() {
return new Vector(dc(), de(), di());
}
}

Datei anzeigen

@ -1,62 +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/>.
*/
package de.steamwar.bausystem.shared;
import net.minecraft.network.protocol.game.PacketPlayOutEntityDestroy;
import net.minecraft.network.protocol.game.PacketPlayOutEntityMetadata;
import net.minecraft.network.protocol.game.PacketPlayOutSpawnEntity;
import net.minecraft.server.network.PlayerConnection;
import net.minecraft.world.entity.EntityTypes;
import net.minecraft.world.entity.decoration.EntityArmorStand;
import net.minecraft.world.phys.Vec3D;
import org.bukkit.World;
import org.bukkit.craftbukkit.v1_18_R2.CraftWorld;
import org.bukkit.craftbukkit.v1_18_R2.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
public class BaseArmorStand18 extends EntityArmorStand implements AbstractEntity {
private static final Vec3D ZERO = new Vec3D(0, 0, 0);
protected Vector position;
public BaseArmorStand18(World world, Vector position) {
super(((CraftWorld) world).getHandle(), position.getX(), position.getY(), position.getZ());
this.position = position;
e(true);
S = -12000;
}
public void sendEntity(Player player) {
PacketPlayOutSpawnEntity packetPlayOutSpawnEntity = new PacketPlayOutSpawnEntity(ae(), cm(), position.getX(), position.getY(), position.getZ(), 0, 0, EntityTypes.c, 0, ZERO);
PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().b;
playerConnection.a(packetPlayOutSpawnEntity);
PacketPlayOutEntityMetadata packetPlayOutEntityMetadata = new PacketPlayOutEntityMetadata(ae(), Y, true);
playerConnection.a(packetPlayOutEntityMetadata);
}
public void sendEntityDestroy(Player player) {
PacketPlayOutEntityDestroy packetPlayOutEntityDestroy = new PacketPlayOutEntityDestroy(ae());
((CraftPlayer) player).getHandle().b.a(packetPlayOutEntityDestroy);
}
}

Datei anzeigen

@ -1,68 +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/>.
*/
package de.steamwar.bausystem.shared;
import net.minecraft.network.protocol.game.PacketPlayOutEntityDestroy;
import net.minecraft.network.protocol.game.PacketPlayOutEntityMetadata;
import net.minecraft.network.protocol.game.PacketPlayOutSpawnEntity;
import net.minecraft.server.network.PlayerConnection;
import net.minecraft.world.entity.EntityTypes;
import net.minecraft.world.entity.item.EntityFallingBlock;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.IBlockData;
import net.minecraft.world.phys.Vec3D;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.craftbukkit.v1_18_R2.CraftWorld;
import org.bukkit.craftbukkit.v1_18_R2.block.data.CraftBlockData;
import org.bukkit.craftbukkit.v1_18_R2.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
public class BaseEntity18 extends EntityFallingBlock implements AbstractEntity {
private static final Vec3D ZERO = new Vec3D(0, 0, 0);
private final IBlockData iBlockData;
protected Vector position;
public BaseEntity18(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.e(true);
this.S = -12000;
}
public void sendEntity(Player player) {
PacketPlayOutSpawnEntity packetPlayOutSpawnEntity = new PacketPlayOutSpawnEntity(ae(), cm(), position.getX(), position.getY(), position.getZ(), 0, 0, EntityTypes.C, Block.i(iBlockData), ZERO);
PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().b;
playerConnection.a(packetPlayOutSpawnEntity);
PacketPlayOutEntityMetadata packetPlayOutEntityMetadata = new PacketPlayOutEntityMetadata(ae(), Y, true);
playerConnection.a(packetPlayOutEntityMetadata);
}
public void sendEntityDestroy(Player player) {
PacketPlayOutEntityDestroy packetPlayOutEntityDestroy = new PacketPlayOutEntityDestroy(ae());
((CraftPlayer) player).getHandle().b.a(packetPlayOutEntityDestroy);
}
}

Datei anzeigen

@ -21,15 +21,7 @@ package de.steamwar.bausystem.utils;
import com.comphenix.tinyprotocol.Reflection; import com.comphenix.tinyprotocol.Reflection;
import com.comphenix.tinyprotocol.TinyProtocol; import com.comphenix.tinyprotocol.TinyProtocol;
import de.steamwar.bausystem.entities.DetonatorEntity18;
import de.steamwar.bausystem.entities.SimulatorEntity18;
import de.steamwar.bausystem.entities.TraceEntity18;
import de.steamwar.bausystem.entities.WarpEntity18;
import de.steamwar.bausystem.features.detonator.AbstractDetonatorEntity;
import de.steamwar.bausystem.features.simulator.AbstractSimulatorEntity;
import de.steamwar.bausystem.features.tracer.AbstractTraceEntity;
import de.steamwar.bausystem.features.util.NoClipCommand; import de.steamwar.bausystem.features.util.NoClipCommand;
import de.steamwar.bausystem.features.warp.AbstractWarpEntity;
import net.minecraft.SystemUtils; import net.minecraft.SystemUtils;
import net.minecraft.nbt.NBTBase; import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
@ -39,14 +31,16 @@ import net.minecraft.network.protocol.game.*;
import net.minecraft.server.level.PlayerInteractManager; import net.minecraft.server.level.PlayerInteractManager;
import net.minecraft.world.level.EnumGamemode; import net.minecraft.world.level.EnumGamemode;
import net.minecraft.world.phys.Vec3D; import net.minecraft.world.phys.Vec3D;
import org.bukkit.*; 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.CraftEntity;
import org.bukkit.craftbukkit.v1_18_R2.entity.CraftPlayer; import org.bukkit.craftbukkit.v1_18_R2.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_18_R2.inventory.CraftItemStack; import org.bukkit.craftbukkit.v1_18_R2.inventory.CraftItemStack;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.entity.TNTPrimed; import org.bukkit.entity.TNTPrimed;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.util.Vector;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -167,26 +161,6 @@ public class NMSWrapper18 implements NMSWrapper {
return invalid; return invalid;
} }
@Override
public AbstractWarpEntity createWarp(World world, Vector position, String name) {
return new WarpEntity18(world, position, name);
}
@Override
public AbstractSimulatorEntity createSimulator(World world, Vector tntPosition, boolean highlight) {
return new SimulatorEntity18(world, tntPosition, highlight);
}
@Override
public AbstractDetonatorEntity constructDetonator(World world, Vector position) {
return new DetonatorEntity18(world, position);
}
@Override
public AbstractTraceEntity createTrace(World world, Vector tntPosition, boolean tnt) {
return new TraceEntity18(world, tntPosition, tnt);
}
private final Class<?> explosionPacket = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutExplosion"); 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> a = Reflection.getField(explosionPacket, double.class, 0);
private final Reflection.FieldAccessor<Double> b = Reflection.getField(explosionPacket, double.class, 1); private final Reflection.FieldAccessor<Double> b = Reflection.getField(explosionPacket, double.class, 1);

Datei anzeigen

@ -1,33 +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.mojang.authlib.GameProfile;
import de.steamwar.bausystem.features.util.NoClipCommand;
public class ProtocolWrapper18 implements ProtocolWrapper {
private static final Reflection.ConstructorInvoker playerInfoDataConstructor = Reflection.getConstructor(NoClipCommand.playerInfoDataClass, GameProfile.class, int.class, NoClipCommand.enumGamemode, NoClipCommand.iChatBaseComponent);
@Override
public Object playerInfoDataConstructor(Object packet, GameProfile profile, Object mode) {
return playerInfoDataConstructor.invoke(profile, 0, mode, null);
}
}

Datei anzeigen

@ -1,124 +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/>.
*/
package de.steamwar.bausystem.entities;
import de.steamwar.bausystem.features.detonator.AbstractDetonatorEntity;
import net.minecraft.network.protocol.game.PacketPlayOutEntityDestroy;
import net.minecraft.network.protocol.game.PacketPlayOutEntityMetadata;
import net.minecraft.network.protocol.game.PacketPlayOutSpawnEntity;
import net.minecraft.server.network.PlayerConnection;
import net.minecraft.world.entity.EntityTypes;
import net.minecraft.world.entity.item.EntityFallingBlock;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.IBlockData;
import net.minecraft.world.phys.Vec3D;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.craftbukkit.v1_19_R1.CraftWorld;
import org.bukkit.craftbukkit.v1_19_R1.block.data.CraftBlockData;
import org.bukkit.craftbukkit.v1_19_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
import java.lang.reflect.Field;
public class DetonatorEntity19 extends EntityFallingBlock implements AbstractDetonatorEntity {
private static final Field ao;
static {
try {
ao = EntityFallingBlock.class.getDeclaredField("ao");
ao.setAccessible(true);
} catch (NoSuchFieldException e) {
throw new RuntimeException(e);
}
}
private static final Vec3D ZERO = new Vec3D(0, 0, 0);
private final Vector position;
private int references = 0;
private IBlockData iBlockData;
public DetonatorEntity19(World world, Vector position) {
super(EntityTypes.E, ((CraftWorld) world).getHandle());
try {
ao.set(this, ((CraftBlockData) Material.RED_STAINED_GLASS.createBlockData()).getState());
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
this.q = true;
e(position.getX(), position.getY(), position.getZ());
f(Vec3D.b);
t = position.getX();
u = position.getY();
v = position.getZ();
a(this.db());
this.iBlockData = ((CraftBlockData) Material.RED_STAINED_GLASS.createBlockData()).getState();
this.position = position;
this.e(true);
this.S = -12000;
}
@Override
public int getId() {
return ae();
}
@Override
public void display(Player player) {
if (references++ > 0)
return;
PacketPlayOutSpawnEntity packetPlayOutSpawnEntity = new PacketPlayOutSpawnEntity(ae(), co(), position.getX(), position.getY(), position.getZ(), 0, 0, EntityTypes.E, Block.i(iBlockData), ZERO, 0.0);
PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().b;
playerConnection.a(packetPlayOutSpawnEntity);
PacketPlayOutEntityMetadata packetPlayOutEntityMetadata = new PacketPlayOutEntityMetadata(getId(), Y, true);
playerConnection.a(packetPlayOutEntityMetadata);
}
@Override
public boolean hide(Player player, boolean force) {
if (!force && --references > 0)
return false;
sendDestroy(player);
ag();
return true;
}
private void sendDestroy(Player player) {
PacketPlayOutEntityDestroy packetPlayOutEntityDestroy = new PacketPlayOutEntityDestroy(getId());
((CraftPlayer) player).getHandle().b.a(packetPlayOutEntityDestroy);
}
@Override
public void sendEntity(Player player) {
display(player);
}
@Override
public void sendEntityDestroy(Player player) {
hide(player, false);
}
}

Datei anzeigen

@ -1,68 +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/>.
*/
package de.steamwar.bausystem.entities;
import de.steamwar.bausystem.features.simulator.AbstractSimulatorEntity;
import de.steamwar.bausystem.shared.BaseEntity19;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
public class SimulatorEntity19 extends BaseEntity19 implements AbstractSimulatorEntity {
private boolean printed = false;
public SimulatorEntity19(World world, Vector position, boolean highlight) {
super(world, position, highlight ? Material.WHITE_STAINED_GLASS : Material.TNT);
this.e(true);
this.S = -12000;
}
@Override
public int getId() {
return ae();
}
@Override
public void display(Player player) {
if (printed) return;
printed = true;
sendEntity(player);
}
@Override
public void setPosition(Vector position) {
this.position = position;
e(position.getX(), position.getY(), position.getZ());
}
@Override
public boolean hide(Player player, boolean force) {
if (!printed) return false;
printed = false;
sendEntityDestroy(player);
ag();
return true;
}
}

Datei anzeigen

@ -1,74 +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/>.
*/
package de.steamwar.bausystem.entities;
import de.steamwar.bausystem.features.tracer.AbstractTraceEntity;
import de.steamwar.bausystem.shared.BaseEntity19;
import de.steamwar.bausystem.shared.ReferenceCounter;
import net.minecraft.network.chat.IChatMutableComponent;
import net.minecraft.network.chat.contents.LiteralContents;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
public class TraceEntity19 extends BaseEntity19 implements AbstractTraceEntity {
private boolean exploded = false;
private ReferenceCounter referenceCounter = new ReferenceCounter();
public TraceEntity19(World world, Vector position, boolean tnt) {
super(world, position, tnt ? Material.TNT : Material.WHITE_STAINED_GLASS);
this.e(true);
this.S = -12000;
}
@Override
public void display(Player player, boolean exploded, int ticks) {
if (ticks != -1) {
this.n(true);
this.b(IChatMutableComponent.a(new LiteralContents(ticks + "")));
}
if (!this.exploded && exploded) {
this.n(true);
this.b(IChatMutableComponent.a(new LiteralContents("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);
ag();
return true;
}
}

Datei anzeigen

@ -1,81 +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/>.
*/
package de.steamwar.bausystem.entities;
import de.steamwar.bausystem.features.warp.AbstractWarpEntity;
import de.steamwar.bausystem.shared.BaseArmorStand19;
import net.minecraft.network.chat.IChatMutableComponent;
import net.minecraft.network.chat.contents.LiteralContents;
import net.minecraft.network.protocol.game.PacketPlayOutEntityMetadata;
import net.minecraft.network.protocol.game.PacketPlayOutEntityTeleport;
import net.minecraft.server.network.PlayerConnection;
import org.bukkit.World;
import org.bukkit.craftbukkit.v1_19_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
public class WarpEntity19 extends BaseArmorStand19 implements AbstractWarpEntity {
public WarpEntity19(World world, Vector position, String name) {
super(world, position);
this.j(true);
this.a(true);
setName(name);
this.e(true);
this.S = -12000;
}
@Override
public void display(Player player) {
sendEntity(player);
}
@Override
public void setName(String name) {
this.n(true);
this.b(IChatMutableComponent.a(new LiteralContents(name)));
}
@Override
public boolean hide(Player player) {
sendEntityDestroy(player);
ag();
return true;
}
@Override
public void sendMetaData(Player player) {
PacketPlayOutEntityMetadata packetPlayOutEntityMetadata = new PacketPlayOutEntityMetadata(ae(), Y, true);
PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().b;
playerConnection.a(packetPlayOutEntityMetadata);
}
@Override
public void teleport(Player player, Vector position) {
setPosRaw(position.getX(), position.getY(), position.getZ(), false);
PacketPlayOutEntityTeleport packetPlayOutEntityTeleport = new PacketPlayOutEntityTeleport(this);
((CraftPlayer) player).getHandle().b.a(packetPlayOutEntityTeleport);
}
@Override
public Vector getPosition() {
return new Vector(df(), dh(), dj());
}
}

Datei anzeigen

@ -1,165 +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.simulator;
import com.google.common.collect.Maps;
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
import net.minecraft.core.BlockPosition;
import net.minecraft.util.RandomSource;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.player.EntityHuman;
import net.minecraft.world.level.Explosion;
import net.minecraft.world.level.ExplosionDamageCalculator;
import net.minecraft.world.level.World;
import net.minecraft.world.level.gameevent.GameEvent;
import net.minecraft.world.phys.Vec3D;
import org.bukkit.craftbukkit.v1_19_R1.event.CraftEventFactory;
import javax.annotation.Nullable;
import java.util.List;
import java.util.Map;
public class FakeExplosion19 extends Explosion {
private List<FakeTNT19> fakeTNT19s;
private boolean c;
private Explosion.Effect d;
private RandomSource e;
private World f;
private double g;
private double h;
private double i;
@Nullable
public Entity j;
private float k;
private DamageSource l;
private ExplosionDamageCalculator m;
private ObjectArrayList<BlockPosition> n;
private Map<EntityHuman, Vec3D> o;
public boolean wasCanceled;
public FakeExplosion19(List<FakeTNT19> fakeTNT19s, World world, @Nullable Entity entity, @Nullable DamageSource damageSource, @Nullable ExplosionDamageCalculator behavior, double x, double y, double z, float power, boolean createFire, Explosion.Effect destructionType) {
super(world, entity, damageSource, behavior, x, y, z, power, createFire, destructionType);
this.fakeTNT19s = fakeTNT19s;
this.wasCanceled = false;
this.e = RandomSource.a();
this.n = new ObjectArrayList();
this.o = Maps.newHashMap();
this.f = world;
this.j = entity;
this.k = (float) Math.max((double) power, 0.0D);
this.g = x;
this.h = y;
this.i = z;
this.c = createFire;
this.d = destructionType;
this.l = damageSource == null ? DamageSource.a(this) : damageSource;
this.m = new ExplosionDamageCalculator();
}
private float getBlockDensity(Vec3D vec3d, Entity entity) {
return a(vec3d, entity);
}
@Override
public void a() {
if ((this.k) >= 0.1F) {
this.f.a(this.j, GameEvent.w, new Vec3D(this.g, this.h, this.i));
/*
Set<BlockPosition> set = Sets.newHashSet();
int i;
int j;
for (int k = 0; k < 16; ++k) {
for (i = 0; i < 16; ++i) {
for (j = 0; j < 16; ++j) {
if (k == 0 || k == 15 || i == 0 || i == 15 || j == 0 || j == 15) {
double d0 = (double) ((float) k / 15.0F * 2.0F - 1.0F);
double d1 = (double) ((float) i / 15.0F * 2.0F - 1.0F);
double d2 = (double) ((float) j / 15.0F * 2.0F - 1.0F);
double d3 = Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2);
d0 /= d3;
d1 /= d3;
d2 /= d3;
float f = this.k * (0.7F + this.f.w.i() * 0.6F);
double d4 = this.g;
double d5 = this.h;
double d6 = this.i;
for (float var21 = 0.3F; f > 0.0F; f -= 0.22500001F) {
BlockPosition blockposition = new BlockPosition(d4, d5, d6);
IBlockData iblockdata = this.f.a_(blockposition);
Fluid fluid = iblockdata.p();
if (!this.f.j(blockposition)) {
break;
}
Optional<Float> optional = this.m.a(this, this.f, blockposition, iblockdata, fluid);
if (optional.isPresent()) {
f -= ((Float) optional.get() + 0.3F) * 0.3F;
}
if (f > 0.0F && this.m.a(this, this.f, blockposition, iblockdata, f)) {
set.add(blockposition);
}
d4 += d0 * 0.30000001192092896D;
d5 += d1 * 0.30000001192092896D;
d6 += d2 * 0.30000001192092896D;
}
}
}
}
}
this.n.addAll(set);
*/
float f2 = this.k * 2.0F;
Vec3D vec3d = new Vec3D(this.g, this.h, this.i);
for (int l1 = 0; l1 < fakeTNT19s.size(); ++l1) {
Entity entity = (Entity) fakeTNT19s.get(l1);
if (!entity.cF()) {
double d7 = Math.sqrt(entity.e(vec3d)) / (double) f2;
if (d7 <= 1.0D) {
double d8 = entity.df() - this.g;
double d9 = entity.dh() - this.h;
double d10 = entity.dl() - this.i;
double d11 = Math.sqrt(d8 * d8 + d9 * d9 + d10 * d10);
if (d11 != 0.0D) {
d8 /= d11;
d9 /= d11;
d10 /= d11;
double d12 = (double) this.getBlockDensity(vec3d, entity);
double d13 = (1.0D - d7) * d12;
entity.lastDamageCancelled = false;
CraftEventFactory.entityDamage = null;
entity.f(entity.dd().b(d8 * d13, d9 * d13, d10 * d13));
}
}
}
}
}
}
}

Datei anzeigen

@ -1,257 +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.simulator;
import net.minecraft.core.BlockPosition;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.game.PacketPlayOutSpawnEntity;
import net.minecraft.network.syncher.DataWatcher;
import net.minecraft.network.syncher.DataWatcherObject;
import net.minecraft.network.syncher.DataWatcherRegistry;
import net.minecraft.util.MathHelper;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.*;
import net.minecraft.world.entity.item.EntityTNTPrimed;
import net.minecraft.world.level.Explosion;
import net.minecraft.world.level.ExplosionDamageCalculator;
import net.minecraft.world.level.World;
import net.minecraft.world.level.block.state.IBlockData;
import net.minecraft.world.phys.AxisAlignedBB;
import net.minecraft.world.phys.Vec3D;
import net.minecraft.world.phys.shapes.VoxelShape;
import org.bukkit.entity.Explosive;
import org.bukkit.event.entity.ExplosionPrimeEvent;
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.List;
public class FakeTNT19 extends EntityTNTPrimed {
private static final DataWatcherObject<Integer> b;
private static final int c = 80;
private List<FakeTNT19> fakeTNT19s;
private List<FakeTNT19> spawnList = new ArrayList<>();
private int count;
@Nullable
public EntityLiving d;
public float yield;
public boolean isIncendiary;
public FakeTNT19(List<FakeTNT19> fakeTNT19s, EntityTypes<? extends EntityTNTPrimed> type, World world) {
super(type, world);
this.fakeTNT19s = fakeTNT19s;
this.yield = 4.0F;
this.isIncendiary = false;
super.q = true;
}
public FakeTNT19(List<FakeTNT19> fakeTNT19s, World world, double x, double y, double z, int fuse, int count) {
this(fakeTNT19s, EntityTypes.av, world);
this.e(x, y, z);
double d3 = world.w.j() * 6.2831854820251465D;
this.n(-Math.sin(d3) * 0.02D, 0.20000000298023224D, -Math.cos(d3) * 0.02D);
this.a(fuse);
super.t = x;
super.u = y;
super.v = z;
this.d = null;
this.count = count;
}
protected void a_() {
super.Y.a(b, 80);
}
protected MovementEmission aO() {
return MovementEmission.a;
}
public boolean bl() {
return !this.dt();
}
private Vec3D g(Vec3D vec3d) {
AxisAlignedBB axisalignedbb = this.cz();
List<VoxelShape> list = this.s.b(this, axisalignedbb.b(vec3d));
Vec3D vec3d1 = vec3d.g() == 0.0 ? vec3d : a(this, vec3d, axisalignedbb, this.s, list);
boolean flag = vec3d.c != vec3d1.c;
boolean flag1 = vec3d.d != vec3d1.d;
boolean flag2 = vec3d.e != vec3d1.e;
boolean flag3 = this.y || flag1 && vec3d.d < 0.0;
if (this.P > 0.0F && flag3 && (flag || flag2)) {
Vec3D vec3d2 = a(this, new Vec3D(vec3d.c, (double)this.P, vec3d.e), axisalignedbb, this.s, list);
Vec3D vec3d3 = a(this, new Vec3D(0.0, (double)this.P, 0.0), axisalignedbb.b(vec3d.c, 0.0, vec3d.e), this.s, list);
if (vec3d3.d < (double)this.P) {
Vec3D vec3d4 = a(this, new Vec3D(vec3d.c, 0.0, vec3d.e), axisalignedbb.c(vec3d3), this.s, list).e(vec3d3);
if (vec3d4.i() > vec3d2.i()) {
vec3d2 = vec3d4;
}
}
if (vec3d2.i() > vec3d1.i()) {
return vec3d2.e(a(this, new Vec3D(0.0, -vec3d2.d + vec3d.d, 0.0), axisalignedbb.c(vec3d2), this.s, list));
}
}
return vec3d1;
}
@Override
public void a(EnumMoveType enummovetype, Vec3D vec3d) {
if (this.E.g() > 1.0E-7) {
vec3d = vec3d.h(this.E);
this.E = Vec3D.b;
this.f(Vec3D.b);
}
Vec3D vec3d1 = this.g(vec3d);
double d0 = vec3d1.g();
if (d0 > 1.0E-7) {
this.e(this.df() + vec3d1.c, this.dg() + vec3d1.d, this.dl() + vec3d1.e);
}
boolean flag = !MathHelper.b(vec3d.c, vec3d1.c);
boolean flag1 = !MathHelper.b(vec3d.e, vec3d1.e);
this.z = flag || flag1;
this.A = vec3d.d != vec3d1.d;
this.B = this.A && vec3d.d < 0.0;
if (this.z) {
this.C = this.b(vec3d1);
} else {
this.C = false;
}
this.y = this.A && vec3d.d < 0.0;
BlockPosition blockposition = this.aA();
IBlockData iblockdata = this.s.a_(blockposition);
// this.a(vec3d1.d, this.y, iblockdata, blockposition);
if (!this.dt()) {
if (this.z) {
Vec3D vec3d2 = this.dd();
this.n(flag ? 0.0 : vec3d2.c, vec3d2.d, flag1 ? 0.0 : vec3d2.e);
}
net.minecraft.world.level.block.Block block = iblockdata.b();
if (vec3d.d != vec3d1.d) {
block.a(this.s, this);
}
if (this.y) {
block.a(this.s, blockposition, iblockdata, this);
}
this.ax();
float f2 = this.aD();
this.f(this.dd().d((double)f2, 1.0, (double)f2));
}
}
public void k(List<FakeTNT19> spawnList) {
if (!this.aN()) {
this.f(this.dd().b(0.0D, -0.04D, 0.0D));
}
this.a(EnumMoveType.a, this.dd());
this.f(this.dd().a(0.98D));
if (super.y) {
this.f(this.dd().d(0.7D, -0.5D, 0.7D));
}
int i = this.i() - 1;
this.a(i);
if (i <= 0) {
if (!super.s.y) {
this.j1();
}
this.ah();
} else {
this.aY();
}
if (i == 1 && count > 1) {
for (int c = 0; c < count - 1; c++) {
FakeTNT19 fakeTNT19 = new FakeTNT19(fakeTNT19s, this.s, this.df(), this.dh(), this.dl(), i, 1);
fakeTNT19.y = this.y;
fakeTNT19.f(new Vec3D(this.dd().c, this.dd().d, this.dd().e));
spawnList.add(fakeTNT19);
}
count = 1;
}
}
private void j1() {
ExplosionPrimeEvent event = new ExplosionPrimeEvent((Explosive) this.getBukkitEntity());
super.s.getCraftServer().getPluginManager().callEvent(event);
if (!event.isCancelled()) {
this.a(this, this.df(), this.e(0.0625D), this.dl(), event.getRadius(), event.getFire(), Explosion.Effect.b);
}
}
public FakeExplosion19 a(@Nullable Entity entity, double x, double y, double z, float power, boolean createFire, Explosion.Effect destructionType) {
return this.a(entity, (DamageSource) null, (ExplosionDamageCalculator) null, x, y, z, power, createFire, destructionType);
}
public FakeExplosion19 a(@Nullable Entity entity, @Nullable DamageSource damageSource, @Nullable ExplosionDamageCalculator behavior, double x, double y, double z, float power, boolean createFire, Explosion.Effect destructionType) {
FakeExplosion19 explosion = new FakeExplosion19(fakeTNT19s, SimulatorPreview19.WORLD, entity, damageSource, behavior, x, y, z, power, createFire, destructionType);
explosion.a();
// explosion.a(true);
return explosion;
}
protected void b(NBTTagCompound nbt) {
nbt.a("Fuse", (short) this.i());
}
protected void a(NBTTagCompound nbt) {
this.a(nbt.g("Fuse"));
}
@Nullable
public EntityLiving h() {
return this.d;
}
protected float a(EntityPose pose, EntitySize dimensions) {
return 0.15F;
}
public void a(int fuse) {
super.Y.b(b, fuse);
}
public int i() {
return (Integer) super.Y.a(b);
}
public Packet<?> S() {
return new PacketPlayOutSpawnEntity(this);
}
public boolean cr() {
return super.cr();
}
static {
b = DataWatcher.a(EntityTNTPrimed.class, DataWatcherRegistry.b);
}
}

Datei anzeigen

@ -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.features.simulator;
import de.steamwar.bausystem.features.simulator.tnt.SimulatorElement;
import de.steamwar.bausystem.features.tracer.show.Record;
import de.steamwar.bausystem.shared.Pair;
import net.minecraft.world.level.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_19_R1.CraftWorld;
import org.bukkit.entity.TNTPrimed;
import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
public class SimulatorPreview19 implements SimulatorPreview {
public static final World WORLD = ((CraftWorld) Bukkit.getWorlds().get(0)).getHandle();
@Override
public Record simulate(TNTSimulator tntSimulator) {
if (true) {
return new Record(null);
}
Map<Integer, Map<Integer, Set<Pair<SimulatorPreview.SimulatorPreviewTNTData, Integer>>>> result = new HashMap<>();
for (SimulatorElement element : tntSimulator.getTntElementList()) {
element.locations(result);
}
AtomicInteger maxTick = new AtomicInteger(0);
Map<Integer, List<List<Pair<SimulatorPreview.SimulatorPreviewTNTData, Integer>>>> toSpawn = new HashMap<>();
AtomicInteger tntCount = new AtomicInteger(0);
result.forEach((integer, integerSetMap) -> {
List<Pair<Integer, Set<Pair<SimulatorPreview.SimulatorPreviewTNTData, Integer>>>> internal = new ArrayList<>();
integerSetMap.forEach((integer1, pairs) -> {
internal.add(new Pair<>(integer1, pairs));
});
internal.sort(Comparator.comparingInt(Pair::getKey));
toSpawn.put(integer, internal.stream().map(Pair::getValue).peek(pairs -> {
tntCount.addAndGet(pairs.stream().mapToInt(Pair::getValue).sum());
}).map(ArrayList::new).peek(Collections::shuffle).collect(Collectors.toList()));
if (maxTick.get() < integer) {
maxTick.set(integer);
}
});
if (tntCount.get() > 500) {
return new Record(null);
}
List<FakeTNT19> fakeTNT19s = new ArrayList<>();
Record record = new Record(null);
Map<FakeTNT19, Record.TNTRecord> tntRecords = new HashMap<>();
int maxTickToCalc = maxTick.get() + 160;
for (int tick = 0; tick < maxTickToCalc; tick++) {
List<List<Pair<SimulatorPreview.SimulatorPreviewTNTData, Integer>>> toSpawnInTick = toSpawn.get(tick);
try {
if (toSpawnInTick == null) continue;
toSpawnInTick.forEach(pairs -> {
AtomicBoolean hasSomeLeft = new AtomicBoolean(true);
while(hasSomeLeft.get()) {
hasSomeLeft.set(false);
pairs.forEach(pair -> {
SimulatorPreview.SimulatorPreviewTNTData previewTNTData = pair.getKey();
if (!previewTNTData.isXVelocity() && !previewTNTData.isZVelocity()) {
FakeTNT19 fakeTNT19 = new FakeTNT19(fakeTNT19s, WORLD, previewTNTData.getX(), previewTNTData.getY(), previewTNTData.getZ(), previewTNTData.getFuseTicks(), pair.getValue());
TNTPrimed tntPrimed = (TNTPrimed) fakeTNT19.getBukkitEntity();
if (!previewTNTData.isXVelocity()) tntPrimed.setVelocity(tntPrimed.getVelocity().setX(0));
if (!previewTNTData.isYVelocity()) tntPrimed.setVelocity(tntPrimed.getVelocity().setY(0));
if (!previewTNTData.isZVelocity()) tntPrimed.setVelocity(tntPrimed.getVelocity().setZ(0));
fakeTNT19s.add(fakeTNT19);
pair.setValue(0);
} else if (pair.getValue() > 0) {
hasSomeLeft.set(true);
FakeTNT19 fakeTNT19 = new FakeTNT19(fakeTNT19s, WORLD, previewTNTData.getX(), previewTNTData.getY(), previewTNTData.getZ(), previewTNTData.getFuseTicks(), 1);
TNTPrimed tntPrimed = (TNTPrimed) fakeTNT19.getBukkitEntity();
if (!previewTNTData.isXVelocity()) tntPrimed.setVelocity(tntPrimed.getVelocity().setX(0));
if (!previewTNTData.isYVelocity()) tntPrimed.setVelocity(tntPrimed.getVelocity().setY(0));
if (!previewTNTData.isZVelocity()) tntPrimed.setVelocity(tntPrimed.getVelocity().setZ(0));
fakeTNT19s.add(fakeTNT19);
pair.setValue(pair.getValue() - 1);
}
});
}
});
} finally {
calculateTick(fakeTNT19s, record, tntRecords);
}
}
return record;
}
private void calculateTick(List<FakeTNT19> fakeTNT19s, Record record, Map<FakeTNT19, Record.TNTRecord> tntRecords) {
int i = 0;
while (i < fakeTNT19s.size()) {
List<FakeTNT19> spawnList = new ArrayList<>();
FakeTNT19 fakeTNT19 = fakeTNT19s.get(i);
fakeTNT19.k(spawnList);
TNTPrimed tntPrimed = ((TNTPrimed) (fakeTNT19.getBukkitEntity()));
if (tntPrimed.getFuseTicks() <= 0) {
tntRecords.computeIfAbsent(fakeTNT19, ignore -> record.spawn(0)).explode(tntPrimed);
fakeTNT19s.remove(i);
i--;
} else {
tntRecords.computeIfAbsent(fakeTNT19, ignore -> record.spawn(0)).explode(tntPrimed);
}
if (!spawnList.isEmpty()) {
fakeTNT19s.addAll(i, spawnList);
i += spawnList.size();
}
i++;
}
}
}

Datei anzeigen

@ -21,7 +21,7 @@ package de.steamwar.bausystem.features.tracer.record;
import net.minecraft.world.entity.item.EntityTNTPrimed; import net.minecraft.world.entity.item.EntityTNTPrimed;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_19_R1.CraftWorld; import org.bukkit.craftbukkit.v1_19_R2.CraftWorld;
import org.bukkit.entity.TNTPrimed; import org.bukkit.entity.TNTPrimed;
import java.util.stream.Stream; import java.util.stream.Stream;

Datei anzeigen

@ -1,62 +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/>.
*/
package de.steamwar.bausystem.shared;
import net.minecraft.network.protocol.game.PacketPlayOutEntityDestroy;
import net.minecraft.network.protocol.game.PacketPlayOutEntityMetadata;
import net.minecraft.network.protocol.game.PacketPlayOutSpawnEntity;
import net.minecraft.server.network.PlayerConnection;
import net.minecraft.world.entity.EntityTypes;
import net.minecraft.world.entity.decoration.EntityArmorStand;
import net.minecraft.world.phys.Vec3D;
import org.bukkit.World;
import org.bukkit.craftbukkit.v1_19_R1.CraftWorld;
import org.bukkit.craftbukkit.v1_19_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
public class BaseArmorStand19 extends EntityArmorStand implements AbstractEntity {
private static final Vec3D ZERO = new Vec3D(0, 0, 0);
protected Vector position;
public BaseArmorStand19(World world, Vector position) {
super(((CraftWorld) world).getHandle(), position.getX(), position.getY(), position.getZ());
this.position = position;
e(true);
S = -12000;
}
public void sendEntity(Player player) {
PacketPlayOutSpawnEntity packetPlayOutSpawnEntity = new PacketPlayOutSpawnEntity(ae(), co(), position.getX(), position.getY(), position.getZ(), 0, 0, EntityTypes.d, 0, ZERO, 0.0);
PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().b;
playerConnection.a(packetPlayOutSpawnEntity);
PacketPlayOutEntityMetadata packetPlayOutEntityMetadata = new PacketPlayOutEntityMetadata(ae(), Y, true);
playerConnection.a(packetPlayOutEntityMetadata);
}
public void sendEntityDestroy(Player player) {
PacketPlayOutEntityDestroy packetPlayOutEntityDestroy = new PacketPlayOutEntityDestroy(ae());
((CraftPlayer) player).getHandle().b.a(packetPlayOutEntityDestroy);
}
}

Datei anzeigen

@ -1,94 +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/>.
*/
package de.steamwar.bausystem.shared;
import net.minecraft.network.protocol.game.PacketPlayOutEntityDestroy;
import net.minecraft.network.protocol.game.PacketPlayOutEntityMetadata;
import net.minecraft.network.protocol.game.PacketPlayOutSpawnEntity;
import net.minecraft.server.network.PlayerConnection;
import net.minecraft.world.entity.EntityTypes;
import net.minecraft.world.entity.item.EntityFallingBlock;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.IBlockData;
import net.minecraft.world.phys.Vec3D;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.craftbukkit.v1_19_R1.CraftWorld;
import org.bukkit.craftbukkit.v1_19_R1.block.data.CraftBlockData;
import org.bukkit.craftbukkit.v1_19_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
import java.lang.reflect.Field;
public class BaseEntity19 extends EntityFallingBlock implements AbstractEntity {
private static final Field ao;
static {
try {
ao = EntityFallingBlock.class.getDeclaredField("ao");
ao.setAccessible(true);
} catch (NoSuchFieldException e) {
throw new RuntimeException(e);
}
}
private static final Vec3D ZERO = new Vec3D(0, 0, 0);
private final IBlockData iBlockData;
protected Vector position;
public BaseEntity19(World world, Vector position, Material blockType) {
super(EntityTypes.E, ((CraftWorld) world).getHandle());
try {
ao.set(this, ((CraftBlockData) blockType.createBlockData()).getState());
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
this.q = true;
e(position.getX(), position.getY(), position.getZ());
f(Vec3D.b);
t = position.getX();
u = position.getY();
v = position.getZ();
a(this.db());
this.iBlockData = ((CraftBlockData) blockType.createBlockData()).getState();
this.position = position;
this.e(true);
this.S = -12000;
}
public void sendEntity(Player player) {
PacketPlayOutSpawnEntity packetPlayOutSpawnEntity = new PacketPlayOutSpawnEntity(ae(), co(), position.getX(), position.getY(), position.getZ(), 0, 0, EntityTypes.E, Block.i(iBlockData), ZERO, 0.0);
PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().b;
playerConnection.a(packetPlayOutSpawnEntity);
PacketPlayOutEntityMetadata packetPlayOutEntityMetadata = new PacketPlayOutEntityMetadata(ae(), Y, true);
playerConnection.a(packetPlayOutEntityMetadata);
}
public void sendEntityDestroy(Player player) {
PacketPlayOutEntityDestroy packetPlayOutEntityDestroy = new PacketPlayOutEntityDestroy(ae());
((CraftPlayer) player).getHandle().b.a(packetPlayOutEntityDestroy);
}
}

Datei anzeigen

@ -21,32 +21,27 @@ package de.steamwar.bausystem.utils;
import com.comphenix.tinyprotocol.Reflection; import com.comphenix.tinyprotocol.Reflection;
import com.comphenix.tinyprotocol.TinyProtocol; import com.comphenix.tinyprotocol.TinyProtocol;
import de.steamwar.bausystem.entities.DetonatorEntity19;
import de.steamwar.bausystem.entities.SimulatorEntity19;
import de.steamwar.bausystem.entities.TraceEntity19;
import de.steamwar.bausystem.entities.WarpEntity19;
import de.steamwar.bausystem.features.detonator.AbstractDetonatorEntity;
import de.steamwar.bausystem.features.simulator.AbstractSimulatorEntity;
import de.steamwar.bausystem.features.tracer.AbstractTraceEntity;
import de.steamwar.bausystem.features.util.NoClipCommand; import de.steamwar.bausystem.features.util.NoClipCommand;
import de.steamwar.bausystem.features.warp.AbstractWarpEntity;
import net.minecraft.SystemUtils; import net.minecraft.SystemUtils;
import net.minecraft.nbt.NBTBase; import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList; import net.minecraft.nbt.NBTTagList;
import net.minecraft.network.protocol.Packet; import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.game.*; import net.minecraft.network.protocol.game.*;
import net.minecraft.network.syncher.DataWatcher;
import net.minecraft.server.level.PlayerInteractManager; import net.minecraft.server.level.PlayerInteractManager;
import net.minecraft.world.level.EnumGamemode; import net.minecraft.world.level.EnumGamemode;
import net.minecraft.world.phys.Vec3D; import net.minecraft.world.phys.Vec3D;
import org.bukkit.*; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_19_R1.entity.CraftEntity; import org.bukkit.GameMode;
import org.bukkit.craftbukkit.v1_19_R1.entity.CraftPlayer; import org.bukkit.Material;
import org.bukkit.craftbukkit.v1_19_R1.inventory.CraftItemStack; 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.Player;
import org.bukkit.entity.TNTPrimed; import org.bukkit.entity.TNTPrimed;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.util.Vector;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -96,7 +91,9 @@ public class NMSWrapper19 implements NMSWrapper {
if (entity instanceof TNTPrimed) { if (entity instanceof TNTPrimed) {
net.minecraft.world.entity.Entity serverEntity = ((CraftEntity) entity).getHandle(); net.minecraft.world.entity.Entity serverEntity = ((CraftEntity) entity).getHandle();
packets.add(new PacketPlayOutEntityMetadata(serverEntity.ae(), serverEntity.ai(), true)); List<DataWatcher.b<?>> list = serverEntity.al().c();
if(list != null)
packets.add(new PacketPlayOutEntityMetadata(serverEntity.ah(), list));
} }
}); });
} }
@ -119,8 +116,8 @@ public class NMSWrapper19 implements NMSWrapper {
@Override @Override
public void setPlayerBuildAbilities(Player player) { public void setPlayerBuildAbilities(Player player) {
((CraftPlayer) player).getHandle().fB().d = true; ((CraftPlayer) player).getHandle().fF().d = true;
((CraftPlayer) player).getHandle().fB().e = true; ((CraftPlayer) player).getHandle().fF().e = true;
} }
@Override @Override
@ -167,26 +164,6 @@ public class NMSWrapper19 implements NMSWrapper {
return invalid; return invalid;
} }
@Override
public AbstractWarpEntity createWarp(World world, Vector position, String name) {
return new WarpEntity19(world, position, name);
}
@Override
public AbstractSimulatorEntity createSimulator(World world, Vector tntPosition, boolean highlight) {
return new SimulatorEntity19(world, tntPosition, highlight);
}
@Override
public AbstractDetonatorEntity constructDetonator(World world, Vector position) {
return new DetonatorEntity19(world, position);
}
@Override
public AbstractTraceEntity createTrace(World world, Vector tntPosition, boolean tnt) {
return new TraceEntity19(world, tntPosition, tnt);
}
private final Class<?> explosionPacket = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutExplosion"); 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> a = Reflection.getField(explosionPacket, double.class, 0);
private final Reflection.FieldAccessor<Double> b = Reflection.getField(explosionPacket, double.class, 1); private final Reflection.FieldAccessor<Double> b = Reflection.getField(explosionPacket, double.class, 1);

Datei anzeigen

@ -19,22 +19,62 @@
package de.steamwar.bausystem.utils; package de.steamwar.bausystem.utils;
import de.steamwar.bausystem.utils.PlayerMovementWrapper;
import net.minecraft.network.protocol.game.PacketPlayInFlying; import net.minecraft.network.protocol.game.PacketPlayInFlying;
import net.minecraft.server.level.EntityPlayer; import net.minecraft.server.level.EntityPlayer;
import org.bukkit.craftbukkit.v1_19_R1.entity.CraftPlayer; import org.bukkit.Location;
import org.bukkit.craftbukkit.v1_19_R2.entity.CraftPlayer;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
public class PlayerMovementWrapper19 implements PlayerMovementWrapper { public class PlayerMovementWrapper19 implements PlayerMovementWrapper {
private static class Position {
private double x;
private double y;
private double z;
private float yaw;
private float pitch;
}
private Map<UUID, Position> playerLocationMap = new HashMap<>();
@Override @Override
public void setPosition(Player player, Object object) { public void setPosition(Player player, Object object) {
Position position = playerLocationMap.computeIfAbsent(player.getUniqueId(), uuid -> {
Position pos = new Position();
Location location = player.getLocation();
pos.x = location.getX();
pos.y = location.getY();
pos.z = location.getZ();
pos.yaw = location.getYaw();
pos.pitch = location.getPitch();
return pos;
});
PacketPlayInFlying packetPlayInFlying = ((PacketPlayInFlying) object); PacketPlayInFlying packetPlayInFlying = ((PacketPlayInFlying) object);
EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle(); EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
if (packetPlayInFlying.h) { if (packetPlayInFlying.h) {
entityPlayer.b(packetPlayInFlying.a, packetPlayInFlying.b, packetPlayInFlying.c, packetPlayInFlying.d, packetPlayInFlying.e); entityPlayer.b(packetPlayInFlying.a, packetPlayInFlying.b, packetPlayInFlying.c, packetPlayInFlying.d, packetPlayInFlying.e);
position.x = packetPlayInFlying.a;
position.y = packetPlayInFlying.b;
position.z = packetPlayInFlying.c;
position.yaw = packetPlayInFlying.d;
position.pitch = packetPlayInFlying.e;
} else { } else {
entityPlayer.e(packetPlayInFlying.a, packetPlayInFlying.b, packetPlayInFlying.c); entityPlayer.e(packetPlayInFlying.a, packetPlayInFlying.b, packetPlayInFlying.c);
position.x = packetPlayInFlying.a;
position.y = packetPlayInFlying.b;
position.z = packetPlayInFlying.c;
}
}
@Override
public void disable(Player player) {
Position position = playerLocationMap.remove(player.getUniqueId());
if (position != null) {
player.teleport(new Location(player.getWorld(), position.x, position.y, position.z, position.yaw, position.pitch));
} }
} }
} }

Datei anzeigen

@ -1,33 +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/>.
*/
package de.steamwar.bausystem.utils;
import com.comphenix.tinyprotocol.Reflection;
import com.mojang.authlib.GameProfile;
import de.steamwar.bausystem.features.util.NoClipCommand;
public class ProtocolWrapper19 implements ProtocolWrapper {
private static final Reflection.ConstructorInvoker playerInfoDataConstructor = Reflection.getConstructor(NoClipCommand.playerInfoDataClass, GameProfile.class, int.class, NoClipCommand.enumGamemode, NoClipCommand.iChatBaseComponent, Reflection.getClass("net.minecraft.world.entity.player.ProfilePublicKey$a"));
@Override
public Object playerInfoDataConstructor(Object packet, GameProfile profile, Object mode) {
return playerInfoDataConstructor.invoke(profile, 0, mode, null, null);
}
}

Datei anzeigen

@ -0,0 +1,40 @@
/*
* 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 + ");");
}
}

Datei anzeigen

@ -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 Operator_GENERIC implements LinkageType {
@Override
public String method() {
return "linkScriptCommands";
}
@Override
public void generateCode(BuildPlan buildPlan, MethodBuilder methodBuilder, String s, TypeElement typeElement) {
buildPlan.addImport("de.steamwar.bausystem.features.script.expression.Expression");
methodBuilder.addLine("Expression.registerOperator(" + s + ");");
}
}

Datei anzeigen

@ -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) 2023 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
@ -25,16 +25,16 @@ import de.steamwar.linkage.plan.MethodBuilder;
import javax.lang.model.element.TypeElement; import javax.lang.model.element.TypeElement;
public class BlockAttribute_GENERIC implements LinkageType { public class ScoreboardElement_GENERIC implements LinkageType {
@Override @Override
public String method() { public String method() {
return "linkBlockAttributes"; return "link";
} }
@Override @Override
public void generateCode(BuildPlan buildPlan, MethodBuilder methodBuilder, String s, TypeElement typeElement) { public void generateCode(BuildPlan buildPlan, MethodBuilder methodBuilder, String s, TypeElement typeElement) {
buildPlan.addImport("de.steamwar.bausystem.features.attributescopy.*"); buildPlan.addImport("de.steamwar.bausystem.features.world.BauScoreboard");
methodBuilder.addLine("AttributesCopyCommand.add(" + s + ");"); methodBuilder.addLine("BauScoreboard.ELEMENTS.add(" + s + ");");
} }
} }

Datei anzeigen

@ -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 SpecialCommand_GENERIC implements LinkageType {
@Override
public String method() {
return "linkScriptCommands";
}
@Override
public void generateCode(BuildPlan buildPlan, MethodBuilder methodBuilder, String s, TypeElement typeElement) {
buildPlan.addImport("de.steamwar.bausystem.features.script.ScriptExecutor");
methodBuilder.addLine("ScriptExecutor.SPECIAL_COMMANDS.add(" + s + ");");
}
}

Datei anzeigen

@ -64,4 +64,6 @@ dependencies {
annotationProcessor swdep('SpigotCore') annotationProcessor swdep('SpigotCore')
compileOnly swdep('FastAsyncWorldEdit-1.18') compileOnly swdep('FastAsyncWorldEdit-1.18')
implementation 'org.luaj:luaj-jse:3.0.1'
} }

Datei anzeigen

@ -37,12 +37,16 @@ SCOREBOARD_TPS_FROZEN = §e Frozen
SCOREBOARD_TRACE_TICKS = Ticks SCOREBOARD_TRACE_TICKS = Ticks
SCOREBOARD_TECHHIDER = TechHider§8: §aOn
SCOREBOARD_XRAY = XRay§8: §aOn
# Flags # Flags
FLAG_COLOR = Color FLAG_COLOR = Color
FLAG_TNT = TNT FLAG_TNT = TNT
FLAG_FIRE = Fire FLAG_FIRE = Fire
FLAG_FREEZE = Freeze FLAG_FREEZE = Freeze
FLAG_PROTECT = Protect FLAG_PROTECT = Protect
FLAG_ITEMS = Items
FLAG_FIRE_ALLOW = §con FLAG_FIRE_ALLOW = §con
FLAG_FIRE_DENY = §aoff FLAG_FIRE_DENY = §aoff
@ -57,6 +61,9 @@ FLAG_TNT_ALLOW = §aon
FLAG_TNT_DENY = §coff FLAG_TNT_DENY = §coff
FLAG_TNT_ONLY_TB = §7no §ebuild area FLAG_TNT_ONLY_TB = §7no §ebuild area
FLAG_ITEMS_ACTIVE = §aon
FLAG_ITEMS_INACTIVE = §coff
FLAG_COLOR_WHITE = §fWhite FLAG_COLOR_WHITE = §fWhite
FLAG_COLOR_ORANGE = §6Orange FLAG_COLOR_ORANGE = §6Orange
FLAG_COLOR_MAGENTA = §dMagenta FLAG_COLOR_MAGENTA = §dMagenta
@ -137,6 +144,7 @@ BAU_INFO_ITEM_LORE_DAMAGE=
BAU_INFO_ITEM_LORE_FIRE = §7Fire§8: §e{0} BAU_INFO_ITEM_LORE_FIRE = §7Fire§8: §e{0}
BAU_INFO_ITEM_LORE_COLOR = §7Color§8: §e{0} BAU_INFO_ITEM_LORE_COLOR = §7Color§8: §e{0}
BAU_INFO_ITEM_LORE_PROTECT = §7Protect§8: §e{0} BAU_INFO_ITEM_LORE_PROTECT = §7Protect§8: §e{0}
BAU_INFO_ITEM_LORE_ITEMS = §7Items§8: §e{0}
BAU_INFO_COMMAND_HELP = §8/§ebauinfo §8- §7Information regarding this build server BAU_INFO_COMMAND_HELP = §8/§ebauinfo §8- §7Information regarding this build server
BAU_INFO_COMMAND_OWNER = §7Owner: §e{0} BAU_INFO_COMMAND_OWNER = §7Owner: §e{0}
@ -159,6 +167,12 @@ COUNTINGWAND_MESSAGE_LCLICK = §7Second position at: §8[§7{0}§8, §7{1}§8,
COUNTINGWAND_MESSAGE_VOLUME = §e{0} COUNTINGWAND_MESSAGE_VOLUME = §e{0}
COUNTINGWAND_MESSAGE_DIMENSION = §e{0}§8, §e{1}§8, §e{2} COUNTINGWAND_MESSAGE_DIMENSION = §e{0}§8, §e{1}§8, §e{2}
# Design Endstone
DESIGN_ENDSTONE_COMMAND_HELP = §8/§edesign endstone §8- §7Show where Endstone is
DESIGN_ENDSTONE_REGION_ERROR = §cThis region has no build area
DESIGN_ENDSTONE_ENABLE = §aEndstone is activated
DESIGN_ENDSTONE_DISABLE = §cEndstone is deactivated
# Detonator # Detonator
DETONATOR_LOC_REMOVE = §e{0} removed DETONATOR_LOC_REMOVE = §e{0} removed
DETONATOR_LOC_ADD = §e{0} added DETONATOR_LOC_ADD = §e{0} added
@ -216,298 +230,50 @@ GUI_EDITOR_TITLE_MORE=Select item
# Script # Script
## Errors ## Errors
SCRIPT_SLEEP_ERROR = §cInsert a sleep into your script SCRIPT_ERROR_GUI=§cError in parsing script: Line {0}
SCRIPT_COMMAND_ERROR_UNKNOWN_VAR = §cUnknown variable {0} SCRIPT_ERROR_GLOBAL=§cError in global script: Line {0}
SCRIPT_COMMAND_ERROR_EXPRESSION = §cExpression error with: {0} SCRIPT_ERROR_CLICK=§cError in script: Line {0}
SCRIPT_COMMAND_ERROR_FIRST_ARG_NOVAR = §cThe first argument is missing and should be a variable SCRIPT_ERROR_ONLY_IN_GLOBAL=§cThis function is only available in global scripts
SCRIPT_COMMAND_ERROR_FIRST_ARG_NONUMER = §cThe first argument is missing and should be a number
SCRIPT_COMMAND_ERROR_FIRST_ARG_NOVAR_OR_VALUE = §cThe first argument is missing and should be a variable or a number
SCRIPT_COMMAND_ERROR_FIRST_ARG_NOJUMPPOINT = §cThe first argument is missing and should be a jump-point
SCRIPT_COMMAND_ERROR_SECOND_ARG_NOVAR = §cThe second argument is missing and should be a variable
SCRIPT_COMMAND_ERROR_SECOND_ARG_NOVALUE = §cThe econd argument is missing and should be a value
SCRIPT_COMMAND_ERROR_SECOND_ARG_NOJUMPPOINT = §cThe second argument is missing and should be a jump-point
SCRIPT_COMMAND_ERROR_THIRD_ARG_NOVAR = §cThe third argument is missing and should be a variable
SCRIPT_COMMAND_ERROR_THIRD_ARG_NOVALUE = §cThe third argument is missing and should be a value
SCRIPT_COMMAND_ERROR_THIRD_ARG_NOVAR_OR_NUMBER = §cThe third argument is missing and should be a variable or a number
SCRIPT_COMMAND_ERROR_FOURTH_ARG_NOVALUE = §cThe fourth argument is missing and should be a value
SCRIPT_COMMAND_ERROR_BOOLEAN_COMPARE = §cOnly booleans can be compared
SCRIPT_COMMAND_ERROR_NUMBER_COMPARE = §cOnly numbers can be compared
SCRIPT_COMMAND_ERROR_NO_BOOLEAN = §cThe value is not a boolean
SCRIPT_COMMAND_ERROR_ONLY_STRINGS_ALLOWED = §cOnly strings are allowed
SCRIPT_COMMAND_ERROR_ONLY_NUMBERS_ALLOWED = §cOnly numbers are allowed
SCRIPT_COMMAND_ERROR_UNKNOWN_OPERATION = §cUnknown operation: {0}
## Commands
SCRIPT_COMMAND_ARITHMETIC_ADD_ERROR = §cOnly numbers or strings can be added
SCRIPT_COMMAND_ARITHMETIC_DIV_ERROR = §cOnly numbers can be divided
SCRIPT_COMMAND_ARITHMETIC_MUL_ERROR = §cOnly numbers can be multiplied
SCRIPT_COMMAND_ARITHMETIC_SUB_ERROR = §cOnly numbers can be subtracted
SCRIPT_COMMAND_ARITHMETIC_POW_ERROR = §cOnly numbers can be raised to a power
SCRIPT_COMMAND_ARITHMETIC_MOD_ERROR = §cOnly whole numbers can be used for modulo
SCRIPT_COMMAND_ARITHMETIC_BIT_AND_ERROR = §cOnly whole numbers and booleans can be used for and
SCRIPT_COMMAND_ARITHMETIC_BIT_OR_ERROR = §cOnly whole numbers and booleans can be used for or
SCRIPT_COMMAND_ARITHMETIC_BIT_XOR_ERROR = §cOnly whole numbers and booleans can be used for xor
SCRIPT_COMMAND_ARITHMETIC_BIT_LEFT_ERROR = §cOnly whole numbers can be used for left shift value
SCRIPT_COMMAND_ARITHMETIC_BIT_RIGHT_ERROR = §cOnly whole numbers can be used for right shift value
SCRIPT_COMMAND_ARITHMETIC_BIT_RIGHT_LOGIC_ERROR = §cOnly whole numbers can be used for logic right shift value
SCRIPT_COMMAND_ARITHMETIC_OTHER_CEIL_HELP_1 = §eceil §8<§7variable§8> §8<§7variable§8|§7value§8>
SCRIPT_COMMAND_ARITHMETIC_OTHER_CEIL_HELP_2 = §eceil §8<§7variable§8> §8<§7variable§8|§7value§8> §8<§7variable§8|§7value§8>
SCRIPT_COMMAND_ARITHMETIC_OTHER_CEIL_HELP_3 = Ceils the second number and writes it in the first or ceils the second number with the precision from the third number and writes it in the first
SCRIPT_COMMAND_ARITHMETIC_OTHER_CEIL_ERROR_1 = §cOnly floating point numbers can be ceiled
SCRIPT_COMMAND_ARITHMETIC_OTHER_CEIL_ERROR_2 = §cThe precision needs to be a whole number
SCRIPT_COMMAND_ARITHMETIC_OTHER_FLOOR_HELP_1 = §efloor §8<§7variable§8> §8<§7variable§8|§7value§8>
SCRIPT_COMMAND_ARITHMETIC_OTHER_FLOOR_HELP_2 = §efloor §8<§7variable§8> §8<§7variable§8|§7value§8> §8<§7variable§8|§7value§8>
SCRIPT_COMMAND_ARITHMETIC_OTHER_FLOOR_HELP_3 = Floors the second number and writes it in the first or floors the second number with the precision from the third number and writes it in the first
SCRIPT_COMMAND_ARITHMETIC_OTHER_FLOOR_ERROR_1 = §cOnly floating point numbers can be floored
SCRIPT_COMMAND_ARITHMETIC_OTHER_FLOOR_ERROR_2 = §cThe precision needs to be a whole number
SCRIPT_COMMAND_ARITHMETIC_OTHER_ROUND_HELP_1 = §eround §8<§7variable§8> §8<§7variable§8|§7value§8>
SCRIPT_COMMAND_ARITHMETIC_OTHER_ROUND_HELP_2 = §eround §8<§7variable§8> §8<§7variable§8|§7value§8> §8<§7variable§8|§7value§8>
SCRIPT_COMMAND_ARITHMETIC_OTHER_ROUND_HELP_3 = Round the second number and writes it in the first or rounds the second number with the precision from the third number and writes it in the first
SCRIPT_COMMAND_ARITHMETIC_OTHER_ROUND_ERROR_1 = §cOnly floating point numbers can be rounded
SCRIPT_COMMAND_ARITHMETIC_OTHER_ROUND_ERROR_2 = §cThe precision needs to be a whole number
SCRIPT_COMMAND_IO_ECHO_HELP_1 = §eecho §8<§7value§8>
SCRIPT_COMMAND_IO_ECHO_HELP_2 = §7Send a message to the player. If the value is empty, the message will be empty as well
SCRIPT_COMMAND_IO_ECHO_MESSAGE = §f{0}
SCRIPT_COMMAND_IO_ECHOACTIONBAR_HELP_1 = §eechoactionbar §8<§7value§8>
SCRIPT_COMMAND_IO_ECHOACTIONBAR_HELP_2 = §7Send a message to the player to the action bar. If the value is empty, the message will be empty as well
SCRIPT_COMMAND_IO_INPUT_HELP_1 = §einput §8<§7variable§8> §8<§7text§8>
SCRIPT_COMMAND_IO_INPUT_HELP_2 = §7Request an input from the player, which will be written in the variable. The text is optional
SCRIPT_COMMAND_STRING_INSERT_HELP_1 = §einsert §8<§7variable§8> §8<§7variable§8> §8<§7number§8>
SCRIPT_COMMAND_STRING_INSERT_HELP_2 = §einsert §8<§7variable§8> §8<§7variable§8> §8<§7variable§8> §8<§7number§8>
SCRIPT_COMMAND_STRING_INSERT_HELP_3 = Insert something into a String at a given index. The number is the index and the variable is the string. Optionally the result can be written in another or a new variable
SCRIPT_COMMAND_STRING_REMOVE_HELP_1 = §eremove §8<§7variable§8> §8<§7from variable§8>
SCRIPT_COMMAND_STRING_REMOVE_HELP_2 = §eremove §8<§7variable§8> §8<§7variable§8> §8<§7from variable§8>
SCRIPT_COMMAND_STRING_REMOVE_HELP_3 = Removes all occurrences of a string from another string.
SCRIPT_COMMAND_STRING_REPLACE_HELP_1 = §ereplace §8<§7variable§8> §8<§7from variable§8> §8<§7to variable§8>
SCRIPT_COMMAND_STRING_REPLACE_HELP_2 = §ereplace §8<§7variable§8> §8<§7variable§8> §8<§7from variable§8> §8<§7to variable§8>
SCRIPT_COMMAND_STRING_REPLACE_HELP_3 = Replaces all occurrences of a string from another string with a given string
SCRIPT_COMMAND_STRING_SUBSTRING_HELP_1 = §esubstring §8<§7variable§8> §8<§7number§8>
SCRIPT_COMMAND_STRING_SUBSTRING_HELP_2 = §esubstring §8<§7variable§8> §8<§7variable§8> §8<§7number§8>
SCRIPT_COMMAND_STRING_SUBSTRING_HELP_3 = Shortens a string either from the start or the end, depending on whether the given index is positive (start) or negative (end)
SCRIPT_COMMAND_VARIABLE_CONST_HELP_1 = §econst §8<§7variable§8> §8[§7value§8(§7s§8)§8]
SCRIPT_COMMAND_VARIABLE_CONST_HELP_2 = Writes a value in a constant, which can be a number, a boolean or a string
SCRIPT_COMMAND_VARIABLE_CONVERT_HELP_1 = §econvert §8<§7variable§8> §8<§7value§8>
SCRIPT_COMMAND_VARIABLE_CONVERT_HELP_2 = Converts a value to 'number' if it's a number, or to 'boolean' if it's either 'true' or 'false'. Otherwise it remains of type 'text'.
SCRIPT_COMMAND_VARIABLE_GLOBAL_HELP_1 = §eglobal §8<§7variable§8> §8[§7value§8(§7s§8)§8]
SCRIPT_COMMAND_VARIABLE_GLOBAL_HELP_2 = Writes a value in a variable, which can be a number, a boolean or a string
SCRIPT_COMMAND_VARIABLE_UNGLOBAL_HELP_1 = §eunglobal §8<§7variable§8>
SCRIPT_COMMAND_VARIABLE_UNGLOBAL_HELP_2 = Deletes a global variable.
SCRIPT_COMMAND_VARIABLE_UNVAR_HELP_1 = §eunvar §8<§7variable§8>
SCRIPT_COMMAND_VARIABLE_UNVAR_HELP_2 = Deletes a local variable.
SCRIPT_COMMAND_VARIABLE_VAR_HELP_1 = §evar §8<§7variable§8> §8[§7value§8(§7s§8)§8]
SCRIPT_COMMAND_VARIABLE_VAR_HELP_2 = Writes a value in a variable, which can be a number, a boolean or a string
SCRIPT_COMMAND_WORLD_GETMATERIAL_HELP_1 = §egetmaterial §8<§7variable§8> §8<§7number§8> §8<§7number§8> §8<§7number§8>
SCRIPT_COMMAND_WORLD_GETMATERIAL_HELP_2 = Writes the material of a block in the world in the variable
SCRIPT_COMMAND_WORLD_SETMATERIAL_HELP_1 = §esetmaterial §8<§7variable§8> §8<§7number§8> §8<§7number§8> §8<§7number§8>
SCRIPT_COMMAND_WORLD_SETMATERIAL_HELP_2 = Sets a block in the world with the given material, given in the variable
SCRIPT_COMMAND_EXIT_HELP_1 = §eexit
SCRIPT_COMMAND_EXIT_HELP_2 = Exits the script
SCRIPT_COMMAND_IF_HELP_1 = §eif §8<§7true/false§8> §8<§7jump-point§8>
SCRIPT_COMMAND_IF_HELP_2 = §eif §8<§7true/false§8> §8<§7jump-point§8> §8<§7jump-point§8>
SCRIPT_COMMAND_IF_HELP_3 = §7Jump to the first jump-point if the given value is true or the second jump-point otherwise.
SCRIPT_COMMAND_JUMP_HELP_1 = §ejump §8<§7jump-point§8>
SCRIPT_COMMAND_JUMP_HELP_2 = §7Jump to a jump-point. A jump-point is a line with §8'§7.§8'§7 before.
SCRIPT_COMMAND_JUMP_ERROR = §cUnknown jump-point: {0}
SCRIPT_COMMAND_CALL_HELP_1 = §ecall §8<§7jump-point§8>
SCRIPT_COMMAND_CALL_HELP_2 = §7Jump to a jump-point. A jump-point is a line with §8'§7.§8'§7 before. Building a return stack alongside. Use 'return' to jump back.
SCRIPT_COMMAND_CALL_ERROR = §cUnknown jump-point: {0}
SCRIPT_COMMAND_RETURN_HELP_1 = §ereturn
SCRIPT_COMMAND_RETURN_HELP_2 = §7Jump back to the last 'call' command
SCRIPT_COMMAND_RETURN_ERROR = §cNo 'call' command executed before
SCRIPT_COMMAND_SLEEP_HELP_1 = §esleep §8<§7time§8>
SCRIPT_COMMAND_SLEEP_HELP_2 = Pauses the execution by the given number of game ticks.
SCRIPT_COMMAND_SLEEP_ERROR = §cThe given number needs to be greater than zero.
## GUI
SCRIPT_GUI_ITEM_NAME = §eScript Help
## CustomScript ## CustomScript
SCRIPT_HOTKEY_ITEM_NAME = §7Hotkey§8: §e{0} §8-§7 {1} SCRIPT_HOTKEY_ITEM_NAME = §7Hotkey§8: §e{0}
SCRIPT_EVENT_ITEM_NAME = §7Event§8: §e{0} §8-§7 {1} SCRIPT_EVENT_ITEM_NAME = §7Event§8: §e{0}
SCRIPT_COMMAND_ITEM_NAME = §7Command§8: §e{0} SCRIPT_COMMAND_ITEM_NAME = §7Command§8: §e/{0}
## Script Menu GUI ## Script Menu GUI
SCRIPT_MENU_GUI_ITEM_LORE_1 = §7Click to retrieve SCRIPT_MENU_GUI_ITEM_LORE_1 = §7Click to retrieve
SCRIPT_MENU_GUI_ITEM_LORE_2 = §7Shift-Click to copy SCRIPT_MENU_GUI_ITEM_LORE_2 = §7Shift-Click to copy
SCRIPT_MENU_GUI_NAME = §eScript Commands {0}{1}§7% SCRIPT_MENU_GUI_ITEM_LORE_3 = §7Right-Click to edit
SCRIPT_MENU_GUI_ITEM_LORE_4 = §7Middle-Click to preview
SCRIPT_MENU_GUI_NAME = §eScript-Menu
SCRIPT_MENU_GUI_ITEM_ADD_NAME = §eInsert SCRIPT_MENU_GUI_ITEM_ADD_NAME = §eInsert
SCRIPT_MENU_GUI_ITEM_ADD_LORE = §7Click with a book to insert SCRIPT_MENU_GUI_ITEM_ADD_LORE = §7Click with a book to insert
SCRIPT_MENU_GUI_DUPLICATE_COMMAND = §cCommand '{0}' already defined SCRIPT_MENU_GUI_ENTER_NAME = §eEnter a name
SCRIPT_MENU_GUI_UNKNOWN_EVENT = §cEvent '{0}' cannot be defined
SCRIPT_MENU_GUI_LIMIT = §cScript-Book limit reached
## ScriptCommand # Shield Printing
SCRIPT_COMMAND_HELP = §8/§escript §8- §7Opens the ScriptGUI SHIELD_PRINTING_HELP_START = §8/§eshieldprinting start §8- §7Starts the shield printing
SCRIPT_COMMAND_HELP_MENU = §8/§escript menu §8- §7Opens the ScriptGUI for custom commands shares across baus SHIELD_PRINTING_HELP_COPY = §8/§eshieldprinting copy §8- §7Copies the shield configuration
SHIELD_PRINTING_HELP_APPLY = §8/§eshieldprinting apply §8- §7Applies the shield configuration
SHIELD_PRINTING_HELP_STOP = §8/§eshieldprinting stop §8- §7Stops the shield printing
SHIELD_PRINTING_HELP_STEP_1 = §81. §7Paste the schematic you want to use
SHIELD_PRINTING_HELP_STEP_2 = §82. §7Start the shield printing with §8/§eshieldprinting start
SHIELD_PRINTING_HELP_STEP_3 = §83. §7Wait until the shield printing is finished
SHIELD_PRINTING_HELP_STEP_4 = §84. §7Edit the shields if necessary
SHIELD_PRINTING_HELP_STEP_5 = §85. §7Copy the shields printing with §8/§eshieldprinting copy
SHIELD_PRINTING_HELP_STEP_6 = §86. §7Paste the original schematic
SHIELD_PRINTING_HELP_STEP_7 = §87. §7Apply the shield printing with §8/§eshieldprinting apply
## Script GUI SHIELD_PRINTING_NO_REGION = §cYou are not in a region.
SCRIPT_GUI_NAME = Script Elements SHIELD_PRINTING_NOT_RUNNING = §cThe shield printing is not running.
SCRIPT_GUI_COMMAND_CHAT = §eScript Command§8: §e{0} SHIELD_PRINTING_DISALLOWED = §cYou are not allowed to use shield printing here.
SHIELD_PRINTING_BOSSBAR = §fMovements: {0}
SHIELD_PRINTING_BOSSBAR_COPIED = §fMovements: {0} Copied: {1}
SCRIPT_GUI_CUSTOM_HOTKEYS = §eCustom Hotkeys SHIELD_PRINTING_START = §aThe shield printing has been started.
SCRIPT_GUI_CUSTOM_HOTKEYS_COMMANDS_LORE_1 = §7Write§8: §e#!HOTKEY 'Char' SHIELD_PRINTING_COPY = §aThe shield has been copied.
SCRIPT_GUI_CUSTOM_HOTKEYS_COMMANDS_LORE_2 = §7at the beginning of a Script Book to use a custom hotkey. The 'Char' can be any char between '§eA§7' and '§eZ§7' as well as '§e0§7' and '§e9§7'. While executing two variables are available: §epressed§7, §ereleased§7. SHIELD_PRINTING_APPLY = §aThe shield has been applied.
SCRIPT_GUI_CUSTOM_HOTKEYS_COMMANDS_LORE_3 = §7You can add modifiers like "SHIFT", "CTRL", "ALT" or "META" to the hotkey. §7Example: §e#!HOTKEY SHIFT+A SHIELD_PRINTING_STOP = §aThe shield printing has been stopped.
SCRIPT_GUI_CUSTOM_HOTKEYS_COMMANDS_LORE_4 = §7
SCRIPT_GUI_CUSTOM_HOTKEYS_COMMANDS_LORE_5 = §cThis can only be used in conjunction with the Fabric-Mod: §eAdvancedScripts §7found on §ehttps://steamwar.de/downloads
SCRIPT_GUI_CUSTOM_COMMANDS = §eCustom Commands
SCRIPT_GUI_CUSTOM_COMMANDS_LORE_1 = §7Write§8: §e#!CMD 'COMMAND'
SCRIPT_GUI_CUSTOM_COMMANDS_LORE_2 = §7at the beginning of a Script Book to use a custom command. The command always starts with §e/§7 and can be structured as you wish. Everything in pointy Brackets '§e<>§7' will be counted as a Parameter and therefore as a variable. Parameters in round brackets '§e()§7' are optional. Simple texts as parameters get a variable with the same name with the values true/false, depending on whether the value was given or not
SCRIPT_GUI_CUSTOM_EVENTS = §eCustom Events
SCRIPT_GUI_CUSTOM_EVENTS_LORE_1 = §7Write§8: §e#!EVENT 'EventName'
SCRIPT_GUI_CUSTOM_EVENTS_LORE_2 = §7at the beginning of a Script Book to use a custom event. Every event can ve canceled by using 'var cancel true'. After the event name are the variables which are usable in a Script Book.
SCRIPT_GUI_CUSTOM_EVENTS_LORE_3 = §7Usable Events are:
SCRIPT_GUI_CUSTOM_EVENTS_LORE_4 = §eFF
SCRIPT_GUI_CUSTOM_EVENTS_LORE_5 = §ePlaceBlock §8-§7 blockX, blockY, blockZ, blockType
SCRIPT_GUI_CUSTOM_EVENTS_LORE_6 = §eBreakBlock §8-§7 blockX, blockY, blockZ, blockType
SCRIPT_GUI_CUSTOM_EVENTS_LORE_7 = §eRightClick §8-§7 blockInHand, action, handType,
SCRIPT_GUI_CUSTOM_EVENTS_LORE_8 = §7 hasBlock §8[§7blockX, blockY, blockZ, blockFace§8]§e*
SCRIPT_GUI_CUSTOM_EVENTS_LORE_9 = §eLeftClick §8-§7 blockInHand, action, handType,
SCRIPT_GUI_CUSTOM_EVENTS_LORE_10 = §7 hasBlock §8[§7blockX, blockY, blockZ, blockFace§8]§e*
SCRIPT_GUI_CUSTOM_EVENTS_LORE_11 = §eTNTSpawn
SCRIPT_GUI_CUSTOM_EVENTS_LORE_12 = §eTNTExplode §8-§7 x, y, z
SCRIPT_GUI_CUSTOM_EVENTS_LORE_13 = §eTNTExplodeInBuild §8-§7 x, y, z
SCRIPT_GUI_CUSTOM_EVENTS_LORE_14 = §eSelfJoin §8-§7 x, y, z, playerName
SCRIPT_GUI_CUSTOM_EVENTS_LORE_15 = §eSelfLeave §8-§7 x, y, z, playerName
SCRIPT_GUI_CUSTOM_EVENTS_LORE_16 = §eDropItem §8-§7 material, x, y, z
SCRIPT_GUI_CUSTOM_EVENTS_LORE_17 = §eEntityDeath §8-§7 entityType, x, y, z
SCRIPT_GUI_CUSTOM_EVENTS_LORE_18 = §eScoreboard
SCRIPT_GUI_CUSTOM_EVENTS_LORE_STAR_1 = §e* §8-§7 Everything in brackets is only set if the variable before is set on §etrue§7.
SCRIPT_GUI_OTHER = §eOther
SCRIPT_GUI_OTHER_LORE_1 = §7Comments start with §e#§7.
SCRIPT_GUI_OTHER_LORE_2 = §7Jump_Points start with §e.§7.
SCRIPT_GUI_OTHER_LORE_3 = §7A variable name enclosed in '§e{}§7' is replaced by its value. A variable can be prefixed with '§econst.§7' or '§elocal.§7' or '§eglobal.§7'.
SCRIPT_GUI_OTHER_LORE_4 = §7The following applies:
SCRIPT_GUI_OTHER_LORE_5 = §7- Local variables are only available in the script book.
SCRIPT_GUI_OTHER_LORE_6 = §7- Global variables are available in every script book.
SCRIPT_GUI_OTHER_LORE_7 = §7- Constant variables are variables from the server (e.g. player name, TPS, etc.)
SCRIPT_GUI_OTHER_LORE_8 = §7A variable can be appended with '§e.length§7' or '§e.type§7' or '§e.isset§7'.
SCRIPT_GUI_OTHER_LORE_9 = §7The following applies:
SCRIPT_GUI_OTHER_LORE_10 = §7- Length returns the length of the variable as a number.
SCRIPT_GUI_OTHER_LORE_11 = §7- Type returns the type (number, floating_number, text or boolean) as text.
SCRIPT_GUI_OTHER_LORE_12 = §7- Isset returns as a boolean whether the variable exists.
SCRIPT_GUI_OTHER_LORE_13 = §7Mathematical as well as logical operations can be specified in '§e{}§7'.
SCRIPT_GUI_OTHER_LORE_14 = §7The following applies:
SCRIPT_GUI_OTHER_LORE_15 = §7- arithmetic operators: §e+ * - /§7 as well as §e%§7 for modulo
SCRIPT_GUI_OTHER_LORE_16 = §7- Logical operators: §e==§7; §e!=§7; §e<=§7; §e>=§7; §e<§7; §e>§7; §e&&§7; §e||§7 (this is the character for or)
SCRIPT_GUI_OTHER_LORE_17 = §7- Bitwise operators: §e&§7; §e|§7; §e^
SCRIPT_GUI_OTHER_LORE_18 = §7- Shift operators: §e<<§7; §e>>§7; §e>>>§7
SCRIPT_GUI_COMMAND_NAME = §7Command: §e{0}
SCRIPT_GUI_CUSTOM_VARIABLES = §eCustom Variables
SCRIPT_GUI_CONSTANT_TIME_NAME = §7Constant §etime
SCRIPT_GUI_CONSTANT_TIME_LORE = §7Formatted time variable.
SCRIPT_GUI_CONSTANT_TICKS_NAME = §7Constant §eticks
SCRIPT_GUI_CONSTANT_TICKS_LORE = §7Ticks since server start.
SCRIPT_GUI_CONSTANT_TRACE_NAME = §7Constant §etrace
SCRIPT_GUI_CONSTANT_TRACE_LORE = §etrue§7 if the trace is activated.
SCRIPT_GUI_CONSTANT_AUTO_TRACE_NAME = §7Constant §eautotrace
SCRIPT_GUI_CONSTANT_AUTO_TRACE_LORE = §etrue§7 if the auto trace is activated.
SCRIPT_GUI_CONSTANT_TRACE_STATUS_NAME = §7Constant §etrace_status
SCRIPT_GUI_CONSTANT_TRACE_STATUS_LORE = §7One of: §eOFF§8, §eIDLE§8, §eIDLE_AUTO_EXPLODE§8, §eIDLE_AUTO_IGNITE§8, §eIDLE_SINGLE
SCRIPT_GUI_CONSTANT_TRACE_TIME_NAME = §7Constant §etrace_time
SCRIPT_GUI_CONSTANT_TRACE_TIME_LORE = §e0§7 if the trace is not active, otherwise the time in ticks since the trace was started.
SCRIPT_GUI_CONSTANT_LOADER_STATUS_NAME = §7Constant §eloader_status
SCRIPT_GUI_CONSTANT_LOADER_STATUS_LORE = §7One of: §eOFF§8, §eSETUP§8, §eRUNNING§8, §eSINGLE§8, §ePAUSE§8, §eEND
SCRIPT_GUI_CONSTANT_TNT_NAME = §7Constant §etnt
SCRIPT_GUI_CONSTANT_TNT_LORE = §etrue§7 if tnt is not deactivated.
SCRIPT_GUI_CONSTANT_ONLY_TB_NAME = §7Constant §etnt_onlytb
SCRIPT_GUI_CONSTANT_ONLY_TB_LORE = §etrue§7 if tnt no build is activated.
SCRIPT_GUI_CONSTANT_FREEZE_NAME = §7Constant §efreeze
SCRIPT_GUI_CONSTANT_FREEZE_LORE = §etrue§7 if freeze is not deactivated.
SCRIPT_GUI_CONSTANT_FIRE_NAME = §7Constant §efire
SCRIPT_GUI_CONSTANT_FIRE_LORE = §etrue§7 if fire is not deactivated.
SCRIPT_GUI_CONSTANT_PROTECT_NAME = §7Constant §eprotect
SCRIPT_GUI_CONSTANT_PROTECT_LORE = §etrue§7 if protect is activated.
SCRIPT_GUI_CONSTANT_X_NAME = §7Constant §ex
SCRIPT_GUI_CONSTANT_X_LORE = §ex§7 position of the player.
SCRIPT_GUI_CONSTANT_Y_NAME = §7Constant §ey
SCRIPT_GUI_CONSTANT_Y_LORE = §ey§7 position of the player.
SCRIPT_GUI_CONSTANT_Z_NAME = §7Constant §ez
SCRIPT_GUI_CONSTANT_Z_LORE = §ez§7 position of the player.
SCRIPT_GUI_CONSTANT_NAME_NAME = §7Constant §ename
SCRIPT_GUI_CONSTANT_NAME_LORE = §eDisplay§7 name of the player.
SCRIPT_GUI_CONSTANT_SNEAK_NAME = §7Constant §esneaking
SCRIPT_GUI_CONSTANT_SNEAK_LORE = §etrue§7 if the player is sneaking.
SCRIPT_GUI_CONSTANT_SPRINTING_NAME = §7Constant §esprinting
SCRIPT_GUI_CONSTANT_SPRINTING_LORE = §etrue§7 is the player is sprinting.
SCRIPT_GUI_CONSTANT_SLOT_NAME = §7Constant §eslot
SCRIPT_GUI_CONSTANT_SLOT_LORE = §e0-8§7 for the selected slot.
SCRIPT_GUI_CONSTANT_SLOT_MATERIAL_NAME = §7Constant §eslotmaterial
SCRIPT_GUI_CONSTANT_SLOT_MATERIAL_LORE = §eMaterial§7 of the item in the current slot
SCRIPT_GUI_CONSTANT_OFF_HAND_MATERIAL_NAME = §7Constant §eoffhandmaterial
SCRIPT_GUI_CONSTANT_OFF_HAND_MATERIAL_LORE = §eMaterial§7 of the item in the off hand
SCRIPT_GUI_CONSTANT_SLOT_MATERIAL_DISPLAY_NAME = §7Constant §ematerialname
SCRIPT_GUI_CONSTANT_SLOT_MATERIAL_DISPLAY_LORE = §eName§7 of the item in the current slot
SCRIPT_GUI_CONSTANT_OFF_HAND_MATERIAL_DISPLAY_NAME = §7Constant §eoffmaterialname
SCRIPT_GUI_CONSTANT_OFF_HAND_MATERIAL_DISPLAY_LORE = §eName§7 of the item in the off hand
SCRIPT_GUI_CONSTANT_REGION_TYPE_NAME = §7Constant §eregion_type
SCRIPT_GUI_CONSTANT_REGION_TYPE_LORE = §eregion type§7 of the current region
SCRIPT_GUI_CONSTANT_REGION_NAME_NAME = §7Constant §eregion_name
SCRIPT_GUI_CONSTANT_REGION_NAME_LORE = §eregion name§7 of the current region
SCRIPT_GUI_CONSTANT_TPS_NAME = §7Constant §etps
SCRIPT_GUI_CONSTANT_TPS_LORE = §etps§7 of the server
SCRIPT_GUI_CONSTANT_TPS_LIMIT_NAME = §7Constant §etps_limit
SCRIPT_GUI_CONSTANT_TPS_LIMIT_LORE = §etps_limit§7 of the server
# Unsign Book # Unsign Book
UNSIGN_HELP=§8/§eunsign §8- §7Make a signed book writable again UNSIGN_HELP=§8/§eunsign §8- §7Make a signed book writable again
@ -585,7 +351,6 @@ SIMULATOR_GUI_TNT_GROUP_LORE_6 = §7z§8: §e{0}
SIMULATOR_GUI_TNT_DISABLED = §cDisabled SIMULATOR_GUI_TNT_DISABLED = §cDisabled
SIMULATOR_GUI_NAME = Simulator SIMULATOR_GUI_NAME = Simulator
SIMULATOR_GUI_DELETE = §cDelete TNT SIMULATOR_GUI_DELETE = §cDelete TNT
SIMULATOR_GUI_START = §eStart
SIMULATOR_GUI_AUTO_TRACE = §eAutoTrace§8: §7{0} SIMULATOR_GUI_AUTO_TRACE = §eAutoTrace§8: §7{0}
SIMULATOR_GUI_MOVE_ALL = §eMove all SIMULATOR_GUI_MOVE_ALL = §eMove all
@ -651,30 +416,29 @@ INVENTORY_FILL_INFO = §7Helps you fill containers by looking at them while snea
INVENTORY_FILL_ENABLE = §aInventoryFiller activated INVENTORY_FILL_ENABLE = §aInventoryFiller activated
INVENTORY_FILL_DISABLE = §cInventoryFiller deactivated INVENTORY_FILL_DISABLE = §cInventoryFiller deactivated
# Killchecker
KILLCHECKER_HELP_ENABLE = §8/§ekillchecker enable §8- §7Enables Killchecker / Recalculates kills
KILLCHECKER_HELP_DISABLE = §8/§ekillchecker disable §8- §7Disables Killchecker
KILLCHECKER_INFO = §7Shows the overlaps of cannon kills in your build area.
KILLCHECKER_INFO2 = §7Only colorable blocks like Wool, Terractotta, Stained Glass and Concrete are counted.
KILLCHECKER_ENABLE = §aKillchecker activated
KILLCHECKER_DISABLE = §cKillchecker deactivated
KILLCHECKER_BOSSBAR = §e§l{0} §7(§e{1}%§7) §e§l{2}§7 cannons
# BlockCounter # BlockCounter
BLOCK_COUNTER_HELP_TOGGLE = §8/§eblockcounter §8- §7Toggle on/off BLOCK_COUNTER_HELP_TOGGLE = §8/§eblockcounter §8- §7Toggle on/off
BLOCK_COUNTER_HELP_ENABLE = §8/§eblockcounter enable §8- §7Toggles BlockCounter on BLOCK_COUNTER_HELP_ENABLE = §8/§eblockcounter enable §8- §7Toggles BlockCounter on
BLOCK_COUNTER_HELP_DISABLE = §8/§eblockcounter disable §8- §7Toggles BlockCounter off BLOCK_COUNTER_HELP_DISABLE = §8/§eblockcounter disable §8- §7Toggles BlockCounter off
BLOCK_COUNTER_MESSAGE = §7Counter §8> §e{0} §7Blocks §e{1} §7TNT §e{2} §7Blocks/TNT §e{3} §7Blocks/tick BLOCK_COUNTER_MESSAGE = §7Damage §8> §e{0} §7Blocks §e{1} §7TNT §e{2} §7Blocks/TNT §e{3} §7Blocks/tick
BLOCK_COUNTER_MESSAGE_SECOND = §7Counter §8> §e{0} §7Blocks §e{1} §7TNT §e{2} §7Blocks/TNT §e{3} §7Blocks/s BLOCK_COUNTER_MESSAGE_SECOND = §7Damage §8> §e{0} §7Blocks §e{1} §7TNT §e{2} §7Blocks/TNT §e{3} §7Blocks/s
BLOCK_COUNTER_ENABLE = §7BlockCounter activated BLOCK_COUNTER_ENABLE = §7BlockCounter activated
BLOCK_COUNTER_DISABLE = §7BlockCounter deactivated BLOCK_COUNTER_DISABLE = §7BlockCounter deactivated
# DepthCounter # DepthCounter
DEPTH_COUNTER_COMMAND_ENABLE_HELP = §8/§edepthcounter enable §8- §7Activate the depth-counter DEPTH_COUNTER_MESSAGE = §7Depth §8> §7
DEPTH_COUNTER_COMMAND_DISABLE_HELP = §8/§edepthcounter disable §8- §7Deactivate the depth-counter DEPTH_COUNTER_COUNT = {0}{1}§8×{2}{3}§8×{4}{5}
DEPTH_COUNTER_COMMAND_INFO_HELP = §8/§edepthcounter info §8- §7Lists active counting modes DEPTH_COUNTER_HOVER = §7X§8ק7Y§8ק7Z
DEPTH_COUNTER_COMMAND_TOGGLE_HELP = §8/§edepthcounter toggle §8<§7CountMode§8> §8- §7Toggle counting modes DEPTH_COUNTER_TNT = §7 TNT§8: §e{0}
DEPTH_COUNTER_ENABLE_MESSAGE = §7You activated the depth-counter
DEPTH_COUNTER_DISABLE_MESSAGE = §7You deactivated the depth-counter
DEPTH_COUNTER_ACTIVE_MESSAGE = §7Active couting modes: §e{0}§8.
DEPTH_COUNTER_MESSAGE = §7Damage §8> §7{0}
DEPTH_COUNTER_HIGHLIGHT = §e
DEPTH_COUNTER_SEPARATOR = §7 §7
DEPTH_COUNTER_X = X: {0}
DEPTH_COUNTER_Y = Y: {0}
DEPTH_COUNTER_Z = Z: {0}
DEPTH_COUNTER_TNT = §7TNT§8: §e{0}
# TPSLimit # TPSLimit
TICK_STEP_HELP = §8/§etick step §8<§7Ticks§8> §8- §7Step n ticks TICK_STEP_HELP = §8/§etick step §8<§7Ticks§8> §8- §7Step n ticks
@ -701,7 +465,7 @@ TPSLIMIT_INVALID_FROZEN = §c and '0'
# Trace # Trace
TRACE_RECORD=§aon TRACE_RECORD=§aon
TRACE_IDLE=§coff TRACE_HAS_TRACES=§ehas Traces
TRACE_IDLE_SINGLE=§esingle TRACE_IDLE_SINGLE=§esingle
TRACE_IDLE_AUTO_EXPLODE=§eauto §8(§7explode§8) TRACE_IDLE_AUTO_EXPLODE=§eauto §8(§7explode§8)
TRACE_IDLE_AUTO_IGNITE=§eauto §8(§7ignite§8) TRACE_IDLE_AUTO_IGNITE=§eauto §8(§7ignite§8)
@ -717,7 +481,6 @@ TRACE_MESSAGE_ISOLATE = §aTNT-positions isolated
TRACE_MESSAGE_UNISOLATE = §cTNT-positions hidden TRACE_MESSAGE_UNISOLATE = §cTNT-positions hidden
TRACE_MESSAGE_CLICK_ISOLATE = §eClick to §aisolate§8/§cunisolate TRACE_MESSAGE_CLICK_ISOLATE = §eClick to §aisolate§8/§cunisolate
TRACE_MESSAGE_DISALLOWED = §cYou are not allowed to use the TNT-Tracer here TRACE_MESSAGE_DISALLOWED = §cYou are not allowed to use the TNT-Tracer here
TRACE_MESSAGE_NO_REGION = §cYou are not in a region
TRACE_COMMAND_HELP_START = §8/§etrace start §8- §7Starts recording of all TNT-positions TRACE_COMMAND_HELP_START = §8/§etrace start §8- §7Starts recording of all TNT-positions
TRACE_COMMAND_HELP_SINGLE = §8/§etrace single §8- §7Starts a single recording of all TNT-positions TRACE_COMMAND_HELP_SINGLE = §8/§etrace single §8- §7Starts a single recording of all TNT-positions
@ -757,63 +520,87 @@ TRACE_GUI_POSITION_SOURCE = §7Source§8: §e{0}
TRACE_GUI_POSITION_EXPLODED = §7Exploded§8: §e{0} TRACE_GUI_POSITION_EXPLODED = §7Exploded§8: §e{0}
# Loader # Loader
LOADER_OFF = §coff
LOADER_SETUP = §eSetup LOADER_SETUP = §eSetup
LOADER_RUNNING = §aRunning LOADER_RUNNING = §aRunning
LOADER_SINGLE_SIDEBAR = §aSingle
LOADER_PAUSE = §7Pause LOADER_PAUSE = §7Pause
LOADER_END = §8Finished LOADER_END = §8Finished
LOADER_MESSAGE_CLEAR = §7Loader cleared LOADER_MESSAGE_INTERACT=§e{0} added {1}
LOADER_MESSAGE_CLEAR_HELP = §cYou have to be in Setup-Mode to clear the Loader LOADER_BUTTON_TNT=TNT
LOADER_MESSAGE_TNT = §eTNT added {0}
LOADER_MESSAGE_INTERACT = §e{0} added {1}
LOADER_BUTTON_SWITCH=Lever LOADER_BUTTON_SWITCH=Lever
LOADER_BUTTON_WOOD_BUTTON=Button LOADER_BUTTON_WOOD_BUTTON=Wooden Button
LOADER_BUTTON_STONE_BUTTON=Button LOADER_BUTTON_STONE_BUTTON=Stone Button
LOADER_BUTTON_PRESSURE_PLATE=Pressure plate LOADER_BUTTON_PRESSURE_PLATE=Pressure plate
LOADER_BUTTON_WEIGHTED_PRESSURE_PLATE=Pressure plate LOADER_BUTTON_WEIGHTED_PRESSURE_PLATE=Pressure plate
LOADER_BUTTON_TRIPWIRE=Tripwire LOADER_BUTTON_TRIPWIRE=Tripwire
LOADER_BUTTON_NOTEBLOCK=Noteblock LOADER_BUTTON_NOTEBLOCK=Noteblock
LOADER_BUTTON_DAYLIGHTSENSOR=Daylightsensor LOADER_BUTTON_DAYLIGHT_DETECTOR=Daylight Detector
LOADER_BUTTON_INVALID=Invalid 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- §7Starts recording actions LOADER_HELP_SETUP=§8/§eloader setup §8- §7Starts recording actions
LOADER_HELP_UNDO=§8/§7loader undo §8- §7Removes last recorded action LOADER_SETUP_STOP_FIRST=§cPlease stop the current loader first!
LOADER_HELP_START=§8/§eloader start §8- §7Playback of previously recorded action LOADER_HELP_START=§8/§eloader start §8- §7Playback of previously recorded action
LOADER_HELP_WAIT=§8/§7loader wait §8[§7Ticks§8] - §7Sets wait time between shots
LOADER_HELP_SPEED=§8/§7loader speed §8[§7Ticks§8] - §7Sets wait time between actions
LOADER_HELP_PAUSE=§8/§7loader pause §8- §7Pauses Loader LOADER_HELP_PAUSE=§8/§7loader pause §8- §7Pauses Loader
LOADER_HELP_RESUME=§8/§7loader resume §8- §7Resumes Loader LOADER_HELP_GUI=§8/§7loader gui §8- §7Shows Loader gui
LOADER_HELP_STOP=§8/§eloader stop §8- §7Stops recording/playback LOADER_HELP_STOP=§8/§eloader stop §8- §7Stops recording/playback
LOADER_HELP_CLEAR=§8/§eloader clear §8- §7Clears recording
LOADER_HELP_SINGLE=§8/§eloader single §8- §7Starts a single shot
LOADER_HELP_OTHER=§7The loader works with §eIngame§8-§eTicks §7(20 ticks per Second)
LOADER_NO_LOADER=§cYou have no Laoder. Create one with /loader setup LOADER_NO_LOADER=§cYou have no Laoder. Create one with /loader setup
LOADER_BACK_SETUP=§7DYour Loader is in Setup again
LOADER_NEW=§7Load your cannon and fire it once, to initialise the loader. LOADER_NEW=§7Load your cannon and fire it once, to initialise the loader.
LOADER_HOW_TO_START=§7Then, execute /§eloader start§7 to start the Loader LOADER_HOW_TO_START=§7Then, execute /§eloader start§7 to start the Loader
LOADER_ACTIVE=§7The Loader is now active. LOADER_ACTIVE=§7The Loader is now active.
LOADER_STOP=§7The Loader has been stopped. LOADER_STOP=§7The Loader has been stopped.
LOADER_PAUSED=§7The Loader is now paused. LOADER_PAUSED=§7The Loader is now paused.
LOADER_RESUME=§7The Loader is resuming.
LOADER_SINGLE=§7The Loader is shooting once.
LOADER_SMALL_TIME=§cThe wait time is too small
LOADER_NEW_TIME=§7The wait time is now: {0}, before {1}
LOADER_NEW_LOAD_TIME=§7The action wait time is now: {0}, before {1}
LOADER_UNDO=§7Undo succesful.
LOADER_PERMS=§cYou are not allowed to use the Loader here LOADER_PERMS=§cYou are not allowed to use the Loader here
LOADER_GUI_NAME=§eLoader
LOADER_GUI_NEW=§eNew Loader LOADER_NOTHING_RECORDED=§cYou have not recorded anything yet!
LOADER_GUI_START=§eStart Loader LOADER_GUI_TITLE=Loader GUI
LOADER_GUI_PAUSE=§7pause Loader LOADER_GUI_SHOW_INTERACTIONS=§eShow only Interactions
LOADER_GUI_UNDO=§7Undo last action LOADER_GUI_SHOW_WAITS=§eShow only Waits
LOADER_GUI_WAIT=§7Shot delay LOADER_GUI_SHOW_WAITS_SET_BETWEEN_TNT=§7Wait Time between TNT
LOADER_GUI_WAIT_LORE=§7Currently: §e{0} LOADER_GUI_SHOW_WAITS_SET_ALL=§7Wait Time all
LOADER_GUI_WAIT_TITLE=§7Shot delay LOADER_GUI_SHOW_WAITS_TITLE=§7Wait Time
LOADER_GUI_SPEED=§eSpeed LOADER_GUI_SETTINGS_TITLE=Settings
LOADER_GUI_SPEED_LORE=§7Currently: §e{0} LOADER_GUI_SETTINGS_BACK=§8Back
LOADER_GUI_SPEED_TITLE=§7Block placing speed LOADER_GUI_SETTINGS_DELETE=§cDelete
LOADER_GUI_STOP=§eStop Loader LOADER_GUI_WAIT_TITLE=Settings
LOADER_GUI_WAIT_BACK=§8Back
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_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
# Loadtimer # Loadtimer
LOADTIMER_HELP_OVERVIEW=§7Compete with your friends loading your cannon and get information about the cannon LOADTIMER_HELP_OVERVIEW=§7Compete with your friends loading your cannon and get information about the cannon
LOADTIMER_HELP_START_1=§8/§eloadtimer start §8-§7 Starts the simple Loadtimer LOADTIMER_HELP_START_1=§8/§eloadtimer start §8-§7 Starts the simple Loadtimer
@ -911,6 +698,8 @@ SKULL_GUI_ITEM_NAME = §ePlayer Heads
ANVIL_INV_NAME=Player name ANVIL_INV_NAME=Player name
# StructureVoid # StructureVoid
STRUCTURE_VOID_COMMAND_HELP=§8/§estructureVoid §8-§7 Receive a StructureVoid STRUCTURE_VOID_COMMAND_HELP=§8/§estructureVoid §8-§7 Receive a StructureVoid
# Dragon Egg
DRAGON_EGG_COMMAND_HELP=§8/§edragonegg §8-§7 Receive a Dragon Egg
# NightVision # NightVision
NIGHT_VISION_HELP=§8/§enightvision §8-§7 Toggel nightvision. NIGHT_VISION_HELP=§8/§enightvision §8-§7 Toggel nightvision.
NIGHT_VISION_OFF=§eNightvision deactivated NIGHT_VISION_OFF=§eNightvision deactivated
@ -997,6 +786,11 @@ REGION_FREEZE_HELP=§8/§efreeze §8- §7Toggle Freeze
REGION_FREEZE_NO_PERMS=§cYou are not allowed to freeze this world REGION_FREEZE_NO_PERMS=§cYou are not allowed to freeze this world
REGION_FREEZE_ENABLED=§cRegion frozen REGION_FREEZE_ENABLED=§cRegion frozen
REGION_FREEZE_DISABLED=§aRegion thawed REGION_FREEZE_DISABLED=§aRegion thawed
REGION_ITEMS_HELP=§8/§eitems §8- §7Toggle Items
REGION_ITEMS_NO_PERMS=§cYou are not allowed to toggle items in this world
REGION_ITEMS_ENABLED=§aItems enabled in this region
REGION_ITEMS_DISABLED_GLOBAL=§cItems disabled in this world
REGION_ITEMS_DISABLED=§cItems disabled in this region
REGION_PROTECT_HELP=§8/§eprotect §8- §7Protect the region REGION_PROTECT_HELP=§8/§eprotect §8- §7Protect the region
REGION_PROTECT_DISABLE=§cProtection disabled REGION_PROTECT_DISABLE=§cProtection disabled
REGION_PROTECT_ENABLE=§aProtection enabled REGION_PROTECT_ENABLE=§aProtection enabled

Datei anzeigen

@ -37,12 +37,16 @@ SCOREBOARD_TPS_FROZEN = §e Eingefroren
SCOREBOARD_TRACE_TICKS = Ticks SCOREBOARD_TRACE_TICKS = Ticks
SCOREBOARD_TECHHIDER = TechHider§8: §aAn
SCOREBOARD_XRAY = XRay§8: §aAn
# Flags # Flags
FLAG_COLOR = Color FLAG_COLOR = Color
FLAG_TNT = TNT FLAG_TNT = TNT
FLAG_FIRE = Fire FLAG_FIRE = Fire
FLAG_FREEZE = Freeze FLAG_FREEZE = Freeze
FLAG_PROTECT = Protect FLAG_PROTECT = Protect
FLAG_ITEMS = Items
FLAG_FIRE_ALLOW = §can FLAG_FIRE_ALLOW = §can
FLAG_FIRE_DENY = §aaus FLAG_FIRE_DENY = §aaus
@ -57,6 +61,9 @@ FLAG_TNT_ALLOW = §aan
FLAG_TNT_DENY = §caus FLAG_TNT_DENY = §caus
FLAG_TNT_ONLY_TB = §7Kein §eBaurahmen FLAG_TNT_ONLY_TB = §7Kein §eBaurahmen
FLAG_ITEMS_ACTIVE = §aan
FLAG_ITEMS_INACTIVE = §caus
FLAG_COLOR_WHITE = §fWeiß FLAG_COLOR_WHITE = §fWeiß
FLAG_COLOR_ORANGE = §6Orange FLAG_COLOR_ORANGE = §6Orange
FLAG_COLOR_MAGENTA = §dMagenta FLAG_COLOR_MAGENTA = §dMagenta
@ -157,6 +164,12 @@ COUNTINGWAND_MESSAGE_LCLICK = §7Zweite Position bei: §8[§7{0}§8, §7{1}§8,
COUNTINGWAND_MESSAGE_VOLUME = §e{0} COUNTINGWAND_MESSAGE_VOLUME = §e{0}
COUNTINGWAND_MESSAGE_DIMENSION = §e{0}§8, §e{1}§8, §e{2} COUNTINGWAND_MESSAGE_DIMENSION = §e{0}§8, §e{1}§8, §e{2}
# Design Endstone
DESIGN_ENDSTONE_COMMAND_HELP = §8/§edesign endstone §8- §7Zeige wo Endstone ist
DESIGN_ENDSTONE_REGION_ERROR = §cDiese Region hat keinen Baubereich
DESIGN_ENDSTONE_ENABLE = §aEndstone ist aktiviert
DESIGN_ENDSTONE_DISABLE = §cEndstone ist deaktiviert
# Detonator # Detonator
DETONATOR_LOC_REMOVE = §e{0} entfernt DETONATOR_LOC_REMOVE = §e{0} entfernt
DETONATOR_LOC_ADD = §e{0} hinzugefügt DETONATOR_LOC_ADD = §e{0} hinzugefügt
@ -213,294 +226,44 @@ GUI_EDITOR_ITEM_CLOSE=§eSchließen
GUI_EDITOR_TITLE_MORE=Item auswählen GUI_EDITOR_TITLE_MORE=Item auswählen
# Script # Script
## Errors
SCRIPT_SLEEP_ERROR = §cFüge ein sleep in dein Script ein
SCRIPT_COMMAND_ERROR_UNKNOWN_VAR = §cUnbekannte Variable {0}
SCRIPT_COMMAND_ERROR_EXPRESSION = §cExpression fehler in: {0}
SCRIPT_COMMAND_ERROR_FIRST_ARG_NOVAR = §cDas erste Argument fehlt und sollte eine Variable sein
SCRIPT_COMMAND_ERROR_FIRST_ARG_NONUMER = §cDas erste Argument fehlt und sollte eine Zahl sein
SCRIPT_COMMAND_ERROR_FIRST_ARG_NOVAR_OR_VALUE = §cDas erste Argument fehlt und sollte eine Variable oder ein Wert sein
SCRIPT_COMMAND_ERROR_FIRST_ARG_NOJUMPPOINT = §cDas erste Argument fehlt und sollte ein Jump-Point sein
SCRIPT_COMMAND_ERROR_SECOND_ARG_NOVAR = §cDas zweite Argument fehlt und sollte eine Variable sein
SCRIPT_COMMAND_ERROR_SECOND_ARG_NOVALUE = §cDas zweite Argument fehlt und sollte ein Wert sein
SCRIPT_COMMAND_ERROR_SECOND_ARG_NOJUMPPOINT = §cDas dritte Argument fehlt und sollte ein Jump-Point sein
SCRIPT_COMMAND_ERROR_THIRD_ARG_NOVAR = §cDas dritte Argument fehlt und sollte eine Variable sein
SCRIPT_COMMAND_ERROR_THIRD_ARG_NOVALUE = §cDas dritte Argument fehlt und sollte ein Wert sein
SCRIPT_COMMAND_ERROR_THIRD_ARG_NOVAR_OR_NUMBER = §cDas dritte Argument fehlt und sollte eine Variable/Zahl sein
SCRIPT_COMMAND_ERROR_FOURTH_ARG_NOVALUE = §cDas vierte Argument fehlt und sollte ein Wert sein
SCRIPT_COMMAND_ERROR_BOOLEAN_COMPARE = §cNur Booleans können verglichen werden
SCRIPT_COMMAND_ERROR_NUMBER_COMPARE = §cNur Zahlen können verglichen werden
SCRIPT_COMMAND_ERROR_ONLY_STRINGS_ALLOWED = §cNur Strings können verwendet werden
SCRIPT_COMMAND_ERROR_ONLY_NUMBERS_ALLOWED = §cNur Zahlen können verwendet werden
SCRIPT_COMMAND_ERROR_UNKNOWN_OPERATION = §cUnbekannte Operation: {0}
## Commands
SCRIPT_COMMAND_ARITHMETIC_ADD_ERROR = §cNur Zahlen können addiert werden
SCRIPT_COMMAND_ARITHMETIC_DIV_ERROR = §cNur Zahlen können dividiert werden
SCRIPT_COMMAND_ARITHMETIC_MUL_ERROR = §cNur Zahlen können multipliziert werden
SCRIPT_COMMAND_ARITHMETIC_SUB_ERROR = §cNur Zahlen können subtrahiert werden
SCRIPT_COMMAND_ARITHMETIC_POW_ERROR = §cNur Zahlen können potenziert werden
SCRIPT_COMMAND_ARITHMETIC_MOD_ERROR = §cNur ganze Zahlen können für modulo verwendet werden
SCRIPT_COMMAND_ARITHMETIC_BIT_AND_ERROR = §cNur ganze Zahlen und booleans können für und verwendet werden
SCRIPT_COMMAND_ARITHMETIC_BIT_OR_ERROR = §cNur ganze Zahlen und booleans können für oder verwendet werden
SCRIPT_COMMAND_ARITHMETIC_BIT_XOR_ERROR = §cNur ganze Zahlen und booleans können für xor verwendet werden
SCRIPT_COMMAND_ARITHMETIC_OTHER_CEIL_HELP_1 = §eceil §8<§7Variable§8> §8<§7Variable§8|§7Wert§8>
SCRIPT_COMMAND_ARITHMETIC_OTHER_CEIL_HELP_2 = §eceil §8<§7Variable§8> §8<§7Variable§8|§7Wert§8> §8<§7Variable§8|§7Wert§8>
SCRIPT_COMMAND_ARITHMETIC_OTHER_CEIL_HELP_3 = Aufrunden der zweiten Zahl und schreibt es in die erste oder aufrunden der zweiten Zahl auf die Nachkommastellenanzahl aus der dritten Zahl und schreibt es in die erste.
SCRIPT_COMMAND_ARITHMETIC_OTHER_CEIL_ERROR_1 = §cNur Fließ-Komma-Zahlen können aufgerundet werden
SCRIPT_COMMAND_ARITHMETIC_OTHER_CEIL_ERROR_2 = §cEs kann nur auf ganze Nachkommastellen gerundet werden
SCRIPT_COMMAND_ARITHMETIC_OTHER_FLOOR_HELP_1 = §efloor §8<§7Variable§8> §8<§7Variable§8|§7Wert§8>
SCRIPT_COMMAND_ARITHMETIC_OTHER_FLOOR_HELP_2 = §efloor §8<§7Variable§8> §8<§7Variable§8|§7Wert§8> §8<§7Variable§8|§7Wert§8>
SCRIPT_COMMAND_ARITHMETIC_OTHER_FLOOR_HELP_3 = Abrunden der zweiten Zahl und schreibt es in die erste oder abrunden der zweiten Zahl auf die Nachkommastellenanzahl aus der dritten Zahl und schreibt es in die erste.
SCRIPT_COMMAND_ARITHMETIC_OTHER_FLOOR_ERROR_1 = §cNur Fließ-Komma-Zahlen können abgerundet werden
SCRIPT_COMMAND_ARITHMETIC_OTHER_FLOOR_ERROR_2 = §cEs kann nur auf ganze Nachkommastellen gerundet werden
SCRIPT_COMMAND_ARITHMETIC_OTHER_ROUND_HELP_1 = §eround §8<§7Variable§8> §8<§7Variable§8|§7Wert§8>
SCRIPT_COMMAND_ARITHMETIC_OTHER_ROUND_HELP_2 = §eround §8<§7Variable§8> §8<§7Variable§8|§7Wert§8> §8<§7Variable§8|§7Wert§8>
SCRIPT_COMMAND_ARITHMETIC_OTHER_ROUND_HELP_3 = Runden der zweiten Zahl und schreibt es in die erste oder runden der zweiten Zahl auf die Nachkommastellenanzahl aus der dritten Zahl und schreibt es in die erste.
SCRIPT_COMMAND_ARITHMETIC_OTHER_ROUND_ERROR_1 = §cNur Fließ-Komma-Zahlen können gerundet werden
SCRIPT_COMMAND_ARITHMETIC_OTHER_ROUND_ERROR_2 = §cEs kann nur auf ganze Nachkommastellen gerundet werden
SCRIPT_COMMAND_IO_ECHO_HELP_1 = §eecho §8<§7Wert§8>
SCRIPT_COMMAND_IO_ECHO_HELP_2 = §7Schreibe etwas dem Spieler. Wenn kein Wert angegeben wurde ist die Nachricht leer.
SCRIPT_COMMAND_IO_ECHO_MESSAGE = §f{0}
SCRIPT_COMMAND_IO_ECHOACTIONBAR_HELP_1 = §eechoactionbar §8<§7Wert§8>
SCRIPT_COMMAND_IO_ECHOACTIONBAR_HELP_2 = §7Schreibe etwas dem Spieler in der ActionBar. Wenn kein Wert angegeben wurde ist die Nachricht leer.
SCRIPT_COMMAND_IO_INPUT_HELP_1 = §einput §8<§7Variable§8> §8<§7Text§8>
SCRIPT_COMMAND_IO_INPUT_HELP_2 = §7Fordere eine Eingabe von dem Spieler, welche in die Variable geschrieben wird. Der Text ist optional.
SCRIPT_COMMAND_STRING_INSERT_HELP_1 = §einsert §8<§7Variable§8> §8<§7Variable§8> §8<§7Zahl§8>
SCRIPT_COMMAND_STRING_INSERT_HELP_2 = §einsert §8<§7Variable§8> §8<§7Variable§8> §8<§7Variable§8> §8<§7Zahl§8>
SCRIPT_COMMAND_STRING_INSERT_HELP_3 = Füge etwas in einen String an einer Stelle ein. Die Zahl ist für die Position und die Variable davor für was. Schreibe optional dies in eine neue oder andere Variable.
SCRIPT_COMMAND_STRING_REMOVE_HELP_1 = §eremove §8<§7Variable§8> §8<§7Von Variable§8>
SCRIPT_COMMAND_STRING_REMOVE_HELP_2 = §eremove §8<§7Variable§8> §8<§7Variable§8> §8<§7Von Variable§8>
SCRIPT_COMMAND_STRING_REMOVE_HELP_3 = Lösche eine Zeichenkette aus dem Ursprung. Dies ersetzt nicht nur die erste Stelle sondern alle.
SCRIPT_COMMAND_STRING_REPLACE_HELP_1 = §ereplace §8<§7Variable§8> §8<§7Von Variable§8> §8<§7Zu Variable§8>
SCRIPT_COMMAND_STRING_REPLACE_HELP_2 = §ereplace §8<§7Variable§8> §8<§7Variable§8> §8<§7Von Variable§8> §8<§7Zu Variable§8>
SCRIPT_COMMAND_STRING_REPLACE_HELP_3 = Ersetzte eine Zeichenkette aus dem Ursprung mit einer neuen Zeichenkette. Dies ersetzt nicht nur die erste Stelle sondern alle.
SCRIPT_COMMAND_STRING_SUBSTRING_HELP_1 = §esubstring §8<§7Variable§8> §8<§7Zahl§8>
SCRIPT_COMMAND_STRING_SUBSTRING_HELP_2 = §esubstring §8<§7Variable§8> §8<§7Variable§8> §8<§7Zahl§8>
SCRIPT_COMMAND_STRING_SUBSTRING_HELP_3 = Kürze einen String entweder vorne oder hinter, je nachdem ob die Zahl positiv (vorne) oder negativ (hinten) ist.
SCRIPT_COMMAND_VARIABLE_CONST_HELP_1 = §econst §8<§7Variable§8> §8[§7Value§8(§7s§8)§8]
SCRIPT_COMMAND_VARIABLE_CONST_HELP_2 = Schreibt in eine Konstante einen Wert rein, welcher eine Zahl sein kann, ein Boolscher Wert oder ein Text.
SCRIPT_COMMAND_VARIABLE_CONVERT_HELP_1 = §econvert §8<§7Variable§8> §8<§7Value§8>
SCRIPT_COMMAND_VARIABLE_CONVERT_HELP_2 = Konvertiere den Value zu 'number' wenn es eine Zahl ist, oder zu 'boolean' bei 'true' oder 'false' und behalte 'text' bei wenn nichts zutrifft.
SCRIPT_COMMAND_VARIABLE_GLOBAL_HELP_1 = §eglobal §8<§7Variable§8> §8[§7Value§8(§7s§8)§8]
SCRIPT_COMMAND_VARIABLE_GLOBAL_HELP_2 = Schreibt in eine Variable einen Wert rein, welcher eine Zahl sein kann, ein Boolscher Wert oder ein Text.
SCRIPT_COMMAND_VARIABLE_UNGLOBAL_HELP_1 = §eunglobal §8<§7Variable§8>
SCRIPT_COMMAND_VARIABLE_UNGLOBAL_HELP_2 = Lösche eine Globale variable.
SCRIPT_COMMAND_VARIABLE_UNVAR_HELP_1 = §eunvar §8<§7Variable§8>
SCRIPT_COMMAND_VARIABLE_UNVAR_HELP_2 = Lösche eine Locale variable.
SCRIPT_COMMAND_VARIABLE_VAR_HELP_1 = §evar §8<§7Variable§8> §8[§7Value§8(§7s§8)§8]
SCRIPT_COMMAND_VARIABLE_VAR_HELP_2 = Schreibt in eine Variable einen Wert rein, welcher eine Zahl sein kann, ein Boolscher Wert oder ein Text.
SCRIPT_COMMAND_WORLD_GETMATERIAL_HELP_1 = §egetmaterial §8<§7Variable§8> §8<§7Zahl§8> §8<§7Zahl§8> §8<§7Zahl§8>
SCRIPT_COMMAND_WORLD_GETMATERIAL_HELP_2 = Schreibt das material von einem Block in der Welt in die Variable.
SCRIPT_COMMAND_WORLD_SETMATERIAL_HELP_1 = §esetmaterial §8<§7Variable§8> §8<§7Zahl§8> §8<§7Zahl§8> §8<§7Zahl§8>
SCRIPT_COMMAND_WORLD_SETMATERIAL_HELP_2 = Setzt an einem Block in der Welt das Material der ersten Variable.
SCRIPT_COMMAND_EXIT_HELP_1 = §eexit
SCRIPT_COMMAND_EXIT_HELP_2 = Beendet das ausführen des Scripts.
SCRIPT_COMMAND_IF_HELP_1 = §eif §8<§7true/false§8> §8<§7jump-point§8>
SCRIPT_COMMAND_IF_HELP_2 = §eif §8<§7true/false§8> §8<§7jump-point§8> §8<§7jump-point§8>
SCRIPT_COMMAND_IF_HELP_3 = §7Springe zu ersten Stelle, wenn der Wert true ist. Oder zu dem zweiten, wenn dies nicht der fall ist.
SCRIPT_COMMAND_JUMP_HELP_1 = §ejump §8<§7Jump-Point§8>
SCRIPT_COMMAND_JUMP_HELP_2 = §7Springe zu einer anderen Zeile. Hierbei ist ein Jump-Point eine Zeile mit §8'§7.§8'§7 vor.
SCRIPT_COMMAND_JUMP_ERROR = §cDer Jump-Point ({0}) ist nicht definiert.
SCRIPT_COMMAND_CALL_HELP_1 = §ecall §8<§7Jump-Point§8>
SCRIPT_COMMAND_CALL_HELP_2 = §7Springe zu einer anderen Zeile. Hierbei ist ein Jump-Point eine Zeile mit §8'§7.§8'§7 vor. Hierbei wird auf den ReturnStack die jetzige Zeile geschrieben, dahin kann man wieder mit 'return' zurück springen.
SCRIPT_COMMAND_CALL_ERROR = §cDer Jump-Point ({0}) ist nicht definiert.
SCRIPT_COMMAND_RETURN_HELP_1 = §ereturn
SCRIPT_COMMAND_RETURN_HELP_2 = §7Springe zum letzten 'call' Befehl.
SCRIPT_COMMAND_RETURN_ERROR = §cEs wurde kein 'call' Befehl ausgeführt
SCRIPT_COMMAND_SLEEP_HELP_1 = §esleep §8<§7Time§8>
SCRIPT_COMMAND_SLEEP_HELP_2 = Pausiert das Ausführen des Scripts. Das erste Argument ist in GameTicks.
SCRIPT_COMMAND_SLEEP_ERROR = §cDie Zeit muss eine Zahl großer 0 sein.
## GUI
SCRIPT_GUI_ITEM_NAME = §eScript Hilfe
## CustomScript ## CustomScript
SCRIPT_HOTKEY_ITEM_NAME = §7Hotkey§8: §e{0} §8-§7 {1} SCRIPT_HOTKEY_ITEM_NAME = §7Hotkey§8: §e{0}
SCRIPT_EVENT_ITEM_NAME = §7Event§8: §e{0} §8-§7 {1} SCRIPT_EVENT_ITEM_NAME = §7Event§8: §e{0}
SCRIPT_COMMAND_ITEM_NAME = §7Command§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
SCRIPT_MENU_GUI_ITEM_LORE_1 = §7Klicke zum rausnehmen SCRIPT_MENU_GUI_ITEM_LORE_1 = §7Klicke zum rausnehmen
SCRIPT_MENU_GUI_ITEM_LORE_2 = §7Shift Klicke zum kopieren SCRIPT_MENU_GUI_ITEM_LORE_2 = §7Shiftklick zum kopieren
SCRIPT_MENU_GUI_NAME = §eScript Commands {0}{1}§7% 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_NAME = §eHinzufügen
SCRIPT_MENU_GUI_ITEM_ADD_LORE = §7Klicke mit einem Buch zum hinzufügen SCRIPT_MENU_GUI_ITEM_ADD_LORE = §7Klicke mit einem Buch zum hinzufügen
SCRIPT_MENU_GUI_DUPLICATE_COMMAND = §cCommand '{0}' bereits definiert # Shield Printing
SCRIPT_MENU_GUI_UNKNOWN_EVENT = §cEvent '{0}' ist nicht definierbar SHIELD_PRINTING_HELP_START = §8/§eshieldprinting start §8- §7Starte das Schild drucken
SCRIPT_MENU_GUI_LIMIT = §cScript-Buch Limit erreicht 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
## ScriptCommand SHIELD_PRINTING_NO_REGION = §cDu bist in keiner Region.
SCRIPT_COMMAND_HELP = §8/§escript §8- §7Öffnet die ScriptGUI SHIELD_PRINTING_NOT_RUNNING = §cShield printing ist nicht aktiv.
SCRIPT_COMMAND_HELP_MENU = §8/§escript menu §8- §7Öffnet die ScriptMenuGUI für Custom Command bauübergreifend SHIELD_PRINTING_DISALLOWED = §cDu darfst Shield printing nicht benutzen.
SHIELD_PRINTING_BOSSBAR = §fBewegungen: {0}
SHIELD_PRINTING_BOSSBAR_COPIED = §fBewegungen: {0} Kopiert: {1}
## Script GUI SHIELD_PRINTING_START = §aShield printing wurde gestartet.
SCRIPT_GUI_NAME = Script Elements SHIELD_PRINTING_COPY = §aSchilde wurden kopiert.
SCRIPT_GUI_COMMAND_CHAT = §eScript Command§8: §e{0} SHIELD_PRINTING_APPLY = §aSchilde wurden angewendet.
SHIELD_PRINTING_STOP = §aShield printing wurde gestoppt.
SCRIPT_GUI_CUSTOM_HOTKEYS = §eCustom Hotkeys
SCRIPT_GUI_CUSTOM_HOTKEYS_COMMANDS_LORE_1 = §7Schreibe§8: §e#!HOTKEY 'Char'
SCRIPT_GUI_CUSTOM_HOTKEYS_COMMANDS_LORE_2 = §7am Anfang eines Skript Buches, um einen benutzerdefinierten Hotkey zu verwenden. Das 'Char' kann ein beliebiges Zeichen zwischen '§eA§7' und '§eZ§7' sowie '§e0§7' und '§e9§7' sein. Während der Ausführung sind zwei Variablen verfügbar: §epressed§7, §ereleased§7
SCRIPT_GUI_CUSTOM_HOTKEYS_COMMANDS_LORE_3 = §7Sie können dem Hotkey Modifikatoren wie "SHIFT", "CTRL", "ALT" oder "META" hinzufügen. §7Beispiel: §e#!HOTKEY SHIFT+A
SCRIPT_GUI_CUSTOM_HOTKEYS_COMMANDS_LORE_4 = §7
SCRIPT_GUI_CUSTOM_HOTKEYS_COMMANDS_LORE_5 = §cDies kann nur in Verbindung mit den Fabric-Mod: §eAdvancedScripts §7runterladbar unter §ehttps://steamwar.de/downloads §cverwendet werden.
SCRIPT_GUI_CUSTOM_COMMANDS = §eCustom Commands
SCRIPT_GUI_CUSTOM_COMMANDS_LORE_1 = §7Schreibe§8: §e#!CMD 'COMMAND'
SCRIPT_GUI_CUSTOM_COMMANDS_LORE_2 = §7an den Anfang eines Script Buches um ein Custom Command zu nutzen. Der Befehl startet immer mit §e/§7 und kann dann so aufgebaut sein wie du willst. Alles was in Spitzen Klammern steht '§e<>§7' wird als Parameter und somit als Variable gewertet. Parameter, welche in runden Klammern stehen sind Optional. Einfache Texte als Parameter bekommen eine gleichnamige Variable mit true/false als Wert je nachdem ob dieser angegeben wurde oder nicht
SCRIPT_GUI_CUSTOM_EVENTS = §eCustom Events
SCRIPT_GUI_CUSTOM_EVENTS_LORE_1 = §7Schreibe§8: §e#!EVENT 'EventName'
SCRIPT_GUI_CUSTOM_EVENTS_LORE_2 = §7an den Anfang eines Script Buches um ein Custom Event zu nutzen. Jedes Event kann durch 'var cancel true' gecancelt werden. Hinter dem Event Namen stehen die Variablen, welche im Script durch das Event nutztbar sind.
SCRIPT_GUI_CUSTOM_EVENTS_LORE_3 = §7Nutzbare Events sind:
SCRIPT_GUI_CUSTOM_EVENTS_LORE_4 = §eFF
SCRIPT_GUI_CUSTOM_EVENTS_LORE_5 = §ePlaceBlock §8-§7 blockX, blockY, blockZ, blockType
SCRIPT_GUI_CUSTOM_EVENTS_LORE_6 = §eBreakBlock §8-§7 blockX, blockY, blockZ, blockType
SCRIPT_GUI_CUSTOM_EVENTS_LORE_7 = §eRightClick §8-§7 blockInHand, action, handType,
SCRIPT_GUI_CUSTOM_EVENTS_LORE_8 = §7 hasBlock §8[§7blockX, blockY, blockZ, blockFace§8]§e*
SCRIPT_GUI_CUSTOM_EVENTS_LORE_9 = §eLeftClick §8-§7 blockInHand, action, handType,
SCRIPT_GUI_CUSTOM_EVENTS_LORE_10 = §7 hasBlock §8[§7blockX, blockY, blockZ, blockFace§8]§e*
SCRIPT_GUI_CUSTOM_EVENTS_LORE_11 = §eTNTSpawn
SCRIPT_GUI_CUSTOM_EVENTS_LORE_12 = §eTNTExplode §8-§7 x, y, z
SCRIPT_GUI_CUSTOM_EVENTS_LORE_13 = §eTNTExplodeInBuild §8-§7 x, y, z
SCRIPT_GUI_CUSTOM_EVENTS_LORE_14 = §eSelfJoin §8-§7 x, y, z, playerName
SCRIPT_GUI_CUSTOM_EVENTS_LORE_15 = §eSelfLeave §8-§7 x, y, z, playerName
SCRIPT_GUI_CUSTOM_EVENTS_LORE_16 = §eDropItem §8-§7 material, x, y, z
SCRIPT_GUI_CUSTOM_EVENTS_LORE_17 = §eEntityDeath §8-§7 entityType, x, y, z
SCRIPT_GUI_CUSTOM_EVENTS_LORE_STAR_1 = §e* §8-§7 Alles in den Klammern ist nur gesetzt, wenn die Variable davor auf §etrue§7 gesetzt ist.
SCRIPT_GUI_OTHER = §eOther
SCRIPT_GUI_OTHER_LORE_1 = §7Kommentare fangen mit §e#§7 an.
SCRIPT_GUI_OTHER_LORE_2 = §7Jump_Points fangen mit §e.§7 an.
SCRIPT_GUI_OTHER_LORE_3 = §7Einen Variablennamen, der in '§e{}§7' eingeschlossen ist wird durch seinen Wert ersetzt. Eine Variable kann mit den Präfixen '§econst.§7' oder '§elocal.§7' oder '§eglobal.§7' versehen werden.
SCRIPT_GUI_OTHER_LORE_4 = §7Dabei gilt:
SCRIPT_GUI_OTHER_LORE_5 = §7- Lokalevariablen sind nur in dem Script-Buch verfügbar.
SCRIPT_GUI_OTHER_LORE_6 = §7- Gloablevariablen sind in jedem Script-Buch verfügbar.
SCRIPT_GUI_OTHER_LORE_7 = §7- Konstantevariablen sind Variablen vom Server (z.B. Spielername, TPS usw.)
SCRIPT_GUI_OTHER_LORE_8 = §7Eine Variable kann mit den Appendixen '§e.length§7' oder '§e.type§7' oder '§e.isset§7' versehen werden.
SCRIPT_GUI_OTHER_LORE_9 = §7Dabei gilt:
SCRIPT_GUI_OTHER_LORE_10 = §7- Length gibt die Länge der variable als Zahl zurück.
SCRIPT_GUI_OTHER_LORE_11 = §7- Type gibt den typen (number, floating number, text oder boolean) als Text zurück.
SCRIPT_GUI_OTHER_LORE_12 = §7- Isset gibt als boolean zurück, ob die Variable existiert.
SCRIPT_GUI_OTHER_LORE_13 = §7Mathematische sowie logische Operationsvorgänge können in '§e{}§7' angegeben werden.
SCRIPT_GUI_OTHER_LORE_14 = §7Dabei gilt:
SCRIPT_GUI_OTHER_LORE_15 = §7- Rechenoperatoren: §e+ * - /§7 sowie §e%§7 für Modulo
SCRIPT_GUI_OTHER_LORE_16 = §7- Logische Operatoren: §e==§7; §e!=§7; §e<=§7; §e>=§7; §e<§7; §e>§7; §e&&§7; §e||§7 (Dies ist das Zeichen für oder)
SCRIPT_GUI_OTHER_LORE_17 = §7- Bitweise Operatoren: §e&§7; §e|§7; §e^
SCRIPT_GUI_OTHER_LORE_18 = §7- Shift Operatoren: §e<<§7; §e>>§7; §e>>>§7
SCRIPT_GUI_COMMAND_NAME = §7Command: §e{0}
SCRIPT_GUI_CUSTOM_VARIABLES = §eCustom Variables
SCRIPT_GUI_CONSTANT_TIME_NAME = §7Constant §etime
SCRIPT_GUI_CONSTANT_TIME_LORE = §7Formattierte Uhrzeit
SCRIPT_GUI_CONSTANT_TICKS_NAME = §7Constant §eticks
SCRIPT_GUI_CONSTANT_TICKS_LORE = §7Ticks seit dem Serverstart
SCRIPT_GUI_CONSTANT_TRACE_NAME = §7Constant §etrace
SCRIPT_GUI_CONSTANT_TRACE_LORE = §etrue§7 wenn gerade der Tracer an ist.
SCRIPT_GUI_CONSTANT_AUTO_TRACE_NAME = §7Constant §eautotrace
SCRIPT_GUI_CONSTANT_AUTO_TRACE_LORE = §etrue§7 wenn gerade der AutoTracer an ist.
SCRIPT_GUI_CONSTANT_TRACE_STATUS_NAME = §7Constant §etrace_status
SCRIPT_GUI_CONSTANT_TRACE_STATUS_LORE = §7Ein Wert von: §eOFF§8, §eIDLE§8, §eIDLE_AUTO_EXPLODE§8, §eIDLE_AUTO_IGNITE§8, §eIDLE_SINGLE
SCRIPT_GUI_CONSTANT_TRACE_TIME_NAME = §7Constant §etrace_time
SCRIPT_GUI_CONSTANT_TRACE_TIME_LORE = §e0§7 wenn gerade kein TNT getraced wird, ansonsten die Zeit in Ticks seit dem Start des Tracers.
SCRIPT_GUI_CONSTANT_LOADER_STATUS_NAME = §7Constant §eloader_status
SCRIPT_GUI_CONSTANT_LOADER_STATUS_LORE = §7Ein Wert von: §eOFF§8, §eSETUP§8, §eRUNNING§8, §eSINGLE§8, §ePAUSE§8, §eEND
SCRIPT_GUI_CONSTANT_TNT_NAME = §7Constant §etnt
SCRIPT_GUI_CONSTANT_TNT_LORE = §etrue§7 wenn TNT nicht ausgeschaltet ist.
SCRIPT_GUI_CONSTANT_ONLY_TB_NAME = §7Constant §etnt_onlytb
SCRIPT_GUI_CONSTANT_ONLY_TB_LORE = §etrue§7 wenn TNT Nur Testblock an ist.
SCRIPT_GUI_CONSTANT_FREEZE_NAME = §7Constant §efreeze
SCRIPT_GUI_CONSTANT_FREEZE_LORE = §etrue§7 wenn Freeze nicht ausgeschaltet ist.
SCRIPT_GUI_CONSTANT_FIRE_NAME = §7Constant §efire
SCRIPT_GUI_CONSTANT_FIRE_LORE = §etrue§7 wenn Fire nicht ausgeschaltet ist.
SCRIPT_GUI_CONSTANT_PROTECT_NAME = §7Constant §eprotect
SCRIPT_GUI_CONSTANT_PROTECT_LORE = §etrue§7 wenn Protect angeschaltet ist.
SCRIPT_GUI_CONSTANT_X_NAME = §7Constant §ex
SCRIPT_GUI_CONSTANT_X_LORE = §ex§7 Position des Spielers.
SCRIPT_GUI_CONSTANT_Y_NAME = §7Constant §ey
SCRIPT_GUI_CONSTANT_Y_LORE = §ey§7 Position des Spielers.
SCRIPT_GUI_CONSTANT_Z_NAME = §7Constant §ez
SCRIPT_GUI_CONSTANT_Z_LORE = §ez§7 Position des Spielers.
SCRIPT_GUI_CONSTANT_NAME_NAME = §7Constant §ename
SCRIPT_GUI_CONSTANT_NAME_LORE = §eDisplay§7 Name des Spielers.
SCRIPT_GUI_CONSTANT_SNEAK_NAME = §7Constant §esneaking
SCRIPT_GUI_CONSTANT_SNEAK_LORE = §etrue§7 wenn der Spieler gerade sneakt.
SCRIPT_GUI_CONSTANT_SPRINTING_NAME = §7Constant §esprinting
SCRIPT_GUI_CONSTANT_SPRINTING_LORE = §etrue§7 wenn der Spieler gerade rennt.
SCRIPT_GUI_CONSTANT_SLOT_NAME = §7Constant §eslot
SCRIPT_GUI_CONSTANT_SLOT_LORE = §e0-8§7 für den ausgewählten slot.
SCRIPT_GUI_CONSTANT_SLOT_MATERIAL_NAME = §7Constant §eslotmaterial
SCRIPT_GUI_CONSTANT_SLOT_MATERIAL_LORE = §eMaterial§7 des Items im Slot
SCRIPT_GUI_CONSTANT_OFF_HAND_MATERIAL_NAME = §7Constant §eoffhandmaterial
SCRIPT_GUI_CONSTANT_OFF_HAND_MATERIAL_LORE = §eMaterial§7 des Items in der Off Hand
SCRIPT_GUI_CONSTANT_SLOT_MATERIAL_DISPLAY_NAME = §7Constant §ematerialname
SCRIPT_GUI_CONSTANT_SLOT_MATERIAL_DISPLAY_LORE = §eName§7 des Items im Slot
SCRIPT_GUI_CONSTANT_OFF_HAND_MATERIAL_DISPLAY_NAME = §7Constant §eoffmaterialname
SCRIPT_GUI_CONSTANT_OFF_HAND_MATERIAL_DISPLAY_LORE = §eName§7 des Items in der Off Hand
SCRIPT_GUI_CONSTANT_REGION_TYPE_NAME = §7Constant §eregion_type
SCRIPT_GUI_CONSTANT_REGION_TYPE_LORE = §eRegionstype§7 der jetztigen Region
SCRIPT_GUI_CONSTANT_REGION_NAME_NAME = §7Constant §eregion_name
SCRIPT_GUI_CONSTANT_REGION_NAME_LORE = §eRegionsname§7 der jetztigen Region
SCRIPT_GUI_CONSTANT_TPS_NAME = §7Constant §etps
SCRIPT_GUI_CONSTANT_TPS_LORE = §etps§7 vom Server
SCRIPT_GUI_CONSTANT_TPS_LIMIT_NAME = §7Constant §etps_limit
SCRIPT_GUI_CONSTANT_TPS_LIMIT_LORE = §etps_limit§7 vom Server
# Unsign Book # Unsign Book
UNSIGN_HELP=§8/§eunsign §8- §7Mache ein Buch beschreibbar UNSIGN_HELP=§8/§eunsign §8- §7Mache ein Buch beschreibbar
@ -568,7 +331,6 @@ SIMULATOR_GUI_TNT_GROUP_LORE_1 = §7Elementanzahl§8: §e{0}
SIMULATOR_GUI_TNT_DISABLED = §cDisabled SIMULATOR_GUI_TNT_DISABLED = §cDisabled
SIMULATOR_GUI_NAME = Kanonensimulator SIMULATOR_GUI_NAME = Kanonensimulator
SIMULATOR_GUI_DELETE = §cTNT löschen SIMULATOR_GUI_DELETE = §cTNT löschen
SIMULATOR_GUI_START = §eStarten
SIMULATOR_GUI_AUTO_TRACE = §eAutoTrace§8: §7{0} SIMULATOR_GUI_AUTO_TRACE = §eAutoTrace§8: §7{0}
SIMULATOR_GUI_MOVE_ALL = §eAlle Verschieben SIMULATOR_GUI_MOVE_ALL = §eAlle Verschieben
@ -624,30 +386,26 @@ INVENTORY_FILL_INFO = §7Hilft dir, Behälter zu füllen, indem du sie beim snea
INVENTORY_FILL_ENABLE = §aInventoryFiller activated INVENTORY_FILL_ENABLE = §aInventoryFiller activated
INVENTORY_FILL_DISABLE = §cInventoryFiller deactivated 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 # BlockCounter
BLOCK_COUNTER_HELP_TOGGLE = §8/§eblockcounter §8- §7Wechsel zwischen an und aus 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_ENABLE = §8/§eblockcounter enable §8- §7Schalte den BlockCounter an
BLOCK_COUNTER_HELP_DISABLE = §8/§eblockcounter disable §8- §7Schalte den BlockCounter aus BLOCK_COUNTER_HELP_DISABLE = §8/§eblockcounter disable §8- §7Schalte den BlockCounter aus
BLOCK_COUNTER_MESSAGE = §7Counter §8> §e{0} §7Blöcke §e{1} §7TNT §e{2} §7Blöcke/TNT §e{3} §7Blöcke/tick 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 = §7Counter §8> §e{0} §7Blöcke §e{1} §7TNT §e{2} §7Blöcke/TNT §e{3} §7Blöcke/s 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_ENABLE = §7BlockCounter angemacht
BLOCK_COUNTER_DISABLE = §7BlockCounter ausgemacht BLOCK_COUNTER_DISABLE = §7BlockCounter ausgemacht
# DepthCounter # DepthCounter
DEPTH_COUNTER_COMMAND_ENABLE_HELP = §8/§edepthcounter enable §8- §7Aktiviere den Tiefenzähler DEPTH_COUNTER_MESSAGE = §7Tiefe §8> §7
DEPTH_COUNTER_COMMAND_DISABLE_HELP = §8/§edepthcounter disable §8- §7Deaktiviere den Tiefenzähler
DEPTH_COUNTER_COMMAND_INFO_HELP = §8/§edepthcounter info §8- §7Zähle aktive Zählmodi auf
DEPTH_COUNTER_COMMAND_TOGGLE_HELP = §8/§edepthcounter toggle §8<§7CountMode§8> §8- §7Stelle einzelne Zählmodi ein
DEPTH_COUNTER_ENABLE_MESSAGE = §7Du hast den Tiefenzähler aktiviert.
DEPTH_COUNTER_DISABLE_MESSAGE = §7Du hast den Tiefenzähler deaktiviert.
DEPTH_COUNTER_ACTIVE_MESSAGE = §7Aktive Zählmodi: §e{0}§8.
DEPTH_COUNTER_MESSAGE = §7Schaden §8> §7{0}
DEPTH_COUNTER_HIGHLIGHT = §e
DEPTH_COUNTER_SEPARATOR = §7 §7
DEPTH_COUNTER_X = X: {0}
DEPTH_COUNTER_Y = Y: {0}
DEPTH_COUNTER_Z = Z: {0}
DEPTH_COUNTER_TNT = §7TNT§8: §e{0}
# TPSLimit # TPSLimit
TICK_STEP_HELP = §8/§etick step §8<§7Ticks§8> §8- §7Spule n Ticks vor TICK_STEP_HELP = §8/§etick step §8<§7Ticks§8> §8- §7Spule n Ticks vor
@ -674,7 +432,7 @@ TPSLIMIT_INVALID_FROZEN = §c und '0'
# Trace # Trace
TRACE_RECORD=§aan TRACE_RECORD=§aan
TRACE_IDLE=§caus TRACE_HAS_TRACES=§ehat Traces
TRACE_IDLE_SINGLE=§esingle TRACE_IDLE_SINGLE=§esingle
TRACE_IDLE_AUTO_EXPLODE=§eauto §8(§7explode§8) TRACE_IDLE_AUTO_EXPLODE=§eauto §8(§7explode§8)
TRACE_IDLE_AUTO_IGNITE=§eauto §8(§7ignite§8) TRACE_IDLE_AUTO_IGNITE=§eauto §8(§7ignite§8)
@ -690,7 +448,6 @@ TRACE_MESSAGE_ISOLATE = §aTNT-Positionen isoliert
TRACE_MESSAGE_UNISOLATE = §cTNT-Positionen ausgeblendet TRACE_MESSAGE_UNISOLATE = §cTNT-Positionen ausgeblendet
TRACE_MESSAGE_CLICK_ISOLATE = §eKlicken zum §aisolieren§8/§causblenden TRACE_MESSAGE_CLICK_ISOLATE = §eKlicken zum §aisolieren§8/§causblenden
TRACE_MESSAGE_DISALLOWED = §cDu darfst hier nicht den TNT-Tracer nutzen TRACE_MESSAGE_DISALLOWED = §cDu darfst hier nicht den TNT-Tracer nutzen
TRACE_MESSAGE_NO_REGION = §cDu bist in keiner Region
TRACE_COMMAND_HELP_START = §8/§etrace start §8- §7Startet die Aufnahme aller TNT-Positionen TRACE_COMMAND_HELP_START = §8/§etrace start §8- §7Startet die Aufnahme aller TNT-Positionen
TRACE_COMMAND_HELP_SINGLE = §8/§etrace single §8- §7Startet eine einzelne Aufnahme aller TNT-Positionen TRACE_COMMAND_HELP_SINGLE = §8/§etrace single §8- §7Startet eine einzelne Aufnahme aller TNT-Positionen
@ -730,63 +487,87 @@ TRACE_GUI_POSITION_SOURCE = §7Ursprung§8: §e{0}
TRACE_GUI_POSITION_EXPLODED = §7Explodiert§8: §e{0} TRACE_GUI_POSITION_EXPLODED = §7Explodiert§8: §e{0}
# Loader # Loader
LOADER_OFF = §caus
LOADER_SETUP = §eEinrichtung LOADER_SETUP = §eEinrichtung
LOADER_RUNNING = §aLaufend LOADER_RUNNING = §aLaufend
LOADER_SINGLE_SIDEBAR = §aEiner
LOADER_PAUSE = §7Pausiert LOADER_PAUSE = §7Pausiert
LOADER_END = §8Beendet LOADER_END = §8Beendet
LOADER_MESSAGE_CLEAR = §7Loader gecleart
LOADER_MESSAGE_CLEAR_HELP = §cDu must im Setup-Modus sein um den Loader zu clearen
LOADER_MESSAGE_TNT = §eTNT hinzugefügt {0}
LOADER_MESSAGE_INTERACT = §e{0} hinzugefügt {1} LOADER_MESSAGE_INTERACT = §e{0} hinzugefügt {1}
LOADER_BUTTON_TNT = TNT
LOADER_BUTTON_SWITCH=Hebel LOADER_BUTTON_SWITCH=Hebel
LOADER_BUTTON_WOOD_BUTTON=Knopf LOADER_BUTTON_WOOD_BUTTON=Holzknopf
LOADER_BUTTON_STONE_BUTTON=Knopf LOADER_BUTTON_STONE_BUTTON=Steinknopf
LOADER_BUTTON_PRESSURE_PLATE=Druckplatte LOADER_BUTTON_PRESSURE_PLATE=Druckplatte
LOADER_BUTTON_WEIGHTED_PRESSURE_PLATE=Druckplatte LOADER_BUTTON_WEIGHTED_PRESSURE_PLATE=Druckplatte
LOADER_BUTTON_TRIPWIRE=Tripwire LOADER_BUTTON_TRIPWIRE=Tripwire
LOADER_BUTTON_NOTEBLOCK=Noteblock LOADER_BUTTON_NOTEBLOCK=Noteblock
LOADER_BUTTON_DAYLIGHTSENSOR=Tageslichtsensor LOADER_BUTTON_DAYLIGHT_DETECTOR=Tageslichtsensor
LOADER_BUTTON_INVALID=Invalider 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_HELP_SETUP=§8/§eloader setup §8- §7Startet die Aufnahme der Aktionen
LOADER_HELP_UNDO=§8/§7loader undo §8- §7Entfernt die zuletzt aufgenommene Aktion LOADER_SETUP_STOP_FIRST=§cBitte stoppe zuerst den Loader
LOADER_HELP_START=§8/§eloader start §8- §7Spielt die zuvor aufgenommenen Aktionen ab LOADER_HELP_START=§8/§eloader start §8- §7Spielt die zuvor aufgenommenen Aktionen ab
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_HELP_PAUSE=§8/§7loader pause §8- §7Pausiert das Abspielen LOADER_HELP_PAUSE=§8/§7loader pause §8- §7Pausiert das Abspielen
LOADER_HELP_RESUME=§8/§7loader resume §8- §7Spielt den Loader weiter ab 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_STOP=§8/§eloader stop §8- §7Stoppt die Aufnahme bzw. das Abspielen
LOADER_HELP_CLEAR=§8/§eloader clear §8- §7Cleart die Aufnahme
LOADER_HELP_SINGLE=§8/§eloader single §8- §7Spielt die Aufnahme einmal ab
LOADER_HELP_OTHER=§7Der Loader arbeitet mit §eIngame§8-§eTicks §7(20 Ticks pro Sekunde)
LOADER_NO_LOADER=§cDu hast noch keinen Loader. Erstelle dir einen mit /loader setup LOADER_NO_LOADER=§cDu hast noch keinen Loader. Erstelle dir einen mit /loader setup
LOADER_BACK_SETUP=§7Dein Loader ist nun wieder im Setup
LOADER_NEW=§7Belade und feuer einmal die Kanone ab, um den Loader zu initialisieren. 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_HOW_TO_START=§7Führe dann /§eloader start§7 um den Loader zu starten
LOADER_ACTIVE=§7Der Loader ist nun aktiviert. LOADER_ACTIVE=§7Der Loader ist nun aktiviert.
LOADER_STOP=§7Der Loader ist nun gestoppt. LOADER_STOP=§7Der Loader ist nun gestoppt.
LOADER_PAUSED=§7Der Loader ist nun pausiert. LOADER_PAUSED=§7Der Loader ist nun pausiert.
LOADER_RESUME=§7Der Loader läuft nun weiter.
LOADER_SINGLE=§7Der Loader schießt einmal.
LOADER_SMALL_TIME=§cDie Wartezeit ist zu klein
LOADER_NEW_TIME=§7Die Schusswartezeit ist nun: {0}, zuvor {1}
LOADER_NEW_LOAD_TIME=§7Die Setzwartezeit ist nun: {0}, zuvor {1}
LOADER_UNDO=§7Undo erfolgreich.
LOADER_PERMS=§cDu darfst hier nicht den Detonator nutzen LOADER_PERMS=§cDu darfst hier nicht den Detonator nutzen
LOADER_GUI_NAME=§eLoader
LOADER_GUI_NEW=§eNeuer Loader LOADER_NOTHING_RECORDED=§cEs wurden keine Elemente aufgenommen!
LOADER_GUI_START=§eLoader starten LOADER_GUI_TITLE=Loader Einstellungen
LOADER_GUI_PAUSE=§7Loader pausieren LOADER_GUI_SHOW_INTERACTIONS=§eZeige Interaktionen
LOADER_GUI_UNDO=§7Letzte Aktion Rückgängig machen LOADER_GUI_SHOW_WAITS=§eZeige Wartezeiten
LOADER_GUI_WAIT=§7Schuss Delay LOADER_GUI_SHOW_WAITS_SET_BETWEEN_TNT=§7Wait Time zwischen TNT
LOADER_GUI_WAIT_LORE=§7Aktuell: §e{0} LOADER_GUI_SHOW_WAITS_SET_ALL=§7Wait Time alle
LOADER_GUI_WAIT_TITLE=§7Schuss Delay LOADER_GUI_SHOW_WAITS_TITLE=§7Wartezeit
LOADER_GUI_SPEED=§eGeschwindigkeit LOADER_GUI_SETTINGS_TITLE=Einstellungen
LOADER_GUI_SPEED_LORE=§7Aktuell: §e{0} LOADER_GUI_SETTINGS_BACK=§8Zurück
LOADER_GUI_SPEED_TITLE=§7Block Platzier Geschwindigkeit LOADER_GUI_SETTINGS_DELETE=§cLöschen
LOADER_GUI_STOP=§eLoader Stoppen LOADER_GUI_WAIT_TITLE=Wartezeit
LOADER_GUI_WAIT_BACK=§8Zurück
LOADER_GUI_CLICK_TO_EDIT=§7Click to edit
LOADER_GUI_ITEM_NAME=§7{0}§8: §e{1}
LOADER_SETTING_NAME=§7{0}
LOADER_SETTING_MODES=§7Modes§8: §e{0}
LOADER_SETTING_POWER=§7Power§8: §e{0}
LOADER_SETTING_TICKS=§7Ticks§8: §e{0}
LOADER_SETTING_REPEATER=§7Repeater§8: §e{0}
LOADER_SETTING_WAIT=§7Wait§8: §e{0} Tick(s)
LOADER_SETTING_WAIT_NAME=Wait
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_INTERACT=Interact
LOADER_INTERACTION_POWERED=Powered
LOADER_INTERACTION_UNPOWERED=Unpowered
LOADER_INTERACTION_PAGE_PREV=Previous Page
LOADER_INTERACTION_PAGE_NEXT=Next Page
LOADER_INTERACTION_PAGE=Page {0}
LOADER_INTERACTION_ACTIVE=Active
LOADER_INTERACTION_INACTIVE=Inactive
LOADER_INTERACTION_WAIT_FOR=Wait for
LOADER_INTERACTION_NO_WAIT_FOR=No wait for
LOADER_INTERACTION_OPEN=Open
LOADER_INTERACTION_CLOSED=Closed
# Loadtimer # Loadtimer
LOADTIMER_HELP_OVERVIEW=§7Messe dich und deine Freunde beim Beladen einer Kanone und bekomme informationen über die Kanone 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_1=§8/§eloadtimer start §8-§7 Startet den einfachen Loadtimer
@ -882,6 +663,8 @@ SKULL_GUI_ITEM_NAME = §eSpieler Köpfe
ANVIL_INV_NAME=Spieler name ANVIL_INV_NAME=Spieler name
# StructureVoid # StructureVoid
STRUCTURE_VOID_COMMAND_HELP=§8/§estructureVoid §8-§7 Erhalte ein 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 # NightVision
NIGHT_VISION_HELP=§8/§enightvision §8-§7 Schalte Nightvision an oder aus. NIGHT_VISION_HELP=§8/§enightvision §8-§7 Schalte Nightvision an oder aus.
NIGHT_VISION_OFF=§eNightvision deaktiviert NIGHT_VISION_OFF=§eNightvision deaktiviert
@ -966,6 +749,11 @@ REGION_FREEZE_HELP=§8/§efreeze §8- §7Toggle Freeze
REGION_FREEZE_NO_PERMS=§cDu darfst diese Welt nicht einfrieren REGION_FREEZE_NO_PERMS=§cDu darfst diese Welt nicht einfrieren
REGION_FREEZE_ENABLED=§cRegion eingefroren REGION_FREEZE_ENABLED=§cRegion eingefroren
REGION_FREEZE_DISABLED=§aRegion aufgetaut REGION_FREEZE_DISABLED=§aRegion aufgetaut
REGION_ITEMS_HELP=§8/§eitems §8- §7Toggle Items
REGION_ITEMS_NO_PERMS=§cDu darfst hier nicht Items (de-)aktivieren
REGION_ITEMS_ENABLED=§aItems aktiviert in dieser Region
REGION_ITEMS_DISABLED=§cItems deaktiviert in dieser Region
REGION_ITEMS_DISABLED_GLOBAL=§cItems sind auf dem Server deaktiviert.
REGION_PROTECT_HELP=§8/§eprotect §8- §7Schütze die Region REGION_PROTECT_HELP=§8/§eprotect §8- §7Schütze die Region
REGION_PROTECT_DISABLE=§cBoden Schutz aufgehoben REGION_PROTECT_DISABLE=§cBoden Schutz aufgehoben
REGION_PROTECT_ENABLE=§aBoden geschützt REGION_PROTECT_ENABLE=§aBoden geschützt
@ -1229,7 +1017,7 @@ 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_NAME_RESERVED=§7Du kannst nicht §c{0} §7als name für einen Warp nutzen
WARP_CREATED=§7Der Warp §e{0} §7wurde erstellt WARP_CREATED=§7Der Warp §e{0} §7wurde erstellt
WARP_DELETE_HOVER=§e{0} §7löschen WARP_DELETE_HOVER=§e{0} §7löschen
WARP_DELETED=§e{0} §7wurde gelöcht WARP_DELETED=§e{0} §7wurde gelöscht
WARP_TELEPORT_HOVER=§7Zu §e{0} §7teleportieren WARP_TELEPORT_HOVER=§7Zu §e{0} §7teleportieren
WARP_MATERIAL_CHOOSE=Material auswählen WARP_MATERIAL_CHOOSE=Material auswählen
WARP_GUI_NAME=Warps WARP_GUI_NAME=Warps

Datei anzeigen

@ -21,6 +21,11 @@ package de.steamwar.bausystem;
import com.comphenix.tinyprotocol.TinyProtocol; import com.comphenix.tinyprotocol.TinyProtocol;
import de.steamwar.bausystem.configplayer.Config; import de.steamwar.bausystem.configplayer.Config;
import de.steamwar.bausystem.features.tpslimit.FreezeUtils;
import de.steamwar.bausystem.features.tpslimit.TPSLimitUtils;
import de.steamwar.bausystem.features.tpslimit.TPSUtils;
import de.steamwar.bausystem.features.tpslimit.TPSWarpUtils;
import de.steamwar.bausystem.features.world.RamUsage;
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;
@ -31,11 +36,16 @@ import lombok.Getter;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.World; import org.bukkit.World;
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.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.util.function.Consumer;
import java.util.logging.Level; import java.util.logging.Level;
public class BauSystem extends JavaPlugin implements Listener { public class BauSystem extends JavaPlugin implements Listener {
@ -73,6 +83,7 @@ public class BauSystem extends JavaPlugin implements Listener {
new Updater(RegionLoader.file, RegionLoader::load); new Updater(RegionLoader.file, RegionLoader::load);
LinkageUtils.link(); LinkageUtils.link();
RamUsage.init();
// This could disable any watchdog stuff. We need to investigate if this is a problem. // This could disable any watchdog stuff. We need to investigate if this is a problem.
/* /*
@ -122,18 +133,44 @@ public class BauSystem extends JavaPlugin implements Listener {
})); }));
} }
private void createLink(String source, String destination) { public static BukkitTask runTaskLater(Plugin plugin, Runnable runnable, long delay) {
try { return new BukkitRunnable() {
Bukkit.getLogger().log(Level.INFO, "Executing: ln -s /home/minecraft/server/Bau15/{0} {1}", new String[]{source, destination}); private int counter = 1;
ProcessBuilder processBuilder = new ProcessBuilder("ln", "-s", "/home/minecraft/server/Bau15/" + source, destination);
processBuilder.directory(world.getWorldFolder());
processBuilder.inheritIO();
Process process = processBuilder.start(); @Override
process.waitFor(); public void run() {
} catch (IOException | InterruptedException e) { if (FreezeUtils.isFrozen()) return;
Thread.currentThread().interrupt(); if (counter >= delay) {
Bukkit.shutdown(); runnable.run();
} cancel();
return;
}
counter++;
}
}.runTaskTimer(plugin, 0, 1);
}
public static BukkitTask runTaskTimer(Plugin plugin, Runnable runnable, long delay, long period) {
return new BukkitRunnable() {
private int counter = 1;
private boolean first = true;
@Override
public void run() {
if (FreezeUtils.isFrozen()) return;
if (counter >= (first ? delay : period)) {
first = false;
runnable.run();
counter = 1;
return;
}
counter++;
}
}.runTaskTimer(plugin, 0, 1);
}
public static void runTaskTimer(Plugin plugin, Consumer<BukkitTask> consumer, long delay, long period) {
AtomicReference<BukkitTask> task = new AtomicReference<>();
task.set(runTaskTimer(plugin, () -> consumer.accept(task.get()), delay, period));
} }
} }

Datei anzeigen

@ -20,12 +20,17 @@
package de.steamwar.bausystem; package de.steamwar.bausystem;
import de.steamwar.bausystem.config.BauServer; import de.steamwar.bausystem.config.BauServer;
import de.steamwar.command.CommandMetaData;
import de.steamwar.command.TypeValidator;
import de.steamwar.sql.BauweltMember; import de.steamwar.sql.BauweltMember;
import de.steamwar.sql.SteamwarUser;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.bukkit.Bukkit; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.function.Predicate; import java.util.function.Predicate;
@AllArgsConstructor @AllArgsConstructor
@ -54,4 +59,33 @@ public enum Permission {
public static boolean hasPermission(Player member, Permission permission) { public static boolean hasPermission(Player member, Permission permission) {
return permission.hasPermission(member); return permission.hasPermission(member);
} }
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.PARAMETER)
@CommandMetaData.Parameter({Player.class})
@CommandMetaData.ImplicitValidator(handler = Perm.Handler.class, order = -10)
public @interface Perm {
Permission value();
String message() default "";
class Handler implements TypeValidator<Player> {
private Permission permission;
private String message;
public Handler(Perm perm) {
this.permission = perm.value();
this.message = perm.message();
if (message != null && message.isEmpty()) message = null;
}
@Override
public boolean validate(CommandSender commandSender, Player player, MessageSender messageSender) {
if (message == null) {
return permission.hasPermission(player);
}
return !messageSender.send(!permission.hasPermission((Player) commandSender), message);
}
}
}
} }

Datei anzeigen

@ -36,7 +36,6 @@ import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Linked @Linked
@MinVersion(18)
public class AttributeRemoveCommand extends SWCommand { public class AttributeRemoveCommand extends SWCommand {
public AttributeRemoveCommand() { public AttributeRemoveCommand() {
@ -100,13 +99,15 @@ public class AttributeRemoveCommand extends SWCommand {
return lore.stream() return lore.stream()
.skip(1) .skip(1)
.map(s1 -> s1.substring(6)) .map(s1 -> s1.substring(6))
.map(s1 -> s1.replace('§', '&'))
.map(s1 -> s1.replace(' ', '_')) .map(s1 -> s1.replace(' ', '_'))
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
@Override @Override
public String map(CommandSender commandSender, PreviousArguments previousArguments, String s) { public String map(CommandSender commandSender, PreviousArguments previousArguments, String s) {
return s.replace('_', ' '); return s.replace('_', ' ')
.replace('&', '§');
} }
}; };
} }

Datei anzeigen

@ -0,0 +1,128 @@
/*
* 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;
}
}
}

Datei anzeigen

@ -20,10 +20,8 @@
package de.steamwar.bausystem.features.attributescopy; package de.steamwar.bausystem.features.attributescopy;
import de.steamwar.bausystem.BauSystem; import de.steamwar.bausystem.BauSystem;
import de.steamwar.bausystem.linkage.LinkageUtils;
import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommand;
import de.steamwar.linkage.Linked; import de.steamwar.linkage.Linked;
import de.steamwar.linkage.MinVersion;
import org.bukkit.FluidCollisionMode; import org.bukkit.FluidCollisionMode;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.block.Block; import org.bukkit.block.Block;
@ -36,40 +34,29 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
@Linked @Linked
@MinVersion(18)
public class AttributesCopyCommand extends SWCommand { public class AttributesCopyCommand extends SWCommand {
static List<BlockAttribute<?>> blockAttributeList = new ArrayList<>();
public static void add(BlockAttribute<?> blockAttribute) {
blockAttributeList.add(blockAttribute);
}
public AttributesCopyCommand() { public AttributesCopyCommand() {
super("copyattributes", "attributescopy", "ac"); super("copyattributes", "attributescopy", "ac");
} }
@Register @Register
public void genericCommand(Player player) { public void genericCommand(Player player) {
linkIfNeeded();
Block block = player.getTargetBlockExact(8, FluidCollisionMode.ALWAYS); Block block = player.getTargetBlockExact(8, FluidCollisionMode.ALWAYS);
if (block == null) return; if (block == null) return;
ItemStack mainHand = player.getInventory().getItemInMainHand(); ItemStack mainHand = player.getInventory().getItemInMainHand();
if (!isSame(block, mainHand)) {
if (!(block.getType().isItem() && block.getType() == mainHand.getType() || isSame(block, mainHand))) {
BauSystem.MESSAGE.send("ATTRIBUTES_CANT_COPY", player); BauSystem.MESSAGE.send("ATTRIBUTES_CANT_COPY", player);
return; return;
} }
BlockData blockData = block.getBlockData(); BlockData blockData = block.getBlockData();
List<String> attributesToCopy = new ArrayList<>(); List<String> attributesToCopy = new ArrayList<>();
if (needsType(block)) { if (block.getType() != mainHand.getType()) {
attributesToCopy.add("§8-§7 material " + block.getType().name().toLowerCase()); attributesToCopy.add("§8-§7 Material§8:§7 " + block.getType().name());
}
for (BlockAttribute blockAttribute : blockAttributeList) {
if (blockAttribute.type().isInstance(blockData)) {
blockAttribute.copy(attributesToCopy, blockData);
}
} }
AttributeUtils.copy(blockData, attributesToCopy);
if (attributesToCopy.isEmpty()) { if (attributesToCopy.isEmpty()) {
BauSystem.MESSAGE.send("ATTRIBUTES_NO_COPY", player); BauSystem.MESSAGE.send("ATTRIBUTES_NO_COPY", player);
return; return;
@ -83,15 +70,7 @@ public class AttributesCopyCommand extends SWCommand {
BauSystem.MESSAGE.send("ATTRIBUTES_COPIED", player); BauSystem.MESSAGE.send("ATTRIBUTES_COPIED", player);
} }
private static boolean isLinked = false;
static void linkIfNeeded() {
if (isLinked) return;
LinkageUtils.linkBlockAttributes();
isLinked = true;
}
private boolean isSame(Block block, ItemStack itemStack) { private boolean isSame(Block block, ItemStack itemStack) {
if (block.getType() == itemStack.getType()) return true;
if (itemStack.getType() == Material.REDSTONE && block.getType() == Material.REDSTONE_WIRE) return true; 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.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.ZOMBIE_HEAD && block.getType() == Material.ZOMBIE_WALL_HEAD) return true;
@ -102,22 +81,8 @@ public class AttributesCopyCommand extends SWCommand {
if (itemStack.getType() == Material.TORCH && block.getType() == Material.WALL_TORCH) 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.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.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; if (itemStack.getType().name().contains("_BANNER") && block.getType().name().contains("_WALL_BANNER")) return true;
return false; return false;
} }
private boolean needsType(Block block) {
if (block.getType().name().contains("WALL")) return true;
if (block.getType() == Material.PLAYER_HEAD) return true;
if (block.getType() == Material.ZOMBIE_HEAD) return true;
if (block.getType() == Material.CREEPER_HEAD) return true;
if (block.getType() == Material.DRAGON_HEAD) return true;
if (block.getType() == Material.SKELETON_SKULL) return true;
if (block.getType() == Material.WITHER_SKELETON_SKULL) return true;
if (block.getType() == Material.TORCH) return true;
if (block.getType() == Material.SOUL_TORCH) return true;
if (block.getType() == Material.REDSTONE_TORCH) return true;
if (block.getType().name().contains("_BANNER")) return true;
return false;
}
} }

Datei anzeigen

@ -21,7 +21,6 @@ package de.steamwar.bausystem.features.attributescopy;
import de.steamwar.bausystem.BauSystem; import de.steamwar.bausystem.BauSystem;
import de.steamwar.linkage.Linked; import de.steamwar.linkage.Linked;
import de.steamwar.linkage.MinVersion;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.OfflinePlayer; import org.bukkit.OfflinePlayer;
@ -33,21 +32,14 @@ import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.event.block.BlockPlaceEvent;
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.profile.PlayerProfile;
import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set;
import static de.steamwar.bausystem.features.attributescopy.AttributesCopyCommand.blockAttributeList;
@Linked @Linked
@MinVersion(18)
public class AttributesPlaceListener implements Listener { public class AttributesPlaceListener implements Listener {
@EventHandler @EventHandler
public void onBlockPlace(BlockPlaceEvent event) { public void onBlockPlace(BlockPlaceEvent event) {
AttributesCopyCommand.linkIfNeeded();
ItemStack itemStack = event.getItemInHand(); ItemStack itemStack = event.getItemInHand();
ItemMeta itemMeta = itemStack.getItemMeta(); ItemMeta itemMeta = itemStack.getItemMeta();
if (itemMeta == null) return; if (itemMeta == null) return;
@ -65,12 +57,12 @@ public class AttributesPlaceListener implements Listener {
event.setCancelled(true); event.setCancelled(true);
Bukkit.getScheduler().runTaskLater(BauSystem.getInstance(), () -> { Bukkit.getScheduler().runTaskLater(BauSystem.getInstance(), () -> {
Material material = strings.stream() Material material = strings.stream()
.filter(s -> s.startsWith("§8-§7 material ")) .filter(s -> s.startsWith("§8-§7 Material§8:§7 "))
.map(s -> s.replace("§8-§7 material ", "")) .map(s -> s.replace("§8-§7 Material§8:§7 ", ""))
.map(String::toUpperCase) .map(String::toUpperCase)
.map(s -> { .map(s -> {
try { try {
return Material.valueOf(s.toUpperCase()); return Material.valueOf(s);
} catch (Exception e) { } catch (Exception e) {
return null; return null;
} }
@ -78,7 +70,6 @@ public class AttributesPlaceListener implements Listener {
.findFirst() .findFirst()
.orElse(type); .orElse(type);
event.getBlock().setType(material, false); event.getBlock().setType(material, false);
Set<String> attributesToPaste = new HashSet<>(strings);
Block block = event.getBlock(); Block block = event.getBlock();
BlockData blockData = block.getBlockData(); BlockData blockData = block.getBlockData();
Bukkit.getScheduler().runTaskLater(BauSystem.getInstance(), () -> { Bukkit.getScheduler().runTaskLater(BauSystem.getInstance(), () -> {
@ -88,11 +79,7 @@ public class AttributesPlaceListener implements Listener {
skull.update(true, false); skull.update(true, false);
} }
}, 1); }, 1);
for (BlockAttribute blockAttribute : blockAttributeList) { AttributeUtils.paste(blockData, strings);
if (blockAttribute.type().isInstance(blockData)) {
blockAttribute.paste(attributesToPaste, blockData);
}
}
block.setBlockData(blockData, false); block.setBlockData(blockData, false);
}, 1); }, 1);
} }

Datei anzeigen

@ -1,31 +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 org.bukkit.block.data.BlockData;
import java.util.List;
import java.util.Set;
public interface BlockAttribute<T extends BlockData> {
Class<T> type();
void copy(List<String> attributes, T blockData);
void paste(Set<String> attributes, T blockData);
}

Datei anzeigen

@ -1,53 +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.impl;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.data.Ageable;
import java.util.List;
import java.util.Set;
@Linked
public class AgeableAttribute implements BlockAttribute<Ageable> {
private String attribute = "§8-§7 age ";
@Override
public Class<Ageable> type() {
return Ageable.class;
}
@Override
public void copy(List<String> attributes, Ageable blockData) {
attributes.add(attribute + blockData.getAge());
}
@Override
public void paste(Set<String> attributes, Ageable blockData) {
attributes.stream()
.filter(s -> s.startsWith(attribute))
.map(s -> s.replace(attribute, ""))
.map(Integer::parseInt)
.findFirst()
.ifPresent(blockData::setAge);
}
}

Datei anzeigen

@ -1,53 +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.impl;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.data.AnaloguePowerable;
import java.util.List;
import java.util.Set;
@Linked
public class AnaloguePowerableAttribute implements BlockAttribute<AnaloguePowerable> {
private String attribute = "§8-§7 power ";
@Override
public Class<AnaloguePowerable> type() {
return AnaloguePowerable.class;
}
@Override
public void copy(List<String> attributes, AnaloguePowerable blockData) {
attributes.add(attribute + blockData.getPower());
}
@Override
public void paste(Set<String> attributes, AnaloguePowerable blockData) {
attributes.stream()
.filter(s -> s.startsWith(attribute))
.map(s -> s.replace(attribute, ""))
.map(Integer::parseInt)
.findFirst()
.ifPresent(blockData::setPower);
}
}

Datei anzeigen

@ -1,48 +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.impl;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.data.Attachable;
import java.util.List;
import java.util.Set;
@Linked
public class AttachableAttribute implements BlockAttribute<Attachable> {
private String attribute = "§8-§7 attached";
@Override
public Class<Attachable> type() {
return Attachable.class;
}
@Override
public void copy(List<String> attributes, Attachable blockData) {
if (blockData.isAttached()) attributes.add(attribute);
}
@Override
public void paste(Set<String> attributes, Attachable blockData) {
blockData.setAttached(attributes.contains(attribute));
}
}

Datei anzeigen

@ -1,53 +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.impl;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.data.Bisected;
import java.util.List;
import java.util.Set;
@Linked
public class BisectedAttribute implements BlockAttribute<Bisected> {
private String attribute = "§8-§7 half ";
@Override
public Class<Bisected> type() {
return Bisected.class;
}
@Override
public void copy(List<String> attributes, Bisected blockData) {
attributes.add(attribute + blockData.getHalf().name().toLowerCase());
}
@Override
public void paste(Set<String> attributes, Bisected blockData) {
for (Bisected.Half half : Bisected.Half.values()) {
if (attributes.contains(attribute + half.name().toLowerCase())) {
blockData.setHalf(half);
return;
}
}
}
}

Datei anzeigen

@ -1,54 +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.impl;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.BlockFace;
import org.bukkit.block.data.Directional;
import java.util.List;
import java.util.Set;
@Linked
public class DirectionalAttribute implements BlockAttribute<Directional> {
private String attribute = "§8-§7 facing ";
@Override
public Class<Directional> type() {
return Directional.class;
}
@Override
public void copy(List<String> attributes, Directional blockData) {
attributes.add(attribute + blockData.getFacing().name().toLowerCase());
}
@Override
public void paste(Set<String> attributes, Directional blockData) {
for (BlockFace blockFace : blockData.getFaces()) {
if (attributes.contains(attribute + blockFace.name().toLowerCase())) {
blockData.setFacing(blockFace);
break;
}
}
}
}

Datei anzeigen

@ -1,53 +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.impl;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.data.FaceAttachable;
import java.util.List;
import java.util.Set;
@Linked
public class FaceAttachableAttribute implements BlockAttribute<FaceAttachable> {
private String attribute = "§8-§7 attached ";
@Override
public Class<FaceAttachable> type() {
return FaceAttachable.class;
}
@Override
public void copy(List<String> attributes, FaceAttachable blockData) {
attributes.add(attribute + blockData.getAttachedFace().name().toLowerCase());
}
@Override
public void paste(Set<String> attributes, FaceAttachable blockData) {
for (FaceAttachable.AttachedFace attachedFace : FaceAttachable.AttachedFace.values()) {
if (attributes.contains(attribute + attachedFace.name().toLowerCase())) {
blockData.setAttachedFace(attachedFace);
break;
}
}
}
}

Datei anzeigen

@ -1,51 +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.impl;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import de.steamwar.linkage.MinVersion;
import org.bukkit.block.data.Hangable;
import java.util.List;
import java.util.Set;
@Linked
@MinVersion(19)
public class HangableAttribute implements BlockAttribute<Hangable> {
private String attribute = "§8-§7 hanging";
@Override
public Class<Hangable> type() {
return Hangable.class;
}
@Override
public void copy(List<String> attributes, Hangable blockData) {
if (!blockData.isHanging()) return;
attributes.add(attribute);
}
@Override
public void paste(Set<String> attributes, Hangable blockData) {
blockData.setHanging(attributes.contains(attribute));
}
}

Datei anzeigen

@ -1,53 +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.impl;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.data.Levelled;
import java.util.List;
import java.util.Set;
@Linked
public class LevelledAttribute implements BlockAttribute<Levelled> {
private String attribute = "§8-§7 level ";
@Override
public Class<Levelled> type() {
return Levelled.class;
}
@Override
public void copy(List<String> attributes, Levelled blockData) {
attributes.add(attribute + blockData.getLevel());
}
@Override
public void paste(Set<String> attributes, Levelled blockData) {
attributes.stream()
.filter(s -> s.startsWith(attribute))
.map(s -> s.replace(attribute, ""))
.map(Integer::parseInt)
.findFirst()
.ifPresent(blockData::setLevel);
}
}

Datei anzeigen

@ -1,48 +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.impl;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.data.Lightable;
import java.util.List;
import java.util.Set;
@Linked
public class LightableAttribute implements BlockAttribute<Lightable> {
private String attribute = "§8-§7 lit";
@Override
public Class<Lightable> type() {
return Lightable.class;
}
@Override
public void copy(List<String> attributes, Lightable blockData) {
if (blockData.isLit()) attributes.add(attribute);
}
@Override
public void paste(Set<String> attributes, Lightable blockData) {
blockData.setLit(attributes.contains(attribute));
}
}

Datei anzeigen

@ -1,53 +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.impl;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.BlockFace;
import org.bukkit.block.data.MultipleFacing;
import java.util.List;
import java.util.Set;
@Linked
public class MultipleFacingAttribute implements BlockAttribute<MultipleFacing> {
private String attribute = "§8-§7 connected ";
@Override
public Class<MultipleFacing> type() {
return MultipleFacing.class;
}
@Override
public void copy(List<String> attributes, MultipleFacing blockData) {
blockData.getFaces().forEach(blockFace -> {
attributes.add(attribute + blockFace.name().toLowerCase());
});
}
@Override
public void paste(Set<String> attributes, MultipleFacing blockData) {
for (BlockFace blockFace : BlockFace.values()) {
blockData.setFace(blockFace, attributes.contains(attribute + blockFace.name().toLowerCase()));
}
}
}

Datei anzeigen

@ -1,48 +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.impl;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.data.Openable;
import java.util.List;
import java.util.Set;
@Linked
public class OpenableAttribute implements BlockAttribute<Openable> {
private String attribute = "§8-§7 open";
@Override
public Class<Openable> type() {
return Openable.class;
}
@Override
public void copy(List<String> attributes, Openable blockData) {
if (blockData.isOpen()) attributes.add(attribute);
}
@Override
public void paste(Set<String> attributes, Openable blockData) {
blockData.setOpen(attributes.contains(attribute));
}
}

Datei anzeigen

@ -1,54 +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.impl;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.Axis;
import org.bukkit.block.data.Orientable;
import java.util.List;
import java.util.Set;
@Linked
public class OrientableAttribute implements BlockAttribute<Orientable> {
private String attribute = "§8-§7 orientation ";
@Override
public Class<Orientable> type() {
return Orientable.class;
}
@Override
public void copy(List<String> attributes, Orientable blockData) {
attributes.add(attribute + blockData.getAxis().name().toLowerCase());
}
@Override
public void paste(Set<String> attributes, Orientable blockData) {
for (Axis axis : Axis.values()) {
if (attributes.contains(attribute + axis.name().toLowerCase())) {
blockData.setAxis(axis);
return;
}
}
}
}

Datei anzeigen

@ -1,53 +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.impl;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.data.Rail;
import java.util.List;
import java.util.Set;
@Linked
public class RailAttribute implements BlockAttribute<Rail> {
private String attribute = "§8-§7 rail shape ";
@Override
public Class<Rail> type() {
return Rail.class;
}
@Override
public void copy(List<String> attributes, Rail blockData) {
attributes.add(attribute + blockData.getShape().name().toLowerCase());
}
@Override
public void paste(Set<String> attributes, Rail blockData) {
for (Rail.Shape shape : Rail.Shape.values()) {
if (attributes.contains(attribute + shape)) {
blockData.setShape(shape);
return;
}
}
}
}

Datei anzeigen

@ -1,54 +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.impl;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.BlockFace;
import org.bukkit.block.data.Rotatable;
import java.util.List;
import java.util.Set;
@Linked
public class RotatableAttribute implements BlockAttribute<Rotatable> {
private String attribute = "§8-§7 rotation ";
@Override
public Class<Rotatable> type() {
return Rotatable.class;
}
@Override
public void copy(List<String> attributes, Rotatable blockData) {
attributes.add(attribute + blockData.getRotation().name());
}
@Override
public void paste(Set<String> attributes, Rotatable blockData) {
for (BlockFace face : BlockFace.values()) {
if (attributes.contains(attribute + face.name())) {
blockData.setRotation(face);
return;
}
}
}
}

Datei anzeigen

@ -1,48 +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.impl;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.data.Snowable;
import java.util.List;
import java.util.Set;
@Linked
public class SnowableAttribute implements BlockAttribute<Snowable> {
private String attribute = "§8-§7 snowy";
@Override
public Class<Snowable> type() {
return Snowable.class;
}
@Override
public void copy(List<String> attributes, Snowable blockData) {
if (blockData.isSnowy()) attributes.add(attribute);
}
@Override
public void paste(Set<String> attributes, Snowable blockData) {
blockData.setSnowy(attributes.contains(attribute));
}
}

Datei anzeigen

@ -1,49 +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.impl;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.data.Waterlogged;
import java.util.List;
import java.util.Set;
@Linked
public class WaterloggedAttribute implements BlockAttribute<Waterlogged> {
private String attribute = "§8-§7 waterlogged";
@Override
public Class<Waterlogged> type() {
return Waterlogged.class;
}
@Override
public void copy(List<String> attributes, Waterlogged waterlogged) {
if (!waterlogged.isWaterlogged()) return;
attributes.add(attribute);
}
@Override
public void paste(Set<String> attributes, Waterlogged waterlogged) {
waterlogged.setWaterlogged(attributes.contains(attribute));
}
}

Datei anzeigen

@ -1,53 +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.impl.type;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.data.type.Bamboo;
import java.util.List;
import java.util.Set;
@Linked
public class BambooAttribute implements BlockAttribute<Bamboo> {
private String attribute = "§8-§7 leaves ";
@Override
public Class<Bamboo> type() {
return Bamboo.class;
}
@Override
public void copy(List<String> attributes, Bamboo blockData) {
attributes.add(attribute + blockData.getLeaves());
}
@Override
public void paste(Set<String> attributes, Bamboo blockData) {
for (Bamboo.Leaves leaves : Bamboo.Leaves.values()) {
if (attributes.contains(attribute + leaves)) {
blockData.setLeaves(leaves);
return;
}
}
}
}

Datei anzeigen

@ -1,53 +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.impl.type;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.data.type.Bell;
import java.util.List;
import java.util.Set;
@Linked
public class BellAttribute implements BlockAttribute<Bell> {
private String attribute = "§8-§7 attachament ";
@Override
public Class<Bell> type() {
return Bell.class;
}
@Override
public void copy(List<String> attributes, Bell blockData) {
attributes.add(attribute + blockData.getAttachment());
}
@Override
public void paste(Set<String> attributes, Bell blockData) {
for (Bell.Attachment attachment : Bell.Attachment.values()) {
if (attributes.contains(attribute + attachment)) {
blockData.setAttachment(attachment);
return;
}
}
}
}

Datei anzeigen

@ -1,55 +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.impl.type;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import de.steamwar.linkage.MinVersion;
import org.bukkit.block.data.type.BigDripleaf;
import java.util.List;
import java.util.Set;
@Linked
@MinVersion(18)
public class BigDripleafAttribute implements BlockAttribute<BigDripleaf> {
private String attribute = "§8-§7 tilt ";
@Override
public Class<BigDripleaf> type() {
return BigDripleaf.class;
}
@Override
public void copy(List<String> attributes, BigDripleaf blockData) {
attributes.add(attribute + blockData.getTilt());
}
@Override
public void paste(Set<String> attributes, BigDripleaf blockData) {
for (BigDripleaf.Tilt tilt : BigDripleaf.Tilt.values()) {
if (attributes.contains(attribute + tilt)) {
blockData.setTilt(tilt);
return;
}
}
}
}

Datei anzeigen

@ -1,53 +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.impl.type;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.data.type.Cake;
import java.util.List;
import java.util.Set;
@Linked
public class CakeAttribute implements BlockAttribute<Cake> {
private String attribute = "§8-§7 bites ";
@Override
public Class<Cake> type() {
return Cake.class;
}
@Override
public void copy(List<String> attributes, Cake blockData) {
attributes.add(attribute + blockData.getBites());
}
@Override
public void paste(Set<String> attributes, Cake blockData) {
attributes.stream()
.filter(s -> s.startsWith(attribute))
.map(s -> s.replace(attribute, ""))
.map(Integer::parseInt)
.findFirst()
.ifPresent(blockData::setBites);
}
}

Datei anzeigen

@ -1,48 +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.impl.type;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.data.type.Campfire;
import java.util.List;
import java.util.Set;
@Linked
public class CampfireAttribute implements BlockAttribute<Campfire> {
private String attribute = "§8-§7 signal fire";
@Override
public Class<Campfire> type() {
return Campfire.class;
}
@Override
public void copy(List<String> attributes, Campfire blockData) {
if (blockData.isSignalFire()) attributes.add(attribute);
}
@Override
public void paste(Set<String> attributes, Campfire blockData) {
blockData.setSignalFire(attributes.contains(attribute));
}
}

Datei anzeigen

@ -1,53 +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.impl.type;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.data.type.Candle;
import java.util.List;
import java.util.Set;
@Linked
public class CandleAttribute implements BlockAttribute<Candle> {
private String attribute = "§8-§7 candles ";
@Override
public Class<Candle> type() {
return Candle.class;
}
@Override
public void copy(List<String> attributes, Candle blockData) {
if (blockData.getCandles() > 0) attributes.add(attribute + blockData.getCandles());
}
@Override
public void paste(Set<String> attributes, Candle blockData) {
attributes.stream()
.filter(s -> s.startsWith(attribute))
.map(s -> s.replace(attribute, ""))
.map(Integer::parseInt)
.findFirst()
.ifPresent(blockData::setCandles);
}
}

Datei anzeigen

@ -1,48 +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.impl.type;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.data.type.CaveVinesPlant;
import java.util.List;
import java.util.Set;
@Linked
public class CaveVinesPlantAttribute implements BlockAttribute<CaveVinesPlant> {
private String attribute = "§8-§7 berries";
@Override
public Class<CaveVinesPlant> type() {
return CaveVinesPlant.class;
}
@Override
public void copy(List<String> attributes, CaveVinesPlant blockData) {
if (blockData.isBerries()) attributes.add(attribute);
}
@Override
public void paste(Set<String> attributes, CaveVinesPlant blockData) {
blockData.setBerries(attributes.contains(attribute));
}
}

Datei anzeigen

@ -1,53 +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.impl.type;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.data.type.Comparator;
import java.util.List;
import java.util.Set;
@Linked
public class ComparatorAttribute implements BlockAttribute<Comparator> {
private String attribute = "§8-§7 mode ";
@Override
public Class<Comparator> type() {
return Comparator.class;
}
@Override
public void copy(List<String> attributes, Comparator blockData) {
attributes.add(attribute + blockData.getMode().name());
}
@Override
public void paste(Set<String> attributes, Comparator blockData) {
for (Comparator.Mode mode : Comparator.Mode.values()) {
if (attributes.contains(attribute + mode.name())) {
blockData.setMode(mode);
return;
}
}
}
}

Datei anzeigen

@ -1,48 +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.impl.type;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.data.type.DaylightDetector;
import java.util.List;
import java.util.Set;
@Linked
public class DaylightDetectorAttribute implements BlockAttribute<DaylightDetector> {
private String attribute = "§8-§7 inverted";
@Override
public Class<DaylightDetector> type() {
return DaylightDetector.class;
}
@Override
public void copy(List<String> attributes, DaylightDetector blockData) {
if (blockData.isInverted()) attributes.add(attribute);
}
@Override
public void paste(Set<String> attributes, DaylightDetector blockData) {
blockData.setInverted(attributes.contains(attribute));
}
}

Datei anzeigen

@ -1,53 +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.impl.type;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.data.type.Door;
import java.util.List;
import java.util.Set;
@Linked
public class DoorAttribute implements BlockAttribute<Door> {
private String attribute = "§8-§7 hinge ";
@Override
public Class<Door> type() {
return Door.class;
}
@Override
public void copy(List<String> attributes, Door blockData) {
attributes.add(attribute + blockData.getHinge().toString().toLowerCase());
}
@Override
public void paste(Set<String> attributes, Door blockData) {
for (Door.Hinge hinge : Door.Hinge.values()) {
if (attributes.contains(attribute + hinge.toString().toLowerCase())) {
blockData.setHinge(hinge);
break;
}
}
}
}

Datei anzeigen

@ -1,48 +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.impl.type;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.data.type.EndPortalFrame;
import java.util.List;
import java.util.Set;
@Linked
public class EndPortalFrameAttribute implements BlockAttribute<EndPortalFrame> {
private String attribute = "§8-§7 eye";
@Override
public Class<EndPortalFrame> type() {
return EndPortalFrame.class;
}
@Override
public void copy(List<String> attributes, EndPortalFrame blockData) {
if (blockData.hasEye()) attributes.add(attribute);
}
@Override
public void paste(Set<String> attributes, EndPortalFrame blockData) {
blockData.setEye(attributes.contains(attribute));
}
}

Datei anzeigen

@ -1,53 +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.impl.type;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.data.type.Farmland;
import java.util.List;
import java.util.Set;
@Linked
public class FarmlandAttribute implements BlockAttribute<Farmland> {
private String attribute = "§8-§7 moisture ";
@Override
public Class<Farmland> type() {
return Farmland.class;
}
@Override
public void copy(List<String> attributes, Farmland blockData) {
attributes.add(attribute + blockData.getMoisture());
}
@Override
public void paste(Set<String> attributes, Farmland blockData) {
attributes.stream()
.filter(s -> s.startsWith(attribute))
.map(s -> s.replace(attribute, ""))
.map(Integer::parseInt)
.findFirst()
.ifPresent(blockData::setMoisture);
}
}

Datei anzeigen

@ -1,48 +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.impl.type;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.data.type.Gate;
import java.util.List;
import java.util.Set;
@Linked
public class GateAttribute implements BlockAttribute<Gate> {
private String attribute = "§8-§7 inWall";
@Override
public Class<Gate> type() {
return Gate.class;
}
@Override
public void copy(List<String> attributes, Gate blockData) {
if (blockData.isInWall()) attributes.add(attribute);
}
@Override
public void paste(Set<String> attributes, Gate blockData) {
blockData.setInWall(attributes.contains(attribute));
}
}

Datei anzeigen

@ -1,48 +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.impl.type;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.data.type.Hopper;
import java.util.List;
import java.util.Set;
@Linked
public class HopperAttribute implements BlockAttribute<Hopper> {
private String attribute = "§8-§7 enabled";
@Override
public Class<Hopper> type() {
return Hopper.class;
}
@Override
public void copy(List<String> attributes, Hopper blockData) {
if (blockData.isEnabled()) attributes.add(attribute);
}
@Override
public void paste(Set<String> attributes, Hopper blockData) {
blockData.setEnabled(attributes.contains(attribute));
}
}

Datei anzeigen

@ -1,53 +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.impl.type;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.data.type.Jigsaw;
import java.util.List;
import java.util.Set;
@Linked
public class JigsawAttribute implements BlockAttribute<Jigsaw> {
private String attribute = "§8-§7 orientation ";
@Override
public Class<Jigsaw> type() {
return Jigsaw.class;
}
@Override
public void copy(List<String> attributes, Jigsaw blockData) {
attributes.add(attribute + blockData.getOrientation());
}
@Override
public void paste(Set<String> attributes, Jigsaw blockData) {
for (Jigsaw.Orientation orientation : Jigsaw.Orientation.values()) {
if (attributes.contains(attribute + orientation)) {
blockData.setOrientation(orientation);
return;
}
}
}
}

Datei anzeigen

@ -1,49 +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.impl.type;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.data.type.Lantern;
import java.util.List;
import java.util.Set;
@Linked
public class LanternAttribute implements BlockAttribute<Lantern> {
private String attribute = "§8-§7 lantern";
@Override
public Class<Lantern> type() {
return Lantern.class;
}
@Override
public void copy(List<String> attributes, Lantern lantern) {
if (!lantern.isHanging()) return;
attributes.add(attribute);
}
@Override
public void paste(Set<String> attributes, Lantern lantern) {
lantern.setHanging(attributes.contains(attribute));
}
}

Datei anzeigen

@ -1,48 +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.impl.type;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.data.type.Leaves;
import java.util.List;
import java.util.Set;
@Linked
public class LeavesAttribute implements BlockAttribute<Leaves> {
private String attribute = "§8-§7 persistent";
@Override
public Class<Leaves> type() {
return Leaves.class;
}
@Override
public void copy(List<String> attributes, Leaves blockData) {
if (blockData.isPersistent()) attributes.add(attribute);
}
@Override
public void paste(Set<String> attributes, Leaves blockData) {
blockData.setPersistent(attributes.contains(attribute));
}
}

Datei anzeigen

@ -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.features.attributescopy.impl.type;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.BlockFace;
import org.bukkit.block.data.type.PointedDripstone;
import java.util.List;
import java.util.Set;
@Linked
public class PointedDripstoneAttribute implements BlockAttribute<PointedDripstone> {
private String attribute1 = "§8-§7 vertialDirection ";
private String attribute2 = "§8-§7 thickness ";
@Override
public Class<PointedDripstone> type() {
return PointedDripstone.class;
}
@Override
public void copy(List<String> attributes, PointedDripstone blockData) {
attributes.add(attribute1 + " " + blockData.getVerticalDirection().name().toLowerCase());
attributes.add(attribute2 + " " + blockData.getThickness().name().toLowerCase());
}
@Override
public void paste(Set<String> attributes, PointedDripstone blockData) {
for (BlockFace blockFace : blockData.getVerticalDirections()) {
if (attributes.contains(attribute1 + " " + blockFace.name().toLowerCase())) {
blockData.setVerticalDirection(blockFace);
break;
}
}
for (PointedDripstone.Thickness thickness : PointedDripstone.Thickness.values()) {
if (attributes.contains(attribute2 + " " + thickness.name().toLowerCase())) {
blockData.setThickness(thickness);
break;
}
}
}
}

Datei anzeigen

@ -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.features.attributescopy.impl.type;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.BlockFace;
import org.bukkit.block.data.type.RedstoneWire;
import java.util.List;
import java.util.Set;
@Linked
public class RedstoneWireAttribute implements BlockAttribute<RedstoneWire> {
private String attribute = "§8-§7 connection ";
@Override
public Class<RedstoneWire> type() {
return RedstoneWire.class;
}
@Override
public void copy(List<String> attributes, RedstoneWire blockData) {
for (BlockFace blockFace : blockData.getAllowedFaces()) {
attributes.add(attribute + blockFace.name().toLowerCase() + " " + blockData.getFace(blockFace).name().toLowerCase());
}
}
@Override
public void paste(Set<String> attributes, RedstoneWire blockData) {
for (BlockFace blockFace : blockData.getAllowedFaces()) {
for (RedstoneWire.Connection connection : RedstoneWire.Connection.values()) {
if (attributes.contains(attribute + blockFace.name().toLowerCase() + " " + connection.name().toLowerCase())) {
blockData.setFace(blockFace, connection);
}
}
}
}
}

Datei anzeigen

@ -1,56 +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.impl.type;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.data.type.Repeater;
import java.util.List;
import java.util.Set;
@Linked
public class RepeaterAttribute implements BlockAttribute<Repeater> {
private String attribute1 = "§8-§7 delay ";
private String attribute2 = "§8-§7 locked";
@Override
public Class<Repeater> type() {
return Repeater.class;
}
@Override
public void copy(List<String> attributes, Repeater blockData) {
attributes.add(attribute1 + blockData.getDelay());
if (blockData.isLocked()) attributes.add(attribute2);
}
@Override
public void paste(Set<String> attributes, Repeater blockData) {
attributes.stream()
.filter(s -> s.startsWith(attribute1))
.map(s -> s.replace(attribute1, ""))
.map(Integer::parseInt)
.findFirst()
.ifPresent(blockData::setDelay);
blockData.setLocked(attributes.contains(attribute2));
}
}

Datei anzeigen

@ -1,53 +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.impl.type;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.data.type.RespawnAnchor;
import java.util.List;
import java.util.Set;
@Linked
public class RespawnAnchorAttribute implements BlockAttribute<RespawnAnchor> {
private String attribute = "§8-§7 charges ";
@Override
public Class<RespawnAnchor> type() {
return RespawnAnchor.class;
}
@Override
public void copy(List<String> attributes, RespawnAnchor blockData) {
attributes.add(attribute + blockData.getCharges());
}
@Override
public void paste(Set<String> attributes, RespawnAnchor blockData) {
attributes.stream()
.filter(s -> s.startsWith(attribute))
.map(s -> s.replace(attribute, ""))
.map(Integer::parseInt)
.findFirst()
.ifPresent(blockData::setCharges);
}
}

Datei anzeigen

@ -1,53 +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.impl.type;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.data.type.Sapling;
import java.util.List;
import java.util.Set;
@Linked
public class SaplingAttribute implements BlockAttribute<Sapling> {
private String attribute = "§8-§7 stage ";
@Override
public Class<Sapling> type() {
return Sapling.class;
}
@Override
public void copy(List<String> attributes, Sapling blockData) {
attributes.add(attribute + blockData.getStage());
}
@Override
public void paste(Set<String> attributes, Sapling blockData) {
attributes.stream()
.filter(s -> s.startsWith(attribute))
.map(s -> s.replace(attribute, ""))
.map(Integer::parseInt)
.findFirst()
.ifPresent(blockData::setStage);
}
}

Datei anzeigen

@ -1,56 +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.impl.type;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.data.type.Scaffolding;
import java.util.List;
import java.util.Set;
@Linked
public class ScaffoldingAttribute implements BlockAttribute<Scaffolding> {
private String attribute1 = "§8-§7 bottom";
private String attribute2 = "§8-§7 distance ";
@Override
public Class<Scaffolding> type() {
return Scaffolding.class;
}
@Override
public void copy(List<String> attributes, Scaffolding blockData) {
if (blockData.isBottom()) attributes.add(attribute1);
attributes.add(attribute2 + blockData.getDistance());
}
@Override
public void paste(Set<String> attributes, Scaffolding blockData) {
blockData.setBottom(attributes.contains(attribute1));
attributes.stream()
.filter(s -> s.startsWith(attribute2))
.map(s -> s.replace(attribute2, ""))
.map(Integer::parseInt)
.findFirst()
.ifPresent(blockData::setDistance);
}
}

Datei anzeigen

@ -1,53 +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.impl.type;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.data.type.SculkSensor;
import java.util.List;
import java.util.Set;
@Linked
public class SculkSensorAttribute implements BlockAttribute<SculkSensor> {
private String attribute = "§8-§7 phase ";
@Override
public Class<SculkSensor> type() {
return SculkSensor.class;
}
@Override
public void copy(List<String> attributes, SculkSensor blockData) {
attributes.add(attribute + blockData.getPhase());
}
@Override
public void paste(Set<String> attributes, SculkSensor blockData) {
for (SculkSensor.Phase phase : SculkSensor.Phase.values()) {
if (attributes.contains(attribute + phase)) {
blockData.setPhase(phase);
return;
}
}
}
}

Datei anzeigen

@ -1,53 +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.impl.type;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.data.type.SeaPickle;
import java.util.List;
import java.util.Set;
@Linked
public class SeaPickleAttribute implements BlockAttribute<SeaPickle> {
private String attribute = "§8-§7 pickles ";
@Override
public Class<SeaPickle> type() {
return SeaPickle.class;
}
@Override
public void copy(List<String> attributes, SeaPickle blockData) {
attributes.add(attribute + blockData.getPickles());
}
@Override
public void paste(Set<String> attributes, SeaPickle blockData) {
attributes.stream()
.filter(s -> s.startsWith(attribute))
.map(s -> s.replace(attribute, ""))
.map(Integer::parseInt)
.findFirst()
.ifPresent(blockData::setPickles);
}
}

Datei anzeigen

@ -1,53 +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.impl.type;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.data.type.Slab;
import java.util.List;
import java.util.Set;
@Linked
public class SlabAttribute implements BlockAttribute<Slab> {
private String attribute = "§8-§7 type ";
@Override
public Class<Slab> type() {
return Slab.class;
}
@Override
public void copy(List<String> attributes, Slab blockData) {
attributes.add(attribute + blockData.getType());
}
@Override
public void paste(Set<String> attributes, Slab blockData) {
for (Slab.Type type : Slab.Type.values()) {
if (attributes.contains(attribute + type)) {
blockData.setType(type);
return;
}
}
}
}

Datei anzeigen

@ -1,53 +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.impl.type;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.data.type.Snow;
import java.util.List;
import java.util.Set;
@Linked
public class SnowAttribute implements BlockAttribute<Snow> {
private String attribute = "§8-§7 layers ";
@Override
public Class<Snow> type() {
return Snow.class;
}
@Override
public void copy(List<String> attributes, Snow blockData) {
attributes.add(attribute + blockData.getLayers());
}
@Override
public void paste(Set<String> attributes, Snow blockData) {
attributes.stream()
.filter(s -> s.startsWith(attribute))
.map(s -> s.replace(attribute, ""))
.map(Integer::parseInt)
.findFirst()
.ifPresent(blockData::setLayers);
}
}

Datei anzeigen

@ -1,53 +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.impl.type;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.data.type.Stairs;
import java.util.List;
import java.util.Set;
@Linked
public class StairsAttribute implements BlockAttribute<Stairs> {
private String attribute = "§8-§7 shape ";
@Override
public Class<Stairs> type() {
return Stairs.class;
}
@Override
public void copy(List<String> attributes, Stairs blockData) {
attributes.add(attribute + blockData.getShape().name().toLowerCase());
}
@Override
public void paste(Set<String> attributes, Stairs blockData) {
for (Stairs.Shape shape : Stairs.Shape.values()) {
if (attributes.contains(attribute + shape.name().toLowerCase())) {
blockData.setShape(shape);
return;
}
}
}
}

Datei anzeigen

@ -1,53 +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.impl.type;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.data.type.StructureBlock;
import java.util.List;
import java.util.Set;
@Linked
public class StructureBlockAttribute implements BlockAttribute<StructureBlock> {
private String attribute = "§8-§7 mode ";
@Override
public Class<StructureBlock> type() {
return StructureBlock.class;
}
@Override
public void copy(List<String> attributes, StructureBlock blockData) {
attributes.add(attribute + blockData.getMode().name());
}
@Override
public void paste(Set<String> attributes, StructureBlock blockData) {
for (StructureBlock.Mode mode : StructureBlock.Mode.values()) {
if (attributes.contains(attribute + mode.name())) {
blockData.setMode(mode);
return;
}
}
}
}

Datei anzeigen

@ -1,48 +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.impl.type;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.data.type.Tripwire;
import java.util.List;
import java.util.Set;
@Linked
public class TripwireAttribute implements BlockAttribute<Tripwire> {
private String attribute = "§8-§7 disarmed";
@Override
public Class<Tripwire> type() {
return Tripwire.class;
}
@Override
public void copy(List<String> attributes, Tripwire blockData) {
if (blockData.isDisarmed()) attributes.add(attribute);
}
@Override
public void paste(Set<String> attributes, Tripwire blockData) {
blockData.setDisarmed(attributes.contains(attribute));
}
}

Datei anzeigen

@ -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.features.attributescopy.impl.type;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.data.type.TurtleEgg;
import java.util.List;
import java.util.Set;
@Linked
public class TurtleEggAttribute implements BlockAttribute<TurtleEgg> {
private String attribute1 = "§8-§7 eggs ";
private String attribute2 = "§8-§7 hatch ";
@Override
public Class<TurtleEgg> type() {
return TurtleEgg.class;
}
@Override
public void copy(List<String> attributes, TurtleEgg blockData) {
attributes.add(attribute1 + blockData.getEggs());
attributes.add(attribute2 + blockData.getHatch());
}
@Override
public void paste(Set<String> attributes, TurtleEgg blockData) {
attributes.stream()
.filter(s -> s.startsWith(attribute1))
.map(s -> s.replace(attribute1, ""))
.map(Integer::parseInt)
.findFirst()
.ifPresent(blockData::setEggs);
attributes.stream()
.filter(s -> s.startsWith(attribute2))
.map(s -> s.replace(attribute2, ""))
.map(Integer::parseInt)
.findFirst()
.ifPresent(blockData::setHatch);
}
}

Datei anzeigen

@ -1,64 +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.impl.type;
import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
import de.steamwar.linkage.Linked;
import org.bukkit.block.BlockFace;
import org.bukkit.block.data.type.Wall;
import java.util.List;
import java.util.Set;
@Linked
public class WallAttribute implements BlockAttribute<Wall> {
private BlockFace[] faces = new BlockFace[] {BlockFace.NORTH, BlockFace.EAST, BlockFace.SOUTH, BlockFace.WEST};
private String attribute1 = "§8-§7 up";
private String attribute2 = "§8-§7 connected ";
@Override
public Class<Wall> type() {
return Wall.class;
}
@Override
public void copy(List<String> attributes, Wall blockData) {
if (blockData.isUp()) attributes.add(attribute1);
for (BlockFace face : faces) {
if (blockData.getHeight(face) == Wall.Height.NONE) continue;
attributes.add(attribute2 + face.name().toLowerCase() + " " + blockData.getHeight(face).name().toLowerCase());
}
}
@Override
public void paste(Set<String> attributes, Wall blockData) {
blockData.setUp(attributes.contains(attribute1));
for (BlockFace face : faces) {
for (Wall.Height height : Wall.Height.values()) {
if (attributes.contains(attribute2 + face.name().toLowerCase() + " " + height.name().toLowerCase())) {
blockData.setHeight(face, height);
break;
}
}
}
}
}

Datei anzeigen

@ -88,7 +88,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.currentTick.get()); regionStartTime.put(region, TPSUtils.currentRealTick.get());
} }
@EventHandler @EventHandler
@ -101,7 +101,7 @@ public class AutostartListener implements Listener {
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.currentTick.get() - regionStartTime.remove(region); long tickDiff = TPSUtils.currentRealTick.get() - regionStartTime.remove(region);
RegionUtils.message(region, player -> { RegionUtils.message(region, player -> {
return BauSystem.MESSAGE.parse("AUTOSTART_MESSAGE_RESULT1", player, new SimpleDateFormat(BauSystem.MESSAGE.parse("AUTOSTART_MESSAGE_DATE_PATTERN", player)).format(new Date(tickDiff * 50))); return BauSystem.MESSAGE.parse("AUTOSTART_MESSAGE_RESULT1", player, new SimpleDateFormat(BauSystem.MESSAGE.parse("AUTOSTART_MESSAGE_DATE_PATTERN", player)).format(new Date(tickDiff * 50)));
}); });

Datei anzeigen

@ -25,6 +25,7 @@ import de.steamwar.bausystem.config.BauServer;
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.linkage.Linked;
import de.steamwar.sql.SteamwarUser; import de.steamwar.sql.SteamwarUser;
@ -58,6 +59,9 @@ 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)));

Datei anzeigen

@ -0,0 +1,99 @@
/*
* 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.Listener;
import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.util.Vector;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Linked
public class CannonDetector implements Listener {
private Map<TNTPrimed, Vector> velocities = new HashMap<>();
@EventHandler
public void onEntityExplode(EntityExplodeEvent event) {
if (!(event.getEntity() instanceof TNTPrimed)) {
return;
}
TNTPrimed tnt = (TNTPrimed) event.getEntity();
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());
});
if (!isEmpty) {
return;
}
BauSystem.runTaskLater(BauSystem.getInstance(), () -> {
Map<CannonKey, List<TNTPrimed>> grouped = new HashMap<>();
velocities.forEach((tntPrimed, vector) -> {
grouped.computeIfAbsent(new CannonKey(round(tntPrimed.getLocation().toVector()), round(vector)), 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);
}
private Vector round(Vector vector) {
vector.multiply(10000);
vector.setX(Math.round(vector.getX()));
vector.setY(Math.round(vector.getY()));
vector.setZ(Math.round(vector.getZ()));
return vector;
}
}

Datei anzeigen

@ -0,0 +1,33 @@
/*
* 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.util.Vector;
@AllArgsConstructor
@EqualsAndHashCode
@Getter
public final class CannonKey {
private Vector locationVector;
private Vector velocityVector;
}

Datei anzeigen

@ -0,0 +1,110 @@
/*
* 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());
if (blocksList.isEmpty()) return;
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);
}
}

Datei anzeigen

@ -0,0 +1,48 @@
/*
* 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();
}
}

Datei anzeigen

@ -0,0 +1,109 @@
/*
* 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 List<Player> players = new ArrayList<>();
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();
}
private 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);
// calc(minX, minY, minZ, maxX, minY, maxZ, 0, 1, 0, maxY - minY);
calc(minX, maxY, minZ, maxX, maxY, maxZ, 0, -1, 0, maxY - minY);
}
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.END_STONE || material == Material.END_STONE_BRICKS || material == Material.END_STONE_BRICK_SLAB || material == Material.END_STONE_BRICK_STAIRS || material == Material.END_STONE_BRICK_WALL) {
Location location = new Location(WORLD, cx + 0.5, cy, cz + 0.5);
if (locations.contains(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()) {
break;
}
}
}
}
}
}
public void toggle(Player player) {
if (players.contains(player)) {
players.remove(player);
entityServer.removePlayer(player);
BauSystem.MESSAGE.send("DESIGN_ENDSTONE_DISABLE", player, ChatMessageType.ACTION_BAR);
} else {
players.add(player);
entityServer.addPlayer(player);
calc();
BauSystem.MESSAGE.send("DESIGN_ENDSTONE_ENABLE", player, ChatMessageType.ACTION_BAR);
}
}
}

Datei anzeigen

@ -0,0 +1,50 @@
/*
* 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.command.SWCommand;
import de.steamwar.linkage.Linked;
import org.bukkit.entity.Player;
import java.util.HashMap;
import java.util.Map;
@Linked
public class DesignEndStoneCommand extends SWCommand {
public DesignEndStoneCommand() {
super("designendstone");
}
private Map<Region, DesignEndStone> designEndStoneMap = new HashMap<>();
@Register(description = "DESIGN_ENDSTONE_COMMAND_HELP")
public void genericCommand(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);
}
}

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden Mehr anzeigen