F3+N Support + Removing GUI
Dieser Commit ist enthalten in:
Ursprung
7cf2de33b7
Commit
211afcb5a8
@ -11,6 +11,7 @@ import de.warking.bausystem.commands.CommandGui;
|
||||
import de.warking.bausystem.commands.CommandTeleport;
|
||||
import de.warking.bausystem.config.Config;
|
||||
import de.warking.bausystem.world.RegionListener;
|
||||
import de.warking.hunjy.MySQL.WarkingUser;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.SimpleCommandMap;
|
||||
@ -24,6 +25,7 @@ import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerRespawnEvent;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
import org.bukkit.permissions.PermissionAttachment;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import java.io.File;
|
||||
@ -246,6 +248,18 @@ public class BauSystem extends JavaPlugin implements Listener {
|
||||
public void onJoin(PlayerJoinEvent e) {
|
||||
Player p = e.getPlayer();
|
||||
p.teleport(config.spawn);
|
||||
WarkingUser user = WarkingUser.get(p.getUniqueId());
|
||||
PermissionAttachment attachment = p.addAttachment(this);
|
||||
switch(user.getUserGroup()){
|
||||
case Admin:
|
||||
case Moderator:
|
||||
case Developer:
|
||||
case Supporter:
|
||||
case Builder:
|
||||
attachment.setPermission("bau.team", true);
|
||||
}
|
||||
attachment.setPermission("F3NPerm.use", true);
|
||||
attachment.setPermission("fawe.permpack.basic", true);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
@ -15,11 +15,11 @@ import de.warking.bausystem.world.BauWorld;
|
||||
import de.warking.hunjy.MySQL.Bauwelt;
|
||||
import de.warking.hunjy.MySQL.BauweltMember;
|
||||
import de.warking.hunjy.MySQL.WarkingUser;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@ -53,7 +53,7 @@ public class CommandBau {
|
||||
p.sendMessage("§6/bau speed §7- Ändert deine Fluggeschwindigkeit");
|
||||
p.sendMessage("§6/bau tp §7- Teleportiert dich auf eine Welt");
|
||||
p.sendMessage("§6/bau info §7- Informationen über die aktuelle Welt");
|
||||
p.sendMessage("§6/bau gui §7- Öffnet eine GUI");
|
||||
//p.sendMessage("§6/bau gui §7- Öffnet eine GUI");
|
||||
}
|
||||
|
||||
@Command(name = "bau.help.2", aliases = "gs.help.2", inGameOnly = true)
|
||||
@ -187,33 +187,17 @@ public class CommandBau {
|
||||
return;
|
||||
}
|
||||
|
||||
player.setFlySpeed(speed);
|
||||
player.setWalkSpeed(speed);
|
||||
player.setFlySpeed(speed / 10);
|
||||
player.setWalkSpeed(speed / 10);
|
||||
player.sendMessage("§aGeschwindigkeit wurde auf §6" + speed + " §agesetzt");
|
||||
}
|
||||
|
||||
@Command(name = "bau.gui", aliases = "gs.gui", inGameOnly = true)
|
||||
/*@Command(name = "bau.gui", aliases = "gs.gui", inGameOnly = true)
|
||||
public boolean ongui(CommandArgs args) {
|
||||
final Player p = args.getPlayer();
|
||||
Inventory inv = Bukkit.createInventory(null, 9, "§aBauoptionen");
|
||||
ItemStack bau = new ItemStack(Material.COMPASS);
|
||||
ItemMeta meta = bau.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§7Grundstücksregionen");
|
||||
bau.setItemMeta(meta);
|
||||
inv.addItem(bau);
|
||||
ItemStack optionen = new ItemStack(Material.ENCHANTED_BOOK);
|
||||
meta = optionen.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§7Weltoptionen");
|
||||
optionen.setItemMeta(meta);
|
||||
inv.setItem(8, optionen);
|
||||
ItemStack spieler = new ItemStack(Material.REDSTONE_BLOCK);
|
||||
meta = spieler.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§7Spieleroptionen");
|
||||
spieler.setItemMeta(meta);
|
||||
inv.setItem(4, spieler);
|
||||
p.openInventory(inv);
|
||||
p.openInventory(CommandGui.mainmenu());
|
||||
return true;
|
||||
}
|
||||
}*/
|
||||
|
||||
@Command(name = "bau.togglewe", aliases = "gs.togglewe", inGameOnly = true)
|
||||
public void onToggleWE(CommandArgs args) {
|
||||
@ -469,11 +453,11 @@ public class CommandBau {
|
||||
final Player p = args.getPlayer();
|
||||
p.sendMessage(BauSystem.PREFIX + "§aDeine Welt wird zurückgesetzt. Einen Moment bitte");
|
||||
BauWorld.unloadWorld(p.getUniqueId());
|
||||
File directory = new File(p.getUniqueId().toString());
|
||||
File directory = new File("plugins/BauSystem/worlds/" + p.getUniqueId().toString());
|
||||
del(directory);
|
||||
File directory1 = new File("plugins/WorldGuard/worlds/" + p.getUniqueId().toString());
|
||||
del(directory1);
|
||||
onHome(args);
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(BauSystem.getInstance(), () -> onHome(args),20L);
|
||||
}
|
||||
|
||||
@Command(name = "bau.replace", aliases = "gs.replace", inGameOnly = true)
|
||||
@ -540,13 +524,13 @@ public class CommandBau {
|
||||
p.sendMessage(BauSystem.PREFIX + "Besitzer§8: §6" + WarkingUser.get(welt.getUserID()).getUserName());
|
||||
|
||||
if(welt.isTNTDmg())
|
||||
p.sendMessage("TNT-Schaden§8: §aerlaubt");
|
||||
p.sendMessage(BauSystem.PREFIX + "TNT-Schaden§8: §aerlaubt");
|
||||
else
|
||||
p.sendMessage("TNT-Schaden§8: §cverboten");
|
||||
p.sendMessage(BauSystem.PREFIX + "TNT-Schaden§8: §cverboten");
|
||||
if(welt.isFireDmg())
|
||||
p.sendMessage("Feuer-Schaden§8: §aerlaubt");
|
||||
p.sendMessage(BauSystem.PREFIX + "Feuer-Schaden§8: §aerlaubt");
|
||||
else
|
||||
p.sendMessage("Feuer-Schaden§8: §cverboten");
|
||||
p.sendMessage(BauSystem.PREFIX + "Feuer-Schaden§8: §cverboten");
|
||||
|
||||
List<BauweltMember> memberList = BauweltMember.getMembers(worldOwner);
|
||||
StringBuilder members = new StringBuilder();
|
||||
|
@ -22,6 +22,9 @@ public class CommandGamemode extends BukkitCommand {
|
||||
|
||||
public CommandGamemode() {
|
||||
super("gm");
|
||||
List<String> aliases = new ArrayList<>();
|
||||
aliases.add("gamemode");
|
||||
this.setAliases(aliases);
|
||||
this.description = "Ändert den Spielmodus eines Spielers";
|
||||
this.usageMessage = "/gm [Spielmodus]";
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package de.warking.bausystem.commands;
|
||||
|
||||
import de.warking.bausystem.BauSystem;
|
||||
import de.warking.bausystem.world.BauWorld;
|
||||
import de.warking.hunjy.MySQL.Bauwelt;
|
||||
import de.warking.hunjy.MySQL.BauweltMember;
|
||||
import de.warking.hunjy.MySQL.WarkingUser;
|
||||
@ -10,7 +9,6 @@ import org.bukkit.ChatColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
@ -26,9 +24,9 @@ public class CommandGui implements Listener {
|
||||
e.getView().close();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
/*@EventHandler
|
||||
public void onPlayerClickInventory(InventoryClickEvent e) {
|
||||
if (e.getCurrentItem().getItemMeta() == null || e.getCurrentItem().getItemMeta().getDisplayName() != null)
|
||||
if (e.getCurrentItem() == null || e.getCurrentItem().getItemMeta() == null || e.getCurrentItem().getItemMeta().getDisplayName() != null)
|
||||
return;
|
||||
|
||||
e.setCancelled(true);
|
||||
@ -142,7 +140,7 @@ public class CommandGui implements Listener {
|
||||
p.sendMessage(BauSystem.PREFIX + "§aDu hast " + target.getName() + " §azu der Welt hinzugefügt");
|
||||
target.sendMessage(BauSystem.PREFIX + "§aDu wurdest zu der Welt von §6" + p.getName() + " §ahinzugefügt");
|
||||
p.openInventory(skullOwnerInventory(member, p));
|
||||
}*/
|
||||
}*//*
|
||||
}else if (member == null){
|
||||
p.sendMessage(BauSystem.PREFIX + "§cDieser Spieler ist kein Mitglied auf deiner Welt");
|
||||
}else if (itemName.equals("§aToggle Worldedit")) {
|
||||
@ -173,7 +171,7 @@ public class CommandGui implements Listener {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
private ItemStack getSkull(String name) {
|
||||
ItemStack skull = new ItemStack(397, 1, (short) 3);
|
||||
|
@ -19,16 +19,20 @@ import java.util.UUID;
|
||||
public class BauWorld {
|
||||
|
||||
public static void loadWorld(UUID owner) throws IOException{
|
||||
World world = Bukkit.getWorld(owner.toString());
|
||||
if(world != null)
|
||||
return;
|
||||
|
||||
File w = new File("plugins/BauSystem/worlds/" + owner);
|
||||
File region = new File("plugins/WorldGuard/worlds/" + owner);
|
||||
if (!region.exists() || !region.isDirectory()) {
|
||||
FileUtils.copyDirectory(new File(BauSystem.getInstance().config.regionDir), new File("plugins/WorldGuard/worlds/" + owner));
|
||||
}
|
||||
World world;
|
||||
|
||||
if (w.exists() && w.isDirectory()) {
|
||||
world = Bukkit.createWorld(new WorldCreator(owner.toString()));
|
||||
} else {
|
||||
FileUtils.copyDirectory(new File(BauSystem.getInstance().config.backupDir), new File(owner.toString()));
|
||||
FileUtils.copyDirectory(new File(BauSystem.getInstance().config.backupDir), new File("plugins/BauSystem/worlds/" + owner.toString()));
|
||||
world = Bukkit.createWorld(new WorldCreator(owner.toString()));
|
||||
}
|
||||
Bukkit.getScheduler().runTaskTimer(BauSystem.getInstance(), new LagDetectorRunnable(world, owner), 20, 20);
|
||||
|
@ -36,6 +36,7 @@ public class RegionListener implements Listener {
|
||||
try{
|
||||
worldOwner = UUID.fromString(e.getPlayer().getWorld().getName());
|
||||
}catch(IllegalArgumentException E){
|
||||
p.sendMessage(BauSystem.PREFIX + "§cDu darfst hier kein Worldedit benutzen.");
|
||||
e.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
@ -3,4 +3,4 @@ author: Exceptionflug, RedstoneTechnik, Lixfel
|
||||
version: 1.0
|
||||
depend: [WorldEdit, WorldGuard]
|
||||
|
||||
main: BauSystem
|
||||
main: de.warking.bausystem.BauSystem
|
In neuem Issue referenzieren
Einen Benutzer sperren