9
0
mirror of https://github.com/Xiao-MoMi/Custom-Crops.git synced 2025-12-23 17:09:21 +00:00

3.2.2-hotfix

This commit is contained in:
Xiao-MoMi
2023-05-19 19:15:49 +08:00
parent 2994689bcf
commit f8da51210b
4 changed files with 15 additions and 11 deletions

View File

@@ -4,7 +4,7 @@ plugins {
}
group = 'net.momirealms'
version = '3.2.2'
version = '3.2.2-hotfix'
repositories {
mavenCentral()

View File

@@ -95,11 +95,6 @@ public class PlatformManager extends Function {
public void onBreakVanillaBlock(BlockBreakEvent event) {
if (event.isCancelled()) return;
Block block = event.getBlock();
if (block.getType() == Material.NOTE_BLOCK) {
SimpleLocation potLoc = SimpleLocation.getByBukkitLocation(block.getLocation());
plugin.getWorldDataManager().removeCorrupted(potLoc);
plugin.getWorldDataManager().removePotData(potLoc);
}
onBreakVanilla(event.getPlayer(), block.getLocation(), block.getType().name(), event);
}
@@ -182,6 +177,12 @@ public class PlatformManager extends Function {
if (onBreakPot(player, id, location, event)) {
return;
}
if (id.equals("NOTE_BLOCK")) {
SimpleLocation potLoc = SimpleLocation.getByBukkitLocation(location);
plugin.getWorldDataManager().removeCorrupted(potLoc);
plugin.getWorldDataManager().removePotData(potLoc);
}
}
public void onPlaceCustom(Player player, Location location, String id, @Nullable Cancellable event) {

View File

@@ -81,11 +81,11 @@ public class CCWorld extends Function {
public CCWorld(World world, CustomCrops plugin) {
this.plugin = plugin;
this.worldName = world.getName();
this.chunksFolder = ConfigUtils.getFile(world, "chunks");
this.dateFile = ConfigUtils.getFile(world, "data.yml");
this.corruptedFile = ConfigUtils.getFile(world, "corrupted.yml");
this.world = new WeakReference<>(world);
this.worldName = world.getName();
this.chunkMap = new ConcurrentHashMap<>(64);
this.schedule = new ScheduledThreadPoolExecutor(ConfigManager.corePoolSize);
this.schedule.setMaximumPoolSize(ConfigManager.maxPoolSize);
@@ -100,6 +100,7 @@ public class CCWorld extends Function {
public void init() {
loadDateData();
loadCorruptedPots();
if (!chunksFolder.exists()) chunksFolder.mkdirs();
if (!ConfigManager.onlyInLoadedChunks) {
loadAllChunkData();
}
@@ -151,7 +152,6 @@ public class CCWorld extends Function {
@SuppressWarnings("ResultOfMethodCallIgnored")
public void loadAllChunkData() {
if (!chunksFolder.exists()) chunksFolder.mkdirs();
File[] data_files = chunksFolder.listFiles();
if (data_files == null) return;
List<File> outdated = new ArrayList<>();
@@ -177,6 +177,7 @@ public class CCWorld extends Function {
@SuppressWarnings("ResultOfMethodCallIgnored")
public void saveAllChunkData() {
if (!chunksFolder.exists()) chunksFolder.mkdirs();
for (Map.Entry<ChunkCoordinate, CCChunk> entry : chunkMap.entrySet()) {
ChunkCoordinate chunkCoordinate = entry.getKey();
CCChunk chunk = entry.getValue();

View File

@@ -4,7 +4,7 @@ config-version: '32'
metrics: true
# Language: english / spanish / chinese / turkish
lang: english
# debug
# Debug
debug:
log-scheduler: false
log-corruption-fixer: false
@@ -16,7 +16,7 @@ worlds:
# Mode: whitelist/blacklist
# Requires a restart when changing mode or editing world list for the safety of data
# 模式:白名单/黑名单
# 为了避免重载时候造成服务器卡顿,修改本栏需要重启服务器
# 修改本栏需要重启服务器
mode: whitelist
list:
- world
@@ -55,7 +55,9 @@ optimization:
# 推荐启用区块限制来防止玩家种植大量农作物
# 如果你使用ItemsAdder的展示框模式你需要在ItemsAdder的配置文件中设置"max-furniture-vehicles-per-chunk"到较高值,否则农作物种植后会消失
limitation:
# max crop amount per chunk
# Maximum amount of growing crops per chunk
# Note: This only limits **growing** crops
# If a crop is ripe, it would not be counted
# 每个区块的限制数量
growing-crop-amount:
enable: true