diff options
author | Dico <dico.karssiens@gmail.com> | 2018-09-25 08:40:02 +0100 |
---|---|---|
committer | Dico <dico.karssiens@gmail.com> | 2018-09-25 08:40:02 +0100 |
commit | dcd90c09add292300b163edf44c26ddf99f1199b (patch) | |
tree | 7f4dac848950910dd4535cb1a946b84f6aa5aa0a /src/main/kotlin/io/dico/parcels2/listener/ParcelEntityTracker.kt | |
parent | 98395542a507e40a9058d2ed6332853ec20b23fc (diff) |
Work on RegionTraverser (wasted a lotta time but we'll get there)
Diffstat (limited to 'src/main/kotlin/io/dico/parcels2/listener/ParcelEntityTracker.kt')
-rw-r--r-- | src/main/kotlin/io/dico/parcels2/listener/ParcelEntityTracker.kt | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/main/kotlin/io/dico/parcels2/listener/ParcelEntityTracker.kt b/src/main/kotlin/io/dico/parcels2/listener/ParcelEntityTracker.kt index 3785770..198e0e7 100644 --- a/src/main/kotlin/io/dico/parcels2/listener/ParcelEntityTracker.kt +++ b/src/main/kotlin/io/dico/parcels2/listener/ParcelEntityTracker.kt @@ -33,7 +33,7 @@ class ParcelEntityTracker(val parcelProvider: ParcelProvider) { remove() val newParcel = parcelProvider.getParcelAt(entity.location) - if (newParcel !== parcel && !(newParcel != null && newParcel.hasBlockVisitors)) { + if (newParcel !== parcel && (newParcel == null || !newParcel.hasBlockVisitors)) { entity.remove() } @@ -41,14 +41,13 @@ class ParcelEntityTracker(val parcelProvider: ParcelProvider) { } val newParcel = parcelProvider.getParcelAt(entity.location) - if (newParcel !== parcel && !(newParcel != null && newParcel.hasBlockVisitors)) { + if (newParcel !== parcel && (newParcel == null || !newParcel.hasBlockVisitors)) { remove() entity.remove() } } } - @Suppress("RedundantLambdaArrow") fun swapParcels(parcel1: Parcel, parcel2: Parcel) { map.editLoop { -> if (value === parcel1) { |