Skip to content

Commit

Permalink
v1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
xtb7 committed Aug 2, 2024
1 parent 49f6771 commit c0a7fc5
Show file tree
Hide file tree
Showing 55 changed files with 13 additions and 24 deletions.
Binary file modified .gradle/8.8/executionHistory/executionHistory.bin
Binary file not shown.
Binary file modified .gradle/8.8/executionHistory/executionHistory.lock
Binary file not shown.
Binary file modified .gradle/8.8/fileHashes/fileHashes.bin
Binary file not shown.
Binary file modified .gradle/8.8/fileHashes/fileHashes.lock
Binary file not shown.
Binary file modified .gradle/8.8/fileHashes/resourceHashesCache.bin
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
3 changes: 1 addition & 2 deletions .idea/modules/JumpPad.main.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified build/classes/kotlin/main/net/xtb/jumpPad/Configuration.class
Binary file not shown.
Binary file modified build/classes/kotlin/main/net/xtb/jumpPad/JumpPad.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified build/classes/kotlin/main/net/xtb/jumpPad/JumpPadKt.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
�&�$�$�$
�&�$�$�$�$
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
42
45
0
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified build/kotlin/compileKotlin/cacheable/last-build.bin
Binary file not shown.
Binary file modified build/kotlin/compileKotlin/local-state/build-history.bin
Binary file not shown.
Binary file modified build/libs/JumpPad-1.0-SNAPSHOT-all.jar
Binary file not shown.
Binary file modified build/libs/JumpPad-1.0-SNAPSHOT.jar
Binary file not shown.
8 changes: 4 additions & 4 deletions src/main/kotlin/net/xtb/jumpPad/JumpPad.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class JumpPad : JavaPlugin(), TabCompleter {
dataFile.createNewFile()
net.xtb.jumpPad.config = Configuration()
}
logger.info("JumpPad 1.0.0 Enabled!")
logger.info("JumpPad 1.0.1 Enabled!")
}

override fun onDisable() {
Expand All @@ -50,12 +50,12 @@ class JumpPad : JavaPlugin(), TabCompleter {
}
"blacklist" -> {
when(args.getOrNull(2)) {
null -> return arrayListOf("add", "remove", "enable", "disable", "info")
null -> return arrayListOf("add", "remove", "enable", "info")
}
}
"whitelist" -> {
when(args.getOrNull(2)) {
null -> return arrayListOf("add", "remove", "enable", "disable", "info")
null -> return arrayListOf("add", "remove", "enable", "info")
}
}
}
Expand All @@ -70,5 +70,5 @@ data class Configuration(
var isBlackListEnabled : Boolean = false,
var blackListedLocations : ArrayList<String> = arrayListOf(),
var whiteListedLocations : ArrayList<String> = arrayListOf(),
var jumppadVectors : HashMap<String, Pair<Int, Int>> = HashMap()
var jumppadVectors : HashMap<String, Pair<Float, Float>> = HashMap()
)
18 changes: 4 additions & 14 deletions src/main/kotlin/net/xtb/jumpPad/JumpPadCommandHandler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@ class JumpPadCommandHandler : CommandExecutor {
override fun onCommand(sender: CommandSender, command: Command, label: String, args: Array<out String>?): Boolean {
when(args!!.size) {
0 -> {
sender.sendMessage(text("JumpPad v1.0.0 - xtb7/jumppad (Github)", color(0, 255, 0), TextDecoration.UNDERLINED).clickEvent(ClickEvent.openUrl("https://github.com/xtb7")))
sender.sendMessage(text("JumpPad v1.0.1 - xtb7/jumppad (Github)", color(0, 255, 0), TextDecoration.UNDERLINED).clickEvent(ClickEvent.openUrl("https://github.com/xtb7/JumpPad")))
return true
}
else -> {
val jumppad = (sender as Player).getTargetBlockExact(5)?:return false
when(args[0]) {
"set" -> {
val vector = config.jumppadVectors[Common.locationToString(jumppad.location)]?:Pair(1, 1)
val vector = config.jumppadVectors[Common.locationToString(jumppad.location)]?:Pair(1F, 1F)
when(args.getOrNull(1)) {
"x" -> {
config.jumppadVectors[Common.locationToString(jumppad.location)] = Pair((args.getOrNull(2)?:return false).toInt(), vector.second)
config.jumppadVectors[Common.locationToString(jumppad.location)] = Pair((args.getOrNull(2)?:return false).toFloatOrNull()?:return false, vector.second)
sender.sendMessage(text("You have successfully set the x multiplier."))
return true
}
"y" -> {
config.jumppadVectors[Common.locationToString(jumppad.location)] = Pair(vector.first, (args.getOrNull(2)?:return false).toInt())
config.jumppadVectors[Common.locationToString(jumppad.location)] = Pair(vector.first, (args.getOrNull(2)?:return false).toFloatOrNull()?:return false)
sender.sendMessage(text("You have successfully set the y value."))
return true
}
Expand All @@ -49,11 +49,6 @@ class JumpPadCommandHandler : CommandExecutor {
config.isBlackListEnabled = false
sender.sendMessage(text("You have enabled the whitelist and disabled the blacklist."))
}
"disable" -> {
config.isWhiteListEnabled = false
config.isBlackListEnabled = true
sender.sendMessage(text("You have disabled the whitelist and enabled the blacklist."))
}
"info" -> sender.sendMessage(text("Selected Jumppad Info:\nIs Whitelisted: ${config.whiteListedLocations.contains(Common.locationToString(jumppad.location))}"))
}
return true
Expand All @@ -73,11 +68,6 @@ class JumpPadCommandHandler : CommandExecutor {
config.isWhiteListEnabled = false
sender.sendMessage(text("You have enabled the blacklist and disabled the whitelist."))
}
"disable" -> {
config.isBlackListEnabled = false
config.isWhiteListEnabled = true
sender.sendMessage(text("You have disabled the blacklist and enabled the whitelist."))
}
"info" -> sender.sendMessage(text("Selected Jumppad Info:\nIs Blacklisted: ${config.blackListedLocations.contains(Common.locationToString(jumppad.location))}"))
}
return true
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/net/xtb/jumpPad/JumpPadInteractHandler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class JumpPadInteractHandler : Listener {
if(e.action != Action.PHYSICAL || !e.player.hasPermission("jumppad.use") || (config.isWhiteListEnabled && !config.whiteListedLocations.contains(Common.locationToString(e.clickedBlock!!.location))) || (config.isBlackListEnabled && config.blackListedLocations.contains(Common.locationToString(e.clickedBlock!!.location)))) {
return
}
val vector = config.jumppadVectors[Common.locationToString(e.clickedBlock!!.location)]?: Pair(1, 1)
val vector = config.jumppadVectors[Common.locationToString(e.clickedBlock!!.location)]?: Pair(1F, 1F)
e.player.velocity = e.player.location.direction.multiply(vector.first).setY(vector.second)
}
else -> return
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: JumpPad
version: '1.0.0'
version: '1.0.1'
main: net.xtb.jumpPad.JumpPad
api-version: '1.21'
commands:
Expand Down

0 comments on commit c0a7fc5

Please sign in to comment.