SteamWar/BauSystem2.0
Archiviert
12
0

Update some stuff
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed

Add Initial GUI stuff

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2022-02-06 18:06:20 +01:00
Ursprung db88a91085
Commit dc277b052a
15 geänderte Dateien mit 180 neuen und 70 gelöschten Zeilen

Datei anzeigen

@ -1118,6 +1118,7 @@ PANZERN_DONE = §aZuende gepanzert
# Laufbau # Laufbau
LAUFBAU_HELP = §8/§elaufbau §8[§7smallest§8|§7blastresistant§8] §8- §7Baue einen Lauf in deiner WorldEdit Auswahl mit den Traces LAUFBAU_HELP = §8/§elaufbau §8[§7smallest§8|§7blastresistant§8] §8- §7Baue einen Lauf in deiner WorldEdit Auswahl mit den Traces
LAUFBAU_HELP_SETTINGS = §8/§elaufbau settings §8- §7Öffnet die Settings GUI
LAUFBAU_PREPARE1 = §71. Trace die Kanonen so oft wie nötig, in allen Modi. LAUFBAU_PREPARE1 = §71. Trace die Kanonen so oft wie nötig, in allen Modi.
LAUFBAU_PREPARE2 = §72. Versuche alle Fails aus dem Trace zu löschen. LAUFBAU_PREPARE2 = §72. Versuche alle Fails aus dem Trace zu löschen.
LAUFBAU_NO_PERM = §cDu darfst hier nicht das Laufbau System verwenden LAUFBAU_NO_PERM = §cDu darfst hier nicht das Laufbau System verwenden
@ -1132,6 +1133,52 @@ LAUFBAU_STATE_CREATING_OUTER_BLOCKS = Mantel bauen
LAUFBAU_SIMPLE_PROGRESS = §e{0}§8: §e{1}§8/§e{2} LAUFBAU_SIMPLE_PROGRESS = §e{0}§8: §e{1}§8/§e{2}
LAUFBAU_DONE = §aZuende gebaut LAUFBAU_DONE = §aZuende gebaut
LAUFBAU_BLOCK_GRASS_PATH =
LAUFBAU_BLOCK_SOUL_SAND =
LAUFBAU_BLOCK_COCOA =
LAUFBAU_BLOCK_TURTLE_EGG =
LAUFBAU_BLOCK_CHEST =
LAUFBAU_BLOCK_SNOW =
LAUFBAU_BLOCK_PLAYER_WALL_HEAD =
LAUFBAU_BLOCK_STONECUTTER =
LAUFBAU_BLOCK_PLAYER_HEAD =
LAUFBAU_BLOCK_CAKE =
LAUFBAU_BLOCK_END_STONE_BRICK_SLAB =
LAUFBAU_BLOCK_SEA_PICKLE =
LAUFBAU_BLOCK_CAMPFIRE =
LAUFBAU_BLOCK_FLOWER_POT =
LAUFBAU_BLOCK_IRON_TRAPDOOR =
LAUFBAU_BLOCK_LILY_PAD =
LAUFBAU_BLOCK_WHITE_CARPET =
LAUFBAU_BLOCK_END_ROD =
LAUFBAU_BLOCK_CONDUIT =
LAUFBAU_FACING_NORTH =
LAUFBAU_FACING_SOUTH =
LAUFBAU_FACING_WEST =
LAUFBAU_FACING_EAST =
LAUFBAU_FACING_UP =
LAUFBAU_FACING_DOWN =
LAUFBAU_COUNT_1 =
LAUFBAU_COUNT_2 =
LAUFBAU_COUNT_3 =
LAUFBAU_COUNT_4 =
LAUFBAU_LAYERS_8 =
LAUFBAU_LAYERS_7 =
LAUFBAU_LAYERS_6 =
LAUFBAU_LAYERS_3 =
LAUFBAU_LAYERS_2 =
LAUFBAU_TYPE_BOTTOM =
LAUFBAU_TYPE_TOP =
LAUFBAU_HALF_BOTTOM =
LAUFBAU_HALF_TOP =
LAUFBAU_OPEN =
# UTILS # UTILS
SELECT_HELP = §8/§eselect §8[§7RegionsTyp§8] §8- §7Wähle einen RegionsTyp aus SELECT_HELP = §8/§eselect §8[§7RegionsTyp§8] §8- §7Wähle einen RegionsTyp aus
SELECT_EXTENSION_HELP = §8/§eselect §8[§7RegionsTyp§8] §8[§7Extension§8] §8- §7Wähle einen RegionsTyp aus mit oder ohne Extension SELECT_EXTENSION_HELP = §8/§eselect §8[§7RegionsTyp§8] §8[§7Extension§8] §8- §7Wähle einen RegionsTyp aus mit oder ohne Extension

Datei anzeigen

