9
0
mirror of https://github.com/Xiao-MoMi/Custom-Crops.git synced 2025-12-25 09:59:20 +00:00
This commit is contained in:
XiaoMoMi
2024-04-15 13:52:19 +08:00
parent 769e1141b2
commit 02414a290c
3 changed files with 5 additions and 8 deletions

View File

@@ -52,7 +52,7 @@ public class BlockPos {
}
public int getSectionID() {
return getY() / 16;
return (int) Math.floor((double) getY() / 16);
}
public int getY() {
@@ -78,7 +78,7 @@ public class BlockPos {
@Override
public String toString() {
return "ChunkPos{" +
return "BlockPos{" +
"x=" + getX() +
"y=" + getY() +
"z=" + getZ() +

View File

@@ -8,7 +8,7 @@ plugins {
allprojects {
project.group = "net.momirealms"
project.version = "3.4.4.1"
project.version = "3.4.4.2"
apply<JavaPlugin>()
apply(plugin = "java")

View File

@@ -26,10 +26,7 @@ import net.momirealms.customcrops.util.RotationUtils;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.ItemFrame;
import org.bukkit.entity.Player;
import org.bukkit.entity.*;
import org.bukkit.inventory.ItemStack;
import java.util.Collection;
@@ -68,7 +65,7 @@ public interface CustomProvider {
return false;
Location center = LocationUtils.toCenterLocation(location);
Collection<Entity> entities = center.getWorld().getNearbyEntities(center, 0.5,0.51,0.5);
entities.removeIf(entity -> entity instanceof Player);
entities.removeIf(entity -> (entity instanceof Player || entity instanceof Item));
return entities.size() == 0;
}