You are not logged in.

  • Login

[Bukkit-Plugin] Plugin hilfe

Bitte besucht unser neues Forum unter https://forum.nitrado.net | Please visit our new Forum at https://forum.nitrado.net

Dear visitor, welcome to Nitrado.net Prepaid Gameserver Community-Support - Archiv. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

moritzhecki

User / Kunde

  • "moritzhecki" started this thread

Posts: 54

  • Send private message

1

Monday, January 5th 2015, 3:01pm

Plugin hilfe

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
package varo;



import java.io.File;
import java.io.IOException;
import java.util.ArrayList;

import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.util.Vector;

public class varo extends JavaPlugin  {

	
	public String prefix = "§7[§bVaro§7] ";
    public ArrayList<Player> dead = new ArrayList<Player>();
    public ArrayList<Player> online = new ArrayList<Player>();
    public File file = new File("plugin/Varo,","config.yml");
    public FileConfiguration cfg = YamlConfiguration.loadConfiguration(this.file);
    
    public int dontmove;
	public static boolean friedenatur;
	public static boolean nogo;
	public static boolean friedeschlagen;
	public static boolean friedeeat;
	
	@Override
	public void onEnable()  {
		this.getCommand("varo").setExecutor(this);
		
	}
	
	public static void spawnplayers(Location middle, int radius)  {
		for(Player all :Bukkit.getOnlinePlayers())  {
			all.teleport(middle);
		}
		float degree = 360 / Bukkit.getOnlinePlayers().length;
		int i = 0;
				for(Player all : Bukkit.getOnlinePlayers())  {
				middle.setYaw(360 - i * degree);	
				all.teleport(middle);
				
				Vector v = all.getEyeLocation().getDirection();
				Vector vec = v.multiply(radius);
				all.teleport(all.getLocation().add(vec));
				
				i++;
				}
				
			}
		
	    @SuppressWarnings("deprecation")
		public boolean onCommand(CommandSender sender, Command cmd, String label,
			String[] args, Plugin plugin)  {
		
		Player p = (Player) sender;
		
		if(cmd.getName().equalsIgnoreCase("varo"))  {
			if(args.length == 0)  {
				p.sendMessage("Das ist ein Varo Plugin");
			}
			if(args.length == 1)  {
				if(args[0].equalsIgnoreCase("start"))  {
					Bukkit.broadcastMessage("§a der Varo Countdown startet jetzt !");
					
				}
			}
			if(args[0].equalsIgnoreCase("setlobby"))  {
				if(p.hasPermission("varo.setlobby"))  {
					
					this.cfg.set("Varo.Lobby.World", p.getWorld().getName());
					this.cfg.set("Varo.Lobby.X", Double.valueOf(p.getLocation().getX()));
					this.cfg.set("Varo.Lobby.Y", Double.valueOf(p.getLocation().getY()));
					this.cfg.set("Varo.Lobby.Z", Double.valueOf(p.getLocation().getZ()));
					this.cfg.set("Varo.Lobby.Yaw", Double.valueOf(p.getLocation().getYaw()));
					this.cfg.set("Varo.Lobby.Pitch", Double.valueOf(p.getLocation().getPitch()));
				try  {
					this.cfg.save(this.file);
					p.sendMessage("§c Die Lobby wurde gesetzt");
				} catch (IOException e)  {
					e.printStackTrace();
				}
			}
		}
	}
		
		
		
			if(args.length == 2)  {
			if(args[0].equalsIgnoreCase("setspawn"))  {
				if(sender instanceof Player)  {
				if(p.hasPermission("varo.setspawn"))  {	
					int radius = Integer.parseInt(args[1]);
				
					this.cfg.set("Varo.Spawn.World", p.getLocation().getWorld().getName());
					this.cfg.set("Varo.Spawn.X", p.getLocation().getX());
					this.cfg.set("Varo.Spawn.Y", p.getLocation().getY());
					this.cfg.set("Varo.Spawn.Z", p.getLocation().getZ());
					this.cfg.set("Varo.Spawn.Radius", radius);
				try  {
					this.cfg.save(this.file);
					p.sendMessage("§c Der Spawn wurde gesetzt");
				} catch (IOException e)  {
					e.printStackTrace();
					}
				}
			}
		}
			
	}
		       Bukkit.broadcastMessage("§a Varo startet in §c30 sekunden");
			   Bukkit.getScheduler().scheduleAsyncDelayedTask(plugin, new Runnable()  {
	           public void run()  {
	        	
	        	World w = Bukkit.getWorld(cfg.getString("Varo.i.World"));
	        	double x = cfg.getDouble("Varo.i.X");
	        	double y = cfg.getDouble("Varo.i.Y");
	        	double z = cfg.getDouble("Varo.i.Z");
	        	int radius = cfg.getInt("Varo.i.Radius");
	        	
	        	Location loc = new Location(w, x, y, z);
	        	spawnplayers(loc, radius);
	          }
	        }, 2400L);	
				
				Bukkit.getScheduler().scheduleAsyncDelayedTask(plugin, new Runnable()  {
			           public void run()  {
			           nogo = false;
			           Bukkit.broadcastMessage("§c Lauft! Lauft! Varo wurde gestartet !");
			           Bukkit.broadcastMessage("§a In§c 30 §c sekunden startet Varo");
			          }
			        }, 3000L);	
				
				Bukkit.getScheduler().scheduleAsyncDelayedTask(plugin, new Runnable()  {
			           public void run()  {
			           friedeschlagen = false;
			           friedenatur = false;
			           Bukkit.broadcastMessage("§c Lauft! Lauft! Varo wurde gestartet !");
			          }
			        }, 3600L);	
	    
            

		return false;
	}
}

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package varo;