@ -19,17 +19,24 @@
package de.steamwar.bausystem.features.slaves.laufbau; package de.steamwar.bausystem.features.slaves.laufbau;
import de.steamwar.inventory.SWItem;
import lombok.Getter; import lombok.Getter;
import lombok.ToString; import lombok.ToString;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.block.BlockFace; import org.bukkit.block.BlockFace;
import org.bukkit.block.data.*; import org.bukkit.block.data.Bisected;
import org.bukkit.block.data.BlockData;
import org.bukkit.block.data.Directional;
import org.bukkit.block.data.Waterlogged;
import org.bukkit.block.data.type.*; import org.bukkit.block.data.type.*;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.createItem;
import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.pixelCuboid;
@ToString @ToString
@Getter @Getter
public class BlockBoundingBox { public class BlockBoundingBox {
@ -39,10 +46,12 @@ public class BlockBoundingBox {
public BlockData blockData; public BlockData blockData;
public List<Cuboid> cuboidList; public List<Cuboid> cuboidList;
private double volume; private double volume;
public SWItem swItem;
public BlockBoundingBox(BlockData blockData, List<Cuboid> cuboidList) { public BlockBoundingBox(BlockData blockData, List<Cuboid> cuboidList, SWItem swItem) {
this.blockData = blockData; this.blockData = blockData;
this.cuboidList = cuboidList; this.cuboidList = cuboidList;
this.swItem = swItem;
volume = cuboidList.stream().mapToDouble(Cuboid::volume).sum(); volume = cuboidList.stream().mapToDouble(Cuboid::volume).sum();
elements.add(this); elements.add(this);
} }
@ -52,174 +61,170 @@ public class BlockBoundingBox {
} }
static { static {
addPixel(Material.AIR.createBlockData(), 0, 0, 0, 0, 0, 0); addPixel(Material.AIR.createBlockData(), 0, 0, 0, 0, 0, 0, null);
addPixel(Material.END_STONE.createBlockData(), 0, 0, 0, 16, 16, 16); addPixel(Material.END_STONE.createBlockData(), 0, 0, 0, 16, 16, 16, null);
addPixel(Material.GRASS_PATH.createBlockData(), 0, 0, 0, 16, 15, 16); addPixel(Material.GRASS_PATH.createBlockData(), 0, 0, 0, 16, 15, 16, createItem("LAUFBAU_BLOCK_GRASS_PATH", Material.GRASS_PATH));
addPixel(Material.SOUL_SAND.createBlockData(), 0, 0, 0, 16, 14, 16); addPixel(Material.SOUL_SAND.createBlockData(), 0, 0, 0, 16, 14, 16, createItem("LAUFBAU_BLOCK_SOUL_SAND", Material.SOUL_SAND));
Cocoa cocoaNorth = (Cocoa) Material.COCOA.createBlockData(); Cocoa cocoaNorth = (Cocoa) Material.COCOA.createBlockData();
cocoaNorth.setAge(2); cocoaNorth.setAge(2);
cocoaNorth.setFacing(BlockFace.NORTH); cocoaNorth.setFacing(BlockFace.NORTH);
addPixel(cocoaNorth, 4, 3, 1, 8, 9, 8); addPixel(cocoaNorth, 4, 3, 1, 8, 9, 8, createItem("LAUFBAU_BLOCK_COCOA", Material.COCOA_BEANS, "LAUFBAU_FACING_NORTH"));
Cocoa cocoaSouth = (Cocoa) Material.COCOA.createBlockData(); Cocoa cocoaSouth = (Cocoa) Material.COCOA.createBlockData();
cocoaSouth.setAge(2); cocoaSouth.setAge(2);
cocoaSouth.setFacing(BlockFace.SOUTH); cocoaSouth.setFacing(BlockFace.SOUTH);
addPixel(cocoaSouth, 4, 3, 7, 8, 9, 8); addPixel(cocoaSouth, 4, 3, 7, 8, 9, 8, createItem("LAUFBAU_BLOCK_COCOA", Material.COCOA_BEANS, "LAUFBAU_FACING_SOUTH"));
Cocoa cocoaWest = (Cocoa) Material.COCOA.createBlockData(); Cocoa cocoaWest = (Cocoa) Material.COCOA.createBlockData();
cocoaWest.setAge(2); cocoaWest.setAge(2);
cocoaWest.setFacing(BlockFace.WEST); cocoaWest.setFacing(BlockFace.WEST);
addPixel(cocoaWest, 1, 3, 4, 8, 9, 8); addPixel(cocoaWest, 1, 3, 4, 8, 9, 8, createItem("LAUFBAU_BLOCK_COCOA", Material.COCOA_BEANS, "LAUFBAU_FACING_WEST"));
Cocoa cocoaEast = (Cocoa) Material.COCOA.createBlockData(); Cocoa cocoaEast = (Cocoa) Material.COCOA.createBlockData();
cocoaEast.setAge(2); cocoaEast.setAge(2);
cocoaEast.setFacing(BlockFace.EAST); cocoaEast.setFacing(BlockFace.EAST);
addPixel(cocoaEast, 7, 3, 4, 8, 9, 8); addPixel(cocoaEast, 7, 3, 4, 8, 9, 8, createItem("LAUFBAU_BLOCK_COCOA", Material.COCOA_BEANS, "LAUFBAU_FACING_EAST"));
TurtleEgg singleTurtleEgg = (TurtleEgg) Material.TURTLE_EGG.createBlockData(); TurtleEgg singleTurtleEgg = (TurtleEgg) Material.TURTLE_EGG.createBlockData();
singleTurtleEgg.setEggs(1); singleTurtleEgg.setEggs(1);
singleTurtleEgg.setHatch(0); singleTurtleEgg.setHatch(0);
addPixel(singleTurtleEgg, 4, 0, 3, 9, 7, 9); addPixel(singleTurtleEgg, 4, 0, 3, 9, 7, 9, createItem("LAUFBAU_BLOCK_TURTLE_EGG", Material.TURTLE_EGG, "LAUFBAU_COUNT_1"));
TurtleEgg doubleTurtleEgg = (TurtleEgg) Material.TURTLE_EGG.createBlockData(); TurtleEgg doubleTurtleEgg = (TurtleEgg) Material.TURTLE_EGG.createBlockData();
doubleTurtleEgg.setEggs(2); doubleTurtleEgg.setEggs(2);
doubleTurtleEgg.setHatch(0); doubleTurtleEgg.setHatch(0);
addPixel(doubleTurtleEgg, 1, 0, 1, 14, 7, 14); addPixel(doubleTurtleEgg, 1, 0, 1, 14, 7, 14, createItem("LAUFBAU_BLOCK_TURTLE_EGG", Material.TURTLE_EGG, "LAUFBAU_COUNT_2"));
addPixel(Material.CHEST.createBlockData(), 1, 0, 1, 14, 14, 14); addPixel(Material.CHEST.createBlockData(), 1, 0, 1, 14, 14, 14, createItem("LAUFBAU_BLOCK_CHEST", Material.CHEST));
Snow snowLayers8 = (Snow) Material.SNOW.createBlockData(); Snow snowLayers8 = (Snow) Material.SNOW.createBlockData();
snowLayers8.setLayers(8); snowLayers8.setLayers(8);
addPixel(snowLayers8, 0, 0, 0, 16, 14, 16); addPixel(snowLayers8, 0, 0, 0, 16, 14, 16, createItem("LAUFBAU_BLOCK_SNOW", Material.SNOW, "LAUFBAU_LAYERS_8"));
Directional headNorth = (Directional) Material.PLAYER_WALL_HEAD.createBlockData(); Directional headNorth = (Directional) Material.PLAYER_WALL_HEAD.createBlockData();
headNorth.setFacing(BlockFace.NORTH); headNorth.setFacing(BlockFace.NORTH);
addPixel(headNorth, 4, 4, 8, 8, 8, 8); addPixel(headNorth, 4, 4, 8, 8, 8, 8, createItem("LAUFBAU_BLOCK_PLAYER_WALL_HEAD", Material.PLAYER_HEAD, "LAUFBAU_FACING_NORTH"));
Directional headSouth = (Directional) Material.PLAYER_WALL_HEAD.createBlockData(); Directional headSouth = (Directional) Material.PLAYER_WALL_HEAD.createBlockData();
headSouth.setFacing(BlockFace.SOUTH); headSouth.setFacing(BlockFace.SOUTH);
addPixel(headSouth, 4, 4, 0, 8, 8, 8); addPixel(headSouth, 4, 4, 0, 8, 8, 8, createItem("LAUFBAU_BLOCK_PLAYER_WALL_HEAD", Material.PLAYER_HEAD, "LAUFBAU_FACING_SOUTH"));
Directional headWest = (Directional) Material.PLAYER_WALL_HEAD.createBlockData(); Directional headWest = (Directional) Material.PLAYER_WALL_HEAD.createBlockData();
headWest.setFacing(BlockFace.WEST); headWest.setFacing(BlockFace.WEST);
addPixel(headWest, 8, 4, 4, 8, 8, 8); addPixel(headWest, 8, 4, 4, 8, 8, 8, createItem("LAUFBAU_BLOCK_PLAYER_WALL_HEAD", Material.PLAYER_HEAD, "LAUFBAU_FACING_WEST"));
Directional headEast = (Directional) Material.PLAYER_WALL_HEAD.createBlockData(); Directional headEast = (Directional) Material.PLAYER_WALL_HEAD.createBlockData();
headEast.setFacing(BlockFace.EAST); headEast.setFacing(BlockFace.EAST);
addPixel(headEast, 0, 4, 4, 8, 8, 8); addPixel(headEast, 0, 4, 4, 8, 8, 8, createItem("LAUFBAU_BLOCK_PLAYER_WALL_HEAD", Material.PLAYER_HEAD, "LAUFBAU_FACING_EAST"));
Snow snowLayers7 = (Snow) Material.SNOW.createBlockData(); Snow snowLayers7 = (Snow) Material.SNOW.createBlockData();
snowLayers7.setLayers(7); snowLayers7.setLayers(7);
addPixel(snowLayers7, 0, 0, 0, 16, 12, 16); addPixel(snowLayers7, 0, 0, 0, 16, 12, 16, createItem("LAUFBAU_BLOCK_SNOW", Material.SNOW, "LAUFBAU_LAYERS_7"));
Snow snowLayers6 = (Snow) Material.SNOW.createBlockData(); Snow snowLayers6 = (Snow) Material.SNOW.createBlockData();
snowLayers6.setLayers(6); snowLayers6.setLayers(6);
addPixel(snowLayers6, 0, 0, 0, 16, 10, 16); addPixel(snowLayers6, 0, 0, 0, 16, 10, 16, createItem("LAUFBAU_BLOCK_SNOW", Material.SNOW, "LAUFBAU_LAYERS_6"));
addPixel(Material.STONECUTTER.createBlockData(), 0, 0, 0, 16, 9, 16); addPixel(Material.STONECUTTER.createBlockData(), 0, 0, 0, 16, 9, 16, createItem("LAUFBAU_BLOCK_STONECUTTER", Material.STONECUTTER));
addPixel(Material.PLAYER_HEAD.createBlockData(), 4, 0, 4, 8, 8, 8); addPixel(Material.PLAYER_HEAD.createBlockData(), 4, 0, 4, 8, 8, 8, createItem("LAUFBAU_BLOCK_PLAYER_HEAD", Material.PLAYER_HEAD));
addPixel(Material.CAKE.createBlockData(), 1, 0, 1, 14, 8, 14); addPixel(Material.CAKE.createBlockData(), 1, 0, 1, 14, 8, 14, createItem("LAUFBAU_BLOCK_CAKE", Material.CAKE));
Slab bottomSlab = (Slab) Material.END_STONE_BRICK_SLAB.createBlockData(); Slab bottomSlab = (Slab) Material.END_STONE_BRICK_SLAB.createBlockData();
bottomSlab.setType(Slab.Type.BOTTOM); bottomSlab.setType(Slab.Type.BOTTOM);
addPixel(bottomSlab, 0, 0, 0, 16, 8, 16); addPixel(bottomSlab, 0, 0, 0, 16, 8, 16, createItem("LAUFBAU_BLOCK_END_STONE_BRICK_SLAB", Material.END_STONE_BRICK_SLAB, "LAUFBAU_TYPE_BOTTOM"));
Slab topSlab = (Slab) Material.END_STONE_BRICK_SLAB.createBlockData(); Slab topSlab = (Slab) Material.END_STONE_BRICK_SLAB.createBlockData();
topSlab.setType(Slab.Type.TOP); topSlab.setType(Slab.Type.TOP);
addPixel(topSlab, 0, 8, 0, 16, 8, 16); addPixel(topSlab, 0, 8, 0, 16, 8, 16, createItem("LAUFBAU_BLOCK_END_STONE_BRICK_SLAB", Material.END_STONE_BRICK_SLAB, "LAUFBAU_TYPE_TOP"));
SeaPickle quadSeaPickle = (SeaPickle) Material.SEA_PICKLE.createBlockData(); SeaPickle quadSeaPickle = (SeaPickle) Material.SEA_PICKLE.createBlockData();
quadSeaPickle.setWaterlogged(false); quadSeaPickle.setWaterlogged(false);
quadSeaPickle.setPickles(4); quadSeaPickle.setPickles(4);
addPixel(quadSeaPickle, 2, 0, 2, 12, 7, 12); addPixel(quadSeaPickle, 2, 0, 2, 12, 7, 12, createItem("LAUFBAU_BLOCK_SEA_PICKLE", Material.SEA_PICKLE, "LAUFBAU_COUNT_4"));
Campfire campfire = (Campfire) Material.CAMPFIRE.createBlockData(); Campfire campfire = (Campfire) Material.CAMPFIRE.createBlockData();
campfire.setSignalFire(false); campfire.setSignalFire(false);
campfire.setLit(false); campfire.setLit(false);
addPixel(campfire, 0, 0, 0, 16, 7, 16); addPixel(campfire, 0, 0, 0, 16, 7, 16, createItem("LAUFBAU_BLOCK_CAMPFIRE", Material.CAMPFIRE));
SeaPickle trippleSeaPickle = (SeaPickle) Material.SEA_PICKLE.createBlockData(); SeaPickle trippleSeaPickle = (SeaPickle) Material.SEA_PICKLE.createBlockData();
trippleSeaPickle.setWaterlogged(false); trippleSeaPickle.setWaterlogged(false);
trippleSeaPickle.setPickles(3); trippleSeaPickle.setPickles(3);
addPixel(trippleSeaPickle, 2, 0, 2, 12, 6, 12); addPixel(trippleSeaPickle, 2, 0, 2, 12, 6, 12, createItem("LAUFBAU_BLOCK_SEA_PICKLE", Material.SEA_PICKLE, "LAUFBAU_COUNT_3"));
SeaPickle doubleSeaPickle = (SeaPickle) Material.SEA_PICKLE.createBlockData(); SeaPickle doubleSeaPickle = (SeaPickle) Material.SEA_PICKLE.createBlockData();
doubleSeaPickle.setWaterlogged(false); doubleSeaPickle.setWaterlogged(false);
doubleSeaPickle.setPickles(2); doubleSeaPickle.setPickles(2);
addPixel(doubleSeaPickle, 3, 0, 3, 10, 6, 10); addPixel(doubleSeaPickle, 3, 0, 3, 10, 6, 10, createItem("LAUFBAU_BLOCK_SEA_PICKLE", Material.SEA_PICKLE, "LAUFBAU_COUNT_2"));
SeaPickle singleSeaPickle = (SeaPickle) Material.SEA_PICKLE.createBlockData(); SeaPickle singleSeaPickle = (SeaPickle) Material.SEA_PICKLE.createBlockData();
singleSeaPickle.setWaterlogged(false); singleSeaPickle.setWaterlogged(false);
singleSeaPickle.setPickles(1); singleSeaPickle.setPickles(1);
addPixel(singleSeaPickle, 6, 0, 6, 4, 6, 4); addPixel(singleSeaPickle, 6, 0, 6, 4, 6, 4, createItem("LAUFBAU_BLOCK_SEA_PICKLE", Material.SEA_PICKLE, "LAUFBAU_COUNT_1"));
addPixel(Material.FLOWER_POT.createBlockData(), 5, 0, 5, 6, 6, 6); addPixel(Material.FLOWER_POT.createBlockData(), 5, 0, 5, 6, 6, 6, createItem("LAUFBAU_BLOCK_FLOWER_POT", Material.FLOWER_POT));
Snow snowLayers3 = (Snow) Material.SNOW.createBlockData(); Snow snowLayers3 = (Snow) Material.SNOW.createBlockData();
snowLayers3.setLayers(3); snowLayers3.setLayers(3);
addPixel(snowLayers3, 0, 0, 0, 16, 4, 16); addPixel(snowLayers3, 0, 0, 0, 16, 4, 16, createItem("LAUFBAU_BLOCK_SNOW", Material.SNOW, "LAUFBAU_LAYERS_3"));
TrapDoor bottomTrapDoor = (TrapDoor) Material.IRON_TRAPDOOR.createBlockData(); TrapDoor bottomTrapDoor = (TrapDoor) Material.IRON_TRAPDOOR.createBlockData();
bottomTrapDoor.setHalf(Bisected.Half.BOTTOM); bottomTrapDoor.setHalf(Bisected.Half.BOTTOM);
addPixel(bottomTrapDoor, 0, 0, 0, 16, 3, 16); addPixel(bottomTrapDoor, 0, 0, 0, 16, 3, 16, createItem("LAUFBAU_BLOCK_IRON_TRAPDOOR", Material.IRON_TRAPDOOR, "LAUFBAU_HALF_BOTTOM"));
TrapDoor topTrapDoor = (TrapDoor) Material.IRON_TRAPDOOR.createBlockData(); TrapDoor topTrapDoor = (TrapDoor) Material.IRON_TRAPDOOR.createBlockData();
topTrapDoor.setHalf(Bisected.Half.TOP); topTrapDoor.setHalf(Bisected.Half.TOP);
addPixel(topTrapDoor, 0, 13, 0, 16, 3, 16); addPixel(topTrapDoor, 0, 13, 0, 16, 3, 16, createItem("LAUFBAU_BLOCK_IRON_TRAPDOOR", Material.IRON_TRAPDOOR, "LAUFBAU_HALF_TOP"));
Snow snowLayers2 = (Snow) Material.SNOW.createBlockData(); Snow snowLayers2 = (Snow) Material.SNOW.createBlockData();
snowLayers2.setLayers(2); snowLayers2.setLayers(2);
addPixel(snowLayers2, 0, 0, 0, 16, 2, 16); addPixel(snowLayers2, 0, 0, 0, 16, 2, 16, createItem("LAUFBAU_BLOCK_SNOW", Material.SNOW, "LAUFBAU_LAYERS_2"));
addPixel(Material.LILY_PAD.createBlockData(), 1, 0, 1, 14, 1.5, 14); addPixel(Material.LILY_PAD.createBlockData(), 1, 0, 1, 14, 1.5, 14, createItem("LAUFBAU_BLOCK_LILY_PAD", Material.LILY_PAD));
addPixel(Material.WHITE_CARPET.createBlockData(), 0, 0, 0, 16, 1, 16); addPixel(Material.WHITE_CARPET.createBlockData(), 0, 0, 0, 16, 1, 16, createItem("LAUFBAU_BLOCK_WHITE_CARPET", Material.WHITE_CARPET));
Directional endRodBottomTop = (Directional) Material.END_ROD.createBlockData(); Directional endRodBottomTop = (Directional) Material.END_ROD.createBlockData();
endRodBottomTop.setFacing(BlockFace.UP); endRodBottomTop.setFacing(BlockFace.UP);
addPixel(endRodBottomTop, 6, 0, 6, 4, 16, 4); addPixel(endRodBottomTop, 6, 0, 6, 4, 16, 4, createItem("LAUFBAU_BLOCK_END_ROD", Material.END_ROD, "LAUFBAU_FACING_UP", "LAUFBAU_FACING_DOWN"));
Directional endRodNorthSouth = (Directional) Material.END_ROD.createBlockData(); Directional endRodNorthSouth = (Directional) Material.END_ROD.createBlockData();
endRodNorthSouth.setFacing(BlockFace.NORTH); endRodNorthSouth.setFacing(BlockFace.NORTH);
addPixel(endRodNorthSouth, 6, 6, 0, 4, 4, 16); addPixel(endRodNorthSouth, 6, 6, 0, 4, 4, 16, createItem("LAUFBAU_BLOCK_END_ROD", Material.END_ROD, "LAUFBAU_FACING_NORTH", "LAUFBAU_FACING_SOUTH"));
Directional endRodEastWest = (Directional) Material.END_ROD.createBlockData(); Directional endRodEastWest = (Directional) Material.END_ROD.createBlockData();
endRodEastWest.setFacing(BlockFace.EAST); endRodEastWest.setFacing(BlockFace.EAST);
addPixel(endRodEastWest, 0, 6, 6, 16, 4, 4); addPixel(endRodEastWest, 0, 6, 6, 16, 4, 4, createItem("LAUFBAU_BLOCK_END_ROD", Material.END_ROD, "LAUFBAU_FACING_EAST", "LAUFBAU_FACING_WEST"));
Waterlogged conduit = (Waterlogged) Material.CONDUIT.createBlockData(); Waterlogged conduit = (Waterlogged) Material.CONDUIT.createBlockData();
conduit.setWaterlogged(false); conduit.setWaterlogged(false);
addPixel(conduit, 5, 5, 5, 6, 6, 6); addPixel(conduit, 5, 5, 5, 6, 6, 6, createItem("LAUFBAU_BLOCK_CONDUIT", Material.CONDUIT));
TrapDoor northTrapDoor = (TrapDoor) Material.IRON_TRAPDOOR.createBlockData(); TrapDoor northTrapDoor = (TrapDoor) Material.IRON_TRAPDOOR.createBlockData();
northTrapDoor.setFacing(BlockFace.NORTH); northTrapDoor.setFacing(BlockFace.NORTH);
northTrapDoor.setOpen(true); northTrapDoor.setOpen(true);
addPixel(northTrapDoor, 0, 0, 13, 16, 16, 3); addPixel(northTrapDoor, 0, 0, 13, 16, 16, 3, createItem("LAUFBAU_BLOCK_IRON_TRAPDOOR", Material.IRON_TRAPDOOR, "LAUFBAU_FACING_NORTH", "LAUFBAU_OPEN"));
TrapDoor southTrapDoor = (TrapDoor) Material.IRON_TRAPDOOR.createBlockData(); TrapDoor southTrapDoor = (TrapDoor) Material.IRON_TRAPDOOR.createBlockData();
southTrapDoor.setFacing(BlockFace.SOUTH); southTrapDoor.setFacing(BlockFace.SOUTH);
southTrapDoor.setOpen(true); southTrapDoor.setOpen(true);
addPixel(southTrapDoor, 0, 0, 0, 16, 16, 3); addPixel(southTrapDoor, 0, 0, 0, 16, 16, 3, createItem("LAUFBAU_BLOCK_IRON_TRAPDOOR", Material.IRON_TRAPDOOR, "LAUFBAU_FACING_SOUTH", "LAUFBAU_OPEN"));
TrapDoor westTrapDoor = (TrapDoor) Material.IRON_TRAPDOOR.createBlockData(); TrapDoor westTrapDoor = (TrapDoor) Material.IRON_TRAPDOOR.createBlockData();
westTrapDoor.setFacing(BlockFace.WEST); westTrapDoor.setFacing(BlockFace.WEST);
westTrapDoor.setOpen(true); westTrapDoor.setOpen(true);
addPixel(westTrapDoor, 13, 0, 0, 3, 16, 16); addPixel(westTrapDoor, 13, 0, 0, 3, 16, 16, createItem("LAUFBAU_BLOCK_IRON_TRAPDOOR", Material.IRON_TRAPDOOR, "LAUFBAU_FACING_WEST", "LAUFBAU_OPEN"));
TrapDoor eastTrapDoor = (TrapDoor) Material.IRON_TRAPDOOR.createBlockData(); TrapDoor eastTrapDoor = (TrapDoor) Material.IRON_TRAPDOOR.createBlockData();
eastTrapDoor.setFacing(BlockFace.EAST); eastTrapDoor.setFacing(BlockFace.EAST);
eastTrapDoor.setOpen(true); eastTrapDoor.setOpen(true);
addPixel(eastTrapDoor, 0, 0, 0, 3, 16, 16); addPixel(eastTrapDoor, 0, 0, 0, 3, 16, 16, createItem("LAUFBAU_BLOCK_IRON_TRAPDOOR", Material.IRON_TRAPDOOR, "LAUFBAU_FACING_EAST", "LAUFBAU_OPEN"));
} }
private static void addPixel(BlockData blockData, double xPixel, double yPixel, double zPixel, double dxPixel, double dyPixel, double dzPixel) { private static void addPixel(BlockData blockData, double xPixel, double yPixel, double zPixel, double dxPixel, double dyPixel, double dzPixel, SWItem swItem) {
new BlockBoundingBox(blockData, Arrays.asList(new Cuboid(pixelToBlock(xPixel), pixelToBlock(yPixel), pixelToBlock(zPixel), pixelToBlock(dxPixel), pixelToBlock(dyPixel), pixelToBlock(dzPixel)))); new BlockBoundingBox(blockData, Arrays.asList(pixelCuboid(xPixel, yPixel, zPixel, dxPixel, dyPixel, dzPixel)), swItem);
}
private static double pixelToBlock(double pixel) {
return 1.0 / 16 * pixel;
} }
} }

