mirror of
https://github.com/Xiao-MoMi/Custom-Fishing.git
synced 2025-12-29 20:09:14 +00:00
1.2.23.2
This commit is contained in:
@@ -106,10 +106,6 @@ public class CompetitionConfig {
|
||||
this.weekday = weekday;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(Calendar.getInstance().get(Calendar.DAY_OF_WEEK));
|
||||
}
|
||||
|
||||
public boolean canStart() {
|
||||
if (date != null && date.size() != 0) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
@@ -121,9 +117,7 @@ public class CompetitionConfig {
|
||||
if (weekday != null && weekday.size() != 0) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
int dateDay = calendar.get(Calendar.DAY_OF_WEEK);
|
||||
if (!weekday.contains(dateDay)) {
|
||||
return false;
|
||||
}
|
||||
return weekday.contains(dateDay);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ public class RedisRankingImpl implements RankingInterface {
|
||||
Jedis jedis = JedisUtil.getJedis();
|
||||
Double score = jedis.zscore("cf_competition", player);
|
||||
jedis.close();
|
||||
if (score == 0) return null;
|
||||
if (score == null || score == 0) return null;
|
||||
return new CompetitionPlayer(player, Float.parseFloat(score.toString()));
|
||||
}
|
||||
|
||||
|
||||
@@ -26,17 +26,16 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class MythicMobsItemImpl implements ItemInterface {
|
||||
|
||||
private final ItemExecutor itemManager;
|
||||
|
||||
public MythicMobsItemImpl() {
|
||||
this.itemManager = MythicBukkit.inst().getItemManager();
|
||||
}
|
||||
private ItemExecutor itemManager;
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public ItemStack build(String material) {
|
||||
if (!material.startsWith("MythicMobs:")) return null;
|
||||
material = material.substring(11);
|
||||
if (itemManager == null) {
|
||||
this.itemManager = MythicBukkit.inst().getItemManager();
|
||||
}
|
||||
return itemManager.getItemStack(material);
|
||||
}
|
||||
|
||||
|
||||
@@ -29,8 +29,8 @@ public class MMOCoreImpl implements SkillInterface {
|
||||
private final Profession profession;
|
||||
private final PlayerDataManager playerDataManager;
|
||||
|
||||
public MMOCoreImpl() {
|
||||
profession = MMOCore.plugin.professionManager.get("fishing");
|
||||
public MMOCoreImpl(String name) {
|
||||
profession = MMOCore.plugin.professionManager.get(name);
|
||||
playerDataManager = MMOCore.plugin.dataProvider.getDataManager();
|
||||
}
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ public class IntegrationManager extends Function {
|
||||
this.skillInterface = new mcMMOImpl();
|
||||
hookMessage("mcMMO");
|
||||
} else if (config.getBoolean("integrations.MMOCore", false) && Bukkit.getPluginManager().getPlugin("MMOCore") != null) {
|
||||
this.skillInterface = new MMOCoreImpl();
|
||||
this.skillInterface = new MMOCoreImpl(config.getString("other-settings.MMOCore-profession-name", "fishing"));
|
||||
hookMessage("MMOCore");
|
||||
} else if (config.getBoolean("integrations.AureliumSkills", false) && Bukkit.getPluginManager().getPlugin("AureliumSkills") != null) {
|
||||
this.skillInterface = new AureliumsImpl();
|
||||
|
||||
@@ -22,6 +22,8 @@ import com.comphenix.protocol.reflect.StructureModifier;
|
||||
import com.comphenix.protocol.wrappers.WrappedChatComponent;
|
||||
import de.tr7zw.changeme.nbtapi.NBTCompound;
|
||||
import de.tr7zw.changeme.nbtapi.NBTItem;
|
||||
import net.Indyuce.mmoitems.MMOItems;
|
||||
import net.Indyuce.mmoitems.api.item.mmoitem.MMOItem;
|
||||
import net.kyori.adventure.key.Key;
|
||||
import net.kyori.adventure.sound.Sound;
|
||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||
|
||||
@@ -7,22 +7,22 @@ example:
|
||||
# RANDOM
|
||||
goal: CATCH_AMOUNT
|
||||
|
||||
#Optional
|
||||
#start-weekday:
|
||||
# Optional
|
||||
# start-weekday:
|
||||
# - monday
|
||||
# - sunday
|
||||
#Optional
|
||||
#start-date:
|
||||
# Optional
|
||||
# start-date:
|
||||
# - 1
|
||||
# - 7
|
||||
# - 14
|
||||
# optional
|
||||
# Optional
|
||||
# Fishing competition can also be started with a command
|
||||
start-time:
|
||||
- '12:30'
|
||||
- '18:30'
|
||||
|
||||
#seconds
|
||||
# Seconds
|
||||
duration: 300
|
||||
|
||||
# Min players to start the competition
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# don't change
|
||||
config-version: '14'
|
||||
config-version: '15'
|
||||
|
||||
# chinese/english/spanish
|
||||
lang: english
|
||||
@@ -177,4 +177,6 @@ other-settings:
|
||||
prevent-other-players-pick-up-loot: false
|
||||
# Log the money player get from selling the fish in the console
|
||||
# 后台记录玩家销售鱼类所得金额
|
||||
log-earnings: true
|
||||
log-earnings: true
|
||||
# Set the MMOCore profession name
|
||||
MMOCore-profession-name: 'customfishing'
|
||||
Reference in New Issue
Block a user