import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.FoodLevelChangeEvent;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerMoveEvent;

public class eventlistener implements Listener  {
	
	public eventlistener(varo plugin)  {
		plugin.getServer().getPluginManager().registerEvents(this, plugin);
}
	
	@EventHandler 
	public void dead (PlayerDeathEvent e) {
		Player p = e.getEntity();
		p.setBanned(true);
		p.kickPlayer("Du bist gestorben");
	
	}
	@EventHandler
	public void ondamage(EntityDamageEvent e)  {
		
		if(varo.friedenatur)  {
			e.setCancelled(true);
		} else  {
			e.setCancelled(false);
		}
	}
	@EventHandler
	public void onnatur(EntityDamageByEntityEvent e)  {
		
		if(varo.friedeschlagen)  {
			e.setCancelled(true);
		} else  {
			e.setCancelled(false);
		}
	}
	@EventHandler
	public void onfood(FoodLevelChangeEvent e)  {
		if(varo.friedeeat)  {
			e.setCancelled(true);
		} else {
			e.setCancelled(false);
		}
	}
	@EventHandler
	public void onMove(PlayerMoveEvent e)  {
		Player p = e.getPlayer();
		if(!varo.nogo)  {
			
			
			if((e.getFrom().getBlockX() == e.getTo().getBlockX() && (e.getFrom().getBlockY()
					== e.getTo().getBlockY() && (e.getFrom().getBlockZ() == e.getTo().getBlockZ())))) return;
			p.teleport(p);
		}
	}
}

es steht bei /pl
aber die befehle funktionieren nicht
hier noch das Plugin
moritzhecki has attached the following file:

D3V3L0P3R

User / Kunde

  • "D3V3L0P3R" is male

Posts: 97

Location: Mainz

Occupation: @school

  • Send private message

2

Monday, January 5th 2015, 3:36pm

Steht da irgendwas in deinem Server log wenn du die Befehle testet ?
Reagiert der Server überhaupt auf die Befehle oder sagt er das es die Befehle nicht gibt ?
Hast du die Befehle in die plugin.yml geschrieben ?
Komplett Kostenlos:
-
Minecraft TTT Plugin *hier klicken*

moritzhecki

User / Kunde

  • "moritzhecki" started this thread

Posts: 54

  • Send private message

3

Monday, January 5th 2015, 3:56pm

Source code

1
2
3
4
5
6
7
8
name: varo
version: 0.1 
description: Varo system
author: Moritz
main: varo.varo
commands:
  varo:
    description: varo
moritzhecki has attached the following file:
  • 2014-12-21-1.log (5.46 kB - 5 times downloaded - latest: Jan 6th 2015, 12:26am)