Datei anzeigen

@ -82,4 +82,12 @@ public class LaufbauCommand extends SWCommand {
} }
}.runTaskTimer(BauSystem.getInstance(), 1, 1); }.runTaskTimer(BauSystem.getInstance(), 1, 1);
} }
@Register(value = "settings", description = "LAUFBAU_HELP_SETTINGS")
public void laufbauSettings(Player player) {
if (!permissionCheck(player, Permission.WORLDEDIT)) {
return;
}
new LaufbauSettings(player);
}
} }

Datei anzeigen

@ -17,17 +17,15 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
package de.steamwar.bausystem.features.slaves.laufbau.boundingboxes; package de.steamwar.bausystem.features.slaves.laufbau;
import de.steamwar.bausystem.features.slaves.laufbau.Cuboid; import org.bukkit.entity.Player;
public class CuboidUtils { public class LaufbauSettings {
public static Cuboid pixelCuboid(double pixelX, double pixelY, double pixelZ, double pixelDX, double pixelDY, double pixelDZ) { private Player p;
return new Cuboid(pixelToBlock(pixelX), pixelToBlock(pixelY), pixelToBlock(pixelZ), pixelToBlock(pixelDX), pixelToBlock(pixelDY), pixelToBlock(pixelDZ));
}
private static double pixelToBlock(double pixel) { public LaufbauSettings(Player p) {
return 1.0 / 16 * pixel; this.p = p;
} }
} }

