9
0
mirror of https://github.com/Xiao-MoMi/Custom-Fishing.git synced 2025-12-29 03:49:07 +00:00
This commit is contained in:
Xiao-MoMi
2022-12-23 20:39:55 +08:00
parent 42e3228c1d
commit 420e0db544
15 changed files with 13 additions and 23 deletions

View File

@@ -7,13 +7,11 @@ import net.momirealms.customfishing.manager.ConfigManager;
import net.momirealms.customfishing.manager.MessageManager;
import net.momirealms.customfishing.util.AdventureUtil;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public class OpenBagCommand extends AbstractSubCommand {

View File

@@ -145,7 +145,7 @@ public class Competition {
Bukkit.getScheduler().runTaskLaterAsynchronously(CustomFishing.plugin, ()-> {
ranking.clear();
}, 100);
}, 600);
}
public void givePrize(){

View File

@@ -82,7 +82,7 @@ public class CompetitionSchedule extends Function {
}
}
}
}.runTaskTimer(CustomFishing.plugin, (60 - LocalTime.now().getSecond()) * 20, 1200);
}.runTaskTimer(CustomFishing.plugin, 60 - LocalTime.now().getSecond(), 200);
}
public void stopCheck() {

View File

@@ -53,7 +53,7 @@ public class SqlConnection {
hikariConfig.setMaximumPoolSize(config.getInt(storageMode + ".Pool-Settings.maximum-pool-size"));
hikariConfig.setMinimumIdle(config.getInt(storageMode + ".Pool-Settings.minimum-idle"));
hikariConfig.setMaxLifetime(config.getInt(storageMode + ".Pool-Settings.maximum-lifetime"));
hikariConfig.setConnectionTimeout(5000);
hikariConfig.setConnectionTimeout(3000);
for (String property : config.getConfigurationSection(storageMode + ".properties").getKeys(false)) {
hikariConfig.addDataSourceProperty(property, config.getString(storageMode + ".properties." + property));
}

View File

@@ -17,8 +17,6 @@
package net.momirealms.customfishing.integration;
import net.momirealms.customfishing.manager.TotemManager;
import net.momirealms.customfishing.util.AdventureUtil;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;

View File

@@ -17,7 +17,6 @@
package net.momirealms.customfishing.integration.block;
import dev.lone.itemsadder.api.CustomBlock;
import io.th0rgal.oraxen.mechanics.provided.gameplay.noteblock.NoteBlockMechanic;
import io.th0rgal.oraxen.mechanics.provided.gameplay.noteblock.NoteBlockMechanicFactory;
import io.th0rgal.oraxen.mechanics.provided.gameplay.noteblock.NoteBlockMechanicListener;

View File

@@ -25,20 +25,14 @@ import net.kyori.adventure.text.minimessage.MiniMessage;
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
import net.momirealms.customfishing.CustomFishing;
import net.momirealms.customfishing.data.PlayerBagData;
import net.momirealms.customfishing.data.storage.DataStorageInterface;
import net.momirealms.customfishing.data.storage.FileStorageImpl;
import net.momirealms.customfishing.data.storage.MySQLStorageImpl;
import net.momirealms.customfishing.listener.InventoryListener;
import net.momirealms.customfishing.listener.SimpleListener;
import net.momirealms.customfishing.listener.WindowPacketListener;
import net.momirealms.customfishing.object.Function;
import net.momirealms.customfishing.util.AdventureUtil;
import net.momirealms.customfishing.util.ConfigUtil;
import net.momirealms.customfishing.util.ItemStackUtil;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.OfflinePlayer;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList;
import org.bukkit.event.inventory.InventoryClickEvent;

View File

@@ -129,6 +129,11 @@ public class ConfigManager {
failureFadeStay = config.getInt("titles.failure.fade.stay", 30) * 50;
failureFadeOut = config.getInt("titles.failure.fade.out", 10) * 50;
if (successTitle.length == 0) successTitle = new String[]{""};
if (successSubTitle.length == 0) successSubTitle = new String[]{""};
if (failureTitle.length == 0) failureTitle = new String[]{""};
if (failureSubTitle.length == 0) failureSubTitle = new String[]{""};
enableWaterAnimation = config.getBoolean("mechanics.splash-animation.water.enable", false);
enableLavaAnimation = config.getBoolean("mechanics.splash-animation.lava.enable", false);
water_item = config.getString("mechanics.splash-animation.water.item");

View File

@@ -24,7 +24,6 @@ import net.kyori.adventure.sound.Sound;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.minimessage.MiniMessage;
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
import net.momirealms.customcrops.config.MainConfig;
import net.momirealms.customfishing.CustomFishing;
import net.momirealms.customfishing.api.event.*;
import net.momirealms.customfishing.competition.Competition;

View File

@@ -28,7 +28,6 @@ import net.kyori.adventure.text.minimessage.MiniMessage;
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
import net.momirealms.customfishing.CustomFishing;
import net.momirealms.customfishing.api.event.SellFishEvent;
import net.momirealms.customfishing.data.PlayerBagData;
import net.momirealms.customfishing.data.PlayerSellData;
import net.momirealms.customfishing.integration.papi.PlaceholderManager;
import net.momirealms.customfishing.listener.InventoryListener;

View File

@@ -18,7 +18,6 @@
package net.momirealms.customfishing.object.requirements;
import net.momirealms.customfishing.CustomFishing;
import net.momirealms.customfishing.helper.Log;
import net.momirealms.customfishing.integration.SeasonInterface;
import net.momirealms.customfishing.object.fishing.FishingCondition;

View File

@@ -43,7 +43,6 @@ public class ArmorStandUtil {
destroyPacket.getIntLists().write(0, List.of(id));
return destroyPacket;
}
public static PacketContainer getSpawnPacket(int id, Location location) {
PacketContainer entityPacket = new PacketContainer(PacketType.Play.Server.SPAWN_ENTITY);
entityPacket.getModifier().write(0, id);

View File

@@ -273,11 +273,10 @@ public class ItemStackUtil {
}
case NBTTagList -> {
List<Object> list = new ArrayList<>();
switch (nbtCompound.getListType(key)){
switch (nbtCompound.getListType(key)) {
case NBTTagInt -> nbtCompound.getIntegerList(key).forEach(a -> list.add("(Int) " + a));
case NBTTagDouble -> nbtCompound.getDoubleList(key).forEach(a -> list.add("(Double) " + a));
case NBTTagString -> nbtCompound.getStringList(key).forEach(a -> list.add("(String) " + a));
case NBTTagCompound -> nbtCompound.getCompoundList(key).forEach(a -> list.add(compoundToMap(a)));
case NBTTagFloat -> nbtCompound.getFloatList(key).forEach(a -> list.add("(Float) " + a));
case NBTTagLong -> nbtCompound.getLongList(key).forEach(a -> list.add("(Long) " + a));
case NBTTagIntArray -> nbtCompound.getIntArrayList(key).forEach(a -> list.add("(IntArray) " + Arrays.toString(a)));