D3V3L0P3R

User / Kunde

  • "D3V3L0P3R" is male

Posts: 97

Location: Mainz

Occupation: @school

  • Send private message

4

Monday, January 5th 2015, 3:59pm

Es wäre gut wenn du den Log nimmst indem du auch den Command ausführst

Ausserdem sehe ich gerade das dein Plugin garnicht installiert ist. Bessergesagt wird es in dem log nicht deaktiviert.

Achja und es wäre nett wenn du mir sagst was überhaupt passiert wenn du /varo eingibst. Also warum es nicht geht (Fehler / Command gibts nicht / gar nichts).
Sonst kann ich dir leider nicht helfen
Komplett Kostenlos:
-
Minecraft TTT Plugin *hier klicken*

Anno35

User / Kunde

Posts: 1,223

Thanks: 3

  • Send private message

5

Monday, January 5th 2015, 4:00pm

Der log zeigt aber nicht den Start des Servers, nur den Stopvorgang.

D3V3L0P3R

User / Kunde

  • "D3V3L0P3R" is male

Posts: 97

Location: Mainz

Occupation: @school

  • Send private message

6

Monday, January 5th 2015, 4:03pm

Der log zeigt aber nicht den Start des Servers, nur den Stopvorgang.

Im Stoppvorgang steht sogar nichts von dem Plugin ^^
Komplett Kostenlos:
-
Minecraft TTT Plugin *hier klicken*

moritzhecki

User / Kunde

  • "moritzhecki" started this thread

Posts: 54

  • Send private message

7

Monday, January 5th 2015, 5:31pm

hier habe ausverehen einen anderen hochgeladen
moritzhecki has attached the following file:
  • latest.log (6.63 kB - 4 times downloaded - latest: Jun 23rd 2017, 3:02pm)

D3V3L0P3R

User / Kunde

  • "D3V3L0P3R" is male

Posts: 97

Location: Mainz

Occupation: @school

  • Send private message

8

Monday, January 5th 2015, 5:41pm

Okay im Log steht also nichts.
Was hat den im Chat gestanden als du es eingegeben hast ?
Komplett Kostenlos:
-
Minecraft TTT Plugin *hier klicken*

moritzhecki

User / Kunde

  • "moritzhecki" started this thread

Posts: 54

  • Send private message

9

Monday, January 5th 2015, 5:52pm

garnichts

D3V3L0P3R

User / Kunde

  • "D3V3L0P3R" is male

Posts: 97

Location: Mainz

Occupation: @school

  • Send private message

10

Monday, January 5th 2015, 6:46pm

Du fragst

Source code

