1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-26 04:25:15 +01:00

Improve material generation in translator file for old versions

- Block cache will not be saved twice on disable
This commit is contained in:
montlikadani 2021-02-17 08:15:05 +01:00
parent ff87470088
commit 2faae4cf08
6 changed files with 34 additions and 40 deletions

View File

@ -845,10 +845,6 @@ public class Jobs extends JavaPlugin {
dao.saveExplore();
}
if (bpManager != null) {
bpManager.saveCache();
}
blockOwnerShips.forEach(BlockOwnerShip::save);
ToggleBarHandling.save();

View File

@ -15,7 +15,6 @@ public class explored implements Cmd {
@Override
public boolean perform(Jobs plugin, CommandSender sender, String[] args) {
if (!(sender instanceof Player))
return false;
@ -24,31 +23,26 @@ public class explored implements Cmd {
HashMap<String, ExploreRegion> worlds = Jobs.getExplore().getWorlds();
if (!worlds.containsKey(player.getWorld().getName())) {
sender.sendMessage(Jobs.getLanguage().getMessage("command.explored.error.noexplore"));
player.sendMessage(Jobs.getLanguage().getMessage("command.explored.error.noexplore"));
return true;
}
ExploreRegion regions = worlds.get(player.getWorld().getName());
ExploreChunk chunk = regions.getChunk(player.getLocation().getChunk());
ExploreChunk chunk = worlds.get(player.getWorld().getName()).getChunk(player.getLocation().getChunk());
if (chunk == null) {
sender.sendMessage(Jobs.getLanguage().getMessage("command.explored.error.noexplore"));
player.sendMessage(Jobs.getLanguage().getMessage("command.explored.error.noexplore"));
return false;
}
if (chunk.isFullyExplored() && Jobs.getGCManager().ExploreCompact) {
sender.sendMessage(Jobs.getLanguage().getMessage("command.explored.fullExplore"));
player.sendMessage(Jobs.getLanguage().getMessage("command.explored.fullExplore"));
return true;
}
int i = 0;
for (Integer one : chunk.getPlayers()) {
i++;
PlayerInfo ji = Jobs.getPlayerManager().getPlayerInfo(one);
for (int i = 0; i < chunk.getPlayers().size(); i++) {
PlayerInfo ji = Jobs.getPlayerManager().getPlayerInfo(chunk.getPlayers().get(i));
if (ji != null)
sender.sendMessage(Jobs.getLanguage().getMessage("command.explored.list", "%place%", i, "%playername%", ji.getName()));
player.sendMessage(Jobs.getLanguage().getMessage("command.explored.list", "%place%", i, "%playername%", ji.getName()));
}
sender.sendMessage(Jobs.getLanguage().getMessage("general.info.separator"));
player.sendMessage(Jobs.getLanguage().getMessage("general.info.separator"));
return true;
}

View File

@ -292,8 +292,13 @@ public class NameTranslatorManager {
for (Material one : Material.values()) {
CMIMaterial mat = CMIMaterial.get(one);
if (mat == null || mat.getMaterial() == null)
if (mat == CMIMaterial.NONE || mat == null || mat.getMaterial() == null) {
mat = CMIMaterial.get(one.getId());
}
if (mat == CMIMaterial.NONE) {
continue;
}
String n = mat.getLegacyId() + (mat.getLegacyData() == -1 ? "" : ":" + mat.getLegacyData());
String name = null;

View File

@ -145,9 +145,17 @@ public class Job {
final Calendar cal = Calendar.getInstance();
cal.setTime(new Date());
if (h > 0) {
cal.set(Calendar.HOUR_OF_DAY, cal.get(Calendar.HOUR_OF_DAY) + h);
}
if (m > 0) {
cal.set(Calendar.MINUTE, cal.get(Calendar.MINUTE) + m);
}
if (s > 0) {
cal.set(Calendar.SECOND, cal.get(Calendar.SECOND) + s);
}
boost.add(type, point, cal.getTimeInMillis());
}

View File

@ -30,7 +30,6 @@ import com.gamingmesh.jobs.hooks.HookManager;
import com.gamingmesh.jobs.hooks.JobsHook;
import com.gmail.nossr50.config.experience.ExperienceConfig;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.player.UserManager;
import com.google.common.base.Objects;

View File

@ -71,11 +71,3 @@ blocksTimer:
PUMPKIN: 30
CARVED_PUMPKIN: 30
MELON: 30
GOLD_ORE: -1
IRON_ORE: -1
COAL_ORE: -1
LAPIS_ORE: -1
DIAMOND_ORE: -1
REDSTONE_ORE: -1
EMERALD_ORE: -1
NETHER_QUARTZ_ORE: -1