mirror of
https://github.com/Xiao-MoMi/Custom-Crops.git
synced 2025-12-26 10:29:10 +00:00
3.0.2-hotfix
This commit is contained in:
@@ -200,6 +200,12 @@ public interface PlatformInterface {
|
||||
return false;
|
||||
}
|
||||
|
||||
default void removeAnyThingAt(Location location) {
|
||||
removeAnyBlock(location);
|
||||
removeItemFrame(location);
|
||||
if (CustomCrops.getInstance().getVersionHelper().isVersionNewerThan1_19_R3()) removeItemDisplay(location);
|
||||
}
|
||||
|
||||
default void placeCustomItem(Location location, String id, ItemMode itemMode) {
|
||||
if (itemMode == ItemMode.TRIPWIRE)
|
||||
placeTripWire(location, id);
|
||||
|
||||
@@ -21,6 +21,7 @@ import net.momirealms.customcrops.CustomCrops;
|
||||
import net.momirealms.customcrops.api.object.ItemMode;
|
||||
import net.momirealms.customcrops.api.object.crop.StageConfig;
|
||||
import net.momirealms.customcrops.api.object.world.SimpleLocation;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -38,7 +39,9 @@ public class BreakImpl implements Action {
|
||||
public void doOn(@Nullable Player player, @Nullable SimpleLocation crop_loc, ItemMode itemMode) {
|
||||
if (crop_loc == null) return;
|
||||
CustomCrops.getInstance().getScheduler().runTask(() -> {
|
||||
CustomCrops.getInstance().getPlatformInterface().removeCustomItem(crop_loc.getBukkitLocation(), itemMode);
|
||||
Location bLoc = crop_loc.getBukkitLocation();
|
||||
if (bLoc == null) return;
|
||||
CustomCrops.getInstance().getPlatformInterface().removeAnyThingAt(bLoc);
|
||||
CustomCrops.getInstance().getWorldDataManager().removeCropData(crop_loc);
|
||||
});
|
||||
if (triggerAction && stage_id != null) {
|
||||
|
||||
@@ -19,6 +19,7 @@ package net.momirealms.customcrops.api.object.season;
|
||||
|
||||
import net.momirealms.customcrops.CustomCrops;
|
||||
import net.momirealms.customcrops.api.object.Function;
|
||||
import net.momirealms.customcrops.api.object.basic.ConfigManager;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
@@ -53,6 +54,7 @@ public class SeasonManager extends Function {
|
||||
}
|
||||
|
||||
public CCSeason getSeason(String world) {
|
||||
if (ConfigManager.syncSeason) world = ConfigManager.referenceWorld;
|
||||
SeasonData seasonData = seasonMap.get(world);
|
||||
if (seasonData == null) return CCSeason.UNKNOWN;
|
||||
return seasonData.getSeason();
|
||||
|
||||
Reference in New Issue
Block a user