mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-26 17:05:01 +00:00
Merge pull request #276 from AtlasMediaGroup/FS-460-remove-sit-command-from-tfm
[FS-460] Remove /sit command
This commit is contained in:
commit
a2133369d2
@ -1,34 +0,0 @@
|
|||||||
package me.totalfreedom.totalfreedommod;
|
|
||||||
|
|
||||||
import me.totalfreedom.totalfreedommod.command.Command_sit;
|
|
||||||
import org.bukkit.entity.ArmorStand;
|
|
||||||
import org.bukkit.entity.Entity;
|
|
||||||
import org.bukkit.event.EventHandler;
|
|
||||||
import org.spigotmc.event.entity.EntityDismountEvent;
|
|
||||||
|
|
||||||
public class Sitter extends FreedomService
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void onStart()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onStop()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onEntityDismount(EntityDismountEvent e)
|
|
||||||
{
|
|
||||||
Entity dm = e.getDismounted();
|
|
||||||
if (dm instanceof ArmorStand)
|
|
||||||
{
|
|
||||||
if (Command_sit.STANDS.contains(dm))
|
|
||||||
{
|
|
||||||
Command_sit.STANDS.remove(dm);
|
|
||||||
dm.remove();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -118,7 +118,6 @@ public class TotalFreedomMod extends JavaPlugin
|
|||||||
public HTTPDaemon hd;
|
public HTTPDaemon hd;
|
||||||
public WorldRestrictions wr;
|
public WorldRestrictions wr;
|
||||||
public EntityWiper ew;
|
public EntityWiper ew;
|
||||||
public Sitter st;
|
|
||||||
public VanishHandler vh;
|
public VanishHandler vh;
|
||||||
public Pterodactyl ptero;
|
public Pterodactyl ptero;
|
||||||
//
|
//
|
||||||
@ -312,7 +311,6 @@ public class TotalFreedomMod extends JavaPlugin
|
|||||||
pem = new PermissionManager();
|
pem = new PermissionManager();
|
||||||
gr = new GameRuleHandler();
|
gr = new GameRuleHandler();
|
||||||
ew = new EntityWiper();
|
ew = new EntityWiper();
|
||||||
st = new Sitter();
|
|
||||||
vh = new VanishHandler();
|
vh = new VanishHandler();
|
||||||
ptero = new Pterodactyl();
|
ptero = new Pterodactyl();
|
||||||
}
|
}
|
||||||
|
@ -1,35 +0,0 @@
|
|||||||
package me.totalfreedom.totalfreedommod.command;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
|
||||||
import org.bukkit.command.Command;
|
|
||||||
import org.bukkit.command.CommandSender;
|
|
||||||
import org.bukkit.entity.ArmorStand;
|
|
||||||
import org.bukkit.entity.EntityType;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
@CommandPermissions(level = Rank.OP, source = SourceType.ONLY_IN_GAME)
|
|
||||||
@CommandParameters(description = "Sit at the current place you are at.", usage = "/<command>")
|
|
||||||
public class Command_sit extends FreedomCommand
|
|
||||||
{
|
|
||||||
public static List<ArmorStand> STANDS = new ArrayList<>();
|
|
||||||
|
|
||||||
public boolean run(final CommandSender sender, final Player playerSender, final Command cmd, final String commandLabel, final String[] args, final boolean senderIsConsole)
|
|
||||||
{
|
|
||||||
if (args.length != 0)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
ArmorStand stand = (ArmorStand)playerSender.getWorld().spawnEntity(playerSender.getLocation().clone().subtract(0.0, 1.7, 0.0), EntityType.ARMOR_STAND);
|
|
||||||
stand.setGravity(false);
|
|
||||||
stand.setAI(false);
|
|
||||||
stand.setVisible(false);
|
|
||||||
stand.setInvulnerable(true);
|
|
||||||
stand.addPassenger(playerSender);
|
|
||||||
STANDS.add(stand);
|
|
||||||
msg("You are now sitting.");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user