Skip to content

Commit

Permalink
v1.2 - fix msg "Jetpack not set"
Browse files Browse the repository at this point in the history
  • Loading branch information
adi-itgg committed Mar 31, 2022
1 parent e3e87af commit edf54c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
}

group 'me.phantomx.fjetpackreloaded'
version '1.1'
version '1.2'

repositories {
mavenCentral()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import me.phantomx.fjetpackreloaded.modules.Module.messages
import me.phantomx.fjetpackreloaded.modules.Module.serverVersion
import me.phantomx.fjetpackreloaded.sealeds.OnDeath
import me.phantomx.fjetpackreloaded.sealeds.OnEmptyFuel
import org.bukkit.Bukkit
import org.bukkit.Effect
import org.bukkit.Material
import org.bukkit.Particle
Expand All @@ -29,7 +28,9 @@ import org.bukkit.event.inventory.ClickType
import org.bukkit.event.inventory.InventoryClickEvent
import org.bukkit.event.inventory.InventoryCreativeEvent
import org.bukkit.event.inventory.InventoryType
import org.bukkit.event.player.*
import org.bukkit.event.player.PlayerJoinEvent
import org.bukkit.event.player.PlayerQuitEvent
import org.bukkit.event.player.PlayerToggleSneakEvent
import org.bukkit.inventory.ItemStack
import kotlin.coroutines.CoroutineContext
import kotlin.math.sin
Expand All @@ -42,12 +43,12 @@ class EventListener : Listener, CoroutineScope {
@EventHandler(priority = EventPriority.LOWEST)
fun onCrouch(e: PlayerToggleSneakEvent) {
try {
e.player.apply player@{
e.player.apply player@ {
equipment?.let {
if (it.armorContents.isEmpty()) return
val armors = it.armorContents.iterator()
while (armors.hasNext()) {
armors.next()?.let i@{ armor ->
armors.next()?.let i@ { armor ->
if (armor.type == Material.AIR) return@i
armor.itemMeta?.let { meta ->
if (isSneaking || !meta.hasLore() || !(this as LivingEntity).isOnGround) return@i
Expand Down Expand Up @@ -241,8 +242,6 @@ class EventListener : Listener, CoroutineScope {
messages.turnOn.send(this@player)
return
}
} ?: run {
"&cJetpack not set!".send(this)
}
}
}
Expand Down

0 comments on commit edf54c2

Please sign in to comment.