mirror of
https://github.com/Xiao-MoMi/Custom-Crops.git
synced 2025-12-27 19:09:09 +00:00
3.6.29
This commit is contained in:
@@ -31,6 +31,7 @@ import net.momirealms.customcrops.api.core.world.Pos3;
|
||||
import net.momirealms.customcrops.api.event.DropItemActionEvent;
|
||||
import net.momirealms.customcrops.api.misc.value.MathValue;
|
||||
import net.momirealms.customcrops.api.util.EventUtils;
|
||||
import net.momirealms.customcrops.api.util.LocationUtils;
|
||||
import net.momirealms.customcrops.api.util.PlayerUtils;
|
||||
import net.momirealms.customcrops.common.util.RandomUtils;
|
||||
import org.bukkit.Location;
|
||||
@@ -87,7 +88,7 @@ public class ActionDropItem<T> extends AbstractBuiltInAction<T> {
|
||||
if (toInv && player != null) {
|
||||
PlayerUtils.giveItem(player, itemToDrop, itemToDrop.getAmount());
|
||||
} else {
|
||||
location.getWorld().dropItemNaturally(location, itemToDrop);
|
||||
location.getWorld().dropItemNaturally(LocationUtils.toBlockCenterLocation(location), itemToDrop);
|
||||
}
|
||||
}
|
||||
}, location);
|
||||
|
||||
@@ -32,6 +32,7 @@ import net.momirealms.customcrops.api.core.world.Pos3;
|
||||
import net.momirealms.customcrops.api.event.QualityCropActionEvent;
|
||||
import net.momirealms.customcrops.api.misc.value.MathValue;
|
||||
import net.momirealms.customcrops.api.util.EventUtils;
|
||||
import net.momirealms.customcrops.api.util.LocationUtils;
|
||||
import net.momirealms.customcrops.api.util.PlayerUtils;
|
||||
import net.momirealms.customcrops.common.util.RandomUtils;
|
||||
import org.bukkit.Location;
|
||||
@@ -94,7 +95,7 @@ public class ActionQualityCrops<T> extends AbstractBuiltInAction<T> {
|
||||
if (toInv && player != null) {
|
||||
PlayerUtils.giveItem(player, itemStack, itemStack.getAmount());
|
||||
} else {
|
||||
location.getWorld().dropItemNaturally(location, itemStack);
|
||||
location.getWorld().dropItemNaturally(LocationUtils.toBlockCenterLocation(location), itemStack);
|
||||
}
|
||||
}
|
||||
}, location);
|
||||
|
||||
@@ -55,6 +55,14 @@ public interface WorldManager extends Reloadable {
|
||||
*/
|
||||
int getDate(World world);
|
||||
|
||||
/**
|
||||
* Loads a CustomCrops world
|
||||
*
|
||||
* @param world The CustomCrops world
|
||||
* @return The loaded CustomCropsWorld instance, it might be another instance if it's already loaded
|
||||
*/
|
||||
CustomCropsWorld<?> loadWorld(CustomCropsWorld<?> world);
|
||||
|
||||
/**
|
||||
* Loads a CustomCrops world based on the specified Bukkit world.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user