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