Compare commits
14 Commits
2.2.7-STAB
...
2.2.8-STAB
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ed73baf5f1 | ||
|
|
94d2035c78 | ||
|
|
8ff8c78a44 | ||
|
|
591dc2172f | ||
|
|
1a4c860c46 | ||
|
|
ad56264c5d | ||
|
|
def1a8b15a | ||
|
|
8b577d360b | ||
|
|
f34ebc73fa | ||
|
|
c86db7ab51 | ||
|
|
070f239948 | ||
|
|
018f08699d | ||
|
|
5542245b2a | ||
|
|
6eb204587d |
37
README.md
37
README.md
@@ -1,9 +1,8 @@
|
||||
# SaberFactions
|
||||
|
||||
 [](https://www.codefactor.io/repository/github/driftay/saber-factions)
|
||||
 [](https://www.codefactor.io/repository/github/driftay/saber-factions) [](https://github.com/SaberLLC/Saber-Factions/blob/1.6.x/LICENSE) 
|
||||
|
||||
SaberFactions is a fork of both FactionsUUID and SavageFactions. Creators of those plugins include DtrShock and ProSavage. Credits to them.
|
||||
SaberFactions is the newest, latest and greatest factions plugin designed for the best and most functional factions experience minecraft has seen!
|
||||
SaberFactions is an exotic, performance optmized, and feature rich factions plugin that focuses on not only making the player experience as great as possibly but maintaining this aspect with the cost of NOTHING! We strive to continue development for SaberFactions as the factions community is strongly growing and seeking new players every day.
|
||||
|
||||
## Some Exciting Features
|
||||
Some of our features include the following
|
||||
@@ -14,21 +13,27 @@ Some of our features include the following
|
||||
* More F Upgrades - Unbreakable Redstone Upgrade, Members Upgrade, and Power Upgrade.
|
||||
* Factions Corner - In the corner of a world? No Problem /f corner will claim your entire buffer for you!
|
||||
* Command Cooldowns - Configurable Command Cooldowns for most "spam" commands. And so Much More to Come!
|
||||
* Faction Points - A point based currency that can be used for any aspect of factions gameplay!
|
||||
* Faction Shop - A shop that essentially lets players buy in-game items in exchange for faction points!
|
||||
* Faction Discord Integration - A discord intergrated factions bot for each faction to have their own personalized discord bot within their faction!
|
||||
* Faction Audit - A full based logging system (GUI designed) to see every aspect of what happens in your faction!
|
||||
* Factions Check System - An automated check system that alerts players when to check walls/buffers!
|
||||
* Faction Reserves - A system designed to reserve a specific faction name for a specific player!
|
||||
|
||||
## Dependency With Maven
|
||||
```
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>jitpack.io</id>
|
||||
<url>https://jitpack.io</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>jitpack.io</id>
|
||||
<url>https://jitpack.io</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.Driftay</groupId>
|
||||
<artifactId>Saber-Factions</artifactId>
|
||||
<version>1.4.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.SaberLLC</groupId>
|
||||
<artifactId>Saber-Factions</artifactId>
|
||||
<version>2.2.7-STABLE</version>
|
||||
</dependency>
|
||||
```
|
||||
## Moving Forward
|
||||
|
||||
@@ -36,8 +41,8 @@ Moving forward we plan to take all suggestions into consideration, as they come
|
||||
We Plan on Releasing the latest and greatest factions/skyblock/prison plugins minecraft has to offer and wont settle for anything less
|
||||
|
||||
## Support
|
||||
Our Discord is Currently In Progress of a Massive Overhaul, but we still encourage our community to join and express any concerns/questions/suggestions they may have
|
||||
https://Discord.Saber.pw
|
||||
Have a problem, question, or concer? We encourage our community to join and express any inquiry you may have
|
||||
https://discord.saber.pw
|
||||
|
||||
Look forward to a bright future and a journey with all of you!
|
||||
|
||||
|
||||
2
pom.xml
2
pom.xml
@@ -4,7 +4,7 @@
|
||||
|
||||
<groupId>com.massivecraft</groupId>
|
||||
<artifactId>Factions</artifactId>
|
||||
<version>1.6.9.5-2.2.7-RC</version>
|
||||
<version>1.6.9.5-2.2.8-RC</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>SaberFactions</name>
|
||||
|
||||
@@ -78,6 +78,7 @@ public class FactionsPlugin extends MPlugin {
|
||||
public boolean mc112 = false;
|
||||
public boolean mc113 = false;
|
||||
public boolean mc114 = false;
|
||||
public boolean mc115 = false;
|
||||
public boolean useNonPacketParticles = false;
|
||||
public boolean factionsFlight = false;
|
||||
SkriptAddon skriptAddon;
|
||||
@@ -164,6 +165,10 @@ public class FactionsPlugin extends MPlugin {
|
||||
FactionsPlugin.instance.log("Minecraft Version 1.14 found.");
|
||||
mc114 = true;
|
||||
break;
|
||||
case 15:
|
||||
FactionsPlugin.instance.log("Minecraft Version 1.15 found.");
|
||||
mc115 = true;
|
||||
break;
|
||||
}
|
||||
migrateFPlayerLeaders();
|
||||
log("==== End Setup ====");
|
||||
@@ -464,7 +469,7 @@ public class FactionsPlugin extends MPlugin {
|
||||
}
|
||||
|
||||
public ItemStack createItem(Material material, int amount, short datavalue, String name, List<String> lore) {
|
||||
ItemStack item = new ItemStack(XMaterial.matchXMaterial(material.toString()).parseMaterial(), amount, datavalue);
|
||||
ItemStack item = new ItemStack(XMaterial.matchXMaterial(material.toString()).get().parseMaterial(), amount, datavalue);
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.setDisplayName(color(name));
|
||||
meta.setLore(colorList(lore));
|
||||
|
||||
@@ -72,13 +72,14 @@ public class CmdDisband extends FCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
boolean access = false;
|
||||
if (context.fPlayer.getPlayer().hasMetadata("disband_confirm") && (time = context.fPlayer.getPlayer().getMetadata("disband_confirm").get(0).asLong()) != 0L && System.currentTimeMillis() - time <= TimeUnit.SECONDS.toMillis(3L)) {
|
||||
access = true;
|
||||
}
|
||||
|
||||
if (!access) {
|
||||
if(Conf.useDisbandGUI) {
|
||||
if(Conf.useDisbandGUI && !context.fPlayer.isAdminBypassing() || !context.player.isOp()) {
|
||||
if (!disbandMap.containsKey(context.player.getUniqueId().toString())) {
|
||||
new FDisbandFrame(context.faction).buildGUI(context.fPlayer);
|
||||
return;
|
||||
|
||||
@@ -9,7 +9,6 @@ import com.massivecraft.factions.zcore.fperms.Access;
|
||||
import com.massivecraft.factions.zcore.fperms.PermissableAction;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -103,7 +102,7 @@ public class CmdFly extends FCommand {
|
||||
if (toFac.getAccess(fme, PermissableAction.FLY) == Access.ALLOW) return true;
|
||||
if (fme.getFaction().isWilderness()) return false;
|
||||
if (toFac.isSystemFaction())
|
||||
return me.hasPermission(Permission.valueOf("FLY_" + ChatColor.stripColor(toFac.getTag()).toUpperCase()).node);
|
||||
return me.hasPermission(toFac.isWilderness() ? Permission.FLY_WILDERNESS.node : toFac.isSafeZone() ? Permission.FLY_SAFEZONE.node : Permission.FLY_WARZONE.node);
|
||||
Relation relationTo = toFac.getRelationTo(fme.getFaction());
|
||||
if (!relationTo.isEnemy() && !relationTo.isMember())
|
||||
return me.hasPermission(Permission.valueOf("FLY_" + relationTo.name()).node);
|
||||
|
||||
@@ -74,7 +74,9 @@ public class CmdSeeChunk extends FCommand {
|
||||
for (Object nameObject : seeChunkMap.keySet()) {
|
||||
String name = nameObject + "";
|
||||
Player player = Bukkit.getPlayer(name);
|
||||
showBorders(player);
|
||||
if (player != null) {
|
||||
showBorders(player);
|
||||
}
|
||||
}
|
||||
manageTask();
|
||||
}, 0, interval);
|
||||
@@ -110,24 +112,19 @@ public class CmdSeeChunk extends FCommand {
|
||||
private void showPillar(Player player, World world, int blockX, int blockZ) {
|
||||
for (int blockY = 0; blockY < player.getLocation().getBlockY() + 30; blockY++) {
|
||||
Location loc = new Location(world, blockX, blockY, blockZ).add(0.5, 0, 0.5);
|
||||
if (loc.getBlock().getType() != Material.AIR) {
|
||||
continue;
|
||||
}
|
||||
if (loc.getBlock().getType() != Material.AIR) continue;
|
||||
if (useParticles) {
|
||||
if (FactionsPlugin.getInstance().useNonPacketParticles) {
|
||||
// Dust options only exists in the 1.13 API, so we use an
|
||||
// alternative method to achieve this in lower versions.
|
||||
if (FactionsPlugin.getInstance().mc113 || FactionsPlugin.getInstance().mc114) {
|
||||
if (FactionsPlugin.getInstance().mc113 || FactionsPlugin.getInstance().mc114 || FactionsPlugin.getInstance().mc115) {
|
||||
player.spawnParticle(Particle.REDSTONE, loc, 0, new Particle.DustOptions(Color.RED, 1));
|
||||
} else {
|
||||
player.getWorld().spawnParticle(Particle.REDSTONE, loc, 0, 255, 0, 0, 1);
|
||||
}
|
||||
|
||||
} else {
|
||||
this.effect.display(0, 0, 0, 0, 1, loc, player);
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
Material type = blockY % 5 == 0 ? XMaterial.REDSTONE_LAMP.parseMaterial() : XMaterial.BLACK_STAINED_GLASS.parseMaterial();
|
||||
VisualizeUtil.addLocation(player, loc, type);
|
||||
|
||||
@@ -62,7 +62,7 @@ public enum FLogType {
|
||||
}
|
||||
|
||||
public Material getMaterial() {
|
||||
return XMaterial.matchXMaterial(FactionsPlugin.getInstance().getConfig().getString("faudit-gui.materials." + name().toLowerCase())).parseMaterial();
|
||||
return XMaterial.matchXMaterial(FactionsPlugin.getInstance().getConfig().getString("faudit-gui.materials." + name().toLowerCase())).get().parseMaterial();
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
|
||||
@@ -52,19 +52,19 @@ public class CheckSettingsFrame implements InventoryHolder, FactionGUI {
|
||||
|
||||
public void build() {
|
||||
Faction faction = fPlayer.getFaction();
|
||||
ItemStack wallsStack = XMaterial.matchXMaterial(FactionsPlugin.getInstance().getConfig().getString("f-check.wall-check.Type")).parseItem();
|
||||
ItemStack wallsStack = XMaterial.matchXMaterial(FactionsPlugin.getInstance().getConfig().getString("f-check.wall-check.Type")).get().parseItem();
|
||||
ItemMeta wallsMeta = wallsStack.getItemMeta();
|
||||
wallsMeta.setDisplayName(TL.CHECK_WALL_CHECK_GUI_ICON.toString());
|
||||
wallsMeta.setLore(Collections.singletonList(TL.CHECK_CHECK_LORE_LINE.format(getFormatted(faction.getWallCheckMinutes()))));
|
||||
wallsStack.setItemMeta(wallsMeta);
|
||||
inventory.setItem(FactionsPlugin.getInstance().getConfig().getInt("f-check.wall-check.slot"), wallsStack);
|
||||
ItemStack bufferStack = XMaterial.matchXMaterial(FactionsPlugin.getInstance().getConfig().getString("f-check.buffer-check.Type")).parseItem();
|
||||
ItemStack bufferStack = XMaterial.matchXMaterial(FactionsPlugin.getInstance().getConfig().getString("f-check.buffer-check.Type")).get().parseItem();
|
||||
ItemMeta bufferMeta = bufferStack.getItemMeta();
|
||||
bufferMeta.setDisplayName(TL.CHECK_BUFFER_CHECK_GUI_ICON.toString());
|
||||
bufferMeta.setLore(Collections.singletonList(TL.CHECK_CHECK_LORE_LINE.format(getFormatted(faction.getBufferCheckMinutes()))));
|
||||
bufferStack.setItemMeta(bufferMeta);
|
||||
inventory.setItem(FactionsPlugin.getInstance().getConfig().getInt("f-check.buffer-check.slot"), bufferStack);
|
||||
ItemStack historyStack = XMaterial.matchXMaterial(FactionsPlugin.getInstance().getConfig().getString("f-check.history.Type")).parseItem();
|
||||
ItemStack historyStack = XMaterial.matchXMaterial(FactionsPlugin.getInstance().getConfig().getString("f-check.history.Type")).get().parseItem();
|
||||
ItemMeta historyMeta = historyStack.getItemMeta();
|
||||
historyMeta.setDisplayName(TL.CHECK_HISTORY_GUI_ICON.toString());
|
||||
historyStack.setItemMeta(historyMeta);
|
||||
|
||||
@@ -26,7 +26,7 @@ public class CmdTntFill extends FCommand {
|
||||
|
||||
public CmdTntFill() {
|
||||
super();
|
||||
this.aliases.add("tntfill");
|
||||
this.aliases.addAll(Aliases.tnt_tntfill);
|
||||
|
||||
this.requiredArgs.add("radius");
|
||||
this.requiredArgs.add("amount");
|
||||
|
||||
@@ -46,7 +46,7 @@ public class WildGUI implements FactionGUI {
|
||||
@Override
|
||||
public void build() {
|
||||
inv = Bukkit.createInventory(this, FactionsPlugin.getInstance().getConfig().getInt("Wild.GUI.Size"), FactionsPlugin.getInstance().color(FactionsPlugin.getInstance().getConfig().getString("Wild.GUI.Name")));
|
||||
ItemStack fillItem = XMaterial.matchXMaterial(FactionsPlugin.getInstance().getConfig().getString("Wild.GUI.FillMaterial")).parseItem();
|
||||
ItemStack fillItem = XMaterial.matchXMaterial(FactionsPlugin.getInstance().getConfig().getString("Wild.GUI.FillMaterial")).get().parseItem();
|
||||
ItemMeta meta = fillItem.getItemMeta();
|
||||
if (meta == null) return;
|
||||
meta.setDisplayName("");
|
||||
@@ -55,7 +55,7 @@ public class WildGUI implements FactionGUI {
|
||||
inv.setItem(fill, fillItem);
|
||||
}
|
||||
for (String key : Objects.requireNonNull(FactionsPlugin.getInstance().getConfig().getConfigurationSection("Wild.Zones")).getKeys(false)) {
|
||||
ItemStack zoneItem = XMaterial.matchXMaterial(FactionsPlugin.getInstance().getConfig().getString("Wild.Zones." + key + ".Material")).parseItem();
|
||||
ItemStack zoneItem = XMaterial.matchXMaterial(FactionsPlugin.getInstance().getConfig().getString("Wild.Zones." + key + ".Material")).get().parseItem();
|
||||
ItemMeta zoneMeta = zoneItem.getItemMeta();
|
||||
if (zoneMeta == null) return;
|
||||
List<String> lore = new ArrayList<>();
|
||||
|
||||
@@ -40,6 +40,7 @@ import org.bukkit.potion.PotionEffectType;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
@@ -377,7 +378,7 @@ public class FactionsBlockListener implements Listener {
|
||||
int radius = FactionsPlugin.getInstance().getConfig().getInt("fbanners.Banner-Effect-Radius");
|
||||
List<String> effects = FactionsPlugin.getInstance().getConfig().getStringList("fbanners.Effects");
|
||||
int affectorTask = Bukkit.getScheduler().scheduleSyncRepeatingTask(FactionsPlugin.getInstance(), () -> {
|
||||
for (Entity e1 : banner.getLocation().getWorld().getNearbyEntities(banner.getLocation(), radius, 255.0, radius)) {
|
||||
for (Entity e1 : Objects.requireNonNull(banner.getLocation().getWorld()).getNearbyEntities(banner.getLocation(), radius, 255.0, radius)) {
|
||||
if (e1 instanceof Player) {
|
||||
Player player = (Player) e1;
|
||||
FPlayer fplayer = FPlayers.getInstance().getByPlayer(player);
|
||||
@@ -386,7 +387,7 @@ public class FactionsBlockListener implements Listener {
|
||||
}
|
||||
for (String effect : effects) {
|
||||
String[] components = effect.split(":");
|
||||
player.addPotionEffect(new PotionEffect(PotionEffectType.getByName(components[0]), 100, Integer.parseInt(components[1])));
|
||||
player.addPotionEffect(new PotionEffect(Objects.requireNonNull(PotionEffectType.getByName(components[0])), 100, Integer.parseInt(components[1])));
|
||||
}
|
||||
ParticleEffect.LAVA.display(1.0f, 1.0f, 1.0f, 1.0f, 10, banner.getLocation(), 16.0);
|
||||
ParticleEffect.FLAME.display(1.0f, 1.0f, 1.0f, 1.0f, 10, banner.getLocation(), 16.0);
|
||||
@@ -499,7 +500,7 @@ public class FactionsBlockListener implements Listener {
|
||||
return;
|
||||
}
|
||||
if (block != null && isSpawner) {
|
||||
ItemStack item = new ItemStack(block.getType(), 1, (short) block.getData());
|
||||
ItemStack item = new ItemStack(block.getType(), 1, block.getData());
|
||||
if (at != null && at.isNormal()) {
|
||||
FPlayer fplayer = FPlayers.getInstance().getByPlayer(event.getPlayer());
|
||||
if (fplayer != null) {
|
||||
|
||||
@@ -338,7 +338,7 @@ public class FactionsPlayerListener implements Listener {
|
||||
return PermissableAction.DOOR;
|
||||
if (material.name().toUpperCase().contains("BUTTON") || material.name().toUpperCase().contains("PRESSURE") || material.name().contains("DIODE") || material.name().contains("COMPARATOR"))
|
||||
return PermissableAction.BUTTON;
|
||||
if (FactionsPlugin.instance.mc113 || FactionsPlugin.instance.mc114) {
|
||||
if (FactionsPlugin.instance.mc113 || FactionsPlugin.instance.mc114 || FactionsPlugin.getInstance().mc115) {
|
||||
switch (material) {
|
||||
case LEVER:
|
||||
return PermissableAction.LEVER;
|
||||
@@ -381,6 +381,8 @@ public class FactionsPlayerListener implements Listener {
|
||||
case TRAPPED_CHEST:
|
||||
case CHEST_MINECART:
|
||||
|
||||
case BARREL:
|
||||
|
||||
case SHULKER_BOX:
|
||||
case BLACK_SHULKER_BOX:
|
||||
case BLUE_SHULKER_BOX:
|
||||
@@ -819,7 +821,7 @@ public class FactionsPlayerListener implements Listener {
|
||||
Material type;
|
||||
if (event.getItem() != null) {
|
||||
// Convert 1.8 Material Names -> 1.14
|
||||
type = XMaterial.matchXMaterial(event.getItem().getType().toString()).parseMaterial();
|
||||
type = XMaterial.matchXMaterial(event.getItem().getType().toString()).get().parseMaterial();
|
||||
} else {
|
||||
type = null;
|
||||
}
|
||||
@@ -918,6 +920,8 @@ public class FactionsPlayerListener implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void onLogoutMove(PlayerMoveEvent e) {
|
||||
LogoutHandler handler = LogoutHandler.getByName(e.getPlayer().getName());
|
||||
@@ -925,6 +929,12 @@ public class FactionsPlayerListener implements Listener {
|
||||
handler.cancelLogout(e.getPlayer());
|
||||
e.getPlayer().sendMessage(String.valueOf(TL.COMMAND_LOGOUT_MOVED));
|
||||
}
|
||||
|
||||
if (e.getTo().getBlockX() == e.getFrom().getBlockX() &&
|
||||
e.getTo().getBlockY() == e.getFrom().getBlockY() &&
|
||||
e.getTo().getBlockZ() == e.getFrom().getBlockZ())
|
||||
return;
|
||||
|
||||
if (CmdWild.waitingTeleport.containsKey(e.getPlayer())) {
|
||||
CmdWild.waitingTeleport.remove(e.getPlayer());
|
||||
FPlayers.getInstance().getByPlayer(e.getPlayer()).msg(TL.COMMAND_WILD_INTERUPTED);
|
||||
@@ -1060,13 +1070,13 @@ public class FactionsPlayerListener implements Listener {
|
||||
}
|
||||
FPlayer fp = FPlayers.getInstance().getByPlayer(e.getPlayer());
|
||||
|
||||
if(fp == null) return;
|
||||
if (fp == null) return;
|
||||
|
||||
if (fp.getChatMode() != ChatMode.FACTION) {
|
||||
return;
|
||||
}
|
||||
Faction f = fp.getFaction();
|
||||
if(f == null) return;
|
||||
if (f == null) return;
|
||||
if (f.isSystemFaction()) {
|
||||
return;
|
||||
}
|
||||
@@ -1085,7 +1095,7 @@ public class FactionsPlayerListener implements Listener {
|
||||
}
|
||||
} else {
|
||||
for (Member m : t.getMembers()) {
|
||||
if (m.getEffectiveName().contains(target) | m.getUser().getName().contains(target)){
|
||||
if (m.getEffectiveName().contains(target) | m.getUser().getName().contains(target)) {
|
||||
targets.add("@" + m.getUser().getName() + "#" + m.getUser().getDiscriminator());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ public class MissionGUI implements FactionGUI {
|
||||
if (configurationSection == null) {
|
||||
return;
|
||||
}
|
||||
ItemStack fillItem = XMaterial.matchXMaterial(configurationSection.getString("FillItem.Material")).parseItem();
|
||||
ItemStack fillItem = XMaterial.matchXMaterial(configurationSection.getString("FillItem.Material")).get().parseItem();
|
||||
ItemMeta fillmeta = fillItem.getItemMeta();
|
||||
fillmeta.setDisplayName("");
|
||||
fillItem.setItemMeta(fillmeta);
|
||||
@@ -109,7 +109,7 @@ public class MissionGUI implements FactionGUI {
|
||||
ConfigurationSection section = configurationSection.getConfigurationSection(key);
|
||||
int slot = section.getInt("Slot");
|
||||
|
||||
ItemStack itemStack = XMaterial.matchXMaterial(section.getString("Material")).parseItem();
|
||||
ItemStack itemStack = XMaterial.matchXMaterial(section.getString("Material")).get().parseItem();
|
||||
ItemMeta itemMeta = itemStack.getItemMeta();
|
||||
itemMeta.setDisplayName(ChatColor.translateAlternateColorCodes('&', section.getString("Name")));
|
||||
List<String> loreLines = new ArrayList<>();
|
||||
@@ -134,7 +134,7 @@ public class MissionGUI implements FactionGUI {
|
||||
if (plugin.getConfig().getBoolean("Randomization.Enabled")) {
|
||||
ItemStack start;
|
||||
ItemMeta meta;
|
||||
start = XMaterial.matchXMaterial(plugin.getConfig().getString("Randomization.Start-Item.Allowed.Material")).parseItem();
|
||||
start = XMaterial.matchXMaterial(plugin.getConfig().getString("Randomization.Start-Item.Allowed.Material")).get().parseItem();
|
||||
meta = start.getItemMeta();
|
||||
meta.setDisplayName(plugin.color(plugin.getConfig().getString("Randomization.Start-Item.Allowed.Name")));
|
||||
List<String> loree = new ArrayList<>();
|
||||
@@ -144,7 +144,7 @@ public class MissionGUI implements FactionGUI {
|
||||
meta.setLore(loree);
|
||||
start.setItemMeta(meta);
|
||||
if (fPlayer.getFaction().getCompletedMissions().size() >= configurationSection.getKeys(false).size() - 1 && plugin.getConfig().getBoolean("DenyMissionsMoreThenOnce")) {
|
||||
start = XMaterial.matchXMaterial(plugin.getConfig().getString("Randomization.Start-Item.Disallowed.Material")).parseItem();
|
||||
start = XMaterial.matchXMaterial(plugin.getConfig().getString("Randomization.Start-Item.Disallowed.Material")).get().parseItem();
|
||||
meta = start.getItemMeta();
|
||||
meta.setDisplayName(plugin.color(plugin.getConfig().getString("Randomization.Start-Item.Disallowed.Name")));
|
||||
List<String> lore = new ArrayList<>();
|
||||
@@ -155,7 +155,7 @@ public class MissionGUI implements FactionGUI {
|
||||
start.setItemMeta(meta);
|
||||
}
|
||||
if (fPlayer.getFaction().getMissions().size() >= plugin.getConfig().getInt("MaximumMissionsAllowedAtOnce")) {
|
||||
start = XMaterial.matchXMaterial(plugin.getConfig().getString("Randomization.Start-Item.Disallowed.Material")).parseItem();
|
||||
start = XMaterial.matchXMaterial(plugin.getConfig().getString("Randomization.Start-Item.Disallowed.Material")).get().parseItem();
|
||||
meta = start.getItemMeta();
|
||||
meta.setDisplayName(plugin.color(plugin.getConfig().getString("Randomization.Start-Item.Disallowed.Name")));
|
||||
List<String> lore = new ArrayList<>();
|
||||
|
||||
@@ -47,7 +47,7 @@ public class ShopGUIFrame {
|
||||
for (int a = 1; a <= items; a++) {
|
||||
String s = a + "";
|
||||
int slot = ShopConfig.getShop().getInt("items." + s + ".slot");
|
||||
Material material = XMaterial.matchXMaterial(ShopConfig.getShop().getString("items." + s + ".block")).parseMaterial();
|
||||
Material material = XMaterial.matchXMaterial(ShopConfig.getShop().getString("items." + s + ".block")).get().parseMaterial();
|
||||
int cost = ShopConfig.getShop().getInt("items." + s + ".cost");
|
||||
String name = ShopConfig.getShop().getString("items." + s + ".name");
|
||||
boolean glowing = ShopConfig.getShop().getBoolean("items." + s + ".glowing");
|
||||
@@ -93,7 +93,7 @@ public class ShopGUIFrame {
|
||||
|
||||
private ItemStack buildDummyItem(Faction f) {
|
||||
ConfigurationSection config = FactionsPlugin.getInstance().getConfig().getConfigurationSection("F-Shop.GUI.dummy-item");
|
||||
ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).parseItem();
|
||||
ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).get().parseItem();
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
if (meta != null) {
|
||||
meta.setLore(FactionsPlugin.getInstance().colorList(config.getStringList("Lore")));
|
||||
|
||||
@@ -210,7 +210,7 @@ public enum Relation implements Permissable {
|
||||
String displayName = replacePlaceholders(RELATION_CONFIG.getString("placeholder-item.name", ""));
|
||||
List<String> lore = new ArrayList<>();
|
||||
|
||||
Material material = XMaterial.matchXMaterial(RELATION_CONFIG.getString("materials." + name().toLowerCase())).parseMaterial();
|
||||
Material material = XMaterial.matchXMaterial(RELATION_CONFIG.getString("materials." + name().toLowerCase())).get().parseMaterial();
|
||||
if (material == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ public enum Role implements Permissable {
|
||||
String displayName = replacePlaceholders(RELATION_CONFIG.getString("placeholder-item.name", ""));
|
||||
List<String> lore = new ArrayList<>();
|
||||
|
||||
Material material = XMaterial.matchXMaterial(RELATION_CONFIG.getString("materials." + name().toLowerCase(), "STAINED_CLAY")).parseMaterial();
|
||||
Material material = XMaterial.matchXMaterial(RELATION_CONFIG.getString("materials." + name().toLowerCase(), "STAINED_CLAY")).get().parseMaterial();
|
||||
if (material == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ public class FactionWarpsFrame {
|
||||
|
||||
private ItemStack buildWarpAsset(final Map.Entry<String, LazyLocation> warp, final Faction faction) {
|
||||
final ConfigurationSection config = this.section.getConfigurationSection("warp-item");
|
||||
final ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).parseItem();
|
||||
final ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).get().parseItem();
|
||||
final ItemMeta meta = item.getItemMeta();
|
||||
meta.setLore(FactionsPlugin.getInstance().colorList(FactionsPlugin.getInstance().replacePlaceholders(config.getStringList("Lore"), new Placeholder("{warp-protected}", faction.hasWarpPassword(warp.getKey()) ? "Enabled" : "Disabled"), new Placeholder("{warp-cost}", FactionsPlugin.getInstance().getConfig().getBoolean("warp-cost.enabled", false) ? Integer.toString(FactionsPlugin.getInstance().getConfig().getInt("warp-cost.warp", 5)) : "Disabled"))));
|
||||
meta.setDisplayName(FactionsPlugin.getInstance().color(config.getString("Name").replace("{warp}", warp.getKey())));
|
||||
@@ -82,7 +82,7 @@ public class FactionWarpsFrame {
|
||||
|
||||
private ItemStack buildDummyItem() {
|
||||
final ConfigurationSection config = this.section.getConfigurationSection("dummy-item");
|
||||
final ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).parseItem();
|
||||
final ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).get().parseItem();
|
||||
final ItemMeta meta = item.getItemMeta();
|
||||
meta.setLore(FactionsPlugin.getInstance().colorList(config.getStringList("Lore")));
|
||||
meta.setDisplayName(FactionsPlugin.getInstance().color(config.getString("Name")));
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -61,7 +61,7 @@ public class FDisbandFrame {
|
||||
|
||||
private ItemStack buildConfirmDummyItem(Faction faction) {
|
||||
ConfigurationSection config = FactionsPlugin.getInstance().getConfig().getConfigurationSection("f-disband-gui.confirm-item");
|
||||
ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).parseItem();
|
||||
ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).get().parseItem();
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
if (meta != null) {
|
||||
List<String> lore = new ArrayList<>();
|
||||
@@ -77,7 +77,7 @@ public class FDisbandFrame {
|
||||
|
||||
private ItemStack buildDenyDummyItem() {
|
||||
ConfigurationSection config = FactionsPlugin.getInstance().getConfig().getConfigurationSection("f-disband-gui.deny-item");
|
||||
ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).parseItem();
|
||||
ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).get().parseItem();
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
if (meta != null) {
|
||||
meta.setLore(FactionsPlugin.getInstance().colorList(config.getStringList("Lore")));
|
||||
|
||||
@@ -104,7 +104,7 @@ public enum PermissableAction {
|
||||
|
||||
public ItemStack buildAsset(FPlayer fme, Permissable perm) {
|
||||
ConfigurationSection section = FactionsPlugin.getInstance().getConfig().getConfigurationSection("fperm-gui.action");
|
||||
ItemStack item = XMaterial.matchXMaterial(section.getString("Materials." + this.name)).parseItem();
|
||||
ItemStack item = XMaterial.matchXMaterial(section.getString("Materials." + this.name)).get().parseItem();
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
|
||||
meta.setDisplayName(FactionsPlugin.getInstance().color(section.getString("placeholder-item.name").replace("{action}", this.name)));
|
||||
|
||||
@@ -91,7 +91,7 @@ public class PermissableActionFrame {
|
||||
|
||||
private ItemStack buildDummyItem() {
|
||||
ConfigurationSection config = FactionsPlugin.getInstance().getConfig().getConfigurationSection("fperm-gui.dummy-item");
|
||||
ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).parseItem();
|
||||
ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).get().parseItem();
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.setLore(FactionsPlugin.getInstance().colorList(config.getStringList("Lore")));
|
||||
meta.setDisplayName(FactionsPlugin.getInstance().color(config.getString("Name")));
|
||||
@@ -101,7 +101,7 @@ public class PermissableActionFrame {
|
||||
|
||||
private ItemStack buildBackItem() {
|
||||
ConfigurationSection config = FactionsPlugin.getInstance().getConfig().getConfigurationSection("fperm-gui.back-item");
|
||||
ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).parseItem();
|
||||
ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).get().parseItem();
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.setLore(FactionsPlugin.getInstance().colorList(config.getStringList("Lore")));
|
||||
meta.setDisplayName(FactionsPlugin.getInstance().color(config.getString("Name")));
|
||||
|
||||
@@ -56,7 +56,7 @@ public class PermissableRelationFrame {
|
||||
}
|
||||
|
||||
private ItemStack buildAsset(String loc, String relation) {
|
||||
ItemStack item = XMaterial.matchXMaterial(FactionsPlugin.getInstance().getConfig().getString(loc)).parseItem();
|
||||
ItemStack item = XMaterial.matchXMaterial(FactionsPlugin.getInstance().getConfig().getString(loc)).get().parseItem();
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.setDisplayName(FactionsPlugin.getInstance().color(FactionsPlugin.getInstance().getConfig().getString("fperm-gui.relation.Placeholder-Item.Name").replace("{relation}", relation)));
|
||||
item.setItemMeta(meta);
|
||||
@@ -65,7 +65,7 @@ public class PermissableRelationFrame {
|
||||
|
||||
private ItemStack buildDummyItem() {
|
||||
ConfigurationSection config = FactionsPlugin.getInstance().getConfig().getConfigurationSection("fperm-gui.dummy-item");
|
||||
ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).parseItem();
|
||||
ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).get().parseItem();
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.setLore(FactionsPlugin.getInstance().colorList(config.getStringList("Lore")));
|
||||
meta.setDisplayName(FactionsPlugin.getInstance().color(config.getString("Name")));
|
||||
|
||||
@@ -25,7 +25,7 @@ public class FUpgradeFrame {
|
||||
|
||||
public FUpgradeFrame(Faction f) {
|
||||
this.gui = new Gui(FactionsPlugin.getInstance(),
|
||||
FactionsPlugin.getInstance().getConfig().getInt("fupgrades.MainMenu.rows", 5),
|
||||
FactionsPlugin.getInstance().getConfig().getInt("fupgrades.MainMenu.Rows", 5),
|
||||
FactionsPlugin.getInstance().getConfig().getString("fupgrades.MainMenu.Title").replace("{faction}", f.getTag()));
|
||||
}
|
||||
|
||||
@@ -95,13 +95,13 @@ public class FUpgradeFrame {
|
||||
private void updateFactionPowerBoost(Faction f) {
|
||||
double boost = FactionsPlugin.getInstance().getConfig().getDouble("fupgrades.MainMenu.Power.Power-Boost.level-" + (f.getUpgrade(UpgradeType.POWER) + 1));
|
||||
if (boost < 0.0) return;
|
||||
f.setPowerBoost(f.getPower() + boost);
|
||||
f.setPowerBoost(boost);
|
||||
}
|
||||
|
||||
|
||||
private ItemStack buildDummyItem() {
|
||||
ConfigurationSection config = FactionsPlugin.getInstance().getConfig().getConfigurationSection("fupgrades.MainMenu.DummyItem");
|
||||
ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).parseItem();
|
||||
ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).get().parseItem();
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
if (meta != null) {
|
||||
meta.setLore(FactionsPlugin.getInstance().colorList(config.getStringList("Lore")));
|
||||
|
||||
@@ -58,7 +58,7 @@ public enum UpgradeType {
|
||||
|
||||
public ItemStack buildAsset(Faction f) {
|
||||
ConfigurationSection config = FactionsPlugin.getInstance().getConfig().getConfigurationSection("fupgrades.MainMenu." + this.id + ".DisplayItem");
|
||||
ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).parseItem();
|
||||
ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).get().parseItem();
|
||||
int level = f.getUpgrade(this);
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
if (meta != null) {
|
||||
|
||||
Reference in New Issue
Block a user