Removed everything shield wise for release with bug fixes
This commit is contained in:
parent
57833bee13
commit
c274918244
@ -4,7 +4,6 @@ import com.massivecraft.factions.event.FactionDisbandEvent.PlayerDisbandReason;
|
|||||||
import com.massivecraft.factions.iface.EconomyParticipator;
|
import com.massivecraft.factions.iface.EconomyParticipator;
|
||||||
import com.massivecraft.factions.iface.RelationParticipator;
|
import com.massivecraft.factions.iface.RelationParticipator;
|
||||||
import com.massivecraft.factions.missions.Mission;
|
import com.massivecraft.factions.missions.Mission;
|
||||||
import com.massivecraft.factions.shield.TimeFrame;
|
|
||||||
import com.massivecraft.factions.struct.BanInfo;
|
import com.massivecraft.factions.struct.BanInfo;
|
||||||
import com.massivecraft.factions.struct.Relation;
|
import com.massivecraft.factions.struct.Relation;
|
||||||
import com.massivecraft.factions.struct.Role;
|
import com.massivecraft.factions.struct.Role;
|
||||||
@ -445,9 +444,4 @@ public interface Faction extends EconomyParticipator {
|
|||||||
// -------------------------------
|
// -------------------------------
|
||||||
// Shields
|
// Shields
|
||||||
// -------------------------------
|
// -------------------------------
|
||||||
|
|
||||||
void setTimeFrame(TimeFrame timeFrame);
|
|
||||||
|
|
||||||
TimeFrame getTimeFrame();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -61,19 +61,20 @@ public class CmdTntFill extends FCommand {
|
|||||||
int radius = context.argAsInt(0, 0); // We don't know the max yet, so let's not assume.
|
int radius = context.argAsInt(0, 0); // We don't know the max yet, so let's not assume.
|
||||||
int amount = context.argAsInt(1, 0); // We don't know the max yet, so let's not assume.
|
int amount = context.argAsInt(1, 0); // We don't know the max yet, so let's not assume.
|
||||||
|
|
||||||
if (amount < 0) {
|
if (amount <= 0 || radius <= 0) {
|
||||||
context.msg(TL.COMMAND_TNT_POSITIVE);
|
context.msg(TL.COMMAND_TNT_POSITIVE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (radius > FactionsPlugin.instance.getConfig().getInt("Tntfill.max-radius")) {
|
if (radius > FactionsPlugin.instance.getConfig().getInt("Tntfill.max-radius")) {
|
||||||
context.msg(TL.COMMAND_TNTFILL_RADIUSMAX.toString().replace("{max}", FactionsPlugin.instance.getConfig().getInt("Tntfill.max-radius") + ""));
|
context.msg(TL.COMMAND_TNTFILL_RADIUSMAX.toString().replace("{max}", FactionsPlugin.instance.getConfig().getInt("Tntfill.max-radius") + ""));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (amount > FactionsPlugin.instance.getConfig().getInt("Tntfill.max-amount")) {
|
if (amount > FactionsPlugin.instance.getConfig().getInt("Tntfill.max-amount")) {
|
||||||
context.msg(TL.COMMAND_TNTFILL_AMOUNTMAX.toString().replace("{max}", FactionsPlugin.instance.getConfig().getInt("Tntfill.max-amount") + ""));
|
context.msg(TL.COMMAND_TNTFILL_AMOUNTMAX.toString().replace("{max}", FactionsPlugin.instance.getConfig().getInt("Tntfill.max-amount") + ""));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// How many dispensers are we to fill in?
|
// How many dispensers are we to fill in?
|
||||||
|
|
||||||
Location start = context.player.getLocation();
|
Location start = context.player.getLocation();
|
||||||
|
@ -1,91 +0,0 @@
|
|||||||
package com.massivecraft.factions.shield;
|
|
||||||
|
|
||||||
import com.massivecraft.factions.Faction;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Saser
|
|
||||||
*/
|
|
||||||
public class TimeFrame {
|
|
||||||
|
|
||||||
//each of these objs will be in 1 fac
|
|
||||||
|
|
||||||
private Faction faction;
|
|
||||||
private Enum startingTime;
|
|
||||||
private Enum endingTime;
|
|
||||||
|
|
||||||
private int currentMinutes; // this will be the variable for either the currentTime starting, or ending, or current in effect.
|
|
||||||
|
|
||||||
private boolean inEffect; // if the shield is in effect
|
|
||||||
private boolean starting; // pending starting countdown
|
|
||||||
private boolean ending; // pending ending countdown
|
|
||||||
|
|
||||||
|
|
||||||
public TimeFrame(Faction faction, Enum startingTime, Enum endingTime, boolean starting, boolean ending, boolean inEffect, int currentMinutes){
|
|
||||||
this.faction = faction;
|
|
||||||
this.startingTime = startingTime;
|
|
||||||
this.endingTime = endingTime;
|
|
||||||
this.starting = starting;
|
|
||||||
this.ending = ending;
|
|
||||||
this.inEffect = inEffect;
|
|
||||||
this.currentMinutes = currentMinutes;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public boolean isEnding() {
|
|
||||||
return ending;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isInEffect() {
|
|
||||||
return inEffect;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Enum getEndingTime() {
|
|
||||||
return endingTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Enum getStartingTime() {
|
|
||||||
return startingTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isStarting() {
|
|
||||||
return starting;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Faction getFaction() {
|
|
||||||
return faction;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCurrentMinutes(int currentMinutes) {
|
|
||||||
this.currentMinutes = currentMinutes;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getCurrentMinutes() {
|
|
||||||
return currentMinutes;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEnding(boolean ending) {
|
|
||||||
this.ending = ending;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEndingTime(Enum endingTime) {
|
|
||||||
this.endingTime = endingTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStartingTime(Enum startingTime) {
|
|
||||||
this.startingTime = startingTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFaction(Faction faction) {
|
|
||||||
this.faction = faction;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setInEffect(boolean inEffect) {
|
|
||||||
this.inEffect = inEffect;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStarting(boolean starting) {
|
|
||||||
this.starting = starting;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,47 +0,0 @@
|
|||||||
package com.massivecraft.factions.shield;
|
|
||||||
|
|
||||||
import com.massivecraft.factions.Faction;
|
|
||||||
import com.massivecraft.factions.Factions;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Saser
|
|
||||||
*/
|
|
||||||
public class TimeFrameTask implements Runnable {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
//remove time from the timeFrame
|
|
||||||
|
|
||||||
|
|
||||||
for (Faction faction : Factions.getInstance().getAllFactions()) {
|
|
||||||
if (faction.getTimeFrame() != null) {
|
|
||||||
TimeFrame timeFrame = faction.getTimeFrame();
|
|
||||||
if (timeFrame.isStarting() || timeFrame.isEnding() || timeFrame.isInEffect()) {
|
|
||||||
//either starting, ending, or in effect, so we have to remove 1 minute interval from the currentTime
|
|
||||||
int newTime = Math.subtractExact(timeFrame.getCurrentMinutes(), 1);
|
|
||||||
if (newTime == 0) {
|
|
||||||
//time is done, do functions...
|
|
||||||
if (timeFrame.isStarting() || timeFrame.isInEffect()) {
|
|
||||||
if (timeFrame.isStarting()) {
|
|
||||||
//it was starting, now set to inEffect
|
|
||||||
timeFrame.setStarting(false);
|
|
||||||
timeFrame.setInEffect(true);
|
|
||||||
}
|
|
||||||
//we don't need to check for inEffect because if it is, it'll just set the time back anyways...
|
|
||||||
timeFrame.setCurrentMinutes(720);
|
|
||||||
continue; // continue to the next faction
|
|
||||||
} else if (timeFrame.isEnding()) {
|
|
||||||
//it was ending, now set inEffect to false, basically remove from the faction obj
|
|
||||||
timeFrame.setEnding(false);
|
|
||||||
timeFrame.setInEffect(false);
|
|
||||||
//remove from faction object
|
|
||||||
faction.setTimeFrame(null);
|
|
||||||
continue; // continue to the next faction
|
|
||||||
}
|
|
||||||
}
|
|
||||||
timeFrame.setCurrentMinutes(newTime);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,31 +0,0 @@
|
|||||||
package com.massivecraft.factions.shield;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Saser
|
|
||||||
*/
|
|
||||||
public enum Times {
|
|
||||||
TWELVEAM,
|
|
||||||
ONEAM,
|
|
||||||
TWOAM,
|
|
||||||
THREEAM,
|
|
||||||
FOURAM,
|
|
||||||
FIVEAM,
|
|
||||||
SIXAM,
|
|
||||||
SEVENAM,
|
|
||||||
EIGHTAM,
|
|
||||||
NINEAM,
|
|
||||||
TENAM,
|
|
||||||
ELEVENAM,
|
|
||||||
TWELVEPM,
|
|
||||||
ONEPM,
|
|
||||||
TWOPM,
|
|
||||||
THREEPM,
|
|
||||||
FOURPM,
|
|
||||||
FIVEPM,
|
|
||||||
SIXPM,
|
|
||||||
SEVENPM,
|
|
||||||
EIGHTPM,
|
|
||||||
NINEPM,
|
|
||||||
TENPM,
|
|
||||||
ELEVENPM
|
|
||||||
}
|
|
@ -62,19 +62,12 @@ public class ShopGUIFrame {
|
|||||||
meta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
|
meta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
|
||||||
meta.addEnchant(Enchantment.DURABILITY, 1, true);
|
meta.addEnchant(Enchantment.DURABILITY, 1, true);
|
||||||
}
|
}
|
||||||
if (!glowing) {
|
if (!glowing) meta.removeEnchant(Enchantment.DURABILITY);
|
||||||
meta.removeEnchant(Enchantment.DURABILITY);
|
|
||||||
}
|
|
||||||
|
|
||||||
List<String> replacedLore = lore.stream().map(t -> t.replace("{cost}", cost + "")).collect(Collectors.toList());
|
List<String> replacedLore = lore.stream().map(t -> t.replace("{cost}", cost + "")).collect(Collectors.toList());
|
||||||
|
|
||||||
meta.setLore(FactionsPlugin.instance.colorList(replacedLore));
|
meta.setLore(FactionsPlugin.instance.colorList(replacedLore));
|
||||||
|
|
||||||
item.setItemMeta(meta);
|
item.setItemMeta(meta);
|
||||||
|
|
||||||
GUIItems.set(slot, new GuiItem(item, e -> {
|
GUIItems.set(slot, new GuiItem(item, e -> {
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
|
|
||||||
FPlayer fme = FPlayers.getInstance().getByPlayer((Player) e.getWhoClicked());
|
FPlayer fme = FPlayers.getInstance().getByPlayer((Player) e.getWhoClicked());
|
||||||
if (fplayer.getFaction().getPoints() >= cost) {
|
if (fplayer.getFaction().getPoints() >= cost) {
|
||||||
fplayer.getFaction().setPoints(fplayer.getFaction().getPoints() - cost);
|
fplayer.getFaction().setPoints(fplayer.getFaction().getPoints() - cost);
|
||||||
|
@ -10,7 +10,6 @@ import com.massivecraft.factions.iface.RelationParticipator;
|
|||||||
import com.massivecraft.factions.integration.Econ;
|
import com.massivecraft.factions.integration.Econ;
|
||||||
import com.massivecraft.factions.missions.Mission;
|
import com.massivecraft.factions.missions.Mission;
|
||||||
import com.massivecraft.factions.scoreboards.FTeamWrapper;
|
import com.massivecraft.factions.scoreboards.FTeamWrapper;
|
||||||
import com.massivecraft.factions.shield.TimeFrame;
|
|
||||||
import com.massivecraft.factions.struct.BanInfo;
|
import com.massivecraft.factions.struct.BanInfo;
|
||||||
import com.massivecraft.factions.struct.Permission;
|
import com.massivecraft.factions.struct.Permission;
|
||||||
import com.massivecraft.factions.struct.Relation;
|
import com.massivecraft.factions.struct.Relation;
|
||||||
@ -96,7 +95,6 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
|
|||||||
private String weeWooFormat;
|
private String weeWooFormat;
|
||||||
private String guildId;
|
private String guildId;
|
||||||
private String memberRoleId;
|
private String memberRoleId;
|
||||||
private TimeFrame timeFrame;
|
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
@ -132,7 +130,6 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
|
|||||||
this.notifyFormat = "@everyone, check %type%";
|
this.notifyFormat = "@everyone, check %type%";
|
||||||
this.weeWooFormat = "@everyone, we're being raided! Get online!";
|
this.weeWooFormat = "@everyone, we're being raided! Get online!";
|
||||||
this.memberRoleId = null;
|
this.memberRoleId = null;
|
||||||
this.timeFrame = null;
|
|
||||||
resetPerms(); // Reset on new Faction so it has default values.
|
resetPerms(); // Reset on new Faction so it has default values.
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -165,7 +162,6 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
|
|||||||
this.checks = new ConcurrentHashMap<>();
|
this.checks = new ConcurrentHashMap<>();
|
||||||
this.playerWallCheckCount = new ConcurrentHashMap<>();
|
this.playerWallCheckCount = new ConcurrentHashMap<>();
|
||||||
this.playerBufferCheckCount = new ConcurrentHashMap<>();
|
this.playerBufferCheckCount = new ConcurrentHashMap<>();
|
||||||
this.timeFrame = null;
|
|
||||||
resetPerms(); // Reset on new Faction so it has default values.
|
resetPerms(); // Reset on new Faction so it has default values.
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1433,8 +1429,4 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
|
|||||||
public Set<FLocation> getAllClaims() {
|
public Set<FLocation> getAllClaims() {
|
||||||
return Board.getInstance().getAllClaims(this);
|
return Board.getInstance().getAllClaims(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public TimeFrame getTimeFrame(){ return this.timeFrame; }
|
|
||||||
|
|
||||||
public void setTimeFrame(TimeFrame timeFrame){ this.timeFrame = timeFrame; }
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user