Fixes POM, and moves things around

This commit is contained in:
2022-08-05 00:34:54 +02:00
parent e3ef78f8f8
commit bb0be8a3f0
613 changed files with 27424 additions and 26469 deletions

View File

@ -0,0 +1,61 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.engine.EngineFly;
import com.massivecraft.factions.entity.MPlayer;
import com.massivecraft.massivecore.MassiveException;
import com.massivecraft.massivecore.command.MassiveCommandToggle;
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
import com.massivecraft.massivecore.engine.EngineMassiveCorePlayerUpdate;
import com.massivecraft.massivecore.ps.PS;
import org.bukkit.entity.Player;
public class CmdFactionsFly extends MassiveCommandToggle {
// -------------------------------------------- //
// INSTANCE
// -------------------------------------------- //
private static CmdFactionsFly i = new CmdFactionsFly();
public static CmdFactionsFly get() {
return i;
}
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public CmdFactionsFly() {
this.addRequirements(RequirementIsPlayer.get());
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public String getName() {
return "faction flying";
}
@Override
public boolean getValue() throws MassiveException {
return MPlayer.get(sender).isFlying();
}
public void setValue(boolean value) throws MassiveException {
MPlayer mplayer = MPlayer.get(sender);
Player player = me;
if (player == null) {
throw new MassiveException().addMsg("<b>Could not find player.");
}
PS ps = PS.valueOf(player);
if (value) {
EngineFly.canFlyInTerritoryOrThrow(mplayer, ps);
}
mplayer.setFlying(value);
EngineMassiveCorePlayerUpdate.update(player, false);
}
}