From 2587c509ca5ff870fe388df052420f450f514cb0 Mon Sep 17 00:00:00 2001 From: TheOnlyTails Date: Tue, 31 Aug 2021 14:40:31 +0300 Subject: [PATCH] Updated the library with the new name. --- .github/ISSUE_TEMPLATE/bug_report.yml | 11 +- CONTRIBUTING.md | 28 +-- README.md | 32 ++-- build.gradle.kts | 17 +- gradle.properties | 16 +- gradle/wrapper/gradle-wrapper.properties | 2 +- lootgoblin-logo.svg | 164 ++++++++++++++++++ settings.gradle.kts | 2 +- .../LootConditions.kt | 28 +-- .../{loottables => lootgoblin}/LootEntries.kt | 34 ++-- .../LootFunctions.kt | 52 +++--- .../LootGoblin.kt} | 19 +- .../{loottables => lootgoblin}/LootMisc.kt | 18 +- .../{loottables => lootgoblin}/LootPools.kt | 14 +- .../LootPredicates.kt | 26 +-- .../LootGoblinTest.kt} | 8 +- src/test/resources/META-INF/mods.toml | 2 +- src/test/resources/pack.mcmeta | 2 +- 18 files changed, 331 insertions(+), 144 deletions(-) create mode 100644 lootgoblin-logo.svg rename src/main/kotlin/com/theonlytails/{loottables => lootgoblin}/LootConditions.kt (97%) rename src/main/kotlin/com/theonlytails/{loottables => lootgoblin}/LootEntries.kt (97%) rename src/main/kotlin/com/theonlytails/{loottables => lootgoblin}/LootFunctions.kt (94%) rename src/main/kotlin/com/theonlytails/{loottables/LootTables.kt => lootgoblin/LootGoblin.kt} (87%) rename src/main/kotlin/com/theonlytails/{loottables => lootgoblin}/LootMisc.kt (94%) rename src/main/kotlin/com/theonlytails/{loottables => lootgoblin}/LootPools.kt (94%) rename src/main/kotlin/com/theonlytails/{loottables => lootgoblin}/LootPredicates.kt (95%) rename src/test/kotlin/com/theonlytails/{loottables/LootTablesTest.kt => lootgoblin/LootGoblinTest.kt} (94%) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 89703e5..90d89fd 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -28,12 +28,13 @@ body: - type: dropdown id: loottables-version attributes: - label: LootTables Version - description: What version of LootTables are you running? + label: LootGoblin Version + description: What version of LootGoblin are you running? options: - - v0.2.14 (Latest) - - v0.2.13 - - v0.2.12 + - v0.2.15 (Latest) + - v0.2.14 + - v0.2.13 + - v0.2.12 - v0.2.11 - v0.2.10 - v0.2.9 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index acb6705..0aaf0f5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,11 +1,11 @@ # Contribution Guidelines -Welcome, and thank you for contributing to LootTables! Here's how you do it: +Welcome, and thank you for contributing to LootGoblin! Here's how you do it: ## Step #1 - What do I add? If you don't know what to add, it's recommended to play around and find things you want to improve by experimenting. -Still clueless? Pick an issue from the [issue tracker](https://github.com/theonlytails/loottables/issues). +Still clueless? Pick an issue from the [issue tracker](https://github.com/theonlytails/LootGoblin/issues). ## Step #2 - Forking and Cloning @@ -17,21 +17,29 @@ Now that you have your own copy, make a new branch with a descriptive name (no, ## Step #3 - Write the Code -Just - do it. There's not much to detail here. Regarding code styling, stick to the [official guidelines](https://kotlinlang.org/docs/coding-conventions.html) supplied by the Kotlin team. (Note: every function, property and class must have [KDocs](https://kotlinlang.org/docs/kotlin-doc.html) attached) - +Just - do it. There's not much to detail here. Regarding code styling, stick to +the [official guidelines](https://kotlinlang.org/docs/coding-conventions.html) supplied by the Kotlin team. (Note: every +function, property and class must have [KDocs](https://kotlinlang.org/docs/kotlin-doc.html) attached) ## Step #4 - Make a Pull Request -Once you're done coding your new feature/bugfix, come back to your fork, and make a new Pull Request from your branch to the [main branch](https://github.com/theonlytails/loottables/tree/main). +Once you're done coding your new feature/bugfix, come back to your fork, and make a new Pull Request from your branch to +the [main branch](https://github.com/theonlytails/LootGoblin/tree/main). Before creating your PR, make sure to: -- Request a review from [@TheOnlyTails](https://github.com/theonlytails] + +- Request a review from [@TheOnlyTails](https://github.com/theonlytails). - Add a relevant label. -- If your PR is supposed to close an issue, add ["Closes #"](https://docs.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue) (e.g. "Closes #3" for issue number 3) at the end of your PR message. +- If your PR is supposed to close an issue, + add ["Closes #"](https://docs.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue) ( + e.g. "Closes #3" for issue number 3) at the end of your PR message. -Now that you've created your PR, the reviewers will discuss the changes with you, and automated checks will run on your code. -**IMPORTANT:** Make sure to [enable *auto-squash and merge*](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/automatically-merging-a-pull-request#enabling-auto-merge). Once it's enabled, your PR will be automatically merged once all checks pass and reviewers approve. +Now that you've created your PR, the reviewers will discuss the changes with you, and automated checks will run on your +code. +**IMPORTANT:** Make sure to [enable *auto-squash and +merge*](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/automatically-merging-a-pull-request#enabling-auto-merge) +. Once it's enabled, your PR will be automatically merged once all checks pass and reviewers approve. ## Step #5 - Celebrate -Hurray! You've made your first contribution to LootTables! 🎉 +Hurray! You've made your first contribution to LootGoblin! 🎉 diff --git a/README.md b/README.md index 9c296b8..b0beced 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,25 @@ -[![Maven metadata URL](https://img.shields.io/maven-metadata/v?color=blue&label=maven%20central&logo=gradle&metadataUrl=https%3A%2F%2Fs01.oss.sonatype.org%2Fservice%2Flocal%2Frepositories%2Freleases%2Fcontent%2Fcom%2Ftheonlytails%2Floottables%2Fmaven-metadata.xml&style=for-the-badge)](https://search.maven.org/artifact/com.theonlytails/loottables) -![GitHub Workflow Status](https://img.shields.io/github/workflow/status/TheOnlyTails/loottables/Java%20CI%20with%20Gradle?label=gradle%20build&logo=github&style=for-the-badge) +[![Maven metadata URL](https://img.shields.io/maven-metadata/v?color=blue&label=maven%20central&logo=gradle&metadataUrl=https%3A%2F%2Fs01.oss.sonatype.org%2Fservice%2Flocal%2Frepositories%2Freleases%2Fcontent%2Fcom%2Ftheonlytails%2lootgoblin%2Fmaven-metadata.xml&style=for-the-badge)](https://search.maven.org/artifact/com.theonlytails/lootgoblin) +![GitHub Workflow Status](https://img.shields.io/github/workflow/status/TheOnlyTails/LootGoblin/Java%20CI%20with%20Gradle?label=gradle%20build&logo=github&style=for-the-badge) ![Kotlin](https://img.shields.io/badge/kotlin-%236C3FD1.svg?style=for-the-badge&logo=kotlin&logoColor=white) ![Gradle](https://img.shields.io/badge/gradle-%2302303A.svg?style=for-the-badge&logo=gradle&logoColor=white) -![GitHub License](https://img.shields.io/github/license/theonlytails/loottables?style=for-the-badge&logo=key) +![GitHub License](https://img.shields.io/github/license/theonlytails/LootGoblin?style=for-the-badge&logo=key) + +--- *Announcement: LootTables will be ported to 1.17* -# LootTables +![LootGoblin](lootgoblin-logo.svg) + +# LootGoblin A Kotlin DSL for creating loot tables in Minecraft Forge mods. -For documentation and usage instructions, please take a look at the [wiki](https://github.com/TheOnlyTails/LootTables/wiki). +For documentation and usage instructions, please take a look at +the [wiki](https://github.com/TheOnlyTails/LootGoblin/wiki). -Here's the [`maven-metadata.xml`](https://s01.oss.sonatype.org/service/local/repositories/releases/content/com/theonlytails/loottables/maven-metadata.xml) of this library. +Here's +the [`maven-metadata.xml`](https://s01.oss.sonatype.org/service/local/repositories/releases/content/com/theonlytails/lootgoblin/maven-metadata.xml) +of this library. ## Installation @@ -20,17 +27,17 @@ _Don't forget to replace the VERSION key with the version in the top with the Ma #### Gradle/Groovy -```groovy +```gradle repositories { mavenCentral() } dependencies { - def lootTables = fg.deobf(project.dependencies.create(group: "com.theonlytails", name: "loottables", version: VERSION) { + def lootGoblin = fg.deobf(project.dependencies.create(group: "com.theonlytails", name: "lootgoblin", version: VERSION) { transitive = false }) - implementation fg.deobf(lootTables) + implementation fg.deobf(lootGoblin) } ``` @@ -41,10 +48,10 @@ repositories { } dependencies { - val lootTables = project.dependencies.create(group = "com.theonlytails", name = "loottables", version = VERSION) + val lootGoblin = project.dependencies.create(group = "com.theonlytails", name = "lootgoblin", version = VERSION) .apply { isTransitive = false } - implementation(project.the().deobf(lootTables)) + implementation(project.the().deobf(lootGoblin)) } ``` @@ -52,4 +59,5 @@ The `isTransitive` property is added to make sure the library is imported correc --- -Want to generate block models with a DSL like this? Check out [BlockModels](https://github.com/theonlytails/blockmodels)! +Want to generate block models with a DSL like this? Check +out [ModelGoblin](https://github.com/theonlytails/ModelGoblin)! diff --git a/build.gradle.kts b/build.gradle.kts index 43448a5..0df8535 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,4 +1,3 @@ - import com.vanniktech.maven.publish.MavenPublishPluginExtension import com.vanniktech.maven.publish.SonatypeHost import net.minecraftforge.gradle.userdev.UserDevExtension @@ -10,7 +9,7 @@ import java.time.format.DateTimeFormatter.ISO_INSTANT plugins { idea `java-library` - kotlin("jvm") version "latest.release" + kotlin("jvm") version "1.5.30" id("net.minecraftforge.gradle") id("com.vanniktech.maven.publish") } @@ -24,7 +23,7 @@ val modId = findProperty("POM_ARTIFACT_ID") as String val projectName = findProperty("POM_NAME") as String val projectAuthor = findProperty("POM_DEVELOPER_NAME") as String -val testModId = "loottables_test" +val testModId = "lootgoblin_test" // JVM Info println( @@ -37,7 +36,6 @@ println( dependencies { "minecraft"(group = "net.minecraftforge", name = "forge", version = "$minecraftVersion-$forgeVersion") - implementation(group = "thedarkcolour", name = "kotlinforforge", version = "latest.release") testImplementation( group = "org.jetbrains.kotlin", name = "kotlin-test-junit5", @@ -89,6 +87,7 @@ repositories { name = "kotlinforforge" url = uri("https://thedarkcolour.github.io/KotlinForForge/") } + mavenCentral() } // Setup @@ -131,4 +130,12 @@ tasks.named("jar") { extensions.getByType().sonatypeHost = SonatypeHost.S01 // Testing -tasks.withType { useJUnitPlatform() } \ No newline at end of file +tasks.withType { useJUnitPlatform() } +val compileKotlin: KotlinCompile by tasks +compileKotlin.kotlinOptions { + jvmTarget = "1.8" +} +val compileTestKotlin: KotlinCompile by tasks +compileTestKotlin.kotlinOptions { + jvmTarget = "1.8" +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 77f1095..a2c35ef 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,22 +3,22 @@ org.gradle.jvmargs=-Xmx3G org.gradle.daemon=false # Versions minecraftVersion=1.17.1 -forgeVersion=37.0.5 +forgeVersion=37.0.48 forgeGradleVersion=5.+ # Maven publishing GROUP=com.theonlytails -POM_ARTIFACT_ID=loottables -VERSION_NAME=0.2.14 -POM_NAME=LootTables +POM_ARTIFACT_ID=lootgoblin +VERSION_NAME=0.2.15 +POM_NAME=LootGoblin POM_DESCRIPTION=A Kotlin DSL for creating loot tables in Minecraft Forge mods. POM_INCEPTION_YEAR=2021 -POM_URL=https://github.com/theonlytails/loottables +POM_URL=https://github.com/theonlytails/lootgoblin POM_LICENCE_NAME=MIT License POM_LICENCE_URL=https://www.opensource.org/licenses/mit-license.php POM_LICENCE_DIST=repo -POM_SCM_URL=https://github.com/theonlytails/loottables/ -POM_SCM_CONNECTION=scm:git:git://github.com/theonlytails/loottables.git -POM_SCM_DEV_CONNECTION=scm:git:ssh://git@github.com/theonlytails/loottables.git +POM_SCM_URL=https://github.com/theonlytails/lootgoblin/ +POM_SCM_CONNECTION=scm:git:git://github.com/theonlytails/lootgoblin.git +POM_SCM_DEV_CONNECTION=scm:git:ssh://git@github.com/theonlytails/lootgoblin.git POM_DEVELOPER_ID=theonlytails POM_DEVELOPER_NAME=TheOnlyTails POM_DEVELOPER_URL=https://github.com/theonlytails/ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 05679dc..ffed3a2 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/lootgoblin-logo.svg b/lootgoblin-logo.svg new file mode 100644 index 0000000..3f12da6 --- /dev/null +++ b/lootgoblin-logo.svg @@ -0,0 +1,164 @@ + + + + + + + + LootGoblin + + + + + + + diff --git a/settings.gradle.kts b/settings.gradle.kts index 5b40439..3b9113e 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,4 +1,4 @@ -rootProject.name = "LootTables" +rootProject.name = "LootGoblin" pluginManagement { repositories { diff --git a/src/main/kotlin/com/theonlytails/loottables/LootConditions.kt b/src/main/kotlin/com/theonlytails/lootgoblin/LootConditions.kt similarity index 97% rename from src/main/kotlin/com/theonlytails/loottables/LootConditions.kt rename to src/main/kotlin/com/theonlytails/lootgoblin/LootConditions.kt index e2f6f3a..ccfb12c 100644 --- a/src/main/kotlin/com/theonlytails/loottables/LootConditions.kt +++ b/src/main/kotlin/com/theonlytails/lootgoblin/LootConditions.kt @@ -1,4 +1,4 @@ -package com.theonlytails.loottables +package com.theonlytails.lootgoblin import net.minecraft.advancements.critereon.* import net.minecraft.core.BlockPos @@ -35,7 +35,7 @@ typealias InvertedCondition = InvertedLootItemCondition * @param condition the condition being inverted. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun inverted(condition: Condition, body: Condition.() -> Condition = { this }) = invert(condition).body() /** @@ -44,7 +44,7 @@ fun inverted(condition: Condition, body: Condition.() -> Condition = { this }) = * @param conditions the conditions being chosen from. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun alternative( conditions: Collection, body: Condition.() -> Condition = { this }, @@ -56,7 +56,7 @@ fun alternative( * @param chance the chance of this condition. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun randomChance(chance: Float, body: Condition.() -> Condition = { this }) = randomChance(chance).body() /** @@ -66,7 +66,7 @@ fun randomChance(chance: Float, body: Condition.() -> Condition = { this }) = ra * @param lootingMultiplier the multiplier of the output if looting is applied. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun randomChanceWithLooting( chance: Float, lootingMultiplier: Float, @@ -80,7 +80,7 @@ fun randomChanceWithLooting( * @param predicate the [EntityPredicate] that matches against the targeted entity. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun entityProperties( target: LootContext.EntityTarget, predicate: EntityPredicate.Builder, @@ -93,7 +93,7 @@ fun entityProperties( * @param target the entity targeted by this condition. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun entityPresent(target: LootContext.EntityTarget, body: Condition.() -> Condition = { this }) = entityPresent(target).body() @@ -102,7 +102,7 @@ fun entityPresent(target: LootContext.EntityTarget, body: Condition.() -> Condit * * @author TheOnlyTails */ -@LootTables +@LootGoblin fun killedByPlayer(body: Condition.() -> Condition = { this }) = killedByPlayer().body() /** @@ -111,7 +111,7 @@ fun killedByPlayer(body: Condition.() -> Condition = { this }) = killedByPlayer( * @param block the block of this condition. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun blockStateProperty( block: Block, body: BlockPropertyCondition.Builder.() -> BlockPropertyCondition.Builder = { this } @@ -124,7 +124,7 @@ fun blockStateProperty( * @param predicate the predicate that matches against the tool in this condition. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun matchTool(predicate: ItemPredicate.Builder, body: Condition.() -> Condition = { this }) = toolMatches(predicate).body() @@ -136,7 +136,7 @@ fun matchTool(predicate: ItemPredicate.Builder, body: Condition.() -> Condition * @author TheOnlyTails */ -@LootTables +@LootGoblin fun tableBonus( enchantment: Enchantment, vararg chances: Float, @@ -148,7 +148,7 @@ fun tableBonus( * * @author TheOnlyTails */ -@LootTables +@LootGoblin fun survivesExplosion(body: Condition.() -> Condition = { this }) = survivesExplosion().body() /** @@ -157,7 +157,7 @@ fun survivesExplosion(body: Condition.() -> Condition = { this }) = survivesExpl * @param predicate the [DamageSourcePredicate] that this condition matches against. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun damageSourceProperties( predicate: DamageSourcePredicate.Builder, body: Condition.() -> Condition = { this }, @@ -170,7 +170,7 @@ fun damageSourceProperties( * @param predicate the [LocationPredicate] that this condition matches against. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun locationCheck( pos: BlockPos = BlockPos.ZERO, predicate: LocationPredicate.Builder, diff --git a/src/main/kotlin/com/theonlytails/loottables/LootEntries.kt b/src/main/kotlin/com/theonlytails/lootgoblin/LootEntries.kt similarity index 97% rename from src/main/kotlin/com/theonlytails/loottables/LootEntries.kt rename to src/main/kotlin/com/theonlytails/lootgoblin/LootEntries.kt index 2da7f3e..f6db8d5 100644 --- a/src/main/kotlin/com/theonlytails/loottables/LootEntries.kt +++ b/src/main/kotlin/com/theonlytails/lootgoblin/LootEntries.kt @@ -1,4 +1,4 @@ -package com.theonlytails.loottables +package com.theonlytails.lootgoblin import net.minecraft.resources.ResourceLocation import net.minecraft.tags.Tag @@ -24,7 +24,7 @@ typealias EntryBuilder = Entry.Builder<*> * @throws [LootTableCreationException] if the entry returned is `null`. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun Pool.itemEntry( item: ItemLike, weight: Int = 1, @@ -42,7 +42,7 @@ fun Pool.itemEntry( * @throws [LootTableCreationException] if the entry returned is `null`. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun AlternativesEntry.Builder.itemEntry( item: ItemLike, weight: Int = 1, @@ -60,7 +60,7 @@ fun AlternativesEntry.Builder.itemEntry( * @throws [LootTableCreationException] if the entry returned is `null`. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun Pool.tagEntry( tag: Tag, weight: Int = 1, @@ -78,7 +78,7 @@ fun Pool.tagEntry( * @throws [LootTableCreationException] if the entry returned is `null`. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun AlternativesEntry.Builder.tagEntry( tag: Tag, weight: Int = 1, @@ -97,7 +97,7 @@ fun AlternativesEntry.Builder.tagEntry( * @throws [LootTableCreationException] if the entry returned is `null`. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun Pool.tableEntry( lootTable: ResourceLocation, weight: Int = 1, @@ -116,7 +116,7 @@ fun Pool.tableEntry( * @throws [LootTableCreationException] if the entry returned is `null`. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun AlternativesEntry.Builder.tableEntry( lootTable: ResourceLocation, weight: Int = 1, @@ -135,7 +135,7 @@ fun AlternativesEntry.Builder.tableEntry( * @throws [LootTableCreationException] if the entry returned is `null`. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun Pool.dynamicEntry( id: ResourceLocation, weight: Int = 1, @@ -153,7 +153,7 @@ fun Pool.dynamicEntry( * @throws [LootTableCreationException] if the entry returned is `null`. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun AlternativesEntry.Builder.dynamicEntry( id: ResourceLocation, weight: Int = 1, @@ -171,7 +171,7 @@ fun AlternativesEntry.Builder.dynamicEntry( * @throws [LootTableCreationException] if the entry returned is `null`. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun Pool.alternativesEntry( vararg entries: EntryBuilder, addToPool: Boolean = true, @@ -187,7 +187,7 @@ fun Pool.alternativesEntry( * @throws [LootTableCreationException] if the entry returned is `null`. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun AlternativesEntry.Builder.alternativesEntry( vararg entries: EntryBuilder, addToPool: Boolean = true, @@ -202,7 +202,7 @@ fun AlternativesEntry.Builder.alternativesEntry( * @throws [LootTableCreationException] if the entry returned is `null`. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun Pool.emptyEntry( weight: Int = 1, quality: Int = 0, @@ -219,7 +219,7 @@ fun Pool.emptyEntry( * @throws [LootTableCreationException] if the entry returned is `null`. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun AlternativesEntry.Builder.emptyEntry( weight: Int = 1, quality: Int = 0, @@ -234,7 +234,7 @@ fun AlternativesEntry.Builder.emptyEntry( * @throws [LootTableCreationException] if the entry returned is `null`. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun EntryBuilder.condition(getCondition: () -> LootConditionBuilder) = `when`(getCondition()) ?: throw LootTableCreationException("Something went wrong while adding a condition to a loot entry") @@ -244,7 +244,7 @@ fun EntryBuilder.condition(getCondition: () -> LootConditionBuilder) = `when`(ge * @throws [LootTableCreationException] if the entry returned is `null`. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun StandaloneEntry<*>.function(getFunction: () -> LootFunctionBuilder) = apply(getFunction()) ?: throw LootTableCreationException("Something went wrong while adding a function to a loot entry") @@ -253,7 +253,7 @@ fun StandaloneEntry<*>.function(getFunction: () -> LootFunctionBuilder) = apply( * * @author TheOnlyTails */ -@LootTables +@LootGoblin fun EntryBuilder.condition(vararg conditions: LootConditionBuilder) = this.also { conditions.forEach { condition { it } } } @@ -263,7 +263,7 @@ fun EntryBuilder.condition(vararg conditions: LootConditionBuilder) = this.also * * @author TheOnlyTails */ -@LootTables +@LootGoblin fun StandaloneEntry<*>.function(vararg functions: LootFunctionBuilder) = this.also { functions.forEach { function { it } } } diff --git a/src/main/kotlin/com/theonlytails/loottables/LootFunctions.kt b/src/main/kotlin/com/theonlytails/lootgoblin/LootFunctions.kt similarity index 94% rename from src/main/kotlin/com/theonlytails/loottables/LootFunctions.kt rename to src/main/kotlin/com/theonlytails/lootgoblin/LootFunctions.kt index 2d0fec5..749d83b 100644 --- a/src/main/kotlin/com/theonlytails/loottables/LootFunctions.kt +++ b/src/main/kotlin/com/theonlytails/lootgoblin/LootFunctions.kt @@ -1,16 +1,15 @@ -package com.theonlytails.loottables +package com.theonlytails.lootgoblin import net.minecraft.nbt.CompoundTag import net.minecraft.world.item.enchantment.Enchantment import net.minecraft.world.level.block.Block import net.minecraft.world.level.block.state.BlockState -import net.minecraft.world.level.storage.loot.IntRange +import net.minecraft.world.level.storage.loot.IntRange.range import net.minecraft.world.level.storage.loot.functions.* import net.minecraft.world.level.storage.loot.functions.ApplyExplosionDecay.explosionDecay import net.minecraft.world.level.storage.loot.functions.CopyBlockState.copyState import net.minecraft.world.level.storage.loot.functions.CopyNameFunction.copyName import net.minecraft.world.level.storage.loot.functions.EnchantWithLevelsFunction.enchantWithLevels -import net.minecraft.world.level.storage.loot.functions.LimitCount.limitCount import net.minecraft.world.level.storage.loot.functions.SetContainerContents.setContents import net.minecraft.world.level.storage.loot.functions.SetItemCountFunction.setCount import net.minecraft.world.level.storage.loot.functions.SetItemDamageFunction.setDamage @@ -27,7 +26,7 @@ typealias ConditionalFunctionBuilder = LootItemConditionalFunction.Builder<*> * * @author TheOnlyTails */ -@LootTables +@LootGoblin fun ConditionalFunctionBuilder.condition(getLootConditionBuilder: () -> LootConditionBuilder) = `when`(getLootConditionBuilder()) ?: throw LootTableCreationException("Something went wrong while adding a condition to a function") @@ -38,7 +37,7 @@ fun ConditionalFunctionBuilder.condition(getLootConditionBuilder: () -> LootCond * @param value the range parameter of the function. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun setCount(value: NumberProvider, body: LootFunctionBuilder.() -> LootFunctionBuilder = { this }) = setCount(value).body() @@ -47,7 +46,7 @@ fun setCount(value: NumberProvider, body: LootFunctionBuilder.() -> LootFunction * * @author TheOnlyTails */ -@LootTables +@LootGoblin fun setConstantCount(value: Float, body: LootFunctionBuilder.() -> LootFunctionBuilder = { this }) = setCount(constantValue(value)).body() @@ -58,7 +57,7 @@ fun setConstantCount(value: Float, body: LootFunctionBuilder.() -> LootFunctionB * @param chance the chance of success in a trail. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun setBinomialCount( amount: Int, chance: Float, @@ -72,7 +71,7 @@ fun setBinomialCount( * @param max the upper bound of the range. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun setUniformCount( min: Float, max: Float, @@ -85,7 +84,7 @@ fun setUniformCount( * @param levels the range parameter of the function. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun enchantWithLevels( levels: NumberProvider, body: EnchantWithLevelsFunction.Builder.() -> EnchantWithLevelsFunction.Builder = { this } @@ -96,7 +95,7 @@ fun enchantWithLevels( * * @author TheOnlyTails */ -@LootTables +@LootGoblin fun enchantRandomly(body: LootFunctionBuilder.() -> LootFunctionBuilder = { this }) = EnchantRandomlyFunction.randomApplicableEnchantment().body() @@ -106,7 +105,7 @@ fun enchantRandomly(body: LootFunctionBuilder.() -> LootFunctionBuilder = { this * @param tag the [CompoundTag] parameter of the function. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun setNbt(tag: CompoundTag, body: LootFunctionBuilder.() -> LootFunctionBuilder = { this }) = setTag(tag).body() /** @@ -114,7 +113,7 @@ fun setNbt(tag: CompoundTag, body: LootFunctionBuilder.() -> LootFunctionBuilder * * @author TheOnlyTails */ -@LootTables +@LootGoblin fun furnaceSmelt(body: LootFunctionBuilder.() -> LootFunctionBuilder = { this }) = SmeltItemFunction.smelted().body() /** @@ -123,7 +122,7 @@ fun furnaceSmelt(body: LootFunctionBuilder.() -> LootFunctionBuilder = { this }) * @param value the range parameter of the function. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun looting( value: NumberProvider, body: LootingEnchantFunction.Builder.() -> LootingEnchantFunction.Builder = { this } @@ -136,7 +135,7 @@ fun looting( * @param damage the range of damage of the function. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun setDamage(damage: NumberProvider, body: LootFunctionBuilder.() -> LootFunctionBuilder = { this }) = setDamage(damage).body() @@ -145,7 +144,7 @@ fun setDamage(damage: NumberProvider, body: LootFunctionBuilder.() -> LootFuncti * * @author TheOnlyTails */ -@LootTables +@LootGoblin fun explorationMap(body: ExplorationMapFunction.Builder.() -> ExplorationMapFunction.Builder = { this }) = ExplorationMapFunction.makeExplorationMap().body() @@ -154,7 +153,7 @@ fun explorationMap(body: ExplorationMapFunction.Builder.() -> ExplorationMapFunc * * @author TheOnlyTails */ -@LootTables +@LootGoblin fun stewEffect(body: SetStewEffectFunction.Builder.() -> SetStewEffectFunction.Builder = { this }) = stewEffect().body() /** @@ -163,7 +162,7 @@ fun stewEffect(body: SetStewEffectFunction.Builder.() -> SetStewEffectFunction.B * @param source the type of [CopyNameFunction.NameSource] to copy the name from. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun copyName(source: CopyNameFunction.NameSource, body: LootFunctionBuilder.() -> LootFunctionBuilder = { this }) = copyName(source).body() @@ -172,7 +171,7 @@ fun copyName(source: CopyNameFunction.NameSource, body: LootFunctionBuilder.() - * * @author TheOnlyTails */ -@LootTables +@LootGoblin fun setContents(body: SetContainerContents.Builder.() -> SetContainerContents.Builder = { this }) = setContents().body() /** @@ -181,9 +180,10 @@ fun setContents(body: SetContainerContents.Builder.() -> SetContainerContents.Bu * @param limiter the limiter of the function. * @author TheOnlyTails */ -@LootTables +@Suppress("RemoveRedundantQualifierName") +@LootGoblin fun limitCount(limiter: IntRange, body: LootFunctionBuilder.() -> LootFunctionBuilder = { this }) = - limitCount(limiter).body() + LimitCount.limitCount(range(limiter.first, limiter.last)).body() /** * Creates an [ApplyBonusCount] loot function of type [ApplyBonusCount.addUniformBonusCount]. @@ -192,7 +192,7 @@ fun limitCount(limiter: IntRange, body: LootFunctionBuilder.() -> LootFunctionBu * @param bonusMultiplier the bonus multiplier passed to the [ApplyBonusCount.UniformBonusCount] of the function * @author TheOnlyTails */ -@LootTables +@LootGoblin fun uniformBonusCount( enchantment: Enchantment, bonusMultiplier: Int = 1, @@ -207,7 +207,7 @@ fun uniformBonusCount( * @param extraRounds the extra rounds parameter passed to the [ApplyBonusCount.BinomialWithBonusCount] of the function. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun bonusBinomialDistributionCount( enchantment: Enchantment, chance: Float, @@ -221,7 +221,7 @@ fun bonusBinomialDistributionCount( * @param enchantment the [Enchantment] of the function. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun oreBonusCount(enchantment: Enchantment, body: LootFunctionBuilder.() -> LootFunctionBuilder = { this }) = ApplyBonusCount.addOreBonusCount(enchantment).body() @@ -230,7 +230,7 @@ fun oreBonusCount(enchantment: Enchantment, body: LootFunctionBuilder.() -> Loot * * @author TheOnlyTails */ -@LootTables +@LootGoblin fun explosionDecay(body: LootFunctionBuilder.() -> LootFunctionBuilder = { this }) = explosionDecay().body() /** @@ -239,7 +239,7 @@ fun explosionDecay(body: LootFunctionBuilder.() -> LootFunctionBuilder = { this * @param source the type of [NbtProvider] to copy the [CompoundTag] from. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun copyNbt(source: NbtProvider, body: CopyNbtFunction.Builder.() -> CopyNbtFunction.Builder = { this }) = CopyNbtFunction.copyData(source).body() @@ -249,6 +249,6 @@ fun copyNbt(source: NbtProvider, body: CopyNbtFunction.Builder.() -> CopyNbtFunc * @param block the [Block] to copy the [BlockState] from. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun copyState(block: Block, body: CopyBlockState.Builder.() -> CopyBlockState.Builder = { this }) = copyState(block).body() \ No newline at end of file diff --git a/src/main/kotlin/com/theonlytails/loottables/LootTables.kt b/src/main/kotlin/com/theonlytails/lootgoblin/LootGoblin.kt similarity index 87% rename from src/main/kotlin/com/theonlytails/loottables/LootTables.kt rename to src/main/kotlin/com/theonlytails/lootgoblin/LootGoblin.kt index b03c87f..09279f5 100644 --- a/src/main/kotlin/com/theonlytails/loottables/LootTables.kt +++ b/src/main/kotlin/com/theonlytails/lootgoblin/LootGoblin.kt @@ -1,9 +1,8 @@ -package com.theonlytails.loottables +package com.theonlytails.lootgoblin import net.minecraft.world.level.storage.loot.LootPool import net.minecraft.world.level.storage.loot.LootPool.lootPool import net.minecraft.world.level.storage.loot.LootTable -import net.minecraft.world.level.storage.loot.LootTable.lootTable import net.minecraft.world.level.storage.loot.parameters.LootContextParamSet import net.minecraft.world.level.storage.loot.providers.number.NumberProvider import kotlin.annotation.AnnotationTarget.* @@ -16,9 +15,9 @@ import kotlin.annotation.AnnotationTarget.* @DslMarker @MustBeDocumented @Target(CLASS, FUNCTION, PROPERTY) -annotation class LootTables +annotation class LootGoblin -@LootTables +@LootGoblin class LootTableCreationException(message: String) : Exception(message) /** @@ -27,11 +26,11 @@ class LootTableCreationException(message: String) : Exception(message) * @param parameterSet the [LootContextParamSet] type of the loot table. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun lootTableBuilder( parameterSet: LootContextParamSet, - body: LootTable.Builder.() -> LootTable.Builder -) = lootTable().body().setParamSet(parameterSet) + body: LootTable.Builder.() -> LootTable.Builder, +) = LootTable.lootTable().body().setParamSet(parameterSet) ?: throw LootTableCreationException("Something went wrong while creating a loot table") /** @@ -40,7 +39,7 @@ fun lootTableBuilder( * @param parameterSet the [LootContextParamSet] type of the loot table. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun lootTable(parameterSet: LootContextParamSet, body: LootTable.Builder.() -> LootTable.Builder) = lootTableBuilder(parameterSet, body).build() ?: throw LootTableCreationException("Something went wrong while creating a loot table") @@ -51,7 +50,7 @@ fun lootTable(parameterSet: LootContextParamSet, body: LootTable.Builder.() -> L * @param rolls the number of rolls in this pool. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun LootTable.Builder.pool(rolls: Float = 1f, body: LootPool.Builder.() -> Unit) = withPool(lootPool().setRolls(constantValue(rolls)).also(body)) ?: throw LootTableCreationException("Something went wrong while adding a pool to a loot table") @@ -62,7 +61,7 @@ fun LootTable.Builder.pool(rolls: Float = 1f, body: LootPool.Builder.() -> Unit) * @param rolls the number of rolls in this pool. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun LootTable.Builder.pool(rolls: NumberProvider, body: LootPool.Builder.() -> Unit) = withPool(lootPool().setRolls(rolls).also(body)) ?: throw LootTableCreationException("Something went wrong while adding a pool to a loot table") \ No newline at end of file diff --git a/src/main/kotlin/com/theonlytails/loottables/LootMisc.kt b/src/main/kotlin/com/theonlytails/lootgoblin/LootMisc.kt similarity index 94% rename from src/main/kotlin/com/theonlytails/loottables/LootMisc.kt rename to src/main/kotlin/com/theonlytails/lootgoblin/LootMisc.kt index 7883736..c6bb8f2 100644 --- a/src/main/kotlin/com/theonlytails/loottables/LootMisc.kt +++ b/src/main/kotlin/com/theonlytails/lootgoblin/LootMisc.kt @@ -1,4 +1,4 @@ -package com.theonlytails.loottables +package com.theonlytails.lootgoblin import net.minecraft.world.level.storage.loot.providers.number.* import net.minecraft.world.level.storage.loot.providers.number.BinomialDistributionGenerator.binomial @@ -11,7 +11,7 @@ import net.minecraft.world.level.storage.loot.IntRange as LootIntRange * * @author TheOnlyTails */ -@LootTables +@LootGoblin fun intValue(value: Int) = LootIntRange.exact(value) ?: throw LootTableCreationException("Something went wrong while creating an IntLimiter") @@ -20,7 +20,7 @@ fun intValue(value: Int) = LootIntRange.exact(value) * * @author TheOnlyTails */ -@LootTables +@LootGoblin fun intRange(min: Int, max: Int) = LootIntRange.range(min, max) ?: throw LootTableCreationException("Something went wrong while creating an IntLimiter") @@ -29,7 +29,7 @@ fun intRange(min: Int, max: Int) = LootIntRange.range(min, max) * * @author TheOnlyTails */ -@LootTables +@LootGoblin fun intClamperLower(min: Int) = LootIntRange.lowerBound(min) ?: throw LootTableCreationException("Something went wrong while creating an IntLimiter") @@ -38,7 +38,7 @@ fun intClamperLower(min: Int) = LootIntRange.lowerBound(min) * * @author TheOnlyTails */ -@LootTables +@LootGoblin fun intClamperUpper(max: Int) = LootIntRange.upperBound(max) ?: throw LootTableCreationException("Something went wrong while creating an IntLimiter") @@ -47,7 +47,7 @@ fun intClamperUpper(max: Int) = LootIntRange.upperBound(max) * * @author TheOnlyTails */ -@LootTables +@LootGoblin fun uniformGenerator(min: Float, max: Float): UniformGenerator = UniformGenerator.between(min, max) /** @@ -55,7 +55,7 @@ fun uniformGenerator(min: Float, max: Float): UniformGenerator = UniformGenerato * * @author TheOnlyTails */ -@LootTables +@LootGoblin fun uniformGenerator(range: IntRange): UniformGenerator = UniformGenerator.between(range.first.toFloat(), range.last.toFloat()) @@ -64,7 +64,7 @@ fun uniformGenerator(range: IntRange): UniformGenerator = * * @author TheOnlyTails */ -@LootTables +@LootGoblin fun constantValue(value: Float): ConstantValue = exactly(value) /** @@ -74,5 +74,5 @@ fun constantValue(value: Float): ConstantValue = exactly(value) * @param chance the chance of success in a trial. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun binomialRange(amount: Int, chance: Float): BinomialDistributionGenerator = binomial(amount, chance) \ No newline at end of file diff --git a/src/main/kotlin/com/theonlytails/loottables/LootPools.kt b/src/main/kotlin/com/theonlytails/lootgoblin/LootPools.kt similarity index 94% rename from src/main/kotlin/com/theonlytails/loottables/LootPools.kt rename to src/main/kotlin/com/theonlytails/lootgoblin/LootPools.kt index 4afb97e..a15c0b2 100644 --- a/src/main/kotlin/com/theonlytails/loottables/LootPools.kt +++ b/src/main/kotlin/com/theonlytails/lootgoblin/LootPools.kt @@ -1,4 +1,4 @@ -package com.theonlytails.loottables +package com.theonlytails.lootgoblin import net.minecraft.world.level.storage.loot.entries.LootPoolEntryContainer import net.minecraft.world.level.storage.loot.functions.LootItemFunction @@ -14,7 +14,7 @@ typealias LootConditionBuilder = LootItemCondition.Builder * * @author TheOnlyTails */ -@LootTables +@LootGoblin fun LootEntryBuilder.add(pool: Pool) = pool.add(this) ?: throw LootTableCreationException("Something went wrong while adding a loot entry to a pool") @@ -23,7 +23,7 @@ fun LootEntryBuilder.add(pool: Pool) = pool.add(this) * * @author TheOnlyTails */ -@LootTables +@LootGoblin fun Pool.add(vararg entries: LootEntryBuilder) = entries.forEach { add(it) } /** @@ -31,7 +31,7 @@ fun Pool.add(vararg entries: LootEntryBuilder) = entries.forEach { add(it) } * * @author TheOnlyTails */ -@LootTables +@LootGoblin fun Pool.condition(getCondition: () -> LootConditionBuilder) = `when`(getCondition()) ?: throw LootTableCreationException("Something went wrong while adding a condition to a loot pool") @@ -40,7 +40,7 @@ fun Pool.condition(getCondition: () -> LootConditionBuilder) = `when`(getConditi * * @author TheOnlyTails */ -@LootTables +@LootGoblin fun Pool.function(getFunction: () -> LootFunctionBuilder) = apply(getFunction()) ?: throw LootTableCreationException("Something went wrong while adding a function to a loot pool") @@ -49,7 +49,7 @@ fun Pool.function(getFunction: () -> LootFunctionBuilder) = apply(getFunction()) * * @author TheOnlyTails */ -@LootTables +@LootGoblin fun Pool.condition(vararg conditions: LootConditionBuilder) = this.also { conditions.forEach { condition { it } } } @@ -59,7 +59,7 @@ fun Pool.condition(vararg conditions: LootConditionBuilder) = this.also { * * @author TheOnlyTails */ -@LootTables +@LootGoblin fun Pool.function(vararg functions: LootFunctionBuilder) = this.also { functions.forEach { function { it } } } \ No newline at end of file diff --git a/src/main/kotlin/com/theonlytails/loottables/LootPredicates.kt b/src/main/kotlin/com/theonlytails/lootgoblin/LootPredicates.kt similarity index 95% rename from src/main/kotlin/com/theonlytails/loottables/LootPredicates.kt rename to src/main/kotlin/com/theonlytails/lootgoblin/LootPredicates.kt index 584cdac..3918849 100644 --- a/src/main/kotlin/com/theonlytails/loottables/LootPredicates.kt +++ b/src/main/kotlin/com/theonlytails/lootgoblin/LootPredicates.kt @@ -1,4 +1,4 @@ -package com.theonlytails.loottables +package com.theonlytails.lootgoblin import net.minecraft.advancements.critereon.* import net.minecraft.nbt.CompoundTag @@ -15,7 +15,7 @@ import net.minecraft.world.level.storage.loot.predicates.MatchTool * * @author TheOnlyTails */ -@LootTables +@LootGoblin val hasSilkTouch = matchTool(itemHasEnchantment(enchantAtLeast(SILK_TOUCH, 1))) /** @@ -27,7 +27,7 @@ val hasSilkTouch = matchTool(itemHasEnchantment(enchantAtLeast(SILK_TOUCH, 1))) message = "use the property version of this function.", replaceWith = ReplaceWith("hasSilkTouch") ) -@LootTables +@LootGoblin fun hasSilkTouch() = matchTool(itemHasEnchantment(enchantAtLeast(SILK_TOUCH, 1))) /** @@ -35,7 +35,7 @@ fun hasSilkTouch() = matchTool(itemHasEnchantment(enchantAtLeast(SILK_TOUCH, 1)) * * @author TheOnlyTails */ -@LootTables +@LootGoblin fun stateProperties(body: StatePropertiesPredicate.Builder.() -> StatePropertiesPredicate.Builder) = StatePropertiesPredicate.Builder.properties().body() @@ -45,7 +45,7 @@ fun stateProperties(body: StatePropertiesPredicate.Builder.() -> StateProperties * @param block the block to check for. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun blockPredicate( block: Block, body: BlockPredicate.Builder.() -> BlockPredicate.Builder = { this }, @@ -57,7 +57,7 @@ fun blockPredicate( * @param blockTag the block [Tag] to check for. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun blockPredicate( blockTag: Tag, body: BlockPredicate.Builder.() -> BlockPredicate.Builder = { this }, @@ -69,7 +69,7 @@ fun blockPredicate( * @param item the [Item] to check for. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun itemPredicate( item: ItemLike, body: ItemPredicate.Builder.() -> ItemPredicate.Builder = { this }, @@ -81,7 +81,7 @@ fun itemPredicate( * @param itemTag the item [Tag] to check for. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun itemPredicate( itemTag: Tag, body: ItemPredicate.Builder.() -> ItemPredicate.Builder = { this }, @@ -93,7 +93,7 @@ fun itemPredicate( * @param tag the [CompoundTag] to check for. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun itemHasNbt( tag: CompoundTag, body: ItemPredicate.Builder.() -> ItemPredicate.Builder = { this }, @@ -105,7 +105,7 @@ fun itemHasNbt( * @param enchantment the [EnchantmentPredicate] to check for. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun itemHasEnchantment( enchantment: EnchantmentPredicate, body: ItemPredicate.Builder.() -> ItemPredicate.Builder = { this }, @@ -119,7 +119,7 @@ fun itemHasEnchantment( * @return the predicate. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun enchantAtLeast(enchantment: Enchantment, min: Int) = EnchantmentPredicate(enchantment, MinMaxBounds.Ints.atLeast(min)) @@ -130,7 +130,7 @@ fun enchantAtLeast(enchantment: Enchantment, min: Int) = * @param level the level of the enchantment. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun enchantExactly(enchantment: Enchantment, level: Int) = EnchantmentPredicate(enchantment, MinMaxBounds.Ints.exactly(level)) @@ -140,6 +140,6 @@ fun enchantExactly(enchantment: Enchantment, level: Int) = * @param isInOpenWater to check if the player was fishing in open water, or if they weren't. * @author TheOnlyTails */ -@LootTables +@LootGoblin fun fishingInOpenWater(isInOpenWater: Boolean) = FishingHookPredicate.inOpenWater(isInOpenWater) ?: throw LootTableCreationException("Something went wrong while creating a fishing predicate for fishing in open water.") \ No newline at end of file diff --git a/src/test/kotlin/com/theonlytails/loottables/LootTablesTest.kt b/src/test/kotlin/com/theonlytails/lootgoblin/LootGoblinTest.kt similarity index 94% rename from src/test/kotlin/com/theonlytails/loottables/LootTablesTest.kt rename to src/test/kotlin/com/theonlytails/lootgoblin/LootGoblinTest.kt index d6cd8ed..ff5c1b9 100644 --- a/src/test/kotlin/com/theonlytails/loottables/LootTablesTest.kt +++ b/src/test/kotlin/com/theonlytails/lootgoblin/LootGoblinTest.kt @@ -1,4 +1,4 @@ -package com.theonlytails.loottables +package com.theonlytails.lootgoblin import com.google.gson.JsonIOException import net.minecraft.data.DataGenerator @@ -20,7 +20,7 @@ import net.minecraftforge.forge.event.lifecycle.GatherDataEvent import org.apache.logging.log4j.LogManager import org.apache.logging.log4j.LoggingException -val logger = LogManager.getLogger("LootTablesTester") ?: throw LoggingException("error creating the logger") +val logger = LogManager.getLogger("LootGoblinTester") ?: throw LoggingException("error creating the logger") val gson = Deserializers.createLootTableSerializer() .disableHtmlEscaping() @@ -36,11 +36,11 @@ fun testLootTable(testName: String, lootTable: LootTable.Builder.() -> LootTable """.trimIndent() ) -const val MOD_ID = "loottables_test" +const val MOD_ID = "lootgoblin_test" @Mod(MOD_ID) @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) -class LootTablesTests { +class LootGoblinTests { @SubscribeEvent fun gatherData(event: GatherDataEvent) { val gen = event.generator diff --git a/src/test/resources/META-INF/mods.toml b/src/test/resources/META-INF/mods.toml index 5f9644c..1a8f1d5 100644 --- a/src/test/resources/META-INF/mods.toml +++ b/src/test/resources/META-INF/mods.toml @@ -3,4 +3,4 @@ loaderVersion = "[37,)" license = "MIT License" [[mods]] -modId = "loottables_test" \ No newline at end of file +modId = "lootgoblin_test" \ No newline at end of file diff --git a/src/test/resources/pack.mcmeta b/src/test/resources/pack.mcmeta index b72e590..88743bd 100644 --- a/src/test/resources/pack.mcmeta +++ b/src/test/resources/pack.mcmeta @@ -1,6 +1,6 @@ { "pack": { "pack_format": 7, - "description": "LootTables test resource pack" + "description": "LootGoblin test resource pack" } } \ No newline at end of file