mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-22 02:25:41 +01:00
Basic Spawn & setSpawn Commands.
This commit is contained in:
parent
b110c51062
commit
724e05d73b
@ -1,6 +1,9 @@
|
||||
package com.onarandombox.MultiVerseCore.commands;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.onarandombox.MultiVerseCore.MVCommandHandler;
|
||||
import com.onarandombox.MultiVerseCore.MultiVerseCore;
|
||||
@ -9,12 +12,20 @@ public class MVSetSpawn extends MVCommandHandler {
|
||||
|
||||
public MVSetSpawn(MultiVerseCore plugin) {
|
||||
super(plugin);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean perform(CommandSender sender, String[] args) {
|
||||
// TODO Auto-generated method stub
|
||||
// TODO: Permissions
|
||||
if(sender instanceof Player){
|
||||
Player p = (Player) sender;
|
||||
Location l = p.getLocation();
|
||||
World w = p.getWorld();
|
||||
w.setSpawnLocation(l.getBlockX(),l.getBlockY(),l.getBlockZ());
|
||||
p.sendMessage(w.getName() + " - Spawn set to X: " + l.getBlockX() + " Y: " + l.getBlockY() + " Z: " + l.getBlockZ());
|
||||
} else {
|
||||
sender.sendMessage("Must be used in game");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.onarandombox.MultiVerseCore.commands;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.onarandombox.MultiVerseCore.MVCommandHandler;
|
||||
import com.onarandombox.MultiVerseCore.MultiVerseCore;
|
||||
@ -9,13 +10,18 @@ public class MVSpawn extends MVCommandHandler {
|
||||
|
||||
public MVSpawn(MultiVerseCore plugin) {
|
||||
super(plugin);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean perform(CommandSender sender, String[] args) {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
// TODO: Permissions
|
||||
if(sender instanceof Player){
|
||||
Player p = (Player) sender;
|
||||
p.teleportTo(p.getWorld().getSpawnLocation());
|
||||
} else {
|
||||
sender.sendMessage("Must be used in game.");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user