mirror of
https://github.com/Xiao-MoMi/Custom-Crops.git
synced 2025-12-28 03:19:15 +00:00
3.4.9
This commit is contained in:
@@ -108,7 +108,8 @@ public abstract class AbstractCustomListener implements Listener {
|
||||
final Location location = block.getLocation();
|
||||
Optional<CustomCropsBlock> customCropsBlock = CustomCropsPlugin.get().getWorldManager().getBlockAt(SimpleLocation.of(location));
|
||||
if (customCropsBlock.isPresent()) {
|
||||
fallingBlock.setCancelDrop(true);
|
||||
event.setCancelled(true);
|
||||
block.getWorld().dropItemNaturally(block.getLocation(), new ItemStack(fallingBlock.getBlockData().getMaterial()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ public interface CustomProvider {
|
||||
Location center = LocationUtils.toCenterLocation(location);
|
||||
Collection<Entity> entities = center.getWorld().getNearbyEntities(center, 0.5,0.51,0.5);
|
||||
entities.removeIf(entity -> (entity instanceof Player || entity instanceof Item));
|
||||
return entities.size() == 0;
|
||||
return entities.isEmpty();
|
||||
}
|
||||
|
||||
default CRotation removeAnythingAt(Location location) {
|
||||
@@ -115,7 +115,7 @@ public interface CustomProvider {
|
||||
return type != EntityType.ITEM_FRAME
|
||||
&& (!VersionManager.isHigherThan1_19_R3() || type != EntityType.ITEM_DISPLAY);
|
||||
});
|
||||
if (entities.size() == 0) return CRotation.NONE;
|
||||
if (entities.isEmpty()) return CRotation.NONE;
|
||||
CRotation rotation;
|
||||
Entity first = entities.stream().findFirst().get();
|
||||
if (first instanceof ItemFrame itemFrame) {
|
||||
|
||||
Reference in New Issue
Block a user