Merge remote-tracking branch 'origin/GillsCommand'
# Conflicts: # BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java
Dieser Commit ist enthalten in:
Commit
83ab53aa91
@ -89,6 +89,7 @@ public class BauSystem extends JavaPlugin implements Listener {
|
|||||||
getCommand("loader").setExecutor(new CommandLoader());
|
getCommand("loader").setExecutor(new CommandLoader());
|
||||||
getCommand("lockschem").setExecutor(new CommandLockschem());
|
getCommand("lockschem").setExecutor(new CommandLockschem());
|
||||||
getCommand("debugstick").setExecutor(new CommandDebugStick());
|
getCommand("debugstick").setExecutor(new CommandDebugStick());
|
||||||
|
getCommand("watervision").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 + "Wassersicht deaktiviert");
|
||||||
|
player.removePotionEffect(PotionEffectType.WATER_BREATHING);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
player.addPotionEffect(new PotionEffect(PotionEffectType.WATER_BREATHING, 1000000, 255, false, false));
|
||||||
|
player.sendMessage(BauSystem.PREFIX + "Wassersicht aktiviert");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
@ -27,4 +27,6 @@ commands:
|
|||||||
loader:
|
loader:
|
||||||
nightvision:
|
nightvision:
|
||||||
aliases: nv
|
aliases: nv
|
||||||
|
watervision:
|
||||||
|
aliases: wv
|
||||||
lockschem:
|
lockschem:
|
In neuem Issue referenzieren
Einen Benutzer sperren