Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String[] arg = rset.getString("memotext").split(",");
- if(arg.length >= 4) {
- try {
- int i = 1;
- for(String ar: arg) { PvPRewards.debug("Argument " + String.valueOf(i) + " ist gleich " + ar); i++; }
- for(World wor: Bukkit.getWorlds()) { PvPRewards.debug("Verfuegbarer WeltName : " + wor.getName()); }
- World world = Bukkit.getWorld(arg[0]);
- if(world != null) {
- double x = Double.parseDouble(arg[1]);
- double y = Double.parseDouble(arg[2]);
- double z = Double.parseDouble(arg[3]);
- Location loc = new Location(world, (int)x, (int)y, (int)z );
- if(loc != null) {
- Block block = world.getBlockAt(loc);
- if(block != null) {
- if(block.getType() == Material.SIGN_POST || block.getType() == Material.WALL_SIGN) {
- Sign sign = (Sign)block.getState();
- if(sign != null) {
- if(sign.getLine(0).equalsIgnoreCase("[" + ChatColor.DARK_GREEN + "Frei" + ChatColor.RESET + "]")) {
- plugin.addSignLocation(block);
- } else {
- PvPRewards.debug("Schild gefunden , doch text in Zeile 1 passt nicht. Aktueller Text : " + sign.getLine(0));
- }
- }
- }
- }
- }
- }
- } catch(Exception e) {
- throw new IllegalStateException("Fehler beim Laden einer Sign Location \"" + rset.getString("memotext") + "\"!", e);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement