Dieser Commit ist enthalten in:
Ursprung
53ba6d7564
Commit
1e3b65f798
47
build.gradle
47
build.gradle
@ -1,5 +1,3 @@
|
||||
import org.apache.tools.ant.filters.ReplaceTokens
|
||||
|
||||
plugins {
|
||||
id 'base'
|
||||
id 'java'
|
||||
@ -7,12 +5,29 @@ plugins {
|
||||
id 'com.github.johnrengelman.shadow' version '5.0.0'
|
||||
}
|
||||
|
||||
group = 'Teamserver'
|
||||
ext.swdep = { s ->
|
||||
if (file("${rootDir}/lib/${s}.jar").exists()) {
|
||||
return files("${rootDir}/lib/${s}.jar")
|
||||
} else {
|
||||
if (s.contains("-")) {
|
||||
return "de.steamwar:${s.toLowerCase().replace('-', ':')}"
|
||||
} else {
|
||||
return "de.steamwar:${s.toLowerCase()}:RELEASE"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
group = 'de.steamwar'
|
||||
version = ''
|
||||
|
||||
Properties steamwarProperties = new Properties()
|
||||
if (file("steamwar.properties").exists()) {
|
||||
steamwarProperties.load(file("steamwar.properties").newDataInputStream())
|
||||
}
|
||||
|
||||
ext {
|
||||
buildName = 'BauSystem'
|
||||
artifactName = 'bausystem'
|
||||
buildName = 'Builder'
|
||||
artifactName = 'Builder'
|
||||
|
||||
uberJarName = "${buildName}-all.jar"
|
||||
jarName = "${artifactName}.jar"
|
||||
@ -38,17 +53,23 @@ sourceSets {
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
|
||||
maven {
|
||||
url = uri('https://hub.spigotmc.org/nexus/content/repositories/snapshots/')
|
||||
}
|
||||
|
||||
maven {
|
||||
url = uri('https://steamwar.de/maven')
|
||||
credentials {
|
||||
username = steamwarProperties.getProperty("maven.username", "")
|
||||
password = steamwarProperties.getProperty("maven.password", "")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly 'org.projectlombok:lombok:1.18.6'
|
||||
testCompileOnly 'org.projectlombok:lombok:1.18.6'
|
||||
annotationProcessor 'org.projectlombok:lombok:1.18.6'
|
||||
testAnnotationProcessor 'org.projectlombok:lombok:1.18.6'
|
||||
|
||||
compileOnly files("${project.rootDir}/lib/Spigot-1.15.jar")
|
||||
compileOnly files("${project.rootDir}/lib/WorldEdit-1.15.jar")
|
||||
compileOnly files("${project.rootDir}/lib/SpigotCore.jar")
|
||||
compileOnly 'org.spigotmc:spigot-api:1.19-R0.1-SNAPSHOT'
|
||||
compileOnly swdep("SpigotCore")
|
||||
}
|
||||
|
||||
task buildProject {
|
||||
|
@ -1 +1 @@
|
||||
rootProject.name = 'Teamserver'
|
||||
rootProject.name = 'Builder'
|
||||
|
@ -22,18 +22,16 @@ package de.steamwar.teamserver;
|
||||
import de.steamwar.message.Message;
|
||||
import de.steamwar.teamserver.command.*;
|
||||
import de.steamwar.teamserver.listener.FreezeListener;
|
||||
import de.steamwar.teamserver.listener.WorldChange;
|
||||
import lombok.Getter;
|
||||
import de.steamwar.teamserver.listener.PlayerChange;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public final class Teamserver extends JavaPlugin {
|
||||
public final class Builder extends JavaPlugin {
|
||||
|
||||
// This should be treated as final!
|
||||
public static Message MESSAGE;
|
||||
|
||||
@Getter
|
||||
private static Teamserver instance;
|
||||
private static Builder instance;
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
@ -46,7 +44,7 @@ public final class Teamserver extends JavaPlugin {
|
||||
new SpeedCommand();
|
||||
new FreezeCommand();
|
||||
|
||||
Bukkit.getPluginManager().registerEvents(new WorldChange(), this);
|
||||
Bukkit.getPluginManager().registerEvents(new PlayerChange(), this);
|
||||
Bukkit.getPluginManager().registerEvents(new FreezeListener(), this);
|
||||
|
||||
MaterialCommand materialCommand = new MaterialCommand();
|
||||
@ -57,4 +55,8 @@ public final class Teamserver extends JavaPlugin {
|
||||
public void onDisable() {
|
||||
// Plugin shutdown logic
|
||||
}
|
||||
|
||||
public static Builder getInstance() {
|
||||
return instance;
|
||||
}
|
||||
}
|
@ -18,14 +18,11 @@
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
PREFIX = §eTeam§8Server§8»
|
||||
PREFIX = §eBuilder§8»
|
||||
TIME = HH:mm:ss
|
||||
DATE=........
|
||||
COMMAND_HELP_HEAD=§7---=== (§e{0}§7) ===---
|
||||
|
||||
# Freeze
|
||||
REGION_FREEZE_HELP=§8/§efreeze §8- §7Toggle Freeze
|
||||
REGION_FREEZE_NO_PERMS=§cDu darfst diese Welt nicht einfrieren
|
||||
REGION_FREEZE_ENABLED=§cRegion eingefroren
|
||||
REGION_FREEZE_DISABLED=§aRegion aufgetaut
|
||||
|
||||
|
@ -19,11 +19,8 @@
|
||||
|
||||
package de.steamwar.teamserver.command;
|
||||
|
||||
import de.steamwar.command.GuardCheckType;
|
||||
import de.steamwar.command.GuardChecker;
|
||||
import de.steamwar.command.GuardResult;
|
||||
import de.steamwar.command.SWCommand;
|
||||
import de.steamwar.teamserver.Teamserver;
|
||||
import de.steamwar.teamserver.Builder;
|
||||
import de.steamwar.teamserver.listener.FreezeListener;
|
||||
import net.md_5.bungee.api.ChatMessageType;
|
||||
import org.bukkit.Bukkit;
|
||||
@ -36,30 +33,18 @@ public class FreezeCommand extends SWCommand {
|
||||
}
|
||||
|
||||
@Register(description = "REGION_FREEZE_HELP")
|
||||
public void toggleCommand(@Guard Player p) {
|
||||
public void toggleCommand(Player p) {
|
||||
if (toggle()) {
|
||||
Bukkit.getOnlinePlayers().forEach(player -> {
|
||||
Teamserver.MESSAGE.sendPrefixless(getEnableMessage(), player, ChatMessageType.ACTION_BAR);
|
||||
Builder.MESSAGE.sendPrefixless("REGION_FREEZE_ENABLED", player, ChatMessageType.ACTION_BAR);
|
||||
});
|
||||
} else {
|
||||
Bukkit.getOnlinePlayers().forEach(player -> {
|
||||
Teamserver.MESSAGE.sendPrefixless(getDisableMessage(), player, ChatMessageType.ACTION_BAR);
|
||||
Builder.MESSAGE.sendPrefixless("REGION_FREEZE_DISABLED", player, ChatMessageType.ACTION_BAR);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private String getNoPermMessage() {
|
||||
return "REGION_FREEZE_NO_PERMS";
|
||||
}
|
||||
|
||||
private String getEnableMessage(){
|
||||
return "REGION_FREEZE_ENABLED";
|
||||
}
|
||||
|
||||
private String getDisableMessage(){
|
||||
return "REGION_FREEZE_DISABLED";
|
||||
}
|
||||
|
||||
private boolean toggle() {
|
||||
if (FreezeListener.freeze) {
|
||||
FreezeListener.freeze = false;
|
||||
@ -68,18 +53,4 @@ public class FreezeCommand extends SWCommand {
|
||||
}
|
||||
return FreezeListener.freeze;
|
||||
}
|
||||
|
||||
@ClassGuard(value = Player.class, local = true)
|
||||
public GuardChecker guard() {
|
||||
return (commandSender, guardCheckType, strings, s) -> {
|
||||
Player player = (Player) commandSender;
|
||||
if (!player.isOp()) {
|
||||
if (guardCheckType != GuardCheckType.TAB_COMPLETE) {
|
||||
Teamserver.MESSAGE.send(getNoPermMessage(), player);
|
||||
}
|
||||
return GuardResult.DENIED;
|
||||
}
|
||||
return GuardResult.ALLOWED;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -24,9 +24,7 @@ import de.steamwar.inventory.SWAnvilInv;
|
||||
import de.steamwar.inventory.SWInventory;
|
||||
import de.steamwar.inventory.SWItem;
|
||||
import de.steamwar.inventory.SWListInv;
|
||||
import de.steamwar.teamserver.Teamserver;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import de.steamwar.teamserver.Builder;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.Waterlogged;
|
||||
@ -104,32 +102,32 @@ public class MaterialCommand extends SWCommand implements Listener {
|
||||
|
||||
public SWListInv.SWListEntry<Material> toSWItem(Player p) {
|
||||
List<String> lore = new ArrayList<>();
|
||||
lore.add(Teamserver.MESSAGE.parse("MATERIAL_BLAST-RESISTANCE", p, blastResistance));
|
||||
lore.add(Teamserver.MESSAGE.parse(blastResistance > 9 ? "MATERIAL_TNT_UNBREAKABLE" : "MATERIAL_TNT_BREAKABLE", p));
|
||||
lore.add(Teamserver.MESSAGE.parse("MATERIAL_HARDNESS", p, hardness));
|
||||
lore.add(Builder.MESSAGE.parse("MATERIAL_BLAST-RESISTANCE", p, blastResistance));
|
||||
lore.add(Builder.MESSAGE.parse(blastResistance > 9 ? "MATERIAL_TNT_UNBREAKABLE" : "MATERIAL_TNT_BREAKABLE", p));
|
||||
lore.add(Builder.MESSAGE.parse("MATERIAL_HARDNESS", p, hardness));
|
||||
if (transparent) {
|
||||
lore.add(Teamserver.MESSAGE.parse("MATERIAL_TRANSPARENT", p));
|
||||
lore.add(Builder.MESSAGE.parse("MATERIAL_TRANSPARENT", p));
|
||||
}
|
||||
if (solid) {
|
||||
lore.add(Teamserver.MESSAGE.parse("MATERIAL_SOLID", p));
|
||||
lore.add(Builder.MESSAGE.parse("MATERIAL_SOLID", p));
|
||||
}
|
||||
if (gravity) {
|
||||
lore.add(Teamserver.MESSAGE.parse("MATERIAL_GRAVITY", p));
|
||||
lore.add(Builder.MESSAGE.parse("MATERIAL_GRAVITY", p));
|
||||
}
|
||||
if (occluding) {
|
||||
lore.add(Teamserver.MESSAGE.parse("MATERIAL_OCCLUDING", p));
|
||||
lore.add(Builder.MESSAGE.parse("MATERIAL_OCCLUDING", p));
|
||||
}
|
||||
if (interacteable) {
|
||||
lore.add(Teamserver.MESSAGE.parse("MATERIAL_INTERACT-ABLE", p));
|
||||
lore.add(Builder.MESSAGE.parse("MATERIAL_INTERACT-ABLE", p));
|
||||
}
|
||||
if (flammable) {
|
||||
lore.add(Teamserver.MESSAGE.parse("MATERIAL_FLAMMABLE", p));
|
||||
lore.add(Builder.MESSAGE.parse("MATERIAL_FLAMMABLE", p));
|
||||
}
|
||||
if (burnable) {
|
||||
lore.add(Teamserver.MESSAGE.parse("MATERIAL_BURNABLE", p));
|
||||
lore.add(Builder.MESSAGE.parse("MATERIAL_BURNABLE", p));
|
||||
}
|
||||
if (waterloggable) {
|
||||
lore.add(Teamserver.MESSAGE.parse("MATERIAL_WATERLOGGABLE", p));
|
||||
lore.add(Builder.MESSAGE.parse("MATERIAL_WATERLOGGABLE", p));
|
||||
}
|
||||
return new SWListInv.SWListEntry<>(new SWItem(material, "§e" + name, lore, false, clickType -> {
|
||||
}), originalMaterial);
|
||||
@ -174,8 +172,6 @@ public class MaterialCommand extends SWCommand implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private static class Search {
|
||||
private boolean transparent = false;
|
||||
private boolean solid = false;
|
||||
@ -199,62 +195,62 @@ public class MaterialCommand extends SWCommand implements Listener {
|
||||
swListEntries.add(data.toSWItem(p));
|
||||
}
|
||||
});
|
||||
SWListInv<Material> materialSWListInv = new SWListInv<>(p, Teamserver.MESSAGE.parse("MATERIAL_INV_NAME", p, swListEntries.size(), materialData.size()), false, swListEntries, (clickType, material) -> {
|
||||
SWListInv<Material> materialSWListInv = new SWListInv<>(p, Builder.MESSAGE.parse("MATERIAL_INV_NAME", p, swListEntries.size(), materialData.size()), false, swListEntries, (clickType, material) -> {
|
||||
});
|
||||
materialSWListInv.setItem(49, new SWItem(Material.NAME_TAG, Teamserver.MESSAGE.parse("MATERIAL_SEARCH", p), clickType -> {
|
||||
materialSWListInv.setItem(49, new SWItem(Material.NAME_TAG, Builder.MESSAGE.parse("MATERIAL_SEARCH", p), clickType -> {
|
||||
searchGUI(p);
|
||||
}));
|
||||
materialSWListInv.open();
|
||||
}
|
||||
|
||||
private void searchGUI(Player p) {
|
||||
SWInventory swInventory = new SWInventory(p, 54, Teamserver.MESSAGE.parse("MATERIAL_SEARCH", p));
|
||||
SWInventory swInventory = new SWInventory(p, 54, Builder.MESSAGE.parse("MATERIAL_SEARCH", p));
|
||||
Search search = searchMap.get(p);
|
||||
swInventory.setItem(45, new SWItem(Material.ARROW, Teamserver.MESSAGE.parse("MATERIAL_BACK", p), clickType -> {
|
||||
swInventory.setItem(45, new SWItem(Material.ARROW, Builder.MESSAGE.parse("MATERIAL_BACK", p), clickType -> {
|
||||
materialGUI(p);
|
||||
}));
|
||||
swInventory.setItem(10, new SWItem(Material.NAME_TAG, Teamserver.MESSAGE.parse("MATERIAL_SEARCH_NAME", p) + Teamserver.MESSAGE.parse("MATERIAL_SEARCH_VALUE", p, search.name), clickType -> {
|
||||
SWAnvilInv swAnvilInv = new SWAnvilInv(p, Teamserver.MESSAGE.parse("MATERIAL_SEARCH_NAME", p), search.name);
|
||||
swInventory.setItem(10, new SWItem(Material.NAME_TAG, Builder.MESSAGE.parse("MATERIAL_SEARCH_NAME", p) + Builder.MESSAGE.parse("MATERIAL_SEARCH_VALUE", p, search.name), clickType -> {
|
||||
SWAnvilInv swAnvilInv = new SWAnvilInv(p, Builder.MESSAGE.parse("MATERIAL_SEARCH_NAME", p), search.name);
|
||||
swAnvilInv.setCallback(s -> {
|
||||
search.name = s;
|
||||
searchGUI(p);
|
||||
});
|
||||
swAnvilInv.open();
|
||||
}));
|
||||
swInventory.setItem(19, new SWItem(Material.GLASS, Teamserver.MESSAGE.parse("MATERIAL_SEARCH_TRANSPARENT", p) + Teamserver.MESSAGE.parse("MATERIAL_SEARCH_VALUE", p, search.transparent), clickType -> {
|
||||
swInventory.setItem(19, new SWItem(Material.GLASS, Builder.MESSAGE.parse("MATERIAL_SEARCH_TRANSPARENT", p) + Builder.MESSAGE.parse("MATERIAL_SEARCH_VALUE", p, search.transparent), clickType -> {
|
||||
search.transparent = !search.transparent;
|
||||
searchGUI(p);
|
||||
}));
|
||||
swInventory.setItem(20, new SWItem(Material.BRICK, Teamserver.MESSAGE.parse("MATERIAL_SEARCH_SOLID", p) + Teamserver.MESSAGE.parse("MATERIAL_SEARCH_VALUE", p, search.solid), clickType -> {
|
||||
swInventory.setItem(20, new SWItem(Material.BRICK, Builder.MESSAGE.parse("MATERIAL_SEARCH_SOLID", p) + Builder.MESSAGE.parse("MATERIAL_SEARCH_VALUE", p, search.solid), clickType -> {
|
||||
search.solid = !search.solid;
|
||||
searchGUI(p);
|
||||
}));
|
||||
swInventory.setItem(21, new SWItem(Material.BLACK_CONCRETE_POWDER, Teamserver.MESSAGE.parse("MATERIAL_SEARCH_GRAVITY", p) + Teamserver.MESSAGE.parse("MATERIAL_SEARCH_VALUE", p, search.gravity), clickType -> {
|
||||
swInventory.setItem(21, new SWItem(Material.BLACK_CONCRETE_POWDER, Builder.MESSAGE.parse("MATERIAL_SEARCH_GRAVITY", p) + Builder.MESSAGE.parse("MATERIAL_SEARCH_VALUE", p, search.gravity), clickType -> {
|
||||
search.gravity = !search.gravity;
|
||||
searchGUI(p);
|
||||
}));
|
||||
swInventory.setItem(22, new SWItem(Material.BIRCH_LOG, Teamserver.MESSAGE.parse("MATERIAL_SEARCH_OCCLUDING", p) + Teamserver.MESSAGE.parse("MATERIAL_SEARCH_VALUE", p, search.occluding), clickType -> {
|
||||
swInventory.setItem(22, new SWItem(Material.BIRCH_LOG, Builder.MESSAGE.parse("MATERIAL_SEARCH_OCCLUDING", p) + Builder.MESSAGE.parse("MATERIAL_SEARCH_VALUE", p, search.occluding), clickType -> {
|
||||
search.occluding = !search.occluding;
|
||||
searchGUI(p);
|
||||
}));
|
||||
swInventory.setItem(23, new SWItem(Material.OAK_BUTTON, Teamserver.MESSAGE.parse("MATERIAL_SEARCH_INTERACTEABLE", p) + Teamserver.MESSAGE.parse("MATERIAL_SEARCH_VALUE", p, search.interacteable), clickType -> {
|
||||
swInventory.setItem(23, new SWItem(Material.OAK_BUTTON, Builder.MESSAGE.parse("MATERIAL_SEARCH_INTERACTEABLE", p) + Builder.MESSAGE.parse("MATERIAL_SEARCH_VALUE", p, search.interacteable), clickType -> {
|
||||
search.interacteable = !search.interacteable;
|
||||
searchGUI(p);
|
||||
}));
|
||||
swInventory.setItem(24, new SWItem(Material.FLINT_AND_STEEL, Teamserver.MESSAGE.parse("MATERIAL_SEARCH_FLAMMABLE", p) + Teamserver.MESSAGE.parse("MATERIAL_SEARCH_VALUE", p, search.flammable), clickType -> {
|
||||
swInventory.setItem(24, new SWItem(Material.FLINT_AND_STEEL, Builder.MESSAGE.parse("MATERIAL_SEARCH_FLAMMABLE", p) + Builder.MESSAGE.parse("MATERIAL_SEARCH_VALUE", p, search.flammable), clickType -> {
|
||||
search.flammable = !search.flammable;
|
||||
searchGUI(p);
|
||||
}));
|
||||
swInventory.setItem(25, new SWItem(Material.LAVA_BUCKET, Teamserver.MESSAGE.parse("MATERIAL_SEARCH_BURNABLE", p) + Teamserver.MESSAGE.parse("MATERIAL_SEARCH_VALUE", p, search.burnable), clickType -> {
|
||||
swInventory.setItem(25, new SWItem(Material.LAVA_BUCKET, Builder.MESSAGE.parse("MATERIAL_SEARCH_BURNABLE", p) + Builder.MESSAGE.parse("MATERIAL_SEARCH_VALUE", p, search.burnable), clickType -> {
|
||||
search.burnable = !search.burnable;
|
||||
searchGUI(p);
|
||||
}));
|
||||
swInventory.setItem(28, new SWItem(Material.WATER_BUCKET, Teamserver.MESSAGE.parse("MATERIAL_SEARCH_WATERLOGGABLE", p) + Teamserver.MESSAGE.parse("MATERIAL_SEARCH_VALUE", p, search.waterloggable), clickType -> {
|
||||
swInventory.setItem(28, new SWItem(Material.WATER_BUCKET, Builder.MESSAGE.parse("MATERIAL_SEARCH_WATERLOGGABLE", p) + Builder.MESSAGE.parse("MATERIAL_SEARCH_VALUE", p, search.waterloggable), clickType -> {
|
||||
search.waterloggable = !search.waterloggable;
|
||||
searchGUI(p);
|
||||
}));
|
||||
swInventory.setItem(30, new SWItem(Material.FIRE_CHARGE, Teamserver.MESSAGE.parse("MATERIAL_SEARCH_BLASTRESISTANCE_MIN", p) + Teamserver.MESSAGE.parse("MATERIAL_SEARCH_VALUE", p, search.blastResistanceMin), clickType -> {
|
||||
SWAnvilInv swAnvilInv = new SWAnvilInv(p, Teamserver.MESSAGE.parse("MATERIAL_SEARCH_BLASTRESISTANCE", p), search.blastResistanceMin + "");
|
||||
swInventory.setItem(30, new SWItem(Material.FIRE_CHARGE, Builder.MESSAGE.parse("MATERIAL_SEARCH_BLASTRESISTANCE_MIN", p) + Builder.MESSAGE.parse("MATERIAL_SEARCH_VALUE", p, search.blastResistanceMin), clickType -> {
|
||||
SWAnvilInv swAnvilInv = new SWAnvilInv(p, Builder.MESSAGE.parse("MATERIAL_SEARCH_BLASTRESISTANCE", p), search.blastResistanceMin + "");
|
||||
swAnvilInv.setCallback(s -> {
|
||||
try {
|
||||
search.blastResistanceMin = Double.parseDouble(s);
|
||||
@ -269,8 +265,8 @@ public class MaterialCommand extends SWCommand implements Listener {
|
||||
});
|
||||
swAnvilInv.open();
|
||||
}));
|
||||
swInventory.setItem(31, new SWItem(Material.TNT, Teamserver.MESSAGE.parse("MATERIAL_SEARCH_BLASTRESISTANCE_MAX", p) + Teamserver.MESSAGE.parse("MATERIAL_SEARCH_VALUE", p, search.blastResistanceMax), clickType -> {
|
||||
SWAnvilInv swAnvilInv = new SWAnvilInv(p, Teamserver.MESSAGE.parse("MATERIAL_SEARCH_BLASTRESISTANCE", p), search.blastResistanceMax + "");
|
||||
swInventory.setItem(31, new SWItem(Material.TNT, Builder.MESSAGE.parse("MATERIAL_SEARCH_BLASTRESISTANCE_MAX", p) + Builder.MESSAGE.parse("MATERIAL_SEARCH_VALUE", p, search.blastResistanceMax), clickType -> {
|
||||
SWAnvilInv swAnvilInv = new SWAnvilInv(p, Builder.MESSAGE.parse("MATERIAL_SEARCH_BLASTRESISTANCE", p), search.blastResistanceMax + "");
|
||||
swAnvilInv.setCallback(s -> {
|
||||
try {
|
||||
search.blastResistanceMax = Double.parseDouble(s);
|
||||
@ -285,8 +281,8 @@ public class MaterialCommand extends SWCommand implements Listener {
|
||||
});
|
||||
swAnvilInv.open();
|
||||
}));
|
||||
swInventory.setItem(32, new SWItem(Material.NETHER_BRICK, Teamserver.MESSAGE.parse("MATERIAL_SEARCH_BLASTRESISTANCE_EXACT", p) + Teamserver.MESSAGE.parse("MATERIAL_SEARCH_VALUE", p, search.blastResistanceMin + "-" + search.blastResistanceMax), clickType -> {
|
||||
SWAnvilInv swAnvilInv = new SWAnvilInv(p, Teamserver.MESSAGE.parse("MATERIAL_SEARCH_BLASTRESISTANCE", p), search.blastResistanceMax + "");
|
||||
swInventory.setItem(32, new SWItem(Material.NETHER_BRICK, Builder.MESSAGE.parse("MATERIAL_SEARCH_BLASTRESISTANCE_EXACT", p) + Builder.MESSAGE.parse("MATERIAL_SEARCH_VALUE", p, search.blastResistanceMin + "-" + search.blastResistanceMax), clickType -> {
|
||||
SWAnvilInv swAnvilInv = new SWAnvilInv(p, Builder.MESSAGE.parse("MATERIAL_SEARCH_BLASTRESISTANCE", p), search.blastResistanceMax + "");
|
||||
swAnvilInv.setCallback(s -> {
|
||||
try {
|
||||
search.blastResistanceMax = Double.parseDouble(s);
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
package de.steamwar.teamserver.listener;
|
||||
|
||||
import de.steamwar.teamserver.Teamserver;
|
||||
import de.steamwar.teamserver.Builder;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.EntityType;
|
||||
@ -41,7 +41,7 @@ public class FreezeListener implements Listener {
|
||||
}
|
||||
e.setCancelled(true);
|
||||
if (e.getEntityType() == EntityType.PRIMED_TNT) {
|
||||
Bukkit.getScheduler().runTaskLater(Teamserver.getInstance(), () -> {
|
||||
Bukkit.getScheduler().runTaskLater(Builder.getInstance(), () -> {
|
||||
e.getLocation().getBlock().setType(Material.TNT, false);
|
||||
}, 1L);
|
||||
}
|
||||
|
@ -19,28 +19,23 @@
|
||||
|
||||
package de.steamwar.teamserver.listener;
|
||||
|
||||
import de.steamwar.teamserver.Teamserver;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerChangedWorldEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
|
||||
public class WorldChange implements Listener {
|
||||
public class PlayerChange implements Listener {
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
@EventHandler
|
||||
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||
Bukkit.getScheduler().runTaskLater(Teamserver.getInstance(), () -> {
|
||||
event.getPlayer().setGameMode(GameMode.CREATIVE);
|
||||
}, 1L);
|
||||
event.getPlayer().setOp(true);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onPlayerChangedWorld(PlayerChangedWorldEvent event) {
|
||||
Bukkit.getScheduler().runTaskLater(Teamserver.getInstance(), () -> {
|
||||
event.getPlayer().setGameMode(GameMode.CREATIVE);
|
||||
}, 1L);
|
||||
@EventHandler
|
||||
public void onPlayerQuit(PlayerQuitEvent event) {
|
||||
if(Bukkit.getOnlinePlayers().isEmpty() || (Bukkit.getOnlinePlayers().size() == 1 && Bukkit.getOnlinePlayers().contains(event.getPlayer())))
|
||||
Bukkit.shutdown();
|
||||
|
||||
}
|
||||
}
|
6
steamwarci.yml
Normale Datei
6
steamwarci.yml
Normale Datei
@ -0,0 +1,6 @@
|
||||
build:
|
||||
- "./gradlew buildProject"
|
||||
- "./gradlew --stop"
|
||||
|
||||
artifacts:
|
||||
"/binarys/Builder.jar": "build/libs/Builder.jar"
|
In neuem Issue referenzieren
Einen Benutzer sperren