Fix compile errors
This commit is contained in:
@@ -30,10 +30,7 @@ annotation class SuspensionTimeout(val millis: Int)
|
|||||||
|
|
||||||
open class WorldScope(val world: ParcelWorld) : ICommandReceiver
|
open class WorldScope(val world: ParcelWorld) : ICommandReceiver
|
||||||
open class ParcelScope(val parcel: Parcel) : WorldScope(parcel.world) {
|
open class ParcelScope(val parcel: Parcel) : WorldScope(parcel.world) {
|
||||||
fun checkCanManage(player: Player, action: String) = Validate.isTrue(
|
fun checkCanManage(player: Player, action: String) = Validate.isTrue(parcel.canManage(player), "You must own this parcel to $action")
|
||||||
player.hasPermAdminManage || parcel.hasPrivilegeToManage(player),
|
|
||||||
"You must own this parcel to $action"
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getParcelCommandReceiver(parcelProvider: ParcelProvider, context: ExecutionContext, method: Method, cmdName: String): ICommandReceiver {
|
fun getParcelCommandReceiver(parcelProvider: ParcelProvider, context: ExecutionContext, method: Method, cmdName: String): ICommandReceiver {
|
||||||
@@ -65,7 +62,7 @@ fun ParcelProvider.getParcelRequired(player: Player, privilege: Privilege? = nul
|
|||||||
OWNER ->
|
OWNER ->
|
||||||
Validate.isTrue(parcel.isOwner(player.uuid), "You must own this parcel to use that command")
|
Validate.isTrue(parcel.isOwner(player.uuid), "You must own this parcel to use that command")
|
||||||
CAN_MANAGE ->
|
CAN_MANAGE ->
|
||||||
Validate.isTrue(parcel.hasPrivilegeToManage(player), "You must have management privileges on this parcel to use that command")
|
Validate.isTrue(parcel.canManage(player), "You must have management privileges on this parcel to use that command")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package io.dico.parcels2.listener
|
|||||||
import io.dico.parcels2.Parcel
|
import io.dico.parcels2.Parcel
|
||||||
import io.dico.parcels2.ParcelProvider
|
import io.dico.parcels2.ParcelProvider
|
||||||
import io.dico.parcels2.util.ext.editLoop
|
import io.dico.parcels2.util.ext.editLoop
|
||||||
import io.dico.parcels2.util.ext.isPresentAnd
|
|
||||||
import org.bukkit.entity.Entity
|
import org.bukkit.entity.Entity
|
||||||
|
|
||||||
class ParcelEntityTracker(val parcelProvider: ParcelProvider) {
|
class ParcelEntityTracker(val parcelProvider: ParcelProvider) {
|
||||||
@@ -29,11 +28,20 @@ class ParcelEntityTracker(val parcelProvider: ParcelProvider) {
|
|||||||
if (entity.isDead) {
|
if (entity.isDead) {
|
||||||
remove(); return@editLoop
|
remove(); return@editLoop
|
||||||
}
|
}
|
||||||
if (parcel.isPresentAnd { hasBlockVisitors }) {
|
|
||||||
|
if (parcel != null && parcel.hasBlockVisitors) {
|
||||||
remove()
|
remove()
|
||||||
|
|
||||||
|
val newParcel = parcelProvider.getParcelAt(entity.location)
|
||||||
|
if (newParcel !== parcel && !(newParcel != null && newParcel.hasBlockVisitors)) {
|
||||||
|
entity.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
return@editLoop
|
||||||
}
|
}
|
||||||
|
|
||||||
val newParcel = parcelProvider.getParcelAt(entity.location)
|
val newParcel = parcelProvider.getParcelAt(entity.location)
|
||||||
if (newParcel !== parcel && !newParcel.isPresentAnd { hasBlockVisitors }) {
|
if (newParcel !== parcel && !(newParcel != null && newParcel.hasBlockVisitors)) {
|
||||||
remove()
|
remove()
|
||||||
entity.remove()
|
entity.remove()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user