Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/xenondevs/Nova into main
Browse files Browse the repository at this point in the history
  • Loading branch information
NichtStudioCode committed Sep 26, 2021
2 parents 6e5ca37 + b5a959c commit ee1551c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/kotlin/xyz/xenondevs/nova/world/LootGeneration.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package xyz.xenondevs.nova.world

import org.bukkit.Bukkit
import org.bukkit.NamespacedKey
import org.bukkit.event.EventHandler
import org.bukkit.event.Listener
import org.bukkit.event.world.LootGenerateEvent
Expand All @@ -12,6 +13,8 @@ import kotlin.random.Random

object LootGeneration : Listener {

@Suppress("DEPRECATION") // We need to specify the minecraft namespace explicitly
private val IGNORED_LOOT_TABLES = listOf(NamespacedKey("minecraft", "chests/jungle_temple_dispenser"))
private val lootFrequency = HashMap<String, Pair<Int, Int>>()
private val possibleLoot = ArrayList<NovaMaterial>()

Expand All @@ -28,7 +31,7 @@ object LootGeneration : Listener {

@EventHandler
fun handleLootGenerationEvent(event: LootGenerateEvent) {
if (event.lootTable.key.toString() == "minecraft:chests/jungle_temple_dispenser") return
if (event.lootTable.key in IGNORED_LOOT_TABLES) return

for (material in possibleLoot) {
val name = material.typeName.lowercase()
Expand Down

0 comments on commit ee1551c

Please sign in to comment.