1
if(args.length == 1)  {

wenn du aber setlobby eingibst, ist die args.lenght auch == 1.
Dadurch kommt es nie dazu dass setlobby usw ausgeführt werden
Komplett Kostenlos:
-
Minecraft TTT Plugin *hier klicken*

moritzhecki

User / Kunde

  • "moritzhecki" started this thread

Posts: 54

  • Send private message

11

Monday, January 5th 2015, 6:57pm

habe es gefixt nur es funktioniert immer noch nicht

D3V3L0P3R

User / Kunde

  • "D3V3L0P3R" is male

Posts: 97

Location: Mainz

Occupation: @school

  • Send private message

12

Monday, January 5th 2015, 7:28pm

Dann schicke den neuen Code
Komplett Kostenlos:
-
Minecraft TTT Plugin *hier klicken*

moritzhecki

User / Kunde

  • "moritzhecki" started this thread

Posts: 54

  • Send private message

13

Monday, January 5th 2015, 7:33pm

Listener

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package varo;

import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.FoodLevelChangeEvent;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerMoveEvent;

public class eventlistener implements Listener  {
	
	public eventlistener(varo plugin)  {
		plugin.getServer().getPluginManager().registerEvents(this, plugin);
}
	
	@EventHandler 
	public void dead (PlayerDeathEvent e) {
		Player p = e.getEntity();
		p.setBanned(true);
		p.kickPlayer("Du bist gestorben");
	
	}
	@EventHandler
	public void ondamage(EntityDamageEvent e)  {
		
		if(varo.friedenatur)  {
			e.setCancelled(true);
		} else  {
			e.setCancelled(false);
		}
	}
	@EventHandler
	public void onnatur(EntityDamageByEntityEvent e)  {
		
		if(varo.friedeschlagen)  {
			e.setCancelled(true);
		} else  {
			e.setCancelled(false);
		}
	}
	@EventHandler
	public void onfood(FoodLevelChangeEvent e)  {
		if(varo.friedeeat)  {
			e.setCancelled(true);
		} else {
			e.setCancelled(false);
		}
	}
	@EventHandler
	public void onMove(PlayerMoveEvent e)  {
		Player p = e.getPlayer();
		if(!varo.nogo)  {
			
			
			if((e.getFrom().getBlockX() == e.getTo().getBlockX() && (e.getFrom().getBlockY()
					== e.getTo().getBlockY() && (e.getFrom().getBlockZ() == e.getTo().getBlockZ())))) return;
			p.teleport(p);
		}
	}
}

Hauptklasse

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
package varo;



import java.io.File;
import java.io.IOException;
import java.util.ArrayList;

import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.util.Vector;

public class varo extends JavaPlugin  {

	
	public String prefix = "§7[§bVaro§7] ";
    public ArrayList<Player> dead = new ArrayList<Player>();
    public ArrayList<Player> online = new ArrayList<Player>();
    public File file = new File("plugin/Varo,","config.yml");
    public FileConfiguration cfg = YamlConfiguration.loadConfiguration(this.file);
    
    public int dontmove;
	public static boolean friedenatur;
	public static boolean nogo;
	public static boolean friedeschlagen;
	public static boolean friedeeat;
	
	@Override
	public void onEnable()  {
		this.getCommand("varo").setExecutor(this);
		
	}
	
	public static void spawnplayers(Location middle, int radius)  {
		for(Player all :Bukkit.getOnlinePlayers())  {
			all.teleport(middle);
		}
		float degree = 360 / Bukkit.getOnlinePlayers().length;
		int i = 0;
				for(Player all : Bukkit.getOnlinePlayers())  {
				middle.setYaw(360 - i * degree);	
				all.teleport(middle);
				
				Vector v = all.getEyeLocation().getDirection();
				Vector vec = v.multiply(radius);
				all.teleport(all.getLocation().add(vec));
				
				i++;
				}
				
			}
		
	    @SuppressWarnings("deprecation")
		public boolean onCommand(CommandSender sender, Command cmd, String label,
			String[] args, Plugin plugin)  {
		
		Player p = (Player) sender;
		
		if(cmd.getName().equalsIgnoreCase("varo"))  {
			if(args.length == 0)  {
				p.sendMessage("Das ist ein Varo Plugin");
			}
			if(args.length == 1)  {
				if(args[0].equalsIgnoreCase("start"))  {
					Bukkit.broadcastMessage("§a der Varo Countdown startet jetzt !");
					
				}
			}
			if(args[0].equalsIgnoreCase("setlobby"))  {
				if(p.hasPermission("varo.setlobby"))  {
					
					this.cfg.set("Varo.Lobby.World", p.getWorld().getName());
					this.cfg.set("Varo.Lobby.X", Double.valueOf(p.getLocation().getX()));
					this.cfg.set("Varo.Lobby.Y", Double.valueOf(p.getLocation().getY()));
					this.cfg.set("Varo.Lobby.Z", Double.valueOf(p.getLocation().getZ()));
					this.cfg.set("Varo.Lobby.Yaw", Double.valueOf(p.getLocation().getYaw()));
					this.cfg.set("Varo.Lobby.Pitch", Double.valueOf(p.getLocation().getPitch()));
				try  {
					this.cfg.save(this.file);
					p.sendMessage("§c Die Lobby wurde gesetzt");
				} catch (IOException e)  {
					e.printStackTrace();
				}
			}
		}
	}
		
		
		
			if(args.length == 1)  {
			if(args[0].equalsIgnoreCase("setspawn"))  {
				if(sender instanceof Player)  {
				if(p.hasPermission("varo.setspawn"))  {	
					int radius = Integer.parseInt(args[1]);
				
					this.cfg.set("Varo.Spawn.World", p.getLocation().getWorld().getName());
					this.cfg.set("Varo.Spawn.X", p.getLocation().getX());
					this.cfg.set("Varo.Spawn.Y", p.getLocation().getY());
					this.cfg.set("Varo.Spawn.Z", p.getLocation().getZ());
					this.cfg.set("Varo.Spawn.Radius", radius);
				try  {
					this.cfg.save(this.file);
					p.sendMessage("§c Der Spawn wurde gesetzt");
				} catch (IOException e)  {
					e.printStackTrace();
					}
				}
			}
		}
			
	}
		       Bukkit.broadcastMessage("§a Varo startet in §c30 sekunden");
			   Bukkit.getScheduler().scheduleAsyncDelayedTask(plugin, new Runnable()  {
	           public void run()  {
	        	
	        	World w = Bukkit.getWorld(cfg.getString("Varo.i.World"));
	        	double x = cfg.getDouble("Varo.i.X");
	        	double y = cfg.getDouble("Varo.i.Y");
	        	double z = cfg.getDouble("Varo.i.Z");
	        	int radius = cfg.getInt("Varo.i.Radius");
	        	
	        	Location loc = new Location(w, x, y, z);
	        	spawnplayers(loc, radius);
	          }
	        }, 2400L);	
				
				Bukkit.getScheduler().scheduleAsyncDelayedTask(plugin, new Runnable()  {
			           public void run()  {
			           nogo = false;
			           Bukkit.broadcastMessage("§c Lauft! Lauft! Varo wurde gestartet !");
			           Bukkit.broadcastMessage("§a In§c 30 §c sekunden startet Varo");
			          }
			        }, 3000L);	
				
				Bukkit.getScheduler().scheduleAsyncDelayedTask(plugin, new Runnable()  {
			           public void run()  {
			           friedeschlagen = false;
			           friedenatur = false;
			           Bukkit.broadcastMessage("§c Lauft! Lauft! Varo wurde gestartet !");
			          }
			        }, 3600L);	
	    
            

		return false;
	}
}

D3V3L0P3R

User / Kunde

  • "D3V3L0P3R" is male

Posts: 97

Location: Mainz

Occupation: @school

  • Send private message

14

Monday, January 5th 2015, 7:50pm

Was hast du denn jetzt gemacht ?
if(args.length == 1) {
muss überall erstmal komplett weg



Wie lange programmierst du denn schon ?
Evtl ist das Projekt für dich für den Anfang etwas zu kompliziert.
Komplett Kostenlos:
-
Minecraft TTT Plugin *hier klicken*

moritzhecki

User / Kunde

  • "moritzhecki" started this thread

Posts: 54

  • Send private message

15

Monday, January 5th 2015, 8:19pm

habe es falch verstanden habe es jetzt geändert

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
package varo;



import java.io.File;
import java.io.IOException;
import java.util.ArrayList;

import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.util.Vector;

public class varo extends JavaPlugin  {

	
	public String prefix = "§7[§bVaro§7] ";
    public ArrayList<Player> dead = new ArrayList<Player>();
    public ArrayList<Player> online = new ArrayList<Player>();
    public File file = new File("plugin/Varo,","config.yml");
    public FileConfiguration cfg = YamlConfiguration.loadConfiguration(this.file);
    
    public int dontmove;
	public static boolean friedenatur;
	public static boolean nogo;
	public static boolean friedeschlagen;
	public static boolean friedeeat;
	
	@Override
	public void onEnable()  {
		this.getCommand("varo").setExecutor(this);
		
	}
	
	public static void spawnplayers(Location middle, int radius)  {
		for(Player all :Bukkit.getOnlinePlayers())  {
			all.teleport(middle);
		}
	
	
		float degree = 360 / Bukkit.getOnlinePlayers().length;
		int i = 0;
				for(Player all : Bukkit.getOnlinePlayers())  {
				middle.setYaw(360 - i * degree);	
				all.teleport(middle);
				
				Vector v = all.getEyeLocation().getDirection();
				Vector vec = v.multiply(radius);
				all.teleport(all.getLocation().add(vec));
				
				i++;
				}
	
}

		
	    @SuppressWarnings("deprecation")
		public boolean onCommand(CommandSender sender, Command cmd, String label,
			String[] args, Plugin plugin)  {
		
		Player p = (Player) sender;
		
		if(cmd.getName().equalsIgnoreCase("varo"))  {
			if(args.length == 0)  {
				p.sendMessage("Das ist ein Varo Plugin");
			}
			if(cmd.getName().equalsIgnoreCase("start"))  {
				if(args.length == 0)  {
					Bukkit.broadcastMessage("§a der Varo Countdown startet jetzt !");
					
				
				}
		}
			if(cmd.getName().equalsIgnoreCase("setlobby"))  {
				if(args.length == 0)  {
			
				if(sender instanceof Player)  {
				if(p.hasPermission("varo.setlobby"))  {
					this.cfg.set("Varo.Lobby.World", p.getWorld().getName());
					this.cfg.set("Varo.Lobby.X", Double.valueOf(p.getLocation().getX()));
					this.cfg.set("Varo.Lobby.Y", Double.valueOf(p.getLocation().getY()));
					this.cfg.set("Varo.Lobby.Z", Double.valueOf(p.getLocation().getZ()));
					this.cfg.set("Varo.Lobby.Yaw", Double.valueOf(p.getLocation().getYaw()));
					this.cfg.set("Varo.Lobby.Pitch", Double.valueOf(p.getLocation().getPitch()));
				try  {
					this.cfg.save(this.file);
					p.sendMessage("§c Die Lobby wurde gesetzt");
				} catch (IOException e)  {
					e.printStackTrace();
				}
			}
		}
	
				}
			}
		
			if(cmd.getName().equalsIgnoreCase("setmapspawn"))  {
				if(sender instanceof Player)  {
				if(p.hasPermission("varo.setmapspawn"))  {	
					int radius = Integer.parseInt(args[1]);
				
					this.cfg.set("Varo.Spawn.World", p.getLocation().getWorld().getName());
					this.cfg.set("Varo.Spawn.X", p.getLocation().getX());
					this.cfg.set("Varo.Spawn.Y", p.getLocation().getY());
					this.cfg.set("Varo.Spawn.Z", p.getLocation().getZ());
					this.cfg.set("Varo.Spawn.Radius", radius);
				try  {
					this.cfg.save(this.file);
					p.sendMessage("§c Der Spawn wurde gesetzt");
				} catch (IOException e)  {
					e.printStackTrace();
					}
				}
			}
		}
			
		
		if(cmd.getName().equalsIgnoreCase("start"))  {
			if(args.length == 0)  {
		       Bukkit.broadcastMessage("§a Varo startet in §c30 sekunden");
			   Bukkit.getScheduler().scheduleAsyncDelayedTask(plugin, new Runnable()  {
	           public void run()  {
	        	
	        	World w = Bukkit.getWorld(cfg.getString("Varo.i.World"));
	        	double x = cfg.getDouble("Varo.i.X");
	        	double y = cfg.getDouble("Varo.i.Y");
	        	double z = cfg.getDouble("Varo.i.Z");
	        	int radius = cfg.getInt("Varo.i.Radius");
	        	
	        	Location loc = new Location(w, x, y, z);
	        	spawnplayers(loc, radius);
	          }
	        }, 2400L);	
		}
	}
				Bukkit.getScheduler().scheduleAsyncDelayedTask(plugin, new Runnable()  {
			           public void run()  {
			           nogo = false;
			           Bukkit.broadcastMessage("§c Lauft! Lauft! Varo wurde gestartet !");
			           Bukkit.broadcastMessage("§a In§c 30 §c sekunden startet Varo");
			          }
			        }, 3000L);	
				
				Bukkit.getScheduler().scheduleAsyncDelayedTask(plugin, new Runnable()  {
			           public void run()  {
			           friedeschlagen = false;
			           friedenatur = false;
			           Bukkit.broadcastMessage("§c Lauft! Lauft! Varo wurde gestartet !");
			          }
			        }, 3600L);	
	    
			

		
	            }
		return false;
            
        
    }

Bitte besucht unser neues Forum unter https://forum.nitrado.net| Please visit our new Forum at https://forum.nitrado.net

Similar threads