Add togglegravity command
This commit is contained in:
parent
a709aee173
commit
46d335bf0e
|
@ -54,6 +54,19 @@ public class MiscCommands implements Commands {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Command(
|
||||||
|
aliases = { "togglegravity" },
|
||||||
|
usage = "<player>",
|
||||||
|
desc = "Toggle a player's gravity.",
|
||||||
|
min = 0,
|
||||||
|
max = 1
|
||||||
|
)
|
||||||
|
@CommandPermissions("togglegravity")
|
||||||
|
public void noGravity(final CommandContext args, final CommandSender sender) throws CommandException {
|
||||||
|
Player player = CommandUtils.getPlayerOrSelf(args, sender, 0);
|
||||||
|
player.setGravity(!player.hasGravity());
|
||||||
|
}
|
||||||
|
|
||||||
@Command(
|
@Command(
|
||||||
aliases = { "sudo" },
|
aliases = { "sudo" },
|
||||||
usage = "<player> [command... (rand|mode|near|color|*)=value]",
|
usage = "<player> [command... (rand|mode|near|color|*)=value]",
|
||||||
|
|
|
@ -144,6 +144,8 @@ public class LoginListener implements Listener, PluginFacet {
|
||||||
final Player player = event.getPlayer();
|
final Player player = event.getPlayer();
|
||||||
final UUID uuid = player.getUniqueId();
|
final UUID uuid = player.getUniqueId();
|
||||||
|
|
||||||
|
player.setGravity(true);
|
||||||
|
|
||||||
this.logins.cleanUp();
|
this.logins.cleanUp();
|
||||||
final LoginResponse response = this.logins.getIfPresent(uuid);
|
final LoginResponse response = this.logins.getIfPresent(uuid);
|
||||||
this.logins.invalidate(uuid);
|
this.logins.invalidate(uuid);
|
||||||
|
|
|
@ -54,6 +54,7 @@ public class Utils {
|
||||||
player.setAllowFlight(player.hasPermission("lobby.fly"));
|
player.setAllowFlight(player.hasPermission("lobby.fly"));
|
||||||
player.setWalkSpeed(0.2f);
|
player.setWalkSpeed(0.2f);
|
||||||
player.setFlySpeed(0.1f);
|
player.setFlySpeed(0.1f);
|
||||||
|
player.setGravity(true);
|
||||||
player.setPotionParticles(false);
|
player.setPotionParticles(false);
|
||||||
player.hideTitle();
|
player.hideTitle();
|
||||||
player.getWorld().spawnParticle(Particle.CLOUD, player.getLocation(), 15, 0.5, 0.5, 0.5, 0);
|
player.getWorld().spawnParticle(Particle.CLOUD, player.getLocation(), 15, 0.5, 0.5, 0.5, 0);
|
||||||
|
|
|
@ -69,6 +69,7 @@ public class Alive extends Participating {
|
||||||
player.setVisible(true);
|
player.setVisible(true);
|
||||||
player.refreshVisibility();
|
player.refreshVisibility();
|
||||||
bukkit.setGameMode(GameMode.SURVIVAL);
|
bukkit.setGameMode(GameMode.SURVIVAL);
|
||||||
|
bukkit.setGravity(true);
|
||||||
|
|
||||||
// Apply spawn kit
|
// Apply spawn kit
|
||||||
for(Kit kit : smm.getPlayerKits()) {
|
for(Kit kit : smm.getPlayerKits()) {
|
||||||
|
|
|
@ -43,6 +43,7 @@ public class Observing extends State {
|
||||||
player.refreshVisibility();
|
player.refreshVisibility();
|
||||||
bukkit.setGameMode(GameMode.CREATIVE);
|
bukkit.setGameMode(GameMode.CREATIVE);
|
||||||
bukkit.setAllowFlight(true);
|
bukkit.setAllowFlight(true);
|
||||||
|
bukkit.setGravity(true);
|
||||||
|
|
||||||
Spawn spawn = smm.getDefaultSpawn();
|
Spawn spawn = smm.getDefaultSpawn();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue