Tiny fixes
This commit is contained in:
@@ -9,6 +9,7 @@ import io.dico.parcels2.*
|
||||
import io.dico.parcels2.command.ProfileKind.Companion.ANY
|
||||
import io.dico.parcels2.command.ProfileKind.Companion.FAKE
|
||||
import io.dico.parcels2.command.ProfileKind.Companion.REAL
|
||||
import org.bukkit.Location
|
||||
import org.bukkit.command.CommandSender
|
||||
import org.bukkit.entity.Player
|
||||
|
||||
@@ -70,4 +71,13 @@ class ProfileParameterType : ParameterType<PlayerProfile, Int>(PlayerProfile::cl
|
||||
return PlayerProfile.byName(input, allowReal, allowFake)
|
||||
}
|
||||
|
||||
override fun complete(
|
||||
parameter: Parameter<PlayerProfile, Int>,
|
||||
sender: CommandSender,
|
||||
location: Location?,
|
||||
buffer: ArgumentBuffer
|
||||
): MutableList<String> {
|
||||
logger.info("Completing PlayerProfile: ${buffer.next()}")
|
||||
return super.complete(parameter, sender, location, buffer)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -266,6 +266,8 @@ class ParcelListeners(
|
||||
}
|
||||
}
|
||||
|
||||
// private val blockPlaceInteractItems = EnumSet.of(LAVA_BUCKET, WATER_BUCKET, BUCKET, FLINT_AND_STEEL)
|
||||
|
||||
@Suppress("NON_EXHAUSTIVE_WHEN")
|
||||
private fun onPlayerRightClick(event: PlayerInteractEvent, world: ParcelWorld, parcel: Parcel?) {
|
||||
if (event.hasItem()) {
|
||||
@@ -275,9 +277,11 @@ class ParcelListeners(
|
||||
event.isCancelled = true; return
|
||||
}
|
||||
|
||||
if (!canBuildOnArea(event.player, parcel)) {
|
||||
when (item) {
|
||||
LAVA_BUCKET, WATER_BUCKET, BUCKET, FLINT_AND_STEEL -> {
|
||||
when (item) {
|
||||
LAVA_BUCKET, WATER_BUCKET, BUCKET, FLINT_AND_STEEL -> {
|
||||
val block = event.clickedBlock.getRelative(event.blockFace)
|
||||
val otherParcel = world.getParcelAt(block)
|
||||
if (!canBuildOnArea(event.player, otherParcel)) {
|
||||
event.isCancelled = true
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user