Datei anzeigen

@ -0,0 +1,53 @@
/*
* 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.slaves.laufbau;
import de.steamwar.bausystem.BauSystem;
import de.steamwar.inventory.SWItem;
import lombok.experimental.UtilityClass;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.meta.ItemMeta;
import java.util.Arrays;
import java.util.stream.Collectors;
@UtilityClass
public class LaufbauUtils {
public static Cuboid pixelCuboid(double pixelX, double pixelY, double pixelZ, double pixelDX, double pixelDY, double pixelDZ) {
return new Cuboid(pixelToBlock(pixelX), pixelToBlock(pixelY), pixelToBlock(pixelZ), pixelToBlock(pixelDX), pixelToBlock(pixelDY), pixelToBlock(pixelDZ));
}
public static double pixelToBlock(double pixel) {
return 1.0 / 16 * pixel;
}
public static SWItem createItem(String name, Material material, String... lore) {
return new SWItem(material, name, Arrays.asList(lore), false, clickType -> {
});
}
public static SWItem translateItem(SWItem item, Player p) {
ItemMeta itemMeta = item.getItemMeta();
return new SWItem(item.getItemStack().getType(), BauSystem.MESSAGE.parse(itemMeta.getDisplayName(), p), itemMeta.getLore().stream().map(l -> BauSystem.MESSAGE.parse(l, p)).collect(Collectors.toList()), false, clickType -> {
});
}
}

Datei anzeigen

@ -31,7 +31,7 @@ import org.bukkit.block.data.type.Bell;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import static de.steamwar.bausystem.features.slaves.laufbau.boundingboxes.CuboidUtils.pixelCuboid; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.pixelCuboid;
@Linked(LinkageType.ENABLE_LINK) @Linked(LinkageType.ENABLE_LINK)
public class BellBoundingBox implements Enable { public class BellBoundingBox implements Enable {

Datei anzeigen

@ -30,7 +30,7 @@ import org.bukkit.block.data.type.BrewingStand;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import static de.steamwar.bausystem.features.slaves.laufbau.boundingboxes.CuboidUtils.pixelCuboid; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.pixelCuboid;
@Linked(LinkageType.ENABLE_LINK) @Linked(LinkageType.ENABLE_LINK)
public class BrewingStandBoundingBox implements Enable { public class BrewingStandBoundingBox implements Enable {

Datei anzeigen

@ -25,14 +25,13 @@ import de.steamwar.bausystem.linkage.Enable;
import de.steamwar.bausystem.linkage.LinkageType; import de.steamwar.bausystem.linkage.LinkageType;
import de.steamwar.bausystem.linkage.Linked; import de.steamwar.bausystem.linkage.Linked;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace; import org.bukkit.block.BlockFace;
import org.bukkit.block.data.MultipleFacing; import org.bukkit.block.data.MultipleFacing;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import static de.steamwar.bausystem.features.slaves.laufbau.boundingboxes.CuboidUtils.pixelCuboid; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.pixelCuboid;
@Linked(LinkageType.ENABLE_LINK) @Linked(LinkageType.ENABLE_LINK)
public class ChorusPlantBoundingBox implements Enable { public class ChorusPlantBoundingBox implements Enable {

Datei anzeigen

@ -31,7 +31,7 @@ import org.bukkit.block.data.type.Fence;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import static de.steamwar.bausystem.features.slaves.laufbau.boundingboxes.CuboidUtils.pixelCuboid; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.pixelCuboid;
@Linked(LinkageType.ENABLE_LINK) @Linked(LinkageType.ENABLE_LINK)
public class FencesBoundingBox implements Enable { public class FencesBoundingBox implements Enable {

Datei anzeigen

@ -32,7 +32,7 @@ import org.bukkit.block.data.type.Grindstone;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import static de.steamwar.bausystem.features.slaves.laufbau.boundingboxes.CuboidUtils.pixelCuboid; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.pixelCuboid;
@Linked(LinkageType.ENABLE_LINK) @Linked(LinkageType.ENABLE_LINK)
public class GrindstoneBoundingBox implements Enable { public class GrindstoneBoundingBox implements Enable {

Datei anzeigen

@ -31,7 +31,7 @@ import org.bukkit.block.data.type.Hopper;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import static de.steamwar.bausystem.features.slaves.laufbau.boundingboxes.CuboidUtils.pixelCuboid; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.pixelCuboid;
@Linked(LinkageType.ENABLE_LINK) @Linked(LinkageType.ENABLE_LINK)
public class HopperBoundingBox implements Enable { public class HopperBoundingBox implements Enable {

Datei anzeigen

@ -31,7 +31,7 @@ import org.bukkit.block.data.type.Fence;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import static de.steamwar.bausystem.features.slaves.laufbau.boundingboxes.CuboidUtils.pixelCuboid; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.pixelCuboid;
@Linked(LinkageType.ENABLE_LINK) @Linked(LinkageType.ENABLE_LINK)
public class IronBarBoundingBox implements Enable { public class IronBarBoundingBox implements Enable {

Datei anzeigen

@ -30,7 +30,7 @@ import org.bukkit.block.data.type.Lantern;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import static de.steamwar.bausystem.features.slaves.laufbau.boundingboxes.CuboidUtils.pixelCuboid; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.pixelCuboid;
@Linked(LinkageType.ENABLE_LINK) @Linked(LinkageType.ENABLE_LINK)
public class LanternBoundingBox implements Enable { public class LanternBoundingBox implements Enable {

Datei anzeigen

@ -31,7 +31,7 @@ import org.bukkit.block.data.type.Stairs;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import static de.steamwar.bausystem.features.slaves.laufbau.boundingboxes.CuboidUtils.pixelCuboid; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.pixelCuboid;
@Linked(LinkageType.ENABLE_LINK) @Linked(LinkageType.ENABLE_LINK)
public class StairBoundingBox implements Enable { public class StairBoundingBox implements Enable {

Datei anzeigen

@ -31,7 +31,7 @@ import org.bukkit.block.data.type.Fence;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import static de.steamwar.bausystem.features.slaves.laufbau.boundingboxes.CuboidUtils.pixelCuboid; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.pixelCuboid;
@Linked(LinkageType.ENABLE_LINK) @Linked(LinkageType.ENABLE_LINK)
public class WallBoundingBox implements Enable { public class WallBoundingBox implements Enable {