Skip to content

Commit

Permalink
Merge pull request #7 from xap3y/dev
Browse files Browse the repository at this point in the history
0.4
  • Loading branch information
xap3y authored Jul 4, 2024
2 parents e20b766 + b499887 commit 8c256a1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,10 @@
<artifactId>kotlin-stdlib-jdk8</artifactId>
<version>${kotlin.version}</version>
</dependency>
<dependency>
<groupId>com.github.cryptomorin</groupId>
<artifactId>XSeries</artifactId>
<version>11.2.0</version>
</dependency>
</dependencies>
</project>
7 changes: 4 additions & 3 deletions src/main/kotlin/eu/xap3y/xagui/GuiMenu.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

package eu.xap3y.xagui

import com.cryptomorin.xseries.XMaterial
import eu.xap3y.xagui.exceptions.PageOutOfBoundException
import eu.xap3y.xagui.exceptions.RowsOutOfBoundException
import eu.xap3y.xagui.exceptions.SlotOutOfBoundException
Expand Down Expand Up @@ -490,7 +491,7 @@ class GuiMenu(private val plugin: JavaPlugin, private val title: String, private
* @param slots The slots to fill
*/
override fun fillSlots(slots: Set<Int>) {
fillSlots(currentOpenedPage, slots, ItemStack(Material.GRAY_STAINED_GLASS_PANE).apply { itemMeta = itemMeta.apply { setDisplayName(" ") }})
fillSlots(currentOpenedPage, slots, ItemStack(XMaterial.GRAY_STAINED_GLASS_PANE.parseMaterial() ?: Material.AIR).apply { itemMeta = itemMeta.apply { setDisplayName(" ") }})
}

/**
Expand All @@ -508,7 +509,7 @@ class GuiMenu(private val plugin: JavaPlugin, private val title: String, private
* @param slots The slots to fill
*/
override fun fillSlots(page: Int, slots: Set<Int>) {
fillSlots(page, slots, ItemStack(Material.GRAY_STAINED_GLASS_PANE).apply { itemMeta = itemMeta.apply { setDisplayName(" ") }} )
fillSlots(page, slots, ItemStack(XMaterial.GRAY_STAINED_GLASS_PANE.parseMaterial() ?: Material.AIR).apply { itemMeta = itemMeta.apply { setDisplayName(" ") }} )
}

/**
Expand Down Expand Up @@ -561,7 +562,7 @@ class GuiMenu(private val plugin: JavaPlugin, private val title: String, private
@Throws(RowsOutOfBoundException::class)
fun fillBorder(rows: Int) {
if (rows > this.rows || rows < 1) throw RowsOutOfBoundException()
fillBorder(rows, ItemStack(Material.GRAY_STAINED_GLASS_PANE).apply { itemMeta = itemMeta.apply { setDisplayName(" ") }} )
fillBorder(rows, ItemStack(XMaterial.GRAY_STAINED_GLASS_PANE.parseMaterial() ?: Material.AIR).apply { itemMeta = itemMeta.apply { setDisplayName(" ") }} )
}
//private val inv: Inventory = Bukkit.createInventory(this, getSize(), getName())
}

0 comments on commit 8c256a1

Please sign in to comment.