Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5a46f10f8b |
@@ -109,7 +109,7 @@ public class FlatteningWrapper15 implements FlatteningWrapper {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setSelection(Player p, Point minPoint, Point maxPoint) {
|
public void setSelection(Player p, Point minPoint, Point maxPoint) {
|
||||||
WORLDEDIT_PLUGIN.getSession(p).setRegionSelector(BUKKITWORLD, new CuboidRegionSelector(BUKKITWORLD, minPoint.toBlockVector3(), maxPoint.toBlockVector3()));
|
WORLDEDIT_PLUGIN.getSession(p).setRegionSelector(BUKKITWORLD, new CuboidRegionSelector(BUKKITWORLD, toBlockVector3(minPoint), toBlockVector3(maxPoint)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -178,9 +178,9 @@ public class FlatteningWrapper15 implements FlatteningWrapper {
|
|||||||
pastePoint.set(v);
|
pastePoint.set(v);
|
||||||
|
|
||||||
if (pasteBuilder.isReset()) {
|
if (pasteBuilder.isReset()) {
|
||||||
e.setBlocks(new CuboidRegion(pasteBuilder.getMinPoint().toBlockVector3(), pasteBuilder.getMaxPoint().toBlockVector3()), Objects.requireNonNull(BlockTypes.AIR).getDefaultState().toBaseBlock());
|
e.setBlocks(new CuboidRegion(toBlockVector3(pasteBuilder.getMinPoint()), toBlockVector3(pasteBuilder.getMaxPoint())), Objects.requireNonNull(BlockTypes.AIR).getDefaultState().toBaseBlock());
|
||||||
if (pasteBuilder.getWaterLevel() != 0) {
|
if (pasteBuilder.getWaterLevel() != 0) {
|
||||||
e.setBlocks(new CuboidRegion(pasteBuilder.getMinPoint().toBlockVector3(), pasteBuilder.getMaxPoint().toBlockVector3().withY(pasteBuilder.getWaterLevel())), Objects.requireNonNull(BlockTypes.WATER).getDefaultState().toBaseBlock());
|
e.setBlocks(new CuboidRegion(toBlockVector3(pasteBuilder.getMinPoint()), toBlockVector3(pasteBuilder.getMaxPoint()).withY(pasteBuilder.getWaterLevel())), Objects.requireNonNull(BlockTypes.WATER).getDefaultState().toBaseBlock());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Operations.completeBlindly(ch.createPaste(e).to(v).ignoreAirBlocks(pasteBuilder.isIgnoreAir()).build());
|
Operations.completeBlindly(ch.createPaste(e).to(v).ignoreAirBlocks(pasteBuilder.isIgnoreAir()).build());
|
||||||
@@ -193,7 +193,7 @@ public class FlatteningWrapper15 implements FlatteningWrapper {
|
|||||||
@Override
|
@Override
|
||||||
public Clipboard copy(Point minPoint, Point maxPoint, Point copyPoint) {
|
public Clipboard copy(Point minPoint, Point maxPoint, Point copyPoint) {
|
||||||
BukkitWorld bukkitWorld = new BukkitWorld(Bukkit.getWorlds().get(0));
|
BukkitWorld bukkitWorld = new BukkitWorld(Bukkit.getWorlds().get(0));
|
||||||
CuboidRegion region = new CuboidRegion(bukkitWorld, minPoint.toBlockVector3(), maxPoint.toBlockVector3());
|
CuboidRegion region = new CuboidRegion(bukkitWorld, toBlockVector3(minPoint), toBlockVector3(maxPoint));
|
||||||
BlockArrayClipboard clipboard = new BlockArrayClipboard(region);
|
BlockArrayClipboard clipboard = new BlockArrayClipboard(region);
|
||||||
try (EditSession e = WorldEdit.getInstance().getEditSessionFactory().getEditSession(bukkitWorld, -1)) {
|
try (EditSession e = WorldEdit.getInstance().getEditSessionFactory().getEditSession(bukkitWorld, -1)) {
|
||||||
ForwardExtentCopy copy = new ForwardExtentCopy(
|
ForwardExtentCopy copy = new ForwardExtentCopy(
|
||||||
@@ -204,7 +204,7 @@ public class FlatteningWrapper15 implements FlatteningWrapper {
|
|||||||
copy.setCopyingBiomes(false);
|
copy.setCopyingBiomes(false);
|
||||||
|
|
||||||
Operations.complete(copy);
|
Operations.complete(copy);
|
||||||
clipboard.setOrigin(copyPoint.toBlockVector3());
|
clipboard.setOrigin(toBlockVector3(copyPoint));
|
||||||
return clipboard;
|
return clipboard;
|
||||||
} catch (WorldEditException e) {
|
} catch (WorldEditException e) {
|
||||||
Bukkit.getLogger().log(Level.SEVERE, e.getMessage(), e);
|
Bukkit.getLogger().log(Level.SEVERE, e.getMessage(), e);
|
||||||
@@ -224,6 +224,10 @@ public class FlatteningWrapper15 implements FlatteningWrapper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private BlockVector3 toBlockVector3(Point point) {
|
||||||
|
return BlockVector3.at(point.getX(), point.getY(), point.getZ());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean inWater(org.bukkit.World world, Vector tntPosition) {
|
public boolean inWater(org.bukkit.World world, Vector tntPosition) {
|
||||||
Block block = world.getBlockAt(tntPosition.getBlockX(), tntPosition.getBlockY(), tntPosition.getBlockZ());
|
Block block = world.getBlockAt(tntPosition.getBlockX(), tntPosition.getBlockY(), tntPosition.getBlockZ());
|
||||||
|
|||||||
@@ -947,9 +947,6 @@ SPEED_TAB_NAME=Input speed
|
|||||||
WORLDEDIT_WAND=WorldEdit Wand
|
WORLDEDIT_WAND=WorldEdit Wand
|
||||||
WORLDEDIT_LEFTCLICK=Left click: select pos #1
|
WORLDEDIT_LEFTCLICK=Left click: select pos #1
|
||||||
WORLDEDIT_RIGHTCLICK=Right click: select pos #2
|
WORLDEDIT_RIGHTCLICK=Right click: select pos #2
|
||||||
TNT_DETAILS_COMMAND=§8/§etntdetails §8-§7 Toggle information printed after clicking on a TNT
|
|
||||||
TNT_DETAILS_ON = §eTNTDetails §aactivated
|
|
||||||
TNT_DETAILS_OFF = §eTNTDetails §cdeactivated
|
|
||||||
TNT_CLICK_HEADER=§8---=== §eTNT §8===---
|
TNT_CLICK_HEADER=§8---=== §eTNT §8===---
|
||||||
TNT_CLICK_ORDER=§eEntity Order§8: §e{0}
|
TNT_CLICK_ORDER=§eEntity Order§8: §e{0}
|
||||||
TNT_CLICK_FUSE_TIME=§eFuseTime§8: §e{0}
|
TNT_CLICK_FUSE_TIME=§eFuseTime§8: §e{0}
|
||||||
|
|||||||
@@ -889,9 +889,6 @@ SPEED_TAB_NAME=Geschwindigkeit eingeben
|
|||||||
WORLDEDIT_WAND=WorldEdit Wand
|
WORLDEDIT_WAND=WorldEdit Wand
|
||||||
WORLDEDIT_LEFTCLICK=Left click: select pos #1
|
WORLDEDIT_LEFTCLICK=Left click: select pos #1
|
||||||
WORLDEDIT_RIGHTCLICK=Right click: select pos #2
|
WORLDEDIT_RIGHTCLICK=Right click: select pos #2
|
||||||
TNT_DETAILS_COMMAND=§8/§etntdetails §8-§7 Aktiviert/Deaktiviert das senden von Details beim Klick auf TNT
|
|
||||||
TNT_DETAILS_ON = §eTNTDetails §aaktiviert
|
|
||||||
TNT_DETAILS_OFF = §eTNTDetails §cdeaktiviert
|
|
||||||
TNT_CLICK_HEADER=§8---=== §eTNT §8===---
|
TNT_CLICK_HEADER=§8---=== §eTNT §8===---
|
||||||
TNT_CLICK_ORDER=§eEntity Order§8: §e{0}
|
TNT_CLICK_ORDER=§eEntity Order§8: §e{0}
|
||||||
TNT_CLICK_FUSE_TIME=§eFuseTime§8: §e{0}
|
TNT_CLICK_FUSE_TIME=§eFuseTime§8: §e{0}
|
||||||
|
|||||||
-37
@@ -1,37 +0,0 @@
|
|||||||
package de.steamwar.bausystem.features.printerTool;
|
|
||||||
|
|
||||||
import de.steamwar.bausystem.utils.ItemUtils;
|
|
||||||
import de.steamwar.inventory.SWItem;
|
|
||||||
import de.steamwar.linkage.Linked;
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.EventHandler;
|
|
||||||
import org.bukkit.event.Listener;
|
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
|
||||||
import org.bukkit.inventory.meta.ItemMeta;
|
|
||||||
|
|
||||||
@Linked
|
|
||||||
public class PrinterToolItem implements Listener {
|
|
||||||
public static ItemStack getItem(Player p) {
|
|
||||||
ItemStack itemStack = new SWItem(Material.WOODEN_PICKAXE, "Printer Tool").getItemStack();
|
|
||||||
ItemMeta itemMeta = itemStack.getItemMeta();
|
|
||||||
itemMeta.setCustomModelData(1);
|
|
||||||
itemStack.setItemMeta(itemMeta);
|
|
||||||
ItemUtils.setItem(itemStack, "printer_tool");
|
|
||||||
return itemStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean isItem(ItemStack itemStack) {
|
|
||||||
return itemStack != null && ItemUtils.isItem(itemStack, "printer_tool");
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onPlayerInteract(PlayerInteractEvent event) {
|
|
||||||
ItemStack item = event.getItem();
|
|
||||||
|
|
||||||
if(PrinterToolItem.isItem(item)) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+2
-120
@@ -11,9 +11,8 @@ import de.steamwar.linkage.Linked;
|
|||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.block.BlockState;
|
|
||||||
import org.bukkit.block.data.type.NoteBlock;
|
|
||||||
import org.bukkit.block.data.type.Switch;
|
import org.bukkit.block.data.type.Switch;
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
@@ -61,24 +60,6 @@ public class FreezeListener implements Listener, ScoreboardElement {
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPhysicsEvent(BlockPhysicsEvent e) {
|
public void onPhysicsEvent(BlockPhysicsEvent e) {
|
||||||
if (Region.getRegion(e.getBlock().getLocation()).get(Flag.FREEZE) == FreezeMode.ACTIVE) {
|
if (Region.getRegion(e.getBlock().getLocation()).get(Flag.FREEZE) == FreezeMode.ACTIVE) {
|
||||||
if (e.getSourceBlock().getType() == Material.NOTE_BLOCK) {
|
|
||||||
BlockState state = e.getSourceBlock().getState();
|
|
||||||
NoteBlock noteBlock = (NoteBlock) state.getBlockData();
|
|
||||||
if (noteBlock.isPowered()) {
|
|
||||||
Bukkit.getScheduler().runTaskLater(BauSystem.getInstance(), () -> {
|
|
||||||
state.update(true, false);
|
|
||||||
}, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (e.getBlock().getType() == Material.NOTE_BLOCK) {
|
|
||||||
BlockState state = e.getBlock().getState();
|
|
||||||
NoteBlock noteBlock = (NoteBlock) state.getBlockData();
|
|
||||||
if (noteBlock.isPowered()) {
|
|
||||||
Bukkit.getScheduler().runTaskLater(BauSystem.getInstance(), () -> {
|
|
||||||
state.update(true, false);
|
|
||||||
}, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -90,105 +71,6 @@ public class FreezeListener implements Listener, ScoreboardElement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onNotePlay(NotePlayEvent event) {
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=45, z=98},type=CYAN_TERRACOTTA,data=Block{minecraft:cyan_terracotta},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-107, y=45, z=98},type=SMOOTH_STONE,data=Block{minecraft:smooth_stone},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=45, z=98},type=CYAN_TERRACOTTA,data=Block{minecraft:cyan_terracotta},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-105, y=45, z=98},type=CYAN_TERRACOTTA,data=Block{minecraft:cyan_terracotta},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=45, z=98},type=CYAN_TERRACOTTA,data=Block{minecraft:cyan_terracotta},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-106, y=44, z=98},type=CYAN_TERRACOTTA,data=Block{minecraft:cyan_terracotta},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=45, z=98},type=CYAN_TERRACOTTA,data=Block{minecraft:cyan_terracotta},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-106, y=46, z=98},type=BARRIER,data=Block{minecraft:barrier},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=45, z=98},type=CYAN_TERRACOTTA,data=Block{minecraft:cyan_terracotta},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-106, y=45, z=97},type=CYAN_TERRACOTTA,data=Block{minecraft:cyan_terracotta},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=45, z=98},type=CYAN_TERRACOTTA,data=Block{minecraft:cyan_terracotta},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-106, y=45, z=99},type=SMOOTH_STONE,data=Block{minecraft:smooth_stone},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=47, z=98},type=NOTE_BLOCK,data=Block{minecraft:note_block}[instrument=custom_head,note=9,powered=true],fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-107, y=47, z=98},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=47, z=98},type=NOTE_BLOCK,data=Block{minecraft:note_block}[instrument=custom_head,note=9,powered=true],fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-105, y=47, z=98},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=47, z=98},type=NOTE_BLOCK,data=Block{minecraft:note_block}[instrument=custom_head,note=9,powered=true],fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-106, y=46, z=98},type=BARRIER,data=Block{minecraft:barrier},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=47, z=98},type=NOTE_BLOCK,data=Block{minecraft:note_block}[instrument=custom_head,note=9,powered=true],fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-106, y=48, z=98},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=47, z=98},type=NOTE_BLOCK,data=Block{minecraft:note_block}[instrument=custom_head,note=9,powered=true],fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-106, y=47, z=97},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=47, z=98},type=NOTE_BLOCK,data=Block{minecraft:note_block}[instrument=custom_head,note=9,powered=true],fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-106, y=47, z=99},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=46, z=97},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-107, y=46, z=97},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=46, z=97},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-105, y=46, z=97},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=46, z=97},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-106, y=45, z=97},type=CYAN_TERRACOTTA,data=Block{minecraft:cyan_terracotta},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=46, z=97},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-106, y=47, z=97},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=46, z=97},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-106, y=46, z=96},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=46, z=97},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-106, y=46, z=98},type=BARRIER,data=Block{minecraft:barrier},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=46, z=99},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-107, y=46, z=99},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=46, z=99},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-105, y=46, z=99},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=46, z=99},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-106, y=45, z=99},type=SMOOTH_STONE,data=Block{minecraft:smooth_stone},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=46, z=99},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-106, y=47, z=99},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=46, z=99},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-106, y=46, z=98},type=BARRIER,data=Block{minecraft:barrier},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=46, z=99},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-106, y=46, z=100},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-107, y=46, z=98},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-108, y=46, z=98},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-107, y=46, z=98},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-106, y=46, z=98},type=BARRIER,data=Block{minecraft:barrier},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-107, y=46, z=98},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-107, y=45, z=98},type=SMOOTH_STONE,data=Block{minecraft:smooth_stone},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-107, y=46, z=98},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-107, y=47, z=98},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-107, y=46, z=98},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-107, y=46, z=97},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-107, y=46, z=98},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-107, y=46, z=99},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-105, y=46, z=98},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-106, y=46, z=98},type=BARRIER,data=Block{minecraft:barrier},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-105, y=46, z=98},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-104, y=46, z=98},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-105, y=46, z=98},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-105, y=45, z=98},type=CYAN_TERRACOTTA,data=Block{minecraft:cyan_terracotta},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-105, y=46, z=98},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-105, y=47, z=98},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-105, y=46, z=98},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-105, y=46, z=97},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-105, y=46, z=98},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-105, y=46, z=99},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=47, z=98},type=NOTE_BLOCK,data=Block{minecraft:note_block}[instrument=harp,note=9,powered=true],fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-106, y=47, z=98},type=NOTE_BLOCK,data=Block{minecraft:note_block}[instrument=harp,note=9,powered=true],fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=47, z=98},type=NOTE_BLOCK,data=Block{minecraft:note_block}[instrument=harp,note=9,powered=false],fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-107, y=47, z=98},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=47, z=98},type=NOTE_BLOCK,data=Block{minecraft:note_block}[instrument=harp,note=9,powered=false],fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-105, y=47, z=98},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=47, z=98},type=NOTE_BLOCK,data=Block{minecraft:note_block}[instrument=harp,note=9,powered=false],fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-106, y=46, z=98},type=BARRIER,data=Block{minecraft:barrier},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=47, z=98},type=NOTE_BLOCK,data=Block{minecraft:note_block}[instrument=harp,note=9,powered=false],fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-106, y=48, z=98},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=47, z=98},type=NOTE_BLOCK,data=Block{minecraft:note_block}[instrument=harp,note=9,powered=false],fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-106, y=47, z=97},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=47, z=98},type=NOTE_BLOCK,data=Block{minecraft:note_block}[instrument=harp,note=9,powered=false],fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-106, y=47, z=99},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=47, z=98},type=NOTE_BLOCK,data=Block{minecraft:note_block}[instrument=harp,note=9,powered=false],fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831} -> CraftBlock{pos=BlockPosition{x=-106, y=47, z=98},type=NOTE_BLOCK,data=Block{minecraft:note_block}[instrument=harp,note=9,powered=false],fluid=net.minecraft.world.level.material.FluidTypeEmpty@78078831}
|
|
||||||
|
|
||||||
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=46, z=100},type=SMOOTH_STONE,data=Block{minecraft:smooth_stone},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b} -> CraftBlock{pos=BlockPosition{x=-107, y=46, z=100},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=46, z=100},type=SMOOTH_STONE,data=Block{minecraft:smooth_stone},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b} -> CraftBlock{pos=BlockPosition{x=-105, y=46, z=100},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=46, z=100},type=SMOOTH_STONE,data=Block{minecraft:smooth_stone},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b} -> CraftBlock{pos=BlockPosition{x=-106, y=45, z=100},type=SMOOTH_STONE,data=Block{minecraft:smooth_stone},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=46, z=100},type=SMOOTH_STONE,data=Block{minecraft:smooth_stone},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b} -> CraftBlock{pos=BlockPosition{x=-106, y=47, z=100},type=STONE_SLAB,data=Block{minecraft:stone_slab}[type=bottom,waterlogged=false],fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=46, z=100},type=SMOOTH_STONE,data=Block{minecraft:smooth_stone},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b} -> CraftBlock{pos=BlockPosition{x=-106, y=46, z=99},type=SMOOTH_STONE,data=Block{minecraft:smooth_stone},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=46, z=100},type=SMOOTH_STONE,data=Block{minecraft:smooth_stone},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b} -> CraftBlock{pos=BlockPosition{x=-106, y=46, z=101},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b}
|
|
||||||
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=48, z=100},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b} -> CraftBlock{pos=BlockPosition{x=-107, y=48, z=100},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=48, z=100},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b} -> CraftBlock{pos=BlockPosition{x=-105, y=48, z=100},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=48, z=100},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b} -> CraftBlock{pos=BlockPosition{x=-106, y=47, z=100},type=STONE_SLAB,data=Block{minecraft:stone_slab}[type=bottom,waterlogged=false],fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=48, z=100},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b} -> CraftBlock{pos=BlockPosition{x=-106, y=49, z=100},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=48, z=100},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b} -> CraftBlock{pos=BlockPosition{x=-106, y=48, z=99},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=48, z=100},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b} -> CraftBlock{pos=BlockPosition{x=-106, y=48, z=101},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=47, z=99},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b} -> CraftBlock{pos=BlockPosition{x=-107, y=47, z=99},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=47, z=99},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b} -> CraftBlock{pos=BlockPosition{x=-105, y=47, z=99},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=47, z=99},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b} -> CraftBlock{pos=BlockPosition{x=-106, y=46, z=99},type=SMOOTH_STONE,data=Block{minecraft:smooth_stone},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=47, z=99},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b} -> CraftBlock{pos=BlockPosition{x=-106, y=48, z=99},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b}
|
|
||||||
////[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=47, z=99},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b} -> CraftBlock{pos=BlockPosition{x=-106, y=47, z=98},type=NOTE_BLOCK,data=Block{minecraft:note_block}[instrument=basedrum,note=9,powered=true],fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=47, z=99},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b} -> CraftBlock{pos=BlockPosition{x=-106, y=47, z=100},type=STONE_SLAB,data=Block{minecraft:stone_slab}[type=bottom,waterlogged=false],fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=47, z=101},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b} -> CraftBlock{pos=BlockPosition{x=-107, y=47, z=101},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=47, z=101},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b} -> CraftBlock{pos=BlockPosition{x=-105, y=47, z=101},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=47, z=101},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b} -> CraftBlock{pos=BlockPosition{x=-106, y=46, z=101},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=47, z=101},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b} -> CraftBlock{pos=BlockPosition{x=-106, y=48, z=101},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=47, z=101},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b} -> CraftBlock{pos=BlockPosition{x=-106, y=47, z=100},type=STONE_SLAB,data=Block{minecraft:stone_slab}[type=bottom,waterlogged=false],fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=47, z=101},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b} -> CraftBlock{pos=BlockPosition{x=-106, y=47, z=102},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-107, y=47, z=100},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b} -> CraftBlock{pos=BlockPosition{x=-108, y=47, z=100},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-107, y=47, z=100},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b} -> CraftBlock{pos=BlockPosition{x=-106, y=47, z=100},type=STONE_SLAB,data=Block{minecraft:stone_slab}[type=bottom,waterlogged=false],fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-107, y=47, z=100},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b} -> CraftBlock{pos=BlockPosition{x=-107, y=46, z=100},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-107, y=47, z=100},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b} -> CraftBlock{pos=BlockPosition{x=-107, y=48, z=100},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-107, y=47, z=100},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b} -> CraftBlock{pos=BlockPosition{x=-107, y=47, z=99},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-107, y=47, z=100},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b} -> CraftBlock{pos=BlockPosition{x=-107, y=47, z=101},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-105, y=47, z=100},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b} -> CraftBlock{pos=BlockPosition{x=-106, y=47, z=100},type=STONE_SLAB,data=Block{minecraft:stone_slab}[type=bottom,waterlogged=false],fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-105, y=47, z=100},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b} -> CraftBlock{pos=BlockPosition{x=-104, y=47, z=100},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-105, y=47, z=100},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b} -> CraftBlock{pos=BlockPosition{x=-105, y=46, z=100},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-105, y=47, z=100},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b} -> CraftBlock{pos=BlockPosition{x=-105, y=48, z=100},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-105, y=47, z=100},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b} -> CraftBlock{pos=BlockPosition{x=-105, y=47, z=99},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-105, y=47, z=100},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b} -> CraftBlock{pos=BlockPosition{x=-105, y=47, z=101},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b}
|
|
||||||
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=47, z=98},type=NOTE_BLOCK,data=Block{minecraft:note_block}[instrument=basedrum,note=9,powered=false],fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b} -> CraftBlock{pos=BlockPosition{x=-107, y=47, z=98},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=47, z=98},type=NOTE_BLOCK,data=Block{minecraft:note_block}[instrument=basedrum,note=9,powered=false],fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b} -> CraftBlock{pos=BlockPosition{x=-105, y=47, z=98},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=47, z=98},type=NOTE_BLOCK,data=Block{minecraft:note_block}[instrument=basedrum,note=9,powered=false],fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b} -> CraftBlock{pos=BlockPosition{x=-106, y=46, z=98},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=47, z=98},type=NOTE_BLOCK,data=Block{minecraft:note_block}[instrument=basedrum,note=9,powered=false],fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b} -> CraftBlock{pos=BlockPosition{x=-106, y=48, z=98},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=47, z=98},type=NOTE_BLOCK,data=Block{minecraft:note_block}[instrument=basedrum,note=9,powered=false],fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b} -> CraftBlock{pos=BlockPosition{x=-106, y=47, z=97},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=47, z=98},type=NOTE_BLOCK,data=Block{minecraft:note_block}[instrument=basedrum,note=9,powered=false],fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b} -> CraftBlock{pos=BlockPosition{x=-106, y=47, z=99},type=AIR,data=Block{minecraft:air},fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b}
|
|
||||||
//[STDOUT] CraftBlock{pos=BlockPosition{x=-106, y=47, z=98},type=NOTE_BLOCK,data=Block{minecraft:note_block}[instrument=basedrum,note=9,powered=false],fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b} -> CraftBlock{pos=BlockPosition{x=-106, y=47, z=98},type=NOTE_BLOCK,data=Block{minecraft:note_block}[instrument=basedrum,note=9,powered=false],fluid=net.minecraft.world.level.material.FluidTypeEmpty@1531ed7b}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPistonRetract(BlockPistonRetractEvent e) {
|
public void onPistonRetract(BlockPistonRetractEvent e) {
|
||||||
if (Region.getRegion(e.getBlock().getLocation()).get(Flag.FREEZE) == FreezeMode.ACTIVE) {
|
if (Region.getRegion(e.getBlock().getLocation()).get(Flag.FREEZE) == FreezeMode.ACTIVE) {
|
||||||
@@ -226,7 +108,7 @@ public class FreezeListener implements Listener, ScoreboardElement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
public void onBlockBreak(BlockBreakEvent e) {
|
public void onBlockBreak(BlockBreakEvent e) {
|
||||||
if (Core.getVersion() < 19) return;
|
if (Core.getVersion() < 19) return;
|
||||||
if (e.getPlayer().getInventory().getItemInMainHand().getType() == Material.DEBUG_STICK) return;
|
if (e.getPlayer().getInventory().getItemInMainHand().getType() == Material.DEBUG_STICK) return;
|
||||||
|
|||||||
+1
-1
@@ -51,7 +51,7 @@ public class TpsLib implements LuaLib {
|
|||||||
tpsLib.set("fiveMinute", getter(() -> TPSWatcher.getTPS(TPSWatcher.TPSType.FIVE_MINUTES)));
|
tpsLib.set("fiveMinute", getter(() -> TPSWatcher.getTPS(TPSWatcher.TPSType.FIVE_MINUTES)));
|
||||||
tpsLib.set("tenMinute", getter(() -> TPSWatcher.getTPS(TPSWatcher.TPSType.TEN_MINUTES)));
|
tpsLib.set("tenMinute", getter(() -> TPSWatcher.getTPS(TPSWatcher.TPSType.TEN_MINUTES)));
|
||||||
tpsLib.set("current", getter(TPSWatcher::getTPS));
|
tpsLib.set("current", getter(TPSWatcher::getTPS));
|
||||||
tpsLib.set("limit", getter(TPSSystem::getCurrentTPSLimit));
|
tpsLib.set("limit", getter(tpsSystem::getCurrentTPSLimit));
|
||||||
return tpsLib;
|
return tpsLib;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -76,7 +76,7 @@ public class SimulatorCommand extends SWCommand {
|
|||||||
|
|
||||||
@Register(value = "start", description = "SIMULATOR_START_HELP")
|
@Register(value = "start", description = "SIMULATOR_START_HELP")
|
||||||
public void start(@Validator Player p, @ErrorMessage("SIMULATOR_NOT_EXISTS") Simulator simulator) {
|
public void start(@Validator Player p, @ErrorMessage("SIMULATOR_NOT_EXISTS") Simulator simulator) {
|
||||||
SimulatorExecutor.run(simulator, () -> {});
|
SimulatorExecutor.run(simulator);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Register(value = "rename", description = "SIMULATOR_RENAME_HELP")
|
@Register(value = "rename", description = "SIMULATOR_RENAME_HELP")
|
||||||
|
|||||||
+2
-12
@@ -168,19 +168,9 @@ public class SimulatorCursor implements Listener {
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Simulator simulator = SimulatorStorage.getSimulator(player);
|
Simulator simulator = SimulatorStorage.getSimulator(player);
|
||||||
if (simulator != null && simulator.getStabGenerator() != null) {
|
|
||||||
removeCursor(player);
|
|
||||||
SimulatorWatcher.show(null, player);
|
|
||||||
SWUtils.sendToActionbar(player, "§cGenerating Stab");
|
|
||||||
synchronized (calculating) {
|
|
||||||
calculating.remove(player);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
SimulatorWatcher.show(simulator, player);
|
SimulatorWatcher.show(simulator, player);
|
||||||
|
|
||||||
List<REntity> entities = SimulatorWatcher.getEntitiesOfSimulator(simulator);
|
List<REntity> entities = SimulatorWatcher.getEntitiesOfSimulator(simulator);
|
||||||
RayTraceUtils.RRayTraceResult rayTraceResult = RayTraceUtils.traceREntity(player, player.getLocation(), entities);
|
RayTraceUtils.RRayTraceResult rayTraceResult = RayTraceUtils.traceREntity(player, player.getLocation(), entities);
|
||||||
if (rayTraceResult == null) {
|
if (rayTraceResult == null) {
|
||||||
@@ -367,7 +357,7 @@ public class SimulatorCursor implements Listener {
|
|||||||
if (simulator == null) {
|
if (simulator == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
SimulatorExecutor.run(simulator, () -> {});
|
SimulatorExecutor.run(simulator);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -20,7 +20,6 @@
|
|||||||
package de.steamwar.bausystem.features.simulator.data;
|
package de.steamwar.bausystem.features.simulator.data;
|
||||||
|
|
||||||
import de.steamwar.bausystem.features.simulator.execute.SimulatorAction;
|
import de.steamwar.bausystem.features.simulator.execute.SimulatorAction;
|
||||||
import de.steamwar.bausystem.features.simulator.execute.SimulatorStabGenerator;
|
|
||||||
import de.steamwar.inventory.InvCallback;
|
import de.steamwar.inventory.InvCallback;
|
||||||
import de.steamwar.inventory.SWItem;
|
import de.steamwar.inventory.SWItem;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
@@ -31,13 +30,13 @@ import org.bukkit.entity.Player;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.function.BiConsumer;
|
import java.util.function.BiConsumer;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public final class Simulator {
|
public final class Simulator {
|
||||||
private SimulatorStabGenerator stabGenerator = null;
|
|
||||||
private Material material = Material.BARREL;
|
private Material material = Material.BARREL;
|
||||||
private final String name;
|
private final String name;
|
||||||
private boolean autoTrace = false;
|
private boolean autoTrace = false;
|
||||||
|
|||||||
-1
@@ -60,7 +60,6 @@ public final class TNTPhase extends SimulatorPhase {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void toSimulatorActions(Vector position, BiConsumer<Integer, SimulatorAction> tickStart, BiConsumer<Integer, SimulatorAction> tickEnd) {
|
public void toSimulatorActions(Vector position, BiConsumer<Integer, SimulatorAction> tickStart, BiConsumer<Integer, SimulatorAction> tickEnd) {
|
||||||
if (count <= 0) return;
|
|
||||||
tickStart.accept(tickOffset, new SimulatorAction(order, count) {
|
tickStart.accept(tickOffset, new SimulatorAction(order, count) {
|
||||||
@Override
|
@Override
|
||||||
public void accept(World world) {
|
public void accept(World world) {
|
||||||
|
|||||||
-34
@@ -1,34 +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.features.simulator.execute;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import org.bukkit.util.Vector;
|
|
||||||
|
|
||||||
import java.util.function.Function;
|
|
||||||
|
|
||||||
@AllArgsConstructor
|
|
||||||
public enum Direction {
|
|
||||||
X(Vector::getBlockX),
|
|
||||||
Y(Vector::getBlockY),
|
|
||||||
Z(Vector::getBlockZ);
|
|
||||||
|
|
||||||
public final Function<Vector, Integer> component;
|
|
||||||
}
|
|
||||||
+3
-5
@@ -46,7 +46,7 @@ public class SimulatorExecutor implements Listener {
|
|||||||
private static Map<Long, Map<Integer, List<SimulatorAction>>> tickStartActions = new HashMap<>();
|
private static Map<Long, Map<Integer, List<SimulatorAction>>> tickStartActions = new HashMap<>();
|
||||||
private static Map<Long, List<SimulatorAction>> tickEndActions = new HashMap<>();
|
private static Map<Long, List<SimulatorAction>> tickEndActions = new HashMap<>();
|
||||||
|
|
||||||
public static boolean run(Simulator simulator, Runnable onEnd) {
|
public static boolean run(Simulator simulator) {
|
||||||
if (currentlyRunning.contains(simulator)) return false;
|
if (currentlyRunning.contains(simulator)) return false;
|
||||||
currentlyRunning.add(simulator);
|
currentlyRunning.add(simulator);
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ public class SimulatorExecutor implements Listener {
|
|||||||
public void accept(World world) {
|
public void accept(World world) {
|
||||||
currentlyRunning.remove(simulator);
|
currentlyRunning.remove(simulator);
|
||||||
|
|
||||||
if (simulator.isAutoTrace() && onEnd == null) {
|
if (simulator.isAutoTrace()) {
|
||||||
simulator.getGroups()
|
simulator.getGroups()
|
||||||
.stream()
|
.stream()
|
||||||
.map(SimulatorGroup::getElements)
|
.map(SimulatorGroup::getElements)
|
||||||
@@ -82,12 +82,10 @@ public class SimulatorExecutor implements Listener {
|
|||||||
TraceRecorder.instance.stopRecording(region);
|
TraceRecorder.instance.stopRecording(region);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onEnd.run();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (simulator.isAutoTrace() && onEnd == null) {
|
if (simulator.isAutoTrace()) {
|
||||||
simulator.getGroups()
|
simulator.getGroups()
|
||||||
.stream()
|
.stream()
|
||||||
.map(SimulatorGroup::getElements)
|
.map(SimulatorGroup::getElements)
|
||||||
|
|||||||
-45
@@ -1,45 +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.features.simulator.execute;
|
|
||||||
|
|
||||||
import de.steamwar.bausystem.features.simulator.data.Simulator;
|
|
||||||
import de.steamwar.bausystem.features.simulator.data.tnt.TNTElement;
|
|
||||||
import de.steamwar.bausystem.region.Region;
|
|
||||||
import de.steamwar.bausystem.utils.bossbar.BossBarService;
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
public class SimulatorStabGenerator {
|
|
||||||
|
|
||||||
private final StabData stabData;
|
|
||||||
|
|
||||||
public SimulatorStabGenerator(Region region, Simulator simulator, TNTElement tntElement, int depthLimit) {
|
|
||||||
stabData = new StabData(region, simulator, tntElement, tntElement.getPhases(), depthLimit);
|
|
||||||
new StabSetup(stabData);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void cancel() {
|
|
||||||
stabData.cancel = true;
|
|
||||||
stabData.simulator.setStabGenerator(null);
|
|
||||||
for (Player player : Bukkit.getOnlinePlayers()) {
|
|
||||||
BossBarService.instance.remove(player, stabData.region, "simulator_stab_generator");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-52
@@ -1,52 +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.features.simulator.execute;
|
|
||||||
|
|
||||||
import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
|
||||||
import de.steamwar.bausystem.features.simulator.data.Simulator;
|
|
||||||
import de.steamwar.bausystem.features.simulator.data.tnt.TNTElement;
|
|
||||||
import de.steamwar.bausystem.features.simulator.data.tnt.TNTPhase;
|
|
||||||
import de.steamwar.bausystem.region.Region;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.logging.Level;
|
|
||||||
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class StabData {
|
|
||||||
|
|
||||||
protected static final int MAX_RECORDINGS = 5;
|
|
||||||
protected static final int MAX_TICK_DIFFERENCE = 3;
|
|
||||||
protected static final Level LEVEL = Level.INFO;
|
|
||||||
protected static final int TNT_INCREASE = 10;
|
|
||||||
protected static final int MIN_BLOCK_TO_COUNT_AS_DEPTH = 20;
|
|
||||||
|
|
||||||
protected final Region region;
|
|
||||||
protected final Simulator simulator;
|
|
||||||
protected final TNTElement tntElement;
|
|
||||||
protected final List<TNTPhase> phases;
|
|
||||||
protected final int depthLimit;
|
|
||||||
|
|
||||||
protected Clipboard clipboard;
|
|
||||||
protected boolean cancel = false;
|
|
||||||
|
|
||||||
protected Direction direction = null;
|
|
||||||
protected int currentDepth = 0;
|
|
||||||
}
|
|
||||||
-103
@@ -1,103 +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.features.simulator.execute;
|
|
||||||
|
|
||||||
import com.sk89q.worldedit.EditSession;
|
|
||||||
import com.sk89q.worldedit.WorldEdit;
|
|
||||||
import com.sk89q.worldedit.bukkit.BukkitWorld;
|
|
||||||
import com.sk89q.worldedit.regions.CuboidRegion;
|
|
||||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
|
||||||
import de.steamwar.bausystem.features.simulator.data.SimulatorPhase;
|
|
||||||
import de.steamwar.bausystem.features.tracer.TNTPoint;
|
|
||||||
import de.steamwar.bausystem.features.tracer.Trace;
|
|
||||||
import de.steamwar.bausystem.features.tracer.TraceManager;
|
|
||||||
import de.steamwar.bausystem.features.tracer.TraceRecorder;
|
|
||||||
import de.steamwar.bausystem.utils.bossbar.BauSystemBossbar;
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.util.Vector;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
public class StabDirection extends StabStep {
|
|
||||||
|
|
||||||
public StabDirection(StabData data) {
|
|
||||||
super(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void start() {
|
|
||||||
try (EditSession e = WorldEdit.getInstance().getEditSessionFactory().getEditSession(new BukkitWorld(Bukkit.getWorlds().get(0)), -1)) {
|
|
||||||
e.setBlocks((com.sk89q.worldedit.regions.Region) new CuboidRegion(data.region.getMinPointTestblockExtension().toBlockVector3(), data.region.getMaxPointTestblockExtension().toBlockVector3()), Objects.requireNonNull(BlockTypes.AIR).getDefaultState().toBaseBlock());
|
|
||||||
}
|
|
||||||
|
|
||||||
Trace trace = TraceRecorder.instance.startRecording(data.region);
|
|
||||||
runSimulator(() -> {
|
|
||||||
TraceRecorder.instance.stopRecording(data.region);
|
|
||||||
calculateDirection(trace);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void calculateDirection(Trace trace) {
|
|
||||||
long tickSinceStart = -1;
|
|
||||||
List<TNTPoint> points = null;
|
|
||||||
for (List<TNTPoint> current : trace.getHistories()) {
|
|
||||||
long ticks = current.get(0).getTicksSinceStart();
|
|
||||||
if (points == null || ticks > tickSinceStart) {
|
|
||||||
tickSinceStart = ticks;
|
|
||||||
points = current;
|
|
||||||
} else if (ticks == tickSinceStart && points.get(0).getTntId() < current.get(0).getTntId()) {
|
|
||||||
points = current;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
TraceManager.instance.remove(trace);
|
|
||||||
if (points == null) {
|
|
||||||
stop();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
TNTPoint current = points.getLast();
|
|
||||||
Vector velocity = current.getVelocity();
|
|
||||||
if (velocity.getX() < 0) velocity.setX(-velocity.getX());
|
|
||||||
if (velocity.getY() < 0) velocity.setY(-velocity.getY());
|
|
||||||
if (velocity.getZ() < 0) velocity.setZ(-velocity.getZ());
|
|
||||||
if (velocity.getX() > velocity.getY() && velocity.getX() > velocity.getZ()) {
|
|
||||||
data.direction = Direction.X;
|
|
||||||
} else if (velocity.getY() > velocity.getX() && velocity.getY() > velocity.getZ()) {
|
|
||||||
data.direction = Direction.Y;
|
|
||||||
} else if (velocity.getZ() > velocity.getX() && velocity.getZ() > velocity.getY()) {
|
|
||||||
data.direction = Direction.Z;
|
|
||||||
} else {
|
|
||||||
stop();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Bukkit.getLogger().log(StabData.LEVEL, "Direction: {0}", data.direction);
|
|
||||||
data.phases.getFirst().setOrder(SimulatorPhase.ORDER_LIMIT);
|
|
||||||
data.phases.getFirst().setCount(StabData.TNT_INCREASE);
|
|
||||||
new StabGenerator(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void bossbar(BauSystemBossbar bossbar, boolean finished) {
|
|
||||||
bossbar.setProgress(0);
|
|
||||||
bossbar.setTitle("§eCalculating Stab Direction");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-61
@@ -1,61 +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.features.simulator.execute;
|
|
||||||
|
|
||||||
import de.steamwar.bausystem.features.tracer.Trace;
|
|
||||||
import de.steamwar.bausystem.features.tracer.TraceRecorder;
|
|
||||||
import de.steamwar.bausystem.region.flags.Flag;
|
|
||||||
import de.steamwar.bausystem.region.flags.flagvalues.ColorMode;
|
|
||||||
import de.steamwar.bausystem.region.utils.RegionExtensionType;
|
|
||||||
import de.steamwar.bausystem.region.utils.RegionType;
|
|
||||||
import de.steamwar.bausystem.utils.PasteBuilder;
|
|
||||||
import de.steamwar.bausystem.utils.bossbar.BauSystemBossbar;
|
|
||||||
|
|
||||||
public class StabFinalizer extends StabStep {
|
|
||||||
|
|
||||||
public StabFinalizer(StabData data) {
|
|
||||||
super(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void start() {
|
|
||||||
try {
|
|
||||||
PasteBuilder.ClipboardProvider clipboardProvider = new PasteBuilder.ClipboardProviderImpl(data.clipboard);
|
|
||||||
PasteBuilder pasteBuilder = new PasteBuilder(clipboardProvider)
|
|
||||||
.color(data.region.getPlain(Flag.COLOR, ColorMode.class).getColor());
|
|
||||||
data.region.reset(pasteBuilder, RegionType.TESTBLOCK, RegionExtensionType.EXTENSION);
|
|
||||||
} catch (SecurityException e) {
|
|
||||||
stop();
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
|
|
||||||
TraceRecorder.instance.startRecording(data.region);
|
|
||||||
runSimulator(() -> {
|
|
||||||
TraceRecorder.instance.stopRecording(data.region);
|
|
||||||
stop();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void bossbar(BauSystemBossbar bossbar, boolean stopped) {
|
|
||||||
bossbar.setProgress(Math.min(data.currentDepth / (double) data.depthLimit, 1.0));
|
|
||||||
bossbar.setTitle("§e" + data.currentDepth + "§8/§7" + data.depthLimit);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-250
@@ -1,250 +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.features.simulator.execute;
|
|
||||||
|
|
||||||
import de.steamwar.bausystem.features.simulator.data.tnt.TNTPhase;
|
|
||||||
import de.steamwar.bausystem.region.Region;
|
|
||||||
import de.steamwar.bausystem.region.flags.Flag;
|
|
||||||
import de.steamwar.bausystem.region.flags.flagvalues.ColorMode;
|
|
||||||
import de.steamwar.bausystem.region.utils.RegionExtensionType;
|
|
||||||
import de.steamwar.bausystem.region.utils.RegionType;
|
|
||||||
import de.steamwar.bausystem.utils.PasteBuilder;
|
|
||||||
import de.steamwar.bausystem.utils.bossbar.BauSystemBossbar;
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.Location;
|
|
||||||
import org.bukkit.event.EventHandler;
|
|
||||||
import org.bukkit.event.HandlerList;
|
|
||||||
import org.bukkit.event.Listener;
|
|
||||||
import org.bukkit.event.entity.EntityExplodeEvent;
|
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
import static de.steamwar.bausystem.features.simulator.execute.Direction.Y;
|
|
||||||
|
|
||||||
public class StabGenerator extends StabStep implements Listener {
|
|
||||||
|
|
||||||
private int recordings = 0;
|
|
||||||
private List<Integer> currentDepths = new ArrayList<>();
|
|
||||||
private int lastDepth = 0;
|
|
||||||
|
|
||||||
private int retries = 0;
|
|
||||||
|
|
||||||
private final Map<Integer, Set<Location>> destroyedBlocksPerSlice = new HashMap<>();
|
|
||||||
|
|
||||||
private Set<Integer> gabStart = new HashSet<>();
|
|
||||||
private Set<TNTPhase> failedAtLeastOnce = new HashSet<>();
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onEntityExplode(EntityExplodeEvent event) {
|
|
||||||
if (Region.getRegion(event.getEntity().getLocation()) == data.region) {
|
|
||||||
event.blockList().forEach(block -> {
|
|
||||||
if (!data.region.inRegion(block.getLocation(), RegionType.TESTBLOCK, RegionExtensionType.EXTENSION)) return;
|
|
||||||
int component = data.direction.component.apply(block.getLocation().toVector());
|
|
||||||
destroyedBlocksPerSlice.computeIfAbsent(component, __ -> new HashSet<>())
|
|
||||||
.add(block.getLocation());
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public StabGenerator(StabData data) {
|
|
||||||
super(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void start() {
|
|
||||||
try {
|
|
||||||
PasteBuilder.ClipboardProvider clipboardProvider = new PasteBuilder.ClipboardProviderImpl(data.clipboard);
|
|
||||||
PasteBuilder pasteBuilder = new PasteBuilder(clipboardProvider)
|
|
||||||
.color(data.region.getPlain(Flag.COLOR, ColorMode.class).getColor());
|
|
||||||
data.region.reset(pasteBuilder, RegionType.TESTBLOCK, RegionExtensionType.EXTENSION);
|
|
||||||
} catch (SecurityException e) {
|
|
||||||
stop();
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (data.cancel) {
|
|
||||||
HandlerList.unregisterAll(this);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
runSimulator(this::calculateStab);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void calculateStab() {
|
|
||||||
TNTPhase lastPhase = data.phases.getLast();
|
|
||||||
|
|
||||||
List<Map.Entry<Integer, Set<Location>>> locations = destroyedBlocksPerSlice.entrySet()
|
|
||||||
.stream()
|
|
||||||
.sorted(Comparator.comparingInt(Map.Entry::getKey))
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
int depth = 0;
|
|
||||||
for (int i = 0; i < locations.size(); i++) {
|
|
||||||
if (data.direction != Y && i > 0 && Math.abs(locations.get(i - 1).getKey() - locations.get(i).getKey()) > 3) {
|
|
||||||
if (gabStart.add(locations.get(i).getKey())) {
|
|
||||||
Bukkit.getLogger().log(StabData.LEVEL, "Increasing tnt count by {0} because of gap", StabData.TNT_INCREASE);
|
|
||||||
lastPhase.setCount(lastPhase.getCount() + StabData.TNT_INCREASE);
|
|
||||||
recordings = 0;
|
|
||||||
currentDepths.clear();
|
|
||||||
|
|
||||||
run();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (i == 0 || i == locations.size() - 1) {
|
|
||||||
if (locations.get(i).getValue().size() > StabData.MIN_BLOCK_TO_COUNT_AS_DEPTH) {
|
|
||||||
depth++;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
depth++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (depth > 0) {
|
|
||||||
Bukkit.getLogger().log(StabData.LEVEL, "{0} {1} {2}", new Object[]{depth, destroyedBlocksPerSlice.size(), destroyedBlocksPerSlice.values().stream().map(Set::size).collect(Collectors.toList())});
|
|
||||||
destroyedBlocksPerSlice.clear();
|
|
||||||
currentDepths.add(depth);
|
|
||||||
} else {
|
|
||||||
destroyedBlocksPerSlice.clear();
|
|
||||||
lastPhase.setTickOffset(lastPhase.getTickOffset() + 1);
|
|
||||||
Bukkit.getLogger().log(StabData.LEVEL, "No dimension - Increasing tickOffset to: {0}", lastPhase.getTickOffset());
|
|
||||||
lastPhase.setOrder(0);
|
|
||||||
if (lastPhase.getTickOffset() > 80) {
|
|
||||||
stop();
|
|
||||||
} else {
|
|
||||||
run();
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
int minDepth = currentDepths.stream().min(Integer::compareTo).orElse(0);
|
|
||||||
int maxDepth = currentDepths.stream().max(Integer::compareTo).orElse(0);
|
|
||||||
data.currentDepth = maxDepth;
|
|
||||||
|
|
||||||
int countWithoutLast = 0;
|
|
||||||
for (int i = 0; i < data.phases.size() - 1; i++) {
|
|
||||||
countWithoutLast += data.phases.get(i).getCount();
|
|
||||||
}
|
|
||||||
countWithoutLast -= gabStart.size();
|
|
||||||
|
|
||||||
boolean moreTNTNeeded = maxDepth - countWithoutLast >= lastPhase.getCount() - 5;
|
|
||||||
if (moreTNTNeeded) {
|
|
||||||
Bukkit.getLogger().log(StabData.LEVEL, "Increasing tnt count by {0}", StabData.TNT_INCREASE);
|
|
||||||
lastPhase.setCount(lastPhase.getCount() + StabData.TNT_INCREASE);
|
|
||||||
recordings = 0;
|
|
||||||
currentDepths.clear();
|
|
||||||
|
|
||||||
run();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (recordings++ < StabData.MAX_RECORDINGS) {
|
|
||||||
run();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
recordings = 0;
|
|
||||||
currentDepths.clear();
|
|
||||||
|
|
||||||
if (maxDepth - minDepth > lastPhase.getCount()) {
|
|
||||||
Bukkit.getLogger().log(StabData.LEVEL, "Stab failed at least once. Adding one tnt to {0}", minDepth - 3);
|
|
||||||
int current = 0;
|
|
||||||
TNTPhase last = null;
|
|
||||||
for (TNTPhase phase : data.phases) {
|
|
||||||
if (current < minDepth - 3) {
|
|
||||||
current += phase.getCount();
|
|
||||||
last = phase;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (failedAtLeastOnce.add(last)) {
|
|
||||||
last = null;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (last != null) {
|
|
||||||
last.setCount(last.getCount() + 1);
|
|
||||||
Bukkit.getLogger().log(StabData.LEVEL, "Added to phase {0} now has {1} tnt", new Object[]{data.phases.indexOf(last), last.getCount()});
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (last != null) {
|
|
||||||
run();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Bukkit.getLogger().log(StabData.LEVEL, "No more TNT needed on phase adjusting - {0} new count; {1} current count", new Object[]{maxDepth - countWithoutLast, lastPhase.getCount()});
|
|
||||||
lastPhase.setCount(maxDepth - countWithoutLast);
|
|
||||||
if (lastPhase.getCount() <= 0) {
|
|
||||||
Bukkit.getLogger().log(StabData.LEVEL, "Count was 0 or negative - removing last phase");
|
|
||||||
data.phases.removeLast();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (maxDepth > data.depthLimit) {
|
|
||||||
Bukkit.getLogger().log(StabData.LEVEL, "Depth is greater than {0} - finished", data.depthLimit);
|
|
||||||
new StabFinalizer(data);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (maxDepth <= lastDepth) {
|
|
||||||
if (lastPhase.getCount() <= 0) {
|
|
||||||
retries++;
|
|
||||||
}
|
|
||||||
if (lastPhase.getCount() > 0 || retries > StabData.MAX_TICK_DIFFERENCE) {
|
|
||||||
Bukkit.getLogger().log(StabData.LEVEL, "Depth is equal to last depth recorded {0} - finished", maxDepth);
|
|
||||||
new StabFinalizer(data);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
lastDepth = maxDepth;
|
|
||||||
|
|
||||||
newPhase(data, lastPhase);
|
|
||||||
run();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void newPhase(StabData data, TNTPhase lastPhase) {
|
|
||||||
Bukkit.getLogger().log(StabData.LEVEL, "Adding new phase in next tick");
|
|
||||||
TNTPhase nextPhase = new TNTPhase();
|
|
||||||
nextPhase.setCount(StabData.TNT_INCREASE);
|
|
||||||
nextPhase.setTickOffset(lastPhase.getTickOffset() + 1);
|
|
||||||
nextPhase.setXJump(lastPhase.isXJump());
|
|
||||||
nextPhase.setYJump(lastPhase.isYJump());
|
|
||||||
nextPhase.setZJump(lastPhase.isZJump());
|
|
||||||
data.phases.add(nextPhase);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void bossbar(BauSystemBossbar bossbar, boolean finished) {
|
|
||||||
bossbar.setProgress(Math.min(data.currentDepth / (double) data.depthLimit, 1.0));
|
|
||||||
if (finished) {
|
|
||||||
bossbar.setTitle("§e" + data.currentDepth + "§8/§7" + data.depthLimit);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
StringBuilder st = new StringBuilder();
|
|
||||||
st.append("§7Direction §e").append(data.direction);
|
|
||||||
st.append(" §e").append(data.currentDepth).append("§8/§7").append(data.depthLimit);
|
|
||||||
if (recordings > 0) {
|
|
||||||
st.append(" §7Retries§8:§e ").append(recordings).append("§8/§7").append(StabData.MAX_RECORDINGS);
|
|
||||||
}
|
|
||||||
bossbar.setTitle(st.toString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-85
@@ -1,85 +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.features.simulator.execute;
|
|
||||||
|
|
||||||
import de.steamwar.bausystem.features.simulator.data.SimulatorGroup;
|
|
||||||
import de.steamwar.bausystem.features.simulator.data.tnt.TNTElement;
|
|
||||||
import de.steamwar.bausystem.features.simulator.data.tnt.TNTPhase;
|
|
||||||
import de.steamwar.bausystem.features.tracer.TraceRecorder;
|
|
||||||
import de.steamwar.bausystem.utils.FlatteningWrapper;
|
|
||||||
import de.steamwar.bausystem.utils.bossbar.BauSystemBossbar;
|
|
||||||
|
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public class StabSetup extends StabStep {
|
|
||||||
|
|
||||||
public StabSetup(StabData data) {
|
|
||||||
super(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void start() {
|
|
||||||
TNTPhase tntPhase = data.simulator.getGroups().stream()
|
|
||||||
.filter(simulatorGroup -> !simulatorGroup.isDisabled())
|
|
||||||
.map(SimulatorGroup::getElements)
|
|
||||||
.flatMap(List::stream)
|
|
||||||
.filter(TNTElement.class::isInstance)
|
|
||||||
.map(TNTElement.class::cast)
|
|
||||||
.filter(tntElement -> !tntElement.isDisabled())
|
|
||||||
.filter(tntElement -> data.tntElement != tntElement)
|
|
||||||
.map(tntElement -> tntElement.getPhases().stream().max(Comparator.comparingInt(TNTPhase::getTickOffset)))
|
|
||||||
.filter(Optional::isPresent)
|
|
||||||
.map(Optional::get)
|
|
||||||
.peek(phase -> {
|
|
||||||
if (phase.getOrder() > TNTPhase.ORDER_LIMIT) {
|
|
||||||
phase.setOrder(TNTPhase.ORDER_LIMIT);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.filter(phase -> phase != data.phases.get(0))
|
|
||||||
.max(Comparator.comparingInt(TNTPhase::getTickOffset))
|
|
||||||
.orElse(null);
|
|
||||||
if (tntPhase == null) {
|
|
||||||
throw new SecurityException("");
|
|
||||||
}
|
|
||||||
|
|
||||||
TNTPhase phase = data.phases.get(0);
|
|
||||||
data.phases.clear();
|
|
||||||
data.phases.add(phase);
|
|
||||||
phase.setCount(1);
|
|
||||||
phase.setTickOffset(tntPhase.getTickOffset());
|
|
||||||
phase.setOrder(100);
|
|
||||||
|
|
||||||
TraceRecorder.instance.stopRecording(data.region);
|
|
||||||
if (TraceRecorder.instance.isAutoTraceEnabledInRegion(data.region)) {
|
|
||||||
TraceRecorder.instance.removeAutoTraceRegion(data.region);
|
|
||||||
}
|
|
||||||
data.clipboard = FlatteningWrapper.impl.copy(data.region.getMinPointTestblockExtension(), data.region.getMaxPointTestblockExtension(), data.region.getTestBlockPoint());
|
|
||||||
|
|
||||||
new StabDirection(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void bossbar(BauSystemBossbar bossbar, boolean finished) {
|
|
||||||
bossbar.setProgress(0);
|
|
||||||
bossbar.setTitle("§eSetting up Simulator");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-95
@@ -1,95 +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.features.simulator.execute;
|
|
||||||
|
|
||||||
import de.steamwar.bausystem.BauSystem;
|
|
||||||
import de.steamwar.bausystem.features.simulator.SimulatorWatcher;
|
|
||||||
import de.steamwar.bausystem.utils.bossbar.BauSystemBossbar;
|
|
||||||
import de.steamwar.bausystem.utils.bossbar.BossBarService;
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.boss.BarColor;
|
|
||||||
import org.bukkit.boss.BarStyle;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.HandlerList;
|
|
||||||
import org.bukkit.event.Listener;
|
|
||||||
|
|
||||||
public abstract class StabStep {
|
|
||||||
|
|
||||||
protected final StabData data;
|
|
||||||
|
|
||||||
protected StabStep(StabData data) {
|
|
||||||
this.data = data;
|
|
||||||
run();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected final void run() {
|
|
||||||
Bukkit.getScheduler().runTaskLater(BauSystem.getInstance(), () -> {
|
|
||||||
for (Player player : Bukkit.getOnlinePlayers()) {
|
|
||||||
BauSystemBossbar bossbar = BossBarService.instance.get(player, data.region, "simulator_stab_generator");
|
|
||||||
bossbar.setColor(BarColor.GREEN);
|
|
||||||
bossbar.setStyle(BarStyle.SEGMENTED_10);
|
|
||||||
bossbar(bossbar, false);
|
|
||||||
}
|
|
||||||
}, 1);
|
|
||||||
|
|
||||||
if (this instanceof Listener) {
|
|
||||||
Bukkit.getPluginManager().registerEvents((Listener) this, BauSystem.getInstance());
|
|
||||||
}
|
|
||||||
Bukkit.getScheduler().runTaskLater(BauSystem.getInstance(), this::start, 20);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected abstract void start();
|
|
||||||
|
|
||||||
protected final void runSimulator(Runnable onFinish) {
|
|
||||||
SimulatorExecutor.run(data.simulator, () -> {
|
|
||||||
Bukkit.getScheduler().runTaskLater(BauSystem.getInstance(), () -> {
|
|
||||||
if (this instanceof Listener) {
|
|
||||||
HandlerList.unregisterAll((Listener) this);
|
|
||||||
}
|
|
||||||
onFinish.run();
|
|
||||||
}, 20);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
protected abstract void bossbar(BauSystemBossbar bossbar, boolean stopped);
|
|
||||||
|
|
||||||
protected final void stop() {
|
|
||||||
data.simulator.setStabGenerator(null);
|
|
||||||
SimulatorWatcher.update(data.simulator);
|
|
||||||
|
|
||||||
for (Player player : Bukkit.getOnlinePlayers()) {
|
|
||||||
BauSystemBossbar bossbar = BossBarService.instance.get(player, data.region, "simulator_stab_generator");
|
|
||||||
bossbar.setColor(BarColor.GREEN);
|
|
||||||
bossbar.setStyle(BarStyle.SEGMENTED_10);
|
|
||||||
bossbar(bossbar, true);
|
|
||||||
}
|
|
||||||
new Thread(() -> {
|
|
||||||
try {
|
|
||||||
Thread.sleep(4000);
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
Thread.currentThread().interrupt();
|
|
||||||
} finally {
|
|
||||||
for (Player player : Bukkit.getOnlinePlayers()) {
|
|
||||||
BossBarService.instance.remove(player, data.region, "simulator_stab_generator");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}).start();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-11
@@ -24,11 +24,8 @@ import de.steamwar.bausystem.features.simulator.data.Simulator;
|
|||||||
import de.steamwar.bausystem.features.simulator.data.SimulatorGroup;
|
import de.steamwar.bausystem.features.simulator.data.SimulatorGroup;
|
||||||
import de.steamwar.bausystem.features.simulator.data.tnt.TNTElement;
|
import de.steamwar.bausystem.features.simulator.data.tnt.TNTElement;
|
||||||
import de.steamwar.bausystem.features.simulator.data.tnt.TNTPhase;
|
import de.steamwar.bausystem.features.simulator.data.tnt.TNTPhase;
|
||||||
import de.steamwar.bausystem.features.simulator.execute.SimulatorStabGenerator;
|
|
||||||
import de.steamwar.bausystem.features.simulator.gui.base.SimulatorAnvilGui;
|
|
||||||
import de.steamwar.bausystem.features.simulator.gui.base.SimulatorBaseGui;
|
import de.steamwar.bausystem.features.simulator.gui.base.SimulatorBaseGui;
|
||||||
import de.steamwar.bausystem.features.simulator.gui.base.SimulatorScrollGui;
|
import de.steamwar.bausystem.features.simulator.gui.base.SimulatorScrollGui;
|
||||||
import de.steamwar.bausystem.region.Region;
|
|
||||||
import de.steamwar.inventory.SWItem;
|
import de.steamwar.inventory.SWItem;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@@ -100,14 +97,6 @@ public class SimulatorTNTGui extends SimulatorScrollGui<TNTPhase> {
|
|||||||
tnt.setDisabled(!tnt.isDisabled());
|
tnt.setDisabled(!tnt.isDisabled());
|
||||||
SimulatorWatcher.update(simulator);
|
SimulatorWatcher.update(simulator);
|
||||||
}));
|
}));
|
||||||
inventory.setItem(49, new SWItem(Material.CALIBRATED_SCULK_SENSOR, "§eCreate Stab", click -> {
|
|
||||||
new SimulatorAnvilGui<>(player, "Depth Limit", "", Integer::parseInt, depthLimit -> {
|
|
||||||
if (depthLimit <= 0) return false;
|
|
||||||
simulator.setStabGenerator(new SimulatorStabGenerator(Region.getRegion(player.getLocation()), simulator, tnt, depthLimit));
|
|
||||||
SimulatorWatcher.update(simulator);
|
|
||||||
return true;
|
|
||||||
}, null).open();
|
|
||||||
}));
|
|
||||||
inventory.setItem(50, new SWItem(Material.CHEST, parent.getElements().size() == 1 ? "§eMake Group" : "§eAdd another TNT to Group", clickType -> {
|
inventory.setItem(50, new SWItem(Material.CHEST, parent.getElements().size() == 1 ? "§eMake Group" : "§eAdd another TNT to Group", clickType -> {
|
||||||
TNTElement tntElement = new TNTElement(tnt.getPosition().clone());
|
TNTElement tntElement = new TNTElement(tnt.getPosition().clone());
|
||||||
tntElement.add(new TNTPhase());
|
tntElement.add(new TNTPhase());
|
||||||
|
|||||||
+1
-1
@@ -44,7 +44,7 @@ public class SimulatorAnvilGui<T extends Number> {
|
|||||||
if (error.get()) {
|
if (error.get()) {
|
||||||
anvilInv.open();
|
anvilInv.open();
|
||||||
} else {
|
} else {
|
||||||
if (back != null) back.open();
|
back.open();
|
||||||
}
|
}
|
||||||
error.set(false);
|
error.set(false);
|
||||||
}, 0);
|
}, 0);
|
||||||
|
|||||||
+3
-17
@@ -22,6 +22,7 @@ package de.steamwar.bausystem.features.simulator.gui.base;
|
|||||||
import de.steamwar.bausystem.features.simulator.SimulatorWatcher;
|
import de.steamwar.bausystem.features.simulator.SimulatorWatcher;
|
||||||
import de.steamwar.bausystem.features.simulator.data.Simulator;
|
import de.steamwar.bausystem.features.simulator.data.Simulator;
|
||||||
import de.steamwar.core.Core;
|
import de.steamwar.core.Core;
|
||||||
|
import de.steamwar.core.TrickyTrialsWrapper;
|
||||||
import de.steamwar.inventory.SWInventory;
|
import de.steamwar.inventory.SWInventory;
|
||||||
import de.steamwar.inventory.SWItem;
|
import de.steamwar.inventory.SWItem;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
@@ -63,11 +64,7 @@ public abstract class SimulatorBaseGui {
|
|||||||
if (Core.getVersion() > 19) {
|
if (Core.getVersion() > 19) {
|
||||||
player.getOpenInventory().setTitle(title());
|
player.getOpenInventory().setTitle(title());
|
||||||
}
|
}
|
||||||
if (simulator != null && simulator.getStabGenerator() != null) {
|
populate();
|
||||||
populateStabGenerator();
|
|
||||||
} else {
|
|
||||||
populate();
|
|
||||||
}
|
|
||||||
if (player.getOpenInventory().getTopInventory() == inv) {
|
if (player.getOpenInventory().getTopInventory() == inv) {
|
||||||
inventory.open();
|
inventory.open();
|
||||||
SimulatorWatcher.watch(player, simulator, this::open);
|
SimulatorWatcher.watch(player, simulator, this::open);
|
||||||
@@ -87,21 +84,10 @@ public abstract class SimulatorBaseGui {
|
|||||||
});
|
});
|
||||||
|
|
||||||
SimulatorWatcher.watch(player, simulator, this::open);
|
SimulatorWatcher.watch(player, simulator, this::open);
|
||||||
if (simulator != null && simulator.getStabGenerator() != null) {
|
populate();
|
||||||
populateStabGenerator();
|
|
||||||
} else {
|
|
||||||
populate();
|
|
||||||
}
|
|
||||||
inventory.open();
|
inventory.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void populateStabGenerator() {
|
|
||||||
inventory.setItem(22, new SWItem(Material.BARRIER, "§cCancel Stab Generator", click -> {
|
|
||||||
simulator.getStabGenerator().cancel();
|
|
||||||
SimulatorWatcher.update(simulator);
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean shouldOpen() {
|
public boolean shouldOpen() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-2
@@ -25,7 +25,6 @@ import com.sk89q.worldedit.world.block.BaseBlock;
|
|||||||
import com.sk89q.worldedit.world.block.BlockState;
|
import com.sk89q.worldedit.world.block.BlockState;
|
||||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||||
import de.steamwar.bausystem.utils.WorldEditUtils;
|
import de.steamwar.bausystem.utils.WorldEditUtils;
|
||||||
import de.steamwar.core.Core;
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.SneakyThrows;
|
import lombok.SneakyThrows;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
@@ -57,7 +56,7 @@ public class Panzern {
|
|||||||
|
|
||||||
private BaseBlock blockType;
|
private BaseBlock blockType;
|
||||||
private BaseBlock slabType;
|
private BaseBlock slabType;
|
||||||
private static final BaseBlock jukeboxType = (Core.getVersion() > 19 ? BlockTypes.get("lodestone"): BlockTypes.get("jukebox")).getDefaultState().toBaseBlock();
|
private static final BaseBlock jukeboxType = BlockTypes.JUKEBOX.getDefaultState().toBaseBlock();
|
||||||
private static final BaseBlock cobwebType = BlockTypes.COBWEB.getDefaultState().toBaseBlock();
|
private static final BaseBlock cobwebType = BlockTypes.COBWEB.getDefaultState().toBaseBlock();
|
||||||
private static final BaseBlock airType = BlockTypes.AIR.getDefaultState().toBaseBlock();
|
private static final BaseBlock airType = BlockTypes.AIR.getDefaultState().toBaseBlock();
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -19,8 +19,8 @@
|
|||||||
|
|
||||||
package de.steamwar.bausystem.features.smartplace;
|
package de.steamwar.bausystem.features.smartplace;
|
||||||
|
|
||||||
import com.comphenix.tinyprotocol.TinyProtocol;
|
|
||||||
import de.steamwar.Reflection;
|
import de.steamwar.Reflection;
|
||||||
|
import com.comphenix.tinyprotocol.TinyProtocol;
|
||||||
import de.steamwar.bausystem.BauSystem;
|
import de.steamwar.bausystem.BauSystem;
|
||||||
import de.steamwar.bausystem.Permission;
|
import de.steamwar.bausystem.Permission;
|
||||||
import de.steamwar.bausystem.configplayer.Config;
|
import de.steamwar.bausystem.configplayer.Config;
|
||||||
@@ -223,7 +223,7 @@ public class SmartPlaceListener implements Listener {
|
|||||||
Block block = event.getBlock().getRelative(BlockFace.DOWN);
|
Block block = event.getBlock().getRelative(BlockFace.DOWN);
|
||||||
BlockState old = block.getState();
|
BlockState old = block.getState();
|
||||||
Bukkit.getScheduler().runTaskLater(BauSystem.getInstance(), () -> {
|
Bukkit.getScheduler().runTaskLater(BauSystem.getInstance(), () -> {
|
||||||
block.setType(Material.GLASS, true);
|
block.setType(Material.GLASS, false);
|
||||||
old.update(true, false);
|
old.update(true, false);
|
||||||
}, 1);
|
}, 1);
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-6
@@ -42,16 +42,16 @@ public class TPSCommand extends SWCommand {
|
|||||||
public void genericCommand(Player p, String... args) {
|
public void genericCommand(Player p, String... args) {
|
||||||
BauSystem.MESSAGE.sendPrefixless("OTHER_TPS_HEAD", p);
|
BauSystem.MESSAGE.sendPrefixless("OTHER_TPS_HEAD", p);
|
||||||
BauSystem.MESSAGE.sendPrefixless("OTHER_TPS_MESSAGE", p,
|
BauSystem.MESSAGE.sendPrefixless("OTHER_TPS_MESSAGE", p,
|
||||||
TPSWatcher.getTPSUnlimited(TPSWatcher.TPSType.ONE_SECOND),
|
TPSWatcher.getTPS(TPSWatcher.TPSType.ONE_SECOND),
|
||||||
TPSWatcher.getTPSUnlimited(TPSWatcher.TPSType.TEN_SECONDS),
|
TPSWatcher.getTPS(TPSWatcher.TPSType.TEN_SECONDS),
|
||||||
TPSWatcher.getTPSUnlimited(TPSWatcher.TPSType.ONE_MINUTE),
|
TPSWatcher.getTPS(TPSWatcher.TPSType.ONE_MINUTE),
|
||||||
TPSWatcher.getTPSUnlimited(TPSWatcher.TPSType.FIVE_MINUTES),
|
TPSWatcher.getTPS(TPSWatcher.TPSType.FIVE_MINUTES),
|
||||||
TPSWatcher.getTPSUnlimited(TPSWatcher.TPSType.TEN_MINUTES)
|
TPSWatcher.getTPS(TPSWatcher.TPSType.TEN_MINUTES)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Register
|
@Register
|
||||||
public void genericCommand(Player p, TPSWatcher.TPSType type) {
|
public void genericCommand(Player p, TPSWatcher.TPSType type) {
|
||||||
BauSystem.MESSAGE.sendPrefixless("OTHER_TPS_SINGLE", p, TPSWatcher.getTPSUnlimited(type));
|
BauSystem.MESSAGE.sendPrefixless("OTHER_TPS_SINGLE", p, tpsSystem.getTPS(type));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-7
@@ -56,7 +56,11 @@ import java.util.Arrays;
|
|||||||
public class TPSSystem implements Listener {
|
public class TPSSystem implements Listener {
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private static double currentTPSLimit = 20;
|
private double currentTPSLimit = 20;
|
||||||
|
|
||||||
|
public double getTPS(TPSWatcher.TPSType tpsType) {
|
||||||
|
return TPSWatcher.getTPSUnlimited(tpsType);
|
||||||
|
}
|
||||||
|
|
||||||
public TPSSystem() {
|
public TPSSystem() {
|
||||||
if (TPSFreezeUtils.isCanFreeze()) {
|
if (TPSFreezeUtils.isCanFreeze()) {
|
||||||
@@ -334,26 +338,26 @@ public class TPSSystem implements Listener {
|
|||||||
} else if (TPSFreezeUtils.frozen()) {
|
} else if (TPSFreezeUtils.frozen()) {
|
||||||
return "§e" + BauSystem.MESSAGE.parse("SCOREBOARD_TPS", p) + "§8: " + BauSystem.MESSAGE.parse("SCOREBOARD_TPS_FROZEN", p);
|
return "§e" + BauSystem.MESSAGE.parse("SCOREBOARD_TPS", p) + "§8: " + BauSystem.MESSAGE.parse("SCOREBOARD_TPS_FROZEN", p);
|
||||||
} else {
|
} else {
|
||||||
return "§e" + BauSystem.MESSAGE.parse("SCOREBOARD_TPS", p) + "§8: " + tpsColor() + TPSWatcher.getTPSUnlimited(TPSWatcher.TPSType.ONE_SECOND) + tpsLimit();
|
return "§e" + BauSystem.MESSAGE.parse("SCOREBOARD_TPS", p) + "§8: " + tpsColor() + tpsSystem.getTPS(TPSWatcher.TPSType.ONE_SECOND) + tpsLimit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private String tpsColor() {
|
private String tpsColor() {
|
||||||
double tps = TPSWatcher.getTPSUnlimited(TPSWatcher.TPSType.ONE_SECOND);
|
double tps = tpsSystem.getTPS(TPSWatcher.TPSType.ONE_SECOND);
|
||||||
if (tps > TPSSystem.getCurrentTPSLimit() * 0.9) {
|
if (tps > tpsSystem.getCurrentTPSLimit() * 0.9) {
|
||||||
return "§a";
|
return "§a";
|
||||||
}
|
}
|
||||||
if (tps > TPSSystem.getCurrentTPSLimit() * 0.5) {
|
if (tps > tpsSystem.getCurrentTPSLimit() * 0.5) {
|
||||||
return "§e";
|
return "§e";
|
||||||
}
|
}
|
||||||
return "§c";
|
return "§c";
|
||||||
}
|
}
|
||||||
|
|
||||||
private String tpsLimit() {
|
private String tpsLimit() {
|
||||||
if (TPSSystem.getCurrentTPSLimit() == 20) {
|
if (tpsSystem.getCurrentTPSLimit() == 20) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
return "§8/§7" + TPSSystem.getCurrentTPSLimit();
|
return "§8/§7" + tpsSystem.getCurrentTPSLimit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-5
@@ -102,14 +102,11 @@ public class TraceRecorder implements Listener {
|
|||||||
*
|
*
|
||||||
* @param region region to be recorded
|
* @param region region to be recorded
|
||||||
*/
|
*/
|
||||||
public Trace startRecording(Region region) {
|
public void startRecording(Region region) {
|
||||||
if (activeTraces.containsKey(region)) {
|
if (activeTraces.containsKey(region)) return;
|
||||||
return activeTraces.get(region).getTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
TraceRecordingWrapper wrappedTrace = new TraceRecordingWrapper(region);
|
TraceRecordingWrapper wrappedTrace = new TraceRecordingWrapper(region);
|
||||||
activeTraces.put(region, wrappedTrace);
|
activeTraces.put(region, wrappedTrace);
|
||||||
return wrappedTrace.getTrace();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
-5
@@ -20,7 +20,6 @@
|
|||||||
package de.steamwar.bausystem.features.tracer.rendering;
|
package de.steamwar.bausystem.features.tracer.rendering;
|
||||||
|
|
||||||
import de.steamwar.bausystem.BauSystem;
|
import de.steamwar.bausystem.BauSystem;
|
||||||
import de.steamwar.bausystem.configplayer.Config;
|
|
||||||
import de.steamwar.bausystem.features.tracer.TNTPoint;
|
import de.steamwar.bausystem.features.tracer.TNTPoint;
|
||||||
import de.steamwar.bausystem.features.tracer.Trace;
|
import de.steamwar.bausystem.features.tracer.Trace;
|
||||||
import de.steamwar.bausystem.features.tracer.TraceManager;
|
import de.steamwar.bausystem.features.tracer.TraceManager;
|
||||||
@@ -31,13 +30,10 @@ import net.md_5.bungee.api.chat.ClickEvent;
|
|||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import yapion.hierarchy.types.YAPIONValue;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static de.steamwar.bausystem.features.util.TNTClickListener.TNT_CLICK_DETAILS;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wrapper for the rendering of a record bundle
|
* Wrapper for the rendering of a record bundle
|
||||||
*/
|
*/
|
||||||
@@ -70,7 +66,6 @@ public class TraceEntity extends RFallingBlockEntity {
|
|||||||
* @param player the player the message should be printed for
|
* @param player the player the message should be printed for
|
||||||
*/
|
*/
|
||||||
public void printIntoChat(Player player) {
|
public void printIntoChat(Player player) {
|
||||||
if (!Config.getInstance().get(player).getOrSetDefault(TNT_CLICK_DETAILS, new YAPIONValue<>(true)).asBoolean().orElse(true)) return;
|
|
||||||
TNTPoint representative = records.get(0);
|
TNTPoint representative = records.get(0);
|
||||||
|
|
||||||
BauSystem.MESSAGE.sendPrefixless("TNT_CLICK_HEADER", player);
|
BauSystem.MESSAGE.sendPrefixless("TNT_CLICK_HEADER", player);
|
||||||
|
|||||||
+1
-25
@@ -21,46 +21,22 @@ package de.steamwar.bausystem.features.util;
|
|||||||
|
|
||||||
import de.steamwar.bausystem.BauSystem;
|
import de.steamwar.bausystem.BauSystem;
|
||||||
import de.steamwar.bausystem.Permission;
|
import de.steamwar.bausystem.Permission;
|
||||||
import de.steamwar.bausystem.configplayer.Config;
|
|
||||||
import de.steamwar.command.SWCommand;
|
|
||||||
import de.steamwar.linkage.Linked;
|
import de.steamwar.linkage.Linked;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.entity.TNTPrimed;
|
import org.bukkit.entity.TNTPrimed;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||||
import org.bukkit.inventory.EquipmentSlot;
|
import org.bukkit.inventory.EquipmentSlot;
|
||||||
import yapion.hierarchy.types.YAPIONObject;
|
|
||||||
import yapion.hierarchy.types.YAPIONValue;
|
|
||||||
|
|
||||||
@Linked
|
@Linked
|
||||||
public class TNTClickListener extends SWCommand implements Listener {
|
public class TNTClickListener implements Listener {
|
||||||
|
|
||||||
public static final String TNT_CLICK_DETAILS = "tnt_click_details";
|
|
||||||
|
|
||||||
public TNTClickListener() {
|
|
||||||
super("tntdetails");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Register(description = "TNT_DETAILS_COMMAND")
|
|
||||||
public void toggle(Player player) {
|
|
||||||
YAPIONObject yapionObject = Config.getInstance().get(player);
|
|
||||||
if (yapionObject.getOrSetDefault(TNT_CLICK_DETAILS, new YAPIONValue<>(true)).asBoolean().orElse(true)) {
|
|
||||||
yapionObject.put(TNT_CLICK_DETAILS, false);
|
|
||||||
BauSystem.MESSAGE.send("TNT_DETAILS_OFF", player);
|
|
||||||
} else {
|
|
||||||
yapionObject.put(TNT_CLICK_DETAILS, true);
|
|
||||||
BauSystem.MESSAGE.send("TNT_DETAILS_ON", player);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerInteractEntity(PlayerInteractEntityEvent event) {
|
public void onPlayerInteractEntity(PlayerInteractEntityEvent event) {
|
||||||
if (!Permission.BUILD.hasPermission(event.getPlayer())) return;
|
if (!Permission.BUILD.hasPermission(event.getPlayer())) return;
|
||||||
if (event.getHand() != EquipmentSlot.HAND) return;
|
if (event.getHand() != EquipmentSlot.HAND) return;
|
||||||
if (!Config.getInstance().get(event.getPlayer()).getOrSetDefault(TNT_CLICK_DETAILS, new YAPIONValue<>(true)).asBoolean().orElse(true)) return;
|
|
||||||
|
|
||||||
Entity entity = event.getRightClicked();
|
Entity entity = event.getRightClicked();
|
||||||
if (event.getRightClicked() instanceof TNTPrimed) {
|
if (event.getRightClicked() instanceof TNTPrimed) {
|
||||||
|
|||||||
+1
-6
@@ -179,12 +179,7 @@ public class SpectatorListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||||
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) {
|
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) {
|
||||||
if (event.getMessage().startsWith("/schem save") ||
|
if (event.getMessage().startsWith("/schem save") || event.getMessage().startsWith("//schem save") || event.getMessage().startsWith("/schematic save") || event.getMessage().startsWith("//schematic save")) {
|
||||||
event.getMessage().startsWith("//schem save") ||
|
|
||||||
event.getMessage().startsWith("/schematic save") ||
|
|
||||||
event.getMessage().startsWith("//schematic save") ||
|
|
||||||
event.getMessage().startsWith("/download") ||
|
|
||||||
event.getMessage().startsWith("//download")) {
|
|
||||||
if (!Permission.SUPERVISOR.hasPermission(event.getPlayer())) {
|
if (!Permission.SUPERVISOR.hasPermission(event.getPlayer())) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
event.setMessage("/");
|
event.setMessage("/");
|
||||||
|
|||||||
@@ -73,8 +73,4 @@ public class Point {
|
|||||||
public Location toLocation(Player player, double dx, double dy, double dz) {
|
public Location toLocation(Player player, double dx, double dy, double dz) {
|
||||||
return new Location(player.getWorld(), x + dx, y + dy, z + dz, player.getLocation().getYaw(), player.getLocation().getPitch());
|
return new Location(player.getWorld(), x + dx, y + dy, z + dz, player.getLocation().getYaw(), player.getLocation().getPitch());
|
||||||
}
|
}
|
||||||
|
|
||||||
public BlockVector3 toBlockVector3() {
|
|
||||||
return BlockVector3.at(this.x, this.y, this.z);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,204 +0,0 @@
|
|||||||
package de.steamwar.bausystem.utils.cursor;
|
|
||||||
|
|
||||||
import de.steamwar.bausystem.utils.RayTraceUtils;
|
|
||||||
import de.steamwar.entity.REntity;
|
|
||||||
import de.steamwar.entity.REntityServer;
|
|
||||||
import de.steamwar.entity.RFallingBlockEntity;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.Location;
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.World;
|
|
||||||
import org.bukkit.block.BlockFace;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.EventHandler;
|
|
||||||
import org.bukkit.event.block.Action;
|
|
||||||
import org.bukkit.util.Vector;
|
|
||||||
import yapion.hierarchy.types.YAPIONType;
|
|
||||||
|
|
||||||
import java.util.function.BiConsumer;
|
|
||||||
import java.util.function.BiFunction;
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
public class RCursor {
|
|
||||||
private final World WORLD = Bukkit.getWorlds().get(0);
|
|
||||||
|
|
||||||
private final REntityServer targetServer;
|
|
||||||
private final REntityServer cursorServer;
|
|
||||||
|
|
||||||
private final Player owner;
|
|
||||||
private final Material highlightMaterial;
|
|
||||||
private final ClickHandler onClickHandler;
|
|
||||||
|
|
||||||
private RFallingBlockEntity cursorEntity;
|
|
||||||
|
|
||||||
private Location cursorLocation;
|
|
||||||
private boolean isHittingEntity = false;
|
|
||||||
|
|
||||||
@Setter
|
|
||||||
private Material cursorMaterial;
|
|
||||||
@Setter
|
|
||||||
private CursorMode cursorMode;
|
|
||||||
private boolean visible = true;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public RCursor(REntityServer targetServer, Player owner, Material highlightMaterial, Material cursorMaterial, CursorMode cursorMode, ClickHandler onClickHandler) {
|
|
||||||
this.targetServer = targetServer;
|
|
||||||
this.owner = owner;
|
|
||||||
this.highlightMaterial = highlightMaterial;
|
|
||||||
this.cursorMaterial = cursorMaterial;
|
|
||||||
this.cursorMode = cursorMode;
|
|
||||||
this.onClickHandler = onClickHandler;
|
|
||||||
|
|
||||||
cursorServer = new REntityServer();
|
|
||||||
cursorServer.addPlayer(owner);
|
|
||||||
|
|
||||||
RCursorManager.getInstance().registerCursor(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void render() {
|
|
||||||
if (!visible) return;
|
|
||||||
|
|
||||||
RayTraceUtils.RRayTraceResult rayTraceResult = RayTraceUtils.traceREntity(owner, owner.getLocation(), targetServer.getEntities());
|
|
||||||
if (rayTraceResult == null) {
|
|
||||||
if(cursorEntity != null) cursorEntity.die();
|
|
||||||
cursorEntity = null;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
REntity hitEntity = rayTraceResult.getHitEntity() == cursorEntity ? null : rayTraceResult.getHitEntity();
|
|
||||||
|
|
||||||
|
|
||||||
Material activeCursorMaterial = hitEntity == null ? cursorMaterial : highlightMaterial;
|
|
||||||
Location activeCursorLocation = hitEntity == null ? cursorMode.positionTransform.apply(owner, rayTraceResult).toLocation(WORLD)
|
|
||||||
: new Vector(hitEntity.getX(), hitEntity.getY(), hitEntity.getZ()).toLocation(WORLD);
|
|
||||||
|
|
||||||
cursorLocation = activeCursorLocation;
|
|
||||||
isHittingEntity = hitEntity != null;
|
|
||||||
|
|
||||||
if (cursorEntity == null) {
|
|
||||||
cursorEntity = new RFallingBlockEntity(cursorServer, activeCursorLocation, activeCursorMaterial);
|
|
||||||
cursorEntity.setNoGravity(true);
|
|
||||||
} if (cursorEntity.getMaterial() == activeCursorMaterial) {
|
|
||||||
cursorEntity.move(activeCursorLocation);
|
|
||||||
} else {
|
|
||||||
cursorEntity.die();
|
|
||||||
cursorEntity = new RFallingBlockEntity(cursorServer, activeCursorLocation, activeCursorMaterial);
|
|
||||||
cursorEntity.setNoGravity(true);
|
|
||||||
if(activeCursorMaterial == highlightMaterial) {
|
|
||||||
cursorEntity.setGlowing(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void hide() {
|
|
||||||
visible = false;
|
|
||||||
if (cursorEntity != null) {
|
|
||||||
cursorEntity.die();
|
|
||||||
cursorEntity = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void show() {
|
|
||||||
visible = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void handleClick(Action action) {
|
|
||||||
if(!visible || cursorLocation == null) return;
|
|
||||||
|
|
||||||
onClickHandler.handle(cursorLocation, isHittingEntity, action);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void close() {
|
|
||||||
cursorServer.close();
|
|
||||||
RCursorManager.getInstance().unregisterCursor(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@AllArgsConstructor
|
|
||||||
public enum CursorMode {
|
|
||||||
FREE((player, rayTraceResult) -> {
|
|
||||||
Vector pos = rayTraceResult.getHitPosition();
|
|
||||||
|
|
||||||
BlockFace face = rayTraceResult.getHitBlockFace();
|
|
||||||
if (face != null) {
|
|
||||||
switch (face) {
|
|
||||||
case DOWN:
|
|
||||||
pos.setY(pos.getY() - 0.98);
|
|
||||||
break;
|
|
||||||
case EAST:
|
|
||||||
pos.setX(pos.getX() + 0.49);
|
|
||||||
break;
|
|
||||||
case WEST:
|
|
||||||
pos.setX(pos.getX() - 0.49);
|
|
||||||
break;
|
|
||||||
case NORTH:
|
|
||||||
pos.setZ(pos.getZ() - 0.49);
|
|
||||||
break;
|
|
||||||
case SOUTH:
|
|
||||||
pos.setZ(pos.getZ() + 0.49);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (face.getModY() == 0 && player.isSneaking()) {
|
|
||||||
pos.setY(pos.getY() - 0.49);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!player.isSneaking()) {
|
|
||||||
pos.setX(pos.getBlockX() + 0.5);
|
|
||||||
if (face == null || face.getModY() == 0)
|
|
||||||
pos.setY(pos.getBlockY() + 0.0);
|
|
||||||
pos.setZ(pos.getBlockZ() + 0.5);
|
|
||||||
}
|
|
||||||
|
|
||||||
return pos;
|
|
||||||
}),
|
|
||||||
BLOCK_ALIGNED((player, rayTraceResult) -> {
|
|
||||||
Vector pos = rayTraceResult.getHitPosition();
|
|
||||||
|
|
||||||
BlockFace face = rayTraceResult.getHitBlockFace();
|
|
||||||
if (face != null) {
|
|
||||||
switch (face) {
|
|
||||||
case DOWN:
|
|
||||||
pos.setY(pos.getY() - 0.98);
|
|
||||||
break;
|
|
||||||
case EAST:
|
|
||||||
pos.setX(pos.getX() + 0.49);
|
|
||||||
break;
|
|
||||||
case WEST:
|
|
||||||
pos.setX(pos.getX() - 0.49);
|
|
||||||
break;
|
|
||||||
case NORTH:
|
|
||||||
pos.setZ(pos.getZ() - 0.49);
|
|
||||||
break;
|
|
||||||
case SOUTH:
|
|
||||||
pos.setZ(pos.getZ() + 0.49);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pos.setX(pos.getBlockX() + 0.5);
|
|
||||||
if (pos.getY() - pos.getBlockY() != 0 && face == BlockFace.UP) {
|
|
||||||
pos.setY(pos.getBlockY() + 1.0);
|
|
||||||
} else {
|
|
||||||
pos.setY(pos.getBlockY());
|
|
||||||
}
|
|
||||||
pos.setZ(pos.getBlockZ() + 0.5);
|
|
||||||
return pos;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
private final BiFunction<Player, RayTraceUtils.RRayTraceResult, Vector> positionTransform;
|
|
||||||
}
|
|
||||||
|
|
||||||
public interface ClickHandler{
|
|
||||||
public void handle(Location cursorLocation, boolean didHitEntity, Action action);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,112 +0,0 @@
|
|||||||
package de.steamwar.bausystem.utils.cursor;
|
|
||||||
|
|
||||||
import com.comphenix.tinyprotocol.TinyProtocol;
|
|
||||||
import de.steamwar.Reflection;
|
|
||||||
import de.steamwar.bausystem.BauSystem;
|
|
||||||
import de.steamwar.linkage.Linked;
|
|
||||||
import lombok.Getter;
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.EventHandler;
|
|
||||||
import org.bukkit.event.Listener;
|
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
|
||||||
import org.bukkit.event.player.PlayerQuitEvent;
|
|
||||||
|
|
||||||
import java.lang.ref.SoftReference;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.function.BiFunction;
|
|
||||||
|
|
||||||
@Linked
|
|
||||||
public class RCursorManager implements Listener {
|
|
||||||
@Getter
|
|
||||||
private static RCursorManager instance;
|
|
||||||
|
|
||||||
private final Set<Player> calculationActive = new HashSet<>();
|
|
||||||
private final Map<Player, RCursor> activeCursors = new HashMap<>();
|
|
||||||
|
|
||||||
public RCursorManager() {
|
|
||||||
if (instance == null) {
|
|
||||||
instance = this;
|
|
||||||
}
|
|
||||||
|
|
||||||
BiFunction<Player, Object, Object> function = (player, object) -> {
|
|
||||||
updateCursor(player);
|
|
||||||
return object;
|
|
||||||
};
|
|
||||||
|
|
||||||
Bukkit.getScheduler().runTaskLater(BauSystem.getInstance(), () -> {
|
|
||||||
Set<Player> playersWithActiveCursor = activeCursors.keySet();
|
|
||||||
|
|
||||||
playersWithActiveCursor.forEach(this::updateCursor);
|
|
||||||
}, 0);
|
|
||||||
|
|
||||||
Class<?> positionPacketClass = Reflection.getClass("net.minecraft.network.protocol.game.ServerboundMovePlayerPacket$Pos");
|
|
||||||
Class<?> lookPacketClass = Reflection.getClass("net.minecraft.network.protocol.game.ServerboundMovePlayerPacket$Rot");
|
|
||||||
Class<?> positionLookPacketClass = Reflection.getClass("net.minecraft.network.protocol.game.ServerboundMovePlayerPacket$PosRot");
|
|
||||||
|
|
||||||
TinyProtocol.instance.addFilter(positionPacketClass, function);
|
|
||||||
TinyProtocol.instance.addFilter(lookPacketClass, function);
|
|
||||||
TinyProtocol.instance.addFilter(positionLookPacketClass, function);
|
|
||||||
}
|
|
||||||
|
|
||||||
void registerCursor(RCursor cursor) {
|
|
||||||
closeCursorOf(cursor.getOwner());
|
|
||||||
|
|
||||||
activeCursors.put(cursor.getOwner(), cursor);
|
|
||||||
}
|
|
||||||
|
|
||||||
void unregisterCursor(RCursor cursor) {
|
|
||||||
activeCursors.remove(cursor.getOwner());
|
|
||||||
}
|
|
||||||
|
|
||||||
private void closeCursorOf(Player player) {
|
|
||||||
RCursor currentPlayerCursor = activeCursors.get(player);
|
|
||||||
|
|
||||||
if(currentPlayerCursor != null) {
|
|
||||||
currentPlayerCursor.close();
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void updateCursor(Player player) {
|
|
||||||
if (!activeCursors.containsKey(player)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
synchronized (calculationActive) {
|
|
||||||
if (calculationActive.contains(player)) {
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
calculationActive.add(player);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
RCursor cursor = activeCursors.get(player);
|
|
||||||
|
|
||||||
if (cursor != null) {
|
|
||||||
cursor.render();
|
|
||||||
}
|
|
||||||
|
|
||||||
synchronized (calculationActive) {
|
|
||||||
calculationActive.remove(player);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
private void handlePlayerInteract(PlayerInteractEvent event) {
|
|
||||||
Player player = event.getPlayer();
|
|
||||||
|
|
||||||
RCursor cursorOfPlayer = activeCursors.get(player);
|
|
||||||
|
|
||||||
cursorOfPlayer.handleClick(event.getAction());
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
private void handlePlayerQuit(PlayerQuitEvent event) {
|
|
||||||
closeCursorOf(event.getPlayer());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -34,19 +34,3 @@ dependencies {
|
|||||||
implementation(project(":BauSystem:BauSystem_20"))
|
implementation(project(":BauSystem:BauSystem_20"))
|
||||||
implementation(project(":BauSystem:BauSystem_21"))
|
implementation(project(":BauSystem:BauSystem_21"))
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.register<DevServer>("DevBau20") {
|
|
||||||
group = "run"
|
|
||||||
description = "Run a 1.20 Dev Bau"
|
|
||||||
dependsOn(":SpigotCore:shadowJar")
|
|
||||||
dependsOn(":BauSystem:shadowJar")
|
|
||||||
template = "Bau20"
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.register<DevServer>("DevBau21") {
|
|
||||||
group = "run"
|
|
||||||
description = "Run a 1.21 Dev Bau"
|
|
||||||
dependsOn(":SpigotCore:shadowJar")
|
|
||||||
dependsOn(":BauSystem:shadowJar")
|
|
||||||
template = "Bau21"
|
|
||||||
}
|
|
||||||
|
|||||||
+15
-24
@@ -34,7 +34,6 @@ import org.bukkit.command.CommandSender;
|
|||||||
|
|
||||||
import java.io.StringWriter;
|
import java.io.StringWriter;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.logging.Level;
|
|
||||||
|
|
||||||
public class TechhiderbugCommand implements CommandExecutor {
|
public class TechhiderbugCommand implements CommandExecutor {
|
||||||
|
|
||||||
@@ -46,33 +45,25 @@ public class TechhiderbugCommand implements CommandExecutor {
|
|||||||
public boolean onCommand(CommandSender sender, Command cmd, String alias, String[] args) {
|
public boolean onCommand(CommandSender sender, Command cmd, String alias, String[] args) {
|
||||||
StringWriter writer = new StringWriter();
|
StringWriter writer = new StringWriter();
|
||||||
|
|
||||||
try {
|
writer.append("ArenaMode: ").append(Config.mode.name()).append('\n');
|
||||||
writer.append("ArenaMode: ").append(Config.mode.name()).append('\n');
|
writer.append("FightState: ").append(FightState.getFightState().name()).append('\n');
|
||||||
writer.append("FightState: ").append(FightState.getFightState().name()).append('\n');
|
writer.append("TechHider enabled: ").append(FightState.getStateDependentFeatures().get(FightSystem.getTechHider()).toString()).append('\n');
|
||||||
writer.append("TechHider enabled: ").append(FightState.getStateDependentFeatures().get(FightSystem.getTechHider()).toString()).append('\n');
|
|
||||||
|
|
||||||
writer.append("Arena region: ").append(Config.ArenaRegion.toString()).append('\n');
|
writer.append("Arena region: ").append(Config.ArenaRegion.toString()).append('\n');
|
||||||
writer.append("Team regions: ");
|
writer.append("Team regions: ");
|
||||||
Fight.teams().forEach(t -> writer.append(t.getName()).append(':').append(t.getExtendRegion().toString()).append(' '));
|
Fight.teams().forEach(t -> writer.append(t.getName()).append(':').append(t.getExtendRegion().toString()).append(' '));
|
||||||
writer.append('\n');
|
writer.append('\n');
|
||||||
|
|
||||||
writer.append("HullHider regions: ");
|
writer.append("HullHider regions: ");
|
||||||
FightSystem.getHullHider().getHullMap().forEach((t, h) -> writer.append(t.getName()).append(':').append(h.getRegion().toString()).append(' '));
|
FightSystem.getHullHider().getHullMap().forEach((t, h) -> writer.append(t.getName()).append(':').append(h.getRegion().toString()).append(' '));
|
||||||
writer.append('\n');
|
writer.append('\n');
|
||||||
|
|
||||||
writer.append("Hidden regions: ");
|
writer.append("Hidden regions: ");
|
||||||
FightSystem.getTechHider().getHiddenRegion().forEach((p, r) -> writer.append(p.getName()).append(':').append(r.toString()).append(' '));
|
FightSystem.getTechHider().getHiddenRegion().forEach((p, r) -> writer.append(p.getName()).append(':').append(r.toString()).append(' '));
|
||||||
writer.append('\n');
|
writer.append('\n');
|
||||||
|
|
||||||
writer.append("TinyProtocol: ");
|
writer.append('\n').append("Netty pipelines:\n");
|
||||||
writer.append(TinyProtocol.instance.toString()).append('\n');
|
Bukkit.getOnlinePlayers().forEach(p -> writer.append(p.getName()).append(": ").append(String.join(" ", TinyProtocol.instance.getPlayerInterceptors().get(p).getChannel().pipeline().names())).append('\n'));
|
||||||
|
|
||||||
writer.append('\n').append("Netty pipelines:\n");
|
|
||||||
Bukkit.getOnlinePlayers().forEach(p -> writer.append(p.getName()).append(": ").append(String.join(" ", TinyProtocol.instance.getPlayerInterceptors().get(p).getChannel().pipeline().names())).append('\n'));
|
|
||||||
} catch (Exception e) {
|
|
||||||
writer.append("Error while generating bug report: ").append(e.getMessage()).append('\n');
|
|
||||||
Bukkit.getLogger().log(Level.SEVERE, "Error while generating bug report", e);
|
|
||||||
}
|
|
||||||
|
|
||||||
SWException.log("Techhider-Bug reported by " + sender.getName() + ": " + Arrays.toString(args), writer.toString());
|
SWException.log("Techhider-Bug reported by " + sender.getName() + ": " + Arrays.toString(args), writer.toString());
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -29,15 +29,11 @@ import de.steamwar.fightsystem.states.FightState;
|
|||||||
import de.steamwar.fightsystem.states.StateDependentListener;
|
import de.steamwar.fightsystem.states.StateDependentListener;
|
||||||
import de.steamwar.fightsystem.states.StateDependentTask;
|
import de.steamwar.fightsystem.states.StateDependentTask;
|
||||||
import de.steamwar.fightsystem.utils.ItemBuilder;
|
import de.steamwar.fightsystem.utils.ItemBuilder;
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.Cancellable;
|
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.block.Action;
|
import org.bukkit.event.block.Action;
|
||||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
|
||||||
import org.bukkit.event.inventory.InventoryOpenEvent;
|
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
import org.bukkit.inventory.EquipmentSlot;
|
import org.bukkit.inventory.EquipmentSlot;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
@@ -111,19 +107,6 @@ public class HotbarKit extends Kit {
|
|||||||
|
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
int slot = player.getInventory().getHeldItemSlot();
|
int slot = player.getInventory().getHeldItemSlot();
|
||||||
click(player, slot, event);
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onInventoryClick(InventoryClickEvent event) {
|
|
||||||
int slot = event.getSlot();
|
|
||||||
if (slot < 0 || slot >= HOTBAR_SIZE) return;
|
|
||||||
|
|
||||||
Player player = (Player) event.getWhoClicked();
|
|
||||||
click(player, slot, event);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void click(Player player, int slot, Cancellable event) {
|
|
||||||
Kit activeKit = activeKits.get(player);
|
Kit activeKit = activeKits.get(player);
|
||||||
if(!(activeKit instanceof HotbarKit) || PersonalKitCreator.inKitCreator(player) || activeKit.getInventory()[slot] == null)
|
if(!(activeKit instanceof HotbarKit) || PersonalKitCreator.inKitCreator(player) || activeKit.getInventory()[slot] == null)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -39,13 +39,3 @@ dependencies {
|
|||||||
implementation(project(":FightSystem:FightSystem_20"))
|
implementation(project(":FightSystem:FightSystem_20"))
|
||||||
implementation(project(":FightSystem:FightSystem_21"))
|
implementation(project(":FightSystem:FightSystem_21"))
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.register<FightServer>("WarGear20") {
|
|
||||||
group = "run"
|
|
||||||
description = "Run a WarGear 1.20 Fight Server"
|
|
||||||
dependsOn(":SpigotCore:shadowJar")
|
|
||||||
dependsOn(":FightSystem:shadowJar")
|
|
||||||
template = "WarGear20"
|
|
||||||
worldName = "arenas/Pentraki"
|
|
||||||
config = "WarGear20.yml"
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ public class JumpAndRun extends BasicListener {
|
|||||||
|
|
||||||
int count = CLICKED_COUNT.getOrDefault(player, -1);
|
int count = CLICKED_COUNT.getOrDefault(player, -1);
|
||||||
if (count >= 0) {
|
if (count >= 0) {
|
||||||
if (count > 20) {
|
if (count > 60) {
|
||||||
toReset.add(player);
|
toReset.add(player);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -104,18 +104,12 @@ public class JumpAndRun extends BasicListener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Vector point = points.get(index);
|
Vector point = points.get(index);
|
||||||
if (location.getY() < point.getY()) index = -2;
|
if (location.getY() < point.getY()) {
|
||||||
if (location.toVector().distanceSquared(point) >= 17) index = -2;
|
return;
|
||||||
if (index > 0 && index < points.size() - 1) {
|
}
|
||||||
Vector nextPoint = points.get(index + 1);
|
if (location.toVector().distanceSquared(point) >= 12.25) {
|
||||||
if (location.getY() >= nextPoint.getY() && location.toVector().distanceSquared(nextPoint) < 17) {
|
|
||||||
index = index + 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (index == -2) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
CURRENT_POS.put(event.getPlayer(), index);
|
CURRENT_POS.put(event.getPlayer(), index);
|
||||||
event.getPlayer().playSound(event.getPlayer().getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 0.4F, 1);
|
event.getPlayer().playSound(event.getPlayer().getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 0.4F, 1);
|
||||||
if (index < points.size() - 1) {
|
if (index < points.size() - 1) {
|
||||||
|
|||||||
@@ -184,7 +184,6 @@ public class MWTeam {
|
|||||||
|
|
||||||
public void leave(Player p) {
|
public void leave(Player p) {
|
||||||
if (!players.contains(p)) return;
|
if (!players.contains(p)) return;
|
||||||
players.remove(p);
|
|
||||||
|
|
||||||
for (ItemStack stack : p.getInventory().getContents()) {
|
for (ItemStack stack : p.getInventory().getContents()) {
|
||||||
if (stack == null) continue;
|
if (stack == null) continue;
|
||||||
@@ -199,6 +198,7 @@ public class MWTeam {
|
|||||||
if (players.isEmpty() && MissileWars.getFightState() == FightState.FIGHTING)
|
if (players.isEmpty() && MissileWars.getFightState() == FightState.FIGHTING)
|
||||||
MissileWars.end(WinReasons.NO_ENEMY, enemy());
|
MissileWars.end(WinReasons.NO_ENEMY, enemy());
|
||||||
|
|
||||||
|
players.remove(p);
|
||||||
sbteam.removePlayer(p);
|
sbteam.removePlayer(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ public class BountifulWrapper21 extends BountifulWrapper9 {
|
|||||||
return (packet, x, y, z, pitch, yaw) -> {
|
return (packet, x, y, z, pitch, yaw) -> {
|
||||||
PositionMoveRotation pos = field.get(packet);
|
PositionMoveRotation pos = field.get(packet);
|
||||||
|
|
||||||
field.set(packet, new PositionMoveRotation(new Vec3D(x, y, z), pos.b(), yaw, pitch));
|
field.set(packet, new PositionMoveRotation(new Vec3D(x, y, z), pos == null ? new Vec3D(0, 0, 0) : pos.b(), yaw, pitch));
|
||||||
};
|
};
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
return super.getPositionSetter(packetClass, fieldOffset);
|
return super.getPositionSetter(packetClass, fieldOffset);
|
||||||
|
|||||||
@@ -71,17 +71,6 @@ public class TinyProtocol implements Listener {
|
|||||||
@Getter
|
@Getter
|
||||||
private final Map<Player, PacketInterceptor> playerInterceptors = new HashMap<>();
|
private final Map<Player, PacketInterceptor> playerInterceptors = new HashMap<>();
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "TinyProtocol{" +
|
|
||||||
"plugin=" + plugin +
|
|
||||||
", connections=" + connections +
|
|
||||||
", closed=" + closed +
|
|
||||||
", packetFilters=" + packetFilters +
|
|
||||||
", playerInterceptors=" + playerInterceptors +
|
|
||||||
'}';
|
|
||||||
}
|
|
||||||
|
|
||||||
private TinyProtocol(final Plugin plugin) {
|
private TinyProtocol(final Plugin plugin) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.connections = networkManagers.get(getServerConnection(plugin));
|
this.connections = networkManagers.get(getServerConnection(plugin));
|
||||||
@@ -95,7 +84,6 @@ public class TinyProtocol implements Listener {
|
|||||||
|
|
||||||
@EventHandler(priority = EventPriority.LOWEST)
|
@EventHandler(priority = EventPriority.LOWEST)
|
||||||
public void onPlayerLogin(PlayerLoginEvent e) {
|
public void onPlayerLogin(PlayerLoginEvent e) {
|
||||||
plugin.getLogger().info("Creating PacketInterceptor for: " + e.getPlayer().getName() + " (" + closed + ")");
|
|
||||||
if(closed)
|
if(closed)
|
||||||
return;
|
return;
|
||||||
new PacketInterceptor(e.getPlayer());
|
new PacketInterceptor(e.getPlayer());
|
||||||
@@ -130,8 +118,6 @@ public class TinyProtocol implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final void close() {
|
public final void close() {
|
||||||
plugin.getLogger().log(Level.INFO, "Closing PacketInterceptor", new Exception("Stacktrace"));
|
|
||||||
|
|
||||||
if(closed)
|
if(closed)
|
||||||
return;
|
return;
|
||||||
closed = true;
|
closed = true;
|
||||||
@@ -171,7 +157,6 @@ public class TinyProtocol implements Listener {
|
|||||||
synchronized (playerInterceptors) {
|
synchronized (playerInterceptors) {
|
||||||
playerInterceptors.put(player, this);
|
playerInterceptors.put(player, this);
|
||||||
}
|
}
|
||||||
plugin.getLogger().info("Adding Techhider for: " + player.getName());
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
channel.pipeline().addBefore("packet_handler", HANDLER_NAME, this);
|
channel.pipeline().addBefore("packet_handler", HANDLER_NAME, this);
|
||||||
|
|||||||
@@ -177,9 +177,30 @@ public final class Reflection {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void set(Object target, Object value) {
|
public void set(Object target, Object value) {
|
||||||
|
// This now works for Fields in records!
|
||||||
try {
|
try {
|
||||||
f.set(target, value);
|
long offset = Unsafe.getUnsafe().objectFieldOffset(f);
|
||||||
} catch (IllegalAccessException e) {
|
Class<?> type = f.getType();
|
||||||
|
if (type == int.class) {
|
||||||
|
Unsafe.getUnsafe().putInt(target, offset, (Integer) value);
|
||||||
|
} else if (type == float.class) {
|
||||||
|
Unsafe.getUnsafe().putFloat(target, offset, (Float) value);
|
||||||
|
} else if (type == double.class) {
|
||||||
|
Unsafe.getUnsafe().putDouble(target, offset, (Double) value);
|
||||||
|
} else if (type == boolean.class) {
|
||||||
|
Unsafe.getUnsafe().putBoolean(target, offset, (Boolean) value);
|
||||||
|
} else if (type == byte.class) {
|
||||||
|
Unsafe.getUnsafe().putByte(target, offset, (Byte) value);
|
||||||
|
} else if (type == char.class) {
|
||||||
|
Unsafe.getUnsafe().putChar(target, offset, (Character) value);
|
||||||
|
} else if (type == short.class) {
|
||||||
|
Unsafe.getUnsafe().putShort(target, offset, (Short) value);
|
||||||
|
} else if (type == long.class) {
|
||||||
|
Unsafe.getUnsafe().putLong(target, offset, (Long) value);
|
||||||
|
} else {
|
||||||
|
Unsafe.getUnsafe().putReference(target, offset, value);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
throw new IllegalArgumentException("Cannot write field", e);
|
throw new IllegalArgumentException("Cannot write field", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -396,10 +396,26 @@ public class REntity {
|
|||||||
public static final Class<?> teleportPacket = Reflection.getClass("net.minecraft.network.protocol.game.ClientboundTeleportEntityPacket");
|
public static final Class<?> teleportPacket = Reflection.getClass("net.minecraft.network.protocol.game.ClientboundTeleportEntityPacket");
|
||||||
public static final Reflection.Field<Integer> teleportEntity = Reflection.getField(teleportPacket, int.class, 0);
|
public static final Reflection.Field<Integer> teleportEntity = Reflection.getField(teleportPacket, int.class, 0);
|
||||||
public static final BountifulWrapper.PositionSetter teleportPosition = BountifulWrapper.impl.getPositionSetter(teleportPacket, Core.getVersion() == 8 ? 1 : 0);
|
public static final BountifulWrapper.PositionSetter teleportPosition = BountifulWrapper.impl.getPositionSetter(teleportPacket, Core.getVersion() == 8 ? 1 : 0);
|
||||||
|
public static final Class<?> relative;
|
||||||
|
public static final Reflection.Field<Set> relatives;
|
||||||
|
static {
|
||||||
|
if (Core.getVersion() >= 21) {
|
||||||
|
relative = Reflection.getClass("net.minecraft.world.entity.Relative");
|
||||||
|
relatives = Reflection.getField(teleportPacket, Set.class, 0);
|
||||||
|
} else {
|
||||||
|
relative = null;
|
||||||
|
relatives = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
private Object getTeleportPacket(){
|
private Object getTeleportPacket(){
|
||||||
Object packet = Reflection.newInstance(teleportPacket);
|
Object packet = Reflection.newInstance(teleportPacket);
|
||||||
teleportEntity.set(packet, entityId);
|
teleportEntity.set(packet, entityId);
|
||||||
teleportPosition.set(packet, x, y, z, pitch, yaw);
|
teleportPosition.set(packet, x, y, z, pitch, yaw);
|
||||||
|
if (Core.getVersion() >= 21) {
|
||||||
|
// https://mappings.dev/1.21.3/net/minecraft/world/entity/Relative.html
|
||||||
|
Object[] constants = relative.getEnumConstants();
|
||||||
|
relatives.set(packet, new HashSet<>(Arrays.asList(constants[0], constants[1], constants[2], constants[3], constants[4], constants[5])));
|
||||||
|
}
|
||||||
return packet;
|
return packet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,8 +35,6 @@ import org.bukkit.event.player.PlayerAttemptPickupItemEvent
|
|||||||
import org.bukkit.event.player.PlayerInteractEntityEvent
|
import org.bukkit.event.player.PlayerInteractEntityEvent
|
||||||
import org.bukkit.event.player.PlayerJoinEvent
|
import org.bukkit.event.player.PlayerJoinEvent
|
||||||
import org.bukkit.event.player.PlayerMoveEvent
|
import org.bukkit.event.player.PlayerMoveEvent
|
||||||
import org.bukkit.event.player.*
|
|
||||||
import org.bukkit.persistence.PersistentDataType
|
|
||||||
|
|
||||||
object IngameListener : Listener {
|
object IngameListener : Listener {
|
||||||
|
|
||||||
@@ -77,9 +75,9 @@ object IngameListener : Listener {
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
fun onPickupCoins(e: PlayerAttemptPickupItemEvent) {
|
fun onPickupCoins(e: PlayerAttemptPickupItemEvent) {
|
||||||
if (e.item.itemStack.persistentDataContainer.has(DealerInventory.coinKey)) {
|
if (e.item.itemStack.isSimilar(DealerInventory.coins)) {
|
||||||
val numberOfCoins = e.item.itemStack.persistentDataContainer[DealerInventory.coinKey, PersistentDataType.INTEGER] ?: 0
|
TNTLeagueGame.getTeam(e.player)?.coins =
|
||||||
TNTLeagueGame.getTeam(e.player)?.coins = (e.item.itemStack.amount * numberOfCoins) + (TNTLeagueGame.getTeam(e.player)?.coins ?: 0)
|
e.item.itemStack.amount + (TNTLeagueGame.getTeam(e.player)?.coins ?: 0)
|
||||||
|
|
||||||
e.item.itemStack.amount = 0
|
e.item.itemStack.amount = 0
|
||||||
e.isCancelled = true
|
e.isCancelled = true
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ import de.steamwar.message.SubMessage
|
|||||||
import de.steamwar.network.NetworkSender
|
import de.steamwar.network.NetworkSender
|
||||||
import de.steamwar.network.packets.common.FightInfoPacket
|
import de.steamwar.network.packets.common.FightInfoPacket
|
||||||
import de.steamwar.scoreboard.SWScoreboard
|
import de.steamwar.scoreboard.SWScoreboard
|
||||||
|
import de.steamwar.sql.Fight
|
||||||
|
import de.steamwar.sql.FightPlayer
|
||||||
import de.steamwar.sql.SteamwarUser
|
import de.steamwar.sql.SteamwarUser
|
||||||
import de.steamwar.tntleague.colorByTeam
|
import de.steamwar.tntleague.colorByTeam
|
||||||
import de.steamwar.tntleague.config.TNTLeagueConfig
|
import de.steamwar.tntleague.config.TNTLeagueConfig
|
||||||
@@ -35,9 +37,10 @@ import de.steamwar.tntleague.events.LobbyListener
|
|||||||
import de.steamwar.tntleague.inventory.DealerInventory
|
import de.steamwar.tntleague.inventory.DealerInventory
|
||||||
import de.steamwar.tntleague.message
|
import de.steamwar.tntleague.message
|
||||||
import de.steamwar.tntleague.plugin
|
import de.steamwar.tntleague.plugin
|
||||||
import de.steamwar.tntleague.util.TNTLeagueScoreboard
|
import de.steamwar.tntleague.util.*
|
||||||
import org.bukkit.GameMode
|
import org.bukkit.GameMode
|
||||||
import org.bukkit.Location
|
import org.bukkit.Location
|
||||||
|
import org.bukkit.Material
|
||||||
import org.bukkit.Sound
|
import org.bukkit.Sound
|
||||||
import org.bukkit.entity.Item
|
import org.bukkit.entity.Item
|
||||||
import org.bukkit.entity.Player
|
import org.bukkit.entity.Player
|
||||||
@@ -48,7 +51,6 @@ import org.bukkit.inventory.ItemStack
|
|||||||
import org.bukkit.scheduler.BukkitTask
|
import org.bukkit.scheduler.BukkitTask
|
||||||
import java.sql.Timestamp
|
import java.sql.Timestamp
|
||||||
import java.time.Instant
|
import java.time.Instant
|
||||||
import kotlin.random.Random
|
|
||||||
|
|
||||||
object TNTLeagueGame {
|
object TNTLeagueGame {
|
||||||
var state: GameState = GameState.LOBBY
|
var state: GameState = GameState.LOBBY
|
||||||
@@ -85,24 +87,18 @@ object TNTLeagueGame {
|
|||||||
|
|
||||||
message.broadcast("GAME_STARTED")
|
message.broadcast("GAME_STARTED")
|
||||||
|
|
||||||
|
val tnt = ItemStack(Material.TNT)
|
||||||
|
|
||||||
start = Timestamp.from(Instant.now())
|
start = Timestamp.from(Instant.now())
|
||||||
|
|
||||||
var spawnCount = 0
|
|
||||||
spawnerTask = plugin.server.scheduler.runTaskTimer(plugin, bukkit {
|
spawnerTask = plugin.server.scheduler.runTaskTimer(plugin, bukkit {
|
||||||
val coinsToSpawn = if (spawnCount % 28 == 0) {
|
|
||||||
DealerInventory.huge_coins
|
|
||||||
} else if (spawnCount % 7 == 0) {
|
|
||||||
DealerInventory.big_coins
|
|
||||||
} else {
|
|
||||||
DealerInventory.coins
|
|
||||||
}
|
|
||||||
spawnCount++
|
|
||||||
|
|
||||||
if (world.getNearbyEntitiesByType(Item::class.java, TNTLeagueWorldConfig.blueTeam.itemSpawn, 3.0).sumOf { it.itemStack.amount } <= 256) {
|
if (world.getNearbyEntitiesByType(Item::class.java, TNTLeagueWorldConfig.blueTeam.itemSpawn, 3.0).sumOf { it.itemStack.amount } <= 256) {
|
||||||
spawnItems(TNTLeagueWorldConfig.blueTeam.itemSpawn, coinsToSpawn)
|
spawnItems(TNTLeagueWorldConfig.blueTeam.itemSpawn, tnt)
|
||||||
|
spawnItems(TNTLeagueWorldConfig.blueTeam.itemSpawn, DealerInventory.coins)
|
||||||
}
|
}
|
||||||
if (world.getNearbyEntitiesByType(Item::class.java, TNTLeagueWorldConfig.redTeam.itemSpawn, 3.0).sumOf { it.itemStack.amount } <= 256) {
|
if (world.getNearbyEntitiesByType(Item::class.java, TNTLeagueWorldConfig.redTeam.itemSpawn, 3.0).sumOf { it.itemStack.amount } <= 256) {
|
||||||
spawnItems(TNTLeagueWorldConfig.redTeam.itemSpawn, coinsToSpawn)
|
spawnItems(TNTLeagueWorldConfig.redTeam.itemSpawn, tnt)
|
||||||
|
spawnItems(TNTLeagueWorldConfig.redTeam.itemSpawn, DealerInventory.coins)
|
||||||
}
|
}
|
||||||
}, 5, 10)
|
}, 5, 10)
|
||||||
|
|
||||||
|
|||||||
@@ -59,31 +59,13 @@ class DealerInventory(player: Player): KotlinInventory(player) {
|
|||||||
companion object {
|
companion object {
|
||||||
private val priceKey = NamespacedKey(plugin, "price")
|
private val priceKey = NamespacedKey(plugin, "price")
|
||||||
private val amountKey = NamespacedKey(plugin, "amount")
|
private val amountKey = NamespacedKey(plugin, "amount")
|
||||||
val coinKey = NamespacedKey(plugin, "coin")
|
private val coinKey = NamespacedKey(plugin, "coin")
|
||||||
|
|
||||||
val coins = ItemStack(Material.RAW_GOLD).apply {
|
val coins = ItemStack(Material.RAW_GOLD).apply {
|
||||||
itemMeta = itemMeta.apply {
|
itemMeta = itemMeta.apply {
|
||||||
displayName(Component.text("Coins").color(NamedTextColor.GOLD))
|
displayName(Component.text("Coins").color(NamedTextColor.GOLD))
|
||||||
persistentDataContainer.apply {
|
persistentDataContainer.apply {
|
||||||
set(coinKey, PersistentDataType.INTEGER, 1)
|
set(coinKey, PersistentDataType.BOOLEAN, true)
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val big_coins = ItemStack(Material.GOLD_INGOT).apply {
|
|
||||||
itemMeta = itemMeta.apply {
|
|
||||||
displayName(Component.text("Big Coins").color(NamedTextColor.GOLD))
|
|
||||||
persistentDataContainer.apply {
|
|
||||||
set(coinKey, PersistentDataType.INTEGER, 3)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val huge_coins = ItemStack(Material.GOLD_BLOCK).apply {
|
|
||||||
itemMeta = itemMeta.apply {
|
|
||||||
displayName(Component.text("Huge Coins").color(NamedTextColor.GOLD))
|
|
||||||
persistentDataContainer.apply {
|
|
||||||
set(coinKey, PersistentDataType.INTEGER, 9)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,23 +17,20 @@
|
|||||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
|
|
||||||
PREFIX=§eTowerRun§8§§r
|
PREFIX=§eTowerRun§8»§r
|
||||||
|
|
||||||
PLAYER_DIED=§c{0} §7died§8!
|
PLAYER_DIED=§c{0} §7died§8!
|
||||||
PLAYER_ESCAPE=§a{0} §7escaped§8!
|
PLAYER_ESCAPE=§a{0} §7escaped§8!
|
||||||
GAME_START=§aThe game has started§8!
|
GAME_START=§aThe game has started§8!
|
||||||
GAME_WIN=§a{0} §7has won the game§8!
|
GAME_WIN=§a{0} §7has won the game§8!
|
||||||
GAME_STARTING=§7Starting: §e{0}s§8!
|
GAME_STARTING=§7Starting: §e{0}s§8!
|
||||||
GAME_WAITING=§7Waiting for players§8...
|
GAME_WAITING=§7Waiting for players§8...
|
||||||
SERVER_STOPPING=§cThe server stops in §e{0}s§8!
|
SERVER_STOPPING=§cThe server stops in §e{0}s§8!
|
||||||
SERVER_RESET=§cThe server will be reset in §e{0}s§8!
|
SERVER_RESET=§cThe server will be reset in §e{0}s§8!
|
||||||
KEY_NAME=§eKey
|
KEY_NAME=§eKey
|
||||||
KEY_FOUND=§a{0} §7found a key§8!
|
KEY_FOUND=§a{0} §7found a key§8!
|
||||||
GAME_TIE=§aThe game ended in a tie§8!
|
GAME_TIE=§aThe game ended in a tie§8!
|
||||||
GAME_TIME=§a{0}:{1}
|
GAME_TIME=§a{0}:{1}
|
||||||
CATCH_UP_WARNING=§4!! §cYou should catch up §4!!
|
CATCH_UP_WARNING=§4!! §cYou should catch up §4!!
|
||||||
|
|
||||||
COMMAND_START=§aThe game will start soon§8!
|
COMMAND_START=§aThe game will start soon§8!
|
||||||
|
|
||||||
PARTICIPANT_CHAT={0} {1}§8» §7{2}
|
|
||||||
SPECTATOR_CHAT=§7{0}§8» §7{1}
|
|
||||||
@@ -17,19 +17,19 @@
|
|||||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
|
|
||||||
PLAYER_DIED=§c{0} §7ist gestorben§8!
|
PLAYER_DIED=§c{0} §7ist gestorben§8!
|
||||||
PLAYER_ESCAPE=§a{0} §7ist entkommen§8!
|
PLAYER_ESCAPE=§a{0} §7ist entkommen§8!
|
||||||
GAME_START=§aDas Spiel beginnt§8!
|
GAME_START=§aDas Spiel beginnt§8!
|
||||||
GAME_WIN=§a{0} §7hat das Spiel gewonnen§8!
|
GAME_WIN=§a{0} §7hat das Spiel gewonnen§8!
|
||||||
GAME_STARTING=§7Das Spiel startet in §e{0}s§8!
|
GAME_STARTING=§7Das Spiel startet in §e{0}s§8!
|
||||||
GAME_WAITING=§7Warte auf weitere Spieler§8...
|
GAME_WAITING=§7Warte auf weitere Spieler§8...
|
||||||
SERVER_STOPPING=§cDer Server stoppt in §e{0}s§8!
|
SERVER_STOPPING=§cDer Server stoppt in §e{0}s§8!
|
||||||
SERVER_RESET=§cDer Server wird in §e{0}s §czur§ckgesetzt§8!
|
SERVER_RESET=§cDer Server wird in §e{0}s §czurückgesetzt§8!
|
||||||
GAME_TIE=§7Keiner hat gewonnen§8!
|
GAME_TIE=§7Keiner hat gewonnen§8!
|
||||||
|
|
||||||
KEY_NAME=§eSchl§ssel
|
KEY_NAME=§eSchlüssel
|
||||||
KEY_FOUND=§a{0} §7hat einen Schl§ssel gefunden§8!
|
KEY_FOUND=§a{0} §7hat einen Schlüssel gefunden§8!
|
||||||
|
|
||||||
CATCH_UP_WARNING=§4!! §cDu solltest aufholen §4!!
|
CATCH_UP_WARNING=§4!! §cDu solltest aufholen §4!!
|
||||||
|
|
||||||
COMMAND_START=§7Das Spiel startet bald§8!
|
COMMAND_START=§7Das Spiel startet bald§8!
|
||||||
@@ -35,8 +35,7 @@ import org.bukkit.configuration.file.YamlConfiguration;
|
|||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@UtilityClass
|
@UtilityClass
|
||||||
public class WorldConfig {
|
public class WorldConfig {
|
||||||
@@ -55,7 +54,7 @@ public class WorldConfig {
|
|||||||
public static final int MAP_MIN_Z;
|
public static final int MAP_MIN_Z;
|
||||||
public static final int MAP_MAX_X;
|
public static final int MAP_MAX_X;
|
||||||
public static final int MAP_MAX_Z;
|
public static final int MAP_MAX_Z;
|
||||||
public static final boolean MELTING;
|
public static final Map<Material, Integer> MELTING_TIMES;
|
||||||
public static final TowerGeneratorConfig TOWER_GENERATOR_CONFIG;
|
public static final TowerGeneratorConfig TOWER_GENERATOR_CONFIG;
|
||||||
|
|
||||||
public static final List<WinCondition> WINCONDITIONS = new ArrayList<>();
|
public static final List<WinCondition> WINCONDITIONS = new ArrayList<>();
|
||||||
@@ -162,7 +161,16 @@ public class WorldConfig {
|
|||||||
MAP_MAX_X = config.getInt("maxX");
|
MAP_MAX_X = config.getInt("maxX");
|
||||||
MAP_MAX_Z = config.getInt("maxZ");
|
MAP_MAX_Z = config.getInt("maxZ");
|
||||||
|
|
||||||
MELTING = tower.getBoolean("melting") || tower.contains("meltingBlocks"); // Backwards compatibility with meltingBlocks key!
|
ConfigurationSection meltingBlocksSection = tower.getConfigurationSection("meltingBlocks");
|
||||||
|
if (meltingBlocksSection != null) {
|
||||||
|
Map<Material, Integer> meltingTimes = new HashMap<>();
|
||||||
|
meltingBlocksSection.getKeys(false).forEach(s -> {
|
||||||
|
meltingTimes.put(Material.valueOf(s), meltingBlocksSection.getInt(s));
|
||||||
|
});
|
||||||
|
MELTING_TIMES = Collections.unmodifiableMap(meltingTimes);
|
||||||
|
} else {
|
||||||
|
MELTING_TIMES = Collections.emptyMap();
|
||||||
|
}
|
||||||
|
|
||||||
ACTIVE_WINCONDITIONS = config.getStringList("winconditions");
|
ACTIVE_WINCONDITIONS = config.getStringList("winconditions");
|
||||||
WINCONDITIONS.stream().filter(winCondition -> ACTIVE_WINCONDITIONS.contains(winCondition.getName())).forEach(winCondition -> winCondition.setActive(true));
|
WINCONDITIONS.stream().filter(winCondition -> ACTIVE_WINCONDITIONS.contains(winCondition.getName())).forEach(winCondition -> winCondition.setActive(true));
|
||||||
|
|||||||
@@ -46,10 +46,6 @@ public class TowerRunGame {
|
|||||||
public static final List<TowerRunPlayer> PLAYERS_ESCAPED = new ArrayList<>();
|
public static final List<TowerRunPlayer> PLAYERS_ESCAPED = new ArrayList<>();
|
||||||
private static final World world = Bukkit.getWorlds().get(0);
|
private static final World world = Bukkit.getWorlds().get(0);
|
||||||
|
|
||||||
public static boolean isEscaped(TowerRunPlayer player) {
|
|
||||||
return PLAYERS_ESCAPED.contains(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean isAlive(TowerRunPlayer player) {
|
public static boolean isAlive(TowerRunPlayer player) {
|
||||||
return PLAYERS_ALIVE.contains(player);
|
return PLAYERS_ALIVE.contains(player);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,20 +19,20 @@
|
|||||||
|
|
||||||
package de.steamwar.towerrun.listener;
|
package de.steamwar.towerrun.listener;
|
||||||
|
|
||||||
import de.steamwar.towerrun.TowerRun;
|
|
||||||
import de.steamwar.towerrun.config.WorldConfig;
|
import de.steamwar.towerrun.config.WorldConfig;
|
||||||
import de.steamwar.towerrun.game.TowerRunGame;
|
import de.steamwar.towerrun.game.TowerRunGame;
|
||||||
import de.steamwar.towerrun.game.TowerRunPlayer;
|
import de.steamwar.towerrun.game.TowerRunPlayer;
|
||||||
import de.steamwar.towerrun.state.GameState;
|
|
||||||
import de.steamwar.towerrun.state.GameStateBukkitListener;
|
import de.steamwar.towerrun.state.GameStateBukkitListener;
|
||||||
import de.steamwar.towerrun.state.GameStates;
|
import de.steamwar.towerrun.state.GameStates;
|
||||||
import lombok.val;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.GameMode;
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.World;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.player.*;
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
|
import org.bukkit.event.player.PlayerMoveEvent;
|
||||||
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
|
import org.bukkit.event.player.PlayerRespawnEvent;
|
||||||
|
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
|
|
||||||
@@ -67,25 +67,4 @@ public class GlobalListener extends GameStateBukkitListener implements Listener
|
|||||||
public void onPlayerRespawn(PlayerRespawnEvent event) {
|
public void onPlayerRespawn(PlayerRespawnEvent event) {
|
||||||
event.setRespawnLocation(WorldConfig.SPAWN);
|
event.setRespawnLocation(WorldConfig.SPAWN);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onAsyncPlayerChat(AsyncPlayerChatEvent event) {
|
|
||||||
TowerRunPlayer player = TowerRunPlayer.get(event.getPlayer());
|
|
||||||
if (GameState.getCurrentState() == GameStates.RUNNING && (TowerRunGame.isAlive(player) || TowerRunGame.isEscaped(player))) {
|
|
||||||
String prefix;
|
|
||||||
if (TowerRunGame.isAlive(player)) {
|
|
||||||
if (event.getPlayer().getGameMode() == GameMode.SPECTATOR) {
|
|
||||||
prefix = "§c☠";
|
|
||||||
} else {
|
|
||||||
prefix = "§6❤";
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
prefix = "§a✔";
|
|
||||||
}
|
|
||||||
TowerRun.getMessage().broadcastPrefixless("PARTICIPANT_CHAT", prefix, event.getPlayer().getName(), event.getMessage());
|
|
||||||
} else {
|
|
||||||
TowerRun.getMessage().broadcastPrefixless("SPECTATOR_CHAT", event.getPlayer().getName(), event.getMessage());
|
|
||||||
}
|
|
||||||
event.setCancelled(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,13 +62,13 @@ public class IngameListener extends GameStateBukkitListener {
|
|||||||
blocksToMeltRunnable = new BukkitRunnable() {
|
blocksToMeltRunnable = new BukkitRunnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
List<Block> blocks = blocksToMelt.remove(time);
|
List<Block> blocks = blocksToMelt.get(time);
|
||||||
time++;
|
time++;
|
||||||
if (blocks == null) {
|
if (blocks == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
blocks.forEach(block -> {
|
blocks.forEach(block -> {
|
||||||
if (block.getType() == Material.AIR || block.getType() == Material.LAVA) return;
|
if (!WorldConfig.MELTING_TIMES.containsKey(block.getType())) return;
|
||||||
block.setType(Material.AIR);
|
block.setType(Material.AIR);
|
||||||
block.getWorld().playSound(block.getLocation(), Sound.BLOCK_FIRE_EXTINGUISH, 0.1F, 1);
|
block.getWorld().playSound(block.getLocation(), Sound.BLOCK_FIRE_EXTINGUISH, 0.1F, 1);
|
||||||
});
|
});
|
||||||
@@ -189,9 +189,6 @@ public class IngameListener extends GameStateBukkitListener {
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onBlockPhysics(BlockPhysicsEvent event) {
|
public void onBlockPhysics(BlockPhysicsEvent event) {
|
||||||
if (!WorldConfig.MELTING) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (event.getSourceBlock().getType() != Material.LAVA) {
|
if (event.getSourceBlock().getType() != Material.LAVA) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -205,9 +202,11 @@ public class IngameListener extends GameStateBukkitListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void shouldMelt(Block block) {
|
private void shouldMelt(Block block) {
|
||||||
if (block.getType().isBurnable()) return;
|
int meltingTime = WorldConfig.MELTING_TIMES.getOrDefault(block.getType(), -1);
|
||||||
int meltingTime = (int) (block.getType().getHardness() * 48 * 20);
|
if (meltingTime == -1) {
|
||||||
blocksToMelt.computeIfAbsent(time + meltingTime, integer -> new ArrayList<>()).add(block);
|
return;
|
||||||
|
}
|
||||||
|
blocksToMelt.computeIfAbsent(time + meltingTime * 20, integer -> new ArrayList<>()).add(block);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
|
|||||||
@@ -66,12 +66,4 @@ dependencies {
|
|||||||
implementation(libs.apolloprotos)
|
implementation(libs.apolloprotos)
|
||||||
|
|
||||||
implementation(libs.nbt)
|
implementation(libs.nbt)
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.register<DevServer>("DevVelocity") {
|
|
||||||
group = "run"
|
|
||||||
description = "Run a Dev Velocity"
|
|
||||||
dependsOn(":VelocityCore:shadowJar")
|
|
||||||
dependsOn(":VelocityCore:Persistent:jar")
|
|
||||||
template = "DevVelocity"
|
|
||||||
}
|
|
||||||
@@ -154,7 +154,7 @@ UNPUNISHMENT_USAGE=§8/§7{0} §8[§eplayer§8]
|
|||||||
PUNISHMENT_UNTIL=until {0}
|
PUNISHMENT_UNTIL=until {0}
|
||||||
PUNISHMENT_PERMA=permanent
|
PUNISHMENT_PERMA=permanent
|
||||||
|
|
||||||
BAN_TEAM=§e{0} §7was §e§lbanned§7 by §e{1} {2}§8: §f{3}
|
BAN_TEAM={0} §e{1} §7was §e§lbanned§7 by §e{2} {3}§8: §f{4}
|
||||||
BAN_PERMA=§7You are §e§lbanned §epermanently§8: §e{0}
|
BAN_PERMA=§7You are §e§lbanned §epermanently§8: §e{0}
|
||||||
BAN_UNTIL=§7You are §e§lbanned §euntil {0}§8: §e{1}
|
BAN_UNTIL=§7You are §e§lbanned §euntil {0}§8: §e{1}
|
||||||
UNBAN_ERROR=§cThe player isn't banned.
|
UNBAN_ERROR=§cThe player isn't banned.
|
||||||
@@ -164,49 +164,49 @@ BAN_AVOIDING_ALERT=§cPotential ban bypass by §r{0}§c: {1}
|
|||||||
BAN_AVOIDING_LIST=§c{0} §e{1}
|
BAN_AVOIDING_LIST=§c{0} §e{1}
|
||||||
BAN_AVOIDING_BAN_HOVER=§cBan player because of bann bypass.
|
BAN_AVOIDING_BAN_HOVER=§cBan player because of bann bypass.
|
||||||
|
|
||||||
MUTE_TEAM=§e{0} §7was §e§lmuted§7 by §e{1} {2}§8: §f{3}
|
MUTE_TEAM={0} §e{1} §7was §e§lmuted§7 by §e{2} {3}§8: §f{4}
|
||||||
MUTE_PERMA=§7You are §epermanently §e§lmuted§8: §e{0}
|
MUTE_PERMA=§7You are §epermanently §e§lmuted§8: §e{0}
|
||||||
MUTE_UNTIL=§7You are §e§lmuted §euntil {0}§8: §e{1}
|
MUTE_UNTIL=§7You are §e§lmuted §euntil {0}§8: §e{1}
|
||||||
UNMUTE_ERROR=§cThe player isn't muted.
|
UNMUTE_ERROR=§cThe player isn't muted.
|
||||||
UNMUTE=§7You have §e§lunmuted §e{0}.
|
UNMUTE=§7You have §e§lunmuted §e{0}.
|
||||||
|
|
||||||
NOSCHEMRECEIVING_TEAM=§e{0} §7was excluded from §e{1} {2} §7from §e§lrecieving schematics§8: §f{3}
|
NOSCHEMRECEIVING_TEAM={0} §e{1} §7was excluded from §e{2} {3} §7from §e§lrecieving schematics§8: §f{4}
|
||||||
NOSCHEMRECEIVING_PERMA=§7You are §epermanently§7 excluded from receiving §e§lschematics§8: §e{0}
|
NOSCHEMRECEIVING_PERMA=§7You are §epermanently§7 excluded from receiving §e§lschematics§8: §e{0}
|
||||||
NOSCHEMRECEIVING_UNTIL=§7You are excluded from receiving §e§lschematics §euntil {0}§8: §e{1}
|
NOSCHEMRECEIVING_UNTIL=§7You are excluded from receiving §e§lschematics §euntil {0}§8: §e{1}
|
||||||
UNNOSCHEMRECEIVING_ERROR=§cThe player is not excluded from receiving schematics.
|
UNNOSCHEMRECEIVING_ERROR=§cThe player is not excluded from receiving schematics.
|
||||||
UNNOSCHEMRECEIVING=§e{0} §7may now receive §e§lschematics§7 again§8.
|
UNNOSCHEMRECEIVING=§e{0} §7may now receive §e§lschematics§7 again§8.
|
||||||
|
|
||||||
NOSCHEMSHARING_TEAM=§e{0} §7was excluded from §e{1} {2} §7from §e§lsharing schematics§8: §f{3}
|
NOSCHEMSHARING_TEAM={0} §e{1} §7was excluded from §e{2} {3} §7from §e§lsharing schematics§8: §f{4}
|
||||||
NOSCHEMSHARING_PERMA=§7You are §epermanently§7 excluded from sharing §e§lschematics§8: §e{0}
|
NOSCHEMSHARING_PERMA=§7You are §epermanently§7 excluded from sharing §e§lschematics§8: §e{0}
|
||||||
NOSCHEMSHARING_UNTIL=§7You are excluded from sharing §e§lschematics §euntil {0}§8: §e{1}
|
NOSCHEMSHARING_UNTIL=§7You are excluded from sharing §e§lschematics §euntil {0}§8: §e{1}
|
||||||
UNNOSCHEMSHARING_ERROR=§cThe player is not excluded from sharing schematics.
|
UNNOSCHEMSHARING_ERROR=§cThe player is not excluded from sharing schematics.
|
||||||
UNNOSCHEMSHARING=§e{0} §7may now share §e§lschematics§7 again§8.
|
UNNOSCHEMSHARING=§e{0} §7may now share §e§lschematics§7 again§8.
|
||||||
|
|
||||||
NOSCHEMSUBMITTING_TEAM=§e{0} §7was excluded from §e{1} {2} §7from §e§lsubmitting schematics§8: §f{3}
|
NOSCHEMSUBMITTING_TEAM={0} §e{1} §7was excluded from §e{2} {3} §7from §e§lsubmitting schematics§8: §f{4}
|
||||||
NOSCHEMSUBMITTING_PERMA=§7You are §epermanently§7 excluded from submitting §e§lschematics§8: §e{0}
|
NOSCHEMSUBMITTING_PERMA=§7You are §epermanently§7 excluded from submitting §e§lschematics§8: §e{0}
|
||||||
NOSCHEMSUBMITTING_UNTIL=§7You are excluded from submitting §e§lschematics §euntil {0}§8: §e{1}
|
NOSCHEMSUBMITTING_UNTIL=§7You are excluded from submitting §e§lschematics §euntil {0}§8: §e{1}
|
||||||
UNNOSCHEMSUBMITTING_ERROR=§cThe player is not excluded from submitting schematics.
|
UNNOSCHEMSUBMITTING_ERROR=§cThe player is not excluded from submitting schematics.
|
||||||
UNNOSCHEMSUBMITTING=§e{0} §7may now submit §e§lschematics§7 again§8.
|
UNNOSCHEMSUBMITTING=§e{0} §7may now submit §e§lschematics§7 again§8.
|
||||||
|
|
||||||
NODEVSERVER_TEAM=§e{0} §7has annoyed §e{1} §7with reason §f{3}§7 and therefore has received §e§ldev server prohibition§7§8, §f{2}
|
NODEVSERVER_TEAM={0} §e{1} §7has annoyed §e{2} §7with reason §f{4}§7 and therefore has received §e§ldev server prohibition§7§8, §f{3}
|
||||||
NODEVSERVER_PERMA=§7You are §epermanently§7 excluded from §e§ldev servers§8: §e{0}
|
NODEVSERVER_PERMA=§7You are §epermanently§7 excluded from §e§ldev servers§8: §e{0}
|
||||||
NODEVSERVER_UNTIL=§7You are excluded from §e§ldev servers§7 §euntil {0}§8: §e{1}
|
NODEVSERVER_UNTIL=§7You are excluded from §e§ldev servers§7 §euntil {0}§8: §e{1}
|
||||||
UNNODEVSERVER_ERROR=§cThe player is not excluded from dev servers.
|
UNNODEVSERVER_ERROR=§cThe player is not excluded from dev servers.
|
||||||
UNNODEVSERVER=§e{0} §7may now join §e§ldev servers§7 again§8.
|
UNNODEVSERVER=§e{0} §7may now join §e§ldev servers§7 again§8.
|
||||||
|
|
||||||
NOFIGHTSERVER_TEAM=§e{0} §7was excluded from §e{1} {2} §7from §e§lfighting§8: §f{3}
|
NOFIGHTSERVER_TEAM={0} §e{1} §7was excluded from §e{2} {3} §7from §e§lfighting§8: §f{4}
|
||||||
NOFIGHTSERVER_PERMA=§7You are §epermanently§7 excluded from §e§lfighting§8: §e{0}
|
NOFIGHTSERVER_PERMA=§7You are §epermanently§7 excluded from §e§lfighting§8: §e{0}
|
||||||
NOFIGHTSERVER_UNTIL=§7You are excluded from §e§lfighting§7 §euntil {0}§8: §e{1}
|
NOFIGHTSERVER_UNTIL=§7You are excluded from §e§lfighting§7 §euntil {0}§8: §e{1}
|
||||||
UNNOFIGHTSERVER_ERROR=§cThe player is not excluded from fighting.
|
UNNOFIGHTSERVER_ERROR=§cThe player is not excluded from fighting.
|
||||||
UNNOFIGHTSERVER=§e{0} §7may now join §e§lfights§7 again§8.
|
UNNOFIGHTSERVER=§e{0} §7may now join §e§lfights§7 again§8.
|
||||||
|
|
||||||
NOTEAMSERVER_TEAM=§e{0} §7was excluded from §e{1} {2} §7from §e§lteam servers§8: §f{3}
|
NOTEAMSERVER_TEAM={0} §e{1} §7was excluded from §e{2} {3} §7from §e§lteam servers§8: §f{4}
|
||||||
NOTEAMSERVER_PERMA=§7You are §epermanently§7 excluded from §e§lteam servers§8: §e{0}
|
NOTEAMSERVER_PERMA=§7You are §epermanently§7 excluded from §e§lteam servers§8: §e{0}
|
||||||
NOTEAMSERVER_UNTIL=§7You are excluded from §e§lteam servers§7 §euntil {0}§8: §e{1}
|
NOTEAMSERVER_UNTIL=§7You are excluded from §e§lteam servers§7 §euntil {0}§8: §e{1}
|
||||||
UNNOTEAMSERVER_ERROR=§cThe player is not excluded from team servers.
|
UNNOTEAMSERVER_ERROR=§cThe player is not excluded from team servers.
|
||||||
UNNOTEAMSERVER=§e{0} §7may now set §e§lteam servers§7 again§8.
|
UNNOTEAMSERVER=§e{0} §7may now set §e§lteam servers§7 again§8.
|
||||||
|
|
||||||
NOTE_TEAM=§e{0} §7received a §e§lnote§7 from §e{1} {2}: §f{3}
|
NOTE_TEAM={0} §e{1} §7received a §e§lnote§7 from §e{2} {3}: §f{4}
|
||||||
|
|
||||||
#BugCommand
|
#BugCommand
|
||||||
BUG_MESSAGE=§7Please describe the issue in a Discord ticket with the bug ID §e{0} §7further§8.
|
BUG_MESSAGE=§7Please describe the issue in a Discord ticket with the bug ID §e{0} §7further§8.
|
||||||
@@ -572,7 +572,6 @@ CHAT_NO_RECEIVER=§cNobody receives your message
|
|||||||
CHAT_EMPTY=§cDon\'t write meaningless empty messages.
|
CHAT_EMPTY=§cDon\'t write meaningless empty messages.
|
||||||
|
|
||||||
CHAT_SERVERTEAM=§8STC §e{0}§8» §f{2}
|
CHAT_SERVERTEAM=§8STC §e{0}§8» §f{2}
|
||||||
CHAT_DISCORD_SERVERTEAM=§8STC §e{0}§8» §f{2}
|
|
||||||
CHAT_GLOBAL={3}{4}{5}{6}{0}§8» {7}{2}
|
CHAT_GLOBAL={3}{4}{5}{6}{0}§8» {7}{2}
|
||||||
CHAT_DISCORD_GLOBAL=§8Dc {5}{6}{0}§8» {7}{2}
|
CHAT_DISCORD_GLOBAL=§8Dc {5}{6}{0}§8» {7}{2}
|
||||||
CHAT_TEAM=§8TC §e{0}§8» §f{2}
|
CHAT_TEAM=§8TC §e{0}§8» §f{2}
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ UNPUNISHMENT_USAGE=§8/§7{0} §8[§eSpieler§8]
|
|||||||
PUNISHMENT_UNTIL=bis zum {0}
|
PUNISHMENT_UNTIL=bis zum {0}
|
||||||
PUNISHMENT_PERMA=permanent
|
PUNISHMENT_PERMA=permanent
|
||||||
|
|
||||||
BAN_TEAM=§e{1} §7wurde von §e{2} {3} §e§lgebannt§8. §7Grund§8: §f{4}
|
BAN_TEAM={0} §e{1} §7wurde von §e{2} {3} §e§lgebannt§8. §7Grund§8: §f{4}
|
||||||
BAN_PERMA=§7Du bist §epermanent §e§lgebannt§8. §7Grund§8: §e{0}
|
BAN_PERMA=§7Du bist §epermanent §e§lgebannt§8. §7Grund§8: §e{0}
|
||||||
BAN_UNTIL=§7Du bist §ebis zum {0} §e§lgebannt§8. §7Grund§8: §e{1}
|
BAN_UNTIL=§7Du bist §ebis zum {0} §e§lgebannt§8. §7Grund§8: §e{1}
|
||||||
UNBAN_ERROR=§cDer Spieler ist nicht gebannt.
|
UNBAN_ERROR=§cDer Spieler ist nicht gebannt.
|
||||||
@@ -148,49 +148,49 @@ BAN_AVOIDING_ALERT=§cMögliche Bannumgehung durch §r{0}§c: {1}
|
|||||||
BAN_AVOIDING_LIST=§c{0} §e{1}
|
BAN_AVOIDING_LIST=§c{0} §e{1}
|
||||||
BAN_AVOIDING_BAN_HOVER=§cBanne Spieler wegen Bannumgehung
|
BAN_AVOIDING_BAN_HOVER=§cBanne Spieler wegen Bannumgehung
|
||||||
|
|
||||||
MUTE_TEAM=§e{0} §7wurde von §e{1} {2} §e§lgemuted§8. §7Grund§8: §f{3}
|
MUTE_TEAM={0} §e{1} §7wurde von §e{2} {3} §e§lgemuted§8. §7Grund§8: §f{4}
|
||||||
MUTE_PERMA=§7Du bist §epermanent §e§lgemuted§8. §7Grund§8: §e{0}
|
MUTE_PERMA=§7Du bist §epermanent §e§lgemuted§8. §7Grund§8: §e{0}
|
||||||
MUTE_UNTIL=§7Du bist §ebis zum {0} §e§lgemuted§8. §7Grund§8: §e{1}
|
MUTE_UNTIL=§7Du bist §ebis zum {0} §e§lgemuted§8. §7Grund§8: §e{1}
|
||||||
UNMUTE_ERROR=§cDer Spieler ist nicht gemuted.
|
UNMUTE_ERROR=§cDer Spieler ist nicht gemuted.
|
||||||
UNMUTE=§7Du hast §e{0} §e§lentmuted.
|
UNMUTE=§7Du hast §e{0} §e§lentmuted.
|
||||||
|
|
||||||
NOSCHEMRECEIVING_TEAM=§e{0} §7wurde von §e{1} {2} §7vom §e§lSchematicerhalten§7 ausgeschlossen§8: §f{3}
|
NOSCHEMRECEIVING_TEAM={0} §e{1} §7wurde von §e{2} {3} §7vom §e§lSchematicerhalten§7 ausgeschlossen§8: §f{4}
|
||||||
NOSCHEMRECEIVING_PERMA=§7Du bist §epermanent §7vom Erhalten von §e§lSchematics§7 ausgeschlossen§8: §e{0}
|
NOSCHEMRECEIVING_PERMA=§7Du bist §epermanent §7vom Erhalten von §e§lSchematics§7 ausgeschlossen§8: §e{0}
|
||||||
NOSCHEMRECEIVING_UNTIL=§7Du bist §ebis zum {0} §7vom Erhalten von §e§lSchematics§7 ausgeschlossen§8: §e{1}
|
NOSCHEMRECEIVING_UNTIL=§7Du bist §ebis zum {0} §7vom Erhalten von §e§lSchematics§7 ausgeschlossen§8: §e{1}
|
||||||
UNNOSCHEMRECEIVING_ERROR=§cDer Spieler ist nicht vom Erhalten von Schematics ausgeschlossen.
|
UNNOSCHEMRECEIVING_ERROR=§cDer Spieler ist nicht vom Erhalten von Schematics ausgeschlossen.
|
||||||
UNNOSCHEMRECEIVING=§e{0} §7darf nun wieder §e§lSchematics§7 erhalten§8.
|
UNNOSCHEMRECEIVING=§e{0} §7darf nun wieder §e§lSchematics§7 erhalten§8.
|
||||||
|
|
||||||
NOSCHEMSHARING_TEAM=§e{0} §7wurde von §e{1} {2} §7vom §e§lSchematicverteilen§7 ausgeschlossen§8: §f{3}
|
NOSCHEMSHARING_TEAM={0} §e{1} §7wurde von §e{2} {3} §7vom §e§lSchematicverteilen§7 ausgeschlossen§8: §f{4}
|
||||||
NOSCHEMSHARING_PERMA=§7Du bist §epermanent §7vom §e§lVerteilen von Schematics§7 ausgeschlossen§8: §e{0}
|
NOSCHEMSHARING_PERMA=§7Du bist §epermanent §7vom §e§lVerteilen von Schematics§7 ausgeschlossen§8: §e{0}
|
||||||
NOSCHEMSHARING_UNTIL=§7Du bist §ebis zum {0} §7vom §e§lVerteilen von Schematics§7 ausgeschlossen§8: §e{1}
|
NOSCHEMSHARING_UNTIL=§7Du bist §ebis zum {0} §7vom §e§lVerteilen von Schematics§7 ausgeschlossen§8: §e{1}
|
||||||
UNNOSCHEMSHARING_ERROR=§cDer Spieler ist nicht vom Verteilen von Schematics ausgeschlossen.
|
UNNOSCHEMSHARING_ERROR=§cDer Spieler ist nicht vom Verteilen von Schematics ausgeschlossen.
|
||||||
UNNOSCHEMSHARING=§e{0} §7darf nun wieder §e§lSchematics§7 verteilen§8.
|
UNNOSCHEMSHARING=§e{0} §7darf nun wieder §e§lSchematics§7 verteilen§8.
|
||||||
|
|
||||||
NOSCHEMSUBMITTING_TEAM=§e{0} §7wurde von §e{1} {2} §7vom §e§lSchematiceinsenden§7 ausgeschlossen§8: §f{3}
|
NOSCHEMSUBMITTING_TEAM={0} §e{1} §7wurde von §e{2} {3} §7vom §e§lSchematiceinsenden§7 ausgeschlossen§8: §f{4}
|
||||||
NOSCHEMSUBMITTING_PERMA=§7Du bist §epermanent §7vom §e§lEinsenden von Schematics§7 ausgeschlossen§8: §e{0}
|
NOSCHEMSUBMITTING_PERMA=§7Du bist §epermanent §7vom §e§lEinsenden von Schematics§7 ausgeschlossen§8: §e{0}
|
||||||
NOSCHEMSUBMITTING_UNTIL=§7Du bist §ebis zum {0} §7vom §e§lEinsenden von Schematics§7 ausgeschlossen§8: §e{1}
|
NOSCHEMSUBMITTING_UNTIL=§7Du bist §ebis zum {0} §7vom §e§lEinsenden von Schematics§7 ausgeschlossen§8: §e{1}
|
||||||
UNNOSCHEMSUBMITTING_ERROR=§cDer Spieler ist nicht vom Einsenden von Schematics ausgeschlossen.
|
UNNOSCHEMSUBMITTING_ERROR=§cDer Spieler ist nicht vom Einsenden von Schematics ausgeschlossen.
|
||||||
UNNOSCHEMSUBMITTING=§e{0} §7darf nun wieder §e§lSchematis§7 einsenden§8.
|
UNNOSCHEMSUBMITTING=§e{0} §7darf nun wieder §e§lSchematis§7 einsenden§8.
|
||||||
|
|
||||||
NODEVSERVER_TEAM=§e{0} §7hat §e{1} §7mit Grund §f{3}§7 zu genervt und hat daher §e§lDevserververbot§7 erhalten§8, §f{2}
|
NODEVSERVER_TEAM={0} §e{1} §7hat §e{2} §7mit Grund §f{4}§7 zu genervt und hat daher §e§lDevserververbot§7 erhalten§8, §f{3}
|
||||||
NODEVSERVER_PERMA=§7Du bist §epermanent §7vom §e§lDevserver§7 ausgeschlossen§8: §e{0}
|
NODEVSERVER_PERMA=§7Du bist §epermanent §7vom §e§lDevserver§7 ausgeschlossen§8: §e{0}
|
||||||
NODEVSERVER_UNTIL=§7Du bist §ebis zum {0} §7vom §e§lDevserver§7 ausgeschlossen§8: §e{1}
|
NODEVSERVER_UNTIL=§7Du bist §ebis zum {0} §7vom §e§lDevserver§7 ausgeschlossen§8: §e{1}
|
||||||
UNNODEVSERVER_ERROR=§cDer Spieler ist nicht vom Devserver ausgeschlossen.
|
UNNODEVSERVER_ERROR=§cDer Spieler ist nicht vom Devserver ausgeschlossen.
|
||||||
UNNODEVSERVER=§e{0} §7darf nun wieder dem §e§lDevserver§7 beitreten§8.
|
UNNODEVSERVER=§e{0} §7darf nun wieder dem §e§lDevserver§7 beitreten§8.
|
||||||
|
|
||||||
NOFIGHTSERVER_TEAM=§e{0} §7wurde von §e{1} {2} §7vom §e§lKämpfen§7 ausgeschlossen§8: §f{3}
|
NOFIGHTSERVER_TEAM={0} §e{1} §7wurde von §e{2} {3} §7vom §e§lKämpfen§7 ausgeschlossen§8: §f{4}
|
||||||
NOFIGHTSERVER_PERMA=§7Du bist §epermanent §7vom §e§lKämpfen§7 ausgeschlossen§8: §e{0}
|
NOFIGHTSERVER_PERMA=§7Du bist §epermanent §7vom §e§lKämpfen§7 ausgeschlossen§8: §e{0}
|
||||||
NOFIGHTSERVER_UNTIL=§7Du bist §ebis zum {0} §7vom §e§lKämpfen§7 ausgeschlossen§8: §e{1}
|
NOFIGHTSERVER_UNTIL=§7Du bist §ebis zum {0} §7vom §e§lKämpfen§7 ausgeschlossen§8: §e{1}
|
||||||
UNNOFIGHTSERVER_ERROR=§cDer Spieler ist nicht vom Kämpfen ausgeschlossen.
|
UNNOFIGHTSERVER_ERROR=§cDer Spieler ist nicht vom Kämpfen ausgeschlossen.
|
||||||
UNNOFIGHTSERVER=§e{0} §7darf nun wieder §e§lKämpfen§7 beitreten§8.
|
UNNOFIGHTSERVER=§e{0} §7darf nun wieder §e§lKämpfen§7 beitreten§8.
|
||||||
|
|
||||||
NOTEAMSERVER_TEAM=§e{0} §7wurde von §e{1} {2} §7vom §e§lTeamserver§7 setzen ausgeschlossen§8: §f{3}
|
NOTEAMSERVER_TEAM={0} §e{1} §7wurde von §e{2} {3} §7vom §e§lTeamserver§7 setzen ausgeschlossen§8: §f{4}
|
||||||
NOTEAMSERVER_PERMA=§7Du bist §epermanent §7vom §e§lTeamserver§7 setzen ausgeschlossen§8: §e{0}
|
NOTEAMSERVER_PERMA=§7Du bist §epermanent §7vom §e§lTeamserver§7 setzen ausgeschlossen§8: §e{0}
|
||||||
NOTEAMSERVER_UNTIL=§7Du bist §ebis zum {0} §7vom §e§lTeamserver§7 setzen ausgeschlossen§8: §e{1}
|
NOTEAMSERVER_UNTIL=§7Du bist §ebis zum {0} §7vom §e§lTeamserver§7 setzen ausgeschlossen§8: §e{1}
|
||||||
UNNOTEAMSERVER_ERROR=§cDer Spieler ist nicht vom Teamserver setzten ausgeschlossen.
|
UNNOTEAMSERVER_ERROR=§cDer Spieler ist nicht vom Teamserver setzten ausgeschlossen.
|
||||||
UNNOTEAMSERVER=§e{0} §7darf nun wieder §e§lTeamserver§7 setzen§8.
|
UNNOTEAMSERVER=§e{0} §7darf nun wieder §e§lTeamserver§7 setzen§8.
|
||||||
|
|
||||||
NOTE_TEAM=§e{0} §7erhielt von §e{1} {2} §7die §e§lNotiz§7§8: §f{3}
|
NOTE_TEAM={0} §e{1} §7erhielt von §e{2} {3} §7die §e§lNotiz§7§8: §f{4}
|
||||||
|
|
||||||
#BugCommand
|
#BugCommand
|
||||||
BUG_MESSAGE=§7Bitte beschreibe das Problem in einem Discordticket genauer und gebe dabei die Bug-ID §e{0} §7an§8.
|
BUG_MESSAGE=§7Bitte beschreibe das Problem in einem Discordticket genauer und gebe dabei die Bug-ID §e{0} §7an§8.
|
||||||
@@ -536,9 +536,9 @@ CHAT_YOYONOW_3=Vielen Dank.
|
|||||||
CHAT_YOYONOW_4=Ich wünsche dir noch weiterhin ein reibungsloses Spielerlebnis.
|
CHAT_YOYONOW_4=Ich wünsche dir noch weiterhin ein reibungsloses Spielerlebnis.
|
||||||
CHAT_CHAOSCAOT_1=Du hast mich gerufen!
|
CHAT_CHAOSCAOT_1=Du hast mich gerufen!
|
||||||
CHAT_CHAOSCAOT_2=Wenn etwas nicht funktioniert, dann nen es einfach ein Feature.
|
CHAT_CHAOSCAOT_2=Wenn etwas nicht funktioniert, dann nen es einfach ein Feature.
|
||||||
CHAT_CHAOSCAOT_3=Und wenn es ein Feature ist, dann kann es nicht kaputt sein.
|
CHAT_CHAOSCAOT_3=Und wenn es ein Feature ist, dann kann es nicht kaputt.
|
||||||
CHAT_CHAOSCAOT_4=Kaputt ist nur eine Definition. Wenn du alles als Feature definierst, dann kann es auch keine Bugs geben.
|
CHAT_CHAOSCAOT_4=Kaputt ist nur eine Definition. Wenn du es als Feature definiert, dann kann es nicht kaputt sein.
|
||||||
CHAT_CHAOSCAOT_5=Solltest du es aber doch als Bug definieren, dann sag uns bescheid mit dem Befehl "/bug <MESSAGE>".
|
CHAT_CHAOSCAOT_5=Und wenn du es als kaputt definiert, dann sag uns bescheid mit dem Befehl "/bug <MESSAGE>".
|
||||||
CHAT_CHAOSCAOT_6=Vielen Dank.
|
CHAT_CHAOSCAOT_6=Vielen Dank.
|
||||||
CHAT_RECEIVE=§cUm Chatnachrichten versenden zu können, musst du auch welche empfangen!
|
CHAT_RECEIVE=§cUm Chatnachrichten versenden zu können, musst du auch welche empfangen!
|
||||||
CHAT_NO_LINKS=§cDu darfst keine Links versenden.
|
CHAT_NO_LINKS=§cDu darfst keine Links versenden.
|
||||||
@@ -547,7 +547,6 @@ CHAT_NO_RECEIVER=§cNiemand empfängt deine Nachricht
|
|||||||
CHAT_EMPTY=§cSchreibe keine inhaltslosen Nachrichten.
|
CHAT_EMPTY=§cSchreibe keine inhaltslosen Nachrichten.
|
||||||
|
|
||||||
CHAT_SERVERTEAM=§8STC §e{0}§8» §f{2}
|
CHAT_SERVERTEAM=§8STC §e{0}§8» §f{2}
|
||||||
CHAT_DISCORD_SERVERTEAM=§8STC §e{0}§8» §f{2}
|
|
||||||
CHAT_GLOBAL={3}{4}{5}{6}{0}§8» {7}{2}
|
CHAT_GLOBAL={3}{4}{5}{6}{0}§8» {7}{2}
|
||||||
CHAT_DISCORD_GLOBAL=§8Dc {5}{6}{0}§8» {7}{2}
|
CHAT_DISCORD_GLOBAL=§8Dc {5}{6}{0}§8» {7}{2}
|
||||||
CHAT_TEAM=§8TC §e{0}§8» §f{2}
|
CHAT_TEAM=§8TC §e{0}§8» §f{2}
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ package de.steamwar.velocitycore;
|
|||||||
import de.steamwar.sql.SchematicType;
|
import de.steamwar.sql.SchematicType;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
public class ArenaMode extends GameModeConfig {
|
public class ArenaMode extends GameModeConfig {
|
||||||
@@ -77,7 +76,7 @@ public class ArenaMode extends GameModeConfig {
|
|||||||
public static List<String> getAllChatNames(boolean historic) {
|
public static List<String> getAllChatNames(boolean historic) {
|
||||||
List<String> chatNames = new LinkedList<>();
|
List<String> chatNames = new LinkedList<>();
|
||||||
for(ArenaMode mode : byInternal.values()){
|
for(ArenaMode mode : byInternal.values()){
|
||||||
if(mode.isActive() && historic == mode.isHistoric())
|
if(historic == mode.isHistoric())
|
||||||
chatNames.addAll(mode.getServer().getChatNames());
|
chatNames.addAll(mode.getServer().getChatNames());
|
||||||
}
|
}
|
||||||
return chatNames;
|
return chatNames;
|
||||||
@@ -95,9 +94,6 @@ public class ArenaMode extends GameModeConfig {
|
|||||||
@Getter
|
@Getter
|
||||||
private String config;
|
private String config;
|
||||||
|
|
||||||
@Getter
|
|
||||||
private List<Integer> ActiveMonths = Collections.emptyList();
|
|
||||||
|
|
||||||
public String hasMap(String map){
|
public String hasMap(String map){
|
||||||
for(String m : getMaps()) {
|
for(String m : getMaps()) {
|
||||||
if(m.equalsIgnoreCase(map))
|
if(m.equalsIgnoreCase(map))
|
||||||
@@ -118,10 +114,8 @@ public class ArenaMode extends GameModeConfig {
|
|||||||
return getServer().getChatNames().get(0);
|
return getServer().getChatNames().get(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isActive() {
|
public boolean withoutChatName(){
|
||||||
if (getServer().getChatNames().isEmpty()) return false;
|
return getServer().getChatNames().isEmpty();
|
||||||
if (ActiveMonths.isEmpty()) return true;
|
|
||||||
return ActiveMonths.contains(LocalDateTime.now().getMonth().getValue());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSchemTypeOrInternalName() {
|
public String getSchemTypeOrInternalName() {
|
||||||
|
|||||||
@@ -44,7 +44,6 @@ public enum ServerVersion {
|
|||||||
PAPER_18("paper-1.18.2.jar", 15, ProtocolVersion.MINECRAFT_1_18_2),
|
PAPER_18("paper-1.18.2.jar", 15, ProtocolVersion.MINECRAFT_1_18_2),
|
||||||
PAPER_19("paper-1.19.3.jar", 19, ProtocolVersion.MINECRAFT_1_19_3),
|
PAPER_19("paper-1.19.3.jar", 19, ProtocolVersion.MINECRAFT_1_19_3),
|
||||||
PAPER_20("paper-1.20.1.jar", 20, ProtocolVersion.MINECRAFT_1_20),
|
PAPER_20("paper-1.20.1.jar", 20, ProtocolVersion.MINECRAFT_1_20),
|
||||||
DEVEL_21("paper-1.21.5.jar", 21, ProtocolVersion.MINECRAFT_1_21_5),
|
|
||||||
PAPER_21("paper-1.21.3.jar", 21, ProtocolVersion.MINECRAFT_1_21_2);
|
PAPER_21("paper-1.21.3.jar", 21, ProtocolVersion.MINECRAFT_1_21_2);
|
||||||
|
|
||||||
private static final Map<String, ServerVersion> chatMap = new HashMap<>();
|
private static final Map<String, ServerVersion> chatMap = new HashMap<>();
|
||||||
@@ -95,10 +94,6 @@ public enum ServerVersion {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static ServerVersion get(int version) {
|
public static ServerVersion get(int version) {
|
||||||
if (version == 21) {
|
|
||||||
return DEVEL_21;
|
|
||||||
}
|
|
||||||
|
|
||||||
return versionMap.get(version);
|
return versionMap.get(version);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -135,12 +135,12 @@ public class DevCommand extends SWCommand {
|
|||||||
});
|
});
|
||||||
|
|
||||||
devServerPorts.forEach((username, value) -> {
|
devServerPorts.forEach((username, value) -> {
|
||||||
|
if (devServers.containsKey(username))
|
||||||
|
return;
|
||||||
|
|
||||||
SteamwarUser user = SteamwarUser.get(username);
|
SteamwarUser user = SteamwarUser.get(username);
|
||||||
String name = "Dev " + user.getUserName();
|
String name = "Dev " + user.getUserName();
|
||||||
((VelocityViaConfig) Via.getConfig()).getVelocityServerProtocols().put(name, ServerVersion.get(devServerVersions.get(username)).getProtocolVersion().getProtocol());
|
((VelocityViaConfig) Via.getConfig()).getVelocityServerProtocols().put(name, ServerVersion.get(devServerVersions.get(username)).getProtocolVersion().getProtocol());
|
||||||
|
|
||||||
if (devServers.containsKey(username))
|
|
||||||
return;
|
|
||||||
devServers.put(user.getUserName().toLowerCase(), VelocityCore.getProxy().registerServer(new ServerInfo(name, new InetSocketAddress("127.0.0.1", value))));
|
devServers.put(user.getUserName().toLowerCase(), VelocityCore.getProxy().registerServer(new ServerInfo(name, new InetSocketAddress("127.0.0.1", value))));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public class FightCommand extends SWCommand {
|
|||||||
private static void getModes(Chatter sender, String precommand, boolean historic){
|
private static void getModes(Chatter sender, String precommand, boolean historic){
|
||||||
Component start = Component.empty();
|
Component start = Component.empty();
|
||||||
for(ArenaMode mode : ArenaMode.getAllModes()){
|
for(ArenaMode mode : ArenaMode.getAllModes()){
|
||||||
if (!mode.isActive() || mode.isHistoric() != historic)
|
if(mode.withoutChatName() || mode.isHistoric() != historic)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
String command = precommand + mode.getChatName();
|
String command = precommand + mode.getChatName();
|
||||||
|
|||||||
@@ -20,8 +20,6 @@
|
|||||||
package de.steamwar.velocitycore.commands;
|
package de.steamwar.velocitycore.commands;
|
||||||
|
|
||||||
import com.velocitypowered.api.proxy.Player;
|
import com.velocitypowered.api.proxy.Player;
|
||||||
import com.velocitypowered.proxy.Velocity;
|
|
||||||
import de.steamwar.velocitycore.VelocityCore;
|
|
||||||
import de.steamwar.velocitycore.listeners.ChatListener;
|
import de.steamwar.velocitycore.listeners.ChatListener;
|
||||||
import de.steamwar.command.SWCommand;
|
import de.steamwar.command.SWCommand;
|
||||||
import de.steamwar.messages.Chatter;
|
import de.steamwar.messages.Chatter;
|
||||||
@@ -43,7 +41,7 @@ public class MsgCommand extends SWCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void msg(PlayerChatter sender, Player target, String[] args) {
|
public static void msg(PlayerChatter sender, Player target, String[] args) {
|
||||||
if(target == null || VelocityCore.getProxy().getPlayer(target.getUniqueId()).orElse(null) == null) {
|
if(target == null || target.getCurrentServer().isEmpty()) {
|
||||||
sender.system("MSG_OFFLINE");
|
sender.system("MSG_OFFLINE");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -210,7 +210,7 @@ public class PunishmentCommand {
|
|||||||
target.punish(punishmentType, banTime, msg, punisher.getId(), isPerma);
|
target.punish(punishmentType, banTime, msg, punisher.getId(), isPerma);
|
||||||
if(punishmentType == Punishment.PunishmentType.Ban)
|
if(punishmentType == Punishment.PunishmentType.Ban)
|
||||||
ban(target, banTime, msg, punisher, isPerma);
|
ban(target, banTime, msg, punisher, isPerma);
|
||||||
Chatter.serverteam().system(punishmentType.getTeamMessage(), target, sender, new Message((isPerma ? "PUNISHMENT_PERMA" : "PUNISHMENT_UNTIL"), banTime), msg);
|
Chatter.serverteam().system(punishmentType.getTeamMessage(), new Message("PREFIX"), target, sender, new Message((isPerma ? "PUNISHMENT_PERMA" : "PUNISHMENT_UNTIL"), banTime), msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Register
|
@Register
|
||||||
|
|||||||
@@ -49,11 +49,7 @@ public class TypeMappers {
|
|||||||
return new TypeMapper<>() {
|
return new TypeMapper<>() {
|
||||||
@Override
|
@Override
|
||||||
public ArenaMode map(Chatter sender, PreviousArguments previousArguments, String s) {
|
public ArenaMode map(Chatter sender, PreviousArguments previousArguments, String s) {
|
||||||
ArenaMode arenaMode = ArenaMode.getByChat(s);
|
return ArenaMode.getByChat(s);
|
||||||
if (arenaMode == null) return null;
|
|
||||||
if (arenaMode.isHistoric() != historic) return null;
|
|
||||||
if (!arenaMode.isActive()) return null;
|
|
||||||
return arenaMode;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -167,19 +167,14 @@ public class DiscordBot {
|
|||||||
checklistChannel = new ChecklistChannel(config.channel("checklist"));
|
checklistChannel = new ChecklistChannel(config.channel("checklist"));
|
||||||
config.getCouncilThread().forEach((roleId, threadId) -> new CouncilChannel(DiscordBot.getGuild().getRoleById(roleId), DiscordBot.getGuild().getThreadChannelById(threadId)));
|
config.getCouncilThread().forEach((roleId, threadId) -> new CouncilChannel(DiscordBot.getGuild().getRoleById(roleId), DiscordBot.getGuild().getThreadChannelById(threadId)));
|
||||||
|
|
||||||
announcementChannel = new DiscordChannel(config.channel("announcement"), 0) {
|
announcementChannel = new DiscordChannel(config.channel("announcement")) {
|
||||||
@Override
|
@Override
|
||||||
public void received(MessageReceivedEvent event) {
|
public void received(MessageReceivedEvent event) {
|
||||||
Chatter.broadcast().system("ALERT", event.getMessage().getContentDisplay());
|
Chatter.broadcast().system("ALERT", event.getMessage().getContentDisplay());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
ingameChat = new DiscordChatRoom(config.channel("ingame"), "CHAT_DISCORD_GLOBAL", Chatter::broadcast);
|
||||||
// There is a hard limit of 30 messages per minute to send as a webhook, thus with 8 webhooks we can send
|
serverTeamChat = new DiscordChatRoom(config.channel("serverteam"), "CHAT_SERVERTEAM", Chatter::serverteam);
|
||||||
// 240 messages per minute. Which means 4 every second. I looked at the WGS fights and there were around
|
|
||||||
// ~70 in a short burst and then rather long no new message.
|
|
||||||
ingameChat = new DiscordChatRoom(config.channel("ingame"), "CHAT_DISCORD_GLOBAL", Chatter::globalChat, 8);
|
|
||||||
// 60 messages per minute should be enough for the server team!
|
|
||||||
serverTeamChat = new DiscordChatRoom(config.channel("serverteam"), "CHAT_DISCORD_SERVERTEAM", Chatter::serverteam, 2);
|
|
||||||
|
|
||||||
VelocityCore.schedule(() -> {
|
VelocityCore.schedule(() -> {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ public class ChecklistChannel extends DiscordChannel {
|
|||||||
private final List<Integer> lastSchematics = new ArrayList<>();
|
private final List<Integer> lastSchematics = new ArrayList<>();
|
||||||
|
|
||||||
public ChecklistChannel(String channel) {
|
public ChecklistChannel(String channel) {
|
||||||
super(channel, 0);
|
super(channel);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void update() {
|
public void update() {
|
||||||
|
|||||||
@@ -26,21 +26,17 @@ import de.steamwar.velocitycore.discord.DiscordBot;
|
|||||||
import de.steamwar.velocitycore.discord.listeners.ChannelListener;
|
import de.steamwar.velocitycore.discord.listeners.ChannelListener;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
import net.dv8tion.jda.api.entities.Icon;
|
||||||
import net.dv8tion.jda.api.entities.User;
|
import net.dv8tion.jda.api.entities.User;
|
||||||
import net.dv8tion.jda.api.entities.Webhook;
|
|
||||||
import net.dv8tion.jda.api.entities.WebhookClient;
|
|
||||||
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
|
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
|
||||||
import net.dv8tion.jda.api.entities.channel.middleman.MessageChannel;
|
import net.dv8tion.jda.api.entities.channel.middleman.MessageChannel;
|
||||||
import net.dv8tion.jda.api.events.interaction.component.GenericComponentInteractionCreateEvent;
|
import net.dv8tion.jda.api.events.interaction.component.GenericComponentInteractionCreateEvent;
|
||||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||||
|
import net.dv8tion.jda.api.utils.ImageProxy;
|
||||||
import net.dv8tion.jda.api.utils.messages.MessageCreateBuilder;
|
import net.dv8tion.jda.api.utils.messages.MessageCreateBuilder;
|
||||||
import net.dv8tion.jda.internal.requests.IncomingWebhookClientImpl;
|
|
||||||
import net.kyori.adventure.text.Component;
|
import net.kyori.adventure.text.Component;
|
||||||
import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
|
import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
|
||||||
|
|
||||||
import java.util.ArrayDeque;
|
|
||||||
import java.util.Queue;
|
|
||||||
|
|
||||||
|
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class DiscordChannel extends Chatter.PlayerlessChatter {
|
public class DiscordChannel extends Chatter.PlayerlessChatter {
|
||||||
@@ -50,36 +46,21 @@ public class DiscordChannel extends Chatter.PlayerlessChatter {
|
|||||||
return user != null ? user : SteamwarUser.get(0);
|
return user != null ? user : SteamwarUser.get(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
private final Queue<Webhook> webhooks = new ArrayDeque<>();
|
|
||||||
|
|
||||||
private final SteamwarUser user;
|
private final SteamwarUser user;
|
||||||
@Getter
|
@Getter
|
||||||
private final MessageChannel channel;
|
private final MessageChannel channel;
|
||||||
|
|
||||||
private final int maxNumberOfWebhooks;
|
|
||||||
|
|
||||||
public DiscordChannel(User user) {
|
public DiscordChannel(User user) {
|
||||||
this(userOrPublic(user), user.openPrivateChannel().complete(), 0);
|
this(userOrPublic(user), user.openPrivateChannel().complete());
|
||||||
}
|
}
|
||||||
|
|
||||||
public DiscordChannel(String channel, int maxNumberOfWebhooks) {
|
public DiscordChannel(String channel) {
|
||||||
this(DiscordBot.getGuild().getTextChannelById(channel), maxNumberOfWebhooks);
|
this(DiscordBot.getGuild().getTextChannelById(channel));
|
||||||
}
|
}
|
||||||
|
|
||||||
public DiscordChannel(MessageChannel channel, int maxNumberOfWebhooks) {
|
public DiscordChannel(MessageChannel channel) {
|
||||||
this(SteamwarUser.get(-1), channel, maxNumberOfWebhooks);
|
this(SteamwarUser.get(-1), channel);
|
||||||
ChannelListener.getChannels().put(this.channel, this);
|
ChannelListener.getChannels().put(this.channel, this);
|
||||||
|
|
||||||
if (channel instanceof TextChannel) {
|
|
||||||
TextChannel textChannel = (TextChannel) channel;
|
|
||||||
webhooks.addAll(textChannel.retrieveWebhooks().complete());
|
|
||||||
while (webhooks.size() > maxNumberOfWebhooks) {
|
|
||||||
webhooks.remove().delete().queue();
|
|
||||||
}
|
|
||||||
while (webhooks.size() < maxNumberOfWebhooks) {
|
|
||||||
webhooks.add(textChannel.createWebhook(DiscordBot.getInstance().getJda().getSelfUser().getName()).complete());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void send(String message) {
|
public void send(String message) {
|
||||||
@@ -89,7 +70,7 @@ public class DiscordChannel extends Chatter.PlayerlessChatter {
|
|||||||
.replace("@here", "`@here`")
|
.replace("@here", "`@here`")
|
||||||
.replaceAll("<[@#]!?\\d+>", "`$0`");
|
.replaceAll("<[@#]!?\\d+>", "`$0`");
|
||||||
|
|
||||||
if (maxNumberOfWebhooks > 0 && getChannel() instanceof TextChannel && message.contains("»")) {
|
if (getChannel() instanceof TextChannel && message.contains("»")) {
|
||||||
String[] strings = message.split("»", 2);
|
String[] strings = message.split("»", 2);
|
||||||
String userName = strings[0];
|
String userName = strings[0];
|
||||||
String sendMessage = strings[1];
|
String sendMessage = strings[1];
|
||||||
@@ -104,24 +85,29 @@ public class DiscordChannel extends Chatter.PlayerlessChatter {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
String avatarUrl;
|
ImageProxy avatarUrl;
|
||||||
if (user.getDiscordId() != null) {
|
if (user.getDiscordId() != null) {
|
||||||
avatarUrl = DiscordBot.getGuild().retrieveMemberById(user.getDiscordId()).complete().getEffectiveAvatarUrl();
|
avatarUrl = DiscordBot.getGuild().retrieveMemberById(user.getDiscordId()).complete().getEffectiveAvatar();
|
||||||
} else {
|
} else {
|
||||||
avatarUrl = DiscordBot.getInstance().getJda().getSelfUser().getAvatarUrl();
|
avatarUrl = DiscordBot.getInstance().getJda().getSelfUser().getAvatar();
|
||||||
}
|
}
|
||||||
|
|
||||||
Webhook webhook = webhooks.poll();
|
TextChannel textChannel = (TextChannel) getChannel();
|
||||||
webhooks.add(webhook);
|
try {
|
||||||
|
textChannel.createWebhook(userName)
|
||||||
// This works as per this documentation: https://discord.com/developers/docs/resources/webhook#execute-webhook
|
.setAvatar(Icon.from(avatarUrl.download(128).get()))
|
||||||
IncomingWebhookClientImpl webhookClient = (IncomingWebhookClientImpl) WebhookClient.createClient(DiscordBot.getInstance().getJda(), webhook.getUrl());
|
.onSuccess(webhook -> {
|
||||||
webhookClient.sendRequest()
|
webhook.sendMessage(sendMessage)
|
||||||
.setUsername(userName)
|
.onSuccess(__ -> {
|
||||||
.setAvatarUrl(avatarUrl)
|
webhook.delete().queue();
|
||||||
.setContent(sendMessage)
|
})
|
||||||
.queue();
|
.queue();
|
||||||
return;
|
})
|
||||||
|
.queue();
|
||||||
|
return;
|
||||||
|
} catch (Exception e) {
|
||||||
|
// Ignore and send message as normal!
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
send(new MessageCreateBuilder()
|
send(new MessageCreateBuilder()
|
||||||
|
|||||||
@@ -33,8 +33,8 @@ public class DiscordChatRoom extends DiscordChannel {
|
|||||||
private final String format;
|
private final String format;
|
||||||
private final Supplier<ChatterGroup> target;
|
private final Supplier<ChatterGroup> target;
|
||||||
|
|
||||||
public DiscordChatRoom(String channel, String format, Supplier<ChatterGroup> target, int maxNumberOfWebhooks) {
|
public DiscordChatRoom(String channel, String format, Supplier<ChatterGroup> target) {
|
||||||
super(channel, maxNumberOfWebhooks);
|
super(channel);
|
||||||
this.format = format;
|
this.format = format;
|
||||||
this.target = target;
|
this.target = target;
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -46,14 +46,14 @@ public class StaticMessageChannel extends DiscordChannel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public StaticMessageChannel(String channel, Supplier<MessageCreateBuilder> supplier, Consumer<GenericComponentInteractionCreateEvent> interaction) {
|
public StaticMessageChannel(String channel, Supplier<MessageCreateBuilder> supplier, Consumer<GenericComponentInteractionCreateEvent> interaction) {
|
||||||
super(channel, 0);
|
super(channel);
|
||||||
this.supplier = supplier;
|
this.supplier = supplier;
|
||||||
this.interaction = interaction;
|
this.interaction = interaction;
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
public StaticMessageChannel(MessageChannel channel, Supplier<MessageCreateBuilder> supplier, Consumer<GenericComponentInteractionCreateEvent> interaction) {
|
public StaticMessageChannel(MessageChannel channel, Supplier<MessageCreateBuilder> supplier, Consumer<GenericComponentInteractionCreateEvent> interaction) {
|
||||||
super(channel, 0);
|
super(channel);
|
||||||
this.supplier = supplier;
|
this.supplier = supplier;
|
||||||
this.interaction = interaction;
|
this.interaction = interaction;
|
||||||
init();
|
init();
|
||||||
|
|||||||
+1
-1
@@ -70,7 +70,7 @@ public class DiscordTicketHandler extends ListenerAdapter {
|
|||||||
Permission.MESSAGE_HISTORY).complete();
|
Permission.MESSAGE_HISTORY).complete();
|
||||||
ticketChannel.getManager().setTopic(event.getUser().getId()).complete();
|
ticketChannel.getManager().setTopic(event.getUser().getId()).complete();
|
||||||
|
|
||||||
DiscordChannel channel = new DiscordChannel(DiscordChannel.userOrPublic(event.getUser()), ticketChannel, 0);
|
DiscordChannel channel = new DiscordChannel(DiscordChannel.userOrPublic(event.getUser()), ticketChannel);
|
||||||
channel.send(new MessageCreateBuilder()
|
channel.send(new MessageCreateBuilder()
|
||||||
.setEmbeds(new EmbedBuilder()
|
.setEmbeds(new EmbedBuilder()
|
||||||
.setTitle(channel.parseToPlain("DC_TICKET_TITLE"))
|
.setTitle(channel.parseToPlain("DC_TICKET_TITLE"))
|
||||||
|
|||||||
@@ -377,8 +377,7 @@ public class PluginMessage extends BasicListener {
|
|||||||
"axiom:hello", "axiom:set_gamemode", "axiom:set_fly_speed", "axiom:set_world_time",
|
"axiom:hello", "axiom:set_gamemode", "axiom:set_fly_speed", "axiom:set_world_time",
|
||||||
"axiom:set_world_property", "axiom:set_block", "axiom:set_hotbar_slot", "axiom:switch_active_hotbar",
|
"axiom:set_world_property", "axiom:set_block", "axiom:set_hotbar_slot", "axiom:switch_active_hotbar",
|
||||||
"axiom:teleport", "axiom:request_chunk_data", "axiom:spawn_entity", "axiom:response_entity_data",
|
"axiom:teleport", "axiom:request_chunk_data", "axiom:spawn_entity", "axiom:response_entity_data",
|
||||||
"axiom:manipulate_entity", "axiom:delete_entity", "axiom:marker_nbt_request", "axiom:set_buffer",
|
"axiom:manipulate_entity", "axiom:delete_entity", "axiom:marker_nbt_request", "axiom:set_buffer"
|
||||||
"axiom:allowed_gamemodes", "axiom:ignore_display_entities", "axiom:add_server_heightmap"
|
|
||||||
)) {
|
)) {
|
||||||
channelRegisterHandlers.put(channel, player -> {});
|
channelRegisterHandlers.put(channel, player -> {});
|
||||||
registerPassthroughToServer(channel);
|
registerPassthroughToServer(channel);
|
||||||
|
|||||||
@@ -149,23 +149,6 @@ fun Route.configureSchematic() {
|
|||||||
return@let SchematicFormat.SPONGE_V2
|
return@let SchematicFormat.SPONGE_V2
|
||||||
}
|
}
|
||||||
|
|
||||||
if (version == SchematicFormat.SPONGE_V3) {
|
|
||||||
try {
|
|
||||||
val fawe = schem.getCompound("Metadata")
|
|
||||||
.getCompound("WorldEdit")
|
|
||||||
.getString("Version")
|
|
||||||
.value
|
|
||||||
|
|
||||||
if (fawe.equals("2.12.3-SNAPSHOT")) {
|
|
||||||
SWException.log("Schematic with Bugged Version Uploaded", """
|
|
||||||
Schematic=$schemName
|
|
||||||
User=${user.userName}
|
|
||||||
Id=${user.id}
|
|
||||||
""".trimIndent())
|
|
||||||
}
|
|
||||||
} catch (_: Exception) {}
|
|
||||||
}
|
|
||||||
|
|
||||||
val data = NodeData(node.id, version)
|
val data = NodeData(node.id, version)
|
||||||
data.saveFromStream(content.inputStream(), version)
|
data.saveFromStream(content.inputStream(), version)
|
||||||
|
|
||||||
|
|||||||
@@ -1,214 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of the SteamWar software.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2020 SteamWar.de-Serverteam
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
plugins {
|
|
||||||
}
|
|
||||||
|
|
||||||
class DevServer extends DefaultTask {
|
|
||||||
|
|
||||||
@Input
|
|
||||||
@Optional
|
|
||||||
String worldName = null
|
|
||||||
|
|
||||||
@Input
|
|
||||||
String template = null
|
|
||||||
|
|
||||||
@Input
|
|
||||||
@Optional
|
|
||||||
String plugins = null
|
|
||||||
|
|
||||||
@Input
|
|
||||||
@Optional
|
|
||||||
Integer port = null
|
|
||||||
|
|
||||||
@Input
|
|
||||||
@Optional
|
|
||||||
String jar = null
|
|
||||||
|
|
||||||
@Input
|
|
||||||
@Optional
|
|
||||||
Map<String, String> dParams = new HashMap<>()
|
|
||||||
|
|
||||||
DevServer() {
|
|
||||||
super()
|
|
||||||
doFirst {
|
|
||||||
List<Project> projects = []
|
|
||||||
projects.add(project)
|
|
||||||
while (projects.first.parent != null) {
|
|
||||||
projects.add(0, projects.first.parent)
|
|
||||||
}
|
|
||||||
|
|
||||||
def properties = new Properties()
|
|
||||||
projects.forEach {
|
|
||||||
def file = new File(it.projectDir, "steamwar.properties")
|
|
||||||
if (file.exists()) {
|
|
||||||
properties.load(new FileInputStream(file))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (worldName == null) worldName = properties.get("worldName")
|
|
||||||
host = properties.get("host")
|
|
||||||
|
|
||||||
if (host == null) {
|
|
||||||
throw new GradleException("Please supply the 'host' in a 'steamwar.properties' files either in this project dir or any parent project!")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
doLast {
|
|
||||||
checkHasTemplate()
|
|
||||||
uploadDependencies()
|
|
||||||
startDevServer()
|
|
||||||
}
|
|
||||||
finalizedBy(new Finalizer())
|
|
||||||
}
|
|
||||||
|
|
||||||
@Internal
|
|
||||||
BufferedWriter processInput
|
|
||||||
|
|
||||||
@Internal
|
|
||||||
String host
|
|
||||||
|
|
||||||
@Internal
|
|
||||||
Boolean running = true
|
|
||||||
|
|
||||||
class Finalizer extends DefaultTask {
|
|
||||||
|
|
||||||
Finalizer() {
|
|
||||||
super()
|
|
||||||
doLast {
|
|
||||||
running = false
|
|
||||||
if (processInput != null) {
|
|
||||||
processInput.write(template.endsWith("Velocity") ? "end\n" : "stop\n")
|
|
||||||
processInput.flush()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void checkHasTemplate() {
|
|
||||||
def process = new ProcessBuilder("ssh", host, "-T", "ls $template").start()
|
|
||||||
process.waitFor()
|
|
||||||
if (new BufferedReader(new InputStreamReader(process.inputStream)).lines().count() < 4) {
|
|
||||||
throw new GradleException("Used template is not in your user.home directory of the given host $host")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void uploadDependencies() {
|
|
||||||
def base = plugins == null ? "$template/plugins" : plugins
|
|
||||||
println("Uploading to ~/$base")
|
|
||||||
this.dependsOn.forEach {
|
|
||||||
Project resolved
|
|
||||||
AbstractArchiveTask archiveTask
|
|
||||||
if (it instanceof String) {
|
|
||||||
resolved = project.findProject(it.substring(0, it.lastIndexOf(':')))
|
|
||||||
archiveTask = (AbstractArchiveTask) resolved.tasks.findByName(it.substring(it.lastIndexOf(':') + 1))
|
|
||||||
} else {
|
|
||||||
throw new GradleException("Illegal argument for uploading dependencies")
|
|
||||||
}
|
|
||||||
|
|
||||||
def archive = archiveTask.archiveFile.get().asFile
|
|
||||||
println("Uploading $archive")
|
|
||||||
new ProcessBuilder("ssh", host, "-T", "rm $base/${archive.name.replace("-all", "")}").start().waitFor()
|
|
||||||
new ProcessBuilder("scp", archive.absolutePath, "$host:~/$base/${archive.name.replace("-all", "")}").start().waitFor()
|
|
||||||
println("Uploaded $archive")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void startDevServer() {
|
|
||||||
def devPy = new StringBuilder().append("dev.py")
|
|
||||||
if (port != null) devPy.append(" --port $port")
|
|
||||||
if (worldName != null) devPy.append(" -w $template/$worldName")
|
|
||||||
if (plugins != null) devPy.append(" -p $plugins")
|
|
||||||
if (jar != null) devPy.append(" --jar $jar")
|
|
||||||
for (Map.Entry<String, String> dParam : dParams.entrySet()) {
|
|
||||||
devPy.append(" -D${dParam.key}=${dParam.value}")
|
|
||||||
}
|
|
||||||
devPy.append(" $template")
|
|
||||||
println("Starting $template with command ${devPy.toString()}")
|
|
||||||
|
|
||||||
def process = new ProcessBuilder("ssh", host, "-T", devPy.toString()).start()
|
|
||||||
def processOutput = new BufferedReader(new InputStreamReader(process.inputStream))
|
|
||||||
new Thread({
|
|
||||||
while (running) {
|
|
||||||
if (processOutput.ready()) {
|
|
||||||
println(processOutput.readLine())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}).start()
|
|
||||||
|
|
||||||
processInput = new BufferedWriter(new OutputStreamWriter(process.outputStream))
|
|
||||||
def input = new BufferedReader(new InputStreamReader(System.in))
|
|
||||||
new Thread({
|
|
||||||
while (running) {
|
|
||||||
def text = input.readLine()
|
|
||||||
if (text == null) break
|
|
||||||
processInput.write(text)
|
|
||||||
processInput.newLine()
|
|
||||||
processInput.flush()
|
|
||||||
}
|
|
||||||
}).start()
|
|
||||||
|
|
||||||
process.waitFor()
|
|
||||||
processInput = null
|
|
||||||
running = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class FightServer extends DevServer {
|
|
||||||
|
|
||||||
@Input
|
|
||||||
@Optional
|
|
||||||
Integer checkSchemID = 0
|
|
||||||
|
|
||||||
@Input
|
|
||||||
@Optional
|
|
||||||
Integer prepareSchemID = 0
|
|
||||||
|
|
||||||
@Input
|
|
||||||
@Optional
|
|
||||||
Integer replay = 0
|
|
||||||
|
|
||||||
@Input
|
|
||||||
@Optional
|
|
||||||
String config = null
|
|
||||||
|
|
||||||
@Input
|
|
||||||
@Optional
|
|
||||||
// Property: fightID
|
|
||||||
Integer eventKampfID = 0
|
|
||||||
|
|
||||||
@Input
|
|
||||||
@Optional
|
|
||||||
UUID blueLeader = null
|
|
||||||
|
|
||||||
@Input
|
|
||||||
@Optional
|
|
||||||
UUID redLeader = null
|
|
||||||
|
|
||||||
FightServer() {
|
|
||||||
super()
|
|
||||||
doFirst {
|
|
||||||
if (checkSchemID != 0) dParams.put("checkSchemID", "$checkSchemID")
|
|
||||||
if (prepareSchemID != 0) dParams.put("prepareSchemID", "$prepareSchemID")
|
|
||||||
if (replay != 0) dParams.put("replay", "$replay")
|
|
||||||
if (eventKampfID != 0) dParams.put("fightID", "$eventKampfID")
|
|
||||||
if (blueLeader != null) dParams.put("blueLeader", blueLeader.toString())
|
|
||||||
if (redLeader != null) dParams.put("redLeader", redLeader.toString())
|
|
||||||
if (config != null) dParams.put("config", config)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -27,6 +27,7 @@ private val isInCi by lazy { Os.isFamily(Os.FAMILY_UNIX) && ProcessBuilder("host
|
|||||||
|
|
||||||
dependencyResolutionManagement {
|
dependencyResolutionManagement {
|
||||||
repositories {
|
repositories {
|
||||||
|
|
||||||
maven {
|
maven {
|
||||||
url = URI("https://m2.dv8tion.net/releases")
|
url = URI("https://m2.dv8tion.net/releases")
|
||||||
content {
|
content {
|
||||||
|
|||||||
Reference in New Issue
Block a user