Fixed breaking crates
This commit is contained in:
@@ -3,6 +3,7 @@ package com.willfp.ecocrates.util
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import com.willfp.ecocrates.crate.OpenMethod
|
||||
import com.willfp.ecocrates.crate.placed.PlacedCrates
|
||||
import org.bukkit.GameMode
|
||||
import org.bukkit.event.EventHandler
|
||||
import org.bukkit.event.Listener
|
||||
import org.bukkit.event.block.Action
|
||||
@@ -42,6 +43,11 @@ class PlacedCrateListener(
|
||||
return
|
||||
}
|
||||
|
||||
// Fix breaking
|
||||
if (player.gameMode == GameMode.CREATIVE && player.isSneaking && event.action == Action.LEFT_CLICK_BLOCK) {
|
||||
return
|
||||
}
|
||||
|
||||
when (event.action) {
|
||||
Action.LEFT_CLICK_BLOCK -> crate.previewForPlayer(player)
|
||||
Action.RIGHT_CLICK_BLOCK -> crate.openPlaced(
|
||||
|
||||
Reference in New Issue
Block a user