added Command "/gills" & registered it
this is a slightly modified version of "/nv"
Dieser Commit ist enthalten in:
Ursprung
bce1f156ca
Commit
05d2ef4632
@ -88,6 +88,7 @@ public class BauSystem extends JavaPlugin implements Listener {
|
|||||||
getCommand("skull").setExecutor(new CommandSkull());
|
getCommand("skull").setExecutor(new CommandSkull());
|
||||||
getCommand("loader").setExecutor(new CommandLoader());
|
getCommand("loader").setExecutor(new CommandLoader());
|
||||||
getCommand("lockschem").setExecutor(new CommandLockschem());
|
getCommand("lockschem").setExecutor(new CommandLockschem());
|
||||||
|
getCommand("gills").setExecutor(new CommandGills());
|
||||||
|
|
||||||
Bukkit.getPluginManager().registerEvents(this, this);
|
Bukkit.getPluginManager().registerEvents(this, this);
|
||||||
Bukkit.getPluginManager().registerEvents(new RegionListener(), this);
|
Bukkit.getPluginManager().registerEvents(new RegionListener(), this);
|
||||||
|
31
BauSystem_Main/src/de/steamwar/bausystem/commands/CommandGills.java
Normale Datei
31
BauSystem_Main/src/de/steamwar/bausystem/commands/CommandGills.java
Normale Datei
@ -0,0 +1,31 @@
|
|||||||
|
package de.steamwar.bausystem.commands;
|
||||||
|
|
||||||
|
import org.bukkit.command.Command;
|
||||||
|
import org.bukkit.command.CommandExecutor;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.potion.PotionEffect;
|
||||||
|
import org.bukkit.potion.PotionEffectType;
|
||||||
|
|
||||||
|
import de.steamwar.bausystem.BauSystem;
|
||||||
|
|
||||||
|
public class CommandGills implements CommandExecutor {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||||
|
if(!(sender instanceof Player))
|
||||||
|
return false;
|
||||||
|
Player player = (Player) sender;
|
||||||
|
|
||||||
|
for(PotionEffect effect : player.getActivePotionEffects()){
|
||||||
|
if(effect.getType().equals(PotionEffectType.WATER_BREATHING)){
|
||||||
|
player.sendMessage(BauSystem.PREFIX + "Kiemen deaktiviert");
|
||||||
|
player.removePotionEffect(PotionEffectType.WATER_BREATHING);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
player.addPotionEffect(new PotionEffect(PotionEffectType.WATER_BREATHING, 1000000, 255, false, false));
|
||||||
|
player.sendMessage(BauSystem.PREFIX + "Kiemen aktiviert");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
In neuem Issue referenzieren
Einen Benutzer sperren