Skip to content

Commit

Permalink
Deleted a unused function (HumanEntity.openShops)
Browse files Browse the repository at this point in the history
  • Loading branch information
LartyHD committed Jun 24, 2019
1 parent ac0025b commit 3071729
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions spigot/src/main/kotlin/de/astride/gungame/setup/Inventories.kt
Original file line number Diff line number Diff line change
Expand Up @@ -280,28 +280,6 @@ object Setup {

}

fun HumanEntity.openShops(pageID: Int, rawInventory: Inventory = Setup.shops) {

val inventory = InventoryBuilder(rawInventory.size, rawInventory.title).build().apply {
contents = rawInventory.contents
}

val pages = mutableListOf<Page>().apply {
for (i in 0 until configService.shops.locations.size / 7 + 1) add(ShopPage(i))
if (isEmpty()) add(ShopPage(0)) else if (configService.shops.locations.size % 7 == 0) removeAt(lastIndex)
}
val page = try {
pages[pageID].apply { page = pageID }
} catch (ex: IndexOutOfBoundsException) {
(this as? Player)?.playSound(location, Sound.ANVIL_LAND, 1f, 1f)
return
}

page.setItems(inventory)
openInventory(inventory)

}

fun HumanEntity.openMaps(pageID: Int): Unit = open(pageID, Setup.maps, configService.maps.maps.size) { MapsPage(it) }
fun HumanEntity.openShops(pageID: Int): Unit =
open(pageID, Setup.shops, configService.shops.locations.size) { ShopPage(it) }
Expand Down

0 comments on commit 3071729

Please sign in to comment.