Skip to content

Commit

Permalink
fix: blocklocker causing issues when not on server
Browse files Browse the repository at this point in the history
  • Loading branch information
Boy0000 committed Sep 22, 2024
1 parent a28ec29 commit 7e8ee86
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 12 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
group=com.mineinabyss
version=0.11
idofrontVersion=0.24.12
idofrontVersion=0.25.6
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import org.bukkit.inventory.ItemStack


private fun updateProtection(block: Block) =
blockLocker.protectionFinder.findProtection(block, SearchMode.ALL).ifPresent {
blockLocker?.protectionFinder?.findProtection(block, SearchMode.ALL)?.ifPresent {
it.signs.forEach { sign -> sign.location.sync(signUpdater()) }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import org.bukkit.event.world.StructureGrowEvent
import org.bukkit.inventory.EquipmentSlot

private fun syncBlockLocker(corr: Block) {
blockLocker.protectionFinder.findProtection(corr, SearchMode.ALL).ifPresent {
blockLocker?.protectionFinder?.findProtection(corr, SearchMode.ALL)?.ifPresent {
it.signs.forEach { linkedSign -> linkedSign.location.block.type = Material.AIR }
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import com.mineinabyss.deeperworld.world.section.*
import net.kyori.adventure.text.Component
import nl.rutgerkok.blocklocker.BlockLockerAPIv2
import nl.rutgerkok.blocklocker.BlockLockerPlugin
import org.bukkit.Bukkit
import org.bukkit.Location
import org.bukkit.Material
import org.bukkit.block.Block
Expand All @@ -13,7 +14,7 @@ import org.bukkit.block.sign.Side
import org.bukkit.inventory.ItemStack
import org.bukkit.util.Vector

internal val blockLocker: BlockLockerPlugin by lazy { BlockLockerAPIv2.getPlugin() }
internal val blockLocker: BlockLockerPlugin? by lazy { Bukkit.getPluginManager().getPlugin("BlockLocker") as? BlockLockerPlugin }

internal fun copyBlockData(original: Block, corresponding: Block) {
corresponding.blockData = original.blockData.clone()
Expand Down
8 changes: 0 additions & 8 deletions src/main/resources/paper-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,7 @@ dependencies:
required: false
load: BEFORE
join-classpath: true
ProtocolLib:
required: false
load: BEFORE
join-classpath: true
FastAsyncWorldEdit:
required: false
load: BEFORE
join-classpath: true
Multiverse-Core:
required: false
load: BEFORE
join-classpath: false

0 comments on commit 7e8ee86

Please sign in to comment.