1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-29 14:05:25 +01:00

Translating enchant material names

This commit is contained in:
Zrips 2022-11-14 14:52:38 +02:00
parent b79b8a1e9d
commit fb5a520f1a
7 changed files with 45 additions and 35 deletions

View File

@ -16,7 +16,6 @@ import com.gamingmesh.jobs.container.DBAction;
import net.Zrips.CMILib.Items.CMIMaterial;
import net.Zrips.CMILib.Locale.LC;
import net.Zrips.CMILib.Logs.CMIDebug;
import net.Zrips.CMILib.Messages.CMIMessages;
import net.Zrips.CMILib.Version.Version;

View File

@ -125,11 +125,6 @@ public class BlockProtectionManager {
}
locations.put(v, Bp);
// if (locations.size() > 10) {
// Jobs.getJobsDAO().saveBlockProtection(loc.getWorld().getName(), new HashMap<String, BlockProtection>(locations));
// locations.clear();
// }
}
public void saveCache() {

View File

@ -156,6 +156,24 @@ public class NameTranslatorManager {
level = ":" + split[1];
}
mat = CMIMaterial.get(mName);
nameLs = listOfNames.get(mat);
if (nameLs != null && !mat.isNone()) {
if (meta != null && !meta.isEmpty() && mat.isCanHavePotionType() && Util.getPotionByName(meta) != null) {
NameList record = listOfPotionEffects.get(meta.toLowerCase().replace("_", ""));
if (record != null)
meta = record.getMinecraftName();
return nameLs.getName() + ":" + meta;
}
if (name != null && !name.isEmpty()) {
return nameLs.getName();
}
}
NameList nameInfo = listOfEnchants.get(mName.toLowerCase().replace("_", ""));
if (nameInfo != null) {
return nameInfo.getMinecraftName() + level;

View File

@ -3,31 +3,31 @@ package com.gamingmesh.jobs.container;
public class BoostCounter {
private CurrencyType type;
private double boost;
private Long calculatedon;
private long calculatedon;
public BoostCounter(CurrencyType type, double boost, Long calculatedon) {
this.type = type;
this.boost = boost;
this.calculatedon = calculatedon;
public BoostCounter(CurrencyType type, double boost, long calculatedon) {
this.type = type;
this.boost = boost;
this.calculatedon = calculatedon;
}
public CurrencyType getType() {
return type;
return type;
}
public long getTime() {
return calculatedon;
return calculatedon;
}
public double getBoost() {
return boost;
return boost;
}
public void setTime(long calculatedon) {
this.calculatedon = calculatedon;
this.calculatedon = calculatedon;
}
public void setBoost(double boost) {
this.boost = boost;
this.boost = boost;
}
}

View File

@ -31,10 +31,10 @@ public class JobProgression {
private Job job;
private JobsPlayer jPlayer;
private double experience;
private Double lastExperience;
private double lastExperience = 0;
private int level;
private transient int maxExperience = -1;
private Long leftOn = null;
private long leftOn = 0;
public JobProgression(Job job, JobsPlayer jPlayer, int level, double experience) {
this.job = job;
@ -258,7 +258,7 @@ public class JobProgression {
}
public boolean canRejoin() {
if (leftOn == null || leftOn + job.getRejoinCd() < System.currentTimeMillis())
if (leftOn == 0 || leftOn + job.getRejoinCd() < System.currentTimeMillis())
return true;
org.bukkit.entity.Player player = jPlayer != null ? jPlayer.getPlayer() : null;
@ -266,14 +266,14 @@ public class JobProgression {
}
public String getRejoinTimeMessage() {
return leftOn == null ? "" : CMITimeManager.to24hourShort(leftOn + job.getRejoinCd() - System.currentTimeMillis());
return leftOn == 0 ? "" : CMITimeManager.to24hourShort(leftOn + job.getRejoinCd() - System.currentTimeMillis());
}
public Double getLastExperience() {
return lastExperience == null ? 0D : lastExperience;
public double getLastExperience() {
return lastExperience;
}
public void setLastExperience(Double lastExperience) {
public void setLastExperience(double lastExperience) {
this.lastExperience = lastExperience;
}

View File

@ -39,13 +39,11 @@ import com.gamingmesh.jobs.api.JobsLevelUpEvent;
import com.gamingmesh.jobs.container.blockOwnerShip.BlockTypes;
import com.gamingmesh.jobs.dao.JobsDAO;
import com.gamingmesh.jobs.economy.PaymentData;
import com.gamingmesh.jobs.stuff.TimeManage;
import net.Zrips.CMILib.ActionBar.CMIActionBar;
import net.Zrips.CMILib.Colors.CMIChatColor;
import net.Zrips.CMILib.Equations.Parser;
import net.Zrips.CMILib.Items.CMIMaterial;
import net.Zrips.CMILib.Logs.CMIDebug;
import net.Zrips.CMILib.Time.CMITimeManager;
public class JobsPlayer {
@ -84,10 +82,10 @@ public class JobsPlayer {
private Map<String, Log> logList = new HashMap<>();
private Long seen = System.currentTimeMillis();
private long seen = System.currentTimeMillis();
private Map<String, Boolean> permissionsCache;
private Long lastPermissionUpdate = -1L;
private long lastPermissionUpdate = -1L;
private final Map<String, Map<String, QuestProgression>> qProgression = new HashMap<>();
private int doneQuests = 0;
@ -937,11 +935,11 @@ public class JobsPlayer {
this.isSaved = isSaved;
}
public Long getSeen() {
public long getSeen() {
return seen;
}
public void setSeen(Long seen) {
public void setSeen(long seen) {
this.seen = seen;
}
@ -957,7 +955,7 @@ public class JobsPlayer {
permissionsCache.put(permission, state);
}
public Long getLastPermissionUpdate() {
public long getLastPermissionUpdate() {
return lastPermissionUpdate;
}

View File

@ -7,7 +7,7 @@ import com.gamingmesh.jobs.container.CurrencyType;
public class PaymentData {
private Long lastAnnouced = 0L;
private long lastAnnouced = 0L;
private final java.util.Map<CurrencyType, LimitsData> payments = new HashMap<>();
@ -53,7 +53,7 @@ public class PaymentData {
return data == null ? 0D : (int) (data.getAmount() * 100) / 100D;
}
public Long getLastAnnounced() {
public long getLastAnnounced() {
return lastAnnouced;
}