mirror of
https://github.com/Xiao-MoMi/Custom-Crops.git
synced 2025-12-19 15:09:25 +00:00
fix issue caused by corrupted event
This commit is contained in:
@@ -86,7 +86,8 @@ public abstract class AbstractCustomListener implements Listener {
|
||||
Material.TWISTING_VINES,
|
||||
Material.WEEPING_VINES,
|
||||
Material.KELP,
|
||||
Material.CACTUS
|
||||
Material.CACTUS,
|
||||
Material.AIR
|
||||
)
|
||||
);
|
||||
if (VersionManager.isHigherThan1_19()) {
|
||||
@@ -164,14 +165,12 @@ public abstract class AbstractCustomListener implements Listener {
|
||||
public void onPlaceBlock(BlockPlaceEvent event) {
|
||||
final Block block = event.getBlock();
|
||||
final Location location = block.getLocation();
|
||||
Optional<CustomCropsBlock> customCropsBlock = CustomCropsPlugin.get().getWorldManager().getBlockAt(SimpleLocation.of(location));
|
||||
if (customCropsBlock.isPresent()) {
|
||||
if (customCropsBlock.get() instanceof WorldPot || customCropsBlock.get() instanceof WorldGlass) {
|
||||
CustomCropsPlugin.get().getWorldManager().removeAnythingAt(SimpleLocation.of(location));
|
||||
} else {
|
||||
event.setCancelled(true);
|
||||
if (CUSTOM_MATERIAL.contains(block.getType())) {
|
||||
return;
|
||||
}
|
||||
Optional<CustomCropsBlock> customCropsBlock = CustomCropsPlugin.get().getWorldManager().getBlockAt(SimpleLocation.of(location));
|
||||
if (customCropsBlock.isPresent()) {
|
||||
CustomCropsPlugin.get().getWorldManager().removeAnythingAt(SimpleLocation.of(location));
|
||||
}
|
||||
this.onPlaceBlock(
|
||||
event.getPlayer(),
|
||||
|
||||
@@ -8,7 +8,7 @@ plugins {
|
||||
allprojects {
|
||||
|
||||
project.group = "net.momirealms"
|
||||
project.version = "3.5.10"
|
||||
project.version = "3.5.11"
|
||||
|
||||
apply<JavaPlugin>()
|
||||
apply(plugin = "java")
|
||||
|
||||
Reference in New Issue
Block a user