1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-26 04:25:15 +01:00
This commit is contained in:
Zrips 2018-10-14 17:04:49 +03:00
commit aa84bde32d
7 changed files with 25 additions and 27 deletions

View File

@ -66,14 +66,14 @@ public class ActionBarTitleMessages {
}
}
public static void send(CommandSender receivingPacket, String msg) {
public void send(CommandSender receivingPacket, String msg) {
if (receivingPacket instanceof Player)
send((Player) receivingPacket, msg);
else
receivingPacket.sendMessage(msg);
}
public static void send(Player receivingPacket, String msg) {
public void send(Player receivingPacket, String msg) {
if (receivingPacket == null)
return;
if (!receivingPacket.isOnline())
@ -116,6 +116,7 @@ public class ActionBarTitleMessages {
public static void sendTitle(final Player receivingPacket, final Object title, final Object subtitle, final int fadeIn, final int keep, final int fadeOut) {
Bukkit.getScheduler().runTaskAsynchronously(Jobs.getInstance(), new Runnable() {
@SuppressWarnings("deprecation")
@Override
public void run() {

View File

@ -138,7 +138,7 @@ public enum CMIChatColor {
}
public static CMIChatColor getRandomColor() {
List<CMIChatColor> ls = new ArrayList<CMIChatColor>();
List<CMIChatColor> ls = new ArrayList<>();
for (CMIChatColor one : CMIChatColor.values()) {
if (!one.isColor())
continue;

View File

@ -22,22 +22,22 @@ import com.gamingmesh.jobs.CMILib.VersionChecker.Version;
public class RawMessage {
List<String> parts = new ArrayList<String>();
List<String> cleanParts = new ArrayList<String>();
String colorReplacerPlaceholder = "%#%";
private List<String> parts = new ArrayList<>();
private List<String> cleanParts = new ArrayList<>();
private String colorReplacerPlaceholder = "%#%";
private String unfinished = "";
private String unfinishedClean = "";
private String combined = "";
String combinedClean = "";
private String combinedClean = "";
private boolean breakLine = true;
// private boolean colorizeEntireWithLast = true;
public void clear() {
parts = new ArrayList<String>();
cleanParts = new ArrayList<String>();
parts = new ArrayList<>();
cleanParts = new ArrayList<>();
combined = "";
combinedClean = "";
}
@ -71,17 +71,17 @@ public class RawMessage {
return add(text, hoverText, command, suggestion, null);
}
Set<CMIChatColor> formats = new HashSet<CMIChatColor>();
CMIChatColor lastColor = null;
private Set<CMIChatColor> formats = new HashSet<>();
private CMIChatColor lastColor = null;
Set<CMIChatColor> savedFormats = new HashSet<CMIChatColor>();
CMIChatColor savedLastColor = null;
private Set<CMIChatColor> savedFormats = new HashSet<>();
private CMIChatColor savedLastColor = null;
CMIChatColor firstBlockColor = null;
private CMIChatColor firstBlockColor = null;
private String makeMessyText(String text) {
text = CMIChatColor.deColorize(text);
List<String> splited = new ArrayList<String>();
List<String> splited = new ArrayList<>();
if (text.contains(" ")) {
for (String one : text.split(" ")) {
@ -348,7 +348,7 @@ public class RawMessage {
}
}
List<String> Lore = new ArrayList<String>();
List<String> Lore = new ArrayList<>();
// if (CMIMaterial.isShulkerBox(item.getType())) {
// List<ItemStack> items = CMI.getInstance().getShulkerBoxManager().getShulkerBoxContents(item);
@ -437,7 +437,7 @@ public class RawMessage {
}
public List<String> softCombine() {
List<String> ls = new ArrayList<String>();
List<String> ls = new ArrayList<>();
String f = "";
for (String part : parts) {
if (f.isEmpty())

View File

@ -14,7 +14,7 @@ import org.bukkit.entity.Player;
import com.gamingmesh.jobs.Jobs;
public class VersionChecker {
Jobs plugin;
private Jobs plugin;
private static int resource = 4216;
public VersionChecker(Jobs plugin) {
@ -182,7 +182,7 @@ public class VersionChecker {
if (version.length() <= 7)
return version;
} catch (Exception ex) {
Bukkit.getConsoleSender().sendMessage(ChatColor.RED + "Failed to check for " + plugin.getDescription().getName() + " update on spigot web page.");
Jobs.consoleMsg("&cFailed to check for " + plugin.getDescription().getName() + " update on spigot web page.");
}
return null;
}

View File

@ -20,7 +20,6 @@ import com.gamingmesh.jobs.container.CurrencyType;
import com.gamingmesh.jobs.container.Job;
import com.gamingmesh.jobs.container.JobInfo;
import com.gamingmesh.jobs.stuff.ChatColor;
import com.gamingmesh.jobs.stuff.Debug;
import com.gamingmesh.jobs.stuff.PageInfo;
import com.gamingmesh.jobs.CMILib.RawMessage;
import com.gamingmesh.jobs.stuff.Util;

View File

@ -31,7 +31,6 @@ import org.bukkit.entity.Player;
import com.gamingmesh.jobs.Jobs;
import com.gamingmesh.jobs.api.JobsPaymentEvent;
import com.gamingmesh.jobs.container.JobsPlayer;
import com.gamingmesh.jobs.CMILib.ActionBarTitleMessages;
import com.gamingmesh.jobs.CMILib.VersionChecker.Version;
import com.gamingmesh.jobs.tasks.BufferedPaymentTask;
@ -148,7 +147,7 @@ public class BufferedEconomy {
Jobs.getActionbarToggleList().put(ServerTaxesAccountname, true);
if (Jobs.getActionbarToggleList().containsKey(ServerTaxesAccountname) && Jobs.getActionbarToggleList().get(ServerTaxesAccountname)) {
Jobs.getActionBar();
ActionBarTitleMessages.send(Bukkit.getPlayer(ServerAccountname), Jobs.getLanguage().getMessage("message.taxes", "[amount]", (int) (TotalAmount * 100)
Jobs.getActionBar().send(Bukkit.getPlayer(ServerAccountname), Jobs.getLanguage().getMessage("message.taxes", "[amount]", (int) (TotalAmount * 100)
/ 100.0));
}
}
@ -182,7 +181,7 @@ public class BufferedEconomy {
if (Jobs.getGCManager().UseServerAccount) {
if (!hasMoney) {
Jobs.getActionBar();
ActionBarTitleMessages.send(payment.getOfflinePlayer().getPlayer(), Jobs.getLanguage().getMessage("economy.error.nomoney"));
Jobs.getActionBar().send(payment.getOfflinePlayer().getPlayer(), Jobs.getLanguage().getMessage("economy.error.nomoney"));
continue;
}
if (Jobs.getGCManager().isEconomyAsync()) {
@ -242,7 +241,7 @@ public class BufferedEconomy {
Message = Message + " " + Jobs.getLanguage().getMessage("command.toggle.output.paid.exp", new Object[] { "[exp]", String.format(Jobs.getGCManager().getDecimalPlacesExp(), new Object[] {
Double.valueOf(payment.getExp()) }) });
}
ActionBarTitleMessages.send(abp, Message);
Jobs.getActionBar().send(abp, Message);
}
}
}

View File

@ -27,7 +27,6 @@ import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.CropState;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.Material;