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