-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug fixed for various details #major
- Loading branch information
devinfritz
committed
May 28, 2024
1 parent
5b0e750
commit 4a55261
Showing
32 changed files
with
179 additions
and
222 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
|
||
mkdir -p /app/server/plugins | ||
cp /app/tmp/app.jar /app/server/plugins/kia.jar | ||
cd /app/server | ||
exec java -jar -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 paper.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 0 additions & 36 deletions
36
src/main/kotlin/de/staticred/kia/events/InventoryMoveItemListener.kt
This file was deleted.
Oops, something went wrong.
65 changes: 12 additions & 53 deletions
65
src/main/kotlin/de/staticred/kia/example/InventoryExample.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,36 @@ | ||
package de.staticred.kia.example | ||
|
||
import de.staticred.kia.inventory.builder.* | ||
import de.staticred.kia.inventory.builder.kInventory | ||
import de.staticred.kia.inventory.builder.kItem | ||
import de.staticred.kia.inventory.extensions.openInventory | ||
import de.staticred.kia.util.ShiftDirection | ||
import de.staticred.kia.inventory.item.DraggingMode | ||
import de.staticred.kia.util.rows | ||
import net.kyori.adventure.text.Component | ||
import net.kyori.adventure.text.format.TextColor | ||
import net.kyori.adventure.text.format.TextDecoration | ||
import org.bukkit.Material | ||
import org.bukkit.command.Command | ||
import org.bukkit.command.CommandExecutor | ||
import org.bukkit.command.CommandSender | ||
import org.bukkit.enchantments.Enchantment | ||
import org.bukkit.entity.Player | ||
import org.bukkit.event.inventory.InventoryType | ||
import java.util.concurrent.TimeUnit | ||
|
||
class InventoryExample: Command("kia") { | ||
|
||
|
||
override fun execute(sender: CommandSender, p1: String, p2: Array<out String>?): Boolean { | ||
if (sender !is Player) return false | ||
|
||
|
||
val inventory = kInventory(sender, 5.rows, InventoryType.CHEST) { | ||
setItem(1, 4, kItem(Material.DIAMOND_PICKAXE) { | ||
onClick { kItem, player -> player.sendMessage("Cool you just clicked ${kItem.slot}") } | ||
}) | ||
} | ||
|
||
sender.openInventory(inventory) | ||
|
||
val defaultHeader = kPageController { | ||
nextBtn = kItem(Material.PAPER, 1) { | ||
setDisplayName(Component.text("Next Page ->")) | ||
} | ||
previousBtn = kItem(Material.PAPER, 1) { | ||
setDisplayName(Component.text("<- Previous Page")) | ||
} | ||
placeholderItem = kItem(Material.BLACK_STAINED_GLASS_PANE, 1) { | ||
setDisplayName(Component.text("'")) | ||
} | ||
builder = { nextBtn, previousBtn, placeholder -> run { | ||
kRow { | ||
setItem(0..1, placeholder!!) | ||
setItem(2, previousBtn!!) | ||
setItem(3..5, placeholder) | ||
setItem(6, nextBtn!!) | ||
setItem(7..8, placeholder) | ||
} | ||
}} | ||
} | ||
|
||
val pageInventory = kPageInventory(sender, 5.rows) { | ||
looping = true | ||
title = Component.text("Paging Inventory") | ||
|
||
mainPage { | ||
this.title = Component.text("This is the main page") | ||
header = defaultHeader | ||
} | ||
|
||
addPage { | ||
this.title = Component.text("Page 2") | ||
header = defaultHeader | ||
} | ||
|
||
addPage { | ||
this.title = Component.text("Page 3") | ||
header = defaultHeader | ||
title = Component.text("This is working") | ||
for (i in 0..8) { | ||
setItem(i, kItem(Material.DIAMOND) { | ||
draggingMode = DraggingMode.GLOBAL | ||
onClick { kItem, player -> | ||
player.sendMessage(Component.text(kItem.uuid.toString())) | ||
} | ||
} ) | ||
} | ||
} | ||
|
||
sender.openInventory(inventory) | ||
return true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.