diff --git a/README.md b/README.md index 812094101..8dce10f2a 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ ![Immersive Weapons Logo](logo.png) -# Immersive Weapons for Minecraft 1.18.1/1.18/1.17.1/1.16.5/1.16.4/1.15.2 +# Immersive Weapons for Minecraft 1.18.2/1.18.1/1.18/1.17.1/1.16.5/1.16.4/1.15.2 ![CodeQL](https://github.com/AnonymousHacker1279/ImmersiveWeapons-Mod/workflows/CodeQL/badge.svg) [![](http://cf.way2muchnoise.eu/full_494454_Downloads.svg)](https://www.curseforge.com/minecraft/mc-mods/immersive-weapons) [![](http://cf.way2muchnoise.eu/versions/494454.svg)](https://www.curseforge.com/minecraft/mc-mods/immersive-weapons) [![CodeFactor](https://www.codefactor.io/repository/github/anonymoushacker1279/immersiveweapons/badge/master)](https://www.codefactor.io/repository/github/anonymoushacker1279/immersiveweapons/overview/master) -## A weapons mod for Minecraft 1.18.1/1.18/1.17.1/1.16.5/1.16.4/1.15.2 +## A weapons mod for Minecraft Immersive Weapons is a weapons mod more than just a weapons mod aiming to spice up your combat skills. @@ -40,37 +40,34 @@ A few other notes: Active development will be focused on the latest Minecraft version. You should upgrade to newer versions of Immersive Weapons for bug fixes and new features. -When looking at the mod file, the version looks like this: "immersiveweapons-\-\". For example, "immersiveweapons-1.17.1-1.6.0". The Minecraft version is simple: it only changes when the mod -is updated to newer versions of Minecraft. +When looking at the mod file, the version looks like +this: `ImmersiveWeapons--`. For example, `ImmersiveWeapons-1.18.2-1.15.0`. +The Minecraft version is simple: it only changes when the mod is updated to newer versions of Minecraft. The Immersive Weapons version is a bit more complex: -When the first number changes (**1**.6.0), it is a major change. For example, changing from a beta to a full release. -This probably won't change. -When the second number changes (1.**6**.0), it is a minor change. For example, adding new features, improvements, etc. +When the first number changes (**1**.15.0), it is a major change. For example, changing from an in-dev to a full +release. This probably won't ever change. +When the second number changes (1.**15**.0), it is a minor change. For example, adding new features, improvements, etc. These are usually content releases or large rewrites. -When the third number changes (1.6.**0**), it is a bugfix/patch. These are small changes that correct behaviors or +When the third number changes (1.15.**0**), it is a bugfix/patch. These are small changes that correct behaviors or otherwise add small functionalities. You should always update to the latest bugfix/patch version. Updating to the latest minor version is also recommended, but can be treated with a lower priority. Read the update changelogs associated with new releases for any important information about that release. -This table lists the latest Immersive Weapons version for a Minecraft version. If anything is listed other than **Latest**, -consider it to be at the End of Life. In some cases, an older version will receive bugfixes should the +This table lists the latest Immersive Weapons version for a Minecraft version. If anything is listed other than +**Latest**, consider it to be at the End of Life. In some cases, an older version will receive bugfixes should the community describe an interest in it (This excludes versions listed as **N/A - Build From Source**). -| MC Version | Immersive Weapons Version Support | -| :-- | :-- | -| 1.18.1 | [(BETA) Latest](https://github.com/AnonymousHacker1279/ImmersiveWeapons/releases) | -| 1.18 | [(BETA) 1.13.0-beta9](https://github.com/AnonymousHacker1279/ImmersiveWeapons/releases/tag/v1.13.0-beta9) | -| 1.17.1 | [1.12.1](https://github.com/AnonymousHacker1279/ImmersiveWeapons/releases/tag/v1.12.1) | -| 1.16.5 | [1.4.3](https://github.com/AnonymousHacker1279/ImmersiveWeapons/releases/tag/v1.4.3) | -| 1.16.4 | [1.1.1](https://github.com/AnonymousHacker1279/ImmersiveWeapons/releases/tag/v1.1.1) | -| 1.15.2 | [N/A - Build From Source](https://github.com/AnonymousHacker1279/ImmersiveWeapons/tree/1.15.2-dev) | - -***Note: 1.18.x releases are currently in a beta state due to major breaking changes in the Forge API and MC 1.18. -Expect missing features and potential game-breaking bugs.*** +| MC Version | Immersive Weapons Latest Version | +|------------|--------------------------------------------------------------------------------------------------------------| +| 1.18.2 | [(ALPHA) Latest](https://github.com/AnonymousHacker1279/ImmersiveWeapons/releases) | +| 1.18.1 | [(ALPHA) 1.14.0-alpha1](https://github.com/AnonymousHacker1279/ImmersiveWeapons/releases/tag/v1.14.0-alpha1) | +| 1.17.1 | [1.12.1](https://github.com/AnonymousHacker1279/ImmersiveWeapons/releases/tag/v1.12.1) | +| 1.16.5 | [1.4.3](https://github.com/AnonymousHacker1279/ImmersiveWeapons/releases/tag/v1.4.3) | +| 1.16.4 | [1.1.1](https://github.com/AnonymousHacker1279/ImmersiveWeapons/releases/tag/v1.1.1) | +| 1.15.2 | [N/A - Build From Source](https://github.com/AnonymousHacker1279/ImmersiveWeapons/tree/1.15.2-dev) | ## Contributing @@ -104,4 +101,4 @@ Translations other than English are generated automatically using my [Mr. Worldwide](https://github.com/AnonymousHacker1279/MrWorldwide) toolkit. Chances are that it's not completely accurate and needs refinements. I do not have the time nor will to refine these. -If you want to clean up the translations then go ahead and make a contribution. I appreciate it. +If you want to clean up the translations then go ahead and make a contribution. I appreciate it. \ No newline at end of file diff --git a/build.gradle b/build.gradle index 5ea1b2bbc..09fb4cc61 100644 --- a/build.gradle +++ b/build.gradle @@ -2,6 +2,8 @@ buildscript { repositories { maven { url = 'https://maven.minecraftforge.net' } maven { url = 'https://maven.parchmentmc.org' } + maven { url = 'https://repo.spongepowered.org/repository/maven-public/' } + mavenCentral() } dependencies { classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true @@ -108,22 +110,27 @@ sourceSets.main.resources { srcDir 'src/generated/resources' } dependencies { implementation 'org.jetbrains:annotations:23.0.0' - minecraft forge_version + minecraft "net.minecraftforge:forge:${forge_version}" // Include JEI - implementation fg.deobf(jei_version) + implementation fg.deobf("mezz.jei:jei-${jei_version}") // Include WTHIT - implementation fg.deobf(wthit_version) + compileOnly fg.deobf("mcp.mobius.waila:wthit-api:${wthit_version}") + runtimeOnly fg.deobf("mcp.mobius.waila:wthit:${wthit_version}") // Include Patchouli - compileOnly fg.deobf(patchouli_version + ":api") - runtimeOnly fg.deobf(patchouli_version) + compileOnly fg.deobf("vazkii.patchouli:Patchouli:${patchouli_version}:api") + runtimeOnly fg.deobf("vazkii.patchouli:Patchouli:${patchouli_version}") + + // Include TerraBlender + implementation fg.deobf("com.github.glitchfiend:TerraBlender-forge:${terrablender_version}") } // This block of code expands all the gradle properties in the specified resource targets. // It copies them into the targets and expands all the defined properties. -def resourceTargets = ['data/immersiveweapons/patchouli_books/encyclopedia/book.json'] +def resourceTargets = ['data/immersiveweapons/patchouli_books/encyclopedia/book.json', + 'data/immersiveweapons/patchouli_books/lorebook/book.json'] def intoTargets = ["$rootDir/out/production/resources/", "$rootDir/out/production/${project.name}.main/", "$rootDir/bin/main/"] def replaceProperties = [build_version: version] processResources { @@ -175,4 +182,8 @@ publishing { url "file:///${project.projectDir}/mcmodsrepo" } } +} + +tasks.withType(JavaCompile).configureEach { + options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation } \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index c49bd94ae..0e56373f4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,10 +1,12 @@ org.gradle.jvmargs=-Xmx6G org.gradle.daemon=true -version=1.18.1-1.14.0-alpha1 -group='com.anonymoushacker1279.immersiveweapons' +org.gradle.caching=true +version=1.18.2-1.15.0-alpha1 +group=com.anonymoushacker1279.immersiveweapons mappings_channel=parchment -mappings_version=2022.02.13-1.18.1 -forge_version=net.minecraftforge:forge:1.18.1-39.0.79 -jei_version=mezz.jei:jei-1.18.1:9.2.1.69 -wthit_version=mcp.mobius.waila:wthit:forge-4.4.1 -patchouli_version=vazkii.patchouli:Patchouli:1.18.1-65 \ No newline at end of file +mappings_version=2022.03.13-1.18.2 +forge_version=1.18.2-40.0.52 +jei_version=1.18.2:9.5.5.174 +wthit_version=forge-4.8.1 +patchouli_version=1.18.2-66 +terrablender_version=1.18.2-1.1.0.99 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 639632b50..60c76b340 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.3.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists \ No newline at end of file diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index 77d843a63..e275cddb5 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -379,6 +379,7 @@ f995b98ddd6c2aa73e389a839352cab305b6391f data/forge/tags/items/ores.json 5008cd4f1f91800ff687533702cbd7591d4b27fc data/forge/tags/items/ores/cobalt.json 587fc72deca2e0aed8867449c0b88e0ab18f1e1c data/forge/tags/items/pickaxes.json abae19f6a9ecfe01b9c3b51f78460e6ac38eb66c data/forge/tags/items/stained_glass.json +3f9e7fb85fae3311cef7bfad370f42797c1d38e7 data/forge/tags/worldgen/biome/plains.json 60760042df8807aa72082c5e595668c4dc22d3e6 data/immersiveweapons/advancements/almost_flying.json 48919cf5515b1f85a4686d98169cf34fedbed4c3 data/immersiveweapons/advancements/bamboo.json 0c16958cb896e659855bd761486c87d875e77d0c data/immersiveweapons/advancements/bandage.json @@ -783,6 +784,8 @@ a6a67131213ed5eb7fef362bbff1eb8ca0520ec5 data/immersiveweapons/loot_tables/block 4009dfc6cbe9cb6dc6f6e5e30362fd53e69dd81e data/immersiveweapons/loot_tables/chests/abandoned_factory.json e897849a77167446ed73aaa42bddb30b74c6ea24 data/immersiveweapons/loot_tables/chests/battlefield_camp.json cd2649687f773f9045f700f3fd7279a814d5524b data/immersiveweapons/loot_tables/chests/campsite.json +7ddb0f0065e8f029b4484471cf342b90b375d3f3 data/immersiveweapons/loot_tables/chests/hans_hut.json +25e8d0076939766b60dbcada1fb4c103afb97588 data/immersiveweapons/loot_tables/chests/hans_hut_cask.json f3b6c546b254b8848e07375c340b4540f43c5241 data/immersiveweapons/loot_tables/chests/underground_bunker.json 3ac1b93a040e55e5702b2c8d379388d5742b9eab data/immersiveweapons/loot_tables/chests/village/battlefield/medic_station.json e3fd678e0ed59a25e044d6362d182e4ce909a133 data/immersiveweapons/loot_tables/entities/celestial_tower.json @@ -1054,6 +1057,19 @@ ce6a439f5218f0d986eae08079ab065c43849b4f data/immersiveweapons/tags/items/ingots 6d77011fb8a4045c9ddf3688c843176b546588be data/immersiveweapons/tags/items/shards/stone.json 6fb989e362e1eafadf5f7732112cf2fe1f2d8d8b data/immersiveweapons/tags/items/shards/ventus.json c623b6e951eb3860b531efd062af5eb2bb9a43d7 data/immersiveweapons/tags/items/shards/wood.json +bb4a9463fae39c80214255ebf1986f8693265327 data/immersiveweapons/tags/worldgen/biome/has_structure/abandoned_factory.json +c13e115e0d989d69f270247d661523241d3ffeb2 data/immersiveweapons/tags/worldgen/biome/has_structure/battlefield_camp.json +c13e115e0d989d69f270247d661523241d3ffeb2 data/immersiveweapons/tags/worldgen/biome/has_structure/battlefield_town.json +bb4a9463fae39c80214255ebf1986f8693265327 data/immersiveweapons/tags/worldgen/biome/has_structure/bear_trap.json +6f9010dc04d2773e6f842f5add27c58b0d264486 data/immersiveweapons/tags/worldgen/biome/has_structure/campsite.json +71042e21fd1d94d561cae1a37ebc786691b4f03a data/immersiveweapons/tags/worldgen/biome/has_structure/cloud_island.json +c13e115e0d989d69f270247d661523241d3ffeb2 data/immersiveweapons/tags/worldgen/biome/has_structure/destroyed_house.json +c13e115e0d989d69f270247d661523241d3ffeb2 data/immersiveweapons/tags/worldgen/biome/has_structure/graveyard.json +7a1ebecb0ab724b1dcadcf96c1a24ca1aaedec0c data/immersiveweapons/tags/worldgen/biome/has_structure/hans_hut.json +2d7bb792b86a5ab3c8d226bd3cbb7e515e7f515d data/immersiveweapons/tags/worldgen/biome/has_structure/landmine_trap.json +119d2b725236b726fd60e98739cae9a59c48e077 data/immersiveweapons/tags/worldgen/biome/has_structure/pitfall_trap.json +bb4a9463fae39c80214255ebf1986f8693265327 data/immersiveweapons/tags/worldgen/biome/has_structure/underground_bunker.json +727a5f00b9a44f2a27905600c764d5d49ac82f8a data/immersiveweapons/tags/worldgen/biome/has_structure/water_tower.json 23996d7fbe141750e73cfd3ab54f873eadf9cc7d data/minecraft/advancements/recipes/misc/gunpowder.json 5d88debdd7eeb96cf5d502b301e4490d599983dc data/minecraft/recipes/gunpowder.json 4a45573a35d3979a08a43e699a64fbda69d0332a data/minecraft/tags/blocks/fences.json diff --git a/src/generated/resources/data/forge/tags/worldgen/biome/plains.json b/src/generated/resources/data/forge/tags/worldgen/biome/plains.json new file mode 100644 index 000000000..8646b4750 --- /dev/null +++ b/src/generated/resources/data/forge/tags/worldgen/biome/plains.json @@ -0,0 +1,8 @@ +{ + "replace": false, + "values": [ + "minecraft:plains", + "minecraft:snowy_plains", + "minecraft:sunflower_plains" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/immersiveweapons/loot_tables/chests/hans_hut.json b/src/generated/resources/data/immersiveweapons/loot_tables/chests/hans_hut.json new file mode 100644 index 000000000..ca6e4546b --- /dev/null +++ b/src/generated/resources/data/immersiveweapons/loot_tables/chests/hans_hut.json @@ -0,0 +1,117 @@ +{ + "type": "minecraft:chest", + "pools": [ + { + "rolls": { + "type": "minecraft:uniform", + "min": 4.0, + "max": 6.0 + }, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "weight": 5, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1.0, + "max": 6.0 + }, + "add": false + } + ], + "name": "minecraft:salmon" + }, + { + "type": "minecraft:item", + "weight": 5, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1.0, + "max": 6.0 + }, + "add": false + } + ], + "name": "minecraft:cod" + }, + { + "type": "minecraft:item", + "weight": 4, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1.0, + "max": 3.0 + }, + "add": false + } + ], + "name": "immersiveweapons:bottle_of_alcohol" + }, + { + "type": "minecraft:item", + "weight": 4, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1.0, + "max": 3.0 + }, + "add": false + } + ], + "name": "immersiveweapons:bottle_of_wine" + }, + { + "type": "minecraft:item", + "weight": 3, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1.0, + "max": 1.0 + }, + "add": false + }, + { + "function": "minecraft:enchant_randomly" + } + ], + "name": "minecraft:iron_sword" + }, + { + "type": "minecraft:item", + "weight": 2, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1.0, + "max": 1.0 + }, + "add": false + }, + { + "function": "minecraft:enchant_randomly" + } + ], + "name": "minecraft:iron_helmet" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/immersiveweapons/loot_tables/chests/hans_hut_cask.json b/src/generated/resources/data/immersiveweapons/loot_tables/chests/hans_hut_cask.json new file mode 100644 index 000000000..542aa7873 --- /dev/null +++ b/src/generated/resources/data/immersiveweapons/loot_tables/chests/hans_hut_cask.json @@ -0,0 +1,46 @@ +{ + "type": "minecraft:chest", + "pools": [ + { + "rolls": { + "type": "minecraft:uniform", + "min": 6.0, + "max": 9.0 + }, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "weight": 2, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 8.0, + "max": 32.0 + }, + "add": false + } + ], + "name": "minecraft:wheat" + }, + { + "type": "minecraft:item", + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 8.0, + "max": 16.0 + }, + "add": false + } + ], + "name": "minecraft:sweet_berries" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/immersiveweapons/tags/worldgen/biome/has_structure/abandoned_factory.json b/src/generated/resources/data/immersiveweapons/tags/worldgen/biome/has_structure/abandoned_factory.json new file mode 100644 index 000000000..31f46618c --- /dev/null +++ b/src/generated/resources/data/immersiveweapons/tags/worldgen/biome/has_structure/abandoned_factory.json @@ -0,0 +1,7 @@ +{ + "replace": false, + "values": [ + "#forge:plains", + "#minecraft:is_forest" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/immersiveweapons/tags/worldgen/biome/has_structure/battlefield_camp.json b/src/generated/resources/data/immersiveweapons/tags/worldgen/biome/has_structure/battlefield_camp.json new file mode 100644 index 000000000..e80ec5527 --- /dev/null +++ b/src/generated/resources/data/immersiveweapons/tags/worldgen/biome/has_structure/battlefield_camp.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "immersiveweapons:battlefield" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/immersiveweapons/tags/worldgen/biome/has_structure/battlefield_town.json b/src/generated/resources/data/immersiveweapons/tags/worldgen/biome/has_structure/battlefield_town.json new file mode 100644 index 000000000..e80ec5527 --- /dev/null +++ b/src/generated/resources/data/immersiveweapons/tags/worldgen/biome/has_structure/battlefield_town.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "immersiveweapons:battlefield" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/immersiveweapons/tags/worldgen/biome/has_structure/bear_trap.json b/src/generated/resources/data/immersiveweapons/tags/worldgen/biome/has_structure/bear_trap.json new file mode 100644 index 000000000..31f46618c --- /dev/null +++ b/src/generated/resources/data/immersiveweapons/tags/worldgen/biome/has_structure/bear_trap.json @@ -0,0 +1,7 @@ +{ + "replace": false, + "values": [ + "#forge:plains", + "#minecraft:is_forest" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/immersiveweapons/tags/worldgen/biome/has_structure/campsite.json b/src/generated/resources/data/immersiveweapons/tags/worldgen/biome/has_structure/campsite.json new file mode 100644 index 000000000..035d1c4b8 --- /dev/null +++ b/src/generated/resources/data/immersiveweapons/tags/worldgen/biome/has_structure/campsite.json @@ -0,0 +1,7 @@ +{ + "replace": false, + "values": [ + "#forge:plains", + "minecraft:desert" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/immersiveweapons/tags/worldgen/biome/has_structure/cloud_island.json b/src/generated/resources/data/immersiveweapons/tags/worldgen/biome/has_structure/cloud_island.json new file mode 100644 index 000000000..b8196e1cf --- /dev/null +++ b/src/generated/resources/data/immersiveweapons/tags/worldgen/biome/has_structure/cloud_island.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "#minecraft:is_taiga" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/immersiveweapons/tags/worldgen/biome/has_structure/destroyed_house.json b/src/generated/resources/data/immersiveweapons/tags/worldgen/biome/has_structure/destroyed_house.json new file mode 100644 index 000000000..e80ec5527 --- /dev/null +++ b/src/generated/resources/data/immersiveweapons/tags/worldgen/biome/has_structure/destroyed_house.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "immersiveweapons:battlefield" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/immersiveweapons/tags/worldgen/biome/has_structure/graveyard.json b/src/generated/resources/data/immersiveweapons/tags/worldgen/biome/has_structure/graveyard.json new file mode 100644 index 000000000..e80ec5527 --- /dev/null +++ b/src/generated/resources/data/immersiveweapons/tags/worldgen/biome/has_structure/graveyard.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "immersiveweapons:battlefield" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/immersiveweapons/tags/worldgen/biome/has_structure/hans_hut.json b/src/generated/resources/data/immersiveweapons/tags/worldgen/biome/has_structure/hans_hut.json new file mode 100644 index 000000000..030d43974 --- /dev/null +++ b/src/generated/resources/data/immersiveweapons/tags/worldgen/biome/has_structure/hans_hut.json @@ -0,0 +1,7 @@ +{ + "replace": false, + "values": [ + "minecraft:lush_caves", + "minecraft:dripstone_caves" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/immersiveweapons/tags/worldgen/biome/has_structure/landmine_trap.json b/src/generated/resources/data/immersiveweapons/tags/worldgen/biome/has_structure/landmine_trap.json new file mode 100644 index 000000000..ff757c036 --- /dev/null +++ b/src/generated/resources/data/immersiveweapons/tags/worldgen/biome/has_structure/landmine_trap.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "minecraft:desert" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/immersiveweapons/tags/worldgen/biome/has_structure/pitfall_trap.json b/src/generated/resources/data/immersiveweapons/tags/worldgen/biome/has_structure/pitfall_trap.json new file mode 100644 index 000000000..04acb3166 --- /dev/null +++ b/src/generated/resources/data/immersiveweapons/tags/worldgen/biome/has_structure/pitfall_trap.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "#minecraft:is_jungle" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/immersiveweapons/tags/worldgen/biome/has_structure/underground_bunker.json b/src/generated/resources/data/immersiveweapons/tags/worldgen/biome/has_structure/underground_bunker.json new file mode 100644 index 000000000..31f46618c --- /dev/null +++ b/src/generated/resources/data/immersiveweapons/tags/worldgen/biome/has_structure/underground_bunker.json @@ -0,0 +1,7 @@ +{ + "replace": false, + "values": [ + "#forge:plains", + "#minecraft:is_forest" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/immersiveweapons/tags/worldgen/biome/has_structure/water_tower.json b/src/generated/resources/data/immersiveweapons/tags/worldgen/biome/has_structure/water_tower.json new file mode 100644 index 000000000..1042ddefe --- /dev/null +++ b/src/generated/resources/data/immersiveweapons/tags/worldgen/biome/has_structure/water_tower.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "#forge:plains" + ] +} \ No newline at end of file diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/ImmersiveWeapons.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/ImmersiveWeapons.java index 6069a9ac3..abb18ad1e 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/ImmersiveWeapons.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/ImmersiveWeapons.java @@ -4,19 +4,23 @@ import com.anonymoushacker1279.immersiveweapons.config.ClientConfig; import com.anonymoushacker1279.immersiveweapons.config.CommonConfig; import com.anonymoushacker1279.immersiveweapons.init.*; +import com.anonymoushacker1279.immersiveweapons.item.crafting.CustomRecipeTypes; import com.anonymoushacker1279.immersiveweapons.world.level.levelgen.OreGeneratorHandler; -import com.anonymoushacker1279.immersiveweapons.world.level.levelgen.Structures; +import com.anonymoushacker1279.immersiveweapons.world.level.levelgen.biomes.IWOverworldBiomesProvider; +import com.anonymoushacker1279.immersiveweapons.world.level.levelgen.biomes.SurfaceRuleData; +import com.mojang.logging.LogUtils; +import net.minecraft.resources.ResourceLocation; import net.minecraft.world.level.block.state.properties.WoodType; import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.eventbus.api.EventPriority; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.fml.ModLoadingContext; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.config.ModConfig.Type; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; +import org.slf4j.Logger; +import terrablender.api.*; +import terrablender.api.SurfaceRuleManager.RuleCategory; // The value here should match an entry in the META-INF/mods.toml file @Mod(ImmersiveWeapons.MOD_ID) @@ -25,7 +29,7 @@ public class ImmersiveWeapons { public static final String MOD_ID = "immersiveweapons"; // Setup logger - public static final Logger LOGGER = LogManager.getLogger(); + public static final Logger LOGGER = LogUtils.getLogger(); // Mod setup begins here public ImmersiveWeapons() { @@ -42,7 +46,6 @@ public ImmersiveWeapons() { // Add event listeners IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus(); modEventBus.addListener(this::setup); - MinecraftForge.EVENT_BUS.addListener(EventPriority.NORMAL, Structures::addDimensionalSpacing); // Register packet handlers PacketHandler.registerPackets(); @@ -57,10 +60,12 @@ public ImmersiveWeapons() { public void setup(FMLCommonSetupEvent event) { DispenserBehaviorRegistry.init(); OreGeneratorHandler.init(); + CustomRecipeTypes.init(); event.enqueueWork(() -> { WoodType.register(WoodTypes.BURNED_OAK); - Structures.setupStructures(); - Structures.registerConfiguredStructures(); + Regions.register(new IWOverworldBiomesProvider(new ResourceLocation(MOD_ID, "overworld_biome_provider"), + RegionType.OVERWORLD, 1)); + SurfaceRuleManager.addSurfaceRules(RuleCategory.OVERWORLD, MOD_ID, SurfaceRuleData.makeRules()); }); PostSetupHandler.init(); } diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/block/decoration/AzulStainedOrchidBlock.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/block/decoration/AzulStainedOrchidBlock.java index 410f79047..424bee504 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/block/decoration/AzulStainedOrchidBlock.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/block/decoration/AzulStainedOrchidBlock.java @@ -1,10 +1,10 @@ package com.anonymoushacker1279.immersiveweapons.block.decoration; -import com.anonymoushacker1279.immersiveweapons.block.misc.portal.statue.warrior.WarriorStatueTorso; +import com.anonymoushacker1279.immersiveweapons.block.misc.warrior_statue.WarriorStatueTorso; import com.anonymoushacker1279.immersiveweapons.config.CommonConfig; import com.anonymoushacker1279.immersiveweapons.init.DeferredRegistryHandler; -import com.anonymoushacker1279.immersiveweapons.util.GeneralUtilities; import com.anonymoushacker1279.immersiveweapons.world.TiltrosTeleporter; +import com.anonymoushacker1279.immersiveweapons.world.level.levelgen.biomes.BiomesAndDimensions; import net.minecraft.core.BlockPos; import net.minecraft.resources.ResourceKey; import net.minecraft.server.MinecraftServer; @@ -47,7 +47,9 @@ public void entityInside(@NotNull BlockState state, @NotNull Level level, @NotNu } Level entityWorld = entity.level; MinecraftServer server = entityWorld.getServer(); - ResourceKey destination = entityWorld.dimension() == GeneralUtilities.TILTROS ? Level.OVERWORLD : GeneralUtilities.TILTROS; + ResourceKey destination = entityWorld.dimension() == BiomesAndDimensions.TILTROS ? Level.OVERWORLD + : BiomesAndDimensions.TILTROS; + if (server != null) { ServerLevel destinationWorld = server.getLevel(destination); if (destinationWorld != null && !entity.isPassenger()) { @@ -56,36 +58,63 @@ public void entityInside(@NotNull BlockState state, @NotNull Level level, @NotNu entity.changeDimension(destinationWorld, new TiltrosTeleporter()); BlockPos oldEntityPos = entity.blockPosition(); entity.teleportTo(oldEntityPos.getX() - 0.5f, oldEntityPos.getY() + 0.5f, oldEntityPos.getZ() + 0.5f); + // Build a spawn area with another portal, if one doesn't already exist - Stream destinationBlockStates = destinationWorld.getBlockStates(new AABB(oldEntityPos.getX() - 10, oldEntityPos.getY() - 5, oldEntityPos.getZ() - 10, oldEntityPos.getX() + 10, oldEntityPos.getY() + 5, oldEntityPos.getZ() + 10)); - if (destinationBlockStates.noneMatch(blockState -> blockState == DeferredRegistryHandler.AZUL_STAINED_ORCHID.get().defaultBlockState())) { + Stream destinationBlockStates = destinationWorld.getBlockStates( + new AABB(oldEntityPos.getX() - 10, + oldEntityPos.getY() - 5, + oldEntityPos.getZ() - 10, + oldEntityPos.getX() + 10, + oldEntityPos.getY() + 5, + oldEntityPos.getZ() + 10)); + + if (destinationBlockStates.noneMatch(blockState -> + blockState == DeferredRegistryHandler.AZUL_STAINED_ORCHID.get().defaultBlockState())) { + destinationWorld.destroyBlock(oldEntityPos.above(), true); destinationWorld.destroyBlock(oldEntityPos.below(), true); - destinationWorld.setBlock(oldEntityPos.below(), Blocks.GRASS_BLOCK.defaultBlockState(), 3); + destinationWorld.setBlock(oldEntityPos.below(), + Blocks.GRASS_BLOCK.defaultBlockState(), 3); destinationWorld.destroyBlock(oldEntityPos, true); - destinationWorld.setBlock(oldEntityPos, DeferredRegistryHandler.AZUL_STAINED_ORCHID.get().defaultBlockState(), 3); + destinationWorld.setBlock(oldEntityPos, + DeferredRegistryHandler.AZUL_STAINED_ORCHID.get().defaultBlockState(), 3); destinationWorld.destroyBlock(oldEntityPos.relative(entity.getDirection()), true); destinationWorld.destroyBlock(oldEntityPos.relative(entity.getDirection()).above(), true); destinationWorld.destroyBlock(oldEntityPos.relative(entity.getDirection()).below(), true); - destinationWorld.setBlock(oldEntityPos.relative(entity.getDirection()).below(), Blocks.STONE_BRICKS.defaultBlockState(), 3); + destinationWorld.setBlock(oldEntityPos.relative(entity.getDirection()).below(), + Blocks.STONE_BRICKS.defaultBlockState(), 3); destinationWorld.destroyBlock(oldEntityPos.relative(entity.getDirection().getClockWise()), true); destinationWorld.destroyBlock(oldEntityPos.relative(entity.getDirection().getClockWise()).above(), true); destinationWorld.destroyBlock(oldEntityPos.relative(entity.getDirection().getClockWise()).below(), true); - destinationWorld.setBlock(oldEntityPos.relative(entity.getDirection().getClockWise()).below(), Blocks.STONE_BRICKS.defaultBlockState(), 3); + destinationWorld.setBlock(oldEntityPos.relative(entity.getDirection().getClockWise()).below(), + Blocks.STONE_BRICKS.defaultBlockState(), 3); destinationWorld.destroyBlock(oldEntityPos.relative(entity.getDirection().getCounterClockWise()), true); destinationWorld.destroyBlock(oldEntityPos.relative(entity.getDirection().getCounterClockWise()).above(), true); destinationWorld.destroyBlock(oldEntityPos.relative(entity.getDirection().getCounterClockWise()).below(), true); - destinationWorld.setBlock(oldEntityPos.relative(entity.getDirection().getCounterClockWise()).below(), Blocks.STONE_BRICKS.defaultBlockState(), 3); + destinationWorld.setBlock(oldEntityPos.relative(entity.getDirection().getCounterClockWise()).below(), + Blocks.STONE_BRICKS.defaultBlockState(), 3); destinationWorld.destroyBlock(oldEntityPos.relative(entity.getDirection().getOpposite()), true); destinationWorld.destroyBlock(oldEntityPos.relative(entity.getDirection().getOpposite()).above(), true); destinationWorld.destroyBlock(oldEntityPos.relative(entity.getDirection().getOpposite()).below(), true); - destinationWorld.setBlock(oldEntityPos.relative(entity.getDirection().getOpposite()).below(), Blocks.STONE_BRICKS.defaultBlockState(), 3); + destinationWorld.setBlock(oldEntityPos.relative(entity.getDirection().getOpposite()).below(), + Blocks.STONE_BRICKS.defaultBlockState(), 3); destinationWorld.destroyBlock(oldEntityPos.relative(entity.getDirection()), true); - destinationWorld.setBlock(oldEntityPos.relative(entity.getDirection()), DeferredRegistryHandler.WARRIOR_STATUE_BASE.get().defaultBlockState().setValue(WarriorStatueTorso.FACING, entity.getDirection().getOpposite()), 3); + destinationWorld.setBlock(oldEntityPos.relative(entity.getDirection()), + DeferredRegistryHandler.WARRIOR_STATUE_BASE.get().defaultBlockState() + .setValue(WarriorStatueTorso.FACING, + entity.getDirection().getOpposite()), 3); destinationWorld.destroyBlock(oldEntityPos.relative(entity.getDirection()).above(), true); - destinationWorld.setBlock(oldEntityPos.relative(entity.getDirection()).above(), DeferredRegistryHandler.WARRIOR_STATUE_TORSO.get().defaultBlockState().setValue(WarriorStatueTorso.FACING, entity.getDirection().getOpposite()).setValue(WarriorStatueTorso.POWERED, true), 3); + destinationWorld.setBlock(oldEntityPos.relative(entity.getDirection()).above(), + DeferredRegistryHandler.WARRIOR_STATUE_TORSO.get().defaultBlockState() + .setValue(WarriorStatueTorso.FACING, + entity.getDirection().getOpposite()) + .setValue(WarriorStatueTorso.POWERED, true), 3); destinationWorld.destroyBlock(oldEntityPos.relative(entity.getDirection()).above(2), true); - destinationWorld.setBlock(oldEntityPos.relative(entity.getDirection()).above(2), DeferredRegistryHandler.WARRIOR_STATUE_HEAD.get().defaultBlockState().setValue(WarriorStatueTorso.FACING, entity.getDirection().getOpposite()).setValue(WarriorStatueTorso.POWERED, true), 3); + destinationWorld.setBlock(oldEntityPos.relative(entity.getDirection()).above(2), + DeferredRegistryHandler.WARRIOR_STATUE_HEAD.get().defaultBlockState() + .setValue(WarriorStatueTorso.FACING, + entity.getDirection().getOpposite()) + .setValue(WarriorStatueTorso.POWERED, true), 3); } entityWorld.getProfiler().pop(); } diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/block/decoration/CelestialLanternBlock.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/block/decoration/CelestialLanternBlock.java index 850b78998..b23f00be5 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/block/decoration/CelestialLanternBlock.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/block/decoration/CelestialLanternBlock.java @@ -1,25 +1,67 @@ package com.anonymoushacker1279.immersiveweapons.block.decoration; +import com.anonymoushacker1279.immersiveweapons.blockentity.CelestialLanternBlockEntity; import net.minecraft.core.BlockPos; -import net.minecraft.world.level.BlockGetter; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.LanternBlock; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.*; +import net.minecraft.world.level.block.*; +import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.phys.shapes.CollisionContext; -import net.minecraft.world.phys.shapes.Shapes; -import net.minecraft.world.phys.shapes.VoxelShape; +import net.minecraft.world.phys.shapes.*; import org.jetbrains.annotations.NotNull; -public class CelestialLanternBlock extends LanternBlock { +import javax.annotation.Nullable; +import java.util.ArrayList; +import java.util.List; - protected static final VoxelShape AABB = Shapes.or(Block.box(4.0D, 0.0D, 4.0D, 12.0D, 10.0D, 12.0D), Block.box(5.0D, 10.0D, 5.0D, 11.0D, 11.0D, 11.0D)); +public class CelestialLanternBlock extends LanternBlock implements EntityBlock { + + protected static final VoxelShape AABB = Shapes.or( + Block.box(4.0D, 0.0D, 4.0D, 12.0D, 10.0D, 12.0D), + Block.box(5.0D, 10.0D, 5.0D, 11.0D, 11.0D, 11.0D)); + + public static List ALL_TILTROS_LANTERNS = new ArrayList<>(3); public CelestialLanternBlock(Properties properties) { super(properties); } @Override - public @NotNull VoxelShape getShape(@NotNull BlockState blockState, @NotNull BlockGetter blockGetter, @NotNull BlockPos blockPos, @NotNull CollisionContext collisionContext) { + public @NotNull VoxelShape getShape(@NotNull BlockState blockState, @NotNull BlockGetter blockGetter, + @NotNull BlockPos blockPos, @NotNull CollisionContext collisionContext) { + return AABB; } + + @Override + public void setPlacedBy(@NotNull Level pLevel, @NotNull BlockPos pPos, @NotNull BlockState pState, + @Nullable LivingEntity pPlacer, @NotNull ItemStack pStack) { + + super.setPlacedBy(pLevel, pPos, pState, pPlacer, pStack); + if (!pLevel.isClientSide) { + ALL_TILTROS_LANTERNS.add(pPos); + } + } + + @Override + public void destroy(@NotNull LevelAccessor pLevel, @NotNull BlockPos pPos, @NotNull BlockState pState) { + super.destroy(pLevel, pPos, pState); + + if (!pLevel.isClientSide()) { + ALL_TILTROS_LANTERNS.remove(pPos); + } + } + + /** + * Create a block entity for the block. + * + * @param blockPos the BlockPos the block is at + * @param blockState the BlockState of the block + * @return BlockEntity + */ + @Override + public BlockEntity newBlockEntity(@NotNull BlockPos blockPos, @NotNull BlockState blockState) { + return new CelestialLanternBlockEntity(blockPos, blockState); + } } \ No newline at end of file diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/block/misc/portal/statue/warrior/WarriorStatueBase.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/block/misc/warrior_statue/WarriorStatueBase.java similarity index 97% rename from src/main/java/com/anonymoushacker1279/immersiveweapons/block/misc/portal/statue/warrior/WarriorStatueBase.java rename to src/main/java/com/anonymoushacker1279/immersiveweapons/block/misc/warrior_statue/WarriorStatueBase.java index 10614f138..53f969e27 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/block/misc/portal/statue/warrior/WarriorStatueBase.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/block/misc/warrior_statue/WarriorStatueBase.java @@ -1,4 +1,4 @@ -package com.anonymoushacker1279.immersiveweapons.block.misc.portal.statue.warrior; +package com.anonymoushacker1279.immersiveweapons.block.misc.warrior_statue; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/block/misc/portal/statue/warrior/WarriorStatueHead.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/block/misc/warrior_statue/WarriorStatueHead.java similarity index 98% rename from src/main/java/com/anonymoushacker1279/immersiveweapons/block/misc/portal/statue/warrior/WarriorStatueHead.java rename to src/main/java/com/anonymoushacker1279/immersiveweapons/block/misc/warrior_statue/WarriorStatueHead.java index ea6390485..0425a5190 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/block/misc/portal/statue/warrior/WarriorStatueHead.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/block/misc/warrior_statue/WarriorStatueHead.java @@ -1,4 +1,4 @@ -package com.anonymoushacker1279.immersiveweapons.block.misc.portal.statue.warrior; +package com.anonymoushacker1279.immersiveweapons.block.misc.warrior_statue; import com.anonymoushacker1279.immersiveweapons.init.DeferredRegistryHandler; import com.anonymoushacker1279.immersiveweapons.util.GeneralUtilities; diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/block/misc/portal/statue/warrior/WarriorStatueTorso.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/block/misc/warrior_statue/WarriorStatueTorso.java similarity index 84% rename from src/main/java/com/anonymoushacker1279/immersiveweapons/block/misc/portal/statue/warrior/WarriorStatueTorso.java rename to src/main/java/com/anonymoushacker1279/immersiveweapons/block/misc/warrior_statue/WarriorStatueTorso.java index b9586f32b..941d41c69 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/block/misc/portal/statue/warrior/WarriorStatueTorso.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/block/misc/warrior_statue/WarriorStatueTorso.java @@ -1,4 +1,4 @@ -package com.anonymoushacker1279.immersiveweapons.block.misc.portal.statue.warrior; +package com.anonymoushacker1279.immersiveweapons.block.misc.warrior_statue; import com.anonymoushacker1279.immersiveweapons.init.DeferredRegistryHandler; import com.anonymoushacker1279.immersiveweapons.init.PacketHandler; @@ -46,7 +46,8 @@ public class WarriorStatueTorso extends HorizontalDirectionalBlock implements Si public WarriorStatueTorso(Properties properties) { super(properties); - registerDefaultState(stateDefinition.any().setValue(FACING, Direction.NORTH).setValue(POWERED, false).setValue(WATERLOGGED, false)); + registerDefaultState(stateDefinition.any().setValue(FACING, Direction.NORTH).setValue(POWERED, false) + .setValue(WATERLOGGED, false)); } /** @@ -70,7 +71,9 @@ protected void createBlockStateDefinition(StateDefinition.Builder SHAPE.move(0.0D, 0.0D, -0.1D); case EAST -> SHAPE.move(-0.1D, 0.0D, 0.0D); @@ -91,7 +94,16 @@ public BlockState getStateForPlacement(BlockPlaceContext context) { BlockState blockStateBelow = context.getLevel().getBlockState(context.getClickedPos().below()); if (blockStateBelow.getBlock() instanceof WarriorStatueBase && blockStateBelow.getValue(FACING) == context.getHorizontalDirection().getOpposite()) { - context.getLevel().playLocalSound(context.getClickedPos().getX(), context.getClickedPos().getY(), context.getClickedPos().getZ(), SoundEvents.END_PORTAL_FRAME_FILL, SoundSource.BLOCKS, 0.5f, GeneralUtilities.getRandomNumber(0.3f, 0.4f), false); + + context.getLevel().playLocalSound(context.getClickedPos().getX(), + context.getClickedPos().getY(), + context.getClickedPos().getZ(), + SoundEvents.END_PORTAL_FRAME_FILL, + SoundSource.BLOCKS, + 0.5f, + GeneralUtilities.getRandomNumber(0.3f, 0.4f), + false); + return defaultBlockState().setValue(FACING, context.getHorizontalDirection().getOpposite()); } else { return Blocks.AIR.defaultBlockState(); @@ -153,7 +165,10 @@ public void neighborChanged(@NotNull BlockState state, Level worldIn, @NotNull B */ @SuppressWarnings("deprecation") @Override - public @NotNull InteractionResult use(@NotNull BlockState state, Level worldIn, @NotNull BlockPos pos, @NotNull Player player, @NotNull InteractionHand handIn, @NotNull BlockHitResult blockRayTraceResult) { + public @NotNull InteractionResult use(@NotNull BlockState state, Level worldIn, @NotNull BlockPos pos, + @NotNull Player player, @NotNull InteractionHand handIn, + @NotNull BlockHitResult blockRayTraceResult) { + if (!worldIn.isClientSide && handIn.equals(InteractionHand.MAIN_HAND)) { if (worldIn.getBlockState(pos.above()).getBlock() == DeferredRegistryHandler.WARRIOR_STATUE_HEAD.get()) { ItemStack itemStack = player.getMainHandItem(); @@ -162,20 +177,35 @@ public void neighborChanged(@NotNull BlockState state, Level worldIn, @NotNull B itemStack.shrink(1); } worldIn.setBlock(pos, state.setValue(POWERED, true), 3); - worldIn.setBlock(pos.above(), DeferredRegistryHandler.WARRIOR_STATUE_HEAD.get().defaultBlockState().setValue(FACING, state.getValue(FACING)).setValue(POWERED, true), 3); + worldIn.setBlock(pos.above(), DeferredRegistryHandler.WARRIOR_STATUE_HEAD.get().defaultBlockState() + .setValue(FACING, state.getValue(FACING)).setValue(POWERED, true), 3); worldIn.destroyBlock(pos.below(2).relative(state.getValue(FACING)), true); - worldIn.setBlock(pos.below(2).relative(state.getValue(FACING)), Blocks.GRASS_BLOCK.defaultBlockState(), 3); + worldIn.setBlock(pos.below(2).relative(state.getValue(FACING)), + Blocks.GRASS_BLOCK.defaultBlockState(), 3); worldIn.destroyBlock(pos.below().relative(state.getValue(FACING)), true); - worldIn.setBlock(pos.below().relative(state.getValue(FACING)), DeferredRegistryHandler.AZUL_STAINED_ORCHID.get().defaultBlockState(), 3); + worldIn.setBlock(pos.below().relative(state.getValue(FACING)), + DeferredRegistryHandler.AZUL_STAINED_ORCHID.get().defaultBlockState(), 3); + + PacketHandler.INSTANCE.send(PacketDistributor.NEAR.with(() -> new TargetPoint(pos.getX(), + pos.getY(), pos.getZ(), 12, worldIn.dimension())), + new WarriorStatueTorsoPacketHandler(pos, 1)); - PacketHandler.INSTANCE.send(PacketDistributor.NEAR.with(() -> new TargetPoint(pos.getX(), pos.getY(), pos.getZ(), 12, worldIn.dimension())), new WarriorStatueTorsoPacketHandler(pos, 1)); for (int i = 0; i < 25; i++) { - ((ServerLevel) worldIn).sendParticles(ParticleTypes.DRIPPING_WATER, pos.getX() + 0.5d + GeneralUtilities.getRandomNumber(-1.0d, 1.0d), pos.getY() + GeneralUtilities.getRandomNumber(-2.0d, 1.5d), pos.getZ() + 0.5d + GeneralUtilities.getRandomNumber(-1.0d, 1.0d), 1, GeneralUtilities.getRandomNumber(-0.03d, 0.03d), GeneralUtilities.getRandomNumber(-0.1d, -0.08d), GeneralUtilities.getRandomNumber(-0.03d, 0.03d), 1.0f); + ((ServerLevel) worldIn).sendParticles(ParticleTypes.DRIPPING_WATER, + pos.getX() + 0.5d + GeneralUtilities.getRandomNumber(-1.0d, 1.0d), + pos.getY() + GeneralUtilities.getRandomNumber(-2.0d, 1.5d), + pos.getZ() + 0.5d + GeneralUtilities.getRandomNumber(-1.0d, 1.0d), + 1, GeneralUtilities.getRandomNumber(-0.03d, 0.03d), + GeneralUtilities.getRandomNumber(-0.1d, -0.08d), + GeneralUtilities.getRandomNumber(-0.03d, 0.03d), 1.0f); + } return InteractionResult.CONSUME; } else { - PacketHandler.INSTANCE.send(PacketDistributor.NEAR.with(() -> new TargetPoint(pos.getX(), pos.getY(), pos.getZ(), 12, worldIn.dimension())), new WarriorStatueTorsoPacketHandler(pos, 2)); + PacketHandler.INSTANCE.send(PacketDistributor.NEAR.with(() -> new TargetPoint(pos.getX(), + pos.getY(), pos.getZ(), 12, worldIn.dimension())), + new WarriorStatueTorsoPacketHandler(pos, 2)); } } @@ -251,9 +281,11 @@ private static void handleOnClient(WarriorStatueTorsoPacketHandler msg) { Minecraft minecraft = Minecraft.getInstance(); if (minecraft.level != null) { if (msg.soundType == 1) { - minecraft.level.playLocalSound(msg.blockPos, SoundEvents.END_PORTAL_FRAME_FILL, SoundSource.BLOCKS, 0.6f, 1.0f, false); + minecraft.level.playLocalSound(msg.blockPos, SoundEvents.END_PORTAL_FRAME_FILL, SoundSource.BLOCKS, + 0.6f, 1.0f, false); } else if (msg.soundType == 2) { - minecraft.level.playLocalSound(msg.blockPos, SoundEvents.ENDERMITE_AMBIENT, SoundSource.BLOCKS, 0.6f, GeneralUtilities.getRandomNumber(0.4f, 0.8f), false); + minecraft.level.playLocalSound(msg.blockPos, SoundEvents.ENDERMITE_AMBIENT, SoundSource.BLOCKS, + 0.6f, GeneralUtilities.getRandomNumber(0.4f, 0.8f), false); } } } diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/blockentity/AbstractTeslaSynthesizerBlockEntity.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/blockentity/AbstractTeslaSynthesizerBlockEntity.java index 8dcbf91c8..c24179a87 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/blockentity/AbstractTeslaSynthesizerBlockEntity.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/blockentity/AbstractTeslaSynthesizerBlockEntity.java @@ -1,7 +1,7 @@ package com.anonymoushacker1279.immersiveweapons.blockentity; import com.anonymoushacker1279.immersiveweapons.init.DeferredRegistryHandler; -import com.anonymoushacker1279.immersiveweapons.item.crafting.ICustomRecipeType; +import com.anonymoushacker1279.immersiveweapons.item.crafting.CustomRecipeTypes; import com.anonymoushacker1279.immersiveweapons.item.crafting.TeslaSynthesizerRecipe; import com.google.common.collect.Maps; import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; @@ -95,7 +95,7 @@ public int getCount() { * @return boolean */ private static boolean isNonFlammable(Item item) { - return ItemTags.NON_FLAMMABLE_WOOD.contains(item); + return item.builtInRegistryHolder().is(ItemTags.NON_FLAMMABLE_WOOD); } /** @@ -160,7 +160,7 @@ public static void serverTick(Level level, AbstractTeslaSynthesizerBlockEntity b && !blockEntity.items.get(1).isEmpty() && !blockEntity.items.get(2).isEmpty()) { RecipeManager recipeManager = level.getRecipeManager(); - Recipe synthesizerRecipe = recipeManager.getRecipeFor(ICustomRecipeType.TESLA_SYNTHESIZER, blockEntity, level) + Recipe synthesizerRecipe = recipeManager.getRecipeFor(CustomRecipeTypes.TESLA_SYNTHESIZER, blockEntity, level) .orElse(null); if (!blockEntity.isBurning() && blockEntity.canSmelt(synthesizerRecipe)) { @@ -337,7 +337,7 @@ private void smelt(@Nullable Recipe recipe) { private int getCookTime() { if (level != null) { Optional recipe = level.getRecipeManager() - .getRecipeFor(ICustomRecipeType.TESLA_SYNTHESIZER, this, level); + .getRecipeFor(CustomRecipeTypes.TESLA_SYNTHESIZER, this, level); if (recipe.isPresent()) return recipe.get().getCookTime(); diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/blockentity/CelestialLanternBlockEntity.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/blockentity/CelestialLanternBlockEntity.java new file mode 100644 index 000000000..40a19cb04 --- /dev/null +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/blockentity/CelestialLanternBlockEntity.java @@ -0,0 +1,72 @@ +package com.anonymoushacker1279.immersiveweapons.blockentity; + +import com.anonymoushacker1279.immersiveweapons.block.decoration.CelestialLanternBlock; +import com.anonymoushacker1279.immersiveweapons.init.DeferredRegistryHandler; +import net.minecraft.core.BlockPos; +import net.minecraft.nbt.*; +import net.minecraft.world.level.block.EntityBlock; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.state.BlockState; +import org.jetbrains.annotations.NotNull; + +import javax.annotation.Nullable; +import java.util.ArrayList; +import java.util.List; + +public class CelestialLanternBlockEntity extends BlockEntity implements EntityBlock { + + /** + * Constructor for CelestialLanternBlockEntity. + */ + public CelestialLanternBlockEntity(BlockPos blockPos, BlockState blockState) { + super(DeferredRegistryHandler.CELESTIAL_LANTERN_BLOCK_ENTITY.get(), blockPos, blockState); + } + + /** + * Create a block entity for the block. + * + * @param blockPos the BlockPos the block is at + * @param blockState the BlockState of the block + * @return BlockEntity + */ + @Nullable + @Override + public BlockEntity newBlockEntity(@NotNull BlockPos blockPos, @NotNull BlockState blockState) { + return new CelestialLanternBlockEntity(blockPos, blockState); + } + + /** + * Save NBT data. + * + * @param tag the CompoundNBT to save + */ + @Override + protected void saveAdditional(@NotNull CompoundTag tag) { + super.saveAdditional(tag); + + ListTag listTag = new ListTag(); + CelestialLanternBlock.ALL_TILTROS_LANTERNS + .forEach(pos -> listTag.add(NbtUtils.writeBlockPos(pos))); + + tag.put("tiltros_lanterns", listTag); + } + + /** + * Load NBT data. + * + * @param tag the CompoundTag to load + */ + @Override + public void load(@NotNull CompoundTag tag) { + super.load(tag); + ListTag SAVED_LANTERNS = (ListTag) tag.get("tiltros_lanterns"); + if (SAVED_LANTERNS != null) { + if (CelestialLanternBlock.ALL_TILTROS_LANTERNS.size() == 0 && SAVED_LANTERNS.size() > 0) { + List blockPosList = new ArrayList<>(SAVED_LANTERNS.size()); + SAVED_LANTERNS.forEach(tag1 -> blockPosList.add(NbtUtils.readBlockPos((CompoundTag) tag1))); + + CelestialLanternBlock.ALL_TILTROS_LANTERNS = blockPosList; + } + } + } +} \ No newline at end of file diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/blockentity/MedicStatueBlockEntity.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/blockentity/MedicStatueBlockEntity.java index 055f58190..f7a196207 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/blockentity/MedicStatueBlockEntity.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/blockentity/MedicStatueBlockEntity.java @@ -3,6 +3,7 @@ import com.anonymoushacker1279.immersiveweapons.entity.neutral.FieldMedicEntity; import com.anonymoushacker1279.immersiveweapons.init.DeferredRegistryHandler; import com.anonymoushacker1279.immersiveweapons.util.GeneralUtilities; +import com.anonymoushacker1279.immersiveweapons.world.level.levelgen.biomes.BiomesAndDimensions; import net.minecraft.core.BlockPos; import net.minecraft.core.particles.ParticleTypes; import net.minecraft.nbt.CompoundTag; @@ -34,19 +35,24 @@ public MedicStatueBlockEntity(BlockPos blockPos, BlockState blockState) { * Runs once each tick. Handle scanning and spawning entities. */ public static void serverTick(Level level, BlockPos blockPos, MedicStatueBlockEntity medicStatueBlockEntity) { - // TODO: Rework when Forge API updates - // if (Objects.equals(level.getBiome(blockPos).getRegistryName(), DeferredRegistryHandler.BATTLEFIELD.get().getRegistryName()) && medicStatueBlockEntity.cooldown == 0) { - if (medicStatueBlockEntity.cooldown == 0) { - List listOfMedicsInArea = level.getEntitiesOfClass(FieldMedicEntity.class, new AABB(medicStatueBlockEntity.getBlockPos().getX() - 48, medicStatueBlockEntity.getBlockPos().getY() - 16, medicStatueBlockEntity.getBlockPos().getZ() - 48, medicStatueBlockEntity.getBlockPos().getX() + 48, medicStatueBlockEntity.getBlockPos().getY() + 16, medicStatueBlockEntity.getBlockPos().getZ() + 48)); + if (level.getBiome(blockPos).is(BiomesAndDimensions.BATTLEFIELD) && medicStatueBlockEntity.cooldown == 0) { + List listOfMedicsInArea = level.getEntitiesOfClass(FieldMedicEntity.class, + new AABB(medicStatueBlockEntity.getBlockPos().getX() - 48, + medicStatueBlockEntity.getBlockPos().getY() - 16, + medicStatueBlockEntity.getBlockPos().getZ() - 48, + medicStatueBlockEntity.getBlockPos().getX() + 48, + medicStatueBlockEntity.getBlockPos().getY() + 16, + medicStatueBlockEntity.getBlockPos().getZ() + 48)); + medicStatueBlockEntity.scannedMedics = listOfMedicsInArea.size(); if (medicStatueBlockEntity.scannedMedics <= 1) { FieldMedicEntity fieldMedicEntity = DeferredRegistryHandler.FIELD_MEDIC_ENTITY.get().create(level); if (fieldMedicEntity != null) { while (true) { - BlockPos blockPos1 = medicStatueBlockEntity.getRandomPositionInArea(); - if (level.getBlockState(blockPos1) == Blocks.AIR.defaultBlockState()) { - fieldMedicEntity.moveTo(blockPos1, 0.0F, 0.0F); + BlockPos randomPositionInArea = medicStatueBlockEntity.getRandomPositionInArea(); + if (level.getBlockState(randomPositionInArea) == Blocks.AIR.defaultBlockState()) { + fieldMedicEntity.moveTo(randomPositionInArea, 0.0F, 0.0F); level.addFreshEntity(fieldMedicEntity); medicStatueBlockEntity.spawnParticles(); medicStatueBlockEntity.cooldown = 400; @@ -70,7 +76,7 @@ public static void serverTick(Level level, BlockPos blockPos, MedicStatueBlockEn @Nullable @Override public BlockEntity newBlockEntity(@NotNull BlockPos blockPos, @NotNull BlockState blockState) { - return new MinutemanStatueBlockEntity(blockPos, blockState); + return new MedicStatueBlockEntity(blockPos, blockState); } /** @@ -79,7 +85,15 @@ public BlockEntity newBlockEntity(@NotNull BlockPos blockPos, @NotNull BlockStat private void spawnParticles() { ServerLevel serverWorld = (ServerLevel) getLevel(); if (serverWorld != null) { - serverWorld.sendParticles(ParticleTypes.HAPPY_VILLAGER, getBlockPos().getX() + 0.5d, getBlockPos().getY(), getBlockPos().getZ() + 0.75d, 5, GeneralUtilities.getRandomNumber(-0.05d, 0.05d), GeneralUtilities.getRandomNumber(-0.25d, 0.25d), GeneralUtilities.getRandomNumber(-0.05d, 0.05d), GeneralUtilities.getRandomNumber(-0.15d, 0.15d)); + serverWorld.sendParticles(ParticleTypes.HAPPY_VILLAGER, + getBlockPos().getX() + 0.5d, + getBlockPos().getY(), + getBlockPos().getZ() + 0.75d, + 5, + GeneralUtilities.getRandomNumber(-0.05d, 0.05d), + GeneralUtilities.getRandomNumber(-0.25d, 0.25d), + GeneralUtilities.getRandomNumber(-0.05d, 0.05d), + GeneralUtilities.getRandomNumber(-0.15d, 0.15d)); } } @@ -89,7 +103,9 @@ private void spawnParticles() { * @return BlockPos */ private BlockPos getRandomPositionInArea() { - return new BlockPos(getBlockPos().getX() + GeneralUtilities.getRandomNumber(-15, 15), getBlockPos().getY(), getBlockPos().getZ() + GeneralUtilities.getRandomNumber(-15, 15)); + return new BlockPos(getBlockPos().getX() + GeneralUtilities.getRandomNumber(-8, 8), + getBlockPos().getY(), + getBlockPos().getZ() + GeneralUtilities.getRandomNumber(-8, 8)); } /** diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/blockentity/MinutemanStatueBlockEntity.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/blockentity/MinutemanStatueBlockEntity.java index 3899a8cd7..e0983ed5e 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/blockentity/MinutemanStatueBlockEntity.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/blockentity/MinutemanStatueBlockEntity.java @@ -3,6 +3,7 @@ import com.anonymoushacker1279.immersiveweapons.entity.neutral.MinutemanEntity; import com.anonymoushacker1279.immersiveweapons.init.DeferredRegistryHandler; import com.anonymoushacker1279.immersiveweapons.util.GeneralUtilities; +import com.anonymoushacker1279.immersiveweapons.world.level.levelgen.biomes.BiomesAndDimensions; import net.minecraft.core.BlockPos; import net.minecraft.core.particles.ParticleTypes; import net.minecraft.nbt.CompoundTag; @@ -34,19 +35,24 @@ public MinutemanStatueBlockEntity(BlockPos blockPos, BlockState blockState) { * Runs once each tick. Handle scanning and spawning entities. */ public static void serverTick(Level level, BlockPos blockPos, MinutemanStatueBlockEntity minutemanStatueBlockEntity) { - // TODO: Rework when Forge API updates - // if (Objects.equals(level.getBiome(blockPos).getRegistryName(), DeferredRegistryHandler.BATTLEFIELD.get().getRegistryName()) && minutemanStatueBlockEntity.cooldown == 0) { - if (minutemanStatueBlockEntity.cooldown == 0) { - List listOfMinutemenInArea = level.getEntitiesOfClass(MinutemanEntity.class, new AABB(minutemanStatueBlockEntity.getBlockPos().getX() - 48, minutemanStatueBlockEntity.getBlockPos().getY() - 16, minutemanStatueBlockEntity.getBlockPos().getZ() - 48, minutemanStatueBlockEntity.getBlockPos().getX() + 48, minutemanStatueBlockEntity.getBlockPos().getY() + 16, minutemanStatueBlockEntity.getBlockPos().getZ() + 48)); + if (level.getBiome(blockPos).is(BiomesAndDimensions.BATTLEFIELD) && minutemanStatueBlockEntity.cooldown == 0) { + List listOfMinutemenInArea = level.getEntitiesOfClass(MinutemanEntity.class, + new AABB(minutemanStatueBlockEntity.getBlockPos().getX() - 48, + minutemanStatueBlockEntity.getBlockPos().getY() - 16, + minutemanStatueBlockEntity.getBlockPos().getZ() - 48, + minutemanStatueBlockEntity.getBlockPos().getX() + 48, + minutemanStatueBlockEntity.getBlockPos().getY() + 16, + minutemanStatueBlockEntity.getBlockPos().getZ() + 48)); + minutemanStatueBlockEntity.scannedMinutemen = listOfMinutemenInArea.size(); if (minutemanStatueBlockEntity.scannedMinutemen <= 16) { MinutemanEntity minutemanEntity = DeferredRegistryHandler.MINUTEMAN_ENTITY.get().create(level); if (minutemanEntity != null) { while (true) { - BlockPos blockPos1 = minutemanStatueBlockEntity.getRandomPositionInArea(); - if (level.getBlockState(blockPos1) == Blocks.AIR.defaultBlockState()) { - minutemanEntity.moveTo(blockPos1, 0.0F, 0.0F); + BlockPos randomPositionInArea = minutemanStatueBlockEntity.getRandomPositionInArea(); + if (level.getBlockState(randomPositionInArea) == Blocks.AIR.defaultBlockState()) { + minutemanEntity.moveTo(randomPositionInArea, 0.0F, 0.0F); level.addFreshEntity(minutemanEntity); minutemanStatueBlockEntity.spawnParticles(); minutemanStatueBlockEntity.cooldown = 400; @@ -79,7 +85,15 @@ public BlockEntity newBlockEntity(@NotNull BlockPos blockPos, @NotNull BlockStat private void spawnParticles() { ServerLevel serverWorld = (ServerLevel) getLevel(); if (serverWorld != null) { - serverWorld.sendParticles(ParticleTypes.HAPPY_VILLAGER, getBlockPos().getX() + 0.5d, getBlockPos().getY(), getBlockPos().getZ() + 0.75d, 5, GeneralUtilities.getRandomNumber(-0.05d, 0.05d), GeneralUtilities.getRandomNumber(-0.25d, 0.25d), GeneralUtilities.getRandomNumber(-0.05d, 0.05d), GeneralUtilities.getRandomNumber(-0.15d, 0.15d)); + serverWorld.sendParticles(ParticleTypes.HAPPY_VILLAGER, + getBlockPos().getX() + 0.5d, + getBlockPos().getY(), + getBlockPos().getZ() + 0.75d, + 5, + GeneralUtilities.getRandomNumber(-0.05d, 0.05d), + GeneralUtilities.getRandomNumber(-0.25d, 0.25d), + GeneralUtilities.getRandomNumber(-0.05d, 0.05d), + GeneralUtilities.getRandomNumber(-0.15d, 0.15d)); } } @@ -89,7 +103,9 @@ private void spawnParticles() { * @return BlockPos */ private BlockPos getRandomPositionInArea() { - return new BlockPos(getBlockPos().getX() + GeneralUtilities.getRandomNumber(-15, 15), getBlockPos().getY(), getBlockPos().getZ() + GeneralUtilities.getRandomNumber(-15, 15)); + return new BlockPos(getBlockPos().getX() + GeneralUtilities.getRandomNumber(-15, 15), + getBlockPos().getY(), + getBlockPos().getZ() + GeneralUtilities.getRandomNumber(-15, 15)); } /** diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/client/integration/jei/ImmersiveWeaponsJEIPlugin.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/client/integration/jei/ImmersiveWeaponsJEIPlugin.java index 8c3de1700..c608921e2 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/client/integration/jei/ImmersiveWeaponsJEIPlugin.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/client/integration/jei/ImmersiveWeaponsJEIPlugin.java @@ -8,9 +8,7 @@ import com.anonymoushacker1279.immersiveweapons.container.SmallPartsContainer; import com.anonymoushacker1279.immersiveweapons.container.TeslaSynthesizerContainer; import com.anonymoushacker1279.immersiveweapons.init.DeferredRegistryHandler; -import com.anonymoushacker1279.immersiveweapons.item.crafting.ICustomRecipeType; -import com.anonymoushacker1279.immersiveweapons.item.crafting.SmallPartsRecipe; -import com.anonymoushacker1279.immersiveweapons.item.crafting.TeslaSynthesizerRecipe; +import com.anonymoushacker1279.immersiveweapons.item.crafting.*; import com.google.common.collect.ImmutableSet; import mezz.jei.api.IModPlugin; import mezz.jei.api.JeiPlugin; @@ -58,8 +56,8 @@ public void registerRecipeCatalysts(IRecipeCatalystRegistration registration) { public void registerRecipes(IRecipeRegistration registration) { ClientLevel world = Objects.requireNonNull(Minecraft.getInstance().level); - Set smallPartsRecipes = ImmutableSet.copyOf(world.getRecipeManager().getAllRecipesFor(ICustomRecipeType.SMALL_PARTS)); - Set teslaSynthesizerRecipes = ImmutableSet.copyOf(world.getRecipeManager().getAllRecipesFor(ICustomRecipeType.TESLA_SYNTHESIZER)); + Set smallPartsRecipes = ImmutableSet.copyOf(world.getRecipeManager().getAllRecipesFor(CustomRecipeTypes.SMALL_PARTS)); + Set teslaSynthesizerRecipes = ImmutableSet.copyOf(world.getRecipeManager().getAllRecipesFor(CustomRecipeTypes.TESLA_SYNTHESIZER)); registration.addRecipes(smallPartsRecipes, SmallPartsRecipeCategory.UID); registration.addRecipes(teslaSynthesizerRecipes, TeslaSynthesizerRecipeCategory.UID); } diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/client/model/LavaRevenantModel.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/client/model/LavaRevenantModel.java index b4b8da970..0f3f628f7 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/client/model/LavaRevenantModel.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/client/model/LavaRevenantModel.java @@ -1,6 +1,6 @@ package com.anonymoushacker1279.immersiveweapons.client.model; -import com.anonymoushacker1279.immersiveweapons.entity.monster.LavaRevenantEntity; +import com.anonymoushacker1279.immersiveweapons.entity.monster.lava_revenant.LavaRevenantEntity; import net.minecraft.client.model.HierarchicalModel; import net.minecraft.client.model.geom.ModelPart; import net.minecraft.util.Mth; diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/client/renderer/entity/layers/LavaRevenantEyesLayer.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/client/renderer/entity/layers/LavaRevenantEyesLayer.java index 4a2438854..af251104b 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/client/renderer/entity/layers/LavaRevenantEyesLayer.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/client/renderer/entity/layers/LavaRevenantEyesLayer.java @@ -2,7 +2,7 @@ import com.anonymoushacker1279.immersiveweapons.ImmersiveWeapons; import com.anonymoushacker1279.immersiveweapons.client.model.LavaRevenantModel; -import com.anonymoushacker1279.immersiveweapons.entity.monster.LavaRevenantEntity; +import com.anonymoushacker1279.immersiveweapons.entity.monster.lava_revenant.LavaRevenantEntity; import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.entity.RenderLayerParent; import net.minecraft.client.renderer.entity.layers.EyesLayer; diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/client/renderer/entity/mob/LavaRevenantRenderer.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/client/renderer/entity/mob/LavaRevenantRenderer.java index 9c553e915..eda528ae8 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/client/renderer/entity/mob/LavaRevenantRenderer.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/client/renderer/entity/mob/LavaRevenantRenderer.java @@ -3,7 +3,7 @@ import com.anonymoushacker1279.immersiveweapons.ImmersiveWeapons; import com.anonymoushacker1279.immersiveweapons.client.model.LavaRevenantModel; import com.anonymoushacker1279.immersiveweapons.client.renderer.entity.layers.LavaRevenantEyesLayer; -import com.anonymoushacker1279.immersiveweapons.entity.monster.LavaRevenantEntity; +import com.anonymoushacker1279.immersiveweapons.entity.monster.lava_revenant.LavaRevenantEntity; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.math.Vector3f; import net.minecraft.client.model.geom.ModelLayers; diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/config/CommonConfig.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/config/CommonConfig.java index 36ec83bff..7b775f773 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/config/CommonConfig.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/config/CommonConfig.java @@ -2,59 +2,67 @@ import net.minecraftforge.common.ForgeConfigSpec; import net.minecraftforge.common.ForgeConfigSpec.Builder; +import net.minecraftforge.common.ForgeConfigSpec.DoubleValue; import org.apache.commons.lang3.tuple.Pair; -import java.util.*; - public class CommonConfig { public static final ForgeConfigSpec COMMON_SPEC; public static final CommonConfig COMMON; + // General settings public static ForgeConfigSpec.ConfigValue MAX_SMOKE_BOMB_PARTICLES; public static ForgeConfigSpec.ConfigValue BULLETS_BREAK_GLASS; - public static ForgeConfigSpec.ConfigValue DYING_SOLDIER_SPAWN; - public static ForgeConfigSpec.ConfigValue WANDERING_WARRIOR_SPAWN; - public static ForgeConfigSpec.ConfigValue HANS_SPAWN; - public static ForgeConfigSpec.ConfigValue LAVA_REVENANT_SPAWN; - public static ForgeConfigSpec.ConfigValue ROCK_SPIDER_SPAWN; - public static ForgeConfigSpec.ConfigValue CELESTIAL_TOWER_SPAWN; public static ForgeConfigSpec.ConfigValue TILTROS_ENABLED; - public static ForgeConfigSpec.ConfigValue CELESTIAL_TOWER_XZ_SPAWN_CHECK_RADIUS; - public static ForgeConfigSpec.ConfigValue CELESTIAL_TOWER_Y_SPAWN_CHECK_RADIUS; - public static ForgeConfigSpec.ConfigValue CELESTIAL_TOWER_MINIONS_WAVE_SIZE_MODIFIER; - public static ForgeConfigSpec.ConfigValue> MOLTEN_ORE_CONFIG; - public static ForgeConfigSpec.ConfigValue> NETHER_SULFUR_ORE_CONFIG; - public static ForgeConfigSpec.ConfigValue> SULFUR_ORE_CONFIG; - public static ForgeConfigSpec.ConfigValue> DEEPSLATE_SULFUR_ORE_CONFIG; - public static ForgeConfigSpec.ConfigValue> COBALT_ORE_CONFIG; - public static ForgeConfigSpec.ConfigValue> DEEPSLATE_COBALT_ORE_CONFIG; - public static ForgeConfigSpec.ConfigValue MAX_ABANDONED_FACTORY_DISTANCE; - public static ForgeConfigSpec.ConfigValue MIN_ABANDONED_FACTORY_DISTANCE; - public static ForgeConfigSpec.ConfigValue MAX_PITFALL_TRAP_DISTANCE; - public static ForgeConfigSpec.ConfigValue MIN_PITFALL_TRAP_DISTANCE; - public static ForgeConfigSpec.ConfigValue MAX_BEAR_TRAP_DISTANCE; - public static ForgeConfigSpec.ConfigValue MIN_BEAR_TRAP_DISTANCE; - public static ForgeConfigSpec.ConfigValue MAX_LANDMINE_TRAP_DISTANCE; - public static ForgeConfigSpec.ConfigValue MIN_LANDMINE_TRAP_DISTANCE; - public static ForgeConfigSpec.ConfigValue MAX_UNDERGROUND_BUNKER_DISTANCE; - public static ForgeConfigSpec.ConfigValue MIN_UNDERGROUND_BUNKER_DISTANCE; - public static ForgeConfigSpec.ConfigValue MAX_BATTLEFIELD_CAMP_DISTANCE; - public static ForgeConfigSpec.ConfigValue MIN_BATTLEFIELD_CAMP_DISTANCE; - public static ForgeConfigSpec.ConfigValue MAX_BATTLEFIELD_VILLAGE_DISTANCE; - public static ForgeConfigSpec.ConfigValue MIN_BATTLEFIELD_VILLAGE_DISTANCE; - public static ForgeConfigSpec.ConfigValue MAX_CLOUD_ISLAND_DISTANCE; - public static ForgeConfigSpec.ConfigValue MIN_CLOUD_ISLAND_DISTANCE; - public static ForgeConfigSpec.ConfigValue MAX_CAMPSITE_DISTANCE; - public static ForgeConfigSpec.ConfigValue MIN_CAMPSITE_DISTANCE; - public static ForgeConfigSpec.ConfigValue MAX_BATTLEFIELD_HOUSE_DISTANCE; - public static ForgeConfigSpec.ConfigValue MIN_BATTLEFIELD_HOUSE_DISTANCE; - public static ForgeConfigSpec.ConfigValue MAX_OUTHOUSE_DISTANCE; - public static ForgeConfigSpec.ConfigValue MIN_OUTHOUSE_DISTANCE; - public static ForgeConfigSpec.ConfigValue MAX_WATER_TOWER_DISTANCE; - public static ForgeConfigSpec.ConfigValue MIN_WATER_TOWER_DISTANCE; - public static ForgeConfigSpec.ConfigValue MAX_GRAVEYARD_DISTANCE; - public static ForgeConfigSpec.ConfigValue MIN_GRAVEYARD_DISTANCE; + + // Celestial Tower entity specific + public static ForgeConfigSpec.ConfigValue CELESTIAL_TOWER_SPAWN_CHECK_RADIUS; + public static ForgeConfigSpec.ConfigValue CELESTIAL_TOWER_MINIONS_WAVE_SIZE_MODIFIER; + + // Ore configurations + + // Molten Ore + public static ForgeConfigSpec.ConfigValue ENABLE_MOLTEN_ORE; + public static ForgeConfigSpec.ConfigValue MOLTEN_ORE_WEIGHT; + public static ForgeConfigSpec.ConfigValue MOLTEN_ORE_TOP_ANCHOR; + public static ForgeConfigSpec.ConfigValue MOLTEN_ORE_BOTTOM_ANCHOR; + public static ForgeConfigSpec.ConfigValue MOLTEN_ORE_SIZE; + public static DoubleValue MOLTEN_ORE_EXPOSED_DISCARD_CHANCE; + // Nether Sulfur Ore + public static ForgeConfigSpec.ConfigValue ENABLE_NETHER_SULFUR_ORE; + public static ForgeConfigSpec.ConfigValue NETHER_SULFUR_ORE_WEIGHT; + public static ForgeConfigSpec.ConfigValue NETHER_SULFUR_ORE_TOP_ANCHOR; + public static ForgeConfigSpec.ConfigValue NETHER_SULFUR_ORE_BOTTOM_ANCHOR; + public static ForgeConfigSpec.ConfigValue NETHER_SULFUR_ORE_SIZE; + public static DoubleValue NETHER_SULFUR_ORE_EXPOSED_DISCARD_CHANCE; + // Sulfur Ore + public static ForgeConfigSpec.ConfigValue ENABLE_SULFUR_ORE; + public static ForgeConfigSpec.ConfigValue SULFUR_ORE_WEIGHT; + public static ForgeConfigSpec.ConfigValue SULFUR_ORE_TOP_ANCHOR; + public static ForgeConfigSpec.ConfigValue SULFUR_ORE_BOTTOM_ANCHOR; + public static ForgeConfigSpec.ConfigValue SULFUR_ORE_SIZE; + public static DoubleValue SULFUR_ORE_EXPOSED_DISCARD_CHANCE; + // Deepslate Sulfur Ore + public static ForgeConfigSpec.ConfigValue ENABLE_DEEPSLATE_SULFUR_ORE; + public static ForgeConfigSpec.ConfigValue DEEPSLATE_SULFUR_ORE_WEIGHT; + public static ForgeConfigSpec.ConfigValue DEEPSLATE_SULFUR_ORE_TOP_ANCHOR; + public static ForgeConfigSpec.ConfigValue DEEPSLATE_SULFUR_ORE_BOTTOM_ANCHOR; + public static ForgeConfigSpec.ConfigValue DEEPSLATE_SULFUR_ORE_SIZE; + public static DoubleValue DEEPSLATE_SULFUR_ORE_EXPOSED_DISCARD_CHANCE; + // Cobalt Ore + public static ForgeConfigSpec.ConfigValue ENABLE_COBALT_ORE; + public static ForgeConfigSpec.ConfigValue COBALT_ORE_WEIGHT; + public static ForgeConfigSpec.ConfigValue COBALT_ORE_TOP_ANCHOR; + public static ForgeConfigSpec.ConfigValue COBALT_ORE_BOTTOM_ANCHOR; + public static ForgeConfigSpec.ConfigValue COBALT_ORE_SIZE; + public static DoubleValue COBALT_ORE_EXPOSED_DISCARD_CHANCE; + // Deepslate Cobalt Ore + public static ForgeConfigSpec.ConfigValue ENABLE_DEEPSLATE_COBALT_ORE; + public static ForgeConfigSpec.ConfigValue DEEPSLATE_COBALT_ORE_WEIGHT; + public static ForgeConfigSpec.ConfigValue DEEPSLATE_COBALT_ORE_TOP_ANCHOR; + public static ForgeConfigSpec.ConfigValue DEEPSLATE_COBALT_ORE_BOTTOM_ANCHOR; + public static ForgeConfigSpec.ConfigValue DEEPSLATE_COBALT_ORE_SIZE; + public static DoubleValue DEEPSLATE_COBALT_ORE_EXPOSED_DISCARD_CHANCE; CommonConfig(ForgeConfigSpec.Builder builder) { builder.push("Server Configuration"); @@ -64,248 +72,94 @@ public class CommonConfig { .comment("Set the maximum number of particles produced by the smoke bomb - Default 96\n" + "Setting this higher can make clients laggy, setting to 0 effectively disables it") .translation("config.immersiveweapons.max_smoke_bomb_particles") - .define("max_smoke_bomb_particles", 96); + .define("Max smoke bomb particles", 96); BULLETS_BREAK_GLASS = builder .comment("Enable bullets breaking glass - Default true") .translation("config.immersiveweapons.bullets_break_glass") - .define("bullets_break_glass", true); + .define("Bullets can break glass", true); TILTROS_ENABLED = builder .comment("Enable the Tiltros dimension portal - Default true") .translation("config.immersiveweapons.tiltros_enabled") - .define("tiltros_enabled", true); - builder.pop(); - - builder.push("Entity Spawns"); - DYING_SOLDIER_SPAWN = builder - .comment("Enable the natural spawning of Dying Soldiers - Default true") - .translation("config.immersiveweapons.dying_soldier_spawn") - .define("dying_soldiers_spawn", true); - WANDERING_WARRIOR_SPAWN = builder - .comment("Enable the natural spawning of Wandering Warriors - Default true") - .translation("config.immersiveweapons.wandering_warrior_spawn") - .define("wandering_warriors_spawn", true); - HANS_SPAWN = builder - .comment("Enable the natural spawning of Hans the Almighty - Default true") - .translation("config.immersiveweapons.hans_spawn") - .define("hans_spawn", true); - LAVA_REVENANT_SPAWN = builder - .comment("Enable the natural spawning of Lava Revenants - Default true") - .translation("config.immersiveweapons.lava_revenant_spawn") - .define("lava_revenant_spawn", true); - ROCK_SPIDER_SPAWN = builder - .comment("Enable the natural spawning of Rock Spiders - Default true") - .translation("config.immersiveweapons.rock_spider_spawn") - .define("rock_spider_spawn", true); - CELESTIAL_TOWER_SPAWN = builder - .comment("Enable the natural spawning of Celestial Towers - Default true") - .translation("config.immersiveweapons.celestial_tower_spawn") - .define("celestial_tower_spawn", true); + .define("Tiltros dimension is accessible via the portal", true); builder.pop(); builder.push("Celestial Tower"); - CELESTIAL_TOWER_XZ_SPAWN_CHECK_RADIUS = builder - .comment("Set the X and Z spawn checking radius for the Celestial Tower.\n" + - "Setting this higher will negatively impact server ticks in Tiltros, but make Celestial Lanterns more effective - Default 56") - .translation("config.immersiveweapons.celestial_tower_xz_spawn_check_radius") - .define("celestial_tower_xz_spawn_check_radius", 56); - CELESTIAL_TOWER_Y_SPAWN_CHECK_RADIUS = builder - .comment("Set the Y spawn checking radius for the Celestial Tower.\n" + - "Setting this higher will negatively impact server ticks in Tiltros, but make Celestial Lanterns more effective - Default 20") - .translation("config.immersiveweapons.celestial_tower_y_spawn_check_radius") - .define("celestial_tower_y_spawn_check_radius", 20); + CELESTIAL_TOWER_SPAWN_CHECK_RADIUS = builder + .comment("Set the spawn checking radius for the Celestial Tower.\n" + + "Setting this higher may slightly negatively impact server ticks in Tiltros, but make Celestial Lanterns more effective - Default 128") + .translation("config.immersiveweapons.celestial_tower_spawn_check_radius") + .define("Celestial Tower spawn checking radius", 128); CELESTIAL_TOWER_MINIONS_WAVE_SIZE_MODIFIER = builder .comment(""" Multiplier to change the wave size from Celestial Tower summons. Set less than 1 to reduce, greater than 1 to increase. Increasing the wave size will negatively affect the server ticks in Tiltros. - Default 1.0""") .translation("config.immersiveweapons.celestial_tower_minions_wave_size_modifier") - .define("celestial_tower_minions_wave_size_modifier", "1.0"); - builder.pop(); - - builder.push("Structure Generation"); - - builder.push("Abandoned Factory"); - MAX_ABANDONED_FACTORY_DISTANCE = builder - .comment("Maximum distance in chunks between Abandoned Factories - Default 120") - .translation("config.immersiveweapons.max_abandoned_factory_distance") - .define("max_abandoned_factory_distance", 120); - MIN_ABANDONED_FACTORY_DISTANCE = builder - .comment("Minimum distance in chunks between Abandoned Factories - Default 90") - .translation("config.immersiveweapons.min_abandoned_factory_distance") - .define("min_abandoned_factory_distance", 90); - builder.pop(); - - builder.push("Pitfall Trap"); - MAX_PITFALL_TRAP_DISTANCE = builder - .comment("Maximum distance in chunks between Pitfall Traps - Default 8") - .translation("config.immersiveweapons.max_pitfall_trap_distance") - .define("max_pitfall_trap_distance", 8); - MIN_PITFALL_TRAP_DISTANCE = builder - .comment("Minimum distance in chunks between Pitfall Traps - Default 2") - .translation("config.immersiveweapons.min_pitfall_trap_distance") - .define("min_pitfall_trap_distance", 2); - builder.pop(); - - builder.push("Bear Trap"); - MAX_BEAR_TRAP_DISTANCE = builder - .comment("Maximum distance in chunks between Bear Traps - Default 10") - .translation("config.immersiveweapons.max_bear_trap_distance") - .define("max_bear_trap_distance", 10); - MIN_BEAR_TRAP_DISTANCE = builder - .comment("Minimum distance in chunks between Bear Traps - Default 4") - .translation("config.immersiveweapons.min_bear_trap_distance") - .define("min_bear_trap_distance", 4); - builder.pop(); - - builder.push("Landmine Trap"); - MAX_LANDMINE_TRAP_DISTANCE = builder - .comment("Minimum distance in chunks between Landmine Traps - Default 12") - .translation("config.immersiveweapons.max_landmine_trap_distance") - .define("max_landmine_trap_distance", 12); - MIN_LANDMINE_TRAP_DISTANCE = builder - .comment("Minimum distance in chunks between Landmine Traps - Default 6") - .translation("config.immersiveweapons.min_landmine_trap_distance") - .define("min_landmine_trap_distance", 6); - builder.pop(); - - builder.push("Underground Bunker"); - MAX_UNDERGROUND_BUNKER_DISTANCE = builder - .comment("Maximum distance in chunks between Underground Bunkers - Default 110") - .translation("config.immersiveweapons.max_underground_bunker_distance") - .define("max_underground_bunker_distance", 110); - MIN_UNDERGROUND_BUNKER_DISTANCE = builder - .comment("Minimum distance in chunks between Underground Bunkers - Default 80") - .translation("config.immersiveweapons.min_underground_bunker_distance") - .define("min_underground_bunker_distance", 80); - builder.pop(); - - builder.push("Battlefield Camp"); - MAX_BATTLEFIELD_CAMP_DISTANCE = builder - .comment("Maximum distance in chunks between Battlefield Camps - Default 16") - .translation("config.immersiveweapons.max_battlefield_camp_distance") - .define("max_battlefield_camp_distance", 16); - MIN_BATTLEFIELD_CAMP_DISTANCE = builder - .comment("Minimum distance in chunks between Battlefield Camps - Default 4") - .translation("config.immersiveweapons.min_battlefield_camp_distance") - .define("min_battlefield_camp_distance", 4); - builder.pop(); - - builder.push("Battlefield Village"); - MAX_BATTLEFIELD_VILLAGE_DISTANCE = builder - .comment("Maximum distance in chunks between Battlefield Villages - Default 30") - .translation("config.immersiveweapons.max_battlefield_village_distance") - .define("max_battlefield_village_distance", 30); - MIN_BATTLEFIELD_VILLAGE_DISTANCE = builder - .comment("Minimum distance in chunks between Battlefield Villages - Default 10") - .translation("config.immersiveweapons.min_battlefield_village_distance") - .define("min_battlefield_village_distance", 10); - builder.pop(); - - builder.push("Cloud Island"); - MAX_CLOUD_ISLAND_DISTANCE = builder - .comment("Maximum distance in chunks between Cloud Islands - Default 90") - .translation("config.immersiveweapons.max_cloud_island_distance") - .define("max_cloud_island_distance", 90); - MIN_CLOUD_ISLAND_DISTANCE = builder - .comment("Minimum distance in chunks between Cloud Islands - Default 70") - .translation("config.immersiveweapons.min_cloud_island_distance") - .define("min_cloud_island_distance", 70); - builder.pop(); - - builder.push("Campsite"); - MAX_CAMPSITE_DISTANCE = builder - .comment("Maximum distance in chunks between Campsites - Default 50") - .translation("config.immersiveweapons.max_campsite_distance") - .define("max_campsite_distance", 50); - MIN_CAMPSITE_DISTANCE = builder - .comment("Minimum distance in chunks between Campsites - Default 30") - .translation("config.immersiveweapons.min_campsite_distance") - .define("min_campsite_distance", 30); - builder.pop(); - - builder.push("Battlefield House"); - MAX_BATTLEFIELD_HOUSE_DISTANCE = builder - .comment("Maximum distance in chunks between Battlefield Houses - Default 12") - .translation("config.immersiveweapons.max_battlefield_house_distance") - .define("max_battlefield_house_distance", 12); - MIN_BATTLEFIELD_HOUSE_DISTANCE = builder - .comment("Minimum distance in chunks between Battlefield Houses - Default 4") - .translation("config.immersiveweapons.min_battlefield_house_distance") - .define("min_battlefield_house_distance", 4); - builder.pop(); - - builder.push("Outhouse"); - MAX_OUTHOUSE_DISTANCE = builder - .comment("Maximum distance in chunks between Outhouses - Default 40") - .translation("config.immersiveweapons.max_outhouse_distance") - .define("max_outhouse_distance", 40); - MIN_OUTHOUSE_DISTANCE = builder - .comment("Minimum distance in chunks between Outhouses - Default 20") - .translation("config.immersiveweapons.min_outhouse_distance") - .define("min_outhouse_distance", 20); - builder.pop(); - - builder.push("Water Tower"); - MAX_WATER_TOWER_DISTANCE = builder - .comment("Maximum distance in chunks between Water Towers - Default 30") - .translation("config.immersiveweapons.max_water_tower_distance") - .define("max_water_tower_distance", 30); - MIN_WATER_TOWER_DISTANCE = builder - .comment("Minimum distance in chunks between Water Towers - Default 12") - .translation("config.immersiveweapons.min_water_tower_distance") - .define("min_water_tower_distance", 12); - builder.pop(); - - builder.push("Graveyard"); - MAX_GRAVEYARD_DISTANCE = builder - .comment("Maximum distance in chunks between Graveyards - Default 50") - .translation("config.immersiveweapons.max_graveyard_distance") - .define("max_graveyard_distance", 50); - MIN_GRAVEYARD_DISTANCE = builder - .comment("Minimum distance in chunks between Graveyards - Default 30") - .translation("config.immersiveweapons.min_graveyard_distance") - .define("min_graveyard_distance", 30); - builder.pop(); - + .define("Celestial Tower wave size modifier", 1.0D); builder.pop(); builder.push("Ore Generation"); - List molten_ore_config_list = new ArrayList<>(3); - molten_ore_config_list.addAll(Arrays.asList(4, 8, 64)); - MOLTEN_ORE_CONFIG = builder - .comment("Configuration for Molten Ore. Specified as a list. [ore_per_vein, veins_per_chunk, max_y]. Default: [4, 8, 64]") - .translation("config.immersiveweapons.molten_ore_config") - .define("molten_ore_config", molten_ore_config_list); - List nether_sulfur_ore_config_list = new ArrayList<>(2); - nether_sulfur_ore_config_list.addAll(Arrays.asList(12, 16)); - NETHER_SULFUR_ORE_CONFIG = builder - .comment("Configuration for Nether Sulfur Ore. Specified as a list. [ore_per_vein, veins_per_chunk]. Default: [12, 16]") - .translation("config.immersiveweapons.nether_sulfur_ore_config") - .define("nether_sulfur_ore_config", nether_sulfur_ore_config_list); - List sulfur_ore_config_list = new ArrayList<>(2); - sulfur_ore_config_list.addAll(Arrays.asList(8, 14)); - SULFUR_ORE_CONFIG = builder - .comment("Configuration for Sulfur Ore. Specified as a list. [ore_per_vein, veins_per_chunk]. Default: [8, 14]") - .translation("config.immersiveweapons.sulfur_ore_config") - .define("sulfur_ore_config", sulfur_ore_config_list); - List cobalt_ore_config_list = new ArrayList<>(3); - cobalt_ore_config_list.addAll(Arrays.asList(6, 12, 24)); - COBALT_ORE_CONFIG = builder - .comment("Configuration for Cobalt Ore. Specified as a list. [ore_per_vein, veins_per_chunk, blocks_below_top]. Default: [6, 12, 24]") - .translation("config.immersiveweapons.cobalt_ore_config") - .define("cobalt_ore_config", cobalt_ore_config_list); - List deepslate_sulfur_ore_config_list = new ArrayList<>(2); - deepslate_sulfur_ore_config_list.addAll(Arrays.asList(8, 14)); - DEEPSLATE_SULFUR_ORE_CONFIG = builder - .comment("Configuration for Deepslate Sulfur Ore. Specified as a list. [ore_per_vein, veins_per_chunk]. Default: [8, 14]") - .translation("config.immersiveweapons.deepslate_sulfur_ore_config") - .define("deepslate_sulfur_ore_config", deepslate_sulfur_ore_config_list); - List deepslate_cobalt_ore_config_list = new ArrayList<>(2); - deepslate_cobalt_ore_config_list.addAll(Arrays.asList(8, 16)); - DEEPSLATE_COBALT_ORE_CONFIG = builder - .comment("Configuration for Deepslate Cobalt Ore. Specified as a list. [ore_per_vein, veins_per_chunk]. Default: [8, 16]") - .translation("config.immersiveweapons.deepslate_cobalt_ore_config") - .define("deepslate_cobalt_ore_config", deepslate_cobalt_ore_config_list); + builder.comment("Note: A configuration will not exist for every ore. Ores found in structures (like Electric Ore) will not have configurations." + + "\nInstead, modify the structure separation settings."); + + builder.push("Molten Ore"); + ENABLE_MOLTEN_ORE = builder.comment("Enable generation of Molten Ore") + .define("Enable Molten Ore Generation", true); + MOLTEN_ORE_WEIGHT = builder.defineInRange("Molten Ore weight", 6, 1, Integer.MAX_VALUE); + MOLTEN_ORE_TOP_ANCHOR = builder.defineInRange("Molten Ore top anchor", 64, -64, 320); + MOLTEN_ORE_BOTTOM_ANCHOR = builder.defineInRange("Molten Ore bottom anchor", -64, -64, 320); + MOLTEN_ORE_SIZE = builder.defineInRange("Molten Ore size", 2, 0, Integer.MAX_VALUE); + MOLTEN_ORE_EXPOSED_DISCARD_CHANCE = builder.defineInRange("Molten Ore exposed to air discard chance", 0.85D, 0D, 1D); + builder.pop(); + + builder.push("Nether Sulfur Ore"); + ENABLE_NETHER_SULFUR_ORE = builder.comment("Enable generation of Nether Sulfur Ore") + .define("Enable Nether Sulfur Ore generation", true); + NETHER_SULFUR_ORE_WEIGHT = builder.defineInRange("Nether Sulfur Ore weight", 16, 1, Integer.MAX_VALUE); + NETHER_SULFUR_ORE_TOP_ANCHOR = builder.defineInRange("Nether Sulfur Ore top anchor", 128, -64, 320); + NETHER_SULFUR_ORE_BOTTOM_ANCHOR = builder.defineInRange("Nether Sulfur Ore bottom anchor", -16, -64, 320); + NETHER_SULFUR_ORE_SIZE = builder.defineInRange("Nether Sulfur Ore size", 12, 0, Integer.MAX_VALUE); + NETHER_SULFUR_ORE_EXPOSED_DISCARD_CHANCE = builder.defineInRange("Nether Sulfur Ore exposed to air discard chance", 0.08D, 0D, 1D); + builder.pop(); + + builder.push("Sulfur Ore"); + ENABLE_SULFUR_ORE = builder.comment("Enable generation of Sulfur Ore") + .define("Enable Sulfur Ore generation", true); + SULFUR_ORE_WEIGHT = builder.defineInRange("Sulfur Ore weight", 6, 1, Integer.MAX_VALUE); + SULFUR_ORE_TOP_ANCHOR = builder.defineInRange("Sulfur Ore top anchor", 196, -64, 320); + SULFUR_ORE_BOTTOM_ANCHOR = builder.defineInRange("Sulfur Ore bottom anchor", 32, -64, 320); + SULFUR_ORE_SIZE = builder.defineInRange("Sulfur Ore size", 4, 0, Integer.MAX_VALUE); + SULFUR_ORE_EXPOSED_DISCARD_CHANCE = builder.defineInRange("Sulfur Ore exposed to air discard chance", 0.1D, 0D, 1D); + builder.pop(); + + builder.push("Deepslate Sulfur Ore"); + ENABLE_DEEPSLATE_SULFUR_ORE = builder.comment("Enable generation of Deepslate Sulfur Ore") + .define("Enable Deepslate Sulfur Ore generation", true); + DEEPSLATE_SULFUR_ORE_WEIGHT = builder.defineInRange("Deepslate Sulfur Ore weight", 16, 1, Integer.MAX_VALUE); + DEEPSLATE_SULFUR_ORE_TOP_ANCHOR = builder.defineInRange("Deepslate Sulfur Ore top anchor", 0, -64, 320); + DEEPSLATE_SULFUR_ORE_BOTTOM_ANCHOR = builder.defineInRange("Deepslate Sulfur Ore bottom anchor", -64, -64, 320); + DEEPSLATE_SULFUR_ORE_SIZE = builder.defineInRange("Deepslate Sulfur Ore size", 4, 0, Integer.MAX_VALUE); + DEEPSLATE_SULFUR_ORE_EXPOSED_DISCARD_CHANCE = builder.defineInRange("Deepslate Sulfur Ore exposed to air discard chance", 0.04D, 0D, 1D); + builder.pop(); + + builder.push("Cobalt Ore"); + ENABLE_COBALT_ORE = builder.comment("Enable generation of Cobalt Ore") + .define("Enable Cobalt Ore generation", true); + COBALT_ORE_WEIGHT = builder.defineInRange("Cobalt Ore weight", 12, 1, Integer.MAX_VALUE); + COBALT_ORE_TOP_ANCHOR = builder.defineInRange("Cobalt Ore top anchor", 196, -64, 320); + COBALT_ORE_BOTTOM_ANCHOR = builder.defineInRange("Cobalt Ore bottom anchor", 7, -64, 320); + COBALT_ORE_SIZE = builder.defineInRange("Cobalt Ore size", 6, 0, Integer.MAX_VALUE); + COBALT_ORE_EXPOSED_DISCARD_CHANCE = builder.defineInRange("Cobalt Ore exposed to air discard chance", 0.15D, 0D, 1D); + builder.pop(); + + builder.push("Deepslate Cobalt Ore"); + ENABLE_DEEPSLATE_COBALT_ORE = builder.comment("Enable generation of Deepslate Cobalt Ore") + .define("Enable Deepslate Cobalt Ore generation", true); + DEEPSLATE_COBALT_ORE_WEIGHT = builder.defineInRange("Deepslate Cobalt Ore weight", 12, 1, Integer.MAX_VALUE); + DEEPSLATE_COBALT_ORE_TOP_ANCHOR = builder.defineInRange("Deepslate Cobalt Ore top anchor", 0, -64, 320); + DEEPSLATE_COBALT_ORE_BOTTOM_ANCHOR = builder.defineInRange("Deepslate Cobalt Ore bottom anchor", -64, -64, 320); + DEEPSLATE_COBALT_ORE_SIZE = builder.defineInRange("Deepslate Cobalt Ore size", 12, 0, Integer.MAX_VALUE); + DEEPSLATE_COBALT_ORE_EXPOSED_DISCARD_CHANCE = builder.defineInRange("Deepslate Cobalt Ore exposed to air discard chance", 0.1D, 0D, 1D); builder.pop(); builder.pop(); diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/container/SmallPartsContainer.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/container/SmallPartsContainer.java index 7fbff8809..4b827bfb9 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/container/SmallPartsContainer.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/container/SmallPartsContainer.java @@ -1,7 +1,7 @@ package com.anonymoushacker1279.immersiveweapons.container; import com.anonymoushacker1279.immersiveweapons.init.DeferredRegistryHandler; -import com.anonymoushacker1279.immersiveweapons.item.crafting.ICustomRecipeType; +import com.anonymoushacker1279.immersiveweapons.item.crafting.CustomRecipeTypes; import com.anonymoushacker1279.immersiveweapons.item.crafting.SmallPartsRecipe; import net.minecraft.sounds.SoundSource; import net.minecraft.world.entity.player.Inventory; @@ -40,7 +40,7 @@ public SmallPartsContainer(int id, Inventory inv) { public SmallPartsContainer(int id, Inventory inv, ContainerLevelAccess access) { super(DeferredRegistryHandler.SMALL_PARTS_TABLE_CONTAINER.get(), id, inv, access); world = inv.player.level; - smallPartsRecipeList = world.getRecipeManager().getAllRecipesFor(ICustomRecipeType.SMALL_PARTS); + smallPartsRecipeList = world.getRecipeManager().getAllRecipesFor(CustomRecipeTypes.SMALL_PARTS); } /** @@ -91,7 +91,7 @@ protected void onTake(@NotNull Player player, ItemStack itemStack) { @Override public void createResult() { List recipes = world.getRecipeManager() - .getRecipesFor(ICustomRecipeType.SMALL_PARTS, inputSlots, world); + .getRecipesFor(CustomRecipeTypes.SMALL_PARTS, inputSlots, world); if (recipes.isEmpty()) { resultSlots.setItem(0, ItemStack.EMPTY); diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/data/CustomDataGenerator.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/data/CustomDataGenerator.java index a54e32fa7..7f55bc0c6 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/data/CustomDataGenerator.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/data/CustomDataGenerator.java @@ -4,8 +4,7 @@ import com.anonymoushacker1279.immersiveweapons.data.loot.LootTableGenerator; import com.anonymoushacker1279.immersiveweapons.data.models.ModelProvider; import com.anonymoushacker1279.immersiveweapons.data.recipes.RecipeGenerator; -import com.anonymoushacker1279.immersiveweapons.data.tags.BlockTagsGenerator; -import com.anonymoushacker1279.immersiveweapons.data.tags.ItemTagsGenerator; +import com.anonymoushacker1279.immersiveweapons.data.tags.*; import net.minecraft.data.DataGenerator; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; @@ -35,6 +34,7 @@ public static void gatherData(GatherDataEvent event) { BlockTagsGenerator blockTagsGenerator = new BlockTagsGenerator(generator, event.getExistingFileHelper()); generator.addProvider(blockTagsGenerator); generator.addProvider(new ItemTagsGenerator(generator, blockTagsGenerator, event.getExistingFileHelper())); + generator.addProvider(new BiomeTagsGenerator(generator, event.getExistingFileHelper())); } } } \ No newline at end of file diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/data/loot/BlockLootTables.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/data/loot/BlockLootTables.java index dbad33701..f2ef7a258 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/data/loot/BlockLootTables.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/data/loot/BlockLootTables.java @@ -1,7 +1,7 @@ package com.anonymoushacker1279.immersiveweapons.data.loot; import com.anonymoushacker1279.immersiveweapons.block.base.SandbagBlock; -import com.anonymoushacker1279.immersiveweapons.block.misc.portal.statue.warrior.WarriorStatueTorso; +import com.anonymoushacker1279.immersiveweapons.block.misc.warrior_statue.WarriorStatueTorso; import com.anonymoushacker1279.immersiveweapons.block.trap.LandmineBlock; import com.anonymoushacker1279.immersiveweapons.init.DeferredRegistryHandler; import com.google.common.collect.Maps; diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/data/loot/ChestLootTables.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/data/loot/ChestLootTables.java index e0472a619..5a09959eb 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/data/loot/ChestLootTables.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/data/loot/ChestLootTables.java @@ -35,6 +35,7 @@ public void accept(BiConsumer resourceLocationBuilder .add(LootItem.lootTableItem(DeferredRegistryHandler.OBSIDIAN_SHARD.get()).setWeight(4)) .add(LootItem.lootTableItem(DeferredRegistryHandler.ELECTRIC_INGOT.get()).setWeight(3)) .add(LootItem.lootTableItem(DeferredRegistryHandler.TESLA_INGOT.get()).setWeight(1)))); + resourceLocationBuilderBiConsumer.accept(LootTableLocations.BATTLEFIELD_CAMP, LootTable.lootTable() .withPool(LootPool.lootPool() @@ -53,6 +54,7 @@ public void accept(BiConsumer resourceLocationBuilder .apply(SetItemCountFunction.setCount(UniformGenerator.between(1.0f, 3.0f)))) .add(LootItem.lootTableItem(Items.EMERALD).setWeight(3)) .add(LootItem.lootTableItem(DeferredRegistryHandler.FLINTLOCK_PISTOL.get()).setWeight(1)))); + resourceLocationBuilderBiConsumer.accept(LootTableLocations.CAMPSITE, LootTable.lootTable() .withPool(LootPool.lootPool() @@ -72,6 +74,7 @@ public void accept(BiConsumer resourceLocationBuilder .add(LootItem.lootTableItem(DeferredRegistryHandler.FLARE.get()).setWeight(3) .apply(SetItemCountFunction.setCount(UniformGenerator.between(1.0f, 4.0f)))) .add(LootItem.lootTableItem(DeferredRegistryHandler.FLARE_GUN.get()).setWeight(1)))); + resourceLocationBuilderBiConsumer.accept(LootTableLocations.UNDERGROUND_BUNKER, LootTable.lootTable() .withPool(LootPool.lootPool() @@ -90,6 +93,7 @@ public void accept(BiConsumer resourceLocationBuilder .apply(SetItemCountFunction.setCount(UniformGenerator.between(1.0f, 3.0f)))) .add(LootItem.lootTableItem(DeferredRegistryHandler.FLINTLOCK_PISTOL.get()).setWeight(2)) .add(LootItem.lootTableItem(DeferredRegistryHandler.BLUNDERBUSS.get()).setWeight(1)))); + resourceLocationBuilderBiConsumer.accept(LootTableLocations.BATTLEFIELD_VILLAGE_MEDIC_STATION, LootTable.lootTable() .withPool(LootPool.lootPool() @@ -102,11 +106,42 @@ public void accept(BiConsumer resourceLocationBuilder .apply(SetItemCountFunction.setCount(UniformGenerator.between(1.0F, 3.0F)))) .add(LootItem.lootTableItem(Items.IRON_AXE).setWeight(4) .apply(EnchantRandomlyFunction.randomApplicableEnchantment()) - .apply(SetNameFunction.setName(new TranslatableComponent("loot.immersiveweapons.chest.village.battlefield.medic_station.iron_axe").withStyle(ChatFormatting.RED)))) + .apply(SetNameFunction + .setName(new TranslatableComponent("loot.immersiveweapons.chest.village.battlefield.medic_station.iron_axe") + .withStyle(ChatFormatting.RED)))) .add(LootItem.lootTableItem(DeferredRegistryHandler.USED_SYRINGE.get()).setWeight(4) .apply(SetItemCountFunction.setCount(UniformGenerator.between(1.0f, 3.0f)))) .add(LootItem.lootTableItem(DeferredRegistryHandler.SYRINGE.get()).setWeight(2) .apply(SetItemCountFunction.setCount(UniformGenerator.between(1.0f, 2.0f)))) .add(LootItem.lootTableItem(DeferredRegistryHandler.MORPHINE.get()).setWeight(1)))); + + resourceLocationBuilderBiConsumer.accept(LootTableLocations.HANS_HUT, + LootTable.lootTable() + .withPool(LootPool.lootPool() + .setRolls(UniformGenerator.between(4.0F, 6.0F)) + .add(LootItem.lootTableItem(Items.SALMON).setWeight(5) + .apply(SetItemCountFunction.setCount(UniformGenerator.between(1.0F, 6.0F)))) + .add(LootItem.lootTableItem(Items.COD).setWeight(5) + .apply(SetItemCountFunction.setCount(UniformGenerator.between(1.0F, 6.0F)))) + .add(LootItem.lootTableItem(DeferredRegistryHandler.BOTTLE_OF_ALCOHOL.get()).setWeight(4) + .apply(SetItemCountFunction.setCount(UniformGenerator.between(1.0f, 3.0f)))) + .add(LootItem.lootTableItem(DeferredRegistryHandler.BOTTLE_OF_WINE.get()).setWeight(4) + .apply(SetItemCountFunction.setCount(UniformGenerator.between(1.0f, 3.0f)))) + .add(LootItem.lootTableItem(Items.IRON_SWORD).setWeight(3) + .apply(SetItemCountFunction.setCount(UniformGenerator.between(1.0f, 1.0f))) + .apply(EnchantRandomlyFunction.randomApplicableEnchantment())) + .add(LootItem.lootTableItem(Items.IRON_HELMET).setWeight(2) + .apply(SetItemCountFunction.setCount(UniformGenerator.between(1.0f, 1.0f))) + .apply(EnchantRandomlyFunction.randomApplicableEnchantment())))); + + + resourceLocationBuilderBiConsumer.accept(LootTableLocations.HANS_HUT_CASK, + LootTable.lootTable() + .withPool(LootPool.lootPool() + .setRolls(UniformGenerator.between(6.0F, 9.0F)) + .add(LootItem.lootTableItem(Items.WHEAT).setWeight(2) + .apply(SetItemCountFunction.setCount(UniformGenerator.between(8.0F, 32.0F)))) + .add(LootItem.lootTableItem(Items.SWEET_BERRIES).setWeight(1) + .apply(SetItemCountFunction.setCount(UniformGenerator.between(8.0f, 16.0f)))))); } } \ No newline at end of file diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/data/loot/LootTableLocations.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/data/loot/LootTableLocations.java index b48c56fb7..f6d05a083 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/data/loot/LootTableLocations.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/data/loot/LootTableLocations.java @@ -18,6 +18,9 @@ public class LootTableLocations { public static final ResourceLocation UNDERGROUND_BUNKER = register("chests/underground_bunker"); public static final ResourceLocation BATTLEFIELD_VILLAGE_MEDIC_STATION = register("chests/village/battlefield/medic_station"); + public static final ResourceLocation HANS_HUT = register("chests/hans_hut"); + public static final ResourceLocation HANS_HUT_CASK = register("chests/hans_hut_cask"); + private static ResourceLocation register(String pId) { return register(new ResourceLocation(ImmersiveWeapons.MOD_ID, pId)); } diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/data/recipes/RecipeGenerator.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/data/recipes/RecipeGenerator.java index e6b7f5461..3e75ff111 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/data/recipes/RecipeGenerator.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/data/recipes/RecipeGenerator.java @@ -13,7 +13,7 @@ import net.minecraft.data.DataGenerator; import net.minecraft.data.recipes.*; import net.minecraft.tags.ItemTags; -import net.minecraft.tags.Tag.Named; +import net.minecraft.tags.TagKey; import net.minecraft.world.item.*; import net.minecraft.world.item.alchemy.PotionUtils; import net.minecraft.world.item.alchemy.Potions; @@ -1865,7 +1865,7 @@ private static void createFlagPole(ItemLike flagPoleItem) { .save(finishedRecipeConsumer); } - private static void createBulletproofStainedGlass(ItemLike stainedGlassItem, Named colorTag) { + private static void createBulletproofStainedGlass(ItemLike stainedGlassItem, TagKey colorTag) { ShapedRecipeBuilder.shaped(stainedGlassItem, 8) .define('a', DeferredRegistryHandler.BULLETPROOF_GLASS.get()) .define('b', colorTag) @@ -1926,7 +1926,7 @@ private static void createSulfur(ItemLike rawItem, ItemLike material) { .save(finishedRecipeConsumer); } - private static void createArrow(ShapedRecipeBuilder builder, Named material) { + private static void createArrow(ShapedRecipeBuilder builder, TagKey material) { builder.define('a', material) .define('b', Items.STICK) .define('c', Items.FEATHER) @@ -1936,7 +1936,7 @@ private static void createArrow(ShapedRecipeBuilder builder, Named materia .save(finishedRecipeConsumer); } - private static void createSword(ShapedRecipeBuilder builder, Named material, Item stick) { + private static void createSword(ShapedRecipeBuilder builder, TagKey material, Item stick) { builder.define('a', material) .define('b', stick) .pattern(" a ") @@ -1945,7 +1945,7 @@ private static void createSword(ShapedRecipeBuilder builder, Named materia .save(finishedRecipeConsumer); } - private static void createPickaxe(ShapedRecipeBuilder builder, Named material) { + private static void createPickaxe(ShapedRecipeBuilder builder, TagKey material) { builder.define('a', material) .define('b', Items.STICK) .pattern("aaa") @@ -1954,7 +1954,7 @@ private static void createPickaxe(ShapedRecipeBuilder builder, Named mater .save(finishedRecipeConsumer); } - private static void createAxe(ShapedRecipeBuilder builder, Named material) { + private static void createAxe(ShapedRecipeBuilder builder, TagKey material) { builder.define('a', material) .define('b', Items.STICK) .pattern("aa ") @@ -1963,7 +1963,7 @@ private static void createAxe(ShapedRecipeBuilder builder, Named material) .save(finishedRecipeConsumer); } - private static void createShovel(ShapedRecipeBuilder builder, Named material) { + private static void createShovel(ShapedRecipeBuilder builder, TagKey material) { builder.define('a', material) .define('b', Items.STICK) .pattern(" a ") @@ -1972,7 +1972,7 @@ private static void createShovel(ShapedRecipeBuilder builder, Named materi .save(finishedRecipeConsumer); } - private static void createHoe(ShapedRecipeBuilder builder, Named material) { + private static void createHoe(ShapedRecipeBuilder builder, TagKey material) { builder.define('a', material) .define('b', Items.STICK) .pattern("aa ") @@ -1981,14 +1981,14 @@ private static void createHoe(ShapedRecipeBuilder builder, Named material) .save(finishedRecipeConsumer); } - private static void createHelmet(ShapedRecipeBuilder builder, Named material) { + private static void createHelmet(ShapedRecipeBuilder builder, TagKey material) { builder.define('a', material) .pattern("aaa") .pattern("a a") .save(finishedRecipeConsumer); } - private static void createChestplate(ShapedRecipeBuilder builder, Named material) { + private static void createChestplate(ShapedRecipeBuilder builder, TagKey material) { builder.define('a', material) .pattern("a a") .pattern("aaa") @@ -1996,7 +1996,7 @@ private static void createChestplate(ShapedRecipeBuilder builder, Named ma .save(finishedRecipeConsumer); } - private static void createLeggings(ShapedRecipeBuilder builder, Named material) { + private static void createLeggings(ShapedRecipeBuilder builder, TagKey material) { builder.define('a', material) .pattern("aaa") .pattern("a a") @@ -2004,14 +2004,14 @@ private static void createLeggings(ShapedRecipeBuilder builder, Named mate .save(finishedRecipeConsumer); } - private static void createBoots(ShapedRecipeBuilder builder, Named material) { + private static void createBoots(ShapedRecipeBuilder builder, TagKey material) { builder.define('a', material) .pattern("a a") .pattern("a a") .save(finishedRecipeConsumer); } - private static void createGauntlet(ShapedRecipeBuilder builder, Named material) { + private static void createGauntlet(ShapedRecipeBuilder builder, TagKey material) { builder.define('a', material) .define('b', DeferredRegistryHandler.GAUNTLET_SCAFFOLDING.get()) .pattern("aaa") @@ -2019,7 +2019,7 @@ private static void createGauntlet(ShapedRecipeBuilder builder, Named mate .save(finishedRecipeConsumer); } - private static void createPike(ShapedRecipeBuilder builder, Named material, ItemLike pikeHead) { + private static void createPike(ShapedRecipeBuilder builder, TagKey material, ItemLike pikeHead) { builder.define('a', pikeHead) .define('b', material) .define('c', DeferredRegistryHandler.WOOD_TOOL_ROD.get()) @@ -2029,7 +2029,7 @@ private static void createPike(ShapedRecipeBuilder builder, Named material .save(finishedRecipeConsumer); } - private static void createPikeHead(ShapedRecipeBuilder builder, Named material, Named material1) { + private static void createPikeHead(ShapedRecipeBuilder builder, TagKey material, TagKey material1) { builder.define('a', material) .define('b', material1) .pattern(" a ") @@ -2037,7 +2037,7 @@ private static void createPikeHead(ShapedRecipeBuilder builder, Named mate .save(finishedRecipeConsumer); } - private static void createMusketBall(ShapedRecipeBuilder builder, Named material) { + private static void createMusketBall(ShapedRecipeBuilder builder, TagKey material) { builder.define('a', material) .define('b', Items.GUNPOWDER) .pattern(" a ") @@ -2045,13 +2045,13 @@ private static void createMusketBall(ShapedRecipeBuilder builder, Named ma .save(finishedRecipeConsumer); } - private static void createPlateItem(ShapedRecipeBuilder builder, Named material) { + private static void createPlateItem(ShapedRecipeBuilder builder, TagKey material) { builder.define('a', material) .pattern("aa ") .save(finishedRecipeConsumer); } - private static void create3x3Object(ShapedRecipeBuilder builder, Named material) { + private static void create3x3Object(ShapedRecipeBuilder builder, TagKey material) { builder.define('a', material) .pattern("aaa") .pattern("aaa") @@ -2088,7 +2088,7 @@ private static void createIngotFromBlock(ShapelessRecipeBuilder builder, ItemLik .save(finishedRecipeConsumer, ImmersiveWeapons.MOD_ID + ":" + getItemName(builder.getResult()) + "_from_" + getItemName(ingotBlock)); } - private static void createNuggetFromIngot(ShapelessRecipeBuilder builder, Named ingotBlock) { + private static void createNuggetFromIngot(ShapelessRecipeBuilder builder, TagKey ingotBlock) { builder.requires(ingotBlock) .save(finishedRecipeConsumer); } @@ -2106,7 +2106,7 @@ private static void createSmokeBomb(ItemLike smokeBombItem) { .save(finishedRecipeConsumer); } - private static void createColoredSmokeBomb(ItemLike smokeBombItem, Named colorTag) { + private static void createColoredSmokeBomb(ItemLike smokeBombItem, TagKey colorTag) { ShapedRecipeBuilder.shaped(smokeBombItem, 2) .define('a', Items.BAMBOO) .define('b', DeferredRegistryHandler.SMALL_PARTS_METAL_THROWABLE_BOMB.get()) @@ -2131,7 +2131,7 @@ private static void createSmokeBombArrow(ItemLike arrowItem) { .save(finishedRecipeConsumer); } - private static void createColoredSmokeBombArrow(ItemLike arrowItem, Named colorTag) { + private static void createColoredSmokeBombArrow(ItemLike arrowItem, TagKey colorTag) { ShapedRecipeBuilder.shaped(arrowItem, 4) .define('a', Items.ARROW) .define('b', DeferredRegistryHandler.SMOKE_POWDER.get()) @@ -2199,7 +2199,7 @@ private static void createShard(ShapelessRecipeBuilder builder, ItemLike materia .save(finishedRecipeConsumer); } - private static void createPistolLikeGun(ItemLike gunItem, Named material) { + private static void createPistolLikeGun(ItemLike gunItem, TagKey material) { ShapedRecipeBuilder.shaped(gunItem) .define('a', ItemTags.PLANKS) .define('b', DeferredRegistryHandler.SMALL_PARTS_IRON.get()) @@ -2268,21 +2268,21 @@ private static void teslaSynthesizing(ItemLike block, ItemLike material1, ItemLi .save(finishedRecipeConsumer, ImmersiveWeapons.MOD_ID + ":" + getItemName(result) + "_tesla_synthesizing"); } - private static void smallPartsTinkering(Named material, ItemLike blueprint, ItemLike result) { + private static void smallPartsTinkering(TagKey material, ItemLike blueprint, ItemLike result) { SmallPartsRecipeBuilder.tinker(Ingredient.of(material), Ingredient.of(blueprint), result.asItem()) .unlocks("copper_ingot", has(ForgeItemTagGroups.COPPER_INGOTS)) .save(finishedRecipeConsumer, ImmersiveWeapons.MOD_ID + ":" + getItemName(result) + "_tinkering"); } - private static String getConversionRecipeName(ItemLike pResult, ItemLike pIngredient) { + protected static String getConversionRecipeName(ItemLike pResult, ItemLike pIngredient) { return getItemName(pResult) + "_from_" + getItemName(pIngredient); } - private static String getItemName(ItemLike pItemLike) { + protected static @NotNull String getItemName(ItemLike pItemLike) { return Objects.requireNonNull(ForgeRegistries.ITEMS.getKey(pItemLike.asItem())).getPath(); } - private static String getHasName(ItemLike pItemLike) { + protected static String getHasName(ItemLike pItemLike) { return "has_" + getItemName(pItemLike); } } \ No newline at end of file diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/data/tags/BiomeTagsGenerator.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/data/tags/BiomeTagsGenerator.java new file mode 100644 index 000000000..6c29ff81f --- /dev/null +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/data/tags/BiomeTagsGenerator.java @@ -0,0 +1,74 @@ +package com.anonymoushacker1279.immersiveweapons.data.tags; + +import com.anonymoushacker1279.immersiveweapons.ImmersiveWeapons; +import com.anonymoushacker1279.immersiveweapons.data.tags.groups.forge.ForgeWorldGenTagGroups; +import com.anonymoushacker1279.immersiveweapons.data.tags.groups.immersiveweapons.ImmersiveWeaponsWorldGenTagGroups; +import com.anonymoushacker1279.immersiveweapons.world.level.levelgen.biomes.BiomesAndDimensions; +import net.minecraft.data.BuiltinRegistries; +import net.minecraft.data.DataGenerator; +import net.minecraft.data.tags.TagsProvider; +import net.minecraft.tags.BiomeTags; +import net.minecraft.world.level.biome.Biome; +import net.minecraft.world.level.biome.Biomes; +import net.minecraftforge.common.data.ExistingFileHelper; +import org.jetbrains.annotations.NotNull; + +public class BiomeTagsGenerator extends TagsProvider { + + public BiomeTagsGenerator(DataGenerator generator, ExistingFileHelper fileHelper) { + super(generator, BuiltinRegistries.BIOME, ImmersiveWeapons.MOD_ID, fileHelper); + } + + @Override + @SuppressWarnings("unchecked") + protected void addTags() { + tag(ForgeWorldGenTagGroups.IS_PLAINS) + .add(Biomes.PLAINS, Biomes.SNOWY_PLAINS, Biomes.SUNFLOWER_PLAINS); + + tag(ImmersiveWeaponsWorldGenTagGroups.HAS_ABANDONED_FACTORY) + .addTags(ForgeWorldGenTagGroups.IS_PLAINS, BiomeTags.IS_FOREST); + + tag(ImmersiveWeaponsWorldGenTagGroups.HAS_PITFALL_TRAP) + .addTag(BiomeTags.IS_JUNGLE); + + tag(ImmersiveWeaponsWorldGenTagGroups.HAS_BEAR_TRAP) + .addTags(ForgeWorldGenTagGroups.IS_PLAINS, BiomeTags.IS_FOREST); + + tag(ImmersiveWeaponsWorldGenTagGroups.HAS_LANDMINE_TRAP) + .add(Biomes.DESERT); + + tag(ImmersiveWeaponsWorldGenTagGroups.HAS_UNDERGROUND_BUNKER) + .addTags(ForgeWorldGenTagGroups.IS_PLAINS, BiomeTags.IS_FOREST); + + tag(ImmersiveWeaponsWorldGenTagGroups.HAS_CLOUD_ISLAND) + .addTag(BiomeTags.IS_TAIGA); + + tag(ImmersiveWeaponsWorldGenTagGroups.HAS_CAMPSITE) + .addTag(ForgeWorldGenTagGroups.IS_PLAINS) + .add(Biomes.DESERT); + + tag(ImmersiveWeaponsWorldGenTagGroups.HAS_WATER_TOWER) + .addTag(ForgeWorldGenTagGroups.IS_PLAINS); + + tag(ImmersiveWeaponsWorldGenTagGroups.HAS_HANS_HUT) + .add(Biomes.LUSH_CAVES) + .add(Biomes.DRIPSTONE_CAVES); + + tag(ImmersiveWeaponsWorldGenTagGroups.HAS_DESTROYED_HOUSE) + .add(BiomesAndDimensions.BATTLEFIELD); + + tag(ImmersiveWeaponsWorldGenTagGroups.HAS_BATTLEFIELD_CAMP) + .add(BiomesAndDimensions.BATTLEFIELD); + + tag(ImmersiveWeaponsWorldGenTagGroups.HAS_GRAVEYARD) + .add(BiomesAndDimensions.BATTLEFIELD); + + tag(ImmersiveWeaponsWorldGenTagGroups.HAS_BATTLEFIELD_TOWN) + .add(BiomesAndDimensions.BATTLEFIELD); + } + + @Override + public @NotNull String getName() { + return "Biome Tags"; + } +} \ No newline at end of file diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/data/tags/BlockTagsGenerator.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/data/tags/BlockTagsGenerator.java index 7b2a2cb8e..3eea5f041 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/data/tags/BlockTagsGenerator.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/data/tags/BlockTagsGenerator.java @@ -152,7 +152,7 @@ private void addMiningBlockTags() { } else if (block == DeferredRegistryHandler.SPOTLIGHT.get() || block == DeferredRegistryHandler.WOODEN_SPIKES.get() || block == DeferredRegistryHandler.PUNJI_STICKS.get()) { - + tier = 1; } else if (block == DeferredRegistryHandler.BARBED_WIRE_FENCE.get()) { tier = 2; @@ -162,17 +162,17 @@ private void addMiningBlockTags() { if (tagStage != 3) { switch (tagStage) { - case 1 -> tag(BlockTags.bind(BlockTags.MINEABLE_WITH_AXE.getName().toString())).add(block); - case 2 -> tag(BlockTags.bind(BlockTags.MINEABLE_WITH_SHOVEL.getName().toString())).add(block); - default -> tag(BlockTags.bind(BlockTags.MINEABLE_WITH_PICKAXE.getName().toString())).add(block); + case 1 -> tag(BlockTags.MINEABLE_WITH_AXE).add(block); + case 2 -> tag(BlockTags.MINEABLE_WITH_SHOVEL).add(block); + default -> tag(BlockTags.MINEABLE_WITH_PICKAXE).add(block); } } if (tier != 0) { switch (tier) { - case 2 -> tag(BlockTags.bind(BlockTags.NEEDS_IRON_TOOL.getName().toString())).add(block); - case 3 -> tag(BlockTags.bind(BlockTags.NEEDS_DIAMOND_TOOL.getName().toString())).add(block); - default -> tag(BlockTags.bind(BlockTags.NEEDS_STONE_TOOL.getName().toString())).add(block); + case 2 -> tag(BlockTags.NEEDS_IRON_TOOL).add(block); + case 3 -> tag(BlockTags.NEEDS_DIAMOND_TOOL).add(block); + default -> tag(BlockTags.NEEDS_STONE_TOOL).add(block); } } } diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/data/tags/groups/forge/ForgeBlockTagGroups.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/data/tags/groups/forge/ForgeBlockTagGroups.java index 8884c3781..e362976cd 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/data/tags/groups/forge/ForgeBlockTagGroups.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/data/tags/groups/forge/ForgeBlockTagGroups.java @@ -1,12 +1,16 @@ package com.anonymoushacker1279.immersiveweapons.data.tags.groups.forge; +import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.BlockTags; -import net.minecraft.tags.Tag.Named; +import net.minecraft.tags.TagKey; import net.minecraft.world.level.block.Block; public class ForgeBlockTagGroups { - public static final Named BULLETPROOF_GLASS = BlockTags.bind("forge:bulletproof_glass"); - public static final Named STAINED_GLASS = BlockTags.bind("forge:stained_glass"); - public static final Named COBALT_ORES = BlockTags.bind("forge:ores/cobalt"); + public static final TagKey BULLETPROOF_GLASS = BlockTags.create(new ResourceLocation("forge", + "bulletproof_glass")); + public static final TagKey STAINED_GLASS = BlockTags.create(new ResourceLocation("forge", + "stained_glass")); + public static final TagKey COBALT_ORES = BlockTags.create(new ResourceLocation("forge", + "ores/cobalt")); } \ No newline at end of file diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/data/tags/groups/forge/ForgeItemTagGroups.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/data/tags/groups/forge/ForgeItemTagGroups.java index ccf686432..ad269aaec 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/data/tags/groups/forge/ForgeItemTagGroups.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/data/tags/groups/forge/ForgeItemTagGroups.java @@ -1,18 +1,28 @@ package com.anonymoushacker1279.immersiveweapons.data.tags.groups.forge; +import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.ItemTags; -import net.minecraft.tags.Tag.Named; +import net.minecraft.tags.TagKey; import net.minecraft.world.item.Item; public class ForgeItemTagGroups { - public static final Named COBALT_ORES = ItemTags.bind("forge:ores/cobalt"); - public static final Named COBALT_INGOTS = ItemTags.bind("forge:ingots/cobalt"); - public static final Named COPPER_INGOTS = ItemTags.bind("forge:ingots/copper"); - public static final Named METAL_INGOTS = ItemTags.bind("forge:ingots/metal"); - public static final Named COBALT_NUGGETS = ItemTags.bind("forge:nuggets/cobalt"); - public static final Named COPPER_NUGGETS = ItemTags.bind("forge:nuggets/copper"); - public static final Named METAL_NUGGETS = ItemTags.bind("forge:nuggets/metal"); - public static final Named SULFUR_DUSTS = ItemTags.bind("forge:dusts/sulfur"); - public static final Named PICKAXES = ItemTags.bind("forge:pickaxes"); + public static final TagKey COBALT_ORES = ItemTags.create(new ResourceLocation("forge", + "ores/cobalt")); + public static final TagKey COBALT_INGOTS = ItemTags.create(new ResourceLocation("forge", + "ingots/cobalt")); + public static final TagKey COPPER_INGOTS = ItemTags.create(new ResourceLocation("forge", + "ingots/copper")); + public static final TagKey METAL_INGOTS = ItemTags.create(new ResourceLocation("forge", + "ingots/metal")); + public static final TagKey COBALT_NUGGETS = ItemTags.create(new ResourceLocation("forge", + "nuggets/cobalt")); + public static final TagKey COPPER_NUGGETS = ItemTags.create(new ResourceLocation("forge", + "nuggets/copper")); + public static final TagKey METAL_NUGGETS = ItemTags.create(new ResourceLocation("forge", + "nuggets/metal")); + public static final TagKey SULFUR_DUSTS = ItemTags.create(new ResourceLocation("forge", + "dusts/sulfur")); + public static final TagKey PICKAXES = ItemTags.create(new ResourceLocation("forge", + "pickaxes")); } \ No newline at end of file diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/data/tags/groups/forge/ForgeWorldGenTagGroups.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/data/tags/groups/forge/ForgeWorldGenTagGroups.java new file mode 100644 index 000000000..1cf1915af --- /dev/null +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/data/tags/groups/forge/ForgeWorldGenTagGroups.java @@ -0,0 +1,11 @@ +package com.anonymoushacker1279.immersiveweapons.data.tags.groups.forge; + +import net.minecraft.tags.BiomeTags; +import net.minecraft.tags.TagKey; +import net.minecraft.world.level.biome.Biome; + +public class ForgeWorldGenTagGroups { + + // For some reason Mojang doesn't have tags for plains biomes... + public static final TagKey IS_PLAINS = BiomeTags.create("forge:plains"); +} \ No newline at end of file diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/data/tags/groups/immersiveweapons/ImmersiveWeaponsBlockTagGroups.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/data/tags/groups/immersiveweapons/ImmersiveWeaponsBlockTagGroups.java index d69327604..d024c3b19 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/data/tags/groups/immersiveweapons/ImmersiveWeaponsBlockTagGroups.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/data/tags/groups/immersiveweapons/ImmersiveWeaponsBlockTagGroups.java @@ -1,10 +1,13 @@ package com.anonymoushacker1279.immersiveweapons.data.tags.groups.immersiveweapons; +import com.anonymoushacker1279.immersiveweapons.ImmersiveWeapons; +import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.BlockTags; -import net.minecraft.tags.Tag.Named; +import net.minecraft.tags.TagKey; import net.minecraft.world.level.block.Block; public class ImmersiveWeaponsBlockTagGroups { - public static final Named BURNED_OAK_LOGS = BlockTags.bind("immersiveweapons:burned_oak_logs"); + public static final TagKey BURNED_OAK_LOGS = BlockTags.create(new ResourceLocation(ImmersiveWeapons.MOD_ID, + "burned_oak_logs")); } \ No newline at end of file diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/data/tags/groups/immersiveweapons/ImmersiveWeaponsItemTagGroups.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/data/tags/groups/immersiveweapons/ImmersiveWeaponsItemTagGroups.java index b9aa60e14..ff01e6007 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/data/tags/groups/immersiveweapons/ImmersiveWeaponsItemTagGroups.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/data/tags/groups/immersiveweapons/ImmersiveWeaponsItemTagGroups.java @@ -1,20 +1,33 @@ package com.anonymoushacker1279.immersiveweapons.data.tags.groups.immersiveweapons; +import com.anonymoushacker1279.immersiveweapons.ImmersiveWeapons; +import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.ItemTags; -import net.minecraft.tags.Tag.Named; +import net.minecraft.tags.TagKey; import net.minecraft.world.item.Item; public class ImmersiveWeaponsItemTagGroups { - public static final Named BURNED_OAK_LOGS = ItemTags.bind("immersiveweapons:burned_oak_logs"); - public static final Named FLARES = ItemTags.bind("immersiveweapons:projectiles/flares"); - public static final Named MUSKET_BALLS = ItemTags.bind("immersiveweapons:projectiles/musket_balls"); - public static final Named MOLTEN_INGOTS = ItemTags.bind("immersiveweapons:ingots/molten"); - public static final Named ELECTRIC_INGOTS = ItemTags.bind("immersiveweapons:ingots/electric"); - public static final Named TESLA_INGOTS = ItemTags.bind("immersiveweapons:ingots/tesla"); - public static final Named MOLTEN_SHARDS = ItemTags.bind("immersiveweapons:shards/molten"); - public static final Named VENTUS_SHARDS = ItemTags.bind("immersiveweapons:shards/ventus"); - public static final Named DIAMOND_SHARDS = ItemTags.bind("immersiveweapons:shards/diamond"); - public static final Named STONE_SHARDS = ItemTags.bind("immersiveweapons:shards/stone"); - public static final Named WOOD_SHARDS = ItemTags.bind("immersiveweapons:shards/wood"); + public static final TagKey BURNED_OAK_LOGS = ItemTags.create(new ResourceLocation(ImmersiveWeapons.MOD_ID, + "burned_oak_logs")); + public static final TagKey FLARES = ItemTags.create(new ResourceLocation(ImmersiveWeapons.MOD_ID, + "projectiles/flares")); + public static final TagKey MUSKET_BALLS = ItemTags.create(new ResourceLocation(ImmersiveWeapons.MOD_ID, + "projectiles/musket_balls")); + public static final TagKey MOLTEN_INGOTS = ItemTags.create(new ResourceLocation(ImmersiveWeapons.MOD_ID, + "ingots/molten")); + public static final TagKey ELECTRIC_INGOTS = ItemTags.create(new ResourceLocation(ImmersiveWeapons.MOD_ID, + "ingots/electric")); + public static final TagKey TESLA_INGOTS = ItemTags.create(new ResourceLocation(ImmersiveWeapons.MOD_ID, + "ingots/tesla")); + public static final TagKey MOLTEN_SHARDS = ItemTags.create(new ResourceLocation(ImmersiveWeapons.MOD_ID, + "shards/molten")); + public static final TagKey VENTUS_SHARDS = ItemTags.create(new ResourceLocation(ImmersiveWeapons.MOD_ID, + "shards/ventus")); + public static final TagKey DIAMOND_SHARDS = ItemTags.create(new ResourceLocation(ImmersiveWeapons.MOD_ID, + "shards/diamond")); + public static final TagKey STONE_SHARDS = ItemTags.create(new ResourceLocation(ImmersiveWeapons.MOD_ID, + "shards/stone")); + public static final TagKey WOOD_SHARDS = ItemTags.create(new ResourceLocation(ImmersiveWeapons.MOD_ID, + "shards/wood")); } \ No newline at end of file diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/data/tags/groups/immersiveweapons/ImmersiveWeaponsWorldGenTagGroups.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/data/tags/groups/immersiveweapons/ImmersiveWeaponsWorldGenTagGroups.java new file mode 100644 index 000000000..23a0b862a --- /dev/null +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/data/tags/groups/immersiveweapons/ImmersiveWeaponsWorldGenTagGroups.java @@ -0,0 +1,35 @@ +package com.anonymoushacker1279.immersiveweapons.data.tags.groups.immersiveweapons; + +import com.anonymoushacker1279.immersiveweapons.ImmersiveWeapons; +import net.minecraft.tags.BiomeTags; +import net.minecraft.tags.TagKey; +import net.minecraft.world.level.biome.Biome; + +public class ImmersiveWeaponsWorldGenTagGroups { + + // Biome Tags + public static final TagKey HAS_ABANDONED_FACTORY = createStructureTag("abandoned_factory"); + public static final TagKey HAS_PITFALL_TRAP = createStructureTag("pitfall_trap"); + public static final TagKey HAS_BEAR_TRAP = createStructureTag("bear_trap"); + public static final TagKey HAS_LANDMINE_TRAP = createStructureTag("landmine_trap"); + public static final TagKey HAS_UNDERGROUND_BUNKER = createStructureTag("underground_bunker"); + public static final TagKey HAS_CLOUD_ISLAND = createStructureTag("cloud_island"); + public static final TagKey HAS_CAMPSITE = createStructureTag("campsite"); + public static final TagKey HAS_WATER_TOWER = createStructureTag("water_tower"); + public static final TagKey HAS_HANS_HUT = createStructureTag("hans_hut"); + public static final TagKey HAS_DESTROYED_HOUSE = createStructureTag("destroyed_house"); + public static final TagKey HAS_BATTLEFIELD_CAMP = createStructureTag("battlefield_camp"); + public static final TagKey HAS_GRAVEYARD = createStructureTag("graveyard"); + public static final TagKey HAS_BATTLEFIELD_TOWN = createStructureTag("battlefield_town"); + + // Structure Tags + + /** + * Helper method for creating a biome tag for containing structures. + * + * @param tag a string to be used for the tag + */ + private static TagKey createStructureTag(String tag) { + return BiomeTags.create(ImmersiveWeapons.MOD_ID + ":has_structure/" + tag); + } +} \ No newline at end of file diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/data/tags/groups/minecraft/MinecraftBlockTagGroups.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/data/tags/groups/minecraft/MinecraftBlockTagGroups.java index 0ea847a0f..2e50c25a5 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/data/tags/groups/minecraft/MinecraftBlockTagGroups.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/data/tags/groups/minecraft/MinecraftBlockTagGroups.java @@ -1,24 +1,25 @@ package com.anonymoushacker1279.immersiveweapons.data.tags.groups.minecraft; +import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.BlockTags; -import net.minecraft.tags.Tag.Named; +import net.minecraft.tags.TagKey; import net.minecraft.world.level.block.Block; public class MinecraftBlockTagGroups { - public static final Named FENCES = BlockTags.bind("minecraft:fences"); - public static final Named LOGS_THAT_BURN = BlockTags.bind("minecraft:logs_that_burn"); - public static final Named PLANKS = BlockTags.bind("minecraft:planks"); - public static final Named SLABS = BlockTags.bind("minecraft:slabs"); - public static final Named STAIRS = BlockTags.bind("minecraft:stairs"); - public static final Named STANDING_SIGNS = BlockTags.bind("minecraft:standing_signs"); - public static final Named WALL_SIGNS = BlockTags.bind("minecraft:wall_signs"); - public static final Named WOODEN_BUTTONS = BlockTags.bind("minecraft:wooden_buttons"); - public static final Named WOODEN_DOORS = BlockTags.bind("minecraft:wooden_doors"); - public static final Named WOODEN_FENCES = BlockTags.bind("minecraft:wooden_fences"); - public static final Named WOODEN_PRESSURE_PLATES = BlockTags.bind("minecraft:wooden_pressure_plates"); - public static final Named WOODEN_SLABS = BlockTags.bind("minecraft:wooden_slabs"); - public static final Named WOODEN_STAIRS = BlockTags.bind("minecraft:wooden_stairs"); - public static final Named WOODEN_TRAPDOORS = BlockTags.bind("minecraft:wooden_trapdoors"); - public static final Named NON_FLAMMABLE_WOOD = BlockTags.bind("minecraft:non_flammable_wood"); + public static final TagKey FENCES = BlockTags.create(new ResourceLocation("fences")); + public static final TagKey LOGS_THAT_BURN = BlockTags.create(new ResourceLocation("logs_that_burn")); + public static final TagKey PLANKS = BlockTags.create(new ResourceLocation("planks")); + public static final TagKey SLABS = BlockTags.create(new ResourceLocation("slabs")); + public static final TagKey STAIRS = BlockTags.create(new ResourceLocation("stairs")); + public static final TagKey STANDING_SIGNS = BlockTags.create(new ResourceLocation("standing_signs")); + public static final TagKey WALL_SIGNS = BlockTags.create(new ResourceLocation("wall_signs")); + public static final TagKey WOODEN_BUTTONS = BlockTags.create(new ResourceLocation("wooden_buttons")); + public static final TagKey WOODEN_DOORS = BlockTags.create(new ResourceLocation("wooden_doors")); + public static final TagKey WOODEN_FENCES = BlockTags.create(new ResourceLocation("wooden_fences")); + public static final TagKey WOODEN_PRESSURE_PLATES = BlockTags.create(new ResourceLocation("wooden_pressure_plates")); + public static final TagKey WOODEN_SLABS = BlockTags.create(new ResourceLocation("wooden_slabs")); + public static final TagKey WOODEN_STAIRS = BlockTags.create(new ResourceLocation("wooden_stairs")); + public static final TagKey WOODEN_TRAPDOORS = BlockTags.create(new ResourceLocation("wooden_trapdoors")); + public static final TagKey NON_FLAMMABLE_WOOD = BlockTags.create(new ResourceLocation("non_flammable_wood")); } \ No newline at end of file diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/data/tags/groups/minecraft/MinecraftItemTagGroups.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/data/tags/groups/minecraft/MinecraftItemTagGroups.java index 9163de641..602398ab0 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/data/tags/groups/minecraft/MinecraftItemTagGroups.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/data/tags/groups/minecraft/MinecraftItemTagGroups.java @@ -1,25 +1,26 @@ package com.anonymoushacker1279.immersiveweapons.data.tags.groups.minecraft; +import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.ItemTags; -import net.minecraft.tags.Tag.Named; +import net.minecraft.tags.TagKey; import net.minecraft.world.item.Item; public class MinecraftItemTagGroups { - - public static final Named FENCES = ItemTags.bind("minecraft:fences"); - public static final Named LOGS_THAT_BURN = ItemTags.bind("minecraft:logs_that_burn"); - public static final Named PLANKS = ItemTags.bind("minecraft:planks"); - public static final Named SLABS = ItemTags.bind("minecraft:slabs"); - public static final Named STAIRS = ItemTags.bind("minecraft:stairs"); - public static final Named SIGNS = ItemTags.bind("minecraft:signs"); - public static final Named WOODEN_BUTTONS = ItemTags.bind("minecraft:wooden_buttons"); - public static final Named WOODEN_DOORS = ItemTags.bind("minecraft:wooden_doors"); - public static final Named WOODEN_FENCES = ItemTags.bind("minecraft:wooden_fences"); - public static final Named WOODEN_PRESSURE_PLATES = ItemTags.bind("minecraft:wooden_pressure_plates"); - public static final Named WOODEN_SLABS = ItemTags.bind("minecraft:wooden_slabs"); - public static final Named WOODEN_STAIRS = ItemTags.bind("minecraft:wooden_stairs"); - public static final Named WOODEN_TRAPDOORS = ItemTags.bind("minecraft:wooden_trapdoors"); - public static final Named BOATS = ItemTags.bind("minecraft:boats"); - public static final Named ARROWS = ItemTags.bind("minecraft:arrows"); + + public static final TagKey FENCES = ItemTags.create(new ResourceLocation("fences")); + public static final TagKey LOGS_THAT_BURN = ItemTags.create(new ResourceLocation("logs_that_burn")); + public static final TagKey PLANKS = ItemTags.create(new ResourceLocation("planks")); + public static final TagKey SLABS = ItemTags.create(new ResourceLocation("slabs")); + public static final TagKey STAIRS = ItemTags.create(new ResourceLocation("stairs")); + public static final TagKey SIGNS = ItemTags.create(new ResourceLocation("signs")); + public static final TagKey WOODEN_BUTTONS = ItemTags.create(new ResourceLocation("wooden_buttons")); + public static final TagKey WOODEN_DOORS = ItemTags.create(new ResourceLocation("wooden_doors")); + public static final TagKey WOODEN_FENCES = ItemTags.create(new ResourceLocation("wooden_fences")); + public static final TagKey WOODEN_PRESSURE_PLATES = ItemTags.create(new ResourceLocation("wooden_pressure_plates")); + public static final TagKey WOODEN_SLABS = ItemTags.create(new ResourceLocation("wooden_slabs")); + public static final TagKey WOODEN_STAIRS = ItemTags.create(new ResourceLocation("wooden_stairs")); + public static final TagKey WOODEN_TRAPDOORS = ItemTags.create(new ResourceLocation("wooden_trapdoors")); + public static final TagKey BOATS = ItemTags.create(new ResourceLocation("boats")); + public static final TagKey ARROWS = ItemTags.create(new ResourceLocation("arrows")); } \ No newline at end of file diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/entity/ai/goal/CelestialTowerSummonGoal.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/entity/ai/goal/CelestialTowerSummonGoal.java index eba25f4dd..ee952a812 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/entity/ai/goal/CelestialTowerSummonGoal.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/entity/ai/goal/CelestialTowerSummonGoal.java @@ -11,6 +11,8 @@ import net.minecraft.server.level.ServerLevel; import net.minecraft.world.BossEvent.BossBarColor; import net.minecraft.world.InteractionHand; +import net.minecraft.world.effect.MobEffectInstance; +import net.minecraft.world.effect.MobEffects; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.entity.ai.attributes.Attributes; @@ -30,7 +32,7 @@ public class CelestialTowerSummonGoal extends Goal { private final CelestialTowerEntity mob; private int waveSpawnCooldown = 100; private AABB searchBox; - private static final float MINION_WAVE_SIZE_MODIFIER = Float.parseFloat(CommonConfig.CELESTIAL_TOWER_MINIONS_WAVE_SIZE_MODIFIER.get()); + private static final double MINION_WAVE_SIZE_MODIFIER = CommonConfig.CELESTIAL_TOWER_MINIONS_WAVE_SIZE_MODIFIER.get(); public CelestialTowerSummonGoal(CelestialTowerEntity pMob) { mob = pMob; @@ -56,61 +58,113 @@ public void tick() { int fodderMobsToSpawn = (int) (mobsToSpawn * 0.3f); // Get the number of "fodder" mobs to spawn mobsToSpawn = mobsToSpawn - fodderMobsToSpawn; // Reduce the total number left to spawn int powerMobsToSpawn = isWavesPastHalf() ? (int) (mobsToSpawn * 0.2f) : 0; // Get the number of "power" mobs to spawn, if over halfway through the waves - mobsToSpawn = mobsToSpawn - powerMobsToSpawn; //Reduce the total number left to spawn + mobsToSpawn = mobsToSpawn - powerMobsToSpawn; // Reduce the total number left to spawn for (int i = fodderMobsToSpawn; i > 0; i--) { - BlockPos summonPos = new BlockPos(mob.getX() + GeneralUtilities.getRandomNumber(-8, 9), mob.getY(), mob.getZ() + GeneralUtilities.getRandomNumber(-8, 9)); - RockSpiderEntity entity = new RockSpiderEntity(DeferredRegistryHandler.ROCK_SPIDER_ENTITY.get(), mob.level); - entity.setPersistenceRequired(); - entity.teleportTo(summonPos.getX(), summonPos.getY(), summonPos.getZ()); - mob.level.addFreshEntity(entity); - ((ServerLevel) mob.level).sendParticles(ParticleTypes.POOF, mob.position().x, mob.position().y, mob.position().z, 1, GeneralUtilities.getRandomNumber(-0.03d, 0.03d), GeneralUtilities.getRandomNumber(-0.1d, -0.08d), GeneralUtilities.getRandomNumber(-0.03d, 0.03d), 1.0f); + BlockPos summonPos = new BlockPos(mob.getX() + GeneralUtilities.getRandomNumber(-8, 9), + mob.getY(), + mob.getZ() + GeneralUtilities.getRandomNumber(-8, 9)); + + RockSpiderEntity rockSpiderEntity = new RockSpiderEntity(DeferredRegistryHandler.ROCK_SPIDER_ENTITY.get(), mob.level); + rockSpiderEntity.setPersistenceRequired(); + rockSpiderEntity.teleportTo(summonPos.getX(), summonPos.getY(), summonPos.getZ()); + mob.level.addFreshEntity(rockSpiderEntity); + ((ServerLevel) mob.level) + .sendParticles(ParticleTypes.POOF, + mob.position().x, + mob.position().y, + mob.position().z, + 1, + GeneralUtilities.getRandomNumber(-0.03d, 0.03d), + GeneralUtilities.getRandomNumber(-0.1d, -0.08d), + GeneralUtilities.getRandomNumber(-0.03d, 0.03d), 1.0f); + } for (int i = powerMobsToSpawn; i > 0; i--) { - BlockPos summonPos = new BlockPos(mob.getX() + GeneralUtilities.getRandomNumber(-8, 9), mob.getY(), mob.getZ() + GeneralUtilities.getRandomNumber(-8, 9)); - Zombie entity = new Zombie(EntityType.ZOMBIE, mob.level); - entity.setPersistenceRequired(); + BlockPos summonPos = new BlockPos(mob.getX() + GeneralUtilities.getRandomNumber(-8, 9), + mob.getY(), + mob.getZ() + GeneralUtilities.getRandomNumber(-8, 9)); + + Zombie zombieEntity = new Zombie(EntityType.ZOMBIE, mob.level); + zombieEntity.setPersistenceRequired(); ItemStack sword = new ItemStack(Items.IRON_SWORD); sword.enchant(Enchantments.SHARPNESS, GeneralUtilities.getRandomNumber(2, 4 + mob.getWavesSpawned())); sword.enchant(Enchantments.KNOCKBACK, GeneralUtilities.getRandomNumber(1, 3 + mob.getWavesSpawned())); sword.enchant(Enchantments.FIRE_ASPECT, GeneralUtilities.getRandomNumber(1, 2 + mob.getWavesSpawned())); - entity.setItemSlot(EquipmentSlot.HEAD, new ItemStack(Items.IRON_HELMET)); - entity.setItemSlot(EquipmentSlot.CHEST, new ItemStack(Items.IRON_CHESTPLATE)); - entity.setItemSlot(EquipmentSlot.LEGS, new ItemStack(Items.IRON_LEGGINGS)); - entity.setItemSlot(EquipmentSlot.FEET, new ItemStack(Items.IRON_BOOTS)); - Objects.requireNonNull(entity.getAttribute(Attributes.MAX_HEALTH)).setBaseValue(20 + (GeneralUtilities.getRandomNumber(5, 11) * mob.getWaveSizeModifier())); - entity.heal(entity.getMaxHealth()); - entity.setItemInHand(InteractionHand.MAIN_HAND, sword); - entity.teleportTo(summonPos.getX(), summonPos.getY(), summonPos.getZ()); - mob.level.addFreshEntity(entity); - ((ServerLevel) mob.level).sendParticles(ParticleTypes.POOF, mob.position().x, mob.position().y, mob.position().z, 1, GeneralUtilities.getRandomNumber(-0.03d, 0.03d), GeneralUtilities.getRandomNumber(-0.1d, -0.08d), GeneralUtilities.getRandomNumber(-0.03d, 0.03d), 1.0f); + zombieEntity.setItemSlot(EquipmentSlot.HEAD, new ItemStack(Items.IRON_HELMET)); + zombieEntity.setItemSlot(EquipmentSlot.CHEST, new ItemStack(Items.IRON_CHESTPLATE)); + zombieEntity.setItemSlot(EquipmentSlot.LEGS, new ItemStack(Items.IRON_LEGGINGS)); + zombieEntity.setItemSlot(EquipmentSlot.FEET, new ItemStack(Items.IRON_BOOTS)); + Objects.requireNonNull(zombieEntity.getAttribute(Attributes.MAX_HEALTH)) + .setBaseValue(20 + (GeneralUtilities.getRandomNumber(5, 11) * mob.getWaveSizeModifier())); + + zombieEntity.heal(zombieEntity.getMaxHealth()); + zombieEntity.addEffect(new MobEffectInstance(MobEffects.FIRE_RESISTANCE, 9999, 0, true, true)); + zombieEntity.setItemInHand(InteractionHand.MAIN_HAND, sword); + zombieEntity.teleportTo(summonPos.getX(), summonPos.getY(), summonPos.getZ()); + mob.level.addFreshEntity(zombieEntity); + ((ServerLevel) mob.level).sendParticles(ParticleTypes.POOF, + mob.position().x, + mob.position().y, + mob.position().z, + 1, + GeneralUtilities.getRandomNumber(-0.03d, 0.03d), + GeneralUtilities.getRandomNumber(-0.1d, -0.08d), + GeneralUtilities.getRandomNumber(-0.03d, 0.03d), 1.0f); + } for (int i = mobsToSpawn; i > 0; i--) { - BlockPos summonPos = new BlockPos(mob.getX() + GeneralUtilities.getRandomNumber(-8, 9), mob.getY(), mob.getZ() + GeneralUtilities.getRandomNumber(-8, 9)); - Skeleton entity = new Skeleton(EntityType.SKELETON, mob.level); - entity.setPersistenceRequired(); + BlockPos summonPos = new BlockPos(mob.getX() + GeneralUtilities.getRandomNumber(-8, 9), + mob.getY(), + mob.getZ() + GeneralUtilities.getRandomNumber(-8, 9)); + + Skeleton skeletonEntity = new Skeleton(EntityType.SKELETON, mob.level); + skeletonEntity.setPersistenceRequired(); ItemStack bow = new ItemStack(Items.BOW); bow.enchant(Enchantments.POWER_ARROWS, GeneralUtilities.getRandomNumber(1, 3 + mob.getWavesSpawned())); bow.enchant(Enchantments.PUNCH_ARROWS, GeneralUtilities.getRandomNumber(1, 2 + mob.getWavesSpawned())); - entity.setItemSlot(EquipmentSlot.HEAD, new ItemStack(Items.IRON_HELMET)); - Objects.requireNonNull(entity.getAttribute(Attributes.MAX_HEALTH)).setBaseValue(20 + (GeneralUtilities.getRandomNumber(0, 6) * mob.getWaveSizeModifier())); - entity.heal(entity.getMaxHealth()); - entity.setItemInHand(InteractionHand.MAIN_HAND, bow); - entity.teleportTo(summonPos.getX(), summonPos.getY(), summonPos.getZ()); - mob.level.addFreshEntity(entity); - ((ServerLevel) mob.level).sendParticles(ParticleTypes.POOF, mob.position().x, mob.position().y, mob.position().z, 1, GeneralUtilities.getRandomNumber(-0.03d, 0.03d), GeneralUtilities.getRandomNumber(-0.1d, -0.08d), GeneralUtilities.getRandomNumber(-0.03d, 0.03d), 1.0f); + skeletonEntity.setItemSlot(EquipmentSlot.HEAD, new ItemStack(Items.IRON_HELMET)); + Objects.requireNonNull(skeletonEntity.getAttribute(Attributes.MAX_HEALTH)) + .setBaseValue(20 + (GeneralUtilities.getRandomNumber(0, 6) * mob.getWaveSizeModifier())); + + skeletonEntity.heal(skeletonEntity.getMaxHealth()); + skeletonEntity.addEffect(new MobEffectInstance(MobEffects.FIRE_RESISTANCE, 9999, 0, true, true)); + skeletonEntity.setItemInHand(InteractionHand.MAIN_HAND, bow); + skeletonEntity.teleportTo(summonPos.getX(), summonPos.getY(), summonPos.getZ()); + mob.level.addFreshEntity(skeletonEntity); + ((ServerLevel) mob.level).sendParticles(ParticleTypes.POOF, + mob.position().x, + mob.position().y, + mob.position().z, + 1, + GeneralUtilities.getRandomNumber(-0.03d, 0.03d), + GeneralUtilities.getRandomNumber(-0.1d, -0.08d), + GeneralUtilities.getRandomNumber(-0.03d, 0.03d), 1.0f); } // Spawn some particles for (int i = 96; i > 0; i--) { - ((ServerLevel) mob.level).sendParticles(ParticleTypes.FLAME, mob.position().x, mob.position().y, mob.position().z, 1, GeneralUtilities.getRandomNumber(-0.03d, 0.03d), GeneralUtilities.getRandomNumber(-0.1d, -0.08d), GeneralUtilities.getRandomNumber(-0.03d, 0.03d), 1.0f); + ((ServerLevel) mob.level).sendParticles(ParticleTypes.FLAME, + mob.position().x, + mob.position().y, + mob.position().z, + 1, + GeneralUtilities.getRandomNumber(-0.03d, 0.03d), + GeneralUtilities.getRandomNumber(-0.1d, -0.08d), + GeneralUtilities.getRandomNumber(-0.03d, 0.03d), 1.0f); } mob.setWavesSpawned(mob.getWavesSpawned() + 1); // Increment the total spawned waves mob.bossEvent.setProgress((float) mob.getWavesSpawned() / mob.getTotalWavesToSpawn()); - mob.bossEvent.setName(new TranslatableComponent("immersiveweapons.boss.celestial_tower.waves", mob.getWavesSpawned(), mob.getTotalWavesToSpawn())); + mob.bossEvent.setName(new TranslatableComponent("immersiveweapons.boss.celestial_tower.waves", + mob.getWavesSpawned(), + mob.getTotalWavesToSpawn())); + mob.setNoActionTime(0); - mob.playSound(DeferredRegistryHandler.CELESTIAL_TOWER_SUMMON.get(), 1.0f, 1.0f + GeneralUtilities.getRandomNumber(-0.3f, 0.2f)); + mob.playSound(DeferredRegistryHandler.CELESTIAL_TOWER_SUMMON.get(), + 1.0f, + 1.0f + GeneralUtilities.getRandomNumber(-0.3f, 0.2f)); + waveSpawnCooldown = 100; // Set the wave spawn cooldown } else if (waveSpawnCooldown > 0) { waveSpawnCooldown--; @@ -120,17 +174,26 @@ public void tick() { mob.bossEvent.setName(mob.getDisplayName()); mob.bossEvent.setProgress(1f); mob.setNoActionTime(0); - mob.playSound(DeferredRegistryHandler.CELESTIAL_TOWER_VULNERABLE.get(), 1.0f, 1.0f + GeneralUtilities.getRandomNumber(-0.3f, 0.2f)); + mob.playSound(DeferredRegistryHandler.CELESTIAL_TOWER_VULNERABLE.get(), + 1.0f, + 1.0f + GeneralUtilities.getRandomNumber(-0.3f, 0.2f)); + } } // Only return major mobs in the area; "fodder" entities are ignored private int getEligibleMobsInArea() { if (searchBox == null) { - searchBox = new AABB(mob.getX() - 32, mob.getY() - 16, mob.getZ() - 32, mob.getX() + 16, mob.getY() + 16, mob.getZ() + 32); + searchBox = new AABB(mob.getX() - 32, + mob.getY() - 16, + mob.getZ() - 32, + mob.getX() + 16, + mob.getY() + 16, + mob.getZ() + 32); + } - int mobs; - mobs = mob.level.getNearbyEntities(Skeleton.class, TargetingConditions.forNonCombat(), mob, searchBox).size(); + + int mobs = mob.level.getNearbyEntities(Skeleton.class, TargetingConditions.forNonCombat(), mob, searchBox).size(); mobs = mobs + mob.level.getNearbyEntities(Zombie.class, TargetingConditions.forNonCombat(), mob, searchBox).size(); return mobs; } diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/entity/monster/AbstractDyingSoldierEntity.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/entity/monster/AbstractDyingSoldierEntity.java index f1b2fec9c..449df40fd 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/entity/monster/AbstractDyingSoldierEntity.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/entity/monster/AbstractDyingSoldierEntity.java @@ -26,8 +26,7 @@ import net.minecraft.world.entity.projectile.ProjectileUtil; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ProjectileWeaponItem; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.ServerLevelAccessor; +import net.minecraft.world.level.*; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.state.BlockState; import org.jetbrains.annotations.NotNull; @@ -64,18 +63,18 @@ public void start() { /** * Constructor for AbstractDyingSoldierEntity. * - * @param type the EntityType instance - * @param worldIn the World the entity is in + * @param type the EntityType instance + * @param level the Level the entity is in */ - AbstractDyingSoldierEntity(EntityType type, Level worldIn) { - super(type, worldIn); + AbstractDyingSoldierEntity(EntityType type, Level level) { + super(type, level); setCombatTask(); } /** * Register this entity's attributes. * - * @return AttributeModifierMap.MutableAttribute + * @return AttributeSupplier.Builder */ public static AttributeSupplier.Builder registerAttributes() { return Monster.createMonsterAttributes() @@ -106,11 +105,11 @@ protected void registerGoals() { /** * Play the step sound. * - * @param pos the BlockPos the entity is at - * @param blockIn the BlockState of the block being stepped on + * @param pos the BlockPos the entity is at + * @param state the BlockState of the block being stepped on */ @Override - protected void playStepSound(@NotNull BlockPos pos, @NotNull BlockState blockIn) { + protected void playStepSound(@NotNull BlockPos pos, @NotNull BlockState state) { playSound(getStepSound(), 0.15F, 1.0F); } @@ -119,7 +118,7 @@ protected void playStepSound(@NotNull BlockPos pos, @NotNull BlockState blockIn) /** * Get the mob type. * - * @return CreatureAttribute + * @return MobType */ @Override public @NotNull MobType getMobType() { @@ -151,31 +150,37 @@ protected void populateDefaultEquipmentSlots(@NotNull DifficultyInstance difficu /** * Finalize spawn information. * - * @param worldIn the IServerWorld the entity is in - * @param difficultyIn the DifficultyInstance of the world - * @param reason the SpawnReason for the entity - * @param spawnDataIn the ILivingEntitySpawnData for the entity - * @param dataTag the CompoundNBT data tag for the entity - * @return ILivingEntityData + * @param level the ServerLevelAccessor the entity is in + * @param difficulty the DifficultyInstance of the world + * @param spawnType the MobSpawnType for the entity + * @param groupData the SpawnGroupData for the entity + * @param tag the CompoundTag data tag for the entity + * @return SpawnGroupData */ @Override - public SpawnGroupData finalizeSpawn(@NotNull ServerLevelAccessor worldIn, @NotNull DifficultyInstance difficultyIn, @NotNull MobSpawnType reason, @Nullable SpawnGroupData spawnDataIn, @Nullable CompoundTag dataTag) { - spawnDataIn = super.finalizeSpawn(worldIn, difficultyIn, reason, spawnDataIn, dataTag); - populateDefaultEquipmentSlots(difficultyIn); - populateDefaultEquipmentEnchantments(difficultyIn); + public SpawnGroupData finalizeSpawn(@NotNull ServerLevelAccessor level, @NotNull DifficultyInstance difficulty, + @NotNull MobSpawnType spawnType, @Nullable SpawnGroupData groupData, + @Nullable CompoundTag tag) { + + groupData = super.finalizeSpawn(level, difficulty, spawnType, groupData, tag); + populateDefaultEquipmentSlots(difficulty); + populateDefaultEquipmentEnchantments(difficulty); setCombatTask(); - setCanPickUpLoot(random.nextFloat() < 0.55F * difficultyIn.getSpecialMultiplier()); + setCanPickUpLoot(random.nextFloat() < 0.55F * difficulty.getSpecialMultiplier()); + if (getItemBySlot(EquipmentSlot.HEAD).isEmpty()) { - LocalDate localdate = LocalDate.now(); - int day = localdate.get(ChronoField.DAY_OF_MONTH); - int month = localdate.get(ChronoField.MONTH_OF_YEAR); + LocalDate date = LocalDate.now(); + int day = date.get(ChronoField.DAY_OF_MONTH); + int month = date.get(ChronoField.MONTH_OF_YEAR); if (month == 10 && day == 31 && random.nextFloat() < 0.25F) { - setItemSlot(EquipmentSlot.HEAD, new ItemStack(random.nextFloat() < 0.1F ? Blocks.JACK_O_LANTERN : Blocks.CARVED_PUMPKIN)); + setItemSlot(EquipmentSlot.HEAD, + new ItemStack(random.nextFloat() < 0.1F ? Blocks.JACK_O_LANTERN : Blocks.CARVED_PUMPKIN)); + armorDropChances[EquipmentSlot.HEAD.getIndex()] = 0.0F; } } - return spawnDataIn; + return groupData; } /** @@ -272,12 +277,12 @@ public void readAdditionalSaveData(@NotNull CompoundTag compound) { /** * Set item slots. * - * @param slotIn the EquipmentSlotType to set - * @param stack the ItemStack to set in the slot + * @param slot the EquipmentSlot to set + * @param stack the ItemStack to set in the slot */ @Override - public void setItemSlot(@NotNull EquipmentSlot slotIn, @NotNull ItemStack stack) { - super.setItemSlot(slotIn, stack); + public void setItemSlot(@NotNull EquipmentSlot slot, @NotNull ItemStack stack) { + super.setItemSlot(slot, stack); if (!level.isClientSide) { setCombatTask(); } @@ -287,12 +292,12 @@ public void setItemSlot(@NotNull EquipmentSlot slotIn, @NotNull ItemStack stack) /** * Get the standing eye height of the entity. * - * @param poseIn the Pose instance - * @param sizeIn the EntitySize of the entity + * @param pose the Pose instance + * @param dimensions the EntityDimensions of the entity * @return float */ @Override - protected float getStandingEyeHeight(@NotNull Pose poseIn, @NotNull EntityDimensions sizeIn) { + protected float getStandingEyeHeight(@NotNull Pose pose, @NotNull EntityDimensions dimensions) { return 1.74F; } @@ -305,4 +310,12 @@ protected float getStandingEyeHeight(@NotNull Pose poseIn, @NotNull EntityDimens public double getMyRidingOffset() { return -0.6D; } + + @Override + public boolean checkSpawnRules(@NotNull LevelAccessor pLevel, @NotNull MobSpawnType pSpawnReason) { + boolean walkTargetAboveZero = super.checkSpawnRules(pLevel, pSpawnReason); + boolean onGround = pLevel.getBlockState(blockPosition().below()).getFluidState().isEmpty(); + + return walkTargetAboveZero && onGround; + } } \ No newline at end of file diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/entity/monster/AbstractWanderingWarriorEntity.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/entity/monster/AbstractWanderingWarriorEntity.java index 87204f59d..e9b60861d 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/entity/monster/AbstractWanderingWarriorEntity.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/entity/monster/AbstractWanderingWarriorEntity.java @@ -15,8 +15,7 @@ import net.minecraft.world.entity.monster.Monster; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.*; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.ServerLevelAccessor; +import net.minecraft.world.level.*; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.state.BlockState; import org.jetbrains.annotations.NotNull; @@ -44,18 +43,18 @@ public void start() { /** * Constructor for AbstractWanderingWarriorEntity. * - * @param type the EntityType instance - * @param worldIn the World the entity is in + * @param type the EntityType instance + * @param level the Level the entity is in */ - AbstractWanderingWarriorEntity(EntityType type, Level worldIn) { - super(type, worldIn); + AbstractWanderingWarriorEntity(EntityType type, Level level) { + super(type, level); setCombatTask(); } /** * Register this entity's attributes. * - * @return AttributeModifierMap.MutableAttribute + * @return AttributeSupplier.Builder */ public static AttributeSupplier.Builder registerAttributes() { return Monster.createMonsterAttributes() @@ -82,11 +81,11 @@ protected void registerGoals() { /** * Play the step sound. * - * @param pos the BlockPos the entity is at - * @param blockIn the BlockState of the block being stepped on + * @param pos the BlockPos the entity is at + * @param state the BlockState of the block being stepped on */ @Override - protected void playStepSound(@NotNull BlockPos pos, @NotNull BlockState blockIn) { + protected void playStepSound(@NotNull BlockPos pos, @NotNull BlockState state) { playSound(getStepSound(), 0.15F, 1.0F); } @@ -146,31 +145,37 @@ protected void populateDefaultEquipmentSlots(@NotNull DifficultyInstance difficu /** * Finalize spawn information. * - * @param worldIn the IServerWorld the entity is in - * @param difficultyIn the DifficultyInstance of the world - * @param reason the SpawnReason for the entity - * @param spawnDataIn the ILivingEntitySpawnData for the entity - * @param dataTag the CompoundNBT data tag for the entity - * @return ILivingEntityData + * @param level the ServerLevelAccessor the entity is in + * @param difficulty the DifficultyInstance of the world + * @param spawnType the MobSpawnType for the entity + * @param groupData the SpawnGroupData for the entity + * @param tag the CompoundTag data tag for the entity + * @return SpawnGroupData */ @Override - public SpawnGroupData finalizeSpawn(@NotNull ServerLevelAccessor worldIn, @NotNull DifficultyInstance difficultyIn, @NotNull MobSpawnType reason, @Nullable SpawnGroupData spawnDataIn, @Nullable CompoundTag dataTag) { - spawnDataIn = super.finalizeSpawn(worldIn, difficultyIn, reason, spawnDataIn, dataTag); - populateDefaultEquipmentSlots(difficultyIn); - populateDefaultEquipmentEnchantments(difficultyIn); + public SpawnGroupData finalizeSpawn(@NotNull ServerLevelAccessor level, @NotNull DifficultyInstance difficulty, + @NotNull MobSpawnType spawnType, @Nullable SpawnGroupData groupData, + @Nullable CompoundTag tag) { + + groupData = super.finalizeSpawn(level, difficulty, spawnType, groupData, tag); + populateDefaultEquipmentSlots(difficulty); + populateDefaultEquipmentEnchantments(difficulty); setCombatTask(); - setCanPickUpLoot(random.nextFloat() < 0.55F * difficultyIn.getSpecialMultiplier()); + setCanPickUpLoot(random.nextFloat() < 0.55F * difficulty.getSpecialMultiplier()); + if (getItemBySlot(EquipmentSlot.HEAD).isEmpty()) { LocalDate date = LocalDate.now(); int day = date.get(ChronoField.DAY_OF_MONTH); int month = date.get(ChronoField.MONTH_OF_YEAR); if (month == 10 && day == 31 && random.nextFloat() < 0.25F) { - setItemSlot(EquipmentSlot.HEAD, new ItemStack(random.nextFloat() < 0.1F ? Blocks.JACK_O_LANTERN : Blocks.CARVED_PUMPKIN)); + setItemSlot(EquipmentSlot.HEAD, + new ItemStack(random.nextFloat() < 0.1F ? Blocks.JACK_O_LANTERN : Blocks.CARVED_PUMPKIN)); + armorDropChances[EquipmentSlot.HEAD.getIndex()] = 0.0F; } } - return spawnDataIn; + return groupData; } /** @@ -189,10 +194,18 @@ void setCombatTask() { /** * Read entity NBT data. * - * @param compound the CompoundNBT to read from + * @param compound the CompoundTag to read from */ @Override public void readAdditionalSaveData(@NotNull CompoundTag compound) { super.readAdditionalSaveData(compound); } + + @Override + public boolean checkSpawnRules(@NotNull LevelAccessor pLevel, @NotNull MobSpawnType pSpawnReason) { + boolean walkTargetAboveZero = super.checkSpawnRules(pLevel, pSpawnReason); + boolean onGround = pLevel.getBlockState(blockPosition().below()).getFluidState().isEmpty(); + + return walkTargetAboveZero && onGround; + } } \ No newline at end of file diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/entity/monster/CelestialTowerEntity.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/entity/monster/CelestialTowerEntity.java index 3733a4d12..1447b4c1e 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/entity/monster/CelestialTowerEntity.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/entity/monster/CelestialTowerEntity.java @@ -1,16 +1,17 @@ package com.anonymoushacker1279.immersiveweapons.entity.monster; +import com.anonymoushacker1279.immersiveweapons.block.decoration.CelestialLanternBlock; import com.anonymoushacker1279.immersiveweapons.config.CommonConfig; import com.anonymoushacker1279.immersiveweapons.entity.ai.goal.CelestialTowerSummonGoal; import com.anonymoushacker1279.immersiveweapons.entity.ai.goal.HoverGoal; import com.anonymoushacker1279.immersiveweapons.init.DeferredRegistryHandler; import com.anonymoushacker1279.immersiveweapons.util.GeneralUtilities; import net.minecraft.core.BlockPos; +import net.minecraft.core.Vec3i; import net.minecraft.core.particles.ParticleTypes; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.TranslatableComponent; -import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerBossEvent; import net.minecraft.server.level.ServerPlayer; import net.minecraft.sounds.SoundEvent; @@ -26,12 +27,11 @@ import net.minecraft.world.entity.ai.goal.RandomLookAroundGoal; import net.minecraft.world.entity.monster.Monster; import net.minecraft.world.level.*; -import net.minecraft.world.level.block.state.BlockBehaviour.BlockStateBase; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.phys.AABB; +import net.minecraft.world.phys.Vec3; import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; +import java.util.List; import java.util.Objects; public class CelestialTowerEntity extends Monster { @@ -42,10 +42,7 @@ public class CelestialTowerEntity extends Monster { private int waveSizeModifier = 1; private int wavesSpawned = 0; private boolean doneSpawningWaves = false; - private static int lastSpawnAttemptTick = -1; - private final MinecraftServer server = getServer(); - private static final int XZ_SPAWN_CHECK_RADIUS = CommonConfig.CELESTIAL_TOWER_XZ_SPAWN_CHECK_RADIUS.get(); - private static final int Y_SPAWN_CHECK_RADIUS = CommonConfig.CELESTIAL_TOWER_Y_SPAWN_CHECK_RADIUS.get(); + private static final int SPAWN_CHECK_RADIUS = CommonConfig.CELESTIAL_TOWER_SPAWN_CHECK_RADIUS.get(); public CelestialTowerEntity(EntityType type, Level level) { super(type, level); @@ -208,40 +205,28 @@ public boolean checkSpawnRules(@NotNull LevelAccessor pLevel, @NotNull MobSpawnT if (pSpawnReason == MobSpawnType.SPAWNER || pSpawnReason == MobSpawnType.SPAWN_EGG) { return true; } - if (server.getTickCount() - CelestialTowerEntity.lastSpawnAttemptTick >= 40) { - CelestialTowerEntity.lastSpawnAttemptTick = server.getTickCount(); - BlockPos blockPos = blockPosition(); - long nearbyCelestialLanterns = level.getBlockStatesIfLoaded(new AABB(blockPos.getX() - XZ_SPAWN_CHECK_RADIUS, - blockPos.getY() - Y_SPAWN_CHECK_RADIUS, blockPos.getZ() - XZ_SPAWN_CHECK_RADIUS, - blockPos.getX() + XZ_SPAWN_CHECK_RADIUS, blockPos.getY() + Y_SPAWN_CHECK_RADIUS, - blockPos.getZ() + XZ_SPAWN_CHECK_RADIUS)) - .filter(blockState -> blockState == DeferredRegistryHandler.CELESTIAL_LANTERN.get().defaultBlockState()) - .limit(3) - .count(); - if (nearbyCelestialLanterns >= 3) { - return false; - } else if (nearbyCelestialLanterns == 0) { - return canSpawn(level, blockPos); - } else if (GeneralUtilities.getRandomNumber(0.0f, 1.0f) <= ( - nearbyCelestialLanterns == 2 ? 0.125f : 0.25f)) { - return canSpawn(level, blockPos); - } - } else if (CelestialTowerEntity.lastSpawnAttemptTick == -1) { - CelestialTowerEntity.lastSpawnAttemptTick = server.getTickCount(); + + if (!pLevel.getBlockState(blockPosition().below()).isValidSpawn(pLevel, blockPosition().below(), getType())) { + return false; } - return false; - } + Vec3 position = position(); + List ALL_TILTROS_LANTERNS = CelestialLanternBlock.ALL_TILTROS_LANTERNS; + int nearbyLanterns = 0; - private boolean canSpawn(LevelAccessor pLevel, BlockPos blockPos) { - BlockState belowState = pLevel.getBlockState(blockPos.below()); - boolean isValidSpawn = belowState.isValidSpawn(pLevel, blockPos.below(), getType()); - boolean hasSufficientGround = pLevel.getBlockStatesIfLoaded(new AABB(blockPos.getX() - 8, - blockPos.getY() - 1, blockPos.getZ() - 8, blockPos.getX() + 8, blockPos.getY(), - blockPos.getZ() + 8)) - .filter(BlockStateBase::isAir) - .count() / 256.0f >= 0.8f; - return isValidSpawn && hasSufficientGround; + for (BlockPos lanternPos : ALL_TILTROS_LANTERNS) { + if (nearbyLanterns < 3) { + if (lanternPos.distManhattan(new Vec3i(position.x, position.y, position.z)) < SPAWN_CHECK_RADIUS) { + nearbyLanterns++; + } + } + } + + if (nearbyLanterns == 3) { + return false; + } else if (nearbyLanterns == 0) { + return true; + } else return GeneralUtilities.getRandomNumber(0.0f, 1.0f) <= (nearbyLanterns == 2 ? 0.125f : 0.25f); } @Override diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/entity/monster/LavaRevenantEntity.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/entity/monster/lava_revenant/LavaRevenantEntity.java similarity index 69% rename from src/main/java/com/anonymoushacker1279/immersiveweapons/entity/monster/LavaRevenantEntity.java rename to src/main/java/com/anonymoushacker1279/immersiveweapons/entity/monster/lava_revenant/LavaRevenantEntity.java index 00d5c9dea..c147f4b33 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/entity/monster/LavaRevenantEntity.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/entity/monster/lava_revenant/LavaRevenantEntity.java @@ -1,4 +1,4 @@ -package com.anonymoushacker1279.immersiveweapons.entity.monster; +package com.anonymoushacker1279.immersiveweapons.entity.monster.lava_revenant; import com.anonymoushacker1279.immersiveweapons.init.DeferredRegistryHandler; import com.anonymoushacker1279.immersiveweapons.init.PacketHandler; @@ -25,9 +25,13 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.Level; import net.minecraft.world.level.ServerLevelAccessor; +import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.Heightmap; +import net.minecraft.world.level.material.Material; +import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.Vec3; import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.common.ForgeHooks; import net.minecraftforge.fml.DistExecutor; import net.minecraftforge.network.NetworkEvent; import net.minecraftforge.network.NetworkEvent.Context; @@ -40,24 +44,43 @@ public class LavaRevenantEntity extends FlyingMob implements Enemy { - public static final int TICKS_PER_FLAP = Mth.ceil(24.166098F); + private static final int TICKS_PER_FLAP = Mth.ceil(24.166098F); private static final EntityDataAccessor ID_SIZE = SynchedEntityData.defineId(LavaRevenantEntity.class, EntityDataSerializers.INT); Vec3 moveTargetPoint = Vec3.ZERO; BlockPos anchorPoint = BlockPos.ZERO; LavaRevenantEntity.AttackPhase attackPhase = LavaRevenantEntity.AttackPhase.CIRCLE; + private final LavaRevenantPart[] subEntities; + private final LavaRevenantPart wing1; + private final LavaRevenantPart wing2; + private final LavaRevenantPart head; + private final LavaRevenantPart body; + private final LavaRevenantPart tail; + private final double[][] positions = new double[64][3]; + private int posPointer = -1; + private float yRotA; + private boolean inWall; public LavaRevenantEntity(EntityType entityType, Level level) { super(entityType, level); xpReward = 25; moveControl = new LavaRevenantMoveControl(this); lookControl = new LavaRevenantLookControl(this); + + wing1 = new LavaRevenantPart(this, "wing", (6.0F * getScale()), 2.0F); + wing2 = new LavaRevenantPart(this, "wing", (6.0F * getScale()), 2.0F); + head = new LavaRevenantPart(this, "head", (3.0F * getScale()), (2.7F * getScale())); + body = new LavaRevenantPart(this, "body", (5.0F * (getScale() * 0.8f)), (2.0F * getScale())); + tail = new LavaRevenantPart(this, "tail", (2.5F * (getScale() * 0.8f)), 1.0F); + subEntities = new LavaRevenantPart[]{wing1, wing2, head, body, tail}; + + noPhysics = true; } /** * Register this entity's attributes. * - * @return AttributeModifierMap.MutableAttribute + * @return AttributeSupplier.Builder */ public static AttributeSupplier.Builder registerAttributes() { return Monster.createMonsterAttributes() @@ -76,7 +99,8 @@ public boolean removeWhenFarAway(double pDistanceToClosestPlayer) { } @Override - protected @NotNull BodyRotationControl createBodyControl() { + protected @NotNull + BodyRotationControl createBodyControl() { return new LavaRevenantBodyRotationControl(this); } @@ -137,13 +161,18 @@ protected boolean shouldDespawnInPeaceful() { @Override public void tick() { super.tick(); + if (level.isClientSide) { float flapTick = Mth.cos((float) (getUniqueFlapTickOffset() + tickCount) * 7.448451F * ((float) Math.PI / 180F) + (float) Math.PI); - float flapTick1 = Mth.cos((float) (getUniqueFlapTickOffset() + tickCount + 1) * 7.448451F + float nextFlapTick = Mth.cos((float) (getUniqueFlapTickOffset() + tickCount + 1) * 7.448451F * ((float) Math.PI / 180F) + (float) Math.PI); - if (flapTick > 0.0F && flapTick1 <= 0.0F) { + if (inWall) { + nextFlapTick *= 2.0f; + } + + if (flapTick > 0.0F && nextFlapTick <= 0.0F) { level.playLocalSound(getX(), getY(), getZ(), DeferredRegistryHandler.LAVA_REVENANT_FLAP.get(), getSoundSource(), 0.95F + random.nextFloat() * 0.05F, 0.95F + random.nextFloat() * 0.05F, false); @@ -158,16 +187,184 @@ public void tick() { getZ() + (double) zSizeModifier, 0.0D, 0.0D, 0.0D); level.addParticle(ParticleTypes.LAVA, getX() - (double) xSizeModifier, getY() + (double) ySizeModifier, getZ() - (double) zSizeModifier, 0.0D, 0.0D, 0.0D); + + } + + if (posPointer < 0) { + for (int i = 0; i < positions.length; ++i) { + positions[i][0] = getYRot(); + positions[i][1] = getY(); + } + } + + if (++posPointer == positions.length) { + posPointer = 0; + } + + Vec3[] subEntitiesLengthVector = new Vec3[subEntities.length]; + + for (int i = 0; i < subEntities.length; ++i) { + subEntitiesLengthVector[i] = new Vec3(subEntities[i].getX(), subEntities[i].getY(), subEntities[i].getZ()); + } + + double moveTargetDeltaX = moveTargetPoint.x - getX(); + double moveTargetDeltaZ = moveTargetPoint.z - getZ(); + + if (Math.abs(moveTargetDeltaX) > (double) 1.0E-5F || Math.abs(moveTargetDeltaZ) > (double) 1.0E-5F) { + float yRotAModifier = Mth.clamp( + Mth.wrapDegrees(180.0F - (float) Mth.atan2(moveTargetDeltaX, moveTargetDeltaZ) + * (180F / (float) Math.PI) - getYRot()), + -10.0F, 10.0F); + + yRotA *= 0.8F; + yRotA += yRotAModifier * getTurnSpeed(); + } + + float latencyPosModifier = (float) (getLatencyPos(5, 1.0F)[1] + - getLatencyPos(10, 1.0F)[1]) * 10.0F * ((float) Math.PI / 180F); + float cosLatencyPosModifier = Mth.cos(latencyPosModifier); + float sinLatencyPosModifier = Mth.sin(latencyPosModifier); + float sinRotModifier = Mth.sin(getYRot() * ((float) Math.PI / 180F) - yRotA * 0.01F); + float cosRotModifier = Mth.cos(getYRot() * ((float) Math.PI / 180F) - yRotA * 0.01F); + float yHeadOffset = getHeadYOffset(); + + float yRadians = getYRot() * ((float) Math.PI / 180F); + float wingXOffset = Mth.cos(yRadians); + float wingZOffset = Mth.sin(yRadians); + + tickPart(wing1, wingXOffset * 4.5f, 2f, wingZOffset * 4.5f); + tickPart(wing2, wingXOffset * -4.5f, 2f, wingZOffset * -4.5f); + + tickPart(body, (sinRotModifier * 0.5F), 0.0D, (-cosRotModifier * 0.5F)); + + tickPart(head, (-sinRotModifier * (4.5f * getScale() * 0.8f) * cosLatencyPosModifier), + (yHeadOffset + sinLatencyPosModifier * 6.5f), + (cosRotModifier * (4.5f * getScale() * 0.8f) * cosLatencyPosModifier)); + + tickPart(tail, (sinRotModifier * (4.5f * getScale() * 0.8f) * cosLatencyPosModifier), + (yHeadOffset + sinLatencyPosModifier * 6.5f), + (-cosRotModifier * (4.5f * getScale() * 0.8f) * cosLatencyPosModifier)); + + if (!level.isClientSide) { + inWall = checkWalls(head.getBoundingBox()) | checkWalls(body.getBoundingBox()); + } + + for (int i = 0; i < subEntities.length; ++i) { + subEntities[i].xo = subEntitiesLengthVector[i].x; + subEntities[i].yo = subEntitiesLengthVector[i].y; + subEntities[i].zo = subEntitiesLengthVector[i].z; + subEntities[i].xOld = subEntitiesLengthVector[i].x; + subEntities[i].yOld = subEntitiesLengthVector[i].y; + subEntities[i].zOld = subEntitiesLengthVector[i].z; + } + + } + + private void tickPart(LavaRevenantPart pPart, double offsetX, double offsetY, double offsetZ) { + pPart.setPos(getX() + offsetX, getY() + offsetY, getZ() + offsetZ); + } + + public double[] getLatencyPos(int pointer, float multiplier) { + if (isDeadOrDying()) { + multiplier = 0.0F; + } + + multiplier = 1.0F - multiplier; + int item = posPointer - pointer & 63; + int previousItem = posPointer - pointer - 1 & 63; + double[] latencyPos = new double[3]; + double yawOffset = positions[item][0]; + double yOffsetMinusYawOffset = Mth.wrapDegrees(positions[previousItem][0] - yawOffset); + latencyPos[0] = yawOffset + yOffsetMinusYawOffset * (double) multiplier; + yawOffset = positions[item][1]; + yOffsetMinusYawOffset = positions[previousItem][1] - yawOffset; + latencyPos[1] = yawOffset + yOffsetMinusYawOffset * (double) multiplier; + latencyPos[2] = Mth.lerp(multiplier, positions[item][2], positions[previousItem][2]); + return latencyPos; + } + + private float getHeadYOffset() { + double[] latencyPos = getLatencyPos(5, 1.0F); + double[] latencyPos1 = getLatencyPos(0, 1.0F); + return (float) (latencyPos[1] - latencyPos1[1]); + } + + public float getTurnSpeed() { + float deltaDistance = (float) (getDeltaMovement().horizontalDistance() + 1.0F); + float min = Math.min(deltaDistance, 40.0F); + return 0.7F / min / deltaDistance; + } + + public boolean hurt(LavaRevenantPart part, DamageSource source, float damage) { + if (part == wing1 || part == wing2) { + damage = damage * 0.65f; + } else if (part == head) { + damage = damage * 1.5f; + } else if (part == tail) { + damage = damage * 0.35f; + } + + return hurt(source, damage); + } + + /** + * Destroys weak blocks that are in the way + */ + private boolean checkWalls(AABB pArea) { + int minX = Mth.floor(pArea.minX); + int minY = Mth.floor(pArea.minY); + int minZ = Mth.floor(pArea.minZ); + int maxX = Mth.floor(pArea.maxX); + int maxY = Mth.floor(pArea.maxY); + int maxZ = Mth.floor(pArea.maxZ); + boolean stuck = false; + boolean blockRemoved = false; + + for (int i = minX; i <= maxX; ++i) { + for (int lMinY = minY; lMinY <= maxY; ++lMinY) { + for (int lMinZ = minZ; lMinZ <= maxZ; ++lMinZ) { + BlockPos pos = new BlockPos(i, lMinY, lMinZ); + BlockState state = level.getBlockState(pos); + if (!state.isAir() && state.getMaterial() != Material.FIRE) { + if (ForgeHooks.canEntityDestroy(level, pos, this) + && state.getDestroySpeed(level, pos) < 5.0f) { + + blockRemoved = level.removeBlock(pos, false) || blockRemoved; + } else { + stuck = true; + } + } + } + } + } + + if (blockRemoved) { + BlockPos randomPos = new BlockPos(minX + random.nextInt(maxX - minX + 1), + minY + random.nextInt(maxY - minY + 1), + minZ + random.nextInt(maxZ - minZ + 1)); + level.levelEvent(2008, randomPos, 0); } + return stuck; + } + + @Override + public boolean isMultipartEntity() { + return true; + } + + @Override + public net.minecraftforge.entity.PartEntity[] getParts() { + return subEntities; } @Override public SpawnGroupData finalizeSpawn(@NotNull ServerLevelAccessor pLevel, @NotNull DifficultyInstance pDifficulty, @NotNull MobSpawnType pReason, @Nullable SpawnGroupData pSpawnData, @Nullable CompoundTag pDataTag) { + anchorPoint = blockPosition().above(15); - setSize(GeneralUtilities.getRandomNumber(1, 4)); + setSize(GeneralUtilities.getRandomNumber(1, 3)); setHealth(getMaxHealth()); return super.finalizeSpawn(pLevel, pDifficulty, pReason, pSpawnData, pDataTag); } @@ -179,7 +376,9 @@ public SpawnGroupData finalizeSpawn(@NotNull ServerLevelAccessor pLevel, @NotNul public void readAdditionalSaveData(@NotNull CompoundTag pCompound) { super.readAdditionalSaveData(pCompound); if (pCompound.contains("AX")) { - anchorPoint = new BlockPos(pCompound.getInt("AX"), pCompound.getInt("AY"), pCompound.getInt("AZ")); + anchorPoint = new BlockPos(pCompound.getInt("AX"), + pCompound.getInt("AY"), + pCompound.getInt("AZ")); } setSize(pCompound.getInt("Size")); @@ -203,7 +402,8 @@ public boolean shouldRenderAtSqrDistance(double pDistance) { } @Override - public @NotNull SoundSource getSoundSource() { + public @NotNull + SoundSource getSoundSource() { return SoundSource.HOSTILE; } @@ -223,7 +423,8 @@ protected SoundEvent getDeathSound() { } @Override - public @NotNull MobType getMobType() { + public @NotNull + MobType getMobType() { return MobType.UNDEAD; } @@ -241,7 +442,8 @@ public boolean canAttackType(@NotNull EntityType pType) { } @Override - public @NotNull EntityDimensions getDimensions(@NotNull Pose pPose) { + public @NotNull + EntityDimensions getDimensions(@NotNull Pose pPose) { int size = getSize(); EntityDimensions dimensions = super.getDimensions(pPose); float scaleFactor = (dimensions.width + 0.2F * (float) size) / dimensions.width; @@ -532,17 +734,21 @@ public void tick() { float deltaTargetZ = (float) (moveTargetPoint.z - getZ()); double sqrtXZ = Mth.sqrt(deltaTargetX * deltaTargetX + deltaTargetZ * deltaTargetZ); if (Math.abs(sqrtXZ) > (double) 1.0E-5F) { - double d1 = 1.0D - (double) Mth.abs(deltaTargetY * 0.7F) / sqrtXZ; - deltaTargetX = (float) ((double) deltaTargetX * d1); - deltaTargetZ = (float) ((double) deltaTargetZ * d1); + double absolute = 1.0D - (double) Mth.abs(deltaTargetY * 0.7F) / sqrtXZ; + deltaTargetX = (float) ((double) deltaTargetX * absolute); + deltaTargetZ = (float) ((double) deltaTargetZ * absolute); sqrtXZ = Mth.sqrt(deltaTargetX * deltaTargetX + deltaTargetZ * deltaTargetZ); - double sqrtXZY = Mth.sqrt(deltaTargetX * deltaTargetX + deltaTargetZ * deltaTargetZ + deltaTargetY * deltaTargetY); + double sqrtXZY = Mth.sqrt(deltaTargetX * deltaTargetX + deltaTargetZ + * deltaTargetZ + deltaTargetY * deltaTargetY); + float yRotation = getYRot(); float angle = (float) Mth.atan2(deltaTargetZ, deltaTargetX); float yRotationWrapped90 = Mth.wrapDegrees(getYRot() + 90.0F); float angleWrapped = Mth.wrapDegrees(angle * (180F / (float) Math.PI)); + setYRot(Mth.approachDegrees(yRotationWrapped90, angleWrapped, 4.0F) - 90.0F); yBodyRot = getYRot(); + if (Mth.degreesDifferenceAbs(yRotation, getYRot()) < 3.0F) { speed = Mth.approach(speed, 1.8F, 0.005F * (1.8F / speed)); } else { @@ -552,13 +758,24 @@ public void tick() { float xRotation = (float) (-(Mth.atan2(-deltaTargetY, sqrtXZ) * (double) (180F / (float) Math.PI))); setXRot(xRotation); float yRotationPlus90 = getYRot() + 90.0F; - double x = (double) (speed * Mth.cos(yRotationPlus90 * ((float) Math.PI / 180F))) * Math.abs((double) deltaTargetX / sqrtXZY); - double y = (double) (speed * Mth.sin(yRotationPlus90 * ((float) Math.PI / 180F))) * Math.abs((double) deltaTargetZ / sqrtXZY); - double z = (double) (speed * Mth.sin(xRotation * ((float) Math.PI / 180F))) * Math.abs((double) deltaTargetY / sqrtXZY); + + double x = (double) (speed * Mth.cos(yRotationPlus90 * ((float) Math.PI / 180F))) + * Math.abs((double) deltaTargetX / sqrtXZY); + double y = (double) (speed * Mth.sin(yRotationPlus90 * ((float) Math.PI / 180F))) + * Math.abs((double) deltaTargetZ / sqrtXZY); + double z = (double) (speed * Mth.sin(xRotation * ((float) Math.PI / 180F))) + * Math.abs((double) deltaTargetY / sqrtXZY); + Vec3 deltaMovement = getDeltaMovement(); + + if (inWall) { + setYRot(yRotation - 180f); + deltaMovement.scale(0.8f); + deltaMovement.reverse(); + } + setDeltaMovement(deltaMovement.add((new Vec3(x, z, y)).subtract(deltaMovement).scale(0.2D))); } - } } @@ -624,7 +841,9 @@ public void tick() { if (target != null) { moveTargetPoint = new Vec3(target.getX(), target.getY(0.5D), target.getZ()); if (getBoundingBox().inflate(0.2F).intersects(target.getBoundingBox())) { - doHurtTarget(target); + if (!inWall) { + doHurtTarget(target); + } attackPhase = LavaRevenantEntity.AttackPhase.CIRCLE; if (!isSilent()) { PacketHandler.INSTANCE.send(PacketDistributor.TRACKING_CHUNK.with(() -> diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/entity/monster/lava_revenant/LavaRevenantPart.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/entity/monster/lava_revenant/LavaRevenantPart.java new file mode 100644 index 000000000..3d6a699b9 --- /dev/null +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/entity/monster/lava_revenant/LavaRevenantPart.java @@ -0,0 +1,76 @@ +package com.anonymoushacker1279.immersiveweapons.entity.monster.lava_revenant; + +import net.minecraft.nbt.CompoundTag; +import net.minecraft.network.protocol.Packet; +import net.minecraft.world.damagesource.DamageSource; +import net.minecraft.world.entity.*; +import net.minecraftforge.entity.PartEntity; +import org.jetbrains.annotations.NotNull; + +public class LavaRevenantPart extends PartEntity { + public final LavaRevenantEntity parentMob; + public final String name; + private final EntityDimensions size; + + public LavaRevenantPart(LavaRevenantEntity entity, String name, float width, float height) { + super(entity); + size = EntityDimensions.scalable(width, height); + refreshDimensions(); + parentMob = entity; + this.name = name; + } + + @Override + protected void defineSynchedData() { + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + @Override + protected void readAdditionalSaveData(@NotNull CompoundTag pCompound) { + } + + @Override + protected void addAdditionalSaveData(@NotNull CompoundTag pCompound) { + } + + /** + * Returns true if other Entities should be prevented from moving through this Entity. + */ + @Override + public boolean isPickable() { + return true; + } + + /** + * Called when the entity is attacked. + */ + @Override + public boolean hurt(@NotNull DamageSource pSource, float pAmount) { + return !isInvulnerableTo(pSource) && parentMob.hurt(this, pSource, pAmount); + } + + /** + * Returns true if Entity argument is equal to this Entity + */ + @Override + public boolean is(@NotNull Entity pEntity) { + return this == pEntity || parentMob == pEntity; + } + + @Override + public Packet getAddEntityPacket() { + throw new UnsupportedOperationException(); + } + + @Override + public @NotNull EntityDimensions getDimensions(@NotNull Pose pPose) { + return size; + } + + @Override + public boolean shouldBeSaved() { + return false; + } +} \ No newline at end of file diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/entity/neutral/AbstractMinutemanEntity.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/entity/neutral/AbstractMinutemanEntity.java index 3e3edf4bc..2e3e81c6b 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/entity/neutral/AbstractMinutemanEntity.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/entity/neutral/AbstractMinutemanEntity.java @@ -109,11 +109,11 @@ protected void registerGoals() { targetSelector.addGoal(1, new HurtByTargetGoal(this, MinutemanEntity.class, IronGolem.class)); targetSelector.addGoal(4, new DefendVillageTargetGoal(this)); targetSelector.addGoal(1, new NearestAttackableTargetGoal<>(this, AbstractDyingSoldierEntity.class, - false)); + true)); targetSelector.addGoal(1, new NearestAttackableTargetGoal<>(this, Player.class, 8, true, false, this::isAngryAt)); targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Monster.class, 10, - false, false, (targetPredicate) -> !(targetPredicate instanceof Creeper))); + true, false, (targetPredicate) -> !(targetPredicate instanceof Creeper))); targetSelector.addGoal(5, new ResetUniversalAngerTargetGoal<>(this, false)); } diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/entity/projectile/AbstractBulletEntity.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/entity/projectile/AbstractBulletEntity.java index 46b2ac465..bde9f8d5c 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/entity/projectile/AbstractBulletEntity.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/entity/projectile/AbstractBulletEntity.java @@ -1,6 +1,7 @@ package com.anonymoushacker1279.immersiveweapons.entity.projectile; import com.anonymoushacker1279.immersiveweapons.config.CommonConfig; +import com.anonymoushacker1279.immersiveweapons.data.tags.groups.forge.ForgeBlockTagGroups; import com.anonymoushacker1279.immersiveweapons.init.DeferredRegistryHandler; import it.unimi.dsi.fastutil.ints.IntOpenHashSet; import net.minecraft.core.BlockPos; @@ -24,6 +25,7 @@ import net.minecraft.world.phys.*; import net.minecraft.world.phys.HitResult.Type; import net.minecraft.world.phys.shapes.VoxelShape; +import net.minecraftforge.common.Tags.Blocks; import net.minecraftforge.event.ForgeEventFactory; import net.minecraftforge.network.NetworkHooks; import org.jetbrains.annotations.NotNull; @@ -387,7 +389,7 @@ protected void onHitBlock(BlockHitResult blockHitResult) { // Check if the bullet hit a permeable block like leaves, if so // keep moving and decrease velocity - if (inBlockState.is(BlockTags.bind("minecraft:leaves"))) { + if (inBlockState.is(BlockTags.LEAVES)) { push(0, -0.1, 0); shakeTime = 4; } else { @@ -405,9 +407,9 @@ protected void onHitBlock(BlockHitResult blockHitResult) { // Check if glass can be broken, and if it hasn't already broken glass if (canBreakGlass && !hasAlreadyBrokeGlass - && !inBlockState.is(BlockTags.bind("forge:bulletproof_glass")) - && inBlockState.is(BlockTags.bind("forge:glass")) - || inBlockState.is(BlockTags.bind("forge:glass_panes"))) { + && !inBlockState.is(ForgeBlockTagGroups.BULLETPROOF_GLASS) + && inBlockState.is(Blocks.GLASS) + || inBlockState.is(Blocks.GLASS_PANES)) { level.destroyBlock(blockHitResult.getBlockPos(), false); hasAlreadyBrokeGlass = true; diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/event/ForgeEventSubscriber.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/event/ForgeEventSubscriber.java index a8428984b..3ffa81704 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/event/ForgeEventSubscriber.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/event/ForgeEventSubscriber.java @@ -2,13 +2,11 @@ import com.anonymoushacker1279.immersiveweapons.ImmersiveWeapons; import com.anonymoushacker1279.immersiveweapons.config.CommonConfig; -import com.anonymoushacker1279.immersiveweapons.init.DeferredRegistryHandler; import com.anonymoushacker1279.immersiveweapons.world.level.levelgen.OreGeneratorHandler; -import net.minecraft.world.entity.MobCategory; +import net.minecraft.core.Holder; import net.minecraft.world.level.biome.Biome.BiomeCategory; -import net.minecraft.world.level.biome.MobSpawnSettings.SpawnerData; +import net.minecraft.world.level.biome.Biomes; import net.minecraft.world.level.levelgen.GenerationStep; -import net.minecraft.world.level.levelgen.GenerationStep.Decoration; import net.minecraftforge.common.world.BiomeGenerationSettingsBuilder; import net.minecraftforge.event.world.BiomeLoadingEvent; import net.minecraftforge.eventbus.api.EventPriority; @@ -30,33 +28,40 @@ public class ForgeEventSubscriber { @SubscribeEvent(priority = EventPriority.HIGH) public static void onBiomeLoading(BiomeLoadingEvent event) { BiomeGenerationSettingsBuilder generation = event.getGeneration(); - if (event.getCategory() != BiomeCategory.NETHER && event.getCategory() != BiomeCategory.THEEND) { - generation.addFeature(GenerationStep.Decoration.UNDERGROUND_ORES, OreGeneratorHandler.COBALT_ORE_FEATURE); - generation.addFeature(Decoration.UNDERGROUND_ORES, OreGeneratorHandler.DEEPSLATE_COBALT_ORE_FEATURE); + BiomeCategory biomeCategory = event.getCategory(); - if (event.getCategory() == BiomeCategory.RIVER || event.getCategory() == BiomeCategory.OCEAN) { - generation.addFeature(GenerationStep.Decoration.UNDERGROUND_ORES, OreGeneratorHandler.SULFUR_ORE_FEATURE); - generation.addFeature(Decoration.UNDERGROUND_ORES, OreGeneratorHandler.DEEPSLATE_SULFUR_ORE_FEATURE); + if (biomeCategory == BiomeCategory.NETHER) { + if (CommonConfig.ENABLE_MOLTEN_ORE.get()) { + generation.addFeature(GenerationStep.Decoration.UNDERGROUND_ORES, + Holder.direct(OreGeneratorHandler.MOLTEN_ORE_BLOB_PLACEMENT)); } - - if (event.getCategory() != BiomeCategory.OCEAN && event.getCategory() != BiomeCategory.RIVER) { - if (CommonConfig.WANDERING_WARRIOR_SPAWN.get()) - event.getSpawns().addSpawn(MobCategory.MONSTER, new SpawnerData(DeferredRegistryHandler.WANDERING_WARRIOR_ENTITY.get(), 13, 1, 1)); - if (CommonConfig.HANS_SPAWN.get()) - event.getSpawns().addSpawn(MobCategory.MONSTER, new SpawnerData(DeferredRegistryHandler.HANS_ENTITY.get(), 1, 1, 1)); + if (CommonConfig.ENABLE_NETHER_SULFUR_ORE.get()) { + generation.addFeature(GenerationStep.Decoration.UNDERGROUND_ORES, + Holder.direct(OreGeneratorHandler.NETHER_SULFUR_ORE_BLOB_PLACEMENT)); + } + } else if (biomeCategory != BiomeCategory.THEEND) { + if (CommonConfig.ENABLE_COBALT_ORE.get()) { + generation.addFeature(GenerationStep.Decoration.UNDERGROUND_ORES, + Holder.direct(OreGeneratorHandler.COBALT_ORE_BLOB_PLACEMENT)); + } + if (CommonConfig.ENABLE_DEEPSLATE_COBALT_ORE.get()) { + generation.addFeature(GenerationStep.Decoration.UNDERGROUND_ORES, + Holder.direct(OreGeneratorHandler.DEEPSLATE_COBALT_ORE_BLOB_PLACEMENT)); } } - if (event.getCategory() == BiomeCategory.NETHER) { - generation.addFeature(GenerationStep.Decoration.UNDERGROUND_ORES, OreGeneratorHandler.MOLTEN_ORE_FEATURE); - generation.addFeature(GenerationStep.Decoration.UNDERGROUND_ORES, OreGeneratorHandler.NETHER_SULFUR_ORE_FEATURE); + + if (biomeCategory == BiomeCategory.RIVER || biomeCategory == BiomeCategory.OCEAN) { + if (CommonConfig.ENABLE_SULFUR_ORE.get()) { + generation.addFeature(GenerationStep.Decoration.UNDERGROUND_ORES, + Holder.direct(OreGeneratorHandler.SULFUR_ORE_BLOB_PLACEMENT)); + } } - if (Objects.requireNonNull(event.getName()).toString().equals("immersiveweapons:tiltros")) { - if (CommonConfig.LAVA_REVENANT_SPAWN.get()) - event.getSpawns().addSpawn(MobCategory.MONSTER, new SpawnerData(DeferredRegistryHandler.LAVA_REVENANT_ENTITY.get(), 1, 0, 1)); - if (CommonConfig.ROCK_SPIDER_SPAWN.get()) - event.getSpawns().addSpawn(MobCategory.MONSTER, new SpawnerData(DeferredRegistryHandler.ROCK_SPIDER_ENTITY.get(), 5, 4, 12)); - if (CommonConfig.CELESTIAL_TOWER_SPAWN.get()) - event.getSpawns().addSpawn(MobCategory.MONSTER, new SpawnerData(DeferredRegistryHandler.CELESTIAL_TOWER_ENTITY.get(), 2, 0, 1)); + if (Objects.equals(event.getName(), Biomes.LUSH_CAVES.location()) + || Objects.equals(event.getName(), Biomes.DRIPSTONE_CAVES.location())) { + if (CommonConfig.ENABLE_DEEPSLATE_SULFUR_ORE.get()) { + generation.addFeature(GenerationStep.Decoration.UNDERGROUND_ORES, + Holder.direct(OreGeneratorHandler.DEEPSLATE_SULFUR_ORE_BLOB_PLACEMENT)); + } } } } \ No newline at end of file diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/event/ModEventSubscriber.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/event/ModEventSubscriber.java index 3d786a612..9971782db 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/event/ModEventSubscriber.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/event/ModEventSubscriber.java @@ -2,6 +2,7 @@ import com.anonymoushacker1279.immersiveweapons.ImmersiveWeapons; import com.anonymoushacker1279.immersiveweapons.entity.monster.*; +import com.anonymoushacker1279.immersiveweapons.entity.monster.lava_revenant.LavaRevenantEntity; import com.anonymoushacker1279.immersiveweapons.entity.neutral.AbstractFieldMedicEntity; import com.anonymoushacker1279.immersiveweapons.entity.neutral.AbstractMinutemanEntity; import com.anonymoushacker1279.immersiveweapons.init.DeferredRegistryHandler; diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/init/DeferredRegistryHandler.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/init/DeferredRegistryHandler.java index 45f490a9b..77768321a 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/init/DeferredRegistryHandler.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/init/DeferredRegistryHandler.java @@ -8,7 +8,7 @@ import com.anonymoushacker1279.immersiveweapons.block.decoration.*; import com.anonymoushacker1279.immersiveweapons.block.misc.MedicStatueBlock; import com.anonymoushacker1279.immersiveweapons.block.misc.MinutemanStatueBlock; -import com.anonymoushacker1279.immersiveweapons.block.misc.portal.statue.warrior.*; +import com.anonymoushacker1279.immersiveweapons.block.misc.warrior_statue.*; import com.anonymoushacker1279.immersiveweapons.block.properties.WoodTypes; import com.anonymoushacker1279.immersiveweapons.block.sign.BurnedOakStandingSignBlock; import com.anonymoushacker1279.immersiveweapons.block.sign.BurnedOakWallSignBlock; @@ -19,6 +19,7 @@ import com.anonymoushacker1279.immersiveweapons.container.TeslaSynthesizerContainer; import com.anonymoushacker1279.immersiveweapons.entity.misc.ChairEntity; import com.anonymoushacker1279.immersiveweapons.entity.monster.*; +import com.anonymoushacker1279.immersiveweapons.entity.monster.lava_revenant.LavaRevenantEntity; import com.anonymoushacker1279.immersiveweapons.entity.neutral.FieldMedicEntity; import com.anonymoushacker1279.immersiveweapons.entity.neutral.MinutemanEntity; import com.anonymoushacker1279.immersiveweapons.entity.projectile.BulletEntity.*; @@ -102,7 +103,7 @@ public class DeferredRegistryHandler { // Particle Register public static final DeferredRegister> PARTICLE_TYPES = DeferredRegister.create(ForgeRegistries.PARTICLE_TYPES, ImmersiveWeapons.MOD_ID); // Global Loot Modifier Register - public static final DeferredRegister> GLOBAL_LOOT_MODIFIER_SERIALIZER = DeferredRegister.create(ForgeRegistries.LOOT_MODIFIER_SERIALIZERS, ImmersiveWeapons.MOD_ID); + public static final DeferredRegister> GLOBAL_LOOT_MODIFIER_SERIALIZER = DeferredRegister.create(ForgeRegistries.Keys.LOOT_MODIFIER_SERIALIZERS, ImmersiveWeapons.MOD_ID); // Tile Entity Register public static final DeferredRegister> BLOCK_ENTITIES = DeferredRegister.create(ForgeRegistries.BLOCK_ENTITIES, ImmersiveWeapons.MOD_ID); // Biome Register @@ -204,7 +205,7 @@ public static void init() { public static final RegistryObject VENTUS_STAFF_CORE = ITEMS.register("ventus_staff_core", () -> new Item(new Properties().tab(ITEM_GROUP))); public static final RegistryObject AZUL_KEYSTONE = ITEMS.register("azul_keystone", () -> new Item(new Properties().tab(ITEM_GROUP))); public static final RegistryObject AZUL_KEYSTONE_FRAGMENT = ITEMS.register("azul_keystone_fragment", () -> new Item(new Properties().tab(ITEM_GROUP))); - public static final RegistryObject CELESTIAL_FRAGMENT = ITEMS.register("celestial_fragment", () -> new Item(new Properties().tab(ITEM_GROUP))); + public static final RegistryObject CELESTIAL_FRAGMENT = ITEMS.register("celestial_fragment", () -> new Item(new Properties().tab(ITEM_GROUP).fireResistant())); public static final RegistryObject WOOD_PIKE_HEAD = ITEMS.register("wood_pike_head", () -> new Item(new Properties().tab(ITEM_GROUP))); public static final RegistryObject STONE_PIKE_HEAD = ITEMS.register("stone_pike_head", () -> new Item(new Properties().tab(ITEM_GROUP))); public static final RegistryObject GOLD_PIKE_HEAD = ITEMS.register("gold_pike_head", () -> new Item(new Properties().tab(ITEM_GROUP))); @@ -452,7 +453,7 @@ public static void init() { public static final RegistryObject> MORTAR_SHELL_ENTITY = ENTITY_TYPES.register("mortar_shell", () -> EntityType.Builder.of(MortarShellEntity::new, MobCategory.MISC).sized(0.5f, 0.5f).build(new ResourceLocation(ImmersiveWeapons.MOD_ID, "mortar_shell").toString())); public static final RegistryObject> BURNED_OAK_BOAT_ENTITY = ENTITY_TYPES.register("burned_oak_boat", () -> EntityType.Builder. of(BurnedOakBoatEntity::new, MobCategory.MISC).sized(1.375f, 0.5625f).build(new ResourceLocation(ImmersiveWeapons.MOD_ID, "burned_oak_boat").toString())); public static final RegistryObject> MUD_BALL_ENTITY = ENTITY_TYPES.register("mud_ball", () -> EntityType.Builder. of(MudBallEntity::new, MobCategory.MISC).sized(0.25f, 0.25f).build(new ResourceLocation(ImmersiveWeapons.MOD_ID, "mud_ball").toString())); - public static final RegistryObject> LAVA_REVENANT_ENTITY = ENTITY_TYPES.register("lava_revenant", () -> EntityType.Builder.of(LavaRevenantEntity::new, MobCategory.MONSTER).sized(15.0f, 5.0f).clientTrackingRange(128).fireImmune().build(new ResourceLocation(ImmersiveWeapons.MOD_ID, "lava_revenant").toString())); + public static final RegistryObject> LAVA_REVENANT_ENTITY = ENTITY_TYPES.register("lava_revenant", () -> EntityType.Builder.of(LavaRevenantEntity::new, MobCategory.MONSTER).sized(16.0f, 6.0f).clientTrackingRange(32).fireImmune().build(new ResourceLocation(ImmersiveWeapons.MOD_ID, "lava_revenant").toString())); public static final RegistryObject> ROCK_SPIDER_ENTITY = ENTITY_TYPES.register("rock_spider", () -> EntityType.Builder.of(RockSpiderEntity::new, MobCategory.MONSTER).sized(0.30f, 0.30f).clientTrackingRange(16).build(new ResourceLocation(ImmersiveWeapons.MOD_ID, "rock_spider").toString())); public static final RegistryObject> CELESTIAL_TOWER_ENTITY = ENTITY_TYPES.register("celestial_tower", () -> EntityType.Builder.of(CelestialTowerEntity::new, MobCategory.MONSTER).sized(8.0f, 9.0f).clientTrackingRange(32).build(new ResourceLocation(ImmersiveWeapons.MOD_ID, "celestial_tower").toString())); @@ -639,6 +640,7 @@ public static void init() { public static final RegistryObject> MEDIC_STATUE_BLOCK_ENTITY = BLOCK_ENTITIES.register("medic_statue", () -> new BlockEntityType<>(MedicStatueBlockEntity::new, Sets.newHashSet(MEDIC_STATUE.get()), null)); public static final RegistryObject> TESLA_SYNTHESIZER_BLOCK_ENTITY = BLOCK_ENTITIES.register("tesla_synthesizer", () -> new BlockEntityType<>(TeslaSynthesizerBlockEntity::new, Sets.newHashSet(TESLA_SYNTHESIZER.get()), null)); public static final RegistryObject> BURNED_OAK_SIGN_ENTITY = BLOCK_ENTITIES.register("custom_sign", () -> BlockEntityType.Builder.of(BurnedOakSignEntity::new, BURNED_OAK_SIGN.get(), BURNED_OAK_WALL_SIGN.get()).build(null)); + public static final RegistryObject> CELESTIAL_LANTERN_BLOCK_ENTITY = BLOCK_ENTITIES.register("celestial_lantern", () -> new BlockEntityType<>(CelestialLanternBlockEntity::new, Sets.newHashSet(CELESTIAL_LANTERN.get()), null)); // Effects public static final RegistryObject MORPHINE_EFFECT = EFFECTS.register("morphine", () -> new MorphineEffect(MobEffectCategory.NEUTRAL, 3484189)); @@ -649,13 +651,9 @@ public static void init() { public static final RegistryObject> BURNED_BRANCH_DECORATOR = TREE_DECORATORS.register("burned_branch", () -> new TreeDecoratorType<>(BurnedBranchDecorator.CODEC)); // Structures - public static final RegistryObject> ABANDONED_FACTORY_STRUCTURE = STRUCTURES.register("abandoned_factory", AbandonedFactoryStructure::new); - public static final RegistryObject> BEAR_TRAP_STRUCTURE = STRUCTURES.register("bear_trap", BearTrapStructure::new); - public static final RegistryObject> CAMPSITE_STRUCTURE = STRUCTURES.register("campsite", CampsiteStructure::new); public static final RegistryObject> CLOUD_ISLAND_STRUCTURE = STRUCTURES.register("cloud_island", CloudIslandStructure::new); - public static final RegistryObject> LANDMINE_TRAP_STRUCTURE = STRUCTURES.register("landmine_trap", LandmineTrapStructure::new); - public static final RegistryObject> OUTHOUSE_STRUCTURE = STRUCTURES.register("outhouse", OuthouseStructure::new); + public static final RegistryObject> HANS_HUT_STRUCTURE = STRUCTURES.register("hans_hut", HansHut::new); public static final RegistryObject> PITFALL_TRAP_STRUCTURE = STRUCTURES.register("pitfall_trap", PitfallTrapStructure::new); public static final RegistryObject> UNDERGROUND_BUNKER_STRUCTURE = STRUCTURES.register("underground_bunker", UndergroundBunkerStructure::new); - public static final RegistryObject> WATER_TOWER_STRUCTURE = STRUCTURES.register("water_tower", WaterTowerStructure::new); + public static final RegistryObject> DESTROYED_HOUSE = STRUCTURES.register("destroyed_house", DestroyedHouse::new); } \ No newline at end of file diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/init/PacketHandler.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/init/PacketHandler.java index 48b12cefd..ac2216731 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/init/PacketHandler.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/init/PacketHandler.java @@ -2,9 +2,9 @@ import com.anonymoushacker1279.immersiveweapons.ImmersiveWeapons; import com.anonymoushacker1279.immersiveweapons.block.base.MortarBlock.MortarBlockPacketHandler; -import com.anonymoushacker1279.immersiveweapons.block.misc.portal.statue.warrior.WarriorStatueTorso.WarriorStatueTorsoPacketHandler; +import com.anonymoushacker1279.immersiveweapons.block.misc.warrior_statue.WarriorStatueTorso.WarriorStatueTorsoPacketHandler; import com.anonymoushacker1279.immersiveweapons.block.trap.SpikeTrapBlock.SpikeTrapBlockPacketHandler; -import com.anonymoushacker1279.immersiveweapons.entity.monster.LavaRevenantEntity.LavaRevenantEntityPacketHandler; +import com.anonymoushacker1279.immersiveweapons.entity.monster.lava_revenant.LavaRevenantEntity.LavaRevenantEntityPacketHandler; import com.anonymoushacker1279.immersiveweapons.entity.neutral.AbstractFieldMedicEntity.AbstractFieldMedicEntityPacketHandler; import com.anonymoushacker1279.immersiveweapons.entity.projectile.CustomArrowEntity.SmokeBombArrowEntityPacketHandler; import com.anonymoushacker1279.immersiveweapons.entity.projectile.SmokeBombEntity.SmokeBombEntityPacketHandler; diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/init/PostSetupHandler.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/init/PostSetupHandler.java index c5f25c5f9..f9344d1a6 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/init/PostSetupHandler.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/init/PostSetupHandler.java @@ -27,7 +27,13 @@ public static void init() { // Pike Special Attributes Builder builder = ImmutableMultimap.builder(); - ImmutableMultimap newAttributes = builder.put(ForgeMod.REACH_DISTANCE.get(), new AttributeModifier(GeneralUtilities.ATTACK_REACH_MODIFIER, "Weapon modifier", 0.5d, AttributeModifier.Operation.ADDITION)).build(); + ImmutableMultimap newAttributes = + builder.put(ForgeMod.REACH_DISTANCE.get(), + new AttributeModifier(GeneralUtilities.ATTACK_REACH_MODIFIER, + "Weapon modifier", + 0.5d, + AttributeModifier.Operation.ADDITION)) + .build(); Builder combineBuilder = ImmutableMultimap.builder(); // Wood Pike Item @@ -79,7 +85,12 @@ public static void init() { // Gauntlet Special Attributes builder = ImmutableMultimap.builder(); - newAttributes = builder.put(ForgeMod.REACH_DISTANCE.get(), new AttributeModifier(GeneralUtilities.ATTACK_REACH_MODIFIER, "Weapon modifier", -2.0d, Operation.ADDITION)).build(); + newAttributes = builder.put(ForgeMod.REACH_DISTANCE.get(), + new AttributeModifier(GeneralUtilities.ATTACK_REACH_MODIFIER, + "Weapon modifier", + -2.0d, + Operation.ADDITION)) + .build(); combineBuilder = ImmutableMultimap.builder(); // Wood Gauntlet Item @@ -130,7 +141,12 @@ public static void init() { NetheriteGauntletItem.gauntletAttributes = combineBuilder.build(); // Add custom logs to be stripped in AxeItem - AxeItem.STRIPPABLES = new ImmutableMap.Builder().putAll(AxeItem.STRIPPABLES).put(DeferredRegistryHandler.BURNED_OAK_LOG.get(), DeferredRegistryHandler.STRIPPED_BURNED_OAK_LOG.get()).put(DeferredRegistryHandler.BURNED_OAK_WOOD.get(), DeferredRegistryHandler.STRIPPED_BURNED_OAK_WOOD.get()).build(); + AxeItem.STRIPPABLES = new ImmutableMap.Builder().putAll(AxeItem.STRIPPABLES) + .put(DeferredRegistryHandler.BURNED_OAK_LOG.get(), + DeferredRegistryHandler.STRIPPED_BURNED_OAK_LOG.get()) + .put(DeferredRegistryHandler.BURNED_OAK_WOOD.get(), + DeferredRegistryHandler.STRIPPED_BURNED_OAK_WOOD.get()) + .build(); // Set custom armor equip sounds, as these don't exist during the initialization of materials CustomArmorMaterials.TESLA.setEquipSound(DeferredRegistryHandler.TESLA_ARMOR_EQUIP.get()); diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/item/crafting/ICustomRecipeType.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/item/crafting/CustomRecipeTypes.java similarity index 68% rename from src/main/java/com/anonymoushacker1279/immersiveweapons/item/crafting/ICustomRecipeType.java rename to src/main/java/com/anonymoushacker1279/immersiveweapons/item/crafting/CustomRecipeTypes.java index c5c6843f4..614d60ba4 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/item/crafting/ICustomRecipeType.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/item/crafting/CustomRecipeTypes.java @@ -6,9 +6,14 @@ import net.minecraft.world.item.crafting.Recipe; import net.minecraft.world.item.crafting.RecipeType; -public interface ICustomRecipeType { - RecipeType SMALL_PARTS = register(ImmersiveWeapons.MOD_ID + ":small_parts"); - RecipeType TESLA_SYNTHESIZER = register(ImmersiveWeapons.MOD_ID + ":tesla_synthesizer"); +public class CustomRecipeTypes { + public static RecipeType SMALL_PARTS; + public static RecipeType TESLA_SYNTHESIZER; + + public static void init() { + SMALL_PARTS = register(ImmersiveWeapons.MOD_ID + ":small_parts"); + TESLA_SYNTHESIZER = register(ImmersiveWeapons.MOD_ID + ":tesla_synthesizer"); + } /** * Register recipe types. diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/item/crafting/SmallPartsRecipe.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/item/crafting/SmallPartsRecipe.java index 12bede9d4..b7b4a55cc 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/item/crafting/SmallPartsRecipe.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/item/crafting/SmallPartsRecipe.java @@ -129,7 +129,7 @@ public boolean isValidAdditionItem(ItemStack blueprint) { */ @Override public @NotNull RecipeType getType() { - return ICustomRecipeType.SMALL_PARTS; + return CustomRecipeTypes.SMALL_PARTS; } /** diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/item/crafting/TeslaSynthesizerRecipe.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/item/crafting/TeslaSynthesizerRecipe.java index 501ae53b5..1aafd21a0 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/item/crafting/TeslaSynthesizerRecipe.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/item/crafting/TeslaSynthesizerRecipe.java @@ -132,7 +132,7 @@ public boolean canCraftInDimensions(int width, int height) { */ @Override public @NotNull RecipeType getType() { - return ICustomRecipeType.TESLA_SYNTHESIZER; + return CustomRecipeTypes.TESLA_SYNTHESIZER; } /** diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/util/GeneralUtilities.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/util/GeneralUtilities.java index 1311a1632..7844a554c 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/util/GeneralUtilities.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/util/GeneralUtilities.java @@ -1,15 +1,10 @@ package com.anonymoushacker1279.immersiveweapons.util; -import com.anonymoushacker1279.immersiveweapons.ImmersiveWeapons; -import net.minecraft.core.Registry; -import net.minecraft.resources.ResourceKey; -import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.item.DyeColor; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.enchantment.EnchantmentHelper; import net.minecraft.world.item.enchantment.Enchantments; -import net.minecraft.world.level.Level; import net.minecraft.world.level.block.StainedGlassBlock; import net.minecraft.world.level.block.state.BlockBehaviour.Properties; @@ -18,8 +13,6 @@ public class GeneralUtilities { public static final UUID ATTACK_REACH_MODIFIER = UUID.fromString("9f470b49-0445-4341-ae85-55b9e5ec2a1c"); - public static final ResourceKey TILTROS = ResourceKey.create(Registry.DIMENSION_REGISTRY, new ResourceLocation(ImmersiveWeapons.MOD_ID, "tiltros")); - /** * Get a random number between a minimum and maximum. diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/world/TiltrosTeleporter.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/world/TiltrosTeleporter.java index c4d069149..97e51e876 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/world/TiltrosTeleporter.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/world/TiltrosTeleporter.java @@ -1,6 +1,6 @@ package com.anonymoushacker1279.immersiveweapons.world; -import com.anonymoushacker1279.immersiveweapons.util.GeneralUtilities; +import com.anonymoushacker1279.immersiveweapons.world.level.levelgen.biomes.BiomesAndDimensions; import net.minecraft.BlockUtil; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -33,8 +33,8 @@ public Optional makePortal(BlockPos pos) { @Nullable @Override public PortalInfo getPortalInfo(Entity entity, ServerLevel level, Function defaultPortalInfo) { - boolean destinationIsUG = level.dimension() == GeneralUtilities.TILTROS; - if (entity.level.dimension() != GeneralUtilities.TILTROS && !destinationIsUG) { + boolean destinationIsUG = level.dimension() == BiomesAndDimensions.TILTROS; + if (entity.level.dimension() != BiomesAndDimensions.TILTROS && !destinationIsUG) { return null; } else { WorldBorder border = level.getWorldBorder(); @@ -42,22 +42,32 @@ public PortalInfo getPortalInfo(Entity entity, ServerLevel level, Function { - BlockState blockstate = entity.level.getBlockState(entity.portalEntrancePos); + double coordinateDifference = DimensionType.getTeleportationScale(entity.level.dimensionType(), + level.dimensionType()); + + BlockPos portalPosition = new BlockPos(Mth.clamp(entity.getX() * coordinateDifference, minX, maxX), + entity.getY(), + Mth.clamp(entity.getZ() * coordinateDifference, minZ, maxZ)); + + return getOrMakePortal(portalPosition).map((result) -> { + BlockState portalEntranceState = entity.level.getBlockState(entity.portalEntrancePos); Direction.Axis axis; - Vec3 vector3d; - if (blockstate.hasProperty(BlockStateProperties.HORIZONTAL_AXIS)) { - axis = blockstate.getValue(BlockStateProperties.HORIZONTAL_AXIS); - BlockUtil.FoundRectangle rectangle = BlockUtil.getLargestRectangleAround(entity.portalEntrancePos, axis, 21, Direction.Axis.Y, 21, (pos) -> entity.level.getBlockState(pos) == blockstate); - vector3d = PortalShape.getRelativePosition(rectangle, axis, entity.position(), entity.getDimensions(entity.getPose())); + Vec3 portalShape; + if (portalEntranceState.hasProperty(BlockStateProperties.HORIZONTAL_AXIS)) { + axis = portalEntranceState.getValue(BlockStateProperties.HORIZONTAL_AXIS); + BlockUtil.FoundRectangle rectangle = BlockUtil.getLargestRectangleAround(entity.portalEntrancePos, + axis, 21, Direction.Axis.Y, 21, + (pos) -> entity.level.getBlockState(pos) == portalEntranceState); + + portalShape = PortalShape.getRelativePosition(rectangle, axis, entity.position(), + entity.getDimensions(entity.getPose())); } else { axis = Direction.Axis.X; - vector3d = new Vec3(0.5D, 0.0D, 0.0D); + portalShape = new Vec3(0.5D, 0.0D, 0.0D); } - return PortalShape.createPortalInfo(level, result, axis, vector3d, entity.getDimensions(entity.getPose()), entity.getDeltaMovement(), entity.getYRot(), entity.getXRot()); + return PortalShape.createPortalInfo(level, result, axis, portalShape, + entity.getDimensions(entity.getPose()), entity.getDeltaMovement(), entity.getYRot(), entity.getXRot()); }).orElse(null); } } diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/OreGeneratorHandler.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/OreGeneratorHandler.java index fe2403e51..6cae794ba 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/OreGeneratorHandler.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/OreGeneratorHandler.java @@ -1,151 +1,133 @@ package com.anonymoushacker1279.immersiveweapons.world.level.levelgen; -import com.anonymoushacker1279.immersiveweapons.ImmersiveWeapons; import com.anonymoushacker1279.immersiveweapons.config.CommonConfig; import com.anonymoushacker1279.immersiveweapons.init.DeferredRegistryHandler; -import net.minecraft.data.worldgen.features.FeatureUtils; -import net.minecraft.data.worldgen.features.OreFeatures; -import net.minecraft.data.worldgen.placement.PlacementUtils; -import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.core.Holder; +import net.minecraft.core.Registry; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.tags.BlockTags; +import net.minecraft.tags.TagKey; +import net.minecraft.world.level.block.Block; import net.minecraft.world.level.levelgen.VerticalAnchor; import net.minecraft.world.level.levelgen.feature.ConfiguredFeature; import net.minecraft.world.level.levelgen.feature.Feature; import net.minecraft.world.level.levelgen.feature.configurations.OreConfiguration; -import net.minecraft.world.level.levelgen.feature.configurations.OreConfiguration.TargetBlockState; import net.minecraft.world.level.levelgen.placement.*; +import net.minecraft.world.level.levelgen.structure.templatesystem.RuleTest; +import net.minecraft.world.level.levelgen.structure.templatesystem.TagMatchTest; import java.util.List; public class OreGeneratorHandler { - static List targetBlockStates; - static ConfiguredFeature configuredFeature; - - public static PlacedFeature MOLTEN_ORE_FEATURE; - public static PlacedFeature NETHER_SULFUR_ORE_FEATURE; - public static PlacedFeature SULFUR_ORE_FEATURE; - public static PlacedFeature COBALT_ORE_FEATURE; - public static PlacedFeature DEEPSLATE_SULFUR_ORE_FEATURE; - public static PlacedFeature DEEPSLATE_COBALT_ORE_FEATURE; - - static final List MOLTEN_ORE_CONFIG = CommonConfig.MOLTEN_ORE_CONFIG.get(); - static final List NETHER_SULFUR_ORE_CONFIG = CommonConfig.NETHER_SULFUR_ORE_CONFIG.get(); - static final List SULFUR_ORE_CONFIG = CommonConfig.SULFUR_ORE_CONFIG.get(); - static final List COBALT_ORE_CONFIG = CommonConfig.COBALT_ORE_CONFIG.get(); - static final List DEEPSLATE_SULFUR_ORE_CONFIG = CommonConfig.DEEPSLATE_SULFUR_ORE_CONFIG.get(); - static final List DEEPSLATE_COBALT_ORE_CONFIG = CommonConfig.DEEPSLATE_COBALT_ORE_CONFIG.get(); - - /** - * Initialize ore generation setup. - */ - public static void init() { - setupMoltenOre(); - setupNetherSulfurOre(); - setupSulfurOre(); - setupCobaltOre(); - setupDeepslateCobaltOre(); - setupDeepslateSulfurOre(); - } - - public static void setupMoltenOre() { - int orePerVein = MOLTEN_ORE_CONFIG.get(0), veinsPerChunk = MOLTEN_ORE_CONFIG.get(1), maxY = MOLTEN_ORE_CONFIG.get(2); - - BlockState blockState = DeferredRegistryHandler.MOLTEN_ORE.get().defaultBlockState(); - - targetBlockStates = List.of(OreConfiguration.target(OreFeatures.NETHERRACK, blockState)); - - configuredFeature = FeatureUtils.register(ImmersiveWeapons.MOD_ID + "block/netherrack_molten_ore", - Feature.ORE.configured(new OreConfiguration(targetBlockStates, orePerVein))); - - MOLTEN_ORE_FEATURE = PlacementUtils.register(ImmersiveWeapons.MOD_ID + "ore/netherrack_molten_ore", - configuredFeature.placed(List.of(CountPlacement.of(veinsPerChunk), InSquarePlacement.spread(), - HeightRangePlacement.triangle(VerticalAnchor.bottom(), - VerticalAnchor.absolute(maxY)), - BiomeFilter.biome()))); - } - - public static void setupNetherSulfurOre() { - int orePerVein = NETHER_SULFUR_ORE_CONFIG.get(0), veinsPerChunk = NETHER_SULFUR_ORE_CONFIG.get(1); - - BlockState blockState = DeferredRegistryHandler.NETHER_SULFUR_ORE.get().defaultBlockState(); - - targetBlockStates = List.of(OreConfiguration.target(OreFeatures.NETHERRACK, blockState)); - - configuredFeature = FeatureUtils.register(ImmersiveWeapons.MOD_ID + "block/netherrack_nether_sulfur_ore", - Feature.ORE.configured(new OreConfiguration(targetBlockStates, orePerVein))); - - NETHER_SULFUR_ORE_FEATURE = PlacementUtils.register(ImmersiveWeapons.MOD_ID + "ore/netherrack_nether_sulfur_ore", - configuredFeature.placed(List.of(CountPlacement.of(veinsPerChunk), InSquarePlacement.spread(), - HeightRangePlacement.triangle(VerticalAnchor.bottom(), - VerticalAnchor.top()), - BiomeFilter.biome()))); - } - - public static void setupSulfurOre() { - int orePerVein = SULFUR_ORE_CONFIG.get(0), veinsPerChunk = SULFUR_ORE_CONFIG.get(1); - - BlockState blockState = DeferredRegistryHandler.SULFUR_ORE.get().defaultBlockState(); + public static PlacedFeature MOLTEN_ORE_BLOB_PLACEMENT; + public static PlacedFeature NETHER_SULFUR_ORE_BLOB_PLACEMENT; + public static PlacedFeature SULFUR_ORE_BLOB_PLACEMENT; + public static PlacedFeature DEEPSLATE_SULFUR_ORE_BLOB_PLACEMENT; + public static PlacedFeature COBALT_ORE_BLOB_PLACEMENT; + public static PlacedFeature DEEPSLATE_COBALT_ORE_BLOB_PLACEMENT; - targetBlockStates = List.of(OreConfiguration.target(OreFeatures.NATURAL_STONE, blockState)); - - configuredFeature = FeatureUtils.register(ImmersiveWeapons.MOD_ID + "block/stone_sulfur_ore", - Feature.ORE.configured(new OreConfiguration(targetBlockStates, orePerVein))); - - SULFUR_ORE_FEATURE = PlacementUtils.register(ImmersiveWeapons.MOD_ID + "ore/stone_sulfur_ore", - configuredFeature.placed(List.of(CountPlacement.of(veinsPerChunk), InSquarePlacement.spread(), - HeightRangePlacement.triangle(VerticalAnchor.absolute(32), - VerticalAnchor.top()), - BiomeFilter.biome()))); - } - - public static void setupCobaltOre() { - int orePerVein = COBALT_ORE_CONFIG.get(0), veinsPerChunk = COBALT_ORE_CONFIG.get(1), belowTop = COBALT_ORE_CONFIG.get(2); - - BlockState blockState = DeferredRegistryHandler.COBALT_ORE.get().defaultBlockState(); - - targetBlockStates = List.of(OreConfiguration.target(OreFeatures.NATURAL_STONE, blockState)); - - configuredFeature = FeatureUtils.register(ImmersiveWeapons.MOD_ID + "block/stone_cobalt_ore", - Feature.ORE.configured(new OreConfiguration(targetBlockStates, orePerVein))); - - COBALT_ORE_FEATURE = PlacementUtils.register(ImmersiveWeapons.MOD_ID + "ore/stone_cobalt_ore", - configuredFeature.placed(List.of(CountPlacement.of(veinsPerChunk), InSquarePlacement.spread(), - HeightRangePlacement.triangle(VerticalAnchor.absolute(7), - VerticalAnchor.belowTop(belowTop)), - BiomeFilter.biome()))); + public static void init() { + MOLTEN_ORE_BLOB_PLACEMENT = new PlacedFeature( + Holder.direct(new ConfiguredFeature<>(Feature.SCATTERED_ORE, + new OreConfiguration(OreReplacementTargets.MOLTEN_ORE_TARGETS, CommonConfig.MOLTEN_ORE_SIZE.get(), + (float) ((double) CommonConfig.MOLTEN_ORE_EXPOSED_DISCARD_CHANCE.get())))), + + List.of(HeightRangePlacement.triangle(VerticalAnchor.absolute(CommonConfig.MOLTEN_ORE_BOTTOM_ANCHOR.get()), + VerticalAnchor.absolute(CommonConfig.MOLTEN_ORE_TOP_ANCHOR.get())), + BiomeFilter.biome(), + InSquarePlacement.spread(), + CountPlacement.of(CommonConfig.MOLTEN_ORE_WEIGHT.get()) + )); + NETHER_SULFUR_ORE_BLOB_PLACEMENT = new PlacedFeature( + Holder.direct(new ConfiguredFeature<>(Feature.ORE, + new OreConfiguration(OreReplacementTargets.SULFUR_ORE_TARGETS, CommonConfig.NETHER_SULFUR_ORE_SIZE.get(), + (float) ((double) CommonConfig.NETHER_SULFUR_ORE_EXPOSED_DISCARD_CHANCE.get())))), + + List.of(HeightRangePlacement.uniform(VerticalAnchor.absolute(CommonConfig.NETHER_SULFUR_ORE_BOTTOM_ANCHOR.get()), + VerticalAnchor.absolute(CommonConfig.NETHER_SULFUR_ORE_TOP_ANCHOR.get())), + BiomeFilter.biome(), + InSquarePlacement.spread(), + CountPlacement.of(CommonConfig.NETHER_SULFUR_ORE_WEIGHT.get()) + )); + SULFUR_ORE_BLOB_PLACEMENT = new PlacedFeature( + Holder.direct(new ConfiguredFeature<>(Feature.ORE, + new OreConfiguration(OreReplacementTargets.SULFUR_ORE_TARGETS, CommonConfig.SULFUR_ORE_SIZE.get(), + (float) ((double) CommonConfig.SULFUR_ORE_EXPOSED_DISCARD_CHANCE.get())))), + + List.of(HeightRangePlacement.uniform(VerticalAnchor.absolute(CommonConfig.SULFUR_ORE_BOTTOM_ANCHOR.get()), + VerticalAnchor.absolute(CommonConfig.SULFUR_ORE_TOP_ANCHOR.get())), + InSquarePlacement.spread(), + BiomeFilter.biome(), + CountPlacement.of(CommonConfig.SULFUR_ORE_WEIGHT.get()) + )); + DEEPSLATE_SULFUR_ORE_BLOB_PLACEMENT = new PlacedFeature( + Holder.direct(new ConfiguredFeature<>(Feature.ORE, + new OreConfiguration(OreReplacementTargets.SULFUR_ORE_TARGETS, CommonConfig.DEEPSLATE_SULFUR_ORE_SIZE.get(), + (float) ((double) CommonConfig.DEEPSLATE_SULFUR_ORE_EXPOSED_DISCARD_CHANCE.get())))), + + List.of(HeightRangePlacement.uniform(VerticalAnchor.absolute(CommonConfig.DEEPSLATE_SULFUR_ORE_BOTTOM_ANCHOR.get()), + VerticalAnchor.absolute(CommonConfig.DEEPSLATE_SULFUR_ORE_TOP_ANCHOR.get())), + InSquarePlacement.spread(), + BiomeFilter.biome(), + CountPlacement.of(CommonConfig.DEEPSLATE_SULFUR_ORE_WEIGHT.get()) + )); + COBALT_ORE_BLOB_PLACEMENT = new PlacedFeature( + Holder.direct(new ConfiguredFeature<>(Feature.ORE, + new OreConfiguration(OreReplacementTargets.COBALT_ORE_TARGETS, CommonConfig.COBALT_ORE_SIZE.get(), + (float) ((double) CommonConfig.COBALT_ORE_EXPOSED_DISCARD_CHANCE.get())))), + + List.of(HeightRangePlacement.triangle(VerticalAnchor.absolute(CommonConfig.COBALT_ORE_BOTTOM_ANCHOR.get()), + VerticalAnchor.absolute(CommonConfig.COBALT_ORE_TOP_ANCHOR.get())), + InSquarePlacement.spread(), + BiomeFilter.biome(), + CountPlacement.of(CommonConfig.COBALT_ORE_WEIGHT.get()) + )); + DEEPSLATE_COBALT_ORE_BLOB_PLACEMENT = new PlacedFeature( + Holder.direct(new ConfiguredFeature<>(Feature.ORE, + new OreConfiguration(OreReplacementTargets.COBALT_ORE_TARGETS, CommonConfig.DEEPSLATE_COBALT_ORE_SIZE.get(), + (float) ((double) CommonConfig.DEEPSLATE_COBALT_ORE_EXPOSED_DISCARD_CHANCE.get())))), + + List.of(HeightRangePlacement.uniform(VerticalAnchor.absolute(CommonConfig.DEEPSLATE_COBALT_ORE_BOTTOM_ANCHOR.get()), + VerticalAnchor.absolute(CommonConfig.DEEPSLATE_COBALT_ORE_TOP_ANCHOR.get())), + InSquarePlacement.spread(), + BiomeFilter.biome(), + CountPlacement.of(CommonConfig.DEEPSLATE_COBALT_ORE_WEIGHT.get()) + )); } - public static void setupDeepslateSulfurOre() { - int orePerVein = DEEPSLATE_SULFUR_ORE_CONFIG.get(0), veinsPerChunk = DEEPSLATE_SULFUR_ORE_CONFIG.get(1); - - BlockState blockState = DeferredRegistryHandler.DEEPSLATE_SULFUR_ORE.get().defaultBlockState(); - - targetBlockStates = List.of(OreConfiguration.target(OreFeatures.NATURAL_STONE, blockState)); - - configuredFeature = FeatureUtils.register(ImmersiveWeapons.MOD_ID + "block/deepslate_sulfur_ore", - Feature.ORE.configured(new OreConfiguration(targetBlockStates, orePerVein))); - - DEEPSLATE_SULFUR_ORE_FEATURE = PlacementUtils.register(ImmersiveWeapons.MOD_ID + "ore/deepslate_sulfur_ore", - configuredFeature.placed(List.of(CountPlacement.of(veinsPerChunk), InSquarePlacement.spread(), - HeightRangePlacement.triangle(VerticalAnchor.bottom(), - VerticalAnchor.absolute(7)), - BiomeFilter.biome()))); + public static class OreReplacementTargets { + public static final List MOLTEN_ORE_TARGETS = List.of( + OreConfiguration.target(ReplacementRules.NETHER_STONE, + DeferredRegistryHandler.MOLTEN_ORE.get().defaultBlockState()) + ); + public static final List SULFUR_ORE_TARGETS = List.of( + OreConfiguration.target(ReplacementRules.REGULAR_STONE, + DeferredRegistryHandler.SULFUR_ORE.get().defaultBlockState()), + + OreConfiguration.target(ReplacementRules.DEEPSLATE_STONE, + DeferredRegistryHandler.DEEPSLATE_SULFUR_ORE.get().defaultBlockState()), + + OreConfiguration.target(ReplacementRules.NETHER_STONE, + DeferredRegistryHandler.NETHER_SULFUR_ORE.get().defaultBlockState()) + ); + public static final List COBALT_ORE_TARGETS = List.of( + OreConfiguration.target(ReplacementRules.REGULAR_STONE, + DeferredRegistryHandler.COBALT_ORE.get().defaultBlockState()), + OreConfiguration.target(ReplacementRules.DEEPSLATE_STONE, + DeferredRegistryHandler.DEEPSLATE_COBALT_ORE.get().defaultBlockState()) + ); } - public static void setupDeepslateCobaltOre() { - int orePerVein = DEEPSLATE_COBALT_ORE_CONFIG.get(0), veinsPerChunk = DEEPSLATE_COBALT_ORE_CONFIG.get(1); - - BlockState blockState = DeferredRegistryHandler.DEEPSLATE_COBALT_ORE.get().defaultBlockState(); - - targetBlockStates = List.of(OreConfiguration.target(OreFeatures.NATURAL_STONE, blockState)); + public static final class ReplacementRules { + public static final RuleTest REGULAR_STONE = new TagMatchTest(BlockTags.STONE_ORE_REPLACEABLES); + public static final RuleTest DEEPSLATE_STONE = new TagMatchTest(BlockTags.DEEPSLATE_ORE_REPLACEABLES); - configuredFeature = FeatureUtils.register(ImmersiveWeapons.MOD_ID + "block/deepslate_cobalt_ore", - Feature.ORE.configured(new OreConfiguration(targetBlockStates, orePerVein))); + public static final RuleTest NETHER_STONE = createRuleFromTag("forge:ore_bearing_ground/netherrack"); - DEEPSLATE_COBALT_ORE_FEATURE = PlacementUtils.register(ImmersiveWeapons.MOD_ID + "ore/deepslate_cobalt_ore", - configuredFeature.placed(List.of(CountPlacement.of(veinsPerChunk), InSquarePlacement.spread(), - HeightRangePlacement.triangle(VerticalAnchor.bottom(), - VerticalAnchor.absolute(7)), - BiomeFilter.biome()))); + public static RuleTest createRuleFromTag(String tagLocation) { + TagKey blockTag = TagKey.create(Registry.BLOCK_REGISTRY, new ResourceLocation(tagLocation)); + return new TagMatchTest(blockTag); + } } } \ No newline at end of file diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/Structures.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/Structures.java deleted file mode 100644 index de850b9ab..000000000 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/Structures.java +++ /dev/null @@ -1,329 +0,0 @@ -package com.anonymoushacker1279.immersiveweapons.world.level.levelgen; - -import com.anonymoushacker1279.immersiveweapons.ImmersiveWeapons; -import com.anonymoushacker1279.immersiveweapons.config.CommonConfig; -import com.anonymoushacker1279.immersiveweapons.init.DeferredRegistryHandler; -import com.google.common.collect.*; -import net.minecraft.core.Registry; -import net.minecraft.data.BuiltinRegistries; -import net.minecraft.data.worldgen.PlainVillagePools; -import net.minecraft.resources.ResourceKey; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.server.level.ServerLevel; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.biome.Biome; -import net.minecraft.world.level.biome.Biome.BiomeCategory; -import net.minecraft.world.level.chunk.ChunkGenerator; -import net.minecraft.world.level.levelgen.FlatLevelSource; -import net.minecraft.world.level.levelgen.StructureSettings; -import net.minecraft.world.level.levelgen.feature.ConfiguredStructureFeature; -import net.minecraft.world.level.levelgen.feature.StructureFeature; -import net.minecraft.world.level.levelgen.feature.configurations.JigsawConfiguration; -import net.minecraft.world.level.levelgen.feature.configurations.StructureFeatureConfiguration; -import net.minecraft.world.level.levelgen.structure.pieces.PieceGeneratorSupplier; -import net.minecraftforge.event.world.WorldEvent; - -import java.util.*; -import java.util.Map.Entry; - -public class Structures { - - /** - * Static instances of structures that can be referenced and added to biomes easily. - * I cannot get my own pool here during initialization, so I use PlainVillagePools.START. - * I'll modify this pool at runtime later in #createPiecesGenerator - */ - public static final ConfiguredStructureFeature CONFIGURED_ABANDONED_FACTORY = DeferredRegistryHandler.ABANDONED_FACTORY_STRUCTURE.get() - .configured(new JigsawConfiguration(() -> PlainVillagePools.START, 0)); - public static final ConfiguredStructureFeature CONFIGURED_BEAR_TRAP = DeferredRegistryHandler.BEAR_TRAP_STRUCTURE.get() - .configured(new JigsawConfiguration(() -> PlainVillagePools.START, 0)); - public static final ConfiguredStructureFeature CONFIGURED_CAMPSITE = DeferredRegistryHandler.CAMPSITE_STRUCTURE.get() - .configured(new JigsawConfiguration(() -> PlainVillagePools.START, 0)); - public static final ConfiguredStructureFeature CONFIGURED_CLOUD_ISLAND = DeferredRegistryHandler.CLOUD_ISLAND_STRUCTURE.get() - .configured(new JigsawConfiguration(() -> PlainVillagePools.START, 0)); - public static final ConfiguredStructureFeature CONFIGURED_LANDMINE_TRAP = DeferredRegistryHandler.LANDMINE_TRAP_STRUCTURE.get() - .configured(new JigsawConfiguration(() -> PlainVillagePools.START, 0)); - public static final ConfiguredStructureFeature CONFIGURED_OUTHOUSE = DeferredRegistryHandler.OUTHOUSE_STRUCTURE.get() - .configured(new JigsawConfiguration(() -> PlainVillagePools.START, 0)); - public static final ConfiguredStructureFeature CONFIGURED_PITFALL_TRAP = DeferredRegistryHandler.PITFALL_TRAP_STRUCTURE.get() - .configured(new JigsawConfiguration(() -> PlainVillagePools.START, 0)); - public static final ConfiguredStructureFeature CONFIGURED_UNDERGROUND_BUNKER = DeferredRegistryHandler.UNDERGROUND_BUNKER_STRUCTURE.get() - .configured(new JigsawConfiguration(() -> PlainVillagePools.START, 0)); - public static final ConfiguredStructureFeature CONFIGURED_WATER_TOWER = DeferredRegistryHandler.WATER_TOWER_STRUCTURE.get() - .configured(new JigsawConfiguration(() -> PlainVillagePools.START, 0)); - - - /** - * Registers the configured structure, which is what gets added to biomes. - * I'm not using a Forge registry because there are none for configured structures. - */ - public static void registerConfiguredStructures() { - Registry.register(BuiltinRegistries.CONFIGURED_STRUCTURE_FEATURE, new ResourceLocation(ImmersiveWeapons.MOD_ID, - "abandoned_factory"), CONFIGURED_ABANDONED_FACTORY); - Registry.register(BuiltinRegistries.CONFIGURED_STRUCTURE_FEATURE, new ResourceLocation(ImmersiveWeapons.MOD_ID, - "bear_trap"), CONFIGURED_BEAR_TRAP); - Registry.register(BuiltinRegistries.CONFIGURED_STRUCTURE_FEATURE, new ResourceLocation(ImmersiveWeapons.MOD_ID, - "campsite"), CONFIGURED_CAMPSITE); - Registry.register(BuiltinRegistries.CONFIGURED_STRUCTURE_FEATURE, new ResourceLocation(ImmersiveWeapons.MOD_ID, - "cloud_island"), CONFIGURED_CLOUD_ISLAND); - Registry.register(BuiltinRegistries.CONFIGURED_STRUCTURE_FEATURE, new ResourceLocation(ImmersiveWeapons.MOD_ID, - "landmine_trap"), CONFIGURED_LANDMINE_TRAP); - Registry.register(BuiltinRegistries.CONFIGURED_STRUCTURE_FEATURE, new ResourceLocation(ImmersiveWeapons.MOD_ID, - "outhouse"), CONFIGURED_OUTHOUSE); - Registry.register(BuiltinRegistries.CONFIGURED_STRUCTURE_FEATURE, new ResourceLocation(ImmersiveWeapons.MOD_ID, - "pitfall_trap"), CONFIGURED_PITFALL_TRAP); - Registry.register(BuiltinRegistries.CONFIGURED_STRUCTURE_FEATURE, new ResourceLocation(ImmersiveWeapons.MOD_ID, - "underground_bunker"), CONFIGURED_UNDERGROUND_BUNKER); - Registry.register(BuiltinRegistries.CONFIGURED_STRUCTURE_FEATURE, new ResourceLocation(ImmersiveWeapons.MOD_ID, - "water_tower"), CONFIGURED_WATER_TOWER); - } - - /** - * Set the rarity of structures and determine if land conforms to it. - */ - public static void setupStructures() { - setupStructure( - DeferredRegistryHandler.ABANDONED_FACTORY_STRUCTURE.get(), - new StructureFeatureConfiguration( - CommonConfig.MAX_ABANDONED_FACTORY_DISTANCE.get(), - CommonConfig.MIN_ABANDONED_FACTORY_DISTANCE.get(), - 959874384), - true); - setupStructure( - DeferredRegistryHandler.BEAR_TRAP_STRUCTURE.get(), - new StructureFeatureConfiguration( - CommonConfig.MAX_BEAR_TRAP_DISTANCE.get(), - CommonConfig.MIN_BEAR_TRAP_DISTANCE.get(), - 794532168), - false); - setupStructure( - DeferredRegistryHandler.CAMPSITE_STRUCTURE.get(), - new StructureFeatureConfiguration( - CommonConfig.MAX_CAMPSITE_DISTANCE.get(), - CommonConfig.MIN_CAMPSITE_DISTANCE.get(), - 671249835), - true); - setupStructure( - DeferredRegistryHandler.CLOUD_ISLAND_STRUCTURE.get(), - new StructureFeatureConfiguration( - CommonConfig.MAX_CLOUD_ISLAND_DISTANCE.get(), - CommonConfig.MIN_CLOUD_ISLAND_DISTANCE.get(), - 349821657), - false); - setupStructure( - DeferredRegistryHandler.LANDMINE_TRAP_STRUCTURE.get(), - new StructureFeatureConfiguration( - CommonConfig.MAX_LANDMINE_TRAP_DISTANCE.get(), - CommonConfig.MIN_LANDMINE_TRAP_DISTANCE.get(), - 959874384), - true); - setupStructure( - DeferredRegistryHandler.OUTHOUSE_STRUCTURE.get(), - new StructureFeatureConfiguration( - CommonConfig.MAX_OUTHOUSE_DISTANCE.get(), - CommonConfig.MIN_OUTHOUSE_DISTANCE.get(), - 845721365), - false); - setupStructure( - DeferredRegistryHandler.PITFALL_TRAP_STRUCTURE.get(), - new StructureFeatureConfiguration( - CommonConfig.MAX_PITFALL_TRAP_DISTANCE.get(), - CommonConfig.MIN_PITFALL_TRAP_DISTANCE.get(), - 875412395), - false); - setupStructure( - DeferredRegistryHandler.UNDERGROUND_BUNKER_STRUCTURE.get(), - new StructureFeatureConfiguration( - CommonConfig.MAX_UNDERGROUND_BUNKER_DISTANCE.get(), - CommonConfig.MIN_UNDERGROUND_BUNKER_DISTANCE.get(), - 548796135), - false); - setupStructure( - DeferredRegistryHandler.WATER_TOWER_STRUCTURE.get(), - new StructureFeatureConfiguration( - CommonConfig.MAX_WATER_TOWER_DISTANCE.get(), - CommonConfig.MIN_WATER_TOWER_DISTANCE.get(), - 246975135), - true); - } - - /** - * Adds the provided structure to the registry, and adds separation settings. - * The rarity of the structure is determined based on the values passed into - * this method in the StructureFeatureConfiguration argument. - *

- * This method is called by #setupStructures. - */ - private static > void setupStructure( - F structure, - StructureFeatureConfiguration structureFeatureConfiguration, - boolean transformSurroundingLand) { - // Add our own structure into the structure feature map. Otherwise, you get errors - StructureFeature.STRUCTURES_REGISTRY.put(Objects.requireNonNull(structure.getRegistryName()).toString(), structure); - - // Adapt the surrounding land to the bottom of our structure - if (transformSurroundingLand) { - StructureFeature.NOISE_AFFECTING_FEATURES = - ImmutableList.> builder() - .addAll(StructureFeature.NOISE_AFFECTING_FEATURES) - .add(structure) - .build(); - } - - // This is the map that holds the default spacing of all structures - StructureSettings.DEFAULTS = - ImmutableMap., StructureFeatureConfiguration> builder() - .putAll(StructureSettings.DEFAULTS) - .put(structure, structureFeatureConfiguration) - .build(); - - - // Add the structure to all the noise generator settings - BuiltinRegistries.NOISE_GENERATOR_SETTINGS.entrySet().forEach(settings -> { - Map, StructureFeatureConfiguration> structureMap = settings.getValue() - .structureSettings().structureConfig(); - - // Be careful with mods that make the structure map immutable (like datapacks do) - if (structureMap instanceof ImmutableMap) { - Map, StructureFeatureConfiguration> tempMap = new HashMap<>(structureMap); - tempMap.put(structure, structureFeatureConfiguration); - settings.getValue().structureSettings().structureConfig = tempMap; - } else { - structureMap.put(structure, structureFeatureConfiguration); - } - }); - } - - /** - * Tells the chunk generator which biomes my structures can spawn in. - * It will go into the world's chunk generator where I manually add structure spacing. - * If the spacing is not added, the structure doesn't spawn. - *

- * It also functions as a dimension blacklist for structures. - */ - public static void addDimensionalSpacing(WorldEvent.Load event) { - if (event.getWorld() instanceof ServerLevel serverLevel) { - ChunkGenerator chunkGenerator = serverLevel.getChunkSource().getGenerator(); - // Skip superflat generators to prevent issues. - // Additionally, users don't want structures clogging up their superflat worlds. - if (chunkGenerator instanceof FlatLevelSource && serverLevel.dimension().equals(Level.OVERWORLD)) { - return; - } - - StructureSettings worldStructureConfig = chunkGenerator.getSettings(); - - /* - * NOTE: BiomeLoadingEvent does not work with structures anymore. - * Instead, I will use the below to add my structures to biomes. - * This is temporary until Forge finds a better solution for adding structures to biomes. - * TODO: Replace with better solution, as BiomeLoadingEvent doesn't work with structures - */ - - // Create a mutable map, which biomes will be added to for now - HashMap, HashMultimap, ResourceKey>> - structureToMultiMap = new HashMap<>(1); - - // Add the resource key of all biomes that the configured structures can spawn in. - for (Map.Entry, Biome> biomeEntry : - serverLevel.registryAccess().ownedRegistryOrThrow(Registry.BIOME_REGISTRY).entrySet()) { - - BiomeCategory category = biomeEntry.getValue().getBiomeCategory(); - // Add structures to biomes here - if (category == BiomeCategory.FOREST) { - associateBiomeToConfiguredStructure(structureToMultiMap, CONFIGURED_ABANDONED_FACTORY, biomeEntry.getKey()); - associateBiomeToConfiguredStructure(structureToMultiMap, CONFIGURED_BEAR_TRAP, biomeEntry.getKey()); - associateBiomeToConfiguredStructure(structureToMultiMap, CONFIGURED_OUTHOUSE, biomeEntry.getKey()); - associateBiomeToConfiguredStructure(structureToMultiMap, CONFIGURED_UNDERGROUND_BUNKER, biomeEntry.getKey()); - } - if (category == BiomeCategory.PLAINS) { - associateBiomeToConfiguredStructure(structureToMultiMap, CONFIGURED_ABANDONED_FACTORY, biomeEntry.getKey()); - associateBiomeToConfiguredStructure(structureToMultiMap, CONFIGURED_BEAR_TRAP, biomeEntry.getKey()); - associateBiomeToConfiguredStructure(structureToMultiMap, CONFIGURED_CAMPSITE, biomeEntry.getKey()); - associateBiomeToConfiguredStructure(structureToMultiMap, CONFIGURED_OUTHOUSE, biomeEntry.getKey()); - associateBiomeToConfiguredStructure(structureToMultiMap, CONFIGURED_UNDERGROUND_BUNKER, biomeEntry.getKey()); - associateBiomeToConfiguredStructure(structureToMultiMap, CONFIGURED_WATER_TOWER, biomeEntry.getKey()); - } - if (category == BiomeCategory.DESERT) { - associateBiomeToConfiguredStructure(structureToMultiMap, CONFIGURED_CAMPSITE, biomeEntry.getKey()); - associateBiomeToConfiguredStructure(structureToMultiMap, CONFIGURED_LANDMINE_TRAP, biomeEntry.getKey()); - } - if (category == BiomeCategory.TAIGA) { - associateBiomeToConfiguredStructure(structureToMultiMap, CONFIGURED_CLOUD_ISLAND, biomeEntry.getKey()); - } - if (category == BiomeCategory.JUNGLE) { - associateBiomeToConfiguredStructure(structureToMultiMap, CONFIGURED_PITFALL_TRAP, biomeEntry.getKey()); - } - } - - // Grab the map that holds what ConfigureStructures a structure has and what biomes it can spawn in. - ImmutableMap.Builder, ImmutableMultimap, - ResourceKey>> tempStructureToMultiMap = ImmutableMap.builder(); - - worldStructureConfig.configuredStructures.entrySet() - .stream() - .filter(entry -> !structureToMultiMap.containsKey(entry.getKey())) - .forEach(tempStructureToMultiMap::put); - - // Add our structures to the structure map/multimap and set the world to use this combined map/multimap. - structureToMultiMap.forEach((key, value) -> tempStructureToMultiMap.put(key, ImmutableMultimap.copyOf(value))); - - worldStructureConfig.configuredStructures = tempStructureToMultiMap.build(); - } - } - - /** - * Helper method that handles setting up the map to multimap relationship to help prevent issues. - */ - private static void associateBiomeToConfiguredStructure(Map, HashMultimap, - ResourceKey>> structureToMultimap, ConfiguredStructureFeature configuredStructureFeature, - ResourceKey biomeRegistryKey) { - - structureToMultimap.putIfAbsent(configuredStructureFeature.feature, HashMultimap.create()); - HashMultimap, ResourceKey> configuredStructureToBiomeMultiMap = - structureToMultimap.get(configuredStructureFeature.feature); - - if (configuredStructureToBiomeMultiMap.containsValue(biomeRegistryKey)) { - Optional, ResourceKey>> keyEntry = - configuredStructureToBiomeMultiMap.entries() - .stream() - .filter(e -> e.getValue() == biomeRegistryKey) - .findFirst(); - - int keyID = 0; // This should always be set below, but the IDE throws a fit if I call all this directly in the logger - if (keyEntry.isPresent()) { - keyID = BuiltinRegistries.CONFIGURED_STRUCTURE_FEATURE.getId(keyEntry.get().getKey()); - } - - ImmersiveWeapons.LOGGER.error(""" - Detected 2 ConfiguredStructureFeatures that share the same base StructureFeature trying to be added to same biome. One will be prevented from spawning. - The two conflicting ConfiguredStructures are: {}, {} - The biome that is attempting to be shared: {} - """, - BuiltinRegistries.CONFIGURED_STRUCTURE_FEATURE.getId(configuredStructureFeature), - keyID, - biomeRegistryKey - ); - } else { - configuredStructureToBiomeMultiMap.put(configuredStructureFeature, biomeRegistryKey); - } - } - - /** - * Create a copy of a piece generator context with another config. This is used by the structures. - */ - public static PieceGeneratorSupplier.Context - createContextWithConfig(PieceGeneratorSupplier.Context context, JigsawConfiguration newConfig) { - - return new PieceGeneratorSupplier.Context<>( - context.chunkGenerator(), - context.biomeSource(), - context.seed(), - context.chunkPos(), - newConfig, - context.heightAccessor(), - context.validBiome(), - context.structureManager(), - context.registryAccess() - ); - } -} \ No newline at end of file diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/biomes/BiomesAndDimensions.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/biomes/BiomesAndDimensions.java new file mode 100644 index 000000000..1066e8c02 --- /dev/null +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/biomes/BiomesAndDimensions.java @@ -0,0 +1,20 @@ +package com.anonymoushacker1279.immersiveweapons.world.level.levelgen.biomes; + +import com.anonymoushacker1279.immersiveweapons.ImmersiveWeapons; +import net.minecraft.core.Registry; +import net.minecraft.resources.ResourceKey; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.biome.Biome; + +public class BiomesAndDimensions { + + public static final ResourceKey BATTLEFIELD = register("battlefield"); + + public static final ResourceKey TILTROS = ResourceKey.create(Registry.DIMENSION_REGISTRY, + new ResourceLocation(ImmersiveWeapons.MOD_ID, "tiltros")); + + private static ResourceKey register(String name) { + return ResourceKey.create(Registry.BIOME_REGISTRY, new ResourceLocation(ImmersiveWeapons.MOD_ID, name)); + } +} \ No newline at end of file diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/biomes/IWOverworldBiomesProvider.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/biomes/IWOverworldBiomesProvider.java new file mode 100644 index 000000000..650d0f76a --- /dev/null +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/biomes/IWOverworldBiomesProvider.java @@ -0,0 +1,33 @@ +package com.anonymoushacker1279.immersiveweapons.world.level.levelgen.biomes; + +import com.mojang.datafixers.util.Pair; +import net.minecraft.core.Registry; +import net.minecraft.resources.ResourceKey; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.level.biome.Biome; +import net.minecraft.world.level.biome.Climate.ParameterPoint; +import terrablender.api.ParameterUtils.*; +import terrablender.api.Region; +import terrablender.api.RegionType; + +import java.util.function.Consumer; + +public class IWOverworldBiomesProvider extends Region { + + public IWOverworldBiomesProvider(ResourceLocation name, RegionType type, int weight) { + super(name, type, weight); + } + + @Override + public void addBiomes(Registry registry, Consumer>> mapper) { + addBiome(mapper, + Temperature.WARM.parameter(), + Humidity.span(Humidity.ARID, Humidity.NEUTRAL), + Continentalness.span(Continentalness.NEAR_INLAND, Continentalness.FAR_INLAND), + Erosion.span(Erosion.EROSION_0, Erosion.EROSION_1), + Weirdness.span(Weirdness.MID_SLICE_VARIANT_ASCENDING, Weirdness.MID_SLICE_VARIANT_DESCENDING), + Depth.SURFACE.parameter(), + 0.5f, + BiomesAndDimensions.BATTLEFIELD); + } +} \ No newline at end of file diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/biomes/SurfaceRuleData.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/biomes/SurfaceRuleData.java new file mode 100644 index 000000000..d5c410045 --- /dev/null +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/biomes/SurfaceRuleData.java @@ -0,0 +1,28 @@ +package com.anonymoushacker1279.immersiveweapons.world.level.levelgen.biomes; + +import com.anonymoushacker1279.immersiveweapons.world.level.levelgen.surface.SurfaceRuleBuilder; +import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.levelgen.SurfaceRules; +import net.minecraft.world.level.levelgen.SurfaceRules.RuleSource; +import net.minecraft.world.level.levelgen.VerticalAnchor; + +public class SurfaceRuleData { + + public static SurfaceRules.RuleSource makeRules() { + + RuleSource battlefield = SurfaceRuleBuilder.start() + .biome(BiomesAndDimensions.BATTLEFIELD) + .surface(Blocks.GRASS_BLOCK.defaultBlockState()) + .subsurface(Blocks.COARSE_DIRT.defaultBlockState(), 3) + .filler(Blocks.STONE.defaultBlockState()) + .rule(3, SurfaceRules.ifTrue(SurfaceRules.verticalGradient("deepslate", + VerticalAnchor.absolute(0), + VerticalAnchor.absolute(8)), + SurfaceRules.state(Blocks.DEEPSLATE.defaultBlockState()))) + .build(); + + return SurfaceRules.sequence( + SurfaceRules.ifTrue(SurfaceRules.isBiome(BiomesAndDimensions.BATTLEFIELD), battlefield) + ); + } +} \ No newline at end of file diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/feature/treedecorators/BurnedBranchDecorator.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/feature/treedecorators/BurnedBranchDecorator.java index a2fa2225d..303e7413b 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/feature/treedecorators/BurnedBranchDecorator.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/feature/treedecorators/BurnedBranchDecorator.java @@ -18,7 +18,8 @@ public class BurnedBranchDecorator extends TreeDecorator { - public static final Codec CODEC = Codec.floatRange(0.0F, 1.0F).fieldOf("probability").xmap(BurnedBranchDecorator::new, (decorator) -> decorator.probability).codec(); + public static final Codec CODEC = Codec.floatRange(0.0F, 1.0F).fieldOf("probability") + .xmap(BurnedBranchDecorator::new, (decorator) -> decorator.probability).codec(); private final float probability; public BurnedBranchDecorator(float chance) { @@ -31,16 +32,19 @@ public BurnedBranchDecorator(float chance) { } @Override - public void place(@NotNull LevelSimulatedReader simulatedReader, @NotNull BiConsumer biConsumer, Random random, @NotNull List pos, @NotNull List posList) { - if (!(random.nextFloat() >= probability)) { - int i = pos.get(0).getY(); - pos.stream().filter((blockPos) -> blockPos.getY() - i <= 8).forEach((blockPos) -> { + public void place(@NotNull LevelSimulatedReader simulatedReader, @NotNull BiConsumer biConsumer, + Random random, @NotNull List pos, @NotNull List posList) { + + if (random.nextFloat() <= probability) { + pos.forEach((blockPos) -> { for (Direction direction : Direction.Plane.HORIZONTAL) { - if (random.nextFloat() <= 0.25F) { - Direction direction1 = direction.getOpposite(); - BlockPos blockpos = blockPos.offset(direction1.getStepX(), 0, direction1.getStepZ()); - if (Feature.isAir(simulatedReader, blockpos)) { - biConsumer.accept(blockpos, DeferredRegistryHandler.BURNED_OAK_BRANCH.get().defaultBlockState().setValue(BranchBlock.FACING, direction)); + if (random.nextFloat() <= 0.25f) { + Direction oppositeDirection = direction.getOpposite(); + BlockPos position = blockPos.offset(oppositeDirection.getStepX(), 0, oppositeDirection.getStepZ()); + + if (Feature.isAir(simulatedReader, position)) { + biConsumer.accept(position, DeferredRegistryHandler.BURNED_OAK_BRANCH.get().defaultBlockState() + .setValue(BranchBlock.FACING, direction)); } } } diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/structures/AbandonedFactoryStructure.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/structures/AbandonedFactoryStructure.java deleted file mode 100644 index 0d0ab3698..000000000 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/structures/AbandonedFactoryStructure.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.anonymoushacker1279.immersiveweapons.world.level.levelgen.structures; - -import com.anonymoushacker1279.immersiveweapons.ImmersiveWeapons; -import com.anonymoushacker1279.immersiveweapons.world.level.levelgen.Structures; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Registry; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.level.NoiseColumn; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.levelgen.GenerationStep; -import net.minecraft.world.level.levelgen.Heightmap; -import net.minecraft.world.level.levelgen.feature.StructureFeature; -import net.minecraft.world.level.levelgen.feature.configurations.JigsawConfiguration; -import net.minecraft.world.level.levelgen.feature.structures.JigsawPlacement; -import net.minecraft.world.level.levelgen.structure.PoolElementStructurePiece; -import net.minecraft.world.level.levelgen.structure.PostPlacementProcessor; -import net.minecraft.world.level.levelgen.structure.pieces.PieceGenerator; -import net.minecraft.world.level.levelgen.structure.pieces.PieceGeneratorSupplier; -import net.minecraft.world.level.levelgen.structure.pieces.PieceGeneratorSupplier.Context; -import org.jetbrains.annotations.NotNull; - -import java.util.Optional; - -public class AbandonedFactoryStructure extends StructureFeature { - - public AbandonedFactoryStructure() { - super(JigsawConfiguration.CODEC, context -> { - if (!isFeatureChunk(context)) { - return Optional.empty(); - } else { - return createPiecesGenerator(context); - } - }, PostPlacementProcessor.NONE); - } - - @Override - public GenerationStep.@NotNull Decoration step() { - return GenerationStep.Decoration.SURFACE_STRUCTURES; - } - - // Test if the current chunk (from context) has a valid location for the structure - private static boolean isFeatureChunk(PieceGeneratorSupplier.Context context) { - BlockPos blockPos = context.chunkPos().getWorldPosition(); - - // Get height of land (stops at first non-air block) - int landHeight = context.chunkGenerator().getFirstOccupiedHeight(blockPos.getX(), blockPos.getZ(), Heightmap.Types.WORLD_SURFACE_WG, context.heightAccessor()); - - // Grabs the column of blocks at given position. - NoiseColumn columnOfBlocks = context.chunkGenerator().getBaseColumn(blockPos.getX(), blockPos.getZ(), context.heightAccessor()); - - // Combine the column of blocks with land height, and get the top block itself which can be tested. - BlockState topBlock = columnOfBlocks.getBlock(landHeight); - - // Now test to make sure the structure is not spawning on water or other fluids. - return topBlock.getFluidState().isEmpty(); - } - - private static Optional> createPiecesGenerator(PieceGeneratorSupplier.Context context) { - // Convert the chunk coordinates into actual coordinates can use. (center of that chunk) - BlockPos blockPos = context.chunkPos().getMiddleBlockPosition(0); - - JigsawConfiguration configuration = new JigsawConfiguration( - () -> context.registryAccess().ownedRegistryOrThrow(Registry.TEMPLATE_POOL_REGISTRY) - .get(new ResourceLocation(ImmersiveWeapons.MOD_ID, "abandoned_factory/start_pool")), - 5 //The structure is only one chunk wide but by using five here it can be replaced with something larger in datapacks - ); - - // Create a new context with the new config that has our JSON pool. We will pass this into JigsawPlacement#addPieces - Context contextWithConfig = Structures.createContextWithConfig(context, configuration); - - // Return the piece generator that is now set up, so that the game runs it when it needs to create the layout of structure pieces. - // Last 'true' parameter means the structure will automatically be placed at ground level - return JigsawPlacement.addPieces(contextWithConfig, - PoolElementStructurePiece::new, blockPos, false, true); - } -} \ No newline at end of file diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/structures/BearTrapStructure.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/structures/BearTrapStructure.java deleted file mode 100644 index d20fc79e5..000000000 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/structures/BearTrapStructure.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.anonymoushacker1279.immersiveweapons.world.level.levelgen.structures; - -import com.anonymoushacker1279.immersiveweapons.ImmersiveWeapons; -import com.anonymoushacker1279.immersiveweapons.world.level.levelgen.Structures; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Registry; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.level.NoiseColumn; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.levelgen.GenerationStep; -import net.minecraft.world.level.levelgen.Heightmap; -import net.minecraft.world.level.levelgen.feature.StructureFeature; -import net.minecraft.world.level.levelgen.feature.configurations.JigsawConfiguration; -import net.minecraft.world.level.levelgen.feature.structures.JigsawPlacement; -import net.minecraft.world.level.levelgen.structure.PoolElementStructurePiece; -import net.minecraft.world.level.levelgen.structure.PostPlacementProcessor; -import net.minecraft.world.level.levelgen.structure.pieces.PieceGenerator; -import net.minecraft.world.level.levelgen.structure.pieces.PieceGeneratorSupplier; -import net.minecraft.world.level.levelgen.structure.pieces.PieceGeneratorSupplier.Context; -import org.jetbrains.annotations.NotNull; - -import java.util.Optional; - -public class BearTrapStructure extends StructureFeature { - - public BearTrapStructure() { - super(JigsawConfiguration.CODEC, context -> { - if (!isFeatureChunk(context)) { - return Optional.empty(); - } else { - return createPiecesGenerator(context); - } - }, PostPlacementProcessor.NONE); - } - - @Override - public GenerationStep.@NotNull Decoration step() { - return GenerationStep.Decoration.SURFACE_STRUCTURES; - } - - // Test if the current chunk (from context) has a valid location for the structure - private static boolean isFeatureChunk(PieceGeneratorSupplier.Context context) { - BlockPos blockPos = context.chunkPos().getWorldPosition(); - - // Get height of land (stops at first non-air block) - int landHeight = context.chunkGenerator().getFirstOccupiedHeight(blockPos.getX(), blockPos.getZ(), Heightmap.Types.WORLD_SURFACE_WG, context.heightAccessor()); - - // Grabs the column of blocks at given position. - NoiseColumn columnOfBlocks = context.chunkGenerator().getBaseColumn(blockPos.getX(), blockPos.getZ(), context.heightAccessor()); - - // Combine the column of blocks with land height, and get the top block itself which can be tested. - BlockState topBlock = columnOfBlocks.getBlock(landHeight); - - // Now test to make sure the structure is not spawning on water or other fluids. - return topBlock.getFluidState().isEmpty(); - } - - private static Optional> createPiecesGenerator(PieceGeneratorSupplier.Context context) { - // Convert the chunk coordinates into actual coordinates can use. (center of that chunk) - BlockPos blockPos = context.chunkPos().getMiddleBlockPosition(0); - - JigsawConfiguration configuration = new JigsawConfiguration( - () -> context.registryAccess().ownedRegistryOrThrow(Registry.TEMPLATE_POOL_REGISTRY) - .get(new ResourceLocation(ImmersiveWeapons.MOD_ID, "bear_trap/start_pool")), - 5 //The structure is only one chunk wide but by using five here it can be replaced with something larger in datapacks - ); - - // Create a new context with the new config that has our JSON pool. We will pass this into JigsawPlacement#addPieces - Context contextWithConfig = Structures.createContextWithConfig(context, configuration); - - // Return the piece generator that is now set up, so that the game runs it when it needs to create the layout of structure pieces. - // Last 'true' parameter means the structure will automatically be placed at ground level - return JigsawPlacement.addPieces(contextWithConfig, - PoolElementStructurePiece::new, blockPos, false, true); - } -} \ No newline at end of file diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/structures/CloudIslandStructure.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/structures/CloudIslandStructure.java index d8984bf29..df002ebd5 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/structures/CloudIslandStructure.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/structures/CloudIslandStructure.java @@ -1,28 +1,25 @@ package com.anonymoushacker1279.immersiveweapons.world.level.levelgen.structures; -import com.anonymoushacker1279.immersiveweapons.ImmersiveWeapons; -import com.anonymoushacker1279.immersiveweapons.world.level.levelgen.Structures; import net.minecraft.core.BlockPos; -import net.minecraft.core.Registry; -import net.minecraft.resources.ResourceLocation; import net.minecraft.world.level.NoiseColumn; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.GenerationStep; import net.minecraft.world.level.levelgen.Heightmap; import net.minecraft.world.level.levelgen.feature.StructureFeature; import net.minecraft.world.level.levelgen.feature.configurations.JigsawConfiguration; -import net.minecraft.world.level.levelgen.feature.structures.JigsawPlacement; import net.minecraft.world.level.levelgen.structure.PoolElementStructurePiece; import net.minecraft.world.level.levelgen.structure.PostPlacementProcessor; import net.minecraft.world.level.levelgen.structure.pieces.PieceGenerator; import net.minecraft.world.level.levelgen.structure.pieces.PieceGeneratorSupplier; -import net.minecraft.world.level.levelgen.structure.pieces.PieceGeneratorSupplier.Context; +import net.minecraft.world.level.levelgen.structure.pools.JigsawPlacement; import org.jetbrains.annotations.NotNull; import java.util.Optional; public class CloudIslandStructure extends StructureFeature { + static int landHeight; + public CloudIslandStructure() { super(JigsawConfiguration.CODEC, context -> { if (!isFeatureChunk(context)) { @@ -43,10 +40,12 @@ private static boolean isFeatureChunk(PieceGeneratorSupplier.Context> createPiecesGenerator(PieceGeneratorSupplier.Context context) { + private static Optional> createPiecesGenerator( + PieceGeneratorSupplier.Context context) { + // Convert the chunk coordinates into actual coordinates can use. (center of that chunk) - BlockPos blockPos = context.chunkPos().getMiddleBlockPosition(0); + BlockPos blockPos = context.chunkPos().getMiddleBlockPosition(landHeight); - JigsawConfiguration configuration = new JigsawConfiguration( - () -> context.registryAccess().ownedRegistryOrThrow(Registry.TEMPLATE_POOL_REGISTRY) - .get(new ResourceLocation(ImmersiveWeapons.MOD_ID, "cloud_island/start_pool")), - 5 //The structure is only one chunk wide but by using five here it can be replaced with something larger in datapacks + /* Generate pieces of the structure. + Second-to-last boolean is only for structure intersections. + Last boolean means the structure will automatically be placed at ground level. + */ + return JigsawPlacement.addPieces( + context, + PoolElementStructurePiece::new, + blockPos.above(48), + false, + false ); - - // Create a new context with the new config that has our JSON pool. We will pass this into JigsawPlacement#addPieces - Context contextWithConfig = Structures.createContextWithConfig(context, configuration); - - // Return the piece generator that is now set up, so that the game runs it when it needs to create the layout of structure pieces. - // Last 'true' parameter means the structure will automatically be placed at ground level - return JigsawPlacement.addPieces(contextWithConfig, - PoolElementStructurePiece::new, blockPos.atY(63), false, true); } } \ No newline at end of file diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/structures/CampsiteStructure.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/structures/DestroyedHouse.java similarity index 54% rename from src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/structures/CampsiteStructure.java rename to src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/structures/DestroyedHouse.java index ad98a5790..2b54b8259 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/structures/CampsiteStructure.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/structures/DestroyedHouse.java @@ -1,29 +1,26 @@ package com.anonymoushacker1279.immersiveweapons.world.level.levelgen.structures; -import com.anonymoushacker1279.immersiveweapons.ImmersiveWeapons; -import com.anonymoushacker1279.immersiveweapons.world.level.levelgen.Structures; import net.minecraft.core.BlockPos; -import net.minecraft.core.Registry; -import net.minecraft.resources.ResourceLocation; import net.minecraft.world.level.NoiseColumn; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.GenerationStep; import net.minecraft.world.level.levelgen.Heightmap; import net.minecraft.world.level.levelgen.feature.StructureFeature; import net.minecraft.world.level.levelgen.feature.configurations.JigsawConfiguration; -import net.minecraft.world.level.levelgen.feature.structures.JigsawPlacement; import net.minecraft.world.level.levelgen.structure.PoolElementStructurePiece; import net.minecraft.world.level.levelgen.structure.PostPlacementProcessor; import net.minecraft.world.level.levelgen.structure.pieces.PieceGenerator; import net.minecraft.world.level.levelgen.structure.pieces.PieceGeneratorSupplier; -import net.minecraft.world.level.levelgen.structure.pieces.PieceGeneratorSupplier.Context; +import net.minecraft.world.level.levelgen.structure.pools.JigsawPlacement; import org.jetbrains.annotations.NotNull; import java.util.Optional; -public class CampsiteStructure extends StructureFeature { +public class DestroyedHouse extends StructureFeature { - public CampsiteStructure() { + static int landHeight; + + public DestroyedHouse() { super(JigsawConfiguration.CODEC, context -> { if (!isFeatureChunk(context)) { return Optional.empty(); @@ -43,34 +40,37 @@ private static boolean isFeatureChunk(PieceGeneratorSupplier.Context> createPiecesGenerator(PieceGeneratorSupplier.Context context) { + private static Optional> createPiecesGenerator( + PieceGeneratorSupplier.Context context) { + // Convert the chunk coordinates into actual coordinates can use. (center of that chunk) BlockPos blockPos = context.chunkPos().getMiddleBlockPosition(0); - JigsawConfiguration configuration = new JigsawConfiguration( - () -> context.registryAccess().ownedRegistryOrThrow(Registry.TEMPLATE_POOL_REGISTRY) - .get(new ResourceLocation(ImmersiveWeapons.MOD_ID, "campsite/start_pool")), - 5 //The structure is only one chunk wide but by using five here it can be replaced with something larger in datapacks + /* Generate pieces of the structure. + Second-to-last boolean is only for structure intersections. + Last boolean means the structure will automatically be placed at ground level. + */ + return JigsawPlacement.addPieces( + context, + PoolElementStructurePiece::new, + blockPos.atY(landHeight), + false, + false ); - - // Create a new context with the new config that has our JSON pool. We will pass this into JigsawPlacement#addPieces - Context contextWithConfig = Structures.createContextWithConfig(context, configuration); - - // Return the piece generator that is now set up, so that the game runs it when it needs to create the layout of structure pieces. - // Last 'true' parameter means the structure will automatically be placed at ground level - return JigsawPlacement.addPieces(contextWithConfig, - PoolElementStructurePiece::new, blockPos, false, true); } } \ No newline at end of file diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/structures/HansHut.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/structures/HansHut.java new file mode 100644 index 000000000..319e5183a --- /dev/null +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/structures/HansHut.java @@ -0,0 +1,94 @@ +package com.anonymoushacker1279.immersiveweapons.world.level.levelgen.structures; + +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.LevelHeightAccessor; +import net.minecraft.world.level.NoiseColumn; +import net.minecraft.world.level.levelgen.*; +import net.minecraft.world.level.levelgen.GenerationStep.Decoration; +import net.minecraft.world.level.levelgen.feature.StructureFeature; +import net.minecraft.world.level.levelgen.feature.configurations.JigsawConfiguration; +import net.minecraft.world.level.levelgen.structure.PoolElementStructurePiece; +import net.minecraft.world.level.levelgen.structure.PostPlacementProcessor; +import net.minecraft.world.level.levelgen.structure.pieces.PieceGenerator; +import net.minecraft.world.level.levelgen.structure.pieces.PieceGeneratorSupplier; +import net.minecraft.world.level.levelgen.structure.pools.JigsawPlacement; +import org.jetbrains.annotations.NotNull; + +import java.util.Optional; + +public class HansHut extends StructureFeature { + + public HansHut() { + super(JigsawConfiguration.CODEC, HansHut::createPiecesGenerator, PostPlacementProcessor.NONE); + } + + @Override + public GenerationStep.@NotNull Decoration step() { + return Decoration.UNDERGROUND_STRUCTURES; + } + + private static @NotNull Optional> createPiecesGenerator(PieceGeneratorSupplier.Context context) { + // Check if the height is suitable + if (context.heightAccessor().getMinBuildHeight() + 3 > -10) { + return Optional.empty(); + } + + // Convert the chunk coordinates into actual coordinates can use. (center of that chunk) + BlockPos blockPos = context.chunkPos().getMiddleBlockPosition(0); + + // Get a block position underground + blockPos = findSuitableSpot(context, blockPos); + + // Don't generate if the position is in a fluid + NoiseColumn columnOfBlocks = context.chunkGenerator().getBaseColumn(blockPos.getX(), blockPos.getZ(), context.heightAccessor()); + if (!columnOfBlocks.getBlock(blockPos.getY()).getFluidState().isEmpty()) { + return Optional.empty(); + } + + /* Generate pieces of the structure. + Second-to-last boolean is only for structure intersections. + Last boolean means the structure will automatically be placed at ground level. + */ + return JigsawPlacement.addPieces( + context, + PoolElementStructurePiece::new, + blockPos, + false, + false + ); + } + + @NotNull + private static BlockPos findSuitableSpot(PieceGeneratorSupplier.Context context, BlockPos blockPos) { + LevelHeightAccessor heightAccessor = context.heightAccessor(); + + // Create a random generator that depends on the current chunk location. That way if the world is recreated + // with the same seed the feature will end up at the same spot + WorldgenRandom worldgenRandom = new WorldgenRandom(new LegacyRandomSource(context.seed())); + worldgenRandom.setLargeFeatureSeed(context.seed(), context.chunkPos().x, context.chunkPos().z); + + // Pick a random y location between a low and a high point + int height = worldgenRandom.nextIntBetweenInclusive(heightAccessor.getMinBuildHeight() + 3, + -10); + + // Go down until I find a spot that has air. Then go down until I find a spot that is solid again + NoiseColumn baseColumn = context.chunkGenerator().getBaseColumn(blockPos.getX(), blockPos.getZ(), heightAccessor); + int tempHeight = height; // Remember the original Y height because I'll just use this if I can't find an air bubble + int lowerLimit = heightAccessor.getMinBuildHeight() + 3; // Lower limit, don't go below this + while (tempHeight > lowerLimit && !baseColumn.getBlock(tempHeight).isAir()) { + tempHeight--; + } + // If I found air, I'll go down until I find a non-air block + if (tempHeight > lowerLimit) { + while (tempHeight > lowerLimit && baseColumn.getBlock(tempHeight).isAir()) { + tempHeight--; + } + if (tempHeight > lowerLimit) { + // Found a possible spawn spot + height = tempHeight + 1; + } + } + + return blockPos.atY(height); + } +} \ No newline at end of file diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/structures/LandmineTrapStructure.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/structures/LandmineTrapStructure.java deleted file mode 100644 index 34626139f..000000000 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/structures/LandmineTrapStructure.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.anonymoushacker1279.immersiveweapons.world.level.levelgen.structures; - -import com.anonymoushacker1279.immersiveweapons.ImmersiveWeapons; -import com.anonymoushacker1279.immersiveweapons.world.level.levelgen.Structures; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Registry; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.level.NoiseColumn; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.levelgen.GenerationStep; -import net.minecraft.world.level.levelgen.Heightmap; -import net.minecraft.world.level.levelgen.feature.StructureFeature; -import net.minecraft.world.level.levelgen.feature.configurations.JigsawConfiguration; -import net.minecraft.world.level.levelgen.feature.structures.JigsawPlacement; -import net.minecraft.world.level.levelgen.structure.PoolElementStructurePiece; -import net.minecraft.world.level.levelgen.structure.PostPlacementProcessor; -import net.minecraft.world.level.levelgen.structure.pieces.PieceGenerator; -import net.minecraft.world.level.levelgen.structure.pieces.PieceGeneratorSupplier; -import net.minecraft.world.level.levelgen.structure.pieces.PieceGeneratorSupplier.Context; -import org.jetbrains.annotations.NotNull; - -import java.util.Optional; - -public class LandmineTrapStructure extends StructureFeature { - - public LandmineTrapStructure() { - super(JigsawConfiguration.CODEC, context -> { - if (!isFeatureChunk(context)) { - return Optional.empty(); - } else { - return createPiecesGenerator(context); - } - }, PostPlacementProcessor.NONE); - } - - @Override - public GenerationStep.@NotNull Decoration step() { - return GenerationStep.Decoration.SURFACE_STRUCTURES; - } - - // Test if the current chunk (from context) has a valid location for the structure - private static boolean isFeatureChunk(PieceGeneratorSupplier.Context context) { - BlockPos blockPos = context.chunkPos().getWorldPosition(); - - // Get height of land (stops at first non-air block) - int landHeight = context.chunkGenerator().getFirstOccupiedHeight(blockPos.getX(), blockPos.getZ(), Heightmap.Types.WORLD_SURFACE_WG, context.heightAccessor()); - - // Grabs the column of blocks at given position. - NoiseColumn columnOfBlocks = context.chunkGenerator().getBaseColumn(blockPos.getX(), blockPos.getZ(), context.heightAccessor()); - - // Combine the column of blocks with land height, and get the top block itself which can be tested. - BlockState topBlock = columnOfBlocks.getBlock(landHeight); - - // Now test to make sure the structure is not spawning on water or other fluids. - return topBlock.getFluidState().isEmpty(); - } - - private static Optional> createPiecesGenerator(PieceGeneratorSupplier.Context context) { - // Convert the chunk coordinates into actual coordinates can use. (center of that chunk) - BlockPos blockPos = context.chunkPos().getMiddleBlockPosition(0); - - JigsawConfiguration configuration = new JigsawConfiguration( - () -> context.registryAccess().ownedRegistryOrThrow(Registry.TEMPLATE_POOL_REGISTRY) - .get(new ResourceLocation(ImmersiveWeapons.MOD_ID, "landmine_trap/start_pool")), - 5 //The structure is only one chunk wide but by using five here it can be replaced with something larger in datapacks - ); - - // Create a new context with the new config that has our JSON pool. We will pass this into JigsawPlacement#addPieces - Context contextWithConfig = Structures.createContextWithConfig(context, configuration); - - // Return the piece generator that is now set up, so that the game runs it when it needs to create the layout of structure pieces. - // Last 'true' parameter means the structure will automatically be placed at ground level - return JigsawPlacement.addPieces(contextWithConfig, - PoolElementStructurePiece::new, blockPos, false, true); - } -} \ No newline at end of file diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/structures/OuthouseStructure.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/structures/OuthouseStructure.java deleted file mode 100644 index 3c4841914..000000000 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/structures/OuthouseStructure.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.anonymoushacker1279.immersiveweapons.world.level.levelgen.structures; - -import com.anonymoushacker1279.immersiveweapons.ImmersiveWeapons; -import com.anonymoushacker1279.immersiveweapons.world.level.levelgen.Structures; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Registry; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.level.NoiseColumn; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.levelgen.GenerationStep; -import net.minecraft.world.level.levelgen.Heightmap; -import net.minecraft.world.level.levelgen.feature.StructureFeature; -import net.minecraft.world.level.levelgen.feature.configurations.JigsawConfiguration; -import net.minecraft.world.level.levelgen.feature.structures.JigsawPlacement; -import net.minecraft.world.level.levelgen.structure.PoolElementStructurePiece; -import net.minecraft.world.level.levelgen.structure.PostPlacementProcessor; -import net.minecraft.world.level.levelgen.structure.pieces.PieceGenerator; -import net.minecraft.world.level.levelgen.structure.pieces.PieceGeneratorSupplier; -import net.minecraft.world.level.levelgen.structure.pieces.PieceGeneratorSupplier.Context; -import org.jetbrains.annotations.NotNull; - -import java.util.Optional; - -public class OuthouseStructure extends StructureFeature { - - public OuthouseStructure() { - super(JigsawConfiguration.CODEC, context -> { - if (!isFeatureChunk(context)) { - return Optional.empty(); - } else { - return createPiecesGenerator(context); - } - }, PostPlacementProcessor.NONE); - } - - @Override - public GenerationStep.@NotNull Decoration step() { - return GenerationStep.Decoration.SURFACE_STRUCTURES; - } - - // Test if the current chunk (from context) has a valid location for the structure - private static boolean isFeatureChunk(PieceGeneratorSupplier.Context context) { - BlockPos blockPos = context.chunkPos().getWorldPosition(); - - // Get height of land (stops at first non-air block) - int landHeight = context.chunkGenerator().getFirstOccupiedHeight(blockPos.getX(), blockPos.getZ(), Heightmap.Types.WORLD_SURFACE_WG, context.heightAccessor()); - - // Grabs the column of blocks at given position. - NoiseColumn columnOfBlocks = context.chunkGenerator().getBaseColumn(blockPos.getX(), blockPos.getZ(), context.heightAccessor()); - - // Combine the column of blocks with land height, and get the top block itself which can be tested. - BlockState topBlock = columnOfBlocks.getBlock(landHeight); - - // Now test to make sure the structure is not spawning on water or other fluids. - return topBlock.getFluidState().isEmpty(); - } - - private static Optional> createPiecesGenerator(PieceGeneratorSupplier.Context context) { - // Convert the chunk coordinates into actual coordinates can use. (center of that chunk) - BlockPos blockPos = context.chunkPos().getMiddleBlockPosition(0); - - JigsawConfiguration configuration = new JigsawConfiguration( - () -> context.registryAccess().ownedRegistryOrThrow(Registry.TEMPLATE_POOL_REGISTRY) - .get(new ResourceLocation(ImmersiveWeapons.MOD_ID, "outhouse/start_pool")), - 5 //The structure is only one chunk wide but by using five here it can be replaced with something larger in datapacks - ); - - // Create a new context with the new config that has our JSON pool. We will pass this into JigsawPlacement#addPieces - Context contextWithConfig = Structures.createContextWithConfig(context, configuration); - - // Return the piece generator that is now set up, so that the game runs it when it needs to create the layout of structure pieces. - // Last 'true' parameter means the structure will automatically be placed at ground level - return JigsawPlacement.addPieces(contextWithConfig, - PoolElementStructurePiece::new, blockPos.below(2), false, true); - } -} \ No newline at end of file diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/structures/PitfallTrapStructure.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/structures/PitfallTrapStructure.java index d7c7cb222..de075dd10 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/structures/PitfallTrapStructure.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/structures/PitfallTrapStructure.java @@ -1,28 +1,25 @@ package com.anonymoushacker1279.immersiveweapons.world.level.levelgen.structures; -import com.anonymoushacker1279.immersiveweapons.ImmersiveWeapons; -import com.anonymoushacker1279.immersiveweapons.world.level.levelgen.Structures; import net.minecraft.core.BlockPos; -import net.minecraft.core.Registry; -import net.minecraft.resources.ResourceLocation; import net.minecraft.world.level.NoiseColumn; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.GenerationStep; import net.minecraft.world.level.levelgen.Heightmap; import net.minecraft.world.level.levelgen.feature.StructureFeature; import net.minecraft.world.level.levelgen.feature.configurations.JigsawConfiguration; -import net.minecraft.world.level.levelgen.feature.structures.JigsawPlacement; import net.minecraft.world.level.levelgen.structure.PoolElementStructurePiece; import net.minecraft.world.level.levelgen.structure.PostPlacementProcessor; import net.minecraft.world.level.levelgen.structure.pieces.PieceGenerator; import net.minecraft.world.level.levelgen.structure.pieces.PieceGeneratorSupplier; -import net.minecraft.world.level.levelgen.structure.pieces.PieceGeneratorSupplier.Context; +import net.minecraft.world.level.levelgen.structure.pools.JigsawPlacement; import org.jetbrains.annotations.NotNull; import java.util.Optional; public class PitfallTrapStructure extends StructureFeature { + static int landHeight; + public PitfallTrapStructure() { super(JigsawConfiguration.CODEC, context -> { if (!isFeatureChunk(context)) { @@ -43,34 +40,37 @@ private static boolean isFeatureChunk(PieceGeneratorSupplier.Context> createPiecesGenerator(PieceGeneratorSupplier.Context context) { + private static Optional> createPiecesGenerator( + PieceGeneratorSupplier.Context context) { + // Convert the chunk coordinates into actual coordinates can use. (center of that chunk) BlockPos blockPos = context.chunkPos().getMiddleBlockPosition(0); - JigsawConfiguration configuration = new JigsawConfiguration( - () -> context.registryAccess().ownedRegistryOrThrow(Registry.TEMPLATE_POOL_REGISTRY) - .get(new ResourceLocation(ImmersiveWeapons.MOD_ID, "pitfall_trap/start_pool")), - 5 //The structure is only one chunk wide but by using five here it can be replaced with something larger in datapacks + /* Generate pieces of the structure. + Second-to-last boolean is only for structure intersections. + Last boolean means the structure will automatically be placed at ground level. + */ + return JigsawPlacement.addPieces( + context, + PoolElementStructurePiece::new, + blockPos.atY(landHeight - 1), + false, + false ); - - // Create a new context with the new config that has our JSON pool. We will pass this into JigsawPlacement#addPieces - Context contextWithConfig = Structures.createContextWithConfig(context, configuration); - - // Return the piece generator that is now set up, so that the game runs it when it needs to create the layout of structure pieces. - // Last 'true' parameter means the structure will automatically be placed at ground level - return JigsawPlacement.addPieces(contextWithConfig, - PoolElementStructurePiece::new, blockPos.below(3), false, true); } } \ No newline at end of file diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/structures/UndergroundBunkerStructure.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/structures/UndergroundBunkerStructure.java index b62070dd6..9a58341ed 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/structures/UndergroundBunkerStructure.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/structures/UndergroundBunkerStructure.java @@ -1,28 +1,26 @@ package com.anonymoushacker1279.immersiveweapons.world.level.levelgen.structures; -import com.anonymoushacker1279.immersiveweapons.ImmersiveWeapons; -import com.anonymoushacker1279.immersiveweapons.world.level.levelgen.Structures; import net.minecraft.core.BlockPos; -import net.minecraft.core.Registry; -import net.minecraft.resources.ResourceLocation; import net.minecraft.world.level.NoiseColumn; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.GenerationStep; +import net.minecraft.world.level.levelgen.GenerationStep.Decoration; import net.minecraft.world.level.levelgen.Heightmap; import net.minecraft.world.level.levelgen.feature.StructureFeature; import net.minecraft.world.level.levelgen.feature.configurations.JigsawConfiguration; -import net.minecraft.world.level.levelgen.feature.structures.JigsawPlacement; import net.minecraft.world.level.levelgen.structure.PoolElementStructurePiece; import net.minecraft.world.level.levelgen.structure.PostPlacementProcessor; import net.minecraft.world.level.levelgen.structure.pieces.PieceGenerator; import net.minecraft.world.level.levelgen.structure.pieces.PieceGeneratorSupplier; -import net.minecraft.world.level.levelgen.structure.pieces.PieceGeneratorSupplier.Context; +import net.minecraft.world.level.levelgen.structure.pools.JigsawPlacement; import org.jetbrains.annotations.NotNull; import java.util.Optional; public class UndergroundBunkerStructure extends StructureFeature { + static int landHeight; + public UndergroundBunkerStructure() { super(JigsawConfiguration.CODEC, context -> { if (!isFeatureChunk(context)) { @@ -35,42 +33,49 @@ public UndergroundBunkerStructure() { @Override public GenerationStep.@NotNull Decoration step() { - return GenerationStep.Decoration.SURFACE_STRUCTURES; + return Decoration.SURFACE_STRUCTURES; } // Test if the current chunk (from context) has a valid location for the structure private static boolean isFeatureChunk(PieceGeneratorSupplier.Context context) { - BlockPos blockPos = context.chunkPos().getWorldPosition(); + BlockPos blockPos = context.chunkPos().getMiddleBlockPosition(0); + BlockPos diagonalPos = blockPos.offset(8, 0, 8); // Get height of land (stops at first non-air block) - int landHeight = context.chunkGenerator().getFirstOccupiedHeight(blockPos.getX(), blockPos.getZ(), Heightmap.Types.WORLD_SURFACE_WG, context.heightAccessor()); + landHeight = context.chunkGenerator().getFirstOccupiedHeight(blockPos.getX(), blockPos.getZ(), + Heightmap.Types.WORLD_SURFACE_WG, context.heightAccessor()); // Grabs the column of blocks at given position. - NoiseColumn columnOfBlocks = context.chunkGenerator().getBaseColumn(blockPos.getX(), blockPos.getZ(), context.heightAccessor()); - + NoiseColumn columnOfBlocks = context.chunkGenerator().getBaseColumn(blockPos.getX(), blockPos.getZ(), + context.heightAccessor()); + NoiseColumn columnOfBlocks2 = context.chunkGenerator().getBaseColumn(diagonalPos.getX(), diagonalPos.getZ(), + context.heightAccessor()); // Combine the column of blocks with land height, and get the top block itself which can be tested. - BlockState topBlock = columnOfBlocks.getBlock(landHeight); + BlockState topBlock = columnOfBlocks.getBlock(landHeight + 1); + BlockState baseBlock = columnOfBlocks.getBlock(landHeight - 6); + BlockState diagonalBlock = columnOfBlocks2.getBlock(landHeight); - // Now test to make sure the structure is not spawning on water or other fluids. - return topBlock.getFluidState().isEmpty(); + // Now test to make sure the structure is not spawning on water or other fluids, and has + // sufficient clearance. + return baseBlock.getFluidState().isEmpty() && !baseBlock.isAir() && topBlock.isAir() && !diagonalBlock.isAir(); } - private static Optional> createPiecesGenerator(PieceGeneratorSupplier.Context context) { + private static Optional> createPiecesGenerator( + PieceGeneratorSupplier.Context context) { + // Convert the chunk coordinates into actual coordinates can use. (center of that chunk) - BlockPos blockPos = context.chunkPos().getMiddleBlockPosition(0); + BlockPos blockPos = context.chunkPos().getWorldPosition().atY(landHeight - 4); - JigsawConfiguration configuration = new JigsawConfiguration( - () -> context.registryAccess().ownedRegistryOrThrow(Registry.TEMPLATE_POOL_REGISTRY) - .get(new ResourceLocation(ImmersiveWeapons.MOD_ID, "underground_bunker/start_pool")), - 5 //The structure is only one chunk wide but by using five here it can be replaced with something larger in datapacks + /* Generate pieces of the structure. + Second-to-last boolean is only for structure intersections. + Last boolean means the structure will automatically be placed at ground level. + */ + return JigsawPlacement.addPieces( + context, + PoolElementStructurePiece::new, + blockPos, + false, + false ); - - // Create a new context with the new config that has our JSON pool. We will pass this into JigsawPlacement#addPieces - Context contextWithConfig = Structures.createContextWithConfig(context, configuration); - - // Return the piece generator that is now set up, so that the game runs it when it needs to create the layout of structure pieces. - // Last 'true' parameter means the structure will automatically be placed at ground level - return JigsawPlacement.addPieces(contextWithConfig, - PoolElementStructurePiece::new, blockPos.below(5), false, true); } } \ No newline at end of file diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/structures/WaterTowerStructure.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/structures/WaterTowerStructure.java deleted file mode 100644 index b54898cd3..000000000 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/structures/WaterTowerStructure.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.anonymoushacker1279.immersiveweapons.world.level.levelgen.structures; - -import com.anonymoushacker1279.immersiveweapons.ImmersiveWeapons; -import com.anonymoushacker1279.immersiveweapons.world.level.levelgen.Structures; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Registry; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.level.NoiseColumn; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.levelgen.GenerationStep; -import net.minecraft.world.level.levelgen.Heightmap; -import net.minecraft.world.level.levelgen.feature.StructureFeature; -import net.minecraft.world.level.levelgen.feature.configurations.JigsawConfiguration; -import net.minecraft.world.level.levelgen.feature.structures.JigsawPlacement; -import net.minecraft.world.level.levelgen.structure.PoolElementStructurePiece; -import net.minecraft.world.level.levelgen.structure.PostPlacementProcessor; -import net.minecraft.world.level.levelgen.structure.pieces.PieceGenerator; -import net.minecraft.world.level.levelgen.structure.pieces.PieceGeneratorSupplier; -import net.minecraft.world.level.levelgen.structure.pieces.PieceGeneratorSupplier.Context; -import org.jetbrains.annotations.NotNull; - -import java.util.Optional; - -public class WaterTowerStructure extends StructureFeature { - - public WaterTowerStructure() { - super(JigsawConfiguration.CODEC, context -> { - if (!isFeatureChunk(context)) { - return Optional.empty(); - } else { - return createPiecesGenerator(context); - } - }, PostPlacementProcessor.NONE); - } - - @Override - public GenerationStep.@NotNull Decoration step() { - return GenerationStep.Decoration.SURFACE_STRUCTURES; - } - - // Test if the current chunk (from context) has a valid location for the structure - private static boolean isFeatureChunk(PieceGeneratorSupplier.Context context) { - BlockPos blockPos = context.chunkPos().getWorldPosition(); - - // Get height of land (stops at first non-air block) - int landHeight = context.chunkGenerator().getFirstOccupiedHeight(blockPos.getX(), blockPos.getZ(), Heightmap.Types.WORLD_SURFACE_WG, context.heightAccessor()); - - // Grabs the column of blocks at given position. - NoiseColumn columnOfBlocks = context.chunkGenerator().getBaseColumn(blockPos.getX(), blockPos.getZ(), context.heightAccessor()); - - // Combine the column of blocks with land height, and get the top block itself which can be tested. - BlockState topBlock = columnOfBlocks.getBlock(landHeight); - - // Now test to make sure the structure is not spawning on water or other fluids. - return topBlock.getFluidState().isEmpty(); - } - - private static Optional> createPiecesGenerator(PieceGeneratorSupplier.Context context) { - // Convert the chunk coordinates into actual coordinates can use. (center of that chunk) - BlockPos blockPos = context.chunkPos().getMiddleBlockPosition(0); - - JigsawConfiguration configuration = new JigsawConfiguration( - () -> context.registryAccess().ownedRegistryOrThrow(Registry.TEMPLATE_POOL_REGISTRY) - .get(new ResourceLocation(ImmersiveWeapons.MOD_ID, "water_tower/start_pool")), - 5 //The structure is only one chunk wide but by using five here it can be replaced with something larger in datapacks - ); - - // Create a new context with the new config that has our JSON pool. We will pass this into JigsawPlacement#addPieces - Context contextWithConfig = Structures.createContextWithConfig(context, configuration); - - // Return the piece generator that is now set up, so that the game runs it when it needs to create the layout of structure pieces. - // Last 'true' parameter means the structure will automatically be placed at ground level - return JigsawPlacement.addPieces(contextWithConfig, - PoolElementStructurePiece::new, blockPos.above(), false, true); - } -} \ No newline at end of file diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/surface/SurfaceRuleBuilder.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/surface/SurfaceRuleBuilder.java new file mode 100644 index 000000000..6dda62124 --- /dev/null +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/levelgen/surface/SurfaceRuleBuilder.java @@ -0,0 +1,155 @@ +package com.anonymoushacker1279.immersiveweapons.world.level.levelgen.surface; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import net.minecraft.resources.ResourceKey; +import net.minecraft.world.level.biome.Biome; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.levelgen.SurfaceRules; +import net.minecraft.world.level.levelgen.SurfaceRules.RuleSource; +import net.minecraft.world.level.levelgen.placement.CaveSurface; + +import java.util.*; +import java.util.function.Supplier; + +public class SurfaceRuleBuilder { + + public static final RuleSource[] RULE_SOURCES = new RuleSource[0]; + private static final Map RULES_CACHE = Maps.newHashMap(); + private static final SurfaceRuleBuilder INSTANCE = new SurfaceRuleBuilder(); + private final List rules = Lists.newArrayList(); + private SurfaceRuleEntry entryInstance; + private ResourceKey biomeKey; + + private SurfaceRuleBuilder() { + } + + public static SurfaceRuleBuilder start() { + INSTANCE.biomeKey = null; + INSTANCE.rules.clear(); + return INSTANCE; + } + + /** + * Restricts surface to only one biome. + * + * @param biomeKey {@link ResourceKey} for the {@link Biome}. + * @return same {@link SurfaceRuleBuilder} instance. + */ + public SurfaceRuleBuilder biome(ResourceKey biomeKey) { + this.biomeKey = biomeKey; + return this; + } + + /** + * Set biome surface with specified {@link BlockState}. Example - block of grass in the Overworld biomes + * + * @param state {@link BlockState} for the ground cover. + * @return same {@link SurfaceRuleBuilder} instance. + */ + public SurfaceRuleBuilder surface(BlockState state) { + entryInstance = getFromCache("surface_" + state.toString(), () -> { + RuleSource rule = SurfaceRules.state(state); + rule = SurfaceRules.ifTrue(SurfaceRules.ON_FLOOR, rule); + rule = SurfaceRules.ifTrue(SurfaceRules.waterBlockCheck(1, 0), rule); + rule = SurfaceRules.ifTrue(SurfaceRules.abovePreliminarySurface(), rule); + return new SurfaceRuleEntry(2, rule); + }); + rules.add(entryInstance); + return this; + } + + /** + * Set biome subsurface with specified {@link BlockState}. Example - dirt in the Overworld biomes. + * + * @param state {@link BlockState} for the subterranean layer. + * @param depth block layer depth. + * @return same {@link SurfaceRuleBuilder} instance. + */ + public SurfaceRuleBuilder subsurface(BlockState state, int depth) { + entryInstance = getFromCache("subsurface_" + depth + "_" + state.toString(), () -> { + RuleSource rule = SurfaceRules.state(state); + rule = SurfaceRules.ifTrue(SurfaceRules.stoneDepthCheck(depth, false, 0, CaveSurface.FLOOR), rule); + rule = SurfaceRules.ifTrue(SurfaceRules.waterBlockCheck(1, 0), rule); + rule = SurfaceRules.ifTrue(SurfaceRules.abovePreliminarySurface(), rule); + return new SurfaceRuleEntry(3, rule); + }); + rules.add(entryInstance); + return this; + } + + /** + * Set biome filler with specified {@link BlockState}. Example - stone in the Overworld biomes. The rule is added with priority 10. + * + * @param state {@link BlockState} for filling. + * @return same {@link SurfaceRuleBuilder} instance. + */ + public SurfaceRuleBuilder filler(BlockState state) { + entryInstance = getFromCache("fill_" + state.toString(), () -> new SurfaceRuleEntry(10, SurfaceRules.state(state))); + rules.add(entryInstance); + return this; + } + + /** + * Finalize rule building process. + * + * @return {@link SurfaceRules.RuleSource}. + */ + public SurfaceRules.RuleSource build() { + Collections.sort(rules); + List ruleList = rules.stream().map(SurfaceRuleEntry::getRule).toList(); + SurfaceRules.RuleSource[] ruleArray = ruleList.toArray(RULE_SOURCES); + SurfaceRules.RuleSource rule = SurfaceRules.sequence(ruleArray); + if (biomeKey != null) { + rule = SurfaceRules.ifTrue(SurfaceRules.isBiome(biomeKey), rule); + } + return rule; + } + + /** + * Internal function, will take entry from cache or create it if necessary. + * + * @param name {@link String} entry internal name. + * @param supplier {@link Supplier} for {@link SurfaceRuleEntry}. + * @return new or existing {@link SurfaceRuleEntry}. + */ + private static SurfaceRuleEntry getFromCache(String name, Supplier supplier) { + SurfaceRuleEntry entry = RULES_CACHE.get(name); + if (entry == null) { + entry = supplier.get(); + RULES_CACHE.put(name, entry); + } + return entry; + } + + /** + * Allows adding a custom rule. + * + * @param priority rule priority, lower values = higher priority (rule will be applied before others). + * @param rule custom {@link SurfaceRules.RuleSource}. + * @return same {@link SurfaceRuleBuilder} instance. + */ + public SurfaceRuleBuilder rule(int priority, SurfaceRules.RuleSource rule) { + rules.add(new SurfaceRuleEntry(priority, rule)); + return this; + } + + public static class SurfaceRuleEntry implements Comparable { + private final SurfaceRules.RuleSource rule; + private final byte priority; + + public SurfaceRuleEntry(int priority, SurfaceRules.RuleSource rule) { + this.priority = (byte) priority; + this.rule = rule; + } + + protected SurfaceRules.RuleSource getRule() { + return rule; + } + + @Override + public int compareTo(SurfaceRuleEntry entry) { + return Integer.compare(priority, entry.priority); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/loot/LogShardsLootModifierHandler.java b/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/loot/LogShardsLootModifierHandler.java index aaf8bd4af..0c605cf10 100644 --- a/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/loot/LogShardsLootModifierHandler.java +++ b/src/main/java/com/anonymoushacker1279/immersiveweapons/world/level/loot/LogShardsLootModifierHandler.java @@ -52,7 +52,7 @@ public class LogShardsLootModifierHandler extends LootModifier { // int numShards = 0; for (ItemStack stack : generatedLoot) { - if (stack.is(ItemTags.bind(blockTag))) { + if (stack.is(ItemTags.create(new ResourceLocation(blockTag)))) { numShards += stack.getCount() + GeneralUtilities.getRandomNumber(2, 5); } } diff --git a/src/main/resources/META-INF/accesstransformer.cfg b/src/main/resources/META-INF/accesstransformer.cfg index 36b11767c..28c8d7473 100644 --- a/src/main/resources/META-INF/accesstransformer.cfg +++ b/src/main/resources/META-INF/accesstransformer.cfg @@ -1,7 +1,3 @@ -public-f net.minecraft.world.level.levelgen.feature.StructureFeature f_67031_ #NOISE_AFFECTING_FEATURES -public-f net.minecraft.world.level.levelgen.StructureSettings f_64580_ #DEFAULTS -public-f net.minecraft.world.level.levelgen.StructureSettings f_64582_ #structureConfig -public-f net.minecraft.world.level.levelgen.StructureSettings f_189361_ #configuredStructures public net.minecraft.world.entity.projectile.AbstractArrow f_36698_ #AbstractArrowEntity-damage public net.minecraft.world.entity.projectile.AbstractArrow m_36798_()Z #AbstractArrowEntity-shouldFall public net.minecraft.world.entity.projectile.AbstractArrow m_36799_()V #AbstractArrowEntity-startFalling @@ -12,4 +8,5 @@ public-f net.minecraft.world.item.AxeItem f_150683_ #STRIPPABLES public net.minecraft.world.entity.vehicle.Boat f_38285_ #DATA_ID_TYPE public net.minecraft.world.entity.Entity f_19819_ #PortalEntrancePos public net.minecraft.client.renderer.DimensionSpecialEffects f_108857_ #EFFECTS -public net.minecraft.data.models.model.ModelTemplate f_125585_ #model \ No newline at end of file +public net.minecraft.data.models.model.ModelTemplate f_125585_ #model +public net.minecraft.tags.BiomeTags m_207630_(Ljava/lang/String;)Lnet/minecraft/tags/TagKey; #create \ No newline at end of file diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 79e0e4524..e2da9b72e 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -1,5 +1,5 @@ modLoader = "javafml" #mandatory -loaderVersion = "[39,)" #mandatory +loaderVersion = "[40,)" #mandatory license = "MIT" issueTrackerURL = "https://github.com/AnonymousHacker1279/ImmersiveWeapons/issues" #optional @@ -8,7 +8,7 @@ modId = "immersiveweapons" #mandatory version = "${file.jarVersion}" #mandatory displayName = "Immersive Weapons" #mandatory displayURL = "https://www.curseforge.com/minecraft/mc-mods/immersive-weapons" #optional -updateJSONURL = "https://raw.githubusercontent.com/AnonymousHacker1279/ImmersiveWeapons/1.14.0-update-indev/update.json" +updateJSONURL = "https://raw.githubusercontent.com/AnonymousHacker1279/ImmersiveWeapons/1.18.x-dev/update.json" logoFile = "logo.png" #optional credits = "Written by AnonymousHacker1279 and visually designed with the help of Jonny-fox and gamingwarrior68 with pain and suffering" #optional authors = "AnonymousHacker1279" #optional @@ -19,20 +19,27 @@ Immersive Weapons is more than just a weapons mod aiming to spice up your combat [[dependencies.immersiveweapons]] #optional modId = "forge" #mandatory mandatory = true #mandatory -versionRange = "[39.0.55,)" #mandatory +versionRange = "[40.0.0,)" #mandatory ordering = "NONE" side = "BOTH" [[dependencies.immersiveweapons]] modId = "minecraft" mandatory = true -versionRange = "[1.18.1,1.19)" +versionRange = "[1.18.2,1.19)" ordering = "NONE" side = "BOTH" [[dependencies.immersiveweapons]] modId = "patchouli" mandatory = false -versionRange = "[1.18.1-64,)" +versionRange = "[1.18.2-66,)" +ordering = "NONE" +side = "BOTH" + +[[dependencies.immersiveweapons]] +modId = "terrablender" +mandatory = true +versionRange = "[1.18.2-1.1.0.99,)" ordering = "NONE" side = "BOTH" \ No newline at end of file diff --git a/src/main/resources/assets/immersiveweapons/lang/en_us.json b/src/main/resources/assets/immersiveweapons/lang/en_us.json index f49fca573..91e17fa08 100644 --- a/src/main/resources/assets/immersiveweapons/lang/en_us.json +++ b/src/main/resources/assets/immersiveweapons/lang/en_us.json @@ -158,6 +158,7 @@ "item.immersiveweapons.celestial_tower_spawn_egg": "Celestial Tower Spawn Egg", "item.immersiveweapons.celestial_fragment": "Celestial Fragment", "item.immersiveweapons.encyclopedia": "Encyclopedia", + "item.immersiveweapons.lorebook": "Oppslukende Legender", "block.immersiveweapons.molten_ore": "Molten Ore", "block.immersiveweapons.molten_block": "Molten Block", "block.immersiveweapons.electric_ore": "Electric Ore", @@ -601,49 +602,13 @@ "loot.immersiveweapons.chest.village.battlefield.medic_station.iron_axe": "The Amputator", "immersiveweapons.boss.celestial_tower.waves": "Wave %s of %s", "immersiveweapons.encyclopedia.landing": "Immersive Weapons is $(m)a weapons mod$() more than just a weapons mod aiming to spice up your combat skills.$(br2)The Encyclopedia is your go-to solution for finding information.", + "immersiveweapons.lorebook.landing": "The secrets of the universe, as described by me, Hans.", "config.immersiveweapons.tesla_armor_effect_sound": "Enable the Tesla Armor effect sound - Default true", "config.immersiveweapons.panic_alarm_range": "Set the range of the Panic Alarm's sound - Default 48", "config.immersiveweapons.max_smoke_bomb_particles": "Set the maximum number of particles produced by the smoke bomb - Default 96\nSetting this higher can make clients laggy, setting to 0 effectively disables it", "config.immersiveweapons.bullets_break_glass": "Enable bullets breaking glass - Default true", "config.immersiveweapons.tiltros_enabled": "Enable the Tiltros dimension portal - Default true", - "config.immersiveweapons.dying_soldier_spawn": "Enable the natural spawning of Dying Soldiers - Default true", - "config.immersiveweapons.wandering_warrior_spawn": "Enable the natural spawning of Wandering Warriors - Default true", - "config.immersiveweapons.hans_spawn": "Enable the natural spawning of Hans the Almighty - Default true", - "config.immersiveweapons.lava_revenant_spawn": "Enable the natural spawning of Lava Revenants - Default true", - "config.immersiveweapons.rock_spider_spawn": "Enable the natural spawning of Rock Spiders - Default true", - "config.immersiveweapons.celestial_tower_spawn": "Enable the natural spawning of Celestial Towers - Default true", - "config.immersiveweapons.celestial_tower_xz_spawn_check_radius": "Set the X and Z spawn checking radius for the Celestial Tower.\nSetting this higher will negatively impact server ticks in Tiltros, but make Celestial Lanterns more effective - Default 56", - "config.immersiveweapons.celestial_tower_y_spawn_check_radius": "Set the Y spawn checking radius for the Celestial Tower.\nSetting this higher will negatively impact server ticks in Tiltros, but make Celestial Lanterns more effective - Default 20", + "config.immersiveweapons.celestial_tower_spawn_check_radius": "Set the spawn checking radius for the Celestial Tower.\nSetting this higher may slightly negatively impact server ticks in Tiltros, but make Celestial Lanterns more effective - Default 128", "config.immersiveweapons.celestial_tower_minions_wave_size_modifier": "Multiplier to change the wave size from Celestial Tower summons.\nSet less than 1 to reduce, greater than 1 to increase.\nIncreasing the wave size will negatively affect the server ticks in Tiltros. - Default 1.0", - "config.immersiveweapons.max_abandoned_factory_distance": "Maximum distance in chunks between Abandoned Factories - Default 120", - "config.immersiveweapons.min_abandoned_factory_distance": "Minimum distance in chunks between Abandoned Factories - Default 90", - "config.immersiveweapons.max_pitfall_trap_distance": "Maximum distance in chunks between Pitfall Traps - Default 8", - "config.immersiveweapons.min_pitfall_trap_distance": "Minimum distance in chunks between Pitfall Traps - Default 2", - "config.immersiveweapons.max_bear_trap_distance": "Maximum distance in chunks between Bear Traps - Default 10", - "config.immersiveweapons.min_bear_trap_distance": "Minimum distance in chunks between Bear Traps - Default 4", - "config.immersiveweapons.max_landmine_trap_distance": "Maximum distance in chunks between Landmine Traps - Default 12", - "config.immersiveweapons.min_landmine_trap_distance": "Minimum distance in chunks between Landmine Traps - Default 6", - "config.immersiveweapons.max_underground_bunker_distance": "Maximum distance in chunks between Underground Bunkers - Default 110", - "config.immersiveweapons.min_underground_bunker_distance": "Minimum distance in chunks between Underground Bunkers - Default 80", - "config.immersiveweapons.max_battlefield_camp_distance": "Maximum distance in chunks between Battlefield Camps - Default 16", - "config.immersiveweapons.min_battlefield_camp_distance": "Minimum distance in chunks between Battlefield Camps - Default 4", - "config.immersiveweapons.max_cloud_island_distance": "Maximum distance in chunks between Cloud Islands - Default 90", - "config.immersiveweapons.min_cloud_island_distance": "Minimum distance in chunks between Cloud Islands - Default 70", - "config.immersiveweapons.max_campsite_distance": "Maximum distance in chunks between Campsites - Default 50", - "config.immersiveweapons.min_campsite_distance": "Minimum distance in chunks between Campsites - Default 30", - "config.immersiveweapons.max_battlefield_house_distance": "Maximum distance in chunks between Battlefield Houses - Default 12", - "config.immersiveweapons.min_battlefield_house_distance": "Minimum distance in chunks between Battlefield Houses - Default 4", - "config.immersiveweapons.max_outhouse_distance": "Maximum distance in chunks between Outhouses - Default 40", - "config.immersiveweapons.min_outhouse_distance": "Minimum distance in chunks between Outhouses - Default 20", - "config.immersiveweapons.max_water_tower_distance": "Maximum distance in chunks between Water Towers - Default 30", - "config.immersiveweapons.min_water_tower_distance": "Minimum distance in chunks between Water Towers - Default 12", - "config.immersiveweapons.max_graveyard_distance": "Maximum distance in chunks between Graveyards - Default 50", - "config.immersiveweapons.min_graveyard_distance": "Minimum distance in chunks between Graveyards - Default 30", - "config.immersiveweapons.molten_ore_config": "Configuration for Molten Ore. Specified as a list. [ore_per_vein, veins_per_chunk, max_y]. Default: [4, 8, 64]", - "config.immersiveweapons.nether_sulfur_ore_config": "Configuration for Nether Sulfur Ore. Specified as a list. [ore_per_vein, veins_per_chunk]. Default: [12, 16]", - "config.immersiveweapons.sulfur_ore_config": "Configuration for Sulfur Ore. Specified as a list. [ore_per_vein, veins_per_chunk]. Default: [8, 14]", - "config.immersiveweapons.cobalt_ore_config": "Configuration for Cobalt Ore. Specified as a list. [ore_per_vein, veins_per_chunk, blocks_below_top]. Default: [6, 12, 24]", - "config.immersiveweapons.deepslate_sulfur_ore_config": "Configuration for Deepslate Sulfur Ore. Specified as a list. [ore_per_vein, veins_per_chunk]. Default: [8, 14]", - "config.immersiveweapons.deepslate_cobalt_ore_config": "Configuration for Deepslate Cobalt Ore. Specified as a list. [ore_per_vein, veins_per_chunk]. Default: [8, 16]", "itemGroup.immersiveweapons": "Immersive Weapons" } \ No newline at end of file diff --git a/src/main/resources/assets/immersiveweapons/models/item/encyclopedia.json b/src/main/resources/assets/immersiveweapons/models/item/encyclopedia.json index 07d4bb4be..f4e924d0b 100644 --- a/src/main/resources/assets/immersiveweapons/models/item/encyclopedia.json +++ b/src/main/resources/assets/immersiveweapons/models/item/encyclopedia.json @@ -1,6 +1,6 @@ { "credit": "Made with Blockbench", - "texture_size": [196, 196], + "texture_size": [256, 256], "textures": { "0": "immersiveweapons:item/encyclopedia", "particle": "immersiveweapons:item/encyclopedia" @@ -11,12 +11,12 @@ "from": [6, 0, 3], "to": [10, 10, 4], "faces": { - "north": {"uv": [0, 0, 3.02959, 7.57396], "texture": "#0"}, - "east": {"uv": [2.93491, 0, 3.69231, 7.47929], "texture": "#0"}, - "south": {"uv": [0, 0, 3.02959, 7.47929], "texture": "#0"}, - "west": {"uv": [2.93491, 0, 3.69231, 7.57396], "texture": "#0"}, - "up": {"uv": [0, 7.47929, 3.02959, 8.23669], "texture": "#0"}, - "down": {"uv": [0, 7.47929, 3.02959, 8.23669], "texture": "#0"} + "north": {"uv": [0, 0, 2, 4.9375], "texture": "#0"}, + "east": {"uv": [0.79974, 0, 0.79974, 0], "texture": "#0"}, + "south": {"uv": [0, 0, 2, 4.9375], "texture": "#0"}, + "west": {"uv": [1.9375, 0, 2.4375, 5], "texture": "#0", "cullface": "west"}, + "up": {"uv": [0, 4.9375, 2, 5.4375], "texture": "#0", "cullface": "up"}, + "down": {"uv": [0, 4.9375, 2, 5.4375], "texture": "#0"} } }, { @@ -24,12 +24,12 @@ "from": [6, 0, 4], "to": [7, 10, 14], "faces": { - "north": {"uv": [0, 0, 1, 10], "texture": "#0"}, - "east": {"uv": [3.59763, 0, 11.1716, 7.57396], "texture": "#0"}, - "south": {"uv": [2.93491, 0, 3.69231, 7.57396], "texture": "#0"}, - "west": {"uv": [3.59763, 0, 11.1716, 7.57396], "texture": "#0"}, - "up": {"uv": [2.93491, 0, 3.65657, 6.53061], "texture": "#0"}, - "down": {"uv": [2.93491, 0, 3.69231, 7.57396], "texture": "#0"} + "north": {"uv": [0, 0, 0, 0], "texture": "#0"}, + "east": {"uv": [2.375, 0, 7.375, 5], "texture": "#0"}, + "south": {"uv": [1.9375, 0, 2.4375, 5], "texture": "#0", "cullface": "south"}, + "west": {"uv": [2.375, 0, 7.375, 5], "texture": "#0", "cullface": "west"}, + "up": {"uv": [1.9375, 0, 2.4375, 5], "texture": "#0"}, + "down": {"uv": [1.9375, 0, 2.4375, 5], "texture": "#0"} } }, { @@ -37,12 +37,12 @@ "from": [9, 0, 4], "to": [10, 10, 14], "faces": { - "north": {"uv": [0, 0, 1, 10], "texture": "#0"}, - "east": {"uv": [3.69231, 7.57396, 11.26627, 15.14793], "texture": "#0"}, - "south": {"uv": [2.93492, 0, 3.69231, 7.57396], "texture": "#0"}, - "west": {"uv": [3.78698, 7.57396, 11.26627, 15.14793], "texture": "#0"}, - "up": {"uv": [2.93492, 0, 3.69231, 7.57396], "texture": "#0"}, - "down": {"uv": [2.93491, 0, 3.69231, 7.57396], "texture": "#0"} + "north": {"uv": [0, 0, 0, 0], "texture": "#0"}, + "east": {"uv": [2.4375, 5, 7.4375, 10], "texture": "#0", "cullface": "east"}, + "south": {"uv": [1.9375, 0, 2.4375, 5], "texture": "#0", "cullface": "south"}, + "west": {"uv": [2.4375, 5, 7.4375, 10], "texture": "#0", "cullface": "west"}, + "up": {"uv": [1.9375, 0, 2.4375, 5], "texture": "#0"}, + "down": {"uv": [1.9375, 0, 2.4375, 5], "texture": "#0"} } }, { @@ -50,12 +50,12 @@ "from": [7, 0.25, 4], "to": [9, 9.75, 13.75], "faces": { - "north": {"uv": [0, 0, 2, 9.5], "texture": "#0"}, - "east": {"uv": [0, 0, 9.75, 9.5], "texture": "#0"}, - "south": {"uv": [0, 8.23669, 3.69231, 9.75148], "rotation": 270, "texture": "#0"}, - "west": {"uv": [0, 0, 9.75, 9.5], "texture": "#0"}, - "up": {"uv": [0, 8.23669, 3.69231, 9.75148], "rotation": 270, "texture": "#0"}, - "down": {"uv": [0, 8.23669, 3.69231, 9.75148], "rotation": 270, "texture": "#0"} + "north": {"uv": [0, 0, 0, 0], "texture": "#0"}, + "east": {"uv": [0, 0, 0, 0], "texture": "#0"}, + "south": {"uv": [0, 5.4375, 2.4375, 6.4375], "rotation": 270, "texture": "#0"}, + "west": {"uv": [0, 0, 0, 0], "texture": "#0", "cullface": "west"}, + "up": {"uv": [0, 5.4375, 2.4375, 6.4375], "rotation": 270, "texture": "#0", "cullface": "up"}, + "down": {"uv": [0, 5.4375, 2.4375, 6.4375], "rotation": 270, "texture": "#0"} } } ], diff --git a/src/main/resources/assets/immersiveweapons/models/item/lorebook.json b/src/main/resources/assets/immersiveweapons/models/item/lorebook.json new file mode 100644 index 000000000..60d4f971c --- /dev/null +++ b/src/main/resources/assets/immersiveweapons/models/item/lorebook.json @@ -0,0 +1,100 @@ +{ + "credit": "Made with Blockbench", + "texture_size": [256, 256], + "textures": { + "0": "immersiveweapons:item/lorebook", + "particle": "immersiveweapons:item/lorebook" + }, + "elements": [ + { + "name": "spine", + "from": [6, 0, 3], + "to": [10, 10, 4], + "faces": { + "north": {"uv": [0, 0, 2, 4.9375], "texture": "#0"}, + "east": {"uv": [2, 0.0625, 2.375, 5], "texture": "#0"}, + "south": {"uv": [0, 0, 2, 4.9375], "texture": "#0"}, + "west": {"uv": [2, 0, 2.375, 5], "texture": "#0", "cullface": "west"}, + "up": {"uv": [0, 4.9375, 2, 5.4375], "texture": "#0", "cullface": "up"}, + "down": {"uv": [0, 5, 2, 5.4375], "texture": "#0"} + } + }, + { + "name": "cover", + "from": [6, 0, 4], + "to": [7, 10, 14], + "faces": { + "north": {"uv": [0, 0, 0, 0], "texture": "#0"}, + "east": {"uv": [2.375, 0, 7.375, 5], "texture": "#0"}, + "south": {"uv": [1.9375, 0, 2.4375, 5], "texture": "#0", "cullface": "south"}, + "west": {"uv": [2.375, 0, 7.375, 5], "texture": "#0", "cullface": "west"}, + "up": {"uv": [1.9375, 0, 2.4375, 5], "texture": "#0"}, + "down": {"uv": [1.9375, 0, 2.4375, 5], "texture": "#0"} + } + }, + { + "name": "cover", + "from": [9, 0, 4], + "to": [10, 10, 14], + "faces": { + "north": {"uv": [0, 0, 0, 0], "texture": "#0"}, + "east": {"uv": [2.4375, 5, 7.4375, 10], "texture": "#0", "cullface": "east"}, + "south": {"uv": [1.9375, 0, 2.4375, 5], "texture": "#0", "cullface": "south"}, + "west": {"uv": [2.4375, 5, 7.4375, 10], "texture": "#0", "cullface": "west"}, + "up": {"uv": [1.9375, 0, 2.4375, 5], "texture": "#0"}, + "down": {"uv": [1.9375, 0, 2.4375, 5], "texture": "#0"} + } + }, + { + "name": "pages", + "from": [7, 0.25, 4], + "to": [9, 9.75, 13.75], + "faces": { + "north": {"uv": [0, 0, 0, 0], "texture": "#0"}, + "east": {"uv": [0, 0, 0, 0], "texture": "#0"}, + "south": {"uv": [0, 5.4375, 2.4375, 6.4375], "rotation": 270, "texture": "#0"}, + "west": {"uv": [0, 0, 0, 0], "texture": "#0", "cullface": "west"}, + "up": {"uv": [0, 5.4375, 2.4375, 6.4375], "rotation": 270, "texture": "#0", "cullface": "up"}, + "down": {"uv": [0, 5.4375, 2.4375, 6.4375], "rotation": 270, "texture": "#0"} + } + } + ], + "display": { + "thirdperson_righthand": { + "scale": [0.5, 0.5, 0.5] + }, + "thirdperson_lefthand": { + "scale": [0.5, 0.5, 0.5] + }, + "firstperson_righthand": { + "rotation": [0, 16.25, 0], + "translation": [0, 3.75, 1.5], + "scale": [0.5, 0.5, 0.5] + }, + "firstperson_lefthand": { + "rotation": [0, 16.25, 0], + "translation": [0, 3.75, 1.5], + "scale": [0.5, 0.5, 0.5] + }, + "ground": { + "translation": [0, 0.75, 0], + "scale": [0.5, 0.5, 0.5] + }, + "gui": { + "rotation": [12.75, 120, 0], + "translation": [-0.25, 2.75, 0] + }, + "fixed": { + "rotation": [0, -90, 0], + "translation": [0.5, 3, -0.5] + } + }, + "groups": [ + { + "name": "book", + "origin": [8, 8, 8], + "color": 0, + "children": [0, 1, 2, 3] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/immersiveweapons/textures/item/encyclopedia.png b/src/main/resources/assets/immersiveweapons/textures/item/encyclopedia.png index 3f4e1b915..c9274bcb1 100644 Binary files a/src/main/resources/assets/immersiveweapons/textures/item/encyclopedia.png and b/src/main/resources/assets/immersiveweapons/textures/item/encyclopedia.png differ diff --git a/src/main/resources/assets/immersiveweapons/textures/item/lorebook.png b/src/main/resources/assets/immersiveweapons/textures/item/lorebook.png new file mode 100644 index 000000000..6e137a25f Binary files /dev/null and b/src/main/resources/assets/immersiveweapons/textures/item/lorebook.png differ diff --git a/src/main/resources/data/immersiveweapons/dimension/tiltros.json b/src/main/resources/data/immersiveweapons/dimension/tiltros.json new file mode 100644 index 000000000..100deeceb --- /dev/null +++ b/src/main/resources/data/immersiveweapons/dimension/tiltros.json @@ -0,0 +1,13 @@ +{ + "type": "immersiveweapons:tiltros", + "generator": { + "type": "minecraft:noise", + "seed": 2031154856, + "settings": "immersiveweapons:tiltros", + "biome_source": { + "type": "minecraft:fixed", + "biome": "immersiveweapons:tiltros" + } + }, + "forge:use_server_seed": true +} \ No newline at end of file diff --git a/src/main/resources/data/immersiveweapons/dimension_type/tiltros.json b/src/main/resources/data/immersiveweapons/dimension_type/tiltros.json new file mode 100644 index 000000000..dc13d3217 --- /dev/null +++ b/src/main/resources/data/immersiveweapons/dimension_type/tiltros.json @@ -0,0 +1,17 @@ +{ + "ultrawarm": false, + "natural": true, + "piglin_safe": false, + "respawn_anchor_works": false, + "bed_works": true, + "has_raids": false, + "has_skylight": false, + "has_ceiling": false, + "coordinate_scale": 16, + "ambient_light": 0.2, + "logical_height": 192, + "effects": "immersiveweapons:tiltros", + "infiniburn": "#minecraft:infiniburn_overworld", + "min_y": -64, + "height": 256 +} \ No newline at end of file diff --git a/src/main/resources/data/immersiveweapons/patchouli_books/lorebook/book.json b/src/main/resources/data/immersiveweapons/patchouli_books/lorebook/book.json new file mode 100644 index 000000000..d64b1a513 --- /dev/null +++ b/src/main/resources/data/immersiveweapons/patchouli_books/lorebook/book.json @@ -0,0 +1,12 @@ +{ + "name": "item.immersiveweapons.lorebook", + "landing_text": "immersiveweapons.lorebook.landing", + "subtitle": "Version: ${build_version}", + "model": "immersiveweapons:lorebook", + "nameplate_color:": "33452f", + "progress_bar_color": "B9F3AB", + "progress_bar_background": "88745a", + "creative_tab": "immersiveweapons", + "advancements_tab": "immersiveweapons", + "book_texture": "patchouli:textures/gui/book_green.png" +} \ No newline at end of file diff --git a/src/main/resources/data/immersiveweapons/patchouli_books/lorebook/categories/neutral_creatures.json b/src/main/resources/data/immersiveweapons/patchouli_books/lorebook/categories/neutral_creatures.json new file mode 100644 index 000000000..fa95386f7 --- /dev/null +++ b/src/main/resources/data/immersiveweapons/patchouli_books/lorebook/categories/neutral_creatures.json @@ -0,0 +1,5 @@ +{ + "name": "Neutral Creatures", + "description": "Not every creature wants you dead on sight, but they'll still put up a fight if you attack them first.", + "icon": "immersiveweapons:copper_arrow" +} \ No newline at end of file diff --git a/src/main/resources/data/immersiveweapons/structures/battlefield_house/house_1.nbt b/src/main/resources/data/immersiveweapons/structures/battlefield_house/house_1.nbt deleted file mode 100644 index 8f816039b..000000000 Binary files a/src/main/resources/data/immersiveweapons/structures/battlefield_house/house_1.nbt and /dev/null differ diff --git a/src/main/resources/data/immersiveweapons/structures/battlefield_house/house_2.nbt b/src/main/resources/data/immersiveweapons/structures/battlefield_house/house_2.nbt deleted file mode 100644 index 70a15b324..000000000 Binary files a/src/main/resources/data/immersiveweapons/structures/battlefield_house/house_2.nbt and /dev/null differ diff --git a/src/main/resources/data/immersiveweapons/structures/battlefield_town.nbt b/src/main/resources/data/immersiveweapons/structures/battlefield_town.nbt new file mode 100644 index 000000000..1090ef595 Binary files /dev/null and b/src/main/resources/data/immersiveweapons/structures/battlefield_town.nbt differ diff --git a/src/main/resources/data/immersiveweapons/structures/destroyed_house/house_1.nbt b/src/main/resources/data/immersiveweapons/structures/destroyed_house/house_1.nbt new file mode 100644 index 000000000..765544363 Binary files /dev/null and b/src/main/resources/data/immersiveweapons/structures/destroyed_house/house_1.nbt differ diff --git a/src/main/resources/data/immersiveweapons/structures/destroyed_house/house_2.nbt b/src/main/resources/data/immersiveweapons/structures/destroyed_house/house_2.nbt new file mode 100644 index 000000000..c35b566ab Binary files /dev/null and b/src/main/resources/data/immersiveweapons/structures/destroyed_house/house_2.nbt differ diff --git a/src/main/resources/data/immersiveweapons/structures/graveyard.nbt b/src/main/resources/data/immersiveweapons/structures/graveyard.nbt index 81284ea55..852474368 100644 Binary files a/src/main/resources/data/immersiveweapons/structures/graveyard.nbt and b/src/main/resources/data/immersiveweapons/structures/graveyard.nbt differ diff --git a/src/main/resources/data/immersiveweapons/structures/hans_hut.nbt b/src/main/resources/data/immersiveweapons/structures/hans_hut.nbt new file mode 100644 index 000000000..380e3b6a9 Binary files /dev/null and b/src/main/resources/data/immersiveweapons/structures/hans_hut.nbt differ diff --git a/src/main/resources/data/immersiveweapons/structures/house_1.nbt b/src/main/resources/data/immersiveweapons/structures/house_1.nbt deleted file mode 100644 index f956b366f..000000000 Binary files a/src/main/resources/data/immersiveweapons/structures/house_1.nbt and /dev/null differ diff --git a/src/main/resources/data/immersiveweapons/structures/house_2.nbt b/src/main/resources/data/immersiveweapons/structures/house_2.nbt deleted file mode 100644 index 70a15b324..000000000 Binary files a/src/main/resources/data/immersiveweapons/structures/house_2.nbt and /dev/null differ diff --git a/src/main/resources/data/immersiveweapons/structures/outhouse.nbt b/src/main/resources/data/immersiveweapons/structures/outhouse.nbt deleted file mode 100644 index 158d677d0..000000000 Binary files a/src/main/resources/data/immersiveweapons/structures/outhouse.nbt and /dev/null differ diff --git a/src/main/resources/data/immersiveweapons/structures/pitfall_trap.nbt b/src/main/resources/data/immersiveweapons/structures/pitfall_trap.nbt index 7784698fb..137f45886 100644 Binary files a/src/main/resources/data/immersiveweapons/structures/pitfall_trap.nbt and b/src/main/resources/data/immersiveweapons/structures/pitfall_trap.nbt differ diff --git a/src/main/resources/data/immersiveweapons/structures/underground_bunker.nbt b/src/main/resources/data/immersiveweapons/structures/underground_bunker.nbt index 7f5ad1e91..3d5dc7ddc 100644 Binary files a/src/main/resources/data/immersiveweapons/structures/underground_bunker.nbt and b/src/main/resources/data/immersiveweapons/structures/underground_bunker.nbt differ diff --git a/src/main/resources/data/immersiveweapons/structures/village/battlefield/houses/medic_station.nbt b/src/main/resources/data/immersiveweapons/structures/village/battlefield/houses/medic_station.nbt deleted file mode 100644 index 6a426fd9f..000000000 Binary files a/src/main/resources/data/immersiveweapons/structures/village/battlefield/houses/medic_station.nbt and /dev/null differ diff --git a/src/main/resources/data/immersiveweapons/structures/village/battlefield/houses/soldier_post.nbt b/src/main/resources/data/immersiveweapons/structures/village/battlefield/houses/soldier_post.nbt deleted file mode 100644 index 8d0f39f9c..000000000 Binary files a/src/main/resources/data/immersiveweapons/structures/village/battlefield/houses/soldier_post.nbt and /dev/null differ diff --git a/src/main/resources/data/immersiveweapons/structures/water_tower.nbt b/src/main/resources/data/immersiveweapons/structures/water_tower.nbt index 94f4949bd..a47a60d5d 100644 Binary files a/src/main/resources/data/immersiveweapons/structures/water_tower.nbt and b/src/main/resources/data/immersiveweapons/structures/water_tower.nbt differ diff --git a/src/main/resources/data/immersiveweapons/worldgen/biome/battlefield.json b/src/main/resources/data/immersiveweapons/worldgen/biome/battlefield.json new file mode 100644 index 000000000..4479a6ad6 --- /dev/null +++ b/src/main/resources/data/immersiveweapons/worldgen/biome/battlefield.json @@ -0,0 +1,198 @@ +{ + "temperature": 0.8, + "downfall": 0.3, + "precipitation": "rain", + "temperature_modifier": "none", + "category": "plains", + "effects": { + "sky_color": 7628662, + "fog_color": 9464960, + "water_color": 5580620, + "water_fog_color": 5258098, + "grass_color": 5576464, + "foliage_color": 4468277, + "grass_color_modifier": "none", + "ambient_sound": "immersiveweapons:battlefield_ambient", + "mood_sound": { + "sound": "immersiveweapons:flintlock_pistol_fire", + "tick_delay": 1200, + "block_search_extent": 8, + "offset": 15 + } + }, + "spawners": { + "monster": [ + { + "type": "immersiveweapons:dying_soldier", + "weight": 95, + "minCount": 2, + "maxCount": 6 + }, + { + "type": "immersiveweapons:wandering_warrior", + "weight": 75, + "minCount": 1, + "maxCount": 1 + }, + { + "type": "minecraft:spider", + "weight": 100, + "minCount": 4, + "maxCount": 4 + }, + { + "type": "minecraft:zombie", + "weight": 95, + "minCount": 4, + "maxCount": 4 + }, + { + "type": "minecraft:zombie_villager", + "weight": 5, + "minCount": 1, + "maxCount": 1 + }, + { + "type": "minecraft:skeleton", + "weight": 100, + "minCount": 4, + "maxCount": 4 + }, + { + "type": "minecraft:creeper", + "weight": 100, + "minCount": 4, + "maxCount": 4 + }, + { + "type": "minecraft:slime", + "weight": 100, + "minCount": 4, + "maxCount": 4 + }, + { + "type": "minecraft:enderman", + "weight": 10, + "minCount": 1, + "maxCount": 4 + }, + { + "type": "minecraft:witch", + "weight": 5, + "minCount": 1, + "maxCount": 1 + } + ], + "creature": [ + { + "type": "minecraft:pig", + "weight": 10, + "minCount": 2, + "maxCount": 2 + }, + { + "type": "minecraft:chicken", + "weight": 10, + "minCount": 2, + "maxCount": 3 + }, + { + "type": "minecraft:cow", + "weight": 8, + "minCount": 1, + "maxCount": 3 + }, + { + "type": "minecraft:horse", + "weight": 5, + "minCount": 2, + "maxCount": 3 + }, + { + "type": "minecraft:donkey", + "weight": 1, + "minCount": 1, + "maxCount": 2 + } + ], + "ambient": [ + { + "type": "minecraft:bat", + "weight": 10, + "minCount": 8, + "maxCount": 8 + } + ] + }, + "spawn_costs": {}, + "carvers": { + "air": [ + "immersiveweapons:trench" + ] + }, + "features": [ + [], + [ + "minecraft:lake_lava_underground", + "minecraft:lake_lava_surface" + ], + [ + "minecraft:amethyst_geode" + ], + [ + "minecraft:monster_room", + "minecraft:monster_room_deep" + ], + [], + [], + [ + "minecraft:ore_dirt", + "minecraft:ore_gravel", + "minecraft:ore_granite_upper", + "minecraft:ore_granite_lower", + "minecraft:ore_diorite_upper", + "minecraft:ore_diorite_lower", + "minecraft:ore_andesite_upper", + "minecraft:ore_andesite_lower", + "minecraft:ore_tuff", + "minecraft:ore_coal_upper", + "minecraft:ore_coal_lower", + "minecraft:ore_iron_upper", + "minecraft:ore_iron_middle", + "minecraft:ore_iron_small", + "minecraft:ore_gold", + "minecraft:ore_gold_lower", + "minecraft:ore_redstone", + "minecraft:ore_redstone_lower", + "minecraft:ore_diamond", + "minecraft:ore_diamond_large", + "minecraft:ore_diamond_buried", + "minecraft:ore_lapis", + "minecraft:ore_lapis_buried", + "minecraft:ore_copper", + "minecraft:underwater_magma", + "minecraft:disk_sand", + "minecraft:disk_clay", + "minecraft:disk_gravel" + ], + [], + [ + "minecraft:spring_water", + "minecraft:spring_lava" + ], + [ + "minecraft:glow_lichen", + "minecraft:patch_tall_grass_2", + "immersiveweapons:burned_oak_tree", + "minecraft:patch_grass_plain", + "immersiveweapons:patch_wooden_spikes", + "minecraft:brown_mushroom_normal", + "minecraft:red_mushroom_normal", + "minecraft:patch_sugar_cane", + "minecraft:patch_pumpkin" + ], + [ + "minecraft:freeze_top_layer" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/immersiveweapons/worldgen/biome/tiltros.json b/src/main/resources/data/immersiveweapons/worldgen/biome/tiltros.json new file mode 100644 index 000000000..eadb058a0 --- /dev/null +++ b/src/main/resources/data/immersiveweapons/worldgen/biome/tiltros.json @@ -0,0 +1,100 @@ +{ + "temperature": 0.6, + "downfall": 0, + "precipitation": "none", + "temperature_modifier": "none", + "category": "extreme_hills", + "effects": { + "sky_color": 461620, + "fog_color": 2830199, + "water_color": 7031172, + "water_fog_color": 4732021, + "grass_color": 16113331, + "foliage_color": 14665365, + "grass_color_modifier": "none", + "music": { + "sound": "immersiveweapons:tiltros_ambient", + "min_delay": 240, + "max_delay": 1200, + "replace_current_music": true + } + }, + "spawners": { + "monster": [ + { + "type": "immersiveweapons:rock_spider", + "weight": 65, + "minCount": 2, + "maxCount": 4 + }, + { + "type": "immersiveweapons:lava_revenant", + "weight": 35, + "minCount": 1, + "maxCount": 1 + }, + { + "type": "immersiveweapons:celestial_tower", + "weight": 15, + "minCount": 1, + "maxCount": 1 + } + ] + }, + "spawn_costs": {}, + "carvers": { + "air": [ + "immersiveweapons:tiltros" + ] + }, + "features": [ + [], + [ + "minecraft:lake_lava_underground", + "minecraft:lake_lava_surface" + ], + [ + "minecraft:amethyst_geode" + ], + [], + [], + [ + "minecraft:ore_dirt", + "minecraft:ore_gravel", + "minecraft:ore_granite_upper", + "minecraft:ore_granite_lower", + "minecraft:ore_diorite_upper", + "minecraft:ore_diorite_lower", + "minecraft:ore_andesite_upper", + "minecraft:ore_andesite_lower", + "minecraft:ore_tuff", + "minecraft:ore_coal_upper", + "minecraft:ore_coal_lower", + "minecraft:ore_iron_upper", + "minecraft:ore_iron_middle", + "minecraft:ore_iron_small", + "minecraft:ore_gold", + "minecraft:ore_gold_lower", + "minecraft:ore_redstone", + "minecraft:ore_redstone_lower", + "minecraft:ore_diamond", + "minecraft:ore_diamond_large", + "minecraft:ore_diamond_buried", + "minecraft:ore_lapis", + "minecraft:ore_lapis_buried", + "minecraft:ore_copper", + "minecraft:underwater_magma", + "minecraft:disk_sand", + "minecraft:disk_clay", + "minecraft:disk_gravel" + ], + [], + [ + "minecraft:spring_water", + "minecraft:spring_lava" + ], + [ + "minecraft:glow_lichen" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/immersiveweapons/worldgen/configured_carver/tiltros.json b/src/main/resources/data/immersiveweapons/worldgen/configured_carver/tiltros.json new file mode 100644 index 000000000..e77d3686e --- /dev/null +++ b/src/main/resources/data/immersiveweapons/worldgen/configured_carver/tiltros.json @@ -0,0 +1,47 @@ +{ + "type": "minecraft:canyon", + "config": { + "probability": 0.65, + "y": { + "type": "minecraft:trapezoid", + "min_inclusive": { + "absolute": 0 + }, + "max_inclusive": { + "absolute": 256 + }, + "plateau": 64 + }, + "yScale": 3, + "lava_level": { + "absolute": -48 + }, + "debug_settings": { + "debug_mode": false, + "air_state": { + "Name": "minecraft:stone_bricks" + } + }, + "vertical_rotation": { + "type": "minecraft:uniform", + "value": { + "min_inclusive": 3, + "max_exclusive": 7 + } + }, + "shape": { + "distance_factor": { + "type": "minecraft:constant", + "value": 35 + }, + "thickness": { + "type": "minecraft:constant", + "value": 4 + }, + "width_smoothness": 3, + "horizontal_radius_factor": 3, + "vertical_radius_default_factor": 3, + "vertical_radius_center_factor": 3 + } + } +} \ No newline at end of file diff --git a/src/main/resources/data/immersiveweapons/worldgen/configured_carver/trench.json b/src/main/resources/data/immersiveweapons/worldgen/configured_carver/trench.json new file mode 100644 index 000000000..e44cbd0b3 --- /dev/null +++ b/src/main/resources/data/immersiveweapons/worldgen/configured_carver/trench.json @@ -0,0 +1,44 @@ +{ + "type": "minecraft:canyon", + "config": { + "probability": 0.35, + "y": { + "type": "minecraft:biased_to_bottom", + "min_inclusive": { + "absolute": 0 + }, + "max_inclusive": { + "absolute": 172 + }, + "inner": 68 + }, + "yScale": 0.75, + "lava_level": { + "absolute": 0 + }, + "debug_settings": { + "debug_mode": false, + "air_state": { + "Name": "minecraft:stone_bricks" + } + }, + "vertical_rotation": { + "type": "minecraft:uniform", + "value": { + "min_inclusive": 0, + "max_exclusive": 16 + } + }, + "shape": { + "distance_factor": { + "type": "minecraft:constant", + "value": 15 + }, + "thickness": 1, + "width_smoothness": 2, + "horizontal_radius_factor": 2, + "vertical_radius_default_factor": 1, + "vertical_radius_center_factor": 1 + } + } +} \ No newline at end of file diff --git a/src/main/resources/data/immersiveweapons/worldgen/configured_feature/burned_oak_tree.json b/src/main/resources/data/immersiveweapons/worldgen/configured_feature/burned_oak_tree.json new file mode 100644 index 000000000..97b95df1f --- /dev/null +++ b/src/main/resources/data/immersiveweapons/worldgen/configured_feature/burned_oak_tree.json @@ -0,0 +1,56 @@ +{ + "type": "minecraft:tree", + "config": { + "ignore_vines": true, + "force_dirt": false, + "minimum_size": { + "type": "minecraft:two_layers_feature_size", + "limit": 1, + "lower_size": 0, + "upper_size": 1 + }, + "dirt_provider": { + "type": "minecraft:simple_state_provider", + "state": { + "Name": "minecraft:dirt" + } + }, + "trunk_provider": { + "type": "minecraft:simple_state_provider", + "state": { + "Name": "immersiveweapons:burned_oak_log", + "Properties": { + "axis": "y" + } + } + }, + "foliage_provider": { + "type": "minecraft:simple_state_provider", + "state": { + "Name": "minecraft:air", + "Properties": { + "persistent": "false", + "distance": "0" + } + } + }, + "trunk_placer": { + "type": "minecraft:straight_trunk_placer", + "base_height": 7, + "height_rand_a": 3, + "height_rand_b": 3 + }, + "foliage_placer": { + "type": "minecraft:blob_foliage_placer", + "radius": 0, + "offset": 0, + "height": 0 + }, + "decorators": [ + { + "type": "immersiveweapons:burned_branch", + "probability": 0.95 + } + ] + } +} \ No newline at end of file diff --git a/src/main/resources/data/immersiveweapons/worldgen/configured_feature/patch_wooden_spikes.json b/src/main/resources/data/immersiveweapons/worldgen/configured_feature/patch_wooden_spikes.json new file mode 100644 index 000000000..e8d4560f4 --- /dev/null +++ b/src/main/resources/data/immersiveweapons/worldgen/configured_feature/patch_wooden_spikes.json @@ -0,0 +1,11 @@ +{ + "config": { + "state_provider": { + "state": { + "Name": "immersiveweapons:wooden_spikes" + }, + "type": "minecraft:simple_state_provider" + } + }, + "type": "minecraft:block_pile" +} \ No newline at end of file diff --git a/src/main/resources/data/immersiveweapons/worldgen/configured_structure_feature/abandoned_factory.json b/src/main/resources/data/immersiveweapons/worldgen/configured_structure_feature/abandoned_factory.json new file mode 100644 index 000000000..94d6399d7 --- /dev/null +++ b/src/main/resources/data/immersiveweapons/worldgen/configured_structure_feature/abandoned_factory.json @@ -0,0 +1,26 @@ +{ + "type": "minecraft:village", + + "config": { + "start_pool": "immersiveweapons:abandoned_factory/start_pool", + "size": 1 + }, + + "biomes": "#immersiveweapons:has_structure/abandoned_factory", + + "adapt_noise": true, + + "spawn_overrides": { + "monster": { + "bounding_box": "full", + "spawns": [ + { + "type": "minecraft:zombie", + "weight": 1, + "minCount": 1, + "maxCount": 2 + } + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/data/immersiveweapons/worldgen/configured_structure_feature/battlefield_camp.json b/src/main/resources/data/immersiveweapons/worldgen/configured_structure_feature/battlefield_camp.json new file mode 100644 index 000000000..f818dd3c3 --- /dev/null +++ b/src/main/resources/data/immersiveweapons/worldgen/configured_structure_feature/battlefield_camp.json @@ -0,0 +1,26 @@ +{ + "type": "minecraft:village", + + "config": { + "start_pool": "immersiveweapons:battlefield_camp/start_pool", + "size": 1 + }, + + "biomes": "#immersiveweapons:has_structure/battlefield_camp", + + "adapt_noise": true, + + "spawn_overrides": { + "monster": { + "bounding_box": "full", + "spawns": [ + { + "type": "immersiveweapons:dying_soldier", + "weight": 1, + "minCount": 2, + "maxCount": 2 + } + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/data/immersiveweapons/worldgen/configured_structure_feature/battlefield_town.json b/src/main/resources/data/immersiveweapons/worldgen/configured_structure_feature/battlefield_town.json new file mode 100644 index 000000000..55452db0a --- /dev/null +++ b/src/main/resources/data/immersiveweapons/worldgen/configured_structure_feature/battlefield_town.json @@ -0,0 +1,26 @@ +{ + "type": "minecraft:village", + + "config": { + "start_pool": "immersiveweapons:battlefield_town/start_pool", + "size": 1 + }, + + "biomes": "#immersiveweapons:has_structure/battlefield_town", + + "adapt_noise": true, + + "spawn_overrides": { + "creature": { + "bounding_box": "full", + "spawns": [ + { + "type": "minecraft:cat", + "weight": 1, + "minCount": 1, + "maxCount": 2 + } + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/data/immersiveweapons/worldgen/configured_structure_feature/bear_trap.json b/src/main/resources/data/immersiveweapons/worldgen/configured_structure_feature/bear_trap.json new file mode 100644 index 000000000..4f499c2d9 --- /dev/null +++ b/src/main/resources/data/immersiveweapons/worldgen/configured_structure_feature/bear_trap.json @@ -0,0 +1,14 @@ +{ + "type": "minecraft:village", + + "config": { + "start_pool": "immersiveweapons:bear_trap/start_pool", + "size": 1 + }, + + "biomes": "#immersiveweapons:has_structure/bear_trap", + + "adapt_noise": true, + + "spawn_overrides": {} +} \ No newline at end of file diff --git a/src/main/resources/data/immersiveweapons/worldgen/configured_structure_feature/campsite.json b/src/main/resources/data/immersiveweapons/worldgen/configured_structure_feature/campsite.json new file mode 100644 index 000000000..e2ec3e4f2 --- /dev/null +++ b/src/main/resources/data/immersiveweapons/worldgen/configured_structure_feature/campsite.json @@ -0,0 +1,26 @@ +{ + "type": "minecraft:village", + + "config": { + "start_pool": "immersiveweapons:campsite/start_pool", + "size": 1 + }, + + "biomes": "#immersiveweapons:has_structure/campsite", + + "adapt_noise": true, + + "spawn_overrides": { + "monster": { + "bounding_box": "full", + "spawns": [ + { + "type": "immersiveweapons:minuteman", + "weight": 1, + "minCount": 1, + "maxCount": 2 + } + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/data/immersiveweapons/worldgen/configured_structure_feature/cloud_island.json b/src/main/resources/data/immersiveweapons/worldgen/configured_structure_feature/cloud_island.json new file mode 100644 index 000000000..2c414f49d --- /dev/null +++ b/src/main/resources/data/immersiveweapons/worldgen/configured_structure_feature/cloud_island.json @@ -0,0 +1,14 @@ +{ + "type": "immersiveweapons:cloud_island", + + "config": { + "start_pool": "immersiveweapons:cloud_island/start_pool", + "size": 1 + }, + + "biomes": "#immersiveweapons:has_structure/cloud_island", + + "adapt_noise": false, + + "spawn_overrides": {} +} \ No newline at end of file diff --git a/src/main/resources/data/immersiveweapons/worldgen/configured_structure_feature/destroyed_house.json b/src/main/resources/data/immersiveweapons/worldgen/configured_structure_feature/destroyed_house.json new file mode 100644 index 000000000..bb0fe5b06 --- /dev/null +++ b/src/main/resources/data/immersiveweapons/worldgen/configured_structure_feature/destroyed_house.json @@ -0,0 +1,26 @@ +{ + "type": "immersiveweapons:destroyed_house", + + "config": { + "start_pool": "immersiveweapons:destroyed_house/start_pool", + "size": 1 + }, + + "biomes": "#immersiveweapons:has_structure/destroyed_house", + + "adapt_noise": true, + + "spawn_overrides": { + "monster": { + "bounding_box": "full", + "spawns": [ + { + "type": "minecraft:zombie", + "weight": 1, + "minCount": 1, + "maxCount": 1 + } + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/data/immersiveweapons/worldgen/configured_structure_feature/graveyard.json b/src/main/resources/data/immersiveweapons/worldgen/configured_structure_feature/graveyard.json new file mode 100644 index 000000000..32da07a64 --- /dev/null +++ b/src/main/resources/data/immersiveweapons/worldgen/configured_structure_feature/graveyard.json @@ -0,0 +1,26 @@ +{ + "type": "minecraft:village", + + "config": { + "start_pool": "immersiveweapons:graveyard/start_pool", + "size": 1 + }, + + "biomes": "#immersiveweapons:has_structure/graveyard", + + "adapt_noise": true, + + "spawn_overrides": { + "monster": { + "bounding_box": "full", + "spawns": [ + { + "type": "minecraft:skeleton", + "weight": 1, + "minCount": 1, + "maxCount": 1 + } + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/data/immersiveweapons/worldgen/configured_structure_feature/hans_hut.json b/src/main/resources/data/immersiveweapons/worldgen/configured_structure_feature/hans_hut.json new file mode 100644 index 000000000..e8810dbb4 --- /dev/null +++ b/src/main/resources/data/immersiveweapons/worldgen/configured_structure_feature/hans_hut.json @@ -0,0 +1,14 @@ +{ + "type": "immersiveweapons:hans_hut", + + "config": { + "start_pool": "immersiveweapons:hans_hut/start_pool", + "size": 1 + }, + + "biomes": "#immersiveweapons:has_structure/hans_hut", + + "adapt_noise": true, + + "spawn_overrides": {} +} \ No newline at end of file diff --git a/src/main/resources/data/immersiveweapons/worldgen/configured_structure_feature/landmine_trap.json b/src/main/resources/data/immersiveweapons/worldgen/configured_structure_feature/landmine_trap.json new file mode 100644 index 000000000..6077136b8 --- /dev/null +++ b/src/main/resources/data/immersiveweapons/worldgen/configured_structure_feature/landmine_trap.json @@ -0,0 +1,14 @@ +{ + "type": "minecraft:village", + + "config": { + "start_pool": "immersiveweapons:landmine_trap/start_pool", + "size": 1 + }, + + "biomes": "#immersiveweapons:has_structure/landmine_trap", + + "adapt_noise": true, + + "spawn_overrides": {} +} \ No newline at end of file diff --git a/src/main/resources/data/immersiveweapons/worldgen/configured_structure_feature/pitfall_trap.json b/src/main/resources/data/immersiveweapons/worldgen/configured_structure_feature/pitfall_trap.json new file mode 100644 index 000000000..6fcd72197 --- /dev/null +++ b/src/main/resources/data/immersiveweapons/worldgen/configured_structure_feature/pitfall_trap.json @@ -0,0 +1,14 @@ +{ + "type": "immersiveweapons:pitfall_trap", + + "config": { + "start_pool": "immersiveweapons:pitfall_trap/start_pool", + "size": 1 + }, + + "biomes": "#immersiveweapons:has_structure/pitfall_trap", + + "adapt_noise": false, + + "spawn_overrides": {} +} \ No newline at end of file diff --git a/src/main/resources/data/immersiveweapons/worldgen/configured_structure_feature/underground_bunker.json b/src/main/resources/data/immersiveweapons/worldgen/configured_structure_feature/underground_bunker.json new file mode 100644 index 000000000..a17f5ea46 --- /dev/null +++ b/src/main/resources/data/immersiveweapons/worldgen/configured_structure_feature/underground_bunker.json @@ -0,0 +1,26 @@ +{ + "type": "immersiveweapons:underground_bunker", + + "config": { + "start_pool": "immersiveweapons:underground_bunker/start_pool", + "size": 1 + }, + + "biomes": "#immersiveweapons:has_structure/underground_bunker", + + "adapt_noise": false, + + "spawn_overrides": { + "monster": { + "bounding_box": "full", + "spawns": [ + { + "type": "immersiveweapons:dying_soldier", + "weight": 1, + "minCount": 2, + "maxCount": 3 + } + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/data/immersiveweapons/worldgen/configured_structure_feature/water_tower.json b/src/main/resources/data/immersiveweapons/worldgen/configured_structure_feature/water_tower.json new file mode 100644 index 000000000..3e5df1298 --- /dev/null +++ b/src/main/resources/data/immersiveweapons/worldgen/configured_structure_feature/water_tower.json @@ -0,0 +1,14 @@ +{ + "type": "minecraft:village", + + "config": { + "start_pool": "immersiveweapons:water_tower/start_pool", + "size": 1 + }, + + "biomes": "#immersiveweapons:has_structure/water_tower", + + "adapt_noise": true, + + "spawn_overrides": {} +} \ No newline at end of file diff --git a/src/main/resources/data/immersiveweapons/worldgen/noise_settings/tiltros.json b/src/main/resources/data/immersiveweapons/worldgen/noise_settings/tiltros.json new file mode 100644 index 000000000..4b9232156 --- /dev/null +++ b/src/main/resources/data/immersiveweapons/worldgen/noise_settings/tiltros.json @@ -0,0 +1,2947 @@ +{ + "aquifers_enabled": true, + "ore_veins_enabled": true, + "legacy_random_source": false, + "sea_level": -64, + "disable_mob_generation": false, + "default_fluid": { + "Properties": { + "level": "0" + }, + "Name": "minecraft:water" + }, + "noise_router": { + "final_density": { + "argument1": { + "argument": { + "argument1": 0.64, + "argument2": { + "argument": { + "argument": { + "argument": { + "max_exclusive": 1.5625, + "when_in_range": { + "argument1": "minecraft:overworld/sloped_cheese", + "argument2": { + "argument1": 5.0, + "argument2": "minecraft:overworld/caves/entrances", + "type": "minecraft:mul" + }, + "type": "minecraft:min" + }, + "when_out_of_range": { + "argument1": { + "argument1": { + "argument1": { + "argument1": { + "argument1": 4.0, + "argument2": { + "argument": { + "noise": "minecraft:cave_layer", + "xz_scale": 1.0, + "y_scale": 8.0, + "type": "minecraft:noise" + }, + "type": "minecraft:square" + }, + "type": "minecraft:mul" + }, + "argument2": { + "argument1": { + "input": { + "argument1": 0.27, + "argument2": { + "noise": "minecraft:cave_cheese", + "xz_scale": 1.0, + "y_scale": 0.6666666666666666, + "type": "minecraft:noise" + }, + "type": "minecraft:add" + }, + "min": -1.0, + "max": 1.0, + "type": "minecraft:clamp" + }, + "argument2": { + "input": { + "argument1": 1.5, + "argument2": { + "argument1": -0.64, + "argument2": "minecraft:overworld/sloped_cheese", + "type": "minecraft:mul" + }, + "type": "minecraft:add" + }, + "min": 0.0, + "max": 0.5, + "type": "minecraft:clamp" + }, + "type": "minecraft:add" + }, + "type": "minecraft:add" + }, + "argument2": "minecraft:overworld/caves/entrances", + "type": "minecraft:min" + }, + "argument2": { + "argument1": "minecraft:overworld/caves/spaghetti_2d", + "argument2": "minecraft:overworld/caves/spaghetti_roughness_function", + "type": "minecraft:add" + }, + "type": "minecraft:min" + }, + "argument2": { + "max_exclusive": 0.03, + "when_in_range": -1000000.0, + "when_out_of_range": "minecraft:overworld/caves/pillars", + "input": "minecraft:overworld/caves/pillars", + "min_inclusive": -1000000.0, + "type": "minecraft:range_choice" + }, + "type": "minecraft:max" + }, + "input": "minecraft:overworld/sloped_cheese", + "min_inclusive": -1000000.0, + "type": "minecraft:range_choice" + }, + "type": "minecraft:slide" + }, + "type": "minecraft:blend_density" + }, + "type": "minecraft:interpolated" + }, + "type": "minecraft:mul" + }, + "type": "minecraft:squeeze" + }, + "argument2": "minecraft:overworld/caves/noodle", + "type": "minecraft:min" + }, + "vein_toggle": { + "argument": { + "max_exclusive": 51.0, + "when_in_range": { + "noise": "minecraft:ore_veininess", + "xz_scale": 1.5, + "y_scale": 1.5, + "type": "minecraft:noise" + }, + "when_out_of_range": 0.0, + "input": "minecraft:y", + "min_inclusive": -60.0, + "type": "minecraft:range_choice" + }, + "type": "minecraft:interpolated" + }, + "vein_ridged": { + "argument1": -0.07999999821186066, + "argument2": { + "argument1": { + "argument": { + "argument": { + "max_exclusive": 51.0, + "when_in_range": { + "noise": "minecraft:ore_vein_a", + "xz_scale": 4.0, + "y_scale": 4.0, + "type": "minecraft:noise" + }, + "when_out_of_range": 0.0, + "input": "minecraft:y", + "min_inclusive": -60.0, + "type": "minecraft:range_choice" + }, + "type": "minecraft:interpolated" + }, + "type": "minecraft:abs" + }, + "argument2": { + "argument": { + "argument": { + "max_exclusive": 51.0, + "when_in_range": { + "noise": "minecraft:ore_vein_b", + "xz_scale": 4.0, + "y_scale": 4.0, + "type": "minecraft:noise" + }, + "when_out_of_range": 0.0, + "input": "minecraft:y", + "min_inclusive": -60.0, + "type": "minecraft:range_choice" + }, + "type": "minecraft:interpolated" + }, + "type": "minecraft:abs" + }, + "type": "minecraft:max" + }, + "type": "minecraft:add" + }, + "vein_gap": { + "noise": "minecraft:ore_gap", + "xz_scale": 1.0, + "y_scale": 1.0, + "type": "minecraft:noise" + }, + "erosion": "minecraft:overworld/erosion", + "depth": "minecraft:overworld/depth", + "ridges": "minecraft:overworld/ridges", + "initial_density_without_jaggedness": { + "argument1": 4.0, + "argument2": { + "argument": { + "argument1": "minecraft:overworld/depth", + "argument2": { + "argument": "minecraft:overworld/factor", + "type": "minecraft:cache_2d" + }, + "type": "minecraft:mul" + }, + "type": "minecraft:quarter_negative" + }, + "type": "minecraft:mul" + }, + "lava": { + "noise": "minecraft:aquifer_lava", + "xz_scale": 1.0, + "y_scale": 1.0, + "type": "minecraft:noise" + }, + "temperature": { + "xz_scale": 0.25, + "y_scale": 0.0, + "noise": "minecraft:temperature", + "shift_x": "minecraft:shift_x", + "shift_y": 0.0, + "shift_z": "minecraft:shift_z", + "type": "minecraft:shifted_noise" + }, + "vegetation": { + "xz_scale": 0.25, + "y_scale": 0.0, + "noise": "minecraft:vegetation", + "shift_x": "minecraft:shift_x", + "shift_y": 0.0, + "shift_z": "minecraft:shift_z", + "type": "minecraft:shifted_noise" + }, + "continents": "minecraft:overworld/continents", + "barrier": { + "noise": "minecraft:aquifer_barrier", + "xz_scale": 1.0, + "y_scale": 0.5, + "type": "minecraft:noise" + }, + "fluid_level_floodedness": { + "noise": "minecraft:aquifer_fluid_level_floodedness", + "xz_scale": 1.0, + "y_scale": 0.67, + "type": "minecraft:noise" + }, + "fluid_level_spread": { + "noise": "minecraft:aquifer_fluid_level_spread", + "xz_scale": 1.0, + "y_scale": 0.7142857142857143, + "type": "minecraft:noise" + } + }, + "surface_rule": { + "sequence": [ + { + "if_true": { + "random_name": "minecraft:bedrock_floor", + "true_at_and_below": { + "above_bottom": 0 + }, + "false_at_and_above": { + "above_bottom": 5 + }, + "type": "minecraft:vertical_gradient" + }, + "then_run": { + "result_state": { + "Name": "minecraft:bedrock" + }, + "type": "minecraft:block" + }, + "type": "minecraft:condition" + }, + { + "if_true": { + "random_name": "minecraft:deepslate", + "true_at_and_below": { + "absolute": 0 + }, + "false_at_and_above": { + "absolute": 8 + }, + "type": "minecraft:vertical_gradient" + }, + "then_run": { + "result_state": { + "Properties": { + "axis": "y" + }, + "Name": "minecraft:deepslate" + }, + "type": "minecraft:block" + }, + "type": "minecraft:condition" + } + ], + "type": "minecraft:sequence" + }, + "noise": { + "bottom_slide": { + "target": 0.1171875, + "size": 3, + "offset": 0 + }, + "size_horizontal": 1, + "size_vertical": 2, + "terrain_shaper": { + "offset": { + "coordinate": "continents", + "points": [ + { + "location": -1.1, + "value": 0.044, + "derivative": 0.0 + }, + { + "location": -1.02, + "value": -0.2222, + "derivative": 0.0 + }, + { + "location": -0.51, + "value": -0.2222, + "derivative": 0.0 + }, + { + "location": -0.44, + "value": -0.12, + "derivative": 0.0 + }, + { + "location": -0.18, + "value": -0.12, + "derivative": 0.0 + }, + { + "location": -0.16, + "value": { + "coordinate": "erosion", + "points": [ + { + "location": -0.85, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": -0.08880186, + "derivative": 0.38940096 + }, + { + "location": 1.0, + "value": 0.69000006, + "derivative": 0.38940096 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.7, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": -0.115760356, + "derivative": 0.37788022 + }, + { + "location": 1.0, + "value": 0.6400001, + "derivative": 0.37788022 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.4, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": -0.2222, + "derivative": 0.0 + }, + { + "location": -0.75, + "value": -0.2222, + "derivative": 0.0 + }, + { + "location": -0.65, + "value": 0.0, + "derivative": 0.0 + }, + { + "location": 0.5954547, + "value": 2.9802322E-8, + "derivative": 0.0 + }, + { + "location": 0.6054547, + "value": 2.9802322E-8, + "derivative": 0.2534563 + }, + { + "location": 1.0, + "value": 0.100000024, + "derivative": 0.2534563 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.35, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": -0.3, + "derivative": 0.5 + }, + { + "location": -0.4, + "value": 0.05, + "derivative": 0.0 + }, + { + "location": 0.0, + "value": 0.05, + "derivative": 0.0 + }, + { + "location": 0.4, + "value": 0.05, + "derivative": 0.0 + }, + { + "location": 1.0, + "value": 0.060000002, + "derivative": 0.007000001 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.1, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": -0.15, + "derivative": 0.5 + }, + { + "location": -0.4, + "value": 0.0, + "derivative": 0.0 + }, + { + "location": 0.0, + "value": 0.0, + "derivative": 0.0 + }, + { + "location": 0.4, + "value": 0.05, + "derivative": 0.1 + }, + { + "location": 1.0, + "value": 0.060000002, + "derivative": 0.007000001 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.2, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": -0.15, + "derivative": 0.5 + }, + { + "location": -0.4, + "value": 0.0, + "derivative": 0.0 + }, + { + "location": 0.0, + "value": 0.0, + "derivative": 0.0 + }, + { + "location": 0.4, + "value": 0.0, + "derivative": 0.0 + }, + { + "location": 1.0, + "value": 0.0, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.7, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": -0.02, + "derivative": 0.0 + }, + { + "location": -0.4, + "value": -0.03, + "derivative": 0.0 + }, + { + "location": 0.0, + "value": -0.03, + "derivative": 0.0 + }, + { + "location": 0.4, + "value": 0.0, + "derivative": 0.06 + }, + { + "location": 1.0, + "value": 0.0, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.15, + "value": { + "coordinate": "erosion", + "points": [ + { + "location": -0.85, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": -0.08880186, + "derivative": 0.38940096 + }, + { + "location": 1.0, + "value": 0.69000006, + "derivative": 0.38940096 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.7, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": -0.115760356, + "derivative": 0.37788022 + }, + { + "location": 1.0, + "value": 0.6400001, + "derivative": 0.37788022 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.4, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": -0.2222, + "derivative": 0.0 + }, + { + "location": -0.75, + "value": -0.2222, + "derivative": 0.0 + }, + { + "location": -0.65, + "value": 0.0, + "derivative": 0.0 + }, + { + "location": 0.5954547, + "value": 2.9802322E-8, + "derivative": 0.0 + }, + { + "location": 0.6054547, + "value": 2.9802322E-8, + "derivative": 0.2534563 + }, + { + "location": 1.0, + "value": 0.100000024, + "derivative": 0.2534563 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.35, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": -0.3, + "derivative": 0.5 + }, + { + "location": -0.4, + "value": 0.05, + "derivative": 0.0 + }, + { + "location": 0.0, + "value": 0.05, + "derivative": 0.0 + }, + { + "location": 0.4, + "value": 0.05, + "derivative": 0.0 + }, + { + "location": 1.0, + "value": 0.060000002, + "derivative": 0.007000001 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.1, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": -0.15, + "derivative": 0.5 + }, + { + "location": -0.4, + "value": 0.0, + "derivative": 0.0 + }, + { + "location": 0.0, + "value": 0.0, + "derivative": 0.0 + }, + { + "location": 0.4, + "value": 0.05, + "derivative": 0.1 + }, + { + "location": 1.0, + "value": 0.060000002, + "derivative": 0.007000001 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.2, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": -0.15, + "derivative": 0.5 + }, + { + "location": -0.4, + "value": 0.0, + "derivative": 0.0 + }, + { + "location": 0.0, + "value": 0.0, + "derivative": 0.0 + }, + { + "location": 0.4, + "value": 0.0, + "derivative": 0.0 + }, + { + "location": 1.0, + "value": 0.0, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.7, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": -0.02, + "derivative": 0.0 + }, + { + "location": -0.4, + "value": -0.03, + "derivative": 0.0 + }, + { + "location": 0.0, + "value": -0.03, + "derivative": 0.0 + }, + { + "location": 0.4, + "value": 0.0, + "derivative": 0.06 + }, + { + "location": 1.0, + "value": 0.0, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.1, + "value": { + "coordinate": "erosion", + "points": [ + { + "location": -0.85, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": -0.08880186, + "derivative": 0.38940096 + }, + { + "location": 1.0, + "value": 0.69000006, + "derivative": 0.38940096 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.7, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": -0.115760356, + "derivative": 0.37788022 + }, + { + "location": 1.0, + "value": 0.6400001, + "derivative": 0.37788022 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.4, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": -0.2222, + "derivative": 0.0 + }, + { + "location": -0.75, + "value": -0.2222, + "derivative": 0.0 + }, + { + "location": -0.65, + "value": 0.0, + "derivative": 0.0 + }, + { + "location": 0.5954547, + "value": 2.9802322E-8, + "derivative": 0.0 + }, + { + "location": 0.6054547, + "value": 2.9802322E-8, + "derivative": 0.2534563 + }, + { + "location": 1.0, + "value": 0.100000024, + "derivative": 0.2534563 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.35, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": -0.25, + "derivative": 0.5 + }, + { + "location": -0.4, + "value": 0.05, + "derivative": 0.0 + }, + { + "location": 0.0, + "value": 0.05, + "derivative": 0.0 + }, + { + "location": 0.4, + "value": 0.05, + "derivative": 0.0 + }, + { + "location": 1.0, + "value": 0.060000002, + "derivative": 0.007000001 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.1, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": -0.1, + "derivative": 0.5 + }, + { + "location": -0.4, + "value": 0.001, + "derivative": 0.01 + }, + { + "location": 0.0, + "value": 0.003, + "derivative": 0.01 + }, + { + "location": 0.4, + "value": 0.05, + "derivative": 0.094000004 + }, + { + "location": 1.0, + "value": 0.060000002, + "derivative": 0.007000001 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.2, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": -0.1, + "derivative": 0.5 + }, + { + "location": -0.4, + "value": 0.01, + "derivative": 0.0 + }, + { + "location": 0.0, + "value": 0.01, + "derivative": 0.0 + }, + { + "location": 0.4, + "value": 0.03, + "derivative": 0.04 + }, + { + "location": 1.0, + "value": 0.1, + "derivative": 0.049 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.7, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": -0.02, + "derivative": 0.0 + }, + { + "location": -0.4, + "value": -0.03, + "derivative": 0.0 + }, + { + "location": 0.0, + "value": -0.03, + "derivative": 0.0 + }, + { + "location": 0.4, + "value": 0.03, + "derivative": 0.12 + }, + { + "location": 1.0, + "value": 0.1, + "derivative": 0.049 + } + ] + }, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.25, + "value": { + "coordinate": "erosion", + "points": [ + { + "location": -0.85, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": 0.20235021, + "derivative": 0.0 + }, + { + "location": 0.0, + "value": 0.7161751, + "derivative": 0.5138249 + }, + { + "location": 1.0, + "value": 1.23, + "derivative": 0.5138249 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.7, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": 0.2, + "derivative": 0.0 + }, + { + "location": 0.0, + "value": 0.44682026, + "derivative": 0.43317974 + }, + { + "location": 1.0, + "value": 0.88, + "derivative": 0.43317974 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.4, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": 0.2, + "derivative": 0.0 + }, + { + "location": 0.0, + "value": 0.30829495, + "derivative": 0.3917051 + }, + { + "location": 1.0, + "value": 0.70000005, + "derivative": 0.3917051 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.35, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": -0.25, + "derivative": 0.5 + }, + { + "location": -0.4, + "value": 0.35, + "derivative": 0.0 + }, + { + "location": 0.0, + "value": 0.35, + "derivative": 0.0 + }, + { + "location": 0.4, + "value": 0.35, + "derivative": 0.0 + }, + { + "location": 1.0, + "value": 0.42000002, + "derivative": 0.049000014 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.1, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": -0.1, + "derivative": 0.5 + }, + { + "location": -0.4, + "value": 0.0069999998, + "derivative": 0.07 + }, + { + "location": 0.0, + "value": 0.021, + "derivative": 0.07 + }, + { + "location": 0.4, + "value": 0.35, + "derivative": 0.658 + }, + { + "location": 1.0, + "value": 0.42000002, + "derivative": 0.049000014 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.2, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": -0.1, + "derivative": 0.5 + }, + { + "location": -0.4, + "value": 0.01, + "derivative": 0.0 + }, + { + "location": 0.0, + "value": 0.01, + "derivative": 0.0 + }, + { + "location": 0.4, + "value": 0.03, + "derivative": 0.04 + }, + { + "location": 1.0, + "value": 0.1, + "derivative": 0.049 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.4, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": -0.1, + "derivative": 0.5 + }, + { + "location": -0.4, + "value": 0.01, + "derivative": 0.0 + }, + { + "location": 0.0, + "value": 0.01, + "derivative": 0.0 + }, + { + "location": 0.4, + "value": 0.03, + "derivative": 0.04 + }, + { + "location": 1.0, + "value": 0.1, + "derivative": 0.049 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.45, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": -0.1, + "derivative": 0.0 + }, + { + "location": -0.4, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": -0.1, + "derivative": 0.5 + }, + { + "location": -0.4, + "value": 0.01, + "derivative": 0.0 + }, + { + "location": 0.0, + "value": 0.01, + "derivative": 0.0 + }, + { + "location": 0.4, + "value": 0.03, + "derivative": 0.04 + }, + { + "location": 1.0, + "value": 0.1, + "derivative": 0.049 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.0, + "value": 0.17, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.55, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": -0.1, + "derivative": 0.0 + }, + { + "location": -0.4, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": -0.1, + "derivative": 0.5 + }, + { + "location": -0.4, + "value": 0.01, + "derivative": 0.0 + }, + { + "location": 0.0, + "value": 0.01, + "derivative": 0.0 + }, + { + "location": 0.4, + "value": 0.03, + "derivative": 0.04 + }, + { + "location": 1.0, + "value": 0.1, + "derivative": 0.049 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.0, + "value": 0.17, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.58, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": -0.1, + "derivative": 0.5 + }, + { + "location": -0.4, + "value": 0.01, + "derivative": 0.0 + }, + { + "location": 0.0, + "value": 0.01, + "derivative": 0.0 + }, + { + "location": 0.4, + "value": 0.03, + "derivative": 0.04 + }, + { + "location": 1.0, + "value": 0.1, + "derivative": 0.049 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.7, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": -0.02, + "derivative": 0.0 + }, + { + "location": -0.4, + "value": -0.03, + "derivative": 0.0 + }, + { + "location": 0.0, + "value": -0.03, + "derivative": 0.0 + }, + { + "location": 0.4, + "value": 0.03, + "derivative": 0.12 + }, + { + "location": 1.0, + "value": 0.1, + "derivative": 0.049 + } + ] + }, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 1.0, + "value": { + "coordinate": "erosion", + "points": [ + { + "location": -0.85, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": 0.34792626, + "derivative": 0.0 + }, + { + "location": 0.0, + "value": 0.9239631, + "derivative": 0.5760369 + }, + { + "location": 1.0, + "value": 1.5, + "derivative": 0.5760369 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.7, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": 0.2, + "derivative": 0.0 + }, + { + "location": 0.0, + "value": 0.5391705, + "derivative": 0.4608295 + }, + { + "location": 1.0, + "value": 1.0, + "derivative": 0.4608295 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.4, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": 0.2, + "derivative": 0.0 + }, + { + "location": 0.0, + "value": 0.5391705, + "derivative": 0.4608295 + }, + { + "location": 1.0, + "value": 1.0, + "derivative": 0.4608295 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.35, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": -0.2, + "derivative": 0.5 + }, + { + "location": -0.4, + "value": 0.5, + "derivative": 0.0 + }, + { + "location": 0.0, + "value": 0.5, + "derivative": 0.0 + }, + { + "location": 0.4, + "value": 0.5, + "derivative": 0.0 + }, + { + "location": 1.0, + "value": 0.6, + "derivative": 0.070000015 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.1, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": -0.05, + "derivative": 0.5 + }, + { + "location": -0.4, + "value": 0.01, + "derivative": 0.099999994 + }, + { + "location": 0.0, + "value": 0.03, + "derivative": 0.099999994 + }, + { + "location": 0.4, + "value": 0.5, + "derivative": 0.94 + }, + { + "location": 1.0, + "value": 0.6, + "derivative": 0.070000015 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.2, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": -0.05, + "derivative": 0.5 + }, + { + "location": -0.4, + "value": 0.01, + "derivative": 0.0 + }, + { + "location": 0.0, + "value": 0.01, + "derivative": 0.0 + }, + { + "location": 0.4, + "value": 0.03, + "derivative": 0.04 + }, + { + "location": 1.0, + "value": 0.1, + "derivative": 0.049 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.4, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": -0.05, + "derivative": 0.5 + }, + { + "location": -0.4, + "value": 0.01, + "derivative": 0.0 + }, + { + "location": 0.0, + "value": 0.01, + "derivative": 0.0 + }, + { + "location": 0.4, + "value": 0.03, + "derivative": 0.04 + }, + { + "location": 1.0, + "value": 0.1, + "derivative": 0.049 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.45, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": -0.05, + "derivative": 0.0 + }, + { + "location": -0.4, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": -0.05, + "derivative": 0.5 + }, + { + "location": -0.4, + "value": 0.01, + "derivative": 0.0 + }, + { + "location": 0.0, + "value": 0.01, + "derivative": 0.0 + }, + { + "location": 0.4, + "value": 0.03, + "derivative": 0.04 + }, + { + "location": 1.0, + "value": 0.1, + "derivative": 0.049 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.0, + "value": 0.17, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.55, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": -0.05, + "derivative": 0.0 + }, + { + "location": -0.4, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": -0.05, + "derivative": 0.5 + }, + { + "location": -0.4, + "value": 0.01, + "derivative": 0.0 + }, + { + "location": 0.0, + "value": 0.01, + "derivative": 0.0 + }, + { + "location": 0.4, + "value": 0.03, + "derivative": 0.04 + }, + { + "location": 1.0, + "value": 0.1, + "derivative": 0.049 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.0, + "value": 0.17, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.58, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": -0.05, + "derivative": 0.5 + }, + { + "location": -0.4, + "value": 0.01, + "derivative": 0.0 + }, + { + "location": 0.0, + "value": 0.01, + "derivative": 0.0 + }, + { + "location": 0.4, + "value": 0.03, + "derivative": 0.04 + }, + { + "location": 1.0, + "value": 0.1, + "derivative": 0.049 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.7, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -1.0, + "value": -0.02, + "derivative": 0.015 + }, + { + "location": -0.4, + "value": 0.01, + "derivative": 0.0 + }, + { + "location": 0.0, + "value": 0.01, + "derivative": 0.0 + }, + { + "location": 0.4, + "value": 0.03, + "derivative": 0.04 + }, + { + "location": 1.0, + "value": 0.1, + "derivative": 0.049 + } + ] + }, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + } + ] + }, + "factor": { + "coordinate": "continents", + "points": [ + { + "location": -0.19, + "value": 3.95, + "derivative": 0.0 + }, + { + "location": -0.15, + "value": { + "coordinate": "erosion", + "points": [ + { + "location": -0.6, + "value": { + "coordinate": "weirdness", + "points": [ + { + "location": -0.2, + "value": 6.3, + "derivative": 0.0 + }, + { + "location": 0.2, + "value": 6.25, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.5, + "value": { + "coordinate": "weirdness", + "points": [ + { + "location": -0.05, + "value": 6.3, + "derivative": 0.0 + }, + { + "location": 0.05, + "value": 2.67, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.35, + "value": { + "coordinate": "weirdness", + "points": [ + { + "location": -0.2, + "value": 6.3, + "derivative": 0.0 + }, + { + "location": 0.2, + "value": 6.25, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.25, + "value": { + "coordinate": "weirdness", + "points": [ + { + "location": -0.2, + "value": 6.3, + "derivative": 0.0 + }, + { + "location": 0.2, + "value": 6.25, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.1, + "value": { + "coordinate": "weirdness", + "points": [ + { + "location": -0.05, + "value": 2.67, + "derivative": 0.0 + }, + { + "location": 0.05, + "value": 6.3, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.03, + "value": { + "coordinate": "weirdness", + "points": [ + { + "location": -0.2, + "value": 6.3, + "derivative": 0.0 + }, + { + "location": 0.2, + "value": 6.25, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.35, + "value": 6.25, + "derivative": 0.0 + }, + { + "location": 0.45, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -0.9, + "value": 6.25, + "derivative": 0.0 + }, + { + "location": -0.69, + "value": { + "coordinate": "weirdness", + "points": [ + { + "location": 0.0, + "value": 6.25, + "derivative": 0.0 + }, + { + "location": 0.1, + "value": 0.625, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.55, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -0.9, + "value": 6.25, + "derivative": 0.0 + }, + { + "location": -0.69, + "value": { + "coordinate": "weirdness", + "points": [ + { + "location": 0.0, + "value": 6.25, + "derivative": 0.0 + }, + { + "location": 0.1, + "value": 0.625, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.62, + "value": 6.25, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.1, + "value": { + "coordinate": "erosion", + "points": [ + { + "location": -0.6, + "value": { + "coordinate": "weirdness", + "points": [ + { + "location": -0.2, + "value": 6.3, + "derivative": 0.0 + }, + { + "location": 0.2, + "value": 5.47, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.5, + "value": { + "coordinate": "weirdness", + "points": [ + { + "location": -0.05, + "value": 6.3, + "derivative": 0.0 + }, + { + "location": 0.05, + "value": 2.67, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.35, + "value": { + "coordinate": "weirdness", + "points": [ + { + "location": -0.2, + "value": 6.3, + "derivative": 0.0 + }, + { + "location": 0.2, + "value": 5.47, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.25, + "value": { + "coordinate": "weirdness", + "points": [ + { + "location": -0.2, + "value": 6.3, + "derivative": 0.0 + }, + { + "location": 0.2, + "value": 5.47, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.1, + "value": { + "coordinate": "weirdness", + "points": [ + { + "location": -0.05, + "value": 2.67, + "derivative": 0.0 + }, + { + "location": 0.05, + "value": 6.3, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.03, + "value": { + "coordinate": "weirdness", + "points": [ + { + "location": -0.2, + "value": 6.3, + "derivative": 0.0 + }, + { + "location": 0.2, + "value": 5.47, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.35, + "value": 5.47, + "derivative": 0.0 + }, + { + "location": 0.45, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -0.9, + "value": 5.47, + "derivative": 0.0 + }, + { + "location": -0.69, + "value": { + "coordinate": "weirdness", + "points": [ + { + "location": 0.0, + "value": 5.47, + "derivative": 0.0 + }, + { + "location": 0.1, + "value": 0.625, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.55, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -0.9, + "value": 5.47, + "derivative": 0.0 + }, + { + "location": -0.69, + "value": { + "coordinate": "weirdness", + "points": [ + { + "location": 0.0, + "value": 5.47, + "derivative": 0.0 + }, + { + "location": 0.1, + "value": 0.625, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.62, + "value": 5.47, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.03, + "value": { + "coordinate": "erosion", + "points": [ + { + "location": -0.6, + "value": { + "coordinate": "weirdness", + "points": [ + { + "location": -0.2, + "value": 6.3, + "derivative": 0.0 + }, + { + "location": 0.2, + "value": 5.08, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.5, + "value": { + "coordinate": "weirdness", + "points": [ + { + "location": -0.05, + "value": 6.3, + "derivative": 0.0 + }, + { + "location": 0.05, + "value": 2.67, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.35, + "value": { + "coordinate": "weirdness", + "points": [ + { + "location": -0.2, + "value": 6.3, + "derivative": 0.0 + }, + { + "location": 0.2, + "value": 5.08, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.25, + "value": { + "coordinate": "weirdness", + "points": [ + { + "location": -0.2, + "value": 6.3, + "derivative": 0.0 + }, + { + "location": 0.2, + "value": 5.08, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.1, + "value": { + "coordinate": "weirdness", + "points": [ + { + "location": -0.05, + "value": 2.67, + "derivative": 0.0 + }, + { + "location": 0.05, + "value": 6.3, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.03, + "value": { + "coordinate": "weirdness", + "points": [ + { + "location": -0.2, + "value": 6.3, + "derivative": 0.0 + }, + { + "location": 0.2, + "value": 5.08, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.35, + "value": 5.08, + "derivative": 0.0 + }, + { + "location": 0.45, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -0.9, + "value": 5.08, + "derivative": 0.0 + }, + { + "location": -0.69, + "value": { + "coordinate": "weirdness", + "points": [ + { + "location": 0.0, + "value": 5.08, + "derivative": 0.0 + }, + { + "location": 0.1, + "value": 0.625, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.55, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -0.9, + "value": 5.08, + "derivative": 0.0 + }, + { + "location": -0.69, + "value": { + "coordinate": "weirdness", + "points": [ + { + "location": 0.0, + "value": 5.08, + "derivative": 0.0 + }, + { + "location": 0.1, + "value": 0.625, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.62, + "value": 5.08, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.06, + "value": { + "coordinate": "erosion", + "points": [ + { + "location": -0.6, + "value": { + "coordinate": "weirdness", + "points": [ + { + "location": -0.2, + "value": 6.3, + "derivative": 0.0 + }, + { + "location": 0.2, + "value": 4.69, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.5, + "value": { + "coordinate": "weirdness", + "points": [ + { + "location": -0.05, + "value": 6.3, + "derivative": 0.0 + }, + { + "location": 0.05, + "value": 2.67, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.35, + "value": { + "coordinate": "weirdness", + "points": [ + { + "location": -0.2, + "value": 6.3, + "derivative": 0.0 + }, + { + "location": 0.2, + "value": 4.69, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.25, + "value": { + "coordinate": "weirdness", + "points": [ + { + "location": -0.2, + "value": 6.3, + "derivative": 0.0 + }, + { + "location": 0.2, + "value": 4.69, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.1, + "value": { + "coordinate": "weirdness", + "points": [ + { + "location": -0.05, + "value": 2.67, + "derivative": 0.0 + }, + { + "location": 0.05, + "value": 6.3, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.03, + "value": { + "coordinate": "weirdness", + "points": [ + { + "location": -0.2, + "value": 6.3, + "derivative": 0.0 + }, + { + "location": 0.2, + "value": 4.69, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.05, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": 0.45, + "value": { + "coordinate": "weirdness", + "points": [ + { + "location": -0.2, + "value": 6.3, + "derivative": 0.0 + }, + { + "location": 0.2, + "value": 4.69, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.7, + "value": 1.56, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.4, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": 0.45, + "value": { + "coordinate": "weirdness", + "points": [ + { + "location": -0.2, + "value": 6.3, + "derivative": 0.0 + }, + { + "location": 0.2, + "value": 4.69, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.7, + "value": 1.56, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.45, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -0.7, + "value": { + "coordinate": "weirdness", + "points": [ + { + "location": -0.2, + "value": 6.3, + "derivative": 0.0 + }, + { + "location": 0.2, + "value": 4.69, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.15, + "value": 1.37, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.55, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": -0.7, + "value": { + "coordinate": "weirdness", + "points": [ + { + "location": -0.2, + "value": 6.3, + "derivative": 0.0 + }, + { + "location": 0.2, + "value": 4.69, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.15, + "value": 1.37, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.58, + "value": 4.69, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + } + ] + }, + "jaggedness": { + "coordinate": "continents", + "points": [ + { + "location": -0.11, + "value": 0.0, + "derivative": 0.0 + }, + { + "location": 0.03, + "value": { + "coordinate": "erosion", + "points": [ + { + "location": -1.0, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": 0.19999999, + "value": 0.0, + "derivative": 0.0 + }, + { + "location": 0.44999996, + "value": 0.0, + "derivative": 0.0 + }, + { + "location": 1.0, + "value": { + "coordinate": "weirdness", + "points": [ + { + "location": -0.01, + "value": 0.63, + "derivative": 0.0 + }, + { + "location": 0.01, + "value": 0.3, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.78, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": 0.19999999, + "value": 0.0, + "derivative": 0.0 + }, + { + "location": 0.44999996, + "value": 0.0, + "derivative": 0.0 + }, + { + "location": 1.0, + "value": { + "coordinate": "weirdness", + "points": [ + { + "location": -0.01, + "value": 0.315, + "derivative": 0.0 + }, + { + "location": 0.01, + "value": 0.15, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.5775, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": 0.19999999, + "value": 0.0, + "derivative": 0.0 + }, + { + "location": 0.44999996, + "value": 0.0, + "derivative": 0.0 + }, + { + "location": 1.0, + "value": { + "coordinate": "weirdness", + "points": [ + { + "location": -0.01, + "value": 0.315, + "derivative": 0.0 + }, + { + "location": 0.01, + "value": 0.15, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.375, + "value": 0.0, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 0.65, + "value": { + "coordinate": "erosion", + "points": [ + { + "location": -1.0, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": 0.19999999, + "value": 0.0, + "derivative": 0.0 + }, + { + "location": 0.44999996, + "value": { + "coordinate": "weirdness", + "points": [ + { + "location": -0.01, + "value": 0.63, + "derivative": 0.0 + }, + { + "location": 0.01, + "value": 0.3, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": 1.0, + "value": { + "coordinate": "weirdness", + "points": [ + { + "location": -0.01, + "value": 0.63, + "derivative": 0.0 + }, + { + "location": 0.01, + "value": 0.3, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.78, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": 0.19999999, + "value": 0.0, + "derivative": 0.0 + }, + { + "location": 0.44999996, + "value": 0.0, + "derivative": 0.0 + }, + { + "location": 1.0, + "value": { + "coordinate": "weirdness", + "points": [ + { + "location": -0.01, + "value": 0.63, + "derivative": 0.0 + }, + { + "location": 0.01, + "value": 0.3, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.5775, + "value": { + "coordinate": "ridges", + "points": [ + { + "location": 0.19999999, + "value": 0.0, + "derivative": 0.0 + }, + { + "location": 0.44999996, + "value": 0.0, + "derivative": 0.0 + }, + { + "location": 1.0, + "value": { + "coordinate": "weirdness", + "points": [ + { + "location": -0.01, + "value": 0.63, + "derivative": 0.0 + }, + { + "location": 0.01, + "value": 0.3, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + }, + { + "location": -0.375, + "value": 0.0, + "derivative": 0.0 + } + ] + }, + "derivative": 0.0 + } + ] + } + }, + "min_y": -64, + "height": 384, + "sampling": { + "xz_scale": 1.0, + "y_scale": 1.0, + "xz_factor": 80.0, + "y_factor": 160.0 + }, + "top_slide": { + "target": -0.078125, + "size": 2, + "offset": 8 + } + }, + "default_block": { + "Name": "minecraft:stone" + } +} \ No newline at end of file diff --git a/src/main/resources/data/immersiveweapons/worldgen/placed_feature/burned_oak_tree.json b/src/main/resources/data/immersiveweapons/worldgen/placed_feature/burned_oak_tree.json new file mode 100644 index 000000000..1f9e567e9 --- /dev/null +++ b/src/main/resources/data/immersiveweapons/worldgen/placed_feature/burned_oak_tree.json @@ -0,0 +1,47 @@ +{ + "feature": "immersiveweapons:burned_oak_tree", + "placement": [ + { + "count": { + "distribution": [ + { + "data": 0, + "weight": 7 + }, + { + "data": 1, + "weight": 1 + } + ], + "type": "minecraft:weighted_list" + }, + "type": "minecraft:count" + }, + { + "type": "minecraft:in_square" + }, + { + "max_water_depth": 0, + "type": "minecraft:surface_water_depth_filter" + }, + { + "heightmap": "OCEAN_FLOOR", + "type": "minecraft:heightmap" + }, + { + "predicate": { + "state": { + "Properties": { + "stage": "0" + }, + "Name": "minecraft:oak_sapling" + }, + "type": "minecraft:would_survive" + }, + "type": "minecraft:block_predicate_filter" + }, + { + "type": "minecraft:biome" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/immersiveweapons/worldgen/placed_feature/patch_wooden_spikes.json b/src/main/resources/data/immersiveweapons/worldgen/placed_feature/patch_wooden_spikes.json new file mode 100644 index 000000000..e3979ec2b --- /dev/null +++ b/src/main/resources/data/immersiveweapons/worldgen/placed_feature/patch_wooden_spikes.json @@ -0,0 +1,19 @@ +{ + "feature": "immersiveweapons:patch_wooden_spikes", + "placement": [ + { + "chance": 16, + "type": "minecraft:rarity_filter" + }, + { + "type": "minecraft:in_square" + }, + { + "heightmap": "MOTION_BLOCKING", + "type": "minecraft:heightmap" + }, + { + "type": "minecraft:biome" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/immersiveweapons/worldgen/structure_set/abandoned_factory.json b/src/main/resources/data/immersiveweapons/worldgen/structure_set/abandoned_factory.json new file mode 100644 index 000000000..75b63a142 --- /dev/null +++ b/src/main/resources/data/immersiveweapons/worldgen/structure_set/abandoned_factory.json @@ -0,0 +1,14 @@ +{ + "structures": [ + { + "structure": "immersiveweapons:abandoned_factory", + "weight": 1 + } + ], + "placement": { + "salt": 959874384, + "spacing": 60, + "separation": 40, + "type": "minecraft:random_spread" + } +} \ No newline at end of file diff --git a/src/main/resources/data/immersiveweapons/worldgen/structure_set/battlefield_camp.json b/src/main/resources/data/immersiveweapons/worldgen/structure_set/battlefield_camp.json new file mode 100644 index 000000000..94cec6d55 --- /dev/null +++ b/src/main/resources/data/immersiveweapons/worldgen/structure_set/battlefield_camp.json @@ -0,0 +1,14 @@ +{ + "structures": [ + { + "structure": "immersiveweapons:battlefield_camp", + "weight": 1 + } + ], + "placement": { + "salt": 458962175, + "spacing": 12, + "separation": 5, + "type": "minecraft:random_spread" + } +} \ No newline at end of file diff --git a/src/main/resources/data/immersiveweapons/worldgen/structure_set/battlefield_town.json b/src/main/resources/data/immersiveweapons/worldgen/structure_set/battlefield_town.json new file mode 100644 index 000000000..49b9dd720 --- /dev/null +++ b/src/main/resources/data/immersiveweapons/worldgen/structure_set/battlefield_town.json @@ -0,0 +1,14 @@ +{ + "structures": [ + { + "structure": "immersiveweapons:battlefield_town", + "weight": 1 + } + ], + "placement": { + "salt": 176482913, + "spacing": 34, + "separation": 8, + "type": "minecraft:random_spread" + } +} \ No newline at end of file diff --git a/src/main/resources/data/immersiveweapons/worldgen/structure_set/bear_trap.json b/src/main/resources/data/immersiveweapons/worldgen/structure_set/bear_trap.json new file mode 100644 index 000000000..d9d695fdf --- /dev/null +++ b/src/main/resources/data/immersiveweapons/worldgen/structure_set/bear_trap.json @@ -0,0 +1,14 @@ +{ + "structures": [ + { + "structure": "immersiveweapons:bear_trap", + "weight": 1 + } + ], + "placement": { + "salt": 794532168, + "spacing": 7, + "separation": 2, + "type": "minecraft:random_spread" + } +} \ No newline at end of file diff --git a/src/main/resources/data/immersiveweapons/worldgen/structure_set/campsite.json b/src/main/resources/data/immersiveweapons/worldgen/structure_set/campsite.json new file mode 100644 index 000000000..2983b8f6c --- /dev/null +++ b/src/main/resources/data/immersiveweapons/worldgen/structure_set/campsite.json @@ -0,0 +1,14 @@ +{ + "structures": [ + { + "structure": "immersiveweapons:campsite", + "weight": 1 + } + ], + "placement": { + "salt": 671249835, + "spacing": 12, + "separation": 5, + "type": "minecraft:random_spread" + } +} \ No newline at end of file diff --git a/src/main/resources/data/immersiveweapons/worldgen/structure_set/cloud_island.json b/src/main/resources/data/immersiveweapons/worldgen/structure_set/cloud_island.json new file mode 100644 index 000000000..0a652cda5 --- /dev/null +++ b/src/main/resources/data/immersiveweapons/worldgen/structure_set/cloud_island.json @@ -0,0 +1,14 @@ +{ + "structures": [ + { + "structure": "immersiveweapons:cloud_island", + "weight": 1 + } + ], + "placement": { + "salt": 349821657, + "spacing": 45, + "separation": 35, + "type": "minecraft:random_spread" + } +} \ No newline at end of file diff --git a/src/main/resources/data/immersiveweapons/worldgen/structure_set/destroyed_house.json b/src/main/resources/data/immersiveweapons/worldgen/structure_set/destroyed_house.json new file mode 100644 index 000000000..c3f13e0e9 --- /dev/null +++ b/src/main/resources/data/immersiveweapons/worldgen/structure_set/destroyed_house.json @@ -0,0 +1,14 @@ +{ + "structures": [ + { + "structure": "immersiveweapons:destroyed_house", + "weight": 1 + } + ], + "placement": { + "salt": 615794356, + "spacing": 10, + "separation": 5, + "type": "minecraft:random_spread" + } +} \ No newline at end of file diff --git a/src/main/resources/data/immersiveweapons/worldgen/structure_set/graveyard.json b/src/main/resources/data/immersiveweapons/worldgen/structure_set/graveyard.json new file mode 100644 index 000000000..3f3c28674 --- /dev/null +++ b/src/main/resources/data/immersiveweapons/worldgen/structure_set/graveyard.json @@ -0,0 +1,14 @@ +{ + "structures": [ + { + "structure": "immersiveweapons:graveyard", + "weight": 1 + } + ], + "placement": { + "salt": 346751289, + "spacing": 20, + "separation": 15, + "type": "minecraft:random_spread" + } +} \ No newline at end of file diff --git a/src/main/resources/data/immersiveweapons/worldgen/structure_set/hans_hut.json b/src/main/resources/data/immersiveweapons/worldgen/structure_set/hans_hut.json new file mode 100644 index 000000000..19ef44c30 --- /dev/null +++ b/src/main/resources/data/immersiveweapons/worldgen/structure_set/hans_hut.json @@ -0,0 +1,14 @@ +{ + "structures": [ + { + "structure": "immersiveweapons:hans_hut", + "weight": 1 + } + ], + "placement": { + "salt": 5973468510, + "spacing": 20, + "separation": 10, + "type": "minecraft:random_spread" + } +} \ No newline at end of file diff --git a/src/main/resources/data/immersiveweapons/worldgen/structure_set/landmine_trap.json b/src/main/resources/data/immersiveweapons/worldgen/structure_set/landmine_trap.json new file mode 100644 index 000000000..8bf826f40 --- /dev/null +++ b/src/main/resources/data/immersiveweapons/worldgen/structure_set/landmine_trap.json @@ -0,0 +1,14 @@ +{ + "structures": [ + { + "structure": "immersiveweapons:landmine_trap", + "weight": 1 + } + ], + "placement": { + "salt": 959874384, + "spacing": 7, + "separation": 4, + "type": "minecraft:random_spread" + } +} \ No newline at end of file diff --git a/src/main/resources/data/immersiveweapons/worldgen/structure_set/pitfall_trap.json b/src/main/resources/data/immersiveweapons/worldgen/structure_set/pitfall_trap.json new file mode 100644 index 000000000..4aee31b5c --- /dev/null +++ b/src/main/resources/data/immersiveweapons/worldgen/structure_set/pitfall_trap.json @@ -0,0 +1,14 @@ +{ + "structures": [ + { + "structure": "immersiveweapons:pitfall_trap", + "weight": 1 + } + ], + "placement": { + "salt": 875412395, + "spacing": 6, + "separation": 2, + "type": "minecraft:random_spread" + } +} \ No newline at end of file diff --git a/src/main/resources/data/immersiveweapons/worldgen/structure_set/underground_bunker.json b/src/main/resources/data/immersiveweapons/worldgen/structure_set/underground_bunker.json new file mode 100644 index 000000000..7478c8f89 --- /dev/null +++ b/src/main/resources/data/immersiveweapons/worldgen/structure_set/underground_bunker.json @@ -0,0 +1,14 @@ +{ + "structures": [ + { + "structure": "immersiveweapons:underground_bunker", + "weight": 1 + } + ], + "placement": { + "salt": 548796135, + "spacing": 25, + "separation": 15, + "type": "minecraft:random_spread" + } +} \ No newline at end of file diff --git a/src/main/resources/data/immersiveweapons/worldgen/structure_set/water_tower.json b/src/main/resources/data/immersiveweapons/worldgen/structure_set/water_tower.json new file mode 100644 index 000000000..f1ef22c38 --- /dev/null +++ b/src/main/resources/data/immersiveweapons/worldgen/structure_set/water_tower.json @@ -0,0 +1,14 @@ +{ + "structures": [ + { + "structure": "immersiveweapons:water_tower", + "weight": 1 + } + ], + "placement": { + "salt": 246975135, + "spacing": 22, + "separation": 12, + "type": "minecraft:random_spread" + } +} \ No newline at end of file diff --git a/src/main/resources/data/immersiveweapons/worldgen/template_pool/battlefield_camp/start_pool.json b/src/main/resources/data/immersiveweapons/worldgen/template_pool/battlefield_camp/start_pool.json new file mode 100644 index 000000000..4a5fba9e1 --- /dev/null +++ b/src/main/resources/data/immersiveweapons/worldgen/template_pool/battlefield_camp/start_pool.json @@ -0,0 +1,16 @@ +{ + "name": "immersiveweapons:battlefield_camp/start_pool", + "fallback": "minecraft:empty", + + "elements": [ + { + "weight": 1, + "element": { + "location": "immersiveweapons:battlefield_camp", + "processors": "minecraft:empty", + "projection": "rigid", + "element_type": "minecraft:single_pool_element" + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/immersiveweapons/worldgen/template_pool/battlefield_town/start_pool.json b/src/main/resources/data/immersiveweapons/worldgen/template_pool/battlefield_town/start_pool.json new file mode 100644 index 000000000..9fb253b91 --- /dev/null +++ b/src/main/resources/data/immersiveweapons/worldgen/template_pool/battlefield_town/start_pool.json @@ -0,0 +1,16 @@ +{ + "name": "immersiveweapons:battlefield_town/start_pool", + "fallback": "minecraft:empty", + + "elements": [ + { + "weight": 1, + "element": { + "location": "immersiveweapons:battlefield_town", + "processors": "minecraft:empty", + "projection": "rigid", + "element_type": "minecraft:single_pool_element" + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/immersiveweapons/worldgen/template_pool/destroyed_house/start_pool.json b/src/main/resources/data/immersiveweapons/worldgen/template_pool/destroyed_house/start_pool.json new file mode 100644 index 000000000..f1f67167d --- /dev/null +++ b/src/main/resources/data/immersiveweapons/worldgen/template_pool/destroyed_house/start_pool.json @@ -0,0 +1,25 @@ +{ + "name": "immersiveweapons:destroyed_house/start_pool", + "fallback": "minecraft:empty", + + "elements": [ + { + "weight": 1, + "element": { + "location": "immersiveweapons:destroyed_house/house_1", + "processors": "minecraft:empty", + "projection": "rigid", + "element_type": "minecraft:single_pool_element" + } + }, + { + "weight": 1, + "element": { + "location": "immersiveweapons:destroyed_house/house_2", + "processors": "minecraft:empty", + "projection": "rigid", + "element_type": "minecraft:single_pool_element" + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/immersiveweapons/worldgen/template_pool/graveyard/start_pool.json b/src/main/resources/data/immersiveweapons/worldgen/template_pool/graveyard/start_pool.json new file mode 100644 index 000000000..ce49e8d02 --- /dev/null +++ b/src/main/resources/data/immersiveweapons/worldgen/template_pool/graveyard/start_pool.json @@ -0,0 +1,16 @@ +{ + "name": "immersiveweapons:graveyard/start_pool", + "fallback": "minecraft:empty", + + "elements": [ + { + "weight": 1, + "element": { + "location": "immersiveweapons:graveyard", + "processors": "minecraft:empty", + "projection": "rigid", + "element_type": "minecraft:single_pool_element" + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/immersiveweapons/worldgen/template_pool/hans_hut/start_pool.json b/src/main/resources/data/immersiveweapons/worldgen/template_pool/hans_hut/start_pool.json new file mode 100644 index 000000000..d076eff58 --- /dev/null +++ b/src/main/resources/data/immersiveweapons/worldgen/template_pool/hans_hut/start_pool.json @@ -0,0 +1,16 @@ +{ + "name": "immersiveweapons:hans_hut/start_pool", + "fallback": "minecraft:empty", + + "elements": [ + { + "weight": 1, + "element": { + "location": "immersiveweapons:hans_hut", + "processors": "minecraft:empty", + "projection": "rigid", + "element_type": "minecraft:single_pool_element" + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/pack.mcmeta b/src/main/resources/pack.mcmeta index ef249998b..80f864bb2 100644 --- a/src/main/resources/pack.mcmeta +++ b/src/main/resources/pack.mcmeta @@ -1,6 +1,6 @@ { "pack": { "description": "Immersive Weapons resources", - "pack_format": 8 + "pack_format": 9 } } \ No newline at end of file diff --git a/update.json b/update.json index 4e287ec90..66652400e 100644 --- a/update.json +++ b/update.json @@ -1,6 +1,8 @@ { "homepage": "https://www.curseforge.com/minecraft/mc-mods/immersive-weapons", "promos": { + "1.18.2-latest": "1.18.2-1.15.0-alpha1", + "1.18.2-recommended": "1.18.2-1.15.0-alpha1", "1.18.1-latest": "1.18.1-1.14.0-alpha1", "1.18.1-recommended": "1.18.1-1.13.0-beta10", "1.18-latest": "1.18.1-1.13.0-beta9", @@ -12,6 +14,9 @@ "1.16.4-latest": "1.16.5-1.1.1", "1.16.4-recommended": "1.16.5-1.1.1" }, + "1.18.2": { + "1.18.2-1.15.0-alpha1": "Initial 1.18.2 Release - https://github.com/AnonymousHacker1279/ImmersiveWeapons/releases/tag/v1.15.0-alpha1" + }, "1.18.1": { "1.18.1-1.14.0-alpha1": "Major Rewrites, Improvements, and Additions - https://github.com/AnonymousHacker1279/ImmersiveWeapons/releases/tag/v1.14.0-alpha1", "1.18.1-1.13.0-beta10": "Support Latest Forge Versions - https://github.com/AnonymousHacker1279/ImmersiveWeapons/releases/tag/v1.13.0-beta10",