SteamWar/BauSystem2.0
Archiviert
12
0

Merge remote-tracking branch 'origin/master'
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2022-08-26 20:10:12 +02:00
Commit 948c19167a
16 geänderte Dateien mit 38 neuen und 71 gelöschten Zeilen

Datei anzeigen

@ -123,37 +123,22 @@ public class FlatteningWrapper15 implements FlatteningWrapper {
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 final Map<String, Long> timing = new HashMap<>();
private void start(String name) {
timing.put(name, System.currentTimeMillis());
}
private long stop(String name) {
return System.currentTimeMillis() - timing.getOrDefault(name, System.currentTimeMillis());
}
@Override
public EditSession paste(File file, Point pastePoint, PasteOptions pasteOptions) {
start("clipboardLoad");
Clipboard clipboard;
try (ClipboardReader reader = Objects.requireNonNull(ClipboardFormats.findByFile(file)).getReader(new FileInputStream(file))) {
clipboard = reader.read();
} catch (NullPointerException | IOException e) {
throw new SecurityException("Bausystem schematic not found", e);
}
System.out.println("Clipboard Load: " + stop("clipboardLoad"));
start("paste");
EditSession editSession = paste(clipboard, pastePoint, pasteOptions);
System.out.println("Paste: " + stop("paste"));
return editSession;
}
@Override
public EditSession paste(Clipboard clipboard, Point pastePoint, PasteOptions pasteOptions) {
try (EditSession e = WorldEdit.getInstance().getEditSessionFactory().getEditSession(new BukkitWorld(Bukkit.getWorlds().get(0)), -1)) {
start("changeColor");
if (pasteOptions.getColor() != Color.YELLOW) {
changeColor(clipboard, pasteOptions.getColor());
}
@ -187,9 +172,7 @@ public class FlatteningWrapper15 implements FlatteningWrapper {
}
});
}
System.out.println("ChangeColor: " + stop("changeColor"));
start("transform");
ClipboardHolder ch = new ClipboardHolder(clipboard);
BlockVector3 dimensions = clipboard.getDimensions();
BlockVector3 v = BlockVector3.at(pastePoint.getX(), pastePoint.getY(), pastePoint.getZ());
@ -200,19 +183,14 @@ public class FlatteningWrapper15 implements FlatteningWrapper {
} else {
v = v.subtract(dimensions.getX() / 2, 0, dimensions.getZ() / 2).subtract(offset);
}
System.out.println("Transform: " + stop("transform"));
start("reset");
if (pasteOptions.isReset()) {
e.setBlocks((Region) new CuboidRegion(toBlockVector3(pasteOptions.getMinPoint()), toBlockVector3(pasteOptions.getMaxPoint())), Objects.requireNonNull(BlockTypes.AIR).getDefaultState().toBaseBlock());
if (pasteOptions.getWaterLevel() != 0) {
e.setBlocks((Region) new CuboidRegion(toBlockVector3(pasteOptions.getMinPoint()), toBlockVector3(pasteOptions.getMaxPoint()).withY(pasteOptions.getWaterLevel())), Objects.requireNonNull(BlockTypes.WATER).getDefaultState().toBaseBlock());
}
}
System.out.println("Reset: " + stop("reset"));
start("operation");
Operations.completeBlindly(ch.createPaste(e).to(v).ignoreAirBlocks(pasteOptions.isIgnoreAir()).build());
System.out.println("Operation: " + stop("operation"));
return e;
} catch (WorldEditException e) {
throw new SecurityException(e.getMessage(), e);

Datei anzeigen

@ -148,7 +148,7 @@ BAU_INFO_COMMAND_TPS = TPS:§e
# Countingwand
COUNTINGWAND_COMMAND_HELP = §8/§ecountingwand §8- §7Receive a CountingWand
COUNTINGWAND_ITEM_NAME = §eFolding rule
COUNTINGWAND_ITEM_NAME = §eMeterstick
COUNTINGWAND_ITEM_LORE1 = §eLeft-Click §8- §7Set the first position
COUNTINGWAND_ITEM_LORE2 = §eRicht-Click §8- §7Set the second position
COUNTINGWAND_MESSAGE_RCLICK = §7First position at: §8[§7{0}§8, §7{1}§8, §7{2}§8] ({3}§8) ({4}§8)
@ -527,7 +527,7 @@ SIMULATOR_EDIT_GROUP_MENU = §eEdit group
SIMULATOR_WAND_NAME = §eSimulator
SIMULATOR_WAND_NAME_SELECTED = §7Simulator §8- §e{0}
SIMULATOR_WAND_LORE_1 = §eRight click §8- §7adds a position
SIMULATOR_WAND_LORE_1 = §eRight click §8- §7Adds a position
SIMULATOR_WAND_LORE_2 = §eSneaking §8- §7Free movement
SIMULATOR_WAND_LORE_3 = §eLeft click §8- §7Start the simulation
SIMULATOR_WAND_LORE_4 = §eRight click in air §8- §7Opens the gui
@ -808,7 +808,7 @@ LOADER_STOP=§7The Loader has been stopped.
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 to small
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.
@ -1063,7 +1063,7 @@ REGION_TNT_HELP=§8/§etnt §8- §7Change the TNT behaviour
REGION_TNT_HELP_MODE=§8/§etnt §8[§7Mode§8] §8- §7Set TNT behaviour to a given mode
REGION_TNT_ON=§aTNT-Damage activated
REGION_TNT_OFF=§cTNT-Damage deactivated
REGION_TNT_TB=§aTNT-Damage activated outside of the biulding area
REGION_TNT_TB=§aTNT-Damage activated outside the building area
REGION_TNT_NO_PERMS=§cYou are not allowed to toggle tnt damage here
REGION_TNT_BUILD=§cAn explosion would have destroyed blocks in the building area
# Team

Datei anzeigen

@ -189,13 +189,6 @@ public class Detonator {
}
static Detoblock getBlock(Block block) {
if (block.getType() == Material.STONE_BUTTON) {
return Detoblock.STONE_BUTTON;
}
if (block.getType() == Material.HEAVY_WEIGHTED_PRESSURE_PLATE || block.getType() == Material.LIGHT_WEIGHTED_PRESSURE_PLATE) {
return Detoblock.WEIGHTED_PRESSURE_PLATE;
}
switch (block.getType()) {
case LEVER:
return Detoblock.SWITCH;
@ -205,16 +198,19 @@ public class Detonator {
return Detoblock.NOTEBLOCK;
case DAYLIGHT_DETECTOR:
return Detoblock.DAYLIGHTSENSOR;
case HEAVY_WEIGHTED_PRESSURE_PLATE:
case LIGHT_WEIGHTED_PRESSURE_PLATE:
return Detoblock.WEIGHTED_PRESSURE_PLATE;
default:
if (block.getBlockData() instanceof Powerable) {
if (block.getType().name().contains("STONE_BUTTON")) {
return Detoblock.STONE_BUTTON;
} else if (block.getType().name().contains("BUTTON")) {
return Detoblock.WOOD_BUTTON;
} else if (block.getType().name().contains("PRESSURE_PLATE")) {
return Detoblock.PRESSURE_PLATE;
} else if (block.getBlockData() instanceof Powerable) {
return Detoblock.POWERABLE;
} else {
if (block.getType().name().contains("BUTTON")) {
return Detoblock.WOOD_BUTTON;
}
if (block.getType().name().contains("PRESSURE_PLATE")) {
return Detoblock.PRESSURE_PLATE;
}
return Detoblock.INVALID;
}
}

Datei anzeigen

@ -56,7 +56,6 @@ public class BauGUI {
if (ITEMS.containsKey(item.getId())) {
throw new IllegalArgumentException("Duplicate Id Key: " + item.getId() + ". From Classes: " + ITEMS.get(item.getId()).getClass().getName() + " and " + item.getClass().getName());
}
System.out.println("Added Item: " + item.getId());
ITEMS.put(item.getId(), item);
}

Datei anzeigen

@ -245,6 +245,8 @@ public class BlockBoundingBox {
eastTrapDoor.setFacing(BlockFace.EAST);
eastTrapDoor.setOpen(true);
addPixel(eastTrapDoor, 0, 0, 0, 3, 16, 16, createItem("LAUFBAU_BLOCK_IRON_TRAPDOOR", Material.IRON_TRAPDOOR, "LAUFBAU_FACING_EAST", "LAUFBAU_OPEN"));
LaufbauLazyInit.init();
}
private static void addPixel(BlockData blockData, double xPixel, double yPixel, double zPixel, double dxPixel, double dyPixel, double dzPixel, SWItem swItem) {

Datei anzeigen

@ -0,0 +1,22 @@
package de.steamwar.bausystem.features.slaves.laufbau;
import de.steamwar.bausystem.features.slaves.laufbau.boundingboxes.*;
public class LaufbauLazyInit {
public static void init() {
}
static {
new BellBoundingBox();
new BrewingStandBoundingBox();
new ChorusPlantBoundingBox();
new FencesBoundingBox();
new GrindstoneBoundingBox();
new HopperBoundingBox();
new IronBarBoundingBox();
new LanternBoundingBox();
new StairBoundingBox();
new WallBoundingBox();
}
}

Datei anzeigen

@ -22,8 +22,6 @@ package de.steamwar.bausystem.features.slaves.laufbau.boundingboxes;
import de.steamwar.bausystem.features.slaves.laufbau.BlockBoundingBox;
import de.steamwar.bausystem.features.slaves.laufbau.Cuboid;
import de.steamwar.bausystem.linkage.Enable;
import de.steamwar.bausystem.linkage.LinkageType;
import de.steamwar.bausystem.linkage.Linked;
import org.bukkit.Material;
import org.bukkit.block.BlockFace;
import org.bukkit.block.data.type.Bell;
@ -34,7 +32,6 @@ import java.util.List;
import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.createItem;
import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.pixelCuboid;
@Linked(LinkageType.ENABLE_LINK)
public class BellBoundingBox implements Enable {
@Override

Datei anzeigen

@ -22,8 +22,6 @@ package de.steamwar.bausystem.features.slaves.laufbau.boundingboxes;
import de.steamwar.bausystem.features.slaves.laufbau.BlockBoundingBox;
import de.steamwar.bausystem.features.slaves.laufbau.Cuboid;
import de.steamwar.bausystem.linkage.Enable;
import de.steamwar.bausystem.linkage.LinkageType;
import de.steamwar.bausystem.linkage.Linked;
import org.bukkit.Material;
import org.bukkit.block.data.type.BrewingStand;
@ -33,7 +31,6 @@ import java.util.List;
import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.createItem;
import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.pixelCuboid;
@Linked(LinkageType.ENABLE_LINK)
public class BrewingStandBoundingBox implements Enable {
@Override

Datei anzeigen

@ -22,8 +22,6 @@ package de.steamwar.bausystem.features.slaves.laufbau.boundingboxes;
import de.steamwar.bausystem.features.slaves.laufbau.BlockBoundingBox;
import de.steamwar.bausystem.features.slaves.laufbau.Cuboid;
import de.steamwar.bausystem.linkage.Enable;
import de.steamwar.bausystem.linkage.LinkageType;
import de.steamwar.bausystem.linkage.Linked;
import org.bukkit.Material;
import org.bukkit.block.BlockFace;
import org.bukkit.block.data.MultipleFacing;
@ -34,7 +32,6 @@ import java.util.List;
import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.createItem;
import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.pixelCuboid;
@Linked(LinkageType.ENABLE_LINK)
public class ChorusPlantBoundingBox implements Enable {
@Override

Datei anzeigen

@ -22,8 +22,6 @@ package de.steamwar.bausystem.features.slaves.laufbau.boundingboxes;
import de.steamwar.bausystem.features.slaves.laufbau.BlockBoundingBox;
import de.steamwar.bausystem.features.slaves.laufbau.Cuboid;
import de.steamwar.bausystem.linkage.Enable;
import de.steamwar.bausystem.linkage.LinkageType;
import de.steamwar.bausystem.linkage.Linked;
import org.bukkit.Material;
import org.bukkit.block.BlockFace;
import org.bukkit.block.data.type.Fence;
@ -34,7 +32,6 @@ import java.util.List;
import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.createItem;
import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.pixelCuboid;
@Linked(LinkageType.ENABLE_LINK)
public class FencesBoundingBox implements Enable {
@Override

Datei anzeigen

@ -22,8 +22,6 @@ package de.steamwar.bausystem.features.slaves.laufbau.boundingboxes;
import de.steamwar.bausystem.features.slaves.laufbau.BlockBoundingBox;
import de.steamwar.bausystem.features.slaves.laufbau.Cuboid;
import de.steamwar.bausystem.linkage.Enable;
import de.steamwar.bausystem.linkage.LinkageType;
import de.steamwar.bausystem.linkage.Linked;
import org.bukkit.Material;
import org.bukkit.block.BlockFace;
import org.bukkit.block.data.FaceAttachable;
@ -35,7 +33,6 @@ import java.util.List;
import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.createItem;
import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.pixelCuboid;
@Linked(LinkageType.ENABLE_LINK)
public class GrindstoneBoundingBox implements Enable {
@Override

Datei anzeigen

@ -22,8 +22,6 @@ package de.steamwar.bausystem.features.slaves.laufbau.boundingboxes;
import de.steamwar.bausystem.features.slaves.laufbau.BlockBoundingBox;
import de.steamwar.bausystem.features.slaves.laufbau.Cuboid;
import de.steamwar.bausystem.linkage.Enable;
import de.steamwar.bausystem.linkage.LinkageType;
import de.steamwar.bausystem.linkage.Linked;
import org.bukkit.Material;
import org.bukkit.block.BlockFace;
import org.bukkit.block.data.type.Hopper;
@ -34,7 +32,6 @@ import java.util.List;
import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.createItem;
import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.pixelCuboid;
@Linked(LinkageType.ENABLE_LINK)
public class HopperBoundingBox implements Enable {
@Override

Datei anzeigen

@ -22,8 +22,6 @@ package de.steamwar.bausystem.features.slaves.laufbau.boundingboxes;
import de.steamwar.bausystem.features.slaves.laufbau.BlockBoundingBox;
import de.steamwar.bausystem.features.slaves.laufbau.Cuboid;
import de.steamwar.bausystem.linkage.Enable;
import de.steamwar.bausystem.linkage.LinkageType;
import de.steamwar.bausystem.linkage.Linked;
import org.bukkit.Material;
import org.bukkit.block.BlockFace;
import org.bukkit.block.data.type.Fence;
@ -34,7 +32,6 @@ import java.util.List;
import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.createItem;
import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.pixelCuboid;
@Linked(LinkageType.ENABLE_LINK)
public class IronBarBoundingBox implements Enable {
@Override

Datei anzeigen

@ -22,8 +22,6 @@ package de.steamwar.bausystem.features.slaves.laufbau.boundingboxes;
import de.steamwar.bausystem.features.slaves.laufbau.BlockBoundingBox;
import de.steamwar.bausystem.features.slaves.laufbau.Cuboid;
import de.steamwar.bausystem.linkage.Enable;
import de.steamwar.bausystem.linkage.LinkageType;
import de.steamwar.bausystem.linkage.Linked;
import org.bukkit.Material;
import org.bukkit.block.data.type.Lantern;
@ -33,7 +31,6 @@ import java.util.List;
import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.createItem;
import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.pixelCuboid;
@Linked(LinkageType.ENABLE_LINK)
public class LanternBoundingBox implements Enable {
@Override

Datei anzeigen

@ -22,8 +22,6 @@ package de.steamwar.bausystem.features.slaves.laufbau.boundingboxes;
import de.steamwar.bausystem.features.slaves.laufbau.BlockBoundingBox;
import de.steamwar.bausystem.features.slaves.laufbau.Cuboid;
import de.steamwar.bausystem.linkage.Enable;
import de.steamwar.bausystem.linkage.LinkageType;
import de.steamwar.bausystem.linkage.Linked;
import org.bukkit.Material;
import org.bukkit.block.BlockFace;
import org.bukkit.block.data.type.Stairs;
@ -34,7 +32,6 @@ import java.util.List;
import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.createItem;
import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.pixelCuboid;
@Linked(LinkageType.ENABLE_LINK)
public class StairBoundingBox implements Enable {
@Override

Datei anzeigen

@ -22,8 +22,6 @@ package de.steamwar.bausystem.features.slaves.laufbau.boundingboxes;
import de.steamwar.bausystem.features.slaves.laufbau.BlockBoundingBox;
import de.steamwar.bausystem.features.slaves.laufbau.Cuboid;
import de.steamwar.bausystem.linkage.Enable;
import de.steamwar.bausystem.linkage.LinkageType;
import de.steamwar.bausystem.linkage.Linked;
import de.steamwar.core.Core;
import org.bukkit.Material;
import org.bukkit.block.BlockFace;
@ -36,7 +34,6 @@ import java.util.List;
import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.createItem;
import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.pixelCuboid;
@Linked(LinkageType.ENABLE_LINK)
public class WallBoundingBox implements Enable {
@Override