initial
This commit is contained in:
@@ -56,9 +56,9 @@ class CrossBowShoot : JavaPlugin(), Listener {
|
|||||||
config.set("settings.knockback-base", 1.5)
|
config.set("settings.knockback-base", 1.5)
|
||||||
config.set("settings.knockback-max", 3.2)
|
config.set("settings.knockback-max", 3.2)
|
||||||
config.set("settings.immunity-duration", 10)
|
config.set("settings.immunity-duration", 10)
|
||||||
config.set("settings.messages.enabled", "${ChatColor.GREEN}Rocket jump enabled!")
|
config.set("settings.messages.enabled", "Rocket jump enabled!")
|
||||||
config.set("settings.messages.disabled", "${ChatColor.RED}Rocket jump disabled!")
|
config.set("settings.messages.disabled", "Rocket jump disabled!")
|
||||||
config.set("settings.messages.welcome", "${ChatColor.GOLD}Use /rocketjump to toggle CrossbBow Jump.")
|
config.set("settings.messages.welcome", "Use /rocketjump to toggle CrossbBow Jump.")
|
||||||
saveConfig()
|
saveConfig()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -75,19 +75,19 @@ class CrossBowShoot : JavaPlugin(), Listener {
|
|||||||
rocketJumpEnabled[uuid] = !isEnabled
|
rocketJumpEnabled[uuid] = !isEnabled
|
||||||
|
|
||||||
if (!isEnabled) {
|
if (!isEnabled) {
|
||||||
sender.sendMessage(config.getString("settings.messages.enabled") ?: "${ChatColor.GREEN}Rocket jump enabled!")
|
sender.sendMessage(config.getString("settings.messages.enabled") ?: "Rocket jump enabled!")
|
||||||
sender.playSound(sender.location, Sound.BLOCK_NOTE_BLOCK_PLING, 0.5f, 2.0f)
|
sender.playSound(sender.location, Sound.BLOCK_NOTE_BLOCK_PLING, 0.5f, 2.0f)
|
||||||
} else {
|
} else {
|
||||||
sender.sendMessage(config.getString("settings.messages.disabled") ?: "${ChatColor.RED}Rocket jump disabled!")
|
sender.sendMessage(config.getString("settings.messages.disabled") ?: "Rocket jump disabled!")
|
||||||
sender.playSound(sender.location, Sound.BLOCK_NOTE_BLOCK_BASS, 0.5f, 0.8f)
|
sender.playSound(sender.location, Sound.BLOCK_NOTE_BLOCK_BASS, 0.5f, 0.8f)
|
||||||
}
|
}
|
||||||
} else if (args[0].equals("status", ignoreCase = true)) {
|
} else if (args[0].equals("status", ignoreCase = true)) {
|
||||||
// Check status
|
// Check status
|
||||||
val status = if (isEnabled)
|
val status = if (isEnabled)
|
||||||
"${ChatColor.GREEN}ENABLED"
|
"ENABLED"
|
||||||
else
|
else
|
||||||
"${ChatColor.RED}DISABLED"
|
"DISABLED"
|
||||||
sender.sendMessage("${ChatColor.GOLD}Your rocket jump is currently: $status")
|
sender.sendMessage("Your rocket jump is currently: $status")
|
||||||
}
|
}
|
||||||
|
|
||||||
return@setExecutor true
|
return@setExecutor true
|
||||||
@@ -105,7 +105,7 @@ class CrossBowShoot : JavaPlugin(), Listener {
|
|||||||
// Send welcome message after a short delay
|
// Send welcome message after a short delay
|
||||||
server.scheduler.runTaskLater(this, Runnable {
|
server.scheduler.runTaskLater(this, Runnable {
|
||||||
player.sendMessage(config.getString("settings.messages.welcome")
|
player.sendMessage(config.getString("settings.messages.welcome")
|
||||||
?: "${ChatColor.GOLD} Use /rocketjump to toggle Crossbow Jump.")
|
?: "Use /rocketjump to toggle Crossbow Jump.")
|
||||||
|
|
||||||
// Mark as welcomed
|
// Mark as welcomed
|
||||||
player.setMetadata("crossbow_welcomed", FixedMetadataValue(this, true))
|
player.setMetadata("crossbow_welcomed", FixedMetadataValue(this, true))
|
||||||
@@ -346,9 +346,9 @@ class CrossBowShoot : JavaPlugin(), Listener {
|
|||||||
|
|
||||||
// Check if player has firework rockets in inventory
|
// Check if player has firework rockets in inventory
|
||||||
val hasRockets = mainHand.type == Material.FIREWORK_ROCKET ||
|
val hasRockets = mainHand.type == Material.FIREWORK_ROCKET ||
|
||||||
offHand.type == Material.FIREWORK_ROCKET ||
|
offHand.type == Material.FIREWORK_ROCKET ||
|
||||||
isCrossbowLoadedWithRocket(mainHand) ||
|
isCrossbowLoadedWithRocket(mainHand) ||
|
||||||
isCrossbowLoadedWithRocket(offHand)
|
isCrossbowLoadedWithRocket(offHand)
|
||||||
|
|
||||||
return holdingCrossbow && hasRockets
|
return holdingCrossbow && hasRockets
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,6 @@ settings:
|
|||||||
|
|
||||||
# Messages
|
# Messages
|
||||||
messages:
|
messages:
|
||||||
enabled: "&aRocket jump enabled!"
|
enabled: "Rocket jump enabled!"
|
||||||
disabled: "&cRocket jump disabled!"
|
disabled: "Rocket jump disabled!"
|
||||||
welcome: "&6Use /rocketjump to toggle Crossbow Jumping!."
|
welcome: "Use /rocketjump to toggle Crossbow Jumping!."
|
||||||
Reference in New Issue
Block a user