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:
parent
ff87470088
commit
2faae4cf08
@ -845,10 +845,6 @@ public class Jobs extends JavaPlugin {
|
||||
dao.saveExplore();
|
||||
}
|
||||
|
||||
if (bpManager != null) {
|
||||
bpManager.saveCache();
|
||||
}
|
||||
|
||||
blockOwnerShips.forEach(BlockOwnerShip::save);
|
||||
ToggleBarHandling.save();
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -145,9 +145,17 @@ public class Job {
|
||||
final Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(new Date());
|
||||
|
||||
cal.set(Calendar.HOUR_OF_DAY, cal.get(Calendar.HOUR_OF_DAY) + h);
|
||||
cal.set(Calendar.MINUTE, cal.get(Calendar.MINUTE) + m);
|
||||
cal.set(Calendar.SECOND, cal.get(Calendar.SECOND) + s);
|
||||
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());
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
@ -494,16 +493,16 @@ public class JobsPaymentListener implements Listener {
|
||||
return;
|
||||
|
||||
if (event.getState() == PlayerFishEvent.State.CAUGHT_FISH && event.getCaught() instanceof Item) {
|
||||
// check is mcMMO enabled
|
||||
if (JobsHook.mcMMO.isEnabled()) {
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||
// check is mcMMO enabled
|
||||
if (JobsHook.mcMMO.isEnabled()) {
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||
|
||||
// check is the fishing being exploited. If yes, prevent payment.
|
||||
if (mcMMOPlayer != null && ExperienceConfig.getInstance().isFishingExploitingPrevented()
|
||||
&& mcMMOPlayer.getFishingManager().isExploitingFishing(event.getHook().getLocation().toVector())) {
|
||||
return;
|
||||
}
|
||||
// check is the fishing being exploited. If yes, prevent payment.
|
||||
if (mcMMOPlayer != null && ExperienceConfig.getInstance().isFishingExploitingPrevented()
|
||||
&& mcMMOPlayer.getFishingManager().isExploitingFishing(event.getHook().getLocation().toVector())) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Jobs.action(Jobs.getPlayerManager().getJobsPlayer(player),
|
||||
new ItemActionInfo(((Item) event.getCaught()).getItemStack(), ActionType.FISH));
|
||||
|
@ -70,12 +70,4 @@ blocksTimer:
|
||||
NETHER_WART: 60
|
||||
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
|
||||
MELON: 30
|
Loading…
Reference in New Issue
Block a user