diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c26c01a..0a56402 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - - uses: gradle/wrapper-validation-action@v1 + - uses: gradle/actions/wrapper-validation@v3 - uses: actions/setup-java@v4 with: java-version: '21' diff --git a/README.md b/README.md index 78e5b64..7687207 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,29 @@ -
- -
- -Logo - -### Hollow +# Hollow A mod about hollow logs and hollow promises fabric +quilt forge -spirit -
+Made by Spirit Studios ## 📖 About +*DISCLAIMER: Do not use the existence of this mod as an excuse to harass Mojang. The name is a joke, Mojang promised nothing.* + Have you ever seen that one birch forest concept and thought, "Wow, I wish that was actually in the game"? Well then this mod is for you. -Hollow adds in as many missing features as it can, fulfilling Mojang's hollow promises. +Hollow adds in as many missing features as it can, fulfilling Mojang's "hollow" promises. ## ❓ FAQ * Forge?
-No. Do not ask me for forge or you will be blocked instantly. + No. Do not ask us for forge or neoforge support. It isn't happening. + +* Can I use this mod in a Mod Pack?
+ Yes! Go ahead! Just make sure we are credited somewhere and don't reupload our .jar file. If you make a pack with one of our mods, we would love to know! Join our discord and tell us! + * Do you plan to add `X`?
-If it's in one of the concept art images, probably. Some features take longer than others. -If you want to suggest something, join the [discord](https://discord.gg/TTmx7d2axf). + If it's in one of the concept art images, probably. Some features take longer than others. If you want to suggest something, join the [discord](https://discord.gg/TTmx7d2axf). + * Can you port/backport to `X` version?
-Updating is a maybe. Seeing as I'm making this for fun, it comes down to whatever version I'm playing on at the time. For backports, probably not. I might do `1.19.2` as I play that a lot but other than that, no. + Updates to new versions will probably happen at some point. Porting is hard and takes time so don't expect it instantly. + Backports won't happen. Multiversion modding is hard, annoying, and not worth the effort. \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index b1b14d2..fcbd513 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,6 +1,7 @@ plugins { java - id("fabric-loom") version "1.7-SNAPSHOT" + alias(libs.plugins.fabric.loom) + alias(libs.plugins.minotaur) } class ModInfo { @@ -9,17 +10,19 @@ class ModInfo { val version = property("mod.version").toString() } -class Dependencies { - val minecraft = property("deps.minecraft").toString() - val loader = property("deps.loader").toString() - val yarn = property("deps.yarn").toString() +val mod = ModInfo() - val fabricApi = property("deps.fabricapi").toString() - val specter = property("deps.specter").toString() -} +version = mod.version +group = mod.group -val mod = ModInfo() -val deps = Dependencies() +base.archivesName = "${mod.id}-${mod.version}" + + +fabricApi { + configureDataGeneration { + client = true + } +} loom { splitEnvironmentSourceSets() @@ -31,56 +34,42 @@ loom { } } -fabricApi { - configureDataGeneration() -} - repositories { - maven("https://maven.callmeecho.dev/releases/") + mavenCentral() + maven("https://maven.spiritstudios.dev/releases/") maven("https://maven.terraformersmc.com/releases/") - maven("https://api.modrinth.com/maven/") + maven("https://maven.gegy.dev/") + + exclusiveContent { + forRepository { maven("https://api.modrinth.com/maven/") } + filter { includeGroup("maven.modrinth") } + } } dependencies { - minecraft("com.mojang:minecraft:${deps.minecraft}") - mappings("net.fabricmc:yarn:${deps.yarn}:v2") - modImplementation("net.fabricmc:fabric-loader:${deps.loader}") + minecraft(libs.minecraft) + mappings(variantOf(libs.yarn) { classifier("v2") }) + modImplementation(libs.fabric.loader) - modImplementation("net.fabricmc.fabric-api:fabric-api:${deps.fabricApi}") - - fun specterModule(name: String) { - include("dev.spiritstudios.specter:specter-$name:${deps.specter}") - modImplementation("dev.spiritstudios.specter:specter-$name:${deps.specter}") - } + modImplementation(libs.fabric.api) - specterModule("api") - specterModule("block") - specterModule("config") - specterModule("core") - specterModule("entity") - specterModule("item") - specterModule("registry") - specterModule("render") + include(libs.bundles.specter) + modImplementation(libs.bundles.specter) - modRuntimeOnly("dev.spiritstudios.specter:specter-debug:${deps.specter}") + modRuntimeOnly(libs.specter.debug) - // will be switched back to lambdynamiclights once it's updated - modCompileOnly("maven.modrinth:ryoamiclights:0.2.9+mc1.21-fabric") + modImplementation(libs.lambdynamiclights) } tasks.processResources { - inputs.property("id", mod.id) - inputs.property("version", mod.version) - inputs.property("loader_version", deps.loader) - inputs.property("minecraft_version", deps.minecraft) - val map = mapOf( - "id" to mod.id, - "version" to mod.version, - "loader_version" to deps.loader, - "minecraft_version" to deps.minecraft + "mod_id" to mod.id, + "mod_version" to mod.version, + "fabric_loader_version" to libs.versions.fabric.loader.get(), + "minecraft_version" to libs.versions.minecraft.get() ) + inputs.properties(map) filesMatching("fabric.mod.json") { expand(map) } } @@ -91,9 +80,23 @@ java { targetCompatibility = JavaVersion.VERSION_21 } - tasks.withType { options.encoding = "UTF-8" options.release = 21 } +tasks.jar { from("LICENSE") { rename { "${it}_${base.archivesName}" } } } + +modrinth { + token.set(System.getenv("MODRINTH_TOKEN")) + projectId.set(mod.id) + versionNumber.set(mod.version) + uploadFile.set(tasks.remapJar) + gameVersions.addAll(libs.versions.minecraft.get(), "1.21.1") + loaders.addAll("fabric", "quilt") + syncBodyFrom.set(rootProject.file("README.md").readText()) + dependencies { + required.version("fabric-api", libs.versions.fabric.api.get()) + optional.version("lambdynamiclights", libs.versions.lambdynamiclights.get()) + } +} diff --git a/gradle.properties b/gradle.properties index 80bb1d6..24704ad 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,13 +1,6 @@ org.gradle.jvmargs=-Xmx2G org.gradle.parallel=true -mod.version = 1.2.5 +mod.version = 1.3.0 mod.group = dev.spiritstudios -mod.id = hollow - -deps.minecraft=1.21 -deps.loader=0.15.11 -deps.yarn=1.21+build.9 - -deps.fabricapi=0.103.0+1.21.1 -deps.specter=1.0.2 \ No newline at end of file +mod.id = hollow \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 0000000..97853c8 --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,49 @@ +[versions] +fabric_loom = "1.9-SNAPSHOT" +minotaur = "2.+" + +minecraft = "1.21" +yarn = "1.21+build.9" + +fabric_loader = "0.16.5" +fabric_api = "0.109.0+1.21.1" + +specter = "1.1.1" + +lambdynamiclights = "3.1.2+1.21.1" + +[plugins] +fabric_loom = { id = "fabric-loom", version.ref = "fabric_loom" } +minotaur = { id = "com.modrinth.minotaur", version.ref = "minotaur" } + +[libraries] +minecraft = { group = "mojang", name = "minecraft", version.ref = "minecraft" } +yarn = { group = "net.fabricmc", name = "yarn", version.ref = "yarn" } + +fabric_loader = { group = "net.fabricmc", name = "fabric-loader", version.ref = "fabric_loader" } +fabric_api = { group = "net.fabricmc.fabric-api", name = "fabric-api", version.ref = "fabric_api" } + +specter_api = { group = "dev.spiritstudios.specter", name = "specter-api", version.ref = "specter" } +specter_block = { group = "dev.spiritstudios.specter", name = "specter-block", version.ref = "specter" } +specter_config = { group = "dev.spiritstudios.specter", name = "specter-config", version.ref = "specter" } +specter_core = { group = "dev.spiritstudios.specter", name = "specter-core", version.ref = "specter" } +specter_serialization = { group = "dev.spiritstudios.specter", name = "specter-serialization", version.ref = "specter" } +specter_entity = { group = "dev.spiritstudios.specter", name = "specter-entity", version.ref = "specter" } +specter_item = { group = "dev.spiritstudios.specter", name = "specter-item", version.ref = "specter" } +specter_registry = { group = "dev.spiritstudios.specter", name = "specter-registry", version.ref = "specter" } +specter_render = { group = "dev.spiritstudios.specter", name = "specter-render", version.ref = "specter" } +specter_debug = { group = "dev.spiritstudios.specter", name = "specter-debug", version.ref = "specter" } + +lambdynamiclights = { group = "dev.lambdaurora.lambdynamiclights", name = "lambdynamiclights-runtime", version.ref = "lambdynamiclights" } + +[bundles] +specter = [ + "specter_block", + "specter_config", + "specter_core", + "specter_entity", + "specter_item", + "specter_registry", + "specter_render", + "specter_serialization" +] \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index e644113..a4b76b9 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a441313..94113f2 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index b740cf1..f5feea6 100755 --- a/gradlew +++ b/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -84,7 +86,8 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum diff --git a/gradlew.bat b/gradlew.bat index 7101f8e..9b42019 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## diff --git a/settings.gradle.kts b/settings.gradle.kts index 715a7b8..cda21f4 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,7 +1,6 @@ pluginManagement { repositories { maven("https://maven.fabricmc.net/") - mavenCentral() gradlePluginPortal() } } diff --git a/src/client/java/dev/spiritstudios/hollow/HollowClient.java b/src/client/java/dev/spiritstudios/hollow/HollowClient.java index a82216f..7657730 100644 --- a/src/client/java/dev/spiritstudios/hollow/HollowClient.java +++ b/src/client/java/dev/spiritstudios/hollow/HollowClient.java @@ -1,43 +1,77 @@ package dev.spiritstudios.hollow; -import dev.spiritstudios.hollow.block.HollowLogBlock; import dev.spiritstudios.hollow.particle.FireflyJarParticle; -import dev.spiritstudios.hollow.registry.*; +import dev.spiritstudios.hollow.registry.HollowBlockEntityTypes; +import dev.spiritstudios.hollow.registry.HollowBlocks; +import dev.spiritstudios.hollow.registry.HollowEntityTypes; +import dev.spiritstudios.hollow.registry.HollowItems; +import dev.spiritstudios.hollow.registry.HollowParticleTypes; +import dev.spiritstudios.hollow.render.block.EchoingPotBlockEntityRenderer; import dev.spiritstudios.hollow.render.entity.FireflyEntityRenderer; import dev.spiritstudios.hollow.render.entity.JarBlockEntityRenderer; -import dev.spiritstudios.specter.api.ModMenuHelper; -import dev.spiritstudios.specter.api.core.util.ReflectionHelper; +import dev.spiritstudios.specter.api.config.ModMenuHelper; import net.fabricmc.api.ClientModInitializer; -import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap; import net.fabricmc.fabric.api.client.particle.v1.ParticleFactoryRegistry; import net.fabricmc.fabric.api.client.rendering.v1.ColorProviderRegistry; import net.fabricmc.fabric.api.client.rendering.v1.EntityRendererRegistry; +import net.minecraft.client.color.world.BiomeColors; import net.minecraft.client.item.ModelPredicateProviderRegistry; -import net.minecraft.client.render.RenderLayer; import net.minecraft.client.render.block.entity.BlockEntityRendererFactories; import net.minecraft.util.Identifier; +import net.minecraft.world.biome.GrassColors; public class HollowClient implements ClientModInitializer { @Override public void onInitializeClient() { - EntityRendererRegistry.register(HollowEntityTypeRegistrar.FIREFLY, FireflyEntityRenderer::new); + ModMenuHelper.addConfig(Hollow.MODID, HollowConfig.HOLDER.id()); + + EntityRendererRegistry.register(HollowEntityTypes.FIREFLY, FireflyEntityRenderer::new); + + ParticleFactoryRegistry.getInstance().register( + HollowParticleTypes.FIREFLY_JAR, + FireflyJarParticle.Factory::new + ); ModelPredicateProviderRegistry.register( - HollowItemRegistrar.COPPER_HORN, + HollowItems.COPPER_HORN, Identifier.ofVanilla("tooting"), (stack, world, entity, seed) -> entity != null && entity.isUsingItem() && entity.getActiveItem() == stack ? 1.0F : 0.0F ); - BlockEntityRendererFactories.register(HollowBlockEntityRegistrar.JAR_BLOCK_ENTITY, JarBlockEntityRenderer::new); + // region Color Providers + ColorProviderRegistry.ITEM.register( + (stack, tintIndex) -> tintIndex == 0 ? 0x71C35C : -1, + HollowItems.GIANT_LILYPAD, HollowItems.LOTUS_LILYPAD + ); + + ColorProviderRegistry.BLOCK.register( + (state, world, pos, tintIndex) -> + world != null && pos != null ? 0x208030 : 0x71C35C, + HollowBlocks.GIANT_LILYPAD, HollowBlocks.LOTUS_LILYPAD + ); - ColorProviderRegistry.BLOCK.register((state, world, pos, tintIndex) -> world != null && pos != null ? 0x208030 : 0x71C35C, HollowBlockRegistrar.LOTUS_LILYPAD); - ColorProviderRegistry.ITEM.register((stack, tintIndex) -> tintIndex == 0 ? 0x71C35C : -1, HollowItemRegistrar.LOTUS_LILYPAD); - ColorProviderRegistry.BLOCK.register((state, world, pos, tintIndex) -> world != null && pos != null ? 0x208030 : 0x71C35C, HollowBlockRegistrar.GIANT_LILYPAD); - ColorProviderRegistry.ITEM.register((stack, tintIndex) -> tintIndex == 0 ? 0x71C35C : -1, HollowItemRegistrar.GIANT_LILYPAD); +// ColorProviderRegistry.BLOCK.register((state, world, pos, tintIndex) -> +// tintIndex != 0 ? +// world != null && pos != null ? BiomeColors.getGrassColor(world, pos) : GrassColors.getDefaultColor() : +// -1, +// HollowBlocks.BLUE_WILDFLOWER, +// HollowBlocks.WHITE_WILDFLOWER, +// HollowBlocks.PURPLE_WILDFLOWER, +// HollowBlocks.PINK_WILDFLOWER +// ); + // endregion - ParticleFactoryRegistry.getInstance().register(HollowParticleRegistrar.FIREFLY_JAR, FireflyJarParticle.Factory::new); + // region Block Entity Renderers + BlockEntityRendererFactories.register( + HollowBlockEntityTypes.JAR_BLOCK_ENTITY, + JarBlockEntityRenderer::new + ); - ModMenuHelper.addConfig(Hollow.MODID, HollowConfig.INSTANCE.getId()); + BlockEntityRendererFactories.register( + HollowBlockEntityTypes.ECHOING_POT_BLOCK_ENTITY, + EchoingPotBlockEntityRenderer::new + ); + // endregion } } \ No newline at end of file diff --git a/src/client/java/dev/spiritstudios/hollow/HollowDynamicLights.java b/src/client/java/dev/spiritstudios/hollow/HollowDynamicLights.java index bfe0c9f..556df17 100644 --- a/src/client/java/dev/spiritstudios/hollow/HollowDynamicLights.java +++ b/src/client/java/dev/spiritstudios/hollow/HollowDynamicLights.java @@ -1,13 +1,17 @@ package dev.spiritstudios.hollow; -import dev.spiritstudios.hollow.registry.HollowEntityTypeRegistrar; +import dev.lambdaurora.lambdynlights.api.DynamicLightHandlers; +import dev.lambdaurora.lambdynlights.api.item.ItemLightSourceManager; +import dev.spiritstudios.hollow.registry.HollowEntityTypes; import dev.lambdaurora.lambdynlights.api.DynamicLightsInitializer; import net.minecraft.util.math.MathHelper; -import org.thinkingstudio.ryoamiclights.api.DynamicLightHandlers; public class HollowDynamicLights implements DynamicLightsInitializer { @Override - public void onInitializeDynamicLights() { - DynamicLightHandlers.registerDynamicLightHandler(HollowEntityTypeRegistrar.FIREFLY, (entity) -> (int) MathHelper.clampedLerp(15.0F, 0.0F, (1.0F - entity.getLightTicks() / 10.0F))); + public void onInitializeDynamicLights(ItemLightSourceManager itemLightSourceManager) { + DynamicLightHandlers.registerDynamicLightHandler( + HollowEntityTypes.FIREFLY, + entity -> (int) MathHelper.clampedLerp(15.0F, 0.0F, (1.0F - entity.getLightTicks() / 10.0F)) + ); } } diff --git a/src/client/java/dev/spiritstudios/hollow/datagen/ClientBlockMetatagProvider.java b/src/client/java/dev/spiritstudios/hollow/datagen/ClientBlockMetatagProvider.java new file mode 100644 index 0000000..94d86a9 --- /dev/null +++ b/src/client/java/dev/spiritstudios/hollow/datagen/ClientBlockMetatagProvider.java @@ -0,0 +1,60 @@ +package dev.spiritstudios.hollow.datagen; + +import dev.spiritstudios.hollow.block.HollowLogBlock; +import dev.spiritstudios.hollow.registry.HollowBlocks; +import dev.spiritstudios.specter.api.core.reflect.ReflectionHelper; +import dev.spiritstudios.specter.api.registry.metatag.datagen.MetatagProvider; +import dev.spiritstudios.specter.api.render.BlockRenderLayer; +import dev.spiritstudios.specter.api.render.RenderMetatags; +import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; +import net.minecraft.block.Block; +import net.minecraft.data.DataOutput; +import net.minecraft.registry.RegistryWrapper; + +import java.util.concurrent.CompletableFuture; +import java.util.function.Consumer; + +public class ClientBlockMetatagProvider extends MetatagProvider { + protected ClientBlockMetatagProvider(FabricDataOutput dataOutput, CompletableFuture registriesFuture) { + super(dataOutput, registriesFuture, DataOutput.OutputType.RESOURCE_PACK); + } + + @Override + protected void configure(Consumer> provider, RegistryWrapper.WrapperLookup lookup) { + MetatagBuilder renderLayer = create(RenderMetatags.RENDER_LAYER); + + ReflectionHelper.getStaticFields( + HollowBlocks.class, + HollowLogBlock.class + ).forEach(pair -> + renderLayer.put(pair.value(), BlockRenderLayer.CUTOUT_MIPPED)); + +// renderLayer.put(HollowBlocks.BLUE_WILDFLOWER, BlockRenderLayer.CUTOUT); +// renderLayer.put(HollowBlocks.WHITE_WILDFLOWER, BlockRenderLayer.CUTOUT); +// renderLayer.put(HollowBlocks.PURPLE_WILDFLOWER, BlockRenderLayer.CUTOUT); +// renderLayer.put(HollowBlocks.PINK_WILDFLOWER, BlockRenderLayer.CUTOUT); + renderLayer.put(HollowBlocks.PAEONIA, BlockRenderLayer.CUTOUT); + renderLayer.put(HollowBlocks.POTTED_PAEONIA, BlockRenderLayer.CUTOUT); + renderLayer.put(HollowBlocks.ROOTED_ORCHID, BlockRenderLayer.CUTOUT); + renderLayer.put(HollowBlocks.POTTED_ROOTED_ORCHID, BlockRenderLayer.CUTOUT); + renderLayer.put(HollowBlocks.CAMPION, BlockRenderLayer.CUTOUT); + + renderLayer.put(HollowBlocks.LOTUS_LILYPAD, BlockRenderLayer.CUTOUT); + renderLayer.put(HollowBlocks.GIANT_LILYPAD, BlockRenderLayer.CUTOUT); + + renderLayer.put(HollowBlocks.TWIG, BlockRenderLayer.CUTOUT); + renderLayer.put(HollowBlocks.POLYPORE, BlockRenderLayer.CUTOUT); + renderLayer.put(HollowBlocks.CATTAIL, BlockRenderLayer.CUTOUT); + renderLayer.put(HollowBlocks.CATTAIL_STEM, BlockRenderLayer.CUTOUT); + + renderLayer.put(HollowBlocks.JAR, BlockRenderLayer.CUTOUT_MIPPED); + renderLayer.put(HollowBlocks.FIREFLY_JAR, BlockRenderLayer.CUTOUT_MIPPED); + + provider.accept(renderLayer); + } + + @Override + public String getName() { + return super.getName() + " for Blocks (Client)"; + } +} diff --git a/src/client/java/dev/spiritstudios/hollow/datagen/HollowDatagen.java b/src/client/java/dev/spiritstudios/hollow/datagen/HollowDatagen.java new file mode 100644 index 0000000..edddacb --- /dev/null +++ b/src/client/java/dev/spiritstudios/hollow/datagen/HollowDatagen.java @@ -0,0 +1,44 @@ +package dev.spiritstudios.hollow.datagen; + +import dev.spiritstudios.hollow.datagen.tag.BiomeTagProvider; +import dev.spiritstudios.hollow.datagen.tag.BlockTagProvider; +import dev.spiritstudios.hollow.datagen.tag.EntityTypeTagProvider; +import dev.spiritstudios.hollow.worldgen.feature.HollowConfiguredFeatures; +import dev.spiritstudios.hollow.worldgen.feature.HollowPlacedFeatures; +import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint; +import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator; +import net.minecraft.registry.RegistryBuilder; +import net.minecraft.registry.RegistryKeys; + +public class HollowDatagen implements DataGeneratorEntrypoint { + @Override + public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator) { + FabricDataGenerator.Pack pack = fabricDataGenerator.createPack(); + + pack.addProvider(AdvancementProvider::new); + + pack.addProvider(ModelProvider::new); + pack.addProvider(ClientBlockMetatagProvider::new); + + pack.addProvider(LootTableProvider::new); + pack.addProvider(RecipeProvider::new); + + pack.addProvider(ConfiguredFeatureProvider::new); + pack.addProvider(PlacedFeatureProvider::new); + + pack.addProvider(BlockMetatagProvider::new); + + pack.addProvider(BlockTagProvider::new); + pack.addProvider(BiomeTagProvider::new); + pack.addProvider(EntityTypeTagProvider::new); + } + + @Override + public void buildRegistry(RegistryBuilder registryBuilder) { + registryBuilder + .addRegistry(RegistryKeys.CONFIGURED_FEATURE, HollowConfiguredFeatures::bootstrap) + .addRegistry(RegistryKeys.PLACED_FEATURE, HollowPlacedFeatures::bootstrap); + } + + +} diff --git a/src/client/java/dev/spiritstudios/hollow/mixin/client/BackgroundRendererMixin.java b/src/client/java/dev/spiritstudios/hollow/mixin/client/BackgroundRendererMixin.java index bdd68bd..84f8c6a 100644 --- a/src/client/java/dev/spiritstudios/hollow/mixin/client/BackgroundRendererMixin.java +++ b/src/client/java/dev/spiritstudios/hollow/mixin/client/BackgroundRendererMixin.java @@ -1,12 +1,14 @@ package dev.spiritstudios.hollow.mixin.client; import com.llamalad7.mixinextras.sugar.Local; -import dev.spiritstudios.hollow.HollowTags; -import dev.spiritstudios.specter.api.core.util.Easing; +import dev.spiritstudios.hollow.HollowConfig; +import dev.spiritstudios.hollow.data.HollowBiomeTags; +import dev.spiritstudios.specter.api.core.math.Easing; import net.minecraft.block.enums.CameraSubmersionType; -import net.minecraft.client.MinecraftClient; import net.minecraft.client.render.BackgroundRenderer; import net.minecraft.client.render.Camera; +import net.minecraft.client.render.FogShape; +import net.minecraft.entity.Entity; import net.minecraft.util.math.MathHelper; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Unique; @@ -15,7 +17,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(BackgroundRenderer.class) -public class BackgroundRendererMixin { +public abstract class BackgroundRendererMixin { @Unique private static float prevEnd; @@ -25,6 +27,9 @@ public class BackgroundRendererMixin { @Unique private static float transitionProgress; + @Unique + private static final float DURATION = 50F; + @Inject(method = "applyFog", at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/systems/RenderSystem;setShaderFogStart(F)V", shift = At.Shift.BEFORE)) private static void applyCloserFog( Camera camera, @@ -33,34 +38,39 @@ private static void applyCloserFog( boolean thickFog, float tickDelta, CallbackInfo ci, - @Local BackgroundRenderer.FogData fogData + @Local BackgroundRenderer.FogData fogData, + @Local Entity entity ) { + if (!HollowConfig.INSTANCE.closerFog.get()) return; if (camera.getSubmersionType() == CameraSubmersionType.WATER) return; + boolean closerFog = entity.getWorld().getBiome(entity.getBlockPos()).isIn(HollowBiomeTags.HAS_CLOSER_FOG); - if (MinecraftClient.getInstance().world != null && MinecraftClient.getInstance().player != null && MinecraftClient.getInstance().world.getBiome(MinecraftClient.getInstance().player.getBlockPos()).isIn(HollowTags.CLOSER_FOG)) { + if (closerFog) { if (prevStart == 0.0F && prevEnd == 0.0F) { prevEnd = fogData.fogEnd; prevStart = fogData.fogStart; transitionProgress = 0.0F; } - fogData.fogStart = -8; - fogData.fogEnd = 92.0F; + transitionProgress += tickDelta; + } else if (transitionProgress > 0.0F) transitionProgress -= tickDelta; - transitionProgress += tickDelta * 0.05F; - transitionProgress = MathHelper.clamp(transitionProgress, 0.0F, 1.0F); + if (transitionProgress > 0.0F) { + fogData.fogStart = (float) Easing.QUINT.out( + transitionProgress, + prevStart, viewDistance * 0.05F, + DURATION + ); - fogData.fogStart = (float) Easing.QUAD.inOut(transitionProgress, prevStart, fogData.fogStart, 1.0F); - fogData.fogEnd = (float) Easing.QUAD.inOut(transitionProgress, prevEnd, fogData.fogEnd, 1.0F); - } else if (transitionProgress > 0.0F) { - transitionProgress -= tickDelta * 0.05F; - transitionProgress = MathHelper.clamp(transitionProgress, 0.0F, 1.0F); + fogData.fogEnd = (float) Easing.QUINT.out( + transitionProgress, + prevEnd, Math.min(viewDistance, 148) * 0.5F, + DURATION + ); - fogData.fogStart = -8; - fogData.fogEnd = 92.0F; - - fogData.fogStart = (float) Easing.QUAD.inOut(transitionProgress, prevStart, fogData.fogStart, 1.0F); - fogData.fogEnd = (float) Easing.QUAD.inOut(transitionProgress, prevEnd, fogData.fogEnd, 1.0F); + fogData.fogShape = FogShape.SPHERE; } + + transitionProgress = MathHelper.clamp(transitionProgress, 0.0F, DURATION); } } diff --git a/src/client/java/dev/spiritstudios/hollow/particle/FireflyJarParticle.java b/src/client/java/dev/spiritstudios/hollow/particle/FireflyJarParticle.java index f63b65e..ce76c00 100644 --- a/src/client/java/dev/spiritstudios/hollow/particle/FireflyJarParticle.java +++ b/src/client/java/dev/spiritstudios/hollow/particle/FireflyJarParticle.java @@ -13,9 +13,9 @@ public class FireflyJarParticle extends SpriteBillboardParticle { protected FireflyJarParticle(ClientWorld clientWorld, double x, double y, double z) { super(clientWorld, x, y, z); this.maxAge = 400; - this.red = 0.101960786f; - this.green = 0.11764706f; - this.blue = 0.105882354f; + this.red = 26 / 255F; + this.green = 30 / 255F; + this.blue = 27 / 255F; xMover = clientWorld.random.nextBoolean(); counterClockwise = clientWorld.random.nextBoolean(); diff --git a/src/client/java/dev/spiritstudios/hollow/render/block/EchoingPotBlockEntityRenderer.java b/src/client/java/dev/spiritstudios/hollow/render/block/EchoingPotBlockEntityRenderer.java new file mode 100644 index 0000000..6380d92 --- /dev/null +++ b/src/client/java/dev/spiritstudios/hollow/render/block/EchoingPotBlockEntityRenderer.java @@ -0,0 +1,55 @@ +package dev.spiritstudios.hollow.render.block; + +import dev.spiritstudios.hollow.block.entity.EchoingPotBlockEntity; +import dev.spiritstudios.specter.api.render.block.BlockModelBlockEntityRenderer; +import net.minecraft.block.entity.DecoratedPotBlockEntity; +import net.minecraft.client.render.RenderLayers; +import net.minecraft.client.render.VertexConsumer; +import net.minecraft.client.render.VertexConsumerProvider; +import net.minecraft.client.render.block.BlockRenderManager; +import net.minecraft.client.render.block.entity.BlockEntityRenderer; +import net.minecraft.client.render.block.entity.BlockEntityRendererFactory; +import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.RotationAxis; + +import java.util.Objects; + +public class EchoingPotBlockEntityRenderer extends BlockModelBlockEntityRenderer { + + public EchoingPotBlockEntityRenderer(BlockEntityRendererFactory.Context context) { + super(context); + } + + @Override + public void render(EchoingPotBlockEntity entity, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay) { + matrices.push(); + + DecoratedPotBlockEntity.WobbleType wobbleType = entity.lastWobbleType; + if (wobbleType != null && entity.getWorld() != null) { + float wobbleProgress = ((float) (entity.getWorld().getTime() - entity.lastWobbleTime) + tickDelta) / (float) wobbleType.lengthInTicks; + if (wobbleProgress >= 0.0F && wobbleProgress <= 1.0F) { + if (wobbleType == DecoratedPotBlockEntity.WobbleType.POSITIVE) { + float progressRadians = wobbleProgress * MathHelper.TAU; + + matrices.multiply( + RotationAxis.POSITIVE_X.rotation((-1.5F * (MathHelper.cos(progressRadians) + 0.5F) * MathHelper.sin(progressRadians / 2.0F)) * 0.015625F), + 0.5F, 0.0F, 0.5F + ); + + matrices.multiply( + RotationAxis.POSITIVE_Z.rotation(MathHelper.sin(progressRadians) * 0.015625F), + 0.5F, 0.0F, 0.5F + ); + } else matrices.multiply( + RotationAxis.POSITIVE_Y.rotation(MathHelper.sin(-wobbleProgress * 3.0F * MathHelper.PI) * 0.125F * (1.0F - wobbleProgress)), + 0.5F, 0.0F, 0.5F + ); + } + } + + renderBlockModel(entity, matrices, vertexConsumers, light, overlay); + + matrices.pop(); + } +} diff --git a/src/client/java/dev/spiritstudios/hollow/render/entity/FireflyEntityRenderer.java b/src/client/java/dev/spiritstudios/hollow/render/entity/FireflyEntityRenderer.java index 940a9e0..dca3811 100644 --- a/src/client/java/dev/spiritstudios/hollow/render/entity/FireflyEntityRenderer.java +++ b/src/client/java/dev/spiritstudios/hollow/render/entity/FireflyEntityRenderer.java @@ -1,5 +1,6 @@ package dev.spiritstudios.hollow.render.entity; +import dev.spiritstudios.hollow.Hollow; import dev.spiritstudios.hollow.entity.FireflyEntity; import net.minecraft.client.render.OverlayTexture; import net.minecraft.client.render.RenderLayer; @@ -10,14 +11,11 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.util.Identifier; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.ColorHelper; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.RotationAxis; -import static dev.spiritstudios.hollow.Hollow.MODID; - public class FireflyEntityRenderer extends EntityRenderer { - private static final Identifier TEXTURE = Identifier.of(MODID, "textures/entity/firefly.png"); + private static final Identifier TEXTURE = Hollow.id("textures/entity/firefly.png"); private static final RenderLayer LAYER = RenderLayer.getEntityCutoutNoCull(TEXTURE); public FireflyEntityRenderer(EntityRendererFactory.Context ctx) { @@ -32,18 +30,42 @@ public Identifier getTexture(FireflyEntity entity) { @Override public void render(FireflyEntity entity, float yaw, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light) { super.render(entity, yaw, tickDelta, matrices, vertexConsumers, light); - + matrices.push(); matrices.multiply(this.dispatcher.getRotation()); matrices.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(180.0F)); - + VertexConsumer vertexConsumer = vertexConsumers.getBuffer(LAYER); - - renderVertex(vertexConsumer, matrices.peek(), 0.0F, 0.0F, 0, 1, entity, light); - renderVertex(vertexConsumer, matrices.peek(), 1.0F, 0.0F, 1, 1, entity, light); - renderVertex(vertexConsumer, matrices.peek(), 1.0F, 1.0F, 1, 0, entity, light); - renderVertex(vertexConsumer, matrices.peek(), 0.0F, 1.0F, 0, 0, entity, light); - + + boolean isJeb = entity.hasCustomName() && "jeb_".equals(entity.getName().getString()); + + float delta = MathHelper.clampedLerp( + 0.0F, + 1.0F, + 1.0F - entity.getLightTicks() / 10.0F + ); + + float r = !isJeb ? + MathHelper.lerp(delta, 146, 48) : + MathHelper.sin(entity.age * 0.1F) * 128F + 128F; + + float g = !isJeb ? + MathHelper.lerp(delta, 207, 53) : + MathHelper.sin(entity.age * 0.1F + (240.0F * MathHelper.RADIANS_PER_DEGREE)) * 128.0F + 128.0F; + + float b = !isJeb ? + MathHelper.lerp(delta, 64, 47) : + MathHelper.sin(entity.age * 0.1F + (120.0F * MathHelper.RADIANS_PER_DEGREE)) * 128.0F + 128.0F; + + r /= 255F; + g /= 255F; + b /= 255F; + + renderVertex(vertexConsumer, matrices.peek(), 0.0F, 0.0F, 0, 1, light, r, g, b); + renderVertex(vertexConsumer, matrices.peek(), 1.0F, 0.0F, 1, 1, light, r, g, b); + renderVertex(vertexConsumer, matrices.peek(), 1.0F, 1.0F, 1, 0, light, r, g, b); + renderVertex(vertexConsumer, matrices.peek(), 0.0F, 1.0F, 0, 0, light, r, g, b); + matrices.scale(1.25F, 1.25F, 1.25F); matrices.pop(); } @@ -53,25 +75,20 @@ protected int getBlockLight(FireflyEntity entity, BlockPos pos) { return 15; } - private void renderVertex(VertexConsumer vertexConsumer, MatrixStack.Entry entry, float x, float y, float u, float v, FireflyEntity entity, int light) { - float red; - float green; - float blue; - - if (entity.hasCustomName() && "jeb_".equals(entity.getName().getString())) { - red = MathHelper.sin(entity.age * 0.1F) * 128.0F + 128.0F; - green = MathHelper.sin(entity.age * 0.1F + (float) Math.toRadians(120.0F)) * 128.0F + 128.0F; - blue = MathHelper.sin(entity.age * 0.1F + (float) Math.toRadians(240.0F)) * 128.0F + 128.0F; - } else { - int color = ColorHelper.Argb.lerp(MathHelper.clampedLerp(0.0F, 15.0F, (1.0F - entity.getLightTicks() / 10.0F)) / 15.0F, 0xFF92CF40, 0xFF30352F); - - red = ColorHelper.Argb.getRed(color); - green = ColorHelper.Argb.getGreen(color); - blue = ColorHelper.Argb.getBlue(color); - } - + private void renderVertex( + VertexConsumer vertexConsumer, + MatrixStack.Entry entry, + float x, + float y, + float u, + float v, + int light, + float r, + float g, + float b + ) { vertexConsumer.vertex(entry, x - 0.5F, y - 0.25F, 0.0F) - .color(red / 255.0F, green / 255.0F, blue / 255.0F, 1.0F) + .color(r, g, b, 1.0F) .texture(u, v) .overlay(OverlayTexture.DEFAULT_UV) .light(light) diff --git a/src/main/generated/assets/hollow/blockstates/cattail.json b/src/main/generated/assets/hollow/blockstates/cattail.json new file mode 100644 index 0000000..e7a93b6 --- /dev/null +++ b/src/main/generated/assets/hollow/blockstates/cattail.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "hollow:block/cattail" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hollow/blockstates/sculk_jaw.json b/src/main/generated/assets/hollow/blockstates/sculk_jaw.json similarity index 100% rename from src/main/resources/assets/hollow/blockstates/sculk_jaw.json rename to src/main/generated/assets/hollow/blockstates/sculk_jaw.json index 23a1569..8483ead 100644 --- a/src/main/resources/assets/hollow/blockstates/sculk_jaw.json +++ b/src/main/generated/assets/hollow/blockstates/sculk_jaw.json @@ -1,10 +1,10 @@ { "variants": { - "active=true": { - "model": "hollow:block/sculk_jaw_active" - }, "active=false": { "model": "hollow:block/sculk_jaw" + }, + "active=true": { + "model": "hollow:block/sculk_jaw_active" } } } \ No newline at end of file diff --git a/src/main/resources/assets/hollow/models/block/cattail_top.json b/src/main/generated/assets/hollow/models/block/cattail.json similarity index 100% rename from src/main/resources/assets/hollow/models/block/cattail_top.json rename to src/main/generated/assets/hollow/models/block/cattail.json diff --git a/src/main/generated/assets/hollow/models/block/sculk_jaw.json b/src/main/generated/assets/hollow/models/block/sculk_jaw.json new file mode 100644 index 0000000..76bc906 --- /dev/null +++ b/src/main/generated/assets/hollow/models/block/sculk_jaw.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/cube_top", + "textures": { + "side": "minecraft:block/sculk", + "top": "hollow:block/sculk_jaw" + } +} \ No newline at end of file diff --git a/src/main/generated/assets/hollow/models/block/sculk_jaw_active.json b/src/main/generated/assets/hollow/models/block/sculk_jaw_active.json new file mode 100644 index 0000000..b33721f --- /dev/null +++ b/src/main/generated/assets/hollow/models/block/sculk_jaw_active.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/cube_top", + "textures": { + "side": "minecraft:block/sculk", + "top": "hollow:block/sculk_jaw_active" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hollow/models/item/campion.json b/src/main/generated/assets/hollow/models/item/campion.json similarity index 59% rename from src/main/resources/assets/hollow/models/item/campion.json rename to src/main/generated/assets/hollow/models/item/campion.json index 983c8ed..bb27946 100644 --- a/src/main/resources/assets/hollow/models/item/campion.json +++ b/src/main/generated/assets/hollow/models/item/campion.json @@ -1,5 +1,5 @@ { - "parent": "item/generated", + "parent": "minecraft:item/generated", "textures": { "layer0": "hollow:item/campion" } diff --git a/src/main/resources/assets/hollow/models/item/cattail.json b/src/main/generated/assets/hollow/models/item/cattail.json similarity index 61% rename from src/main/resources/assets/hollow/models/item/cattail.json rename to src/main/generated/assets/hollow/models/item/cattail.json index 83441e6..f1e0b69 100644 --- a/src/main/resources/assets/hollow/models/item/cattail.json +++ b/src/main/generated/assets/hollow/models/item/cattail.json @@ -1,5 +1,5 @@ { - "parent": "item/generated", + "parent": "minecraft:item/generated", "textures": { "layer0": "hollow:block/cattail_top" } diff --git a/src/main/resources/assets/hollow/models/item/firefly_jar.json b/src/main/generated/assets/hollow/models/item/firefly_jar.json similarity index 100% rename from src/main/resources/assets/hollow/models/item/firefly_jar.json rename to src/main/generated/assets/hollow/models/item/firefly_jar.json diff --git a/src/main/generated/assets/hollow/models/item/firefly_spawn_egg.json b/src/main/generated/assets/hollow/models/item/firefly_spawn_egg.json new file mode 100644 index 0000000..d1aaa9d --- /dev/null +++ b/src/main/generated/assets/hollow/models/item/firefly_spawn_egg.json @@ -0,0 +1,3 @@ +{ + "parent": "minecraft:item/template_spawn_egg" +} \ No newline at end of file diff --git a/src/main/resources/assets/hollow/models/item/giant_lilypad.json b/src/main/generated/assets/hollow/models/item/giant_lilypad.json similarity index 100% rename from src/main/resources/assets/hollow/models/item/giant_lilypad.json rename to src/main/generated/assets/hollow/models/item/giant_lilypad.json diff --git a/src/main/resources/assets/hollow/models/item/jar.json b/src/main/generated/assets/hollow/models/item/jar.json similarity index 100% rename from src/main/resources/assets/hollow/models/item/jar.json rename to src/main/generated/assets/hollow/models/item/jar.json diff --git a/src/main/resources/assets/hollow/models/item/lotus_lilypad.json b/src/main/generated/assets/hollow/models/item/lotus_lilypad.json similarity index 100% rename from src/main/resources/assets/hollow/models/item/lotus_lilypad.json rename to src/main/generated/assets/hollow/models/item/lotus_lilypad.json diff --git a/src/main/resources/assets/hollow/models/item/music_disc_postmortem.json b/src/main/generated/assets/hollow/models/item/music_disc_postmortem.json similarity index 100% rename from src/main/resources/assets/hollow/models/item/music_disc_postmortem.json rename to src/main/generated/assets/hollow/models/item/music_disc_postmortem.json diff --git a/src/main/resources/assets/hollow/models/item/polypore.json b/src/main/generated/assets/hollow/models/item/polypore.json similarity index 60% rename from src/main/resources/assets/hollow/models/item/polypore.json rename to src/main/generated/assets/hollow/models/item/polypore.json index 36ec930..deb2b31 100644 --- a/src/main/resources/assets/hollow/models/item/polypore.json +++ b/src/main/generated/assets/hollow/models/item/polypore.json @@ -1,5 +1,5 @@ { - "parent": "item/generated", + "parent": "minecraft:item/generated", "textures": { "layer0": "hollow:item/polypore" } diff --git a/src/main/resources/assets/hollow/models/item/sculk_jaw.json b/src/main/generated/assets/hollow/models/item/sculk_jaw.json similarity index 100% rename from src/main/resources/assets/hollow/models/item/sculk_jaw.json rename to src/main/generated/assets/hollow/models/item/sculk_jaw.json diff --git a/src/main/resources/assets/specter/metatags/minecraft/block/render_layer.json b/src/main/generated/assets/specter/metatags/minecraft/block/render_layer.json similarity index 85% rename from src/main/resources/assets/specter/metatags/minecraft/block/render_layer.json rename to src/main/generated/assets/specter/metatags/minecraft/block/render_layer.json index 84608f2..4a7ed5f 100644 --- a/src/main/resources/assets/specter/metatags/minecraft/block/render_layer.json +++ b/src/main/generated/assets/specter/metatags/minecraft/block/render_layer.json @@ -1,38 +1,37 @@ { - "replace": false, "values": { - "hollow:paeonia": "cutout", - "hollow:lotus_lilypad": "cutout", - "hollow:giant_lilypad": "cutout", - "hollow:twig": "cutout", + "hollow:acacia_hollow_log": "cutout_mipped", + "hollow:birch_hollow_log": "cutout_mipped", "hollow:campion": "cutout", + "hollow:cattail": "cutout", + "hollow:cattail_stem": "cutout", + "hollow:cherry_hollow_log": "cutout_mipped", + "hollow:crimson_hollow_stem": "cutout_mipped", + "hollow:dark_oak_hollow_log": "cutout_mipped", + "hollow:firefly_jar": "cutout_mipped", + "hollow:giant_lilypad": "cutout", + "hollow:jar": "cutout_mipped", + "hollow:jungle_hollow_log": "cutout_mipped", + "hollow:lotus_lilypad": "cutout", + "hollow:mangrove_hollow_log": "cutout_mipped", + "hollow:oak_hollow_log": "cutout_mipped", + "hollow:paeonia": "cutout", "hollow:polypore": "cutout", "hollow:potted_paeonia": "cutout", - "hollow:jar": "cutout", - "hollow:firefly_jar": "cutout", - "hollow:root_vines": "cutout", - "hollow:cattail": "cutout", - "hollow:rooted_orchid": "cutout", "hollow:potted_rooted_orchid": "cutout", - "hollow:oak_hollow_log": "cutout_mipped", + "hollow:rooted_orchid": "cutout", "hollow:spruce_hollow_log": "cutout_mipped", - "hollow:birch_hollow_log": "cutout_mipped", - "hollow:jungle_hollow_log": "cutout_mipped", - "hollow:acacia_hollow_log": "cutout_mipped", - "hollow:dark_oak_hollow_log": "cutout_mipped", - "hollow:cherry_hollow_log": "cutout_mipped", - "hollow:mangrove_hollow_log": "cutout_mipped", - "hollow:crimson_hollow_stem": "cutout_mipped", - "hollow:warped_hollow_stem": "cutout_mipped", - "hollow:stripped_oak_hollow_log": "cutout_mipped", - "hollow:stripped_spruce_hollow_log": "cutout_mipped", - "hollow:stripped_birch_hollow_log": "cutout_mipped", - "hollow:stripped_jungle_hollow_log": "cutout_mipped", "hollow:stripped_acacia_hollow_log": "cutout_mipped", - "hollow:stripped_dark_oak_hollow_log": "cutout_mipped", + "hollow:stripped_birch_hollow_log": "cutout_mipped", "hollow:stripped_cherry_hollow_log": "cutout_mipped", - "hollow:stripped_mangrove_hollow_log": "cutout_mipped", "hollow:stripped_crimson_hollow_stem": "cutout_mipped", - "hollow:stripped_warped_hollow_stem": "cutout_mipped" + "hollow:stripped_dark_oak_hollow_log": "cutout_mipped", + "hollow:stripped_jungle_hollow_log": "cutout_mipped", + "hollow:stripped_mangrove_hollow_log": "cutout_mipped", + "hollow:stripped_oak_hollow_log": "cutout_mipped", + "hollow:stripped_spruce_hollow_log": "cutout_mipped", + "hollow:stripped_warped_hollow_stem": "cutout_mipped", + "hollow:twig": "cutout", + "hollow:warped_hollow_stem": "cutout_mipped" } -} +} \ No newline at end of file diff --git a/src/main/generated/data/hollow/item_group/hollow.json b/src/main/generated/data/hollow/item_group/hollow.json deleted file mode 100644 index affaff2..0000000 --- a/src/main/generated/data/hollow/item_group/hollow.json +++ /dev/null @@ -1,259 +0,0 @@ -{ - "icon": { - "count": 1, - "id": "hollow:birch_hollow_log" - }, - "items": [ - { - "count": 1, - "id": "hollow:stripped_oak_hollow_log" - }, - { - "count": 1, - "id": "hollow:oak_hollow_log" - }, - { - "count": 1, - "id": "hollow:stripped_spruce_hollow_log" - }, - { - "count": 1, - "id": "hollow:spruce_hollow_log" - }, - { - "count": 1, - "id": "hollow:stripped_birch_hollow_log" - }, - { - "count": 1, - "id": "hollow:birch_hollow_log" - }, - { - "count": 1, - "id": "hollow:stripped_jungle_hollow_log" - }, - { - "count": 1, - "id": "hollow:jungle_hollow_log" - }, - { - "count": 1, - "id": "hollow:stripped_acacia_hollow_log" - }, - { - "count": 1, - "id": "hollow:acacia_hollow_log" - }, - { - "count": 1, - "id": "hollow:stripped_dark_oak_hollow_log" - }, - { - "count": 1, - "id": "hollow:dark_oak_hollow_log" - }, - { - "count": 1, - "id": "hollow:stripped_crimson_hollow_stem" - }, - { - "count": 1, - "id": "hollow:crimson_hollow_stem" - }, - { - "count": 1, - "id": "hollow:stripped_warped_hollow_stem" - }, - { - "count": 1, - "id": "hollow:warped_hollow_stem" - }, - { - "count": 1, - "id": "hollow:stripped_mangrove_hollow_log" - }, - { - "count": 1, - "id": "hollow:mangrove_hollow_log" - }, - { - "count": 1, - "id": "hollow:stripped_cherry_hollow_log" - }, - { - "count": 1, - "id": "hollow:cherry_hollow_log" - }, - { - "count": 1, - "id": "hollow:echoing_pot" - }, - { - "count": 1, - "id": "hollow:paeonia" - }, - { - "count": 1, - "id": "hollow:rooted_orchid" - }, - { - "count": 1, - "id": "hollow:campion" - }, - { - "count": 1, - "id": "hollow:twig" - }, - { - "count": 1, - "id": "hollow:root_vines" - }, - { - "count": 1, - "id": "hollow:cattail" - }, - { - "count": 1, - "id": "hollow:lotus_lilypad" - }, - { - "count": 1, - "id": "hollow:giant_lilypad" - }, - { - "count": 1, - "id": "hollow:polypore" - }, - { - "count": 1, - "id": "hollow:sculk_jaw" - }, - { - "count": 1, - "id": "hollow:jar" - }, - { - "count": 1, - "id": "hollow:firefly_jar" - }, - { - "count": 1, - "id": "hollow:stone_chest" - }, - { - "count": 1, - "id": "hollow:stone_chest_lid" - }, - { - "count": 1, - "id": "hollow:copper_pillar" - }, - { - "count": 1, - "id": "hollow:exposed_copper_pillar" - }, - { - "count": 1, - "id": "hollow:weathered_copper_pillar" - }, - { - "count": 1, - "id": "hollow:oxidized_copper_pillar" - }, - { - "count": 1, - "id": "hollow:waxed_copper_pillar" - }, - { - "count": 1, - "id": "hollow:waxed_exposed_copper_pillar" - }, - { - "count": 1, - "id": "hollow:waxed_weathered_copper_pillar" - }, - { - "count": 1, - "id": "hollow:waxed_oxidized_copper_pillar" - }, - { - "components": { - "hollow:copper_instrument": "great_sky_falling" - }, - "count": 1, - "id": "hollow:copper_horn" - }, - { - "components": { - "hollow:copper_instrument": "old_hymn_resting" - }, - "count": 1, - "id": "hollow:copper_horn" - }, - { - "components": { - "hollow:copper_instrument": "pure_water_desire" - }, - "count": 1, - "id": "hollow:copper_horn" - }, - { - "components": { - "hollow:copper_instrument": "humble_fire_memory" - }, - "count": 1, - "id": "hollow:copper_horn" - }, - { - "components": { - "hollow:copper_instrument": "dry_urge_anger" - }, - "count": 1, - "id": "hollow:copper_horn" - }, - { - "components": { - "hollow:copper_instrument": "clear_temper_journey" - }, - "count": 1, - "id": "hollow:copper_horn" - }, - { - "components": { - "hollow:copper_instrument": "fresh_nest_thought" - }, - "count": 1, - "id": "hollow:copper_horn" - }, - { - "components": { - "hollow:copper_instrument": "secret_lake_tear" - }, - "count": 1, - "id": "hollow:copper_horn" - }, - { - "components": { - "hollow:copper_instrument": "fearless_river_gift" - }, - "count": 1, - "id": "hollow:copper_horn" - }, - { - "components": { - "hollow:copper_instrument": "sweet_moon_love" - }, - "count": 1, - "id": "hollow:copper_horn" - }, - { - "count": 1, - "id": "hollow:firefly_spawn_egg" - }, - { - "count": 1, - "id": "hollow:music_disc_postmortem" - } - ], - "translate": "item_group.hollow.hollow" -} \ No newline at end of file diff --git a/src/main/resources/data/hollow/loot_table/blocks/campion.json b/src/main/generated/data/hollow/loot_table/blocks/campion.json similarity index 91% rename from src/main/resources/data/hollow/loot_table/blocks/campion.json rename to src/main/generated/data/hollow/loot_table/blocks/campion.json index b0dd36e..2f77cb0 100644 --- a/src/main/resources/data/hollow/loot_table/blocks/campion.json +++ b/src/main/generated/data/hollow/loot_table/blocks/campion.json @@ -25,6 +25,5 @@ ], "rolls": 1.0 } - ], - "random_sequence": "minecraft:blocks/peony" + ] } \ No newline at end of file diff --git a/src/main/resources/data/hollow/loot_table/blocks/cattail.json b/src/main/generated/data/hollow/loot_table/blocks/cattail.json similarity index 86% rename from src/main/resources/data/hollow/loot_table/blocks/cattail.json rename to src/main/generated/data/hollow/loot_table/blocks/cattail.json index a4d78c9..35efe68 100644 --- a/src/main/resources/data/hollow/loot_table/blocks/cattail.json +++ b/src/main/generated/data/hollow/loot_table/blocks/cattail.json @@ -16,6 +16,5 @@ ], "rolls": 1.0 } - ], - "random_sequence": "hollow:blocks/cattail" + ] } \ No newline at end of file diff --git a/src/main/resources/data/hollow/loot_table/blocks/root_vines.json b/src/main/generated/data/hollow/loot_table/blocks/cattail_stem.json similarity index 76% rename from src/main/resources/data/hollow/loot_table/blocks/root_vines.json rename to src/main/generated/data/hollow/loot_table/blocks/cattail_stem.json index c8813fb..35efe68 100644 --- a/src/main/resources/data/hollow/loot_table/blocks/root_vines.json +++ b/src/main/generated/data/hollow/loot_table/blocks/cattail_stem.json @@ -11,11 +11,10 @@ "entries": [ { "type": "minecraft:item", - "name": "hollow:root_vines" + "name": "hollow:cattail" } ], "rolls": 1.0 } - ], - "random_sequence": "hollow:blocks/root_vines" + ] } \ No newline at end of file diff --git a/src/main/resources/data/hollow/loot_table/blocks/firefly_jar.json b/src/main/generated/data/hollow/loot_table/blocks/firefly_jar.json similarity index 85% rename from src/main/resources/data/hollow/loot_table/blocks/firefly_jar.json rename to src/main/generated/data/hollow/loot_table/blocks/firefly_jar.json index da704cd..db9525a 100644 --- a/src/main/resources/data/hollow/loot_table/blocks/firefly_jar.json +++ b/src/main/generated/data/hollow/loot_table/blocks/firefly_jar.json @@ -16,6 +16,5 @@ ], "rolls": 1.0 } - ], - "random_sequence": "hollow:blocks/firefly_jar" + ] } \ No newline at end of file diff --git a/src/main/resources/data/hollow/loot_table/blocks/giant_lilypad.json b/src/main/generated/data/hollow/loot_table/blocks/giant_lilypad.json similarity index 85% rename from src/main/resources/data/hollow/loot_table/blocks/giant_lilypad.json rename to src/main/generated/data/hollow/loot_table/blocks/giant_lilypad.json index 36f2804..17b8370 100644 --- a/src/main/resources/data/hollow/loot_table/blocks/giant_lilypad.json +++ b/src/main/generated/data/hollow/loot_table/blocks/giant_lilypad.json @@ -16,6 +16,5 @@ ], "rolls": 1.0 } - ], - "random_sequence": "hollow:blocks/giant_lilypad" + ] } \ No newline at end of file diff --git a/src/main/resources/data/hollow/loot_table/blocks/jar.json b/src/main/generated/data/hollow/loot_table/blocks/jar.json similarity index 74% rename from src/main/resources/data/hollow/loot_table/blocks/jar.json rename to src/main/generated/data/hollow/loot_table/blocks/jar.json index f45295d..893f4cf 100644 --- a/src/main/resources/data/hollow/loot_table/blocks/jar.json +++ b/src/main/generated/data/hollow/loot_table/blocks/jar.json @@ -13,7 +13,10 @@ "type": "minecraft:item", "functions": [ { - "function": "minecraft:copy_name", + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], "source": "block_entity" } ], @@ -22,6 +25,5 @@ ], "rolls": 1.0 } - ], - "random_sequence": "hollow:blocks/jar" + ] } \ No newline at end of file diff --git a/src/main/resources/data/hollow/loot_table/blocks/lotus_lilypad.json b/src/main/generated/data/hollow/loot_table/blocks/lotus_lilypad.json similarity index 85% rename from src/main/resources/data/hollow/loot_table/blocks/lotus_lilypad.json rename to src/main/generated/data/hollow/loot_table/blocks/lotus_lilypad.json index 9dee39e..dbddf19 100644 --- a/src/main/resources/data/hollow/loot_table/blocks/lotus_lilypad.json +++ b/src/main/generated/data/hollow/loot_table/blocks/lotus_lilypad.json @@ -16,6 +16,5 @@ ], "rolls": 1.0 } - ], - "random_sequence": "hollow:blocks/lotus_lilypad" + ] } \ No newline at end of file diff --git a/src/main/resources/data/hollow/loot_table/blocks/paeonia.json b/src/main/generated/data/hollow/loot_table/blocks/paeonia.json similarity index 86% rename from src/main/resources/data/hollow/loot_table/blocks/paeonia.json rename to src/main/generated/data/hollow/loot_table/blocks/paeonia.json index 93998f0..787769a 100644 --- a/src/main/resources/data/hollow/loot_table/blocks/paeonia.json +++ b/src/main/generated/data/hollow/loot_table/blocks/paeonia.json @@ -16,6 +16,5 @@ ], "rolls": 1.0 } - ], - "random_sequence": "hollow:blocks/paeonia" + ] } \ No newline at end of file diff --git a/src/main/resources/data/hollow/loot_table/blocks/polypore.json b/src/main/generated/data/hollow/loot_table/blocks/polypore.json similarity index 95% rename from src/main/resources/data/hollow/loot_table/blocks/polypore.json rename to src/main/generated/data/hollow/loot_table/blocks/polypore.json index 3ac2305..d2589e1 100644 --- a/src/main/resources/data/hollow/loot_table/blocks/polypore.json +++ b/src/main/generated/data/hollow/loot_table/blocks/polypore.json @@ -44,6 +44,5 @@ ], "rolls": 1.0 } - ], - "random_sequence": "hollow:blocks/polypore" + ] } \ No newline at end of file diff --git a/src/main/resources/data/hollow/loot_table/blocks/potted_paeonia.json b/src/main/generated/data/hollow/loot_table/blocks/potted_paeonia.json similarity index 91% rename from src/main/resources/data/hollow/loot_table/blocks/potted_paeonia.json rename to src/main/generated/data/hollow/loot_table/blocks/potted_paeonia.json index 3075419..d529bff 100644 --- a/src/main/resources/data/hollow/loot_table/blocks/potted_paeonia.json +++ b/src/main/generated/data/hollow/loot_table/blocks/potted_paeonia.json @@ -31,6 +31,5 @@ ], "rolls": 1.0 } - ], - "random_sequence": "hollow:blocks/potted_paeonia" + ] } \ No newline at end of file diff --git a/src/main/resources/data/hollow/loot_table/blocks/potted_rooted_orchid.json b/src/main/generated/data/hollow/loot_table/blocks/potted_rooted_orchid.json similarity index 90% rename from src/main/resources/data/hollow/loot_table/blocks/potted_rooted_orchid.json rename to src/main/generated/data/hollow/loot_table/blocks/potted_rooted_orchid.json index 29973eb..4b34712 100644 --- a/src/main/resources/data/hollow/loot_table/blocks/potted_rooted_orchid.json +++ b/src/main/generated/data/hollow/loot_table/blocks/potted_rooted_orchid.json @@ -31,6 +31,5 @@ ], "rolls": 1.0 } - ], - "random_sequence": "hollow:blocks/potted_rooted_orchid" + ] } \ No newline at end of file diff --git a/src/main/resources/data/hollow/loot_table/blocks/rooted_orchid.json b/src/main/generated/data/hollow/loot_table/blocks/rooted_orchid.json similarity index 85% rename from src/main/resources/data/hollow/loot_table/blocks/rooted_orchid.json rename to src/main/generated/data/hollow/loot_table/blocks/rooted_orchid.json index 57c3a71..9fb2e33 100644 --- a/src/main/resources/data/hollow/loot_table/blocks/rooted_orchid.json +++ b/src/main/generated/data/hollow/loot_table/blocks/rooted_orchid.json @@ -16,6 +16,5 @@ ], "rolls": 1.0 } - ], - "random_sequence": "hollow:blocks/rooted_orchid" + ] } \ No newline at end of file diff --git a/src/main/resources/data/hollow/loot_table/blocks/stone_chest.json b/src/main/generated/data/hollow/loot_table/blocks/stone_chest.json similarity index 75% rename from src/main/resources/data/hollow/loot_table/blocks/stone_chest.json rename to src/main/generated/data/hollow/loot_table/blocks/stone_chest.json index 458b7de..95a1995 100644 --- a/src/main/resources/data/hollow/loot_table/blocks/stone_chest.json +++ b/src/main/generated/data/hollow/loot_table/blocks/stone_chest.json @@ -13,7 +13,10 @@ "type": "minecraft:item", "functions": [ { - "function": "minecraft:copy_name", + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], "source": "block_entity" } ], @@ -22,6 +25,5 @@ ], "rolls": 1.0 } - ], - "random_sequence": "hollow:blocks/stone_chest" + ] } \ No newline at end of file diff --git a/src/main/resources/data/hollow/loot_table/blocks/twig.json b/src/main/generated/data/hollow/loot_table/blocks/twig.json similarity index 87% rename from src/main/resources/data/hollow/loot_table/blocks/twig.json rename to src/main/generated/data/hollow/loot_table/blocks/twig.json index 2fe355b..abd3c25 100644 --- a/src/main/resources/data/hollow/loot_table/blocks/twig.json +++ b/src/main/generated/data/hollow/loot_table/blocks/twig.json @@ -16,6 +16,5 @@ ], "rolls": 1.0 } - ], - "random_sequence": "hollow:blocks/twig" + ] } \ No newline at end of file diff --git a/src/main/resources/data/hollow/tags/block/hollow_logs.json b/src/main/generated/data/hollow/tags/block/hollow_logs.json similarity index 90% rename from src/main/resources/data/hollow/tags/block/hollow_logs.json rename to src/main/generated/data/hollow/tags/block/hollow_logs.json index 43386aa..a5f2fcf 100644 --- a/src/main/resources/data/hollow/tags/block/hollow_logs.json +++ b/src/main/generated/data/hollow/tags/block/hollow_logs.json @@ -1,24 +1,24 @@ { "values": [ - "hollow:stripped_oak_hollow_log", "hollow:oak_hollow_log", - "hollow:stripped_spruce_hollow_log", + "hollow:stripped_oak_hollow_log", "hollow:spruce_hollow_log", - "hollow:stripped_birch_hollow_log", + "hollow:stripped_spruce_hollow_log", "hollow:birch_hollow_log", - "hollow:stripped_jungle_hollow_log", + "hollow:stripped_birch_hollow_log", "hollow:jungle_hollow_log", - "hollow:stripped_acacia_hollow_log", + "hollow:stripped_jungle_hollow_log", "hollow:acacia_hollow_log", - "hollow:stripped_dark_oak_hollow_log", + "hollow:stripped_acacia_hollow_log", "hollow:dark_oak_hollow_log", - "hollow:stripped_crimson_hollow_stem", + "hollow:stripped_dark_oak_hollow_log", "hollow:crimson_hollow_stem", - "hollow:stripped_warped_hollow_stem", + "hollow:stripped_crimson_hollow_stem", "hollow:warped_hollow_stem", - "hollow:stripped_mangrove_hollow_log", + "hollow:stripped_warped_hollow_stem", "hollow:mangrove_hollow_log", - "hollow:stripped_cherry_hollow_log", - "hollow:cherry_hollow_log" + "hollow:stripped_mangrove_hollow_log", + "hollow:cherry_hollow_log", + "hollow:stripped_cherry_hollow_log" ] } \ No newline at end of file diff --git a/src/main/generated/data/hollow/tags/block/polypore_placeable_on.json b/src/main/generated/data/hollow/tags/block/polypore_placeable_on.json new file mode 100644 index 0000000..b8fd378 --- /dev/null +++ b/src/main/generated/data/hollow/tags/block/polypore_placeable_on.json @@ -0,0 +1,6 @@ +{ + "values": [ + "#minecraft:logs", + "#hollow:hollow_logs" + ] +} \ No newline at end of file diff --git a/src/main/generated/data/hollow/tags/entity_type/immune_to_sculk_jaw.json b/src/main/generated/data/hollow/tags/entity_type/immune_to_sculk_jaw.json new file mode 100644 index 0000000..87e7d3a --- /dev/null +++ b/src/main/generated/data/hollow/tags/entity_type/immune_to_sculk_jaw.json @@ -0,0 +1,5 @@ +{ + "values": [ + "minecraft:warden" + ] +} \ No newline at end of file diff --git a/src/main/generated/data/hollow/tags/entity_type/poisons_frog.json b/src/main/generated/data/hollow/tags/entity_type/poisons_frog.json new file mode 100644 index 0000000..03a2bed --- /dev/null +++ b/src/main/generated/data/hollow/tags/entity_type/poisons_frog.json @@ -0,0 +1,5 @@ +{ + "values": [ + "hollow:firefly" + ] +} \ No newline at end of file diff --git a/src/main/generated/data/hollow/tags/worldgen/biome/has_closer_fog.json b/src/main/generated/data/hollow/tags/worldgen/biome/has_closer_fog.json new file mode 100644 index 0000000..e642312 --- /dev/null +++ b/src/main/generated/data/hollow/tags/worldgen/biome/has_closer_fog.json @@ -0,0 +1,5 @@ +{ + "values": [ + "#c:is_swamp" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/hollow/worldgen/configured_feature/cattails.json b/src/main/generated/data/hollow/worldgen/configured_feature/cattails.json similarity index 100% rename from src/main/resources/data/hollow/worldgen/configured_feature/cattails.json rename to src/main/generated/data/hollow/worldgen/configured_feature/cattails.json diff --git a/src/main/generated/data/hollow/worldgen/configured_feature/fallen_birch.json b/src/main/generated/data/hollow/worldgen/configured_feature/fallen_birch.json new file mode 100644 index 0000000..16ee28d --- /dev/null +++ b/src/main/generated/data/hollow/worldgen/configured_feature/fallen_birch.json @@ -0,0 +1,74 @@ +{ + "type": "hollow:fallen_tree", + "config": { + "side_block_provider": { + "type": "minecraft:weighted_state_provider", + "entries": [ + { + "data": { + "Name": "minecraft:air" + }, + "weight": 4 + }, + { + "data": { + "Name": "hollow:polypore", + "Properties": { + "amount": "1", + "facing": "north" + } + }, + "weight": 2 + }, + { + "data": { + "Name": "hollow:polypore", + "Properties": { + "amount": "2", + "facing": "north" + } + }, + "weight": 2 + }, + { + "data": { + "Name": "hollow:polypore", + "Properties": { + "amount": "3", + "facing": "north" + } + }, + "weight": 2 + } + ] + }, + "state_provider": { + "type": "minecraft:simple_state_provider", + "state": { + "Name": "hollow:birch_hollow_log", + "Properties": { + "axis": "y", + "mossy": "false", + "waterlogged": "false" + } + } + }, + "top_block_provider": { + "type": "minecraft:weighted_state_provider", + "entries": [ + { + "data": { + "Name": "minecraft:air" + }, + "weight": 5 + }, + { + "data": { + "Name": "minecraft:moss_carpet" + }, + "weight": 5 + } + ] + } + } +} \ No newline at end of file diff --git a/src/main/generated/data/hollow/worldgen/configured_feature/fallen_oak.json b/src/main/generated/data/hollow/worldgen/configured_feature/fallen_oak.json new file mode 100644 index 0000000..f0564b9 --- /dev/null +++ b/src/main/generated/data/hollow/worldgen/configured_feature/fallen_oak.json @@ -0,0 +1,57 @@ +{ + "type": "hollow:fallen_tree", + "config": { + "side_block_provider": { + "type": "minecraft:weighted_state_provider", + "entries": [ + { + "data": { + "Name": "minecraft:air" + }, + "weight": 6 + }, + { + "data": { + "Name": "minecraft:vine", + "Properties": { + "east": "false", + "north": "false", + "south": "false", + "up": "false", + "west": "false" + } + }, + "weight": 4 + } + ] + }, + "state_provider": { + "type": "minecraft:simple_state_provider", + "state": { + "Name": "hollow:oak_hollow_log", + "Properties": { + "axis": "y", + "mossy": "false", + "waterlogged": "false" + } + } + }, + "top_block_provider": { + "type": "minecraft:weighted_state_provider", + "entries": [ + { + "data": { + "Name": "minecraft:air" + }, + "weight": 5 + }, + { + "data": { + "Name": "minecraft:moss_carpet" + }, + "weight": 5 + } + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/data/hollow/worldgen/configured_feature/patch_campion.json b/src/main/generated/data/hollow/worldgen/configured_feature/patch_campion.json similarity index 72% rename from src/main/resources/data/hollow/worldgen/configured_feature/patch_campion.json rename to src/main/generated/data/hollow/worldgen/configured_feature/patch_campion.json index 34762e0..190cc6e 100644 --- a/src/main/resources/data/hollow/worldgen/configured_feature/patch_campion.json +++ b/src/main/generated/data/hollow/worldgen/configured_feature/patch_campion.json @@ -20,19 +20,14 @@ { "type": "minecraft:block_predicate_filter", "predicate": { - "type": "minecraft:all_of", - "predicates": [ - { - "type": "minecraft:matching_blocks", - "blocks": "minecraft:air" - } - ] + "type": "minecraft:matching_blocks", + "blocks": "minecraft:air" } } ] }, - "tries": 10, + "tries": 96, "xz_spread": 7, "y_spread": 3 } -} +} \ No newline at end of file diff --git a/src/main/resources/data/hollow/worldgen/configured_feature/patch_giant_lilypad.json b/src/main/generated/data/hollow/worldgen/configured_feature/patch_giant_lilypad.json similarity index 65% rename from src/main/resources/data/hollow/worldgen/configured_feature/patch_giant_lilypad.json rename to src/main/generated/data/hollow/worldgen/configured_feature/patch_giant_lilypad.json index 801095b..3443893 100644 --- a/src/main/resources/data/hollow/worldgen/configured_feature/patch_giant_lilypad.json +++ b/src/main/generated/data/hollow/worldgen/configured_feature/patch_giant_lilypad.json @@ -1,9 +1,6 @@ { "type": "minecraft:random_patch", "config": { - "tries": 10, - "xz_spread": 7, - "y_spread": 3, "feature": { "feature": { "type": "hollow:giant_lilypad", @@ -18,15 +15,9 @@ } } ] - } - }, - "placement": [ - { - "type": "minecraft:block_predicate_filter", - "predicate": { - "type": "minecraft:matching_blocks", - "blocks": "minecraft:air" - } - } - ] + }, + "tries": 10, + "xz_spread": 7, + "y_spread": 3 + } } \ No newline at end of file diff --git a/src/main/resources/data/hollow/worldgen/configured_feature/patch_twig.json b/src/main/generated/data/hollow/worldgen/configured_feature/patch_twig.json similarity index 71% rename from src/main/resources/data/hollow/worldgen/configured_feature/patch_twig.json rename to src/main/generated/data/hollow/worldgen/configured_feature/patch_twig.json index 4dae23c..54dd5bf 100644 --- a/src/main/resources/data/hollow/worldgen/configured_feature/patch_twig.json +++ b/src/main/generated/data/hollow/worldgen/configured_feature/patch_twig.json @@ -17,13 +17,8 @@ { "type": "minecraft:block_predicate_filter", "predicate": { - "type": "minecraft:all_of", - "predicates": [ - { - "type": "minecraft:matching_blocks", - "blocks": "minecraft:air" - } - ] + "type": "minecraft:matching_blocks", + "blocks": "minecraft:air" } } ] @@ -32,4 +27,4 @@ "xz_spread": 7, "y_spread": 3 } -} +} \ No newline at end of file diff --git a/src/main/resources/data/hollow/worldgen/placed_feature/cattails.json b/src/main/generated/data/hollow/worldgen/placed_feature/cattails.json similarity index 75% rename from src/main/resources/data/hollow/worldgen/placed_feature/cattails.json rename to src/main/generated/data/hollow/worldgen/placed_feature/cattails.json index ba0cfec..aa354ee 100644 --- a/src/main/resources/data/hollow/worldgen/placed_feature/cattails.json +++ b/src/main/generated/data/hollow/worldgen/placed_feature/cattails.json @@ -2,18 +2,22 @@ "feature": "hollow:cattails", "placement": [ { - "type": "minecraft:in_square" + "type": "minecraft:count", + "count": 2 + }, + { + "type": "minecraft:rarity_filter", + "chance": 2 }, { "type": "minecraft:heightmap", "heightmap": "OCEAN_FLOOR_WG" }, { - "type": "minecraft:count", - "count": 32 + "type": "minecraft:biome" }, { - "type": "minecraft:biome" + "type": "minecraft:in_square" } ] } \ No newline at end of file diff --git a/src/main/resources/data/hollow/worldgen/placed_feature/patch_lilac.json b/src/main/generated/data/hollow/worldgen/placed_feature/fallen_birch.json similarity index 59% rename from src/main/resources/data/hollow/worldgen/placed_feature/patch_lilac.json rename to src/main/generated/data/hollow/worldgen/placed_feature/fallen_birch.json index 7210427..bf14eeb 100644 --- a/src/main/resources/data/hollow/worldgen/placed_feature/patch_lilac.json +++ b/src/main/generated/data/hollow/worldgen/placed_feature/fallen_birch.json @@ -1,23 +1,19 @@ { - "feature": "hollow:patch_lilac", + "feature": "hollow:fallen_birch", "placement": [ - { - "type": "minecraft:count", - "count": 6 - }, - { - "type": "minecraft:rarity_filter", - "chance": 2 - }, { "type": "minecraft:in_square" }, { "type": "minecraft:heightmap", - "heightmap": "MOTION_BLOCKING" + "heightmap": "WORLD_SURFACE_WG" }, { "type": "minecraft:biome" + }, + { + "type": "minecraft:rarity_filter", + "chance": 4 } ] } \ No newline at end of file diff --git a/src/main/generated/data/hollow/worldgen/placed_feature/fallen_oak.json b/src/main/generated/data/hollow/worldgen/placed_feature/fallen_oak.json new file mode 100644 index 0000000..a2cf85d --- /dev/null +++ b/src/main/generated/data/hollow/worldgen/placed_feature/fallen_oak.json @@ -0,0 +1,19 @@ +{ + "feature": "hollow:fallen_oak", + "placement": [ + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:heightmap", + "heightmap": "WORLD_SURFACE_WG" + }, + { + "type": "minecraft:biome" + }, + { + "type": "minecraft:rarity_filter", + "chance": 4 + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/hollow/worldgen/placed_feature/huge_brown_mushroom.json b/src/main/generated/data/hollow/worldgen/placed_feature/huge_brown_mushroom_swamp.json similarity index 100% rename from src/main/resources/data/hollow/worldgen/placed_feature/huge_brown_mushroom.json rename to src/main/generated/data/hollow/worldgen/placed_feature/huge_brown_mushroom_swamp.json index 500ba5e..0867110 100644 --- a/src/main/resources/data/hollow/worldgen/placed_feature/huge_brown_mushroom.json +++ b/src/main/generated/data/hollow/worldgen/placed_feature/huge_brown_mushroom_swamp.json @@ -6,18 +6,18 @@ "count": 1 }, { - "type": "minecraft:in_square" + "type": "minecraft:rarity_filter", + "chance": 2 }, { "type": "minecraft:heightmap", "heightmap": "MOTION_BLOCKING" }, { - "type": "minecraft:rarity_filter", - "chance": 2 + "type": "minecraft:biome" }, { - "type": "minecraft:biome" + "type": "minecraft:in_square" } ] } \ No newline at end of file diff --git a/src/main/resources/data/hollow/worldgen/placed_feature/patch_campion.json b/src/main/generated/data/hollow/worldgen/placed_feature/patch_campion.json similarity index 56% rename from src/main/resources/data/hollow/worldgen/placed_feature/patch_campion.json rename to src/main/generated/data/hollow/worldgen/placed_feature/patch_campion.json index d30f6fd..bd03844 100644 --- a/src/main/resources/data/hollow/worldgen/placed_feature/patch_campion.json +++ b/src/main/generated/data/hollow/worldgen/placed_feature/patch_campion.json @@ -1,13 +1,9 @@ { "feature": "hollow:patch_campion", "placement": [ - { - "type": "minecraft:count", - "count": 8 - }, { "type": "minecraft:rarity_filter", - "chance": 2 + "chance": 7 }, { "type": "minecraft:in_square" @@ -16,6 +12,19 @@ "type": "minecraft:heightmap", "heightmap": "MOTION_BLOCKING" }, + { + "type": "minecraft:count", + "count": { + "type": "minecraft:clamped", + "max_inclusive": 1, + "min_inclusive": 0, + "source": { + "type": "minecraft:uniform", + "max_inclusive": 1, + "min_inclusive": -3 + } + } + }, { "type": "minecraft:biome" } diff --git a/src/main/resources/data/hollow/worldgen/placed_feature/patch_giant_lilypad.json b/src/main/generated/data/hollow/worldgen/placed_feature/patch_giant_lilypad.json similarity index 100% rename from src/main/resources/data/hollow/worldgen/placed_feature/patch_giant_lilypad.json rename to src/main/generated/data/hollow/worldgen/placed_feature/patch_giant_lilypad.json index 7917fa8..127393f 100644 --- a/src/main/resources/data/hollow/worldgen/placed_feature/patch_giant_lilypad.json +++ b/src/main/generated/data/hollow/worldgen/placed_feature/patch_giant_lilypad.json @@ -5,15 +5,15 @@ "type": "minecraft:count", "count": 1 }, - { - "type": "minecraft:in_square" - }, { "type": "minecraft:heightmap", "heightmap": "WORLD_SURFACE_WG" }, { "type": "minecraft:biome" + }, + { + "type": "minecraft:in_square" } ] } \ No newline at end of file diff --git a/src/main/resources/data/hollow/worldgen/placed_feature/patch_waterlily.json b/src/main/generated/data/hollow/worldgen/placed_feature/patch_grass_birch.json similarity index 81% rename from src/main/resources/data/hollow/worldgen/placed_feature/patch_waterlily.json rename to src/main/generated/data/hollow/worldgen/placed_feature/patch_grass_birch.json index ecc7a9a..36a7334 100644 --- a/src/main/resources/data/hollow/worldgen/placed_feature/patch_waterlily.json +++ b/src/main/generated/data/hollow/worldgen/placed_feature/patch_grass_birch.json @@ -1,12 +1,9 @@ { - "feature": "hollow:patch_waterlily", + "feature": "minecraft:patch_grass", "placement": [ { "type": "minecraft:count", - "count": 4 - }, - { - "type": "minecraft:in_square" + "count": 20 }, { "type": "minecraft:heightmap", @@ -14,6 +11,9 @@ }, { "type": "minecraft:biome" + }, + { + "type": "minecraft:in_square" } ] } \ No newline at end of file diff --git a/src/main/generated/data/hollow/worldgen/placed_feature/patch_tall_grass_birch.json b/src/main/generated/data/hollow/worldgen/placed_feature/patch_tall_grass_birch.json new file mode 100644 index 0000000..1b375e4 --- /dev/null +++ b/src/main/generated/data/hollow/worldgen/placed_feature/patch_tall_grass_birch.json @@ -0,0 +1,19 @@ +{ + "feature": "minecraft:patch_tall_grass", + "placement": [ + { + "type": "minecraft:count", + "count": 1 + }, + { + "type": "minecraft:heightmap", + "heightmap": "MOTION_BLOCKING" + }, + { + "type": "minecraft:biome" + }, + { + "type": "minecraft:in_square" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/hollow/worldgen/placed_feature/patch_twig.json b/src/main/generated/data/hollow/worldgen/placed_feature/patch_twig.json similarity index 100% rename from src/main/resources/data/hollow/worldgen/placed_feature/patch_twig.json rename to src/main/generated/data/hollow/worldgen/placed_feature/patch_twig.json index 9abd960..883caaf 100644 --- a/src/main/resources/data/hollow/worldgen/placed_feature/patch_twig.json +++ b/src/main/generated/data/hollow/worldgen/placed_feature/patch_twig.json @@ -9,15 +9,15 @@ "type": "minecraft:rarity_filter", "chance": 2 }, - { - "type": "minecraft:in_square" - }, { "type": "minecraft:heightmap", "heightmap": "MOTION_BLOCKING" }, { "type": "minecraft:biome" + }, + { + "type": "minecraft:in_square" } ] } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/advancement/husbandry/witnessed_frog_poisoning.json b/src/main/generated/data/minecraft/advancement/husbandry/witnessed_frog_poisoning.json new file mode 100644 index 0000000..e475a63 --- /dev/null +++ b/src/main/generated/data/minecraft/advancement/husbandry/witnessed_frog_poisoning.json @@ -0,0 +1,25 @@ +{ + "parent": "minecraft:husbandry/root", + "criteria": { + "witnessed_frog_poisoning": { + "trigger": "hollow:frog_poisoned" + } + }, + "display": { + "description": { + "translate": "advancements.husbandry.witnessed_frog_poisoning.description" + }, + "icon": { + "count": 1, + "id": "hollow:firefly_spawn_egg" + }, + "title": { + "translate": "advancements.husbandry.witnessed_frog_poisoning.title" + } + }, + "requirements": [ + [ + "witnessed_frog_poisoning" + ] + ] +} \ No newline at end of file diff --git a/src/main/generated/data/minecraft/tags/block/flower_pots.json b/src/main/generated/data/minecraft/tags/block/flower_pots.json new file mode 100644 index 0000000..74f9565 --- /dev/null +++ b/src/main/generated/data/minecraft/tags/block/flower_pots.json @@ -0,0 +1,6 @@ +{ + "values": [ + "hollow:potted_rooted_orchid", + "hollow:potted_paeonia" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/block/mineable/axe.json b/src/main/generated/data/minecraft/tags/block/mineable/axe.json similarity index 88% rename from src/main/resources/data/minecraft/tags/block/mineable/axe.json rename to src/main/generated/data/minecraft/tags/block/mineable/axe.json index dd1b975..a5f2fcf 100644 --- a/src/main/resources/data/minecraft/tags/block/mineable/axe.json +++ b/src/main/generated/data/minecraft/tags/block/mineable/axe.json @@ -1,25 +1,24 @@ { - "replace": false, "values": [ - "hollow:stripped_oak_hollow_log", "hollow:oak_hollow_log", - "hollow:stripped_spruce_hollow_log", + "hollow:stripped_oak_hollow_log", "hollow:spruce_hollow_log", - "hollow:stripped_birch_hollow_log", + "hollow:stripped_spruce_hollow_log", "hollow:birch_hollow_log", - "hollow:stripped_jungle_hollow_log", + "hollow:stripped_birch_hollow_log", "hollow:jungle_hollow_log", - "hollow:stripped_acacia_hollow_log", + "hollow:stripped_jungle_hollow_log", "hollow:acacia_hollow_log", - "hollow:stripped_dark_oak_hollow_log", + "hollow:stripped_acacia_hollow_log", "hollow:dark_oak_hollow_log", - "hollow:stripped_crimson_hollow_stem", + "hollow:stripped_dark_oak_hollow_log", "hollow:crimson_hollow_stem", - "hollow:stripped_warped_hollow_stem", + "hollow:stripped_crimson_hollow_stem", "hollow:warped_hollow_stem", - "hollow:stripped_mangrove_hollow_log", + "hollow:stripped_warped_hollow_stem", "hollow:mangrove_hollow_log", - "hollow:stripped_cherry_hollow_log", - "hollow:cherry_hollow_log" + "hollow:stripped_mangrove_hollow_log", + "hollow:cherry_hollow_log", + "hollow:stripped_cherry_hollow_log" ] } \ No newline at end of file diff --git a/src/main/generated/data/minecraft/tags/block/mineable/hoe.json b/src/main/generated/data/minecraft/tags/block/mineable/hoe.json new file mode 100644 index 0000000..07a313a --- /dev/null +++ b/src/main/generated/data/minecraft/tags/block/mineable/hoe.json @@ -0,0 +1,5 @@ +{ + "values": [ + "hollow:sculk_jaw" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/block/mineable/pickaxe.json b/src/main/generated/data/minecraft/tags/block/mineable/pickaxe.json similarity index 94% rename from src/main/resources/data/minecraft/tags/block/mineable/pickaxe.json rename to src/main/generated/data/minecraft/tags/block/mineable/pickaxe.json index 23649d5..f642e34 100644 --- a/src/main/resources/data/minecraft/tags/block/mineable/pickaxe.json +++ b/src/main/generated/data/minecraft/tags/block/mineable/pickaxe.json @@ -1,15 +1,12 @@ { - "replace": false, "values": [ "hollow:echoing_pot", - "hollow:stone_chest_lid", "hollow:stone_chest", - + "hollow:stone_chest_lid", "hollow:copper_pillar", "hollow:weathered_copper_pillar", "hollow:exposed_copper_pillar", "hollow:oxidized_copper_pillar", - "hollow:waxed_copper_pillar", "hollow:waxed_weathered_copper_pillar", "hollow:waxed_exposed_copper_pillar", diff --git a/src/main/generated/data/minecraft/tags/block/small_flowers.json b/src/main/generated/data/minecraft/tags/block/small_flowers.json new file mode 100644 index 0000000..b0bb87e --- /dev/null +++ b/src/main/generated/data/minecraft/tags/block/small_flowers.json @@ -0,0 +1,7 @@ +{ + "values": [ + "hollow:paeonia", + "hollow:rooted_orchid", + "hollow:lotus_lilypad" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/block/tall_flowers.json b/src/main/generated/data/minecraft/tags/block/tall_flowers.json similarity index 67% rename from src/main/resources/data/minecraft/tags/block/tall_flowers.json rename to src/main/generated/data/minecraft/tags/block/tall_flowers.json index aa4e5c7..d68b7ae 100644 --- a/src/main/resources/data/minecraft/tags/block/tall_flowers.json +++ b/src/main/generated/data/minecraft/tags/block/tall_flowers.json @@ -1,5 +1,4 @@ { - "replace": false, "values": [ "hollow:campion" ] diff --git a/src/main/resources/data/minecraft/tags/entity_type/frog_food.json b/src/main/generated/data/minecraft/tags/entity_type/frog_food.json similarity index 67% rename from src/main/resources/data/minecraft/tags/entity_type/frog_food.json rename to src/main/generated/data/minecraft/tags/entity_type/frog_food.json index 3676f3e..03a2bed 100644 --- a/src/main/resources/data/minecraft/tags/entity_type/frog_food.json +++ b/src/main/generated/data/minecraft/tags/entity_type/frog_food.json @@ -1,5 +1,4 @@ { - "replace": false, "values": [ "hollow:firefly" ] diff --git a/src/main/resources/data/hollow/worldgen/configured_feature/birch_bees_0002.json b/src/main/generated/data/minecraft/worldgen/configured_feature/birch_bees_0002.json similarity index 77% rename from src/main/resources/data/hollow/worldgen/configured_feature/birch_bees_0002.json rename to src/main/generated/data/minecraft/worldgen/configured_feature/birch_bees_0002.json index dfee407..7a9f24c 100644 --- a/src/main/resources/data/hollow/worldgen/configured_feature/birch_bees_0002.json +++ b/src/main/generated/data/minecraft/worldgen/configured_feature/birch_bees_0002.json @@ -3,21 +3,29 @@ "config": { "decorators": [ { - "type": "hollow:branch_tree_decorator", + "type": "hollow:polypore_tree_decorator", "provider": { "type": "minecraft:simple_state_provider", "state": { - "Name": "minecraft:birch_log" + "Name": "hollow:polypore", + "Properties": { + "amount": "1", + "facing": "north" + } } - }, - "probability": 0.5 + } }, { - "type": "hollow:polypore_tree_decorator", + "type": "hollow:branch_tree_decorator", + "max_amount": 2, + "probability": 0.5, "provider": { "type": "minecraft:simple_state_provider", "state": { - "Name": "hollow:polypore" + "Name": "minecraft:birch_log", + "Properties": { + "axis": "y" + } } } } @@ -29,7 +37,9 @@ } }, "foliage_placer": { - "type": "minecraft:blob_foliage_placer", + "type": "hollow:blob_with_hanging", + "hanging_leaves_chance": 0.25, + "hanging_leaves_extension_chance": 0.4, "height": 3, "offset": 0, "radius": 2 diff --git a/src/main/generated/data/minecraft/worldgen/configured_feature/flower_swamp.json b/src/main/generated/data/minecraft/worldgen/configured_feature/flower_swamp.json new file mode 100644 index 0000000..87f19cb --- /dev/null +++ b/src/main/generated/data/minecraft/worldgen/configured_feature/flower_swamp.json @@ -0,0 +1,41 @@ +{ + "type": "minecraft:flower", + "config": { + "feature": { + "feature": { + "type": "minecraft:simple_block", + "config": { + "to_place": { + "type": "minecraft:weighted_state_provider", + "entries": [ + { + "data": { + "Name": "minecraft:blue_orchid" + }, + "weight": 1 + }, + { + "data": { + "Name": "hollow:rooted_orchid" + }, + "weight": 1 + } + ] + } + } + }, + "placement": [ + { + "type": "minecraft:block_predicate_filter", + "predicate": { + "type": "minecraft:matching_blocks", + "blocks": "minecraft:air" + } + } + ] + }, + "tries": 64, + "xz_spread": 6, + "y_spread": 2 + } +} \ No newline at end of file diff --git a/src/main/resources/data/hollow/worldgen/configured_feature/patch_waterlily.json b/src/main/generated/data/minecraft/worldgen/configured_feature/patch_waterlily.json similarity index 86% rename from src/main/resources/data/hollow/worldgen/configured_feature/patch_waterlily.json rename to src/main/generated/data/minecraft/worldgen/configured_feature/patch_waterlily.json index df73e78..e4862b9 100644 --- a/src/main/resources/data/hollow/worldgen/configured_feature/patch_waterlily.json +++ b/src/main/generated/data/minecraft/worldgen/configured_feature/patch_waterlily.json @@ -1,9 +1,6 @@ { "type": "minecraft:random_patch", "config": { - "tries": 10, - "xz_spread": 7, - "y_spread": 3, "feature": { "feature": { "type": "minecraft:simple_block", @@ -12,16 +9,16 @@ "type": "minecraft:weighted_state_provider", "entries": [ { - "weight": 4, "data": { "Name": "minecraft:lily_pad" - } + }, + "weight": 4 }, { - "weight": 1, "data": { "Name": "hollow:lotus_lilypad" - } + }, + "weight": 1 } ] } @@ -36,6 +33,9 @@ } } ] - } + }, + "tries": 10, + "xz_spread": 7, + "y_spread": 3 } -} +} \ No newline at end of file diff --git a/src/main/resources/data/hollow/worldgen/configured_feature/super_birch_bees_0002.json b/src/main/generated/data/minecraft/worldgen/configured_feature/super_birch_bees_0002.json similarity index 77% rename from src/main/resources/data/hollow/worldgen/configured_feature/super_birch_bees_0002.json rename to src/main/generated/data/minecraft/worldgen/configured_feature/super_birch_bees_0002.json index 074c21f..f2f9c3a 100644 --- a/src/main/resources/data/hollow/worldgen/configured_feature/super_birch_bees_0002.json +++ b/src/main/generated/data/minecraft/worldgen/configured_feature/super_birch_bees_0002.json @@ -3,21 +3,29 @@ "config": { "decorators": [ { - "type": "hollow:branch_tree_decorator", + "type": "hollow:polypore_tree_decorator", "provider": { "type": "minecraft:simple_state_provider", "state": { - "Name": "minecraft:birch_log" + "Name": "hollow:polypore", + "Properties": { + "amount": "1", + "facing": "north" + } } - }, - "probability": 0.5 + } }, { - "type": "hollow:polypore_tree_decorator", + "type": "hollow:branch_tree_decorator", + "max_amount": 5, + "probability": 0.5, "provider": { "type": "minecraft:simple_state_provider", "state": { - "Name": "hollow:polypore" + "Name": "minecraft:birch_log", + "Properties": { + "axis": "y" + } } } } @@ -29,7 +37,9 @@ } }, "foliage_placer": { - "type": "minecraft:blob_foliage_placer", + "type": "hollow:blob_with_hanging", + "hanging_leaves_chance": 0.25, + "hanging_leaves_extension_chance": 0.4, "height": 3, "offset": 0, "radius": 2 diff --git a/src/main/resources/data/hollow/worldgen/configured_feature/swamp_oak.json b/src/main/generated/data/minecraft/worldgen/configured_feature/swamp_oak.json similarity index 80% rename from src/main/resources/data/hollow/worldgen/configured_feature/swamp_oak.json rename to src/main/generated/data/minecraft/worldgen/configured_feature/swamp_oak.json index c7b7e42..016a713 100644 --- a/src/main/resources/data/hollow/worldgen/configured_feature/swamp_oak.json +++ b/src/main/generated/data/minecraft/worldgen/configured_feature/swamp_oak.json @@ -4,17 +4,20 @@ "decorators": [ { "type": "minecraft:leave_vine", - "probability": 0.25 + "probability": 0.05 }, { "type": "hollow:big_branch_tree_decorator", + "probability": 0.5, "provider": { "type": "minecraft:simple_state_provider", "state": { - "Name": "minecraft:oak_log" + "Name": "minecraft:oak_log", + "Properties": { + "axis": "y" + } } - }, - "probability": 0.5 + } } ], "dirt_provider": { @@ -24,7 +27,9 @@ } }, "foliage_placer": { - "type": "minecraft:blob_foliage_placer", + "type": "hollow:blob_with_hanging", + "hanging_leaves_chance": 1.0, + "hanging_leaves_extension_chance": 0.5, "height": 3, "offset": 0, "radius": 3 @@ -50,7 +55,7 @@ }, "trunk_placer": { "type": "minecraft:straight_trunk_placer", - "base_height": 7, + "base_height": 8, "height_rand_a": 2, "height_rand_b": 0 }, diff --git a/src/main/resources/data/hollow/worldgen/placed_feature/trees_swamp.json b/src/main/generated/data/minecraft/worldgen/placed_feature/birch_tall.json similarity index 82% rename from src/main/resources/data/hollow/worldgen/placed_feature/trees_swamp.json rename to src/main/generated/data/minecraft/worldgen/placed_feature/birch_tall.json index e2092ae..2c6563e 100644 --- a/src/main/resources/data/hollow/worldgen/placed_feature/trees_swamp.json +++ b/src/main/generated/data/minecraft/worldgen/placed_feature/birch_tall.json @@ -1,5 +1,5 @@ { - "feature": "hollow:swamp_oak", + "feature": "minecraft:birch_tall", "placement": [ { "type": "minecraft:count", @@ -7,36 +7,36 @@ "type": "minecraft:weighted_list", "distribution": [ { - "data": 2, + "data": 9, "weight": 9 }, { - "data": 3, + "data": 8, "weight": 1 } ] } }, { - "type": "minecraft:in_square" + "type": "minecraft:heightmap", + "heightmap": "OCEAN_FLOOR" }, { - "type": "minecraft:surface_water_depth_filter", - "max_water_depth": 2 + "type": "minecraft:biome" }, { - "type": "minecraft:heightmap", - "heightmap": "OCEAN_FLOOR" + "type": "minecraft:in_square" }, { - "type": "minecraft:biome" + "type": "minecraft:surface_water_depth_filter", + "max_water_depth": 0 }, { "type": "minecraft:block_predicate_filter", "predicate": { "type": "minecraft:would_survive", "state": { - "Name": "minecraft:oak_sapling", + "Name": "minecraft:birch_sapling", "Properties": { "stage": "0" } diff --git a/src/main/resources/data/hollow/worldgen/placed_feature/trees_birch.json b/src/main/generated/data/minecraft/worldgen/placed_feature/trees_birch.json similarity index 90% rename from src/main/resources/data/hollow/worldgen/placed_feature/trees_birch.json rename to src/main/generated/data/minecraft/worldgen/placed_feature/trees_birch.json index 9a54c7c..ba0ec26 100644 --- a/src/main/resources/data/hollow/worldgen/placed_feature/trees_birch.json +++ b/src/main/generated/data/minecraft/worldgen/placed_feature/trees_birch.json @@ -1,5 +1,5 @@ { - "feature": "hollow:birch_bees_0002", + "feature": "minecraft:birch_bees_0002", "placement": [ { "type": "minecraft:count", @@ -7,29 +7,29 @@ "type": "minecraft:weighted_list", "distribution": [ { - "data": 10, + "data": 9, "weight": 9 }, { - "data": 11, + "data": 8, "weight": 1 } ] } }, { - "type": "minecraft:in_square" + "type": "minecraft:heightmap", + "heightmap": "OCEAN_FLOOR" }, { - "type": "minecraft:surface_water_depth_filter", - "max_water_depth": 0 + "type": "minecraft:biome" }, { - "type": "minecraft:heightmap", - "heightmap": "OCEAN_FLOOR" + "type": "minecraft:in_square" }, { - "type": "minecraft:biome" + "type": "minecraft:surface_water_depth_filter", + "max_water_depth": 0 }, { "type": "minecraft:block_predicate_filter", diff --git a/src/main/resources/data/specter/metatags/minecraft/block/flammable.json b/src/main/generated/data/specter/metatags/minecraft/block/flammable.json similarity index 79% rename from src/main/resources/data/specter/metatags/minecraft/block/flammable.json rename to src/main/generated/data/specter/metatags/minecraft/block/flammable.json index ce288a9..868146f 100644 --- a/src/main/resources/data/specter/metatags/minecraft/block/flammable.json +++ b/src/main/generated/data/specter/metatags/minecraft/block/flammable.json @@ -1,39 +1,38 @@ { - "replace": false, "values": { - "hollow:oak_hollow_log": { + "hollow:acacia_hollow_log": { "burn": 5, "spread": 5 }, - "hollow:stripped_oak_hollow_log": { + "hollow:birch_hollow_log": { "burn": 5, "spread": 5 }, - "hollow:spruce_hollow_log": { + "hollow:cherry_hollow_log": { "burn": 5, "spread": 5 }, - "hollow:stripped_spruce_hollow_log": { + "hollow:crimson_hollow_stem": { "burn": 5, "spread": 5 }, - "hollow:birch_hollow_log": { + "hollow:dark_oak_hollow_log": { "burn": 5, "spread": 5 }, - "hollow:stripped_birch_hollow_log": { + "hollow:jungle_hollow_log": { "burn": 5, "spread": 5 }, - "hollow:jungle_hollow_log": { + "hollow:mangrove_hollow_log": { "burn": 5, "spread": 5 }, - "hollow:stripped_jungle_hollow_log": { + "hollow:oak_hollow_log": { "burn": 5, "spread": 5 }, - "hollow:acacia_hollow_log": { + "hollow:spruce_hollow_log": { "burn": 5, "spread": 5 }, @@ -41,29 +40,45 @@ "burn": 5, "spread": 5 }, - "hollow:dark_oak_hollow_log": { + "hollow:stripped_birch_hollow_log": { "burn": 5, "spread": 5 }, - "hollow:stripped_dark_oak_hollow_log": { + "hollow:stripped_cherry_hollow_log": { "burn": 5, "spread": 5 }, - "hollow:cherry_hollow_log": { + "hollow:stripped_crimson_hollow_stem": { "burn": 5, "spread": 5 }, - "hollow:stripped_cherry_hollow_log": { + "hollow:stripped_dark_oak_hollow_log": { "burn": 5, "spread": 5 }, - "hollow:mangrove_hollow_log": { + "hollow:stripped_jungle_hollow_log": { "burn": 5, "spread": 5 }, "hollow:stripped_mangrove_hollow_log": { "burn": 5, "spread": 5 + }, + "hollow:stripped_oak_hollow_log": { + "burn": 5, + "spread": 5 + }, + "hollow:stripped_spruce_hollow_log": { + "burn": 5, + "spread": 5 + }, + "hollow:stripped_warped_hollow_stem": { + "burn": 5, + "spread": 5 + }, + "hollow:warped_hollow_stem": { + "burn": 5, + "spread": 5 } } } \ No newline at end of file diff --git a/src/main/resources/data/specter/metatags/minecraft/block/oxidizable.json b/src/main/generated/data/specter/metatags/minecraft/block/oxidizable.json similarity index 91% rename from src/main/resources/data/specter/metatags/minecraft/block/oxidizable.json rename to src/main/generated/data/specter/metatags/minecraft/block/oxidizable.json index 0899c47..031c28d 100644 --- a/src/main/resources/data/specter/metatags/minecraft/block/oxidizable.json +++ b/src/main/generated/data/specter/metatags/minecraft/block/oxidizable.json @@ -1,5 +1,4 @@ { - "replace": false, "values": { "hollow:copper_pillar": "hollow:exposed_copper_pillar", "hollow:exposed_copper_pillar": "hollow:weathered_copper_pillar", diff --git a/src/main/resources/data/specter/metatags/minecraft/block/strippable.json b/src/main/generated/data/specter/metatags/minecraft/block/strippable.json similarity index 95% rename from src/main/resources/data/specter/metatags/minecraft/block/strippable.json rename to src/main/generated/data/specter/metatags/minecraft/block/strippable.json index 64e4eaf..0069304 100644 --- a/src/main/resources/data/specter/metatags/minecraft/block/strippable.json +++ b/src/main/generated/data/specter/metatags/minecraft/block/strippable.json @@ -1,15 +1,14 @@ { - "replace": false, "values": { - "hollow:oak_hollow_log": "hollow:stripped_oak_hollow_log", - "hollow:spruce_hollow_log": "hollow:stripped_spruce_hollow_log", - "hollow:birch_hollow_log": "hollow:stripped_birch_hollow_log", - "hollow:jungle_hollow_log": "hollow:stripped_jungle_hollow_log", "hollow:acacia_hollow_log": "hollow:stripped_acacia_hollow_log", - "hollow:dark_oak_hollow_log": "hollow:stripped_dark_oak_hollow_log", + "hollow:birch_hollow_log": "hollow:stripped_birch_hollow_log", + "hollow:cherry_hollow_log": "hollow:stripped_cherry_hollow_log", "hollow:crimson_hollow_stem": "hollow:stripped_crimson_hollow_stem", - "hollow:warped_hollow_stem": "hollow:stripped_warped_hollow_stem", + "hollow:dark_oak_hollow_log": "hollow:stripped_dark_oak_hollow_log", + "hollow:jungle_hollow_log": "hollow:stripped_jungle_hollow_log", "hollow:mangrove_hollow_log": "hollow:stripped_mangrove_hollow_log", - "hollow:cherry_hollow_log": "hollow:stripped_cherry_hollow_log" + "hollow:oak_hollow_log": "hollow:stripped_oak_hollow_log", + "hollow:spruce_hollow_log": "hollow:stripped_spruce_hollow_log", + "hollow:warped_hollow_stem": "hollow:stripped_warped_hollow_stem" } } \ No newline at end of file diff --git a/src/main/resources/data/specter/metatags/minecraft/block/waxable.json b/src/main/generated/data/specter/metatags/minecraft/block/waxable.json similarity index 86% rename from src/main/resources/data/specter/metatags/minecraft/block/waxable.json rename to src/main/generated/data/specter/metatags/minecraft/block/waxable.json index 978d379..b6cdf85 100644 --- a/src/main/resources/data/specter/metatags/minecraft/block/waxable.json +++ b/src/main/generated/data/specter/metatags/minecraft/block/waxable.json @@ -1,9 +1,8 @@ { - "replace": false, "values": { "hollow:copper_pillar": "hollow:waxed_copper_pillar", "hollow:exposed_copper_pillar": "hollow:waxed_exposed_copper_pillar", - "hollow:weathered_copper_pillar": "hollow:waxed_weathered_copper_pillar", - "hollow:oxidized_copper_pillar": "hollow:waxed_oxidized_copper_pillar" + "hollow:oxidized_copper_pillar": "hollow:waxed_oxidized_copper_pillar", + "hollow:weathered_copper_pillar": "hollow:waxed_weathered_copper_pillar" } } \ No newline at end of file diff --git a/src/main/java/dev/spiritstudios/hollow/Hollow.java b/src/main/java/dev/spiritstudios/hollow/Hollow.java index 76ba411..2eeb57a 100644 --- a/src/main/java/dev/spiritstudios/hollow/Hollow.java +++ b/src/main/java/dev/spiritstudios/hollow/Hollow.java @@ -5,21 +5,25 @@ import dev.spiritstudios.hollow.loot.SetCopperInstrumentFunction; import dev.spiritstudios.hollow.registry.*; import dev.spiritstudios.hollow.worldgen.HollowBiomeModifications; -import dev.spiritstudios.specter.api.registry.registration.Registrar; +import dev.spiritstudios.specter.api.registry.RegistryHelper; import net.fabricmc.api.ModInitializer; import net.fabricmc.fabric.api.object.builder.v1.entity.FabricDefaultAttributeRegistry; +import net.minecraft.advancement.criterion.Criterion; import net.minecraft.loot.function.LootFunctionType; import net.minecraft.registry.Registries; import net.minecraft.registry.Registry; import net.minecraft.sound.SoundEvent; import net.minecraft.util.Identifier; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.foliage.FoliagePlacerType; +import net.minecraft.world.gen.treedecorator.TreeDecoratorType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.List; -public class Hollow implements ModInitializer { +public final class Hollow implements ModInitializer { public static final String MODID = "hollow"; public static final Logger LOGGER = LoggerFactory.getLogger(MODID); @@ -27,19 +31,23 @@ public class Hollow implements ModInitializer { @Override public void onInitialize() { - Registrar.process(HollowSoundEventRegistrar.class, MODID); - Registrar.process(HollowBlockRegistrar.class, MODID); - Registrar.process(HollowItemRegistrar.class, MODID); - Registrar.process(HollowEntityTypeRegistrar.class, MODID); - Registrar.process(HollowFeatureRegistrar.class, MODID); - Registrar.process(HollowTreeDecoratorRegistrar.class, MODID); - Registrar.process(HollowBlockEntityRegistrar.class, MODID); - Registrar.process(HollowParticleRegistrar.class, MODID); - Registrar.process(HollowDataComponentRegistrar.class, MODID); + RegistryHelper.registerSoundEvents(HollowSoundEvents.class, MODID); + RegistryHelper.registerBlocks(HollowBlocks.class, MODID); + RegistryHelper.registerItems(HollowItems.class, MODID); + RegistryHelper.registerEntityTypes(HollowEntityTypes.class, MODID); + RegistryHelper.registerFields(Registries.FEATURE, RegistryHelper.fixGenerics(Feature.class), HollowFeatures.class, MODID); + RegistryHelper.registerFields(Registries.TREE_DECORATOR_TYPE, RegistryHelper.fixGenerics(TreeDecoratorType.class), HollowTreeDecoratorTypes.class, MODID); + RegistryHelper.registerBlockEntityTypes(HollowBlockEntityTypes.class, MODID); + RegistryHelper.registerParticleTypes(HollowParticleTypes.class, MODID); + RegistryHelper.registerDataComponentTypes(HollowDataComponentTypes.class, MODID); + RegistryHelper.registerFields(Registries.FOLIAGE_PLACER_TYPE, RegistryHelper.fixGenerics(FoliagePlacerType.class), HollowFoliagePlacerTypes.class, MODID); + RegistryHelper.registerFields(Registries.CRITERION, RegistryHelper.fixGenerics(Criterion.class), HollowCriteria.class, MODID); + + HollowGameRules.init(); Registry.register( Registries.LOOT_FUNCTION_TYPE, - Identifier.of(MODID, "set_copper_instrument"), + id("set_copper_instrument"), SET_COPPER_INSTRUMENT ); @@ -49,7 +57,7 @@ public void onInitialize() { "bass" ).forEach(name -> { for (int i = 0; i < 10; i++) { - Identifier id = Identifier.of(MODID, "horn.%s.%d".formatted(name, i)); + Identifier id = id("horn.%s.%d".formatted(name, i)); Registry.register( Registries.SOUND_EVENT, id, @@ -58,9 +66,14 @@ public void onInitialize() { } }); - FabricDefaultAttributeRegistry.register(HollowEntityTypeRegistrar.FIREFLY, FireflyEntity.createFireflyAttributes()); + FabricDefaultAttributeRegistry.register(HollowEntityTypes.FIREFLY, FireflyEntity.createFireflyAttributes()); HollowBiomeModifications.init(); HollowLootTableModifications.init(); + HollowItemGroupAdditions.init(); + } + + public static Identifier id(String path) { + return Identifier.of(MODID, path); } } diff --git a/src/main/java/dev/spiritstudios/hollow/HollowConfig.java b/src/main/java/dev/spiritstudios/hollow/HollowConfig.java index 3bdfb6f..6a11539 100644 --- a/src/main/java/dev/spiritstudios/hollow/HollowConfig.java +++ b/src/main/java/dev/spiritstudios/hollow/HollowConfig.java @@ -1,20 +1,20 @@ package dev.spiritstudios.hollow; import dev.spiritstudios.specter.api.config.Config; -import net.minecraft.util.Identifier; +import dev.spiritstudios.specter.api.config.ConfigHolder; +import dev.spiritstudios.specter.api.config.Value; -public class HollowConfig extends Config { - public static final HollowConfig INSTANCE = create(HollowConfig.class); +public final class HollowConfig extends Config { + public static final ConfigHolder HOLDER = ConfigHolder.builder( + Hollow.id("hollow"), HollowConfig.class + ).build(); + public static final HollowConfig INSTANCE = HOLDER.get(); - @Override - public Identifier getId() { return Identifier.of(Hollow.MODID, "hollow"); } - - public Value revertCopperBulb = booleanValue(true) - .comment("Whether to revert the Copper Bulb to it's original 1-tick delay. If you aren't a redstoner, you can ignore this.") - .sync() + public final Value music = booleanValue(true) + .comment("Whether to enable Hollow's custom music.") .build(); - public Value music = booleanValue(true) - .comment("Whether to enable Hollow's custom music.") + public final Value closerFog = booleanValue(true) + .comment("Moves the fog closer to the camera in some biomes") .build(); } diff --git a/src/main/java/dev/spiritstudios/hollow/HollowGameRules.java b/src/main/java/dev/spiritstudios/hollow/HollowGameRules.java new file mode 100644 index 0000000..614e07d --- /dev/null +++ b/src/main/java/dev/spiritstudios/hollow/HollowGameRules.java @@ -0,0 +1,23 @@ +package dev.spiritstudios.hollow; + +import net.fabricmc.fabric.api.gamerule.v1.GameRuleFactory; +import net.fabricmc.fabric.api.gamerule.v1.GameRuleRegistry; +import net.minecraft.world.GameRules; + +public final class HollowGameRules { + public static final GameRules.Key DO_FROG_POISONING = GameRuleRegistry.register( + "doFrogPoisoning", + GameRules.Category.MOBS, + GameRuleFactory.createBooleanRule(true) + ); + + public static final GameRules.Key COPPER_BULB_DELAY = GameRuleRegistry.register( + "copperBulbDelay", + GameRules.Category.UPDATES, + GameRuleFactory.createBooleanRule(true) + ); + + public static void init() { + // NO-OP + } +} diff --git a/src/main/java/dev/spiritstudios/hollow/HollowItemGroupAdditions.java b/src/main/java/dev/spiritstudios/hollow/HollowItemGroupAdditions.java new file mode 100644 index 0000000..2a81641 --- /dev/null +++ b/src/main/java/dev/spiritstudios/hollow/HollowItemGroupAdditions.java @@ -0,0 +1,89 @@ +package dev.spiritstudios.hollow; + +import dev.spiritstudios.hollow.block.HollowLogBlock; +import dev.spiritstudios.hollow.component.CopperInstrument; +import dev.spiritstudios.hollow.registry.HollowBlocks; +import dev.spiritstudios.hollow.registry.HollowDataComponentTypes; +import dev.spiritstudios.hollow.registry.HollowItems; +import dev.spiritstudios.specter.api.core.reflect.ReflectionHelper; +import it.unimi.dsi.fastutil.objects.Object2ReferenceOpenHashMap; +import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroupEntries; +import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents; +import net.minecraft.component.ComponentChanges; +import net.minecraft.item.*; +import net.minecraft.registry.Registries; + +import java.util.Arrays; +import java.util.Map; + +public final class HollowItemGroupAdditions { + public static void init() { + Map baseToHollow = new Object2ReferenceOpenHashMap<>(); + ReflectionHelper.getStaticFields(HollowBlocks.class, HollowLogBlock.class) + .forEach(pair -> + baseToHollow.put(Registries.ITEM.get(pair.value().typeData.id()), pair.value())); + + ItemGroupEvents.MODIFY_ENTRIES_ALL.register((itemGroup, entries) -> { + ItemGroupHelper helper = new ItemGroupHelper(itemGroup, entries); + + baseToHollow.forEach(helper::addAfter); + +// helper.addAfter( +// Items.PINK_PETALS, +// HollowBlocks.PINK_WILDFLOWER, +// HollowBlocks.PURPLE_WILDFLOWER, +// HollowBlocks.BLUE_WILDFLOWER, +// HollowBlocks.WHITE_WILDFLOWER +// ); + helper.addAfter(Items.ALLIUM, HollowBlocks.PAEONIA); + helper.addAfter(Items.BLUE_ORCHID, HollowBlocks.ROOTED_ORCHID); + helper.addAfter(Items.PEONY, HollowBlocks.CAMPION); + helper.addAfter(Items.DEAD_BUSH, HollowBlocks.TWIG); + helper.addAfter(Items.KELP, HollowBlocks.CATTAIL); + helper.addAfter(Items.LILY_PAD, HollowItems.LOTUS_LILYPAD, HollowItems.GIANT_LILYPAD); + helper.addAfter(Items.BROWN_MUSHROOM, HollowBlocks.POLYPORE); + + helper.addAfter(Items.DECORATED_POT, HollowBlocks.JAR, HollowBlocks.FIREFLY_JAR); + + helper.addAfter(Items.SCULK_CATALYST, HollowBlocks.SCULK_JAW); + helper.addAfter(Items.VAULT, HollowBlocks.ECHOING_POT); + helper.addAfter(Items.CHEST, HollowBlocks.STONE_CHEST, HollowBlocks.STONE_CHEST_LID); + + helper.addAfter(Items.CHISELED_COPPER, HollowBlocks.COPPER_PILLAR); + helper.addAfter(Items.EXPOSED_CHISELED_COPPER, HollowBlocks.EXPOSED_COPPER_PILLAR); + helper.addAfter(Items.WEATHERED_CHISELED_COPPER, HollowBlocks.WEATHERED_COPPER_PILLAR); + helper.addAfter(Items.OXIDIZED_CHISELED_COPPER, HollowBlocks.OXIDIZED_COPPER_PILLAR); + + helper.addAfter(Items.WAXED_CHISELED_COPPER, HollowBlocks.WAXED_COPPER_PILLAR); + helper.addAfter(Items.WAXED_EXPOSED_CHISELED_COPPER, HollowBlocks.WAXED_EXPOSED_COPPER_PILLAR); + helper.addAfter(Items.WAXED_WEATHERED_CHISELED_COPPER, HollowBlocks.WAXED_WEATHERED_COPPER_PILLAR); + helper.addAfter(Items.WAXED_OXIDIZED_CHISELED_COPPER, HollowBlocks.WAXED_OXIDIZED_COPPER_PILLAR); + }); + + ItemGroupEvents.modifyEntriesEvent(ItemGroups.SPAWN_EGGS).register(entries -> { + entries.add(HollowItems.FIREFLY_SPAWN_EGG); + }); + + ItemGroupEvents.modifyEntriesEvent(ItemGroups.TOOLS).register(entries -> { + entries.add(HollowItems.MUSIC_DISC_POSTMORTEM); + + entries.addAfter( + Items.GOAT_HORN, + Arrays.stream(CopperInstrument.values()).map(instrument -> new ItemStack( + Registries.ITEM.getEntry(HollowItems.COPPER_HORN), + 1, + ComponentChanges.builder() + .add(HollowDataComponentTypes.COPPER_INSTRUMENT, instrument) + .build() + )).toArray(ItemStack[]::new) + ); + }); + } + + private record ItemGroupHelper(ItemGroup group, FabricItemGroupEntries entries) { + public void addAfter(Item after, ItemConvertible... add) { + if (group.contains(after.getDefaultStack())) + entries.addAfter(after, add); + } + } +} diff --git a/src/main/java/dev/spiritstudios/hollow/HollowTags.java b/src/main/java/dev/spiritstudios/hollow/HollowTags.java deleted file mode 100644 index a6b6116..0000000 --- a/src/main/java/dev/spiritstudios/hollow/HollowTags.java +++ /dev/null @@ -1,19 +0,0 @@ -package dev.spiritstudios.hollow; - -import net.minecraft.block.Block; -import net.minecraft.registry.Registries; -import net.minecraft.registry.RegistryKeys; -import net.minecraft.registry.tag.TagKey; -import net.minecraft.util.Identifier; -import net.minecraft.world.biome.Biome; - -public class HollowTags { - public static final TagKey HOLLOW_LOGS = TagKey.of(Registries.BLOCK.getKey(), id("hollow_logs")); - - public static final TagKey CLOSER_FOG = TagKey.of(RegistryKeys.BIOME, id("closer_fog")); - - - public static Identifier id(String path) { - return Identifier.of(Hollow.MODID, path); - } -} diff --git a/src/main/java/dev/spiritstudios/hollow/block/CampionBlock.java b/src/main/java/dev/spiritstudios/hollow/block/CampionBlock.java new file mode 100644 index 0000000..6ea5797 --- /dev/null +++ b/src/main/java/dev/spiritstudios/hollow/block/CampionBlock.java @@ -0,0 +1,25 @@ +package dev.spiritstudios.hollow.block; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.ShapeContext; +import net.minecraft.block.TallFlowerBlock; +import net.minecraft.block.enums.DoubleBlockHalf; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.shape.VoxelShape; +import net.minecraft.world.BlockView; + +public class CampionBlock extends TallFlowerBlock { + private static final VoxelShape UPPER_SHAPE = Block.createCuboidShape(0.0, 0.0, 0.0, 16.0, 8.0, 16.0); + + public CampionBlock(Settings settings) { + super(settings); + } + + @Override + public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { + return state.get(HALF) == DoubleBlockHalf.UPPER ? + UPPER_SHAPE : + super.getOutlineShape(state, world, pos, context); + } +} diff --git a/src/main/java/dev/spiritstudios/hollow/block/CattailBlock.java b/src/main/java/dev/spiritstudios/hollow/block/CattailBlock.java index e7cfd78..534c697 100644 --- a/src/main/java/dev/spiritstudios/hollow/block/CattailBlock.java +++ b/src/main/java/dev/spiritstudios/hollow/block/CattailBlock.java @@ -1,6 +1,7 @@ package dev.spiritstudios.hollow.block; import com.mojang.serialization.MapCodec; +import dev.spiritstudios.hollow.registry.HollowBlocks; import net.minecraft.block.*; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.fluid.Fluid; @@ -11,100 +12,72 @@ import net.minecraft.server.world.ServerWorld; import net.minecraft.state.StateManager; import net.minecraft.state.property.BooleanProperty; -import net.minecraft.state.property.EnumProperty; import net.minecraft.state.property.Properties; -import net.minecraft.util.StringIdentifiable; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.util.math.random.Random; import net.minecraft.util.shape.VoxelShape; import net.minecraft.world.BlockView; -import net.minecraft.world.World; import net.minecraft.world.WorldAccess; -import net.minecraft.world.WorldView; import org.jetbrains.annotations.Nullable; -import java.util.Locale; - -public class CattailBlock extends PlantBlock implements Fertilizable, FluidFillable { +public class CattailBlock extends AbstractPlantStemBlock implements FluidFillable { public static final MapCodec CODEC = createCodec(CattailBlock::new); - public static final EnumProperty PIECE = EnumProperty.of("reeds_part", Piece.class); public static final BooleanProperty WATERLOGGED = Properties.WATERLOGGED; protected static final VoxelShape SHAPE = Block.createCuboidShape(2.0, 0.0, 2.0, 14.0, 16.0, 14.0); public CattailBlock(AbstractBlock.Settings settings) { - super(settings); - - this.setDefaultState(this.stateManager.getDefaultState().with(PIECE, Piece.BASE).with(WATERLOGGED, true)); + super(settings, Direction.UP, SHAPE, true, 0.14); + setDefaultState(getDefaultState().with(WATERLOGGED, false)); } @Override protected void appendProperties(StateManager.Builder builder) { - builder.add(PIECE); + super.appendProperties(builder); builder.add(WATERLOGGED); } @Override - protected MapCodec getCodec() { - return CODEC; + protected int getGrowthLength(Random random) { + return 1; } - @Override - public boolean canFillWithFluid(@Nullable PlayerEntity player, BlockView world, BlockPos pos, BlockState state, Fluid fluid) { - return false; - } - - @Override - public boolean tryFillWithFluid(WorldAccess world, BlockPos pos, BlockState state, FluidState fluidState) { - return false; + protected boolean chooseStemState(BlockState state) { + return true; } - @Nullable @Override - public BlockState getPlacementState(ItemPlacementContext ctx) { - BlockState belowState = ctx.getWorld().getBlockState(ctx.getBlockPos().down()); - FluidState fluidState = ctx.getWorld().getFluidState(ctx.getBlockPos()); - if (belowState.isOf(this)) { - return super.getPlacementState(ctx).with(PIECE, Piece.TOP).with(WATERLOGGED, fluidState.isIn(FluidTags.WATER)); - } - - if (fluidState.isIn(FluidTags.WATER) && fluidState.getLevel() == 8) { - return super.getPlacementState(ctx); - } - - return null; + protected MapCodec getCodec() { + return CODEC; } @Override - protected VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { - return SHAPE; + protected Block getPlant() { + return HollowBlocks.CATTAIL_STEM; } @Override - protected BlockState getStateForNeighborUpdate( - BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos - ) { - BlockState blockState = super.getStateForNeighborUpdate(state, direction, neighborState, world, pos, neighborPos); - if (!blockState.isAir()) { - world.scheduleFluidTick(pos, Fluids.WATER, Fluids.WATER.getTickRate(world)); - } - - if (direction == Direction.UP && neighborState.isOf(this) && state.get(PIECE) == Piece.TOP) { - return blockState.with(PIECE, Piece.MIDDLE); - } - - if (direction == Direction.UP && !neighborState.isOf(this) && state.get(PIECE) == Piece.MIDDLE) { - return Blocks.AIR.getDefaultState(); - } + protected BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) { + BlockState below = world.getBlockState(pos.down()); - return blockState; + return super.getStateForNeighborUpdate(state, direction, neighborState, world, pos, neighborPos) + .withIfExists(WATERLOGGED, world.isWater(pos)) + .withIfExists(CattailStemBlock.BOTTOM, !below.isOf(this) && !below.isOf(getPlant())); } + @Nullable @Override - protected boolean canPlantOnTop(BlockState floor, BlockView world, BlockPos pos) { - return super.canPlantOnTop(floor, world, pos) || floor.isOf(this); + public BlockState getPlacementState(ItemPlacementContext ctx) { + FluidState fluidState = ctx.getWorld().getFluidState(ctx.getBlockPos()); + BlockState below = ctx.getWorld().getBlockState(ctx.getBlockPos().down()); + + return (fluidState.isIn(FluidTags.WATER) && fluidState.getLevel() == 8) || below.isOf(this) ? + super.getPlacementState(ctx).with(WATERLOGGED, fluidState.isIn(FluidTags.WATER)) + .withIfExists(CattailStemBlock.BOTTOM, !below.isOf(this) && !below.isOf(getPlant())) + : + null; } @Override @@ -113,26 +86,50 @@ protected FluidState getFluidState(BlockState state) { } @Override - public boolean isFertilizable(WorldView world, BlockPos pos, BlockState state) { - return true; - } + protected void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random random) { + if (state.get(AGE) >= 25 || !(random.nextDouble() < 0.14)) return; + int outOfWater = 0; + BlockPos waterPos = pos; + while (!world.isWater(waterPos)) { + waterPos = waterPos.down(); + outOfWater++; + if (outOfWater > 3) break; + } - @Override - public boolean canGrow(World world, Random random, BlockPos pos, BlockState state) { - return true; + if (outOfWater > 3) return; + + BlockPos blockPos = pos.offset(this.growthDirection); + if (this.chooseStemState(world.getBlockState(blockPos))) + world.setBlockState( + blockPos, + this.age(state, world.random) + .with(WATERLOGGED, world.isWater(blockPos)) + ); } @Override public void grow(ServerWorld world, Random random, BlockPos pos, BlockState state) { - + BlockPos blockPos = pos.offset(this.growthDirection); + int age = Math.min(state.get(AGE) + 1, 25); + int length = this.getGrowthLength(random); + + for (int i = 0; i < length && this.chooseStemState(world.getBlockState(blockPos)); i++) { + world.setBlockState( + blockPos, + state.with(AGE, age).with(WATERLOGGED, world.isWater(blockPos)) + ); + blockPos = blockPos.offset(this.growthDirection); + age = Math.min(age + 1, 25); + } } - public enum Piece implements StringIdentifiable { - TOP, - MIDDLE, - BASE; + @Override + public boolean canFillWithFluid(@Nullable PlayerEntity player, BlockView world, BlockPos pos, BlockState state, Fluid fluid) { + return false; + } - @Override - public String asString() { return this.name().toLowerCase(Locale.ROOT); } + @Override + public boolean tryFillWithFluid(WorldAccess world, BlockPos pos, BlockState state, FluidState fluidState) { + return false; } } diff --git a/src/main/java/dev/spiritstudios/hollow/block/CattailStemBlock.java b/src/main/java/dev/spiritstudios/hollow/block/CattailStemBlock.java new file mode 100644 index 0000000..eff6195 --- /dev/null +++ b/src/main/java/dev/spiritstudios/hollow/block/CattailStemBlock.java @@ -0,0 +1,79 @@ +package dev.spiritstudios.hollow.block; + +import com.mojang.serialization.MapCodec; +import dev.spiritstudios.hollow.registry.HollowBlocks; +import net.minecraft.block.*; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.fluid.Fluid; +import net.minecraft.fluid.FluidState; +import net.minecraft.fluid.Fluids; +import net.minecraft.item.ItemPlacementContext; +import net.minecraft.state.StateManager; +import net.minecraft.state.property.BooleanProperty; +import net.minecraft.state.property.Properties; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.util.shape.VoxelShapes; +import net.minecraft.world.*; +import org.jetbrains.annotations.Nullable; + +public class CattailStemBlock extends AbstractPlantBlock implements FluidFillable { + public static final MapCodec CODEC = createCodec(CattailStemBlock::new); + public static final BooleanProperty WATERLOGGED = Properties.WATERLOGGED; + public static final BooleanProperty BOTTOM = Properties.BOTTOM; + + public CattailStemBlock(AbstractBlock.Settings settings) { + super(settings, Direction.UP, CattailBlock.SHAPE, true); + setDefaultState(getDefaultState().with(BOTTOM, false)); + } + + @Override + protected void appendProperties(StateManager.Builder builder) { + super.appendProperties(builder); + builder.add(WATERLOGGED, BOTTOM); + } + + @Override + protected MapCodec getCodec() { + return CODEC; + } + + @Override + protected AbstractPlantStemBlock getStem() { + return HollowBlocks.CATTAIL; + } + + @Nullable + @Override + public BlockState getPlacementState(ItemPlacementContext ctx) { + BlockState below = ctx.getWorld().getBlockState(ctx.getBlockPos().down()); + + return super.getPlacementState(ctx) + .with(WATERLOGGED, ctx.getWorld().isWater(ctx.getBlockPos())) + .with(BOTTOM, !below.isOf(this) && !below.isOf(getStem())); + } + + @Override + protected BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) { + if (direction != Direction.DOWN) return super.getStateForNeighborUpdate(state, direction, neighborState, world, pos, neighborPos).withIfExists(WATERLOGGED, world.isWater(pos)); + + return super.getStateForNeighborUpdate(state, direction, neighborState, world, pos, neighborPos) + .withIfExists(BOTTOM, !neighborState.isOf(this) && !neighborState.isOf(getStem())) + .withIfExists(WATERLOGGED, world.isWater(pos)); + } + + @Override + protected FluidState getFluidState(BlockState state) { + return state.get(WATERLOGGED) ? Fluids.WATER.getStill(false) : super.getFluidState(state); + } + + @Override + public boolean canFillWithFluid(@Nullable PlayerEntity player, BlockView world, BlockPos pos, BlockState state, Fluid fluid) { + return false; + } + + @Override + public boolean tryFillWithFluid(WorldAccess world, BlockPos pos, BlockState state, FluidState fluidState) { + return false; + } +} diff --git a/src/main/java/dev/spiritstudios/hollow/block/EchoingPotBlock.java b/src/main/java/dev/spiritstudios/hollow/block/EchoingPotBlock.java index 2659ffa..47a4599 100644 --- a/src/main/java/dev/spiritstudios/hollow/block/EchoingPotBlock.java +++ b/src/main/java/dev/spiritstudios/hollow/block/EchoingPotBlock.java @@ -2,7 +2,7 @@ import com.mojang.serialization.MapCodec; import dev.spiritstudios.hollow.block.entity.EchoingPotBlockEntity; -import dev.spiritstudios.hollow.registry.HollowBlockEntityRegistrar; +import dev.spiritstudios.hollow.registry.HollowBlockEntityTypes; import net.minecraft.block.*; import net.minecraft.block.entity.BlockEntity; import net.minecraft.block.entity.BlockEntityTicker; @@ -32,10 +32,10 @@ public EchoingPotBlock(Settings settings) { super(settings); setDefaultState(getDefaultState().with(Properties.HORIZONTAL_FACING, Direction.NORTH)); } - + public static final VoxelShape SHAPE = VoxelShapes.union( - Block.createCuboidShape(1, 0, 1, 15, 13, 15), - Block.createCuboidShape(3, 13, 3, 13, 15, 13) + Block.createCuboidShape(1, 0, 1, 15, 14, 15), + Block.createCuboidShape(4, 14, 4, 12, 16, 12) ); @Override @@ -44,7 +44,9 @@ protected void appendProperties(StateManager.Builder builder) } @Override - public BlockRenderType getRenderType(BlockState state) { return BlockRenderType.MODEL; } + public BlockRenderType getRenderType(BlockState state) { + return BlockRenderType.ENTITYBLOCK_ANIMATED; + } @Override public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { @@ -62,12 +64,11 @@ public BlockEntity createBlockEntity(BlockPos pos, BlockState state) { return new EchoingPotBlockEntity(pos, state); } - @Override protected ItemActionResult onUseWithItem(ItemStack stack, BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { if (world.isClient) return ItemActionResult.SUCCESS; - EchoingPotBlockEntity blockEntity = (EchoingPotBlockEntity)world.getBlockEntity(pos); + EchoingPotBlockEntity blockEntity = (EchoingPotBlockEntity) world.getBlockEntity(pos); Objects.requireNonNull(blockEntity).use(player, hand); return ItemActionResult.CONSUME; } @@ -75,9 +76,11 @@ protected ItemActionResult onUseWithItem(ItemStack stack, BlockState state, Worl @Nullable @Override public BlockEntityTicker getTicker(World world, BlockState state, BlockEntityType type) { - return validateTicker(type, HollowBlockEntityRegistrar.ECHOING_POT_BLOCK_ENTITY, EchoingPotBlockEntity::tick); + return validateTicker(type, HollowBlockEntityTypes.ECHOING_POT_BLOCK_ENTITY, EchoingPotBlockEntity::tick); } @Override - protected MapCodec getCodec() { return CODEC; } + protected MapCodec getCodec() { + return CODEC; + } } diff --git a/src/main/java/dev/spiritstudios/hollow/block/FireflyJarBlock.java b/src/main/java/dev/spiritstudios/hollow/block/FireflyJarBlock.java index e5d7024..2914d8d 100644 --- a/src/main/java/dev/spiritstudios/hollow/block/FireflyJarBlock.java +++ b/src/main/java/dev/spiritstudios/hollow/block/FireflyJarBlock.java @@ -1,6 +1,6 @@ package dev.spiritstudios.hollow.block; -import dev.spiritstudios.hollow.registry.HollowParticleRegistrar; +import dev.spiritstudios.hollow.registry.HollowParticleTypes; import net.minecraft.block.*; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.random.Random; @@ -22,7 +22,7 @@ public BlockRenderType getRenderType(BlockState state) { public void randomDisplayTick(BlockState state, World world, BlockPos pos, Random random) { if (random.nextInt(15) == 0) world.addParticle( - HollowParticleRegistrar.FIREFLY_JAR, + HollowParticleTypes.FIREFLY_JAR, (pos.getX() + 0.5) + (random.nextDouble() - 0.5) / 5.0F, (pos.getY() + 0.5) + (2 * random.nextDouble() - 1) / 5.0F, (pos.getZ() + 0.5) + (random.nextDouble() - 0.5) / 5.0F, diff --git a/src/main/java/dev/spiritstudios/hollow/block/GiantLilyPadBlock.java b/src/main/java/dev/spiritstudios/hollow/block/GiantLilyPadBlock.java index eb4c410..8d709d0 100644 --- a/src/main/java/dev/spiritstudios/hollow/block/GiantLilyPadBlock.java +++ b/src/main/java/dev/spiritstudios/hollow/block/GiantLilyPadBlock.java @@ -1,7 +1,14 @@ package dev.spiritstudios.hollow.block; -import net.minecraft.block.*; -import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.HorizontalFacingBlock; +import net.minecraft.block.LilyPadBlock; +import net.minecraft.block.ShapeContext; +import net.minecraft.entity.LivingEntity; +import net.minecraft.item.ItemPlacementContext; +import net.minecraft.item.ItemStack; +import net.minecraft.registry.tag.BlockTags; import net.minecraft.state.StateManager; import net.minecraft.state.property.DirectionProperty; import net.minecraft.state.property.EnumProperty; @@ -11,6 +18,7 @@ import net.minecraft.util.shape.VoxelShape; import net.minecraft.world.BlockView; import net.minecraft.world.World; +import org.jetbrains.annotations.Nullable; import java.util.ArrayList; import java.util.List; @@ -28,15 +36,42 @@ public GiantLilyPadBlock(Settings settings) { } @Override - public BlockState onBreak(World world, BlockPos pos, BlockState state, PlayerEntity player) { + public @Nullable BlockState getPlacementState(ItemPlacementContext ctx) { + World world = ctx.getWorld(); + BlockPos pos = ctx.getBlockPos(); + + if (posInvalid(world, pos) || posInvalid(world, pos.east()) || posInvalid(world, pos.south()) || posInvalid(world, pos.east().south()) + ) return null; + + return this.getDefaultState().with(FACING, ctx.getHorizontalPlayerFacing()); + } + + private boolean posInvalid(World world, BlockPos pos) { + return (!world.isWater(pos.down()) && !world.getBlockState(pos.down()).isIn(BlockTags.ICE)) || !world.isAir(pos); + } + + @Override + public void onPlaced(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack) { + if (world.isClient() || state.get(PIECE) != Piece.NORTH_WEST) return; + + world.setBlockState(pos.south(), state.with(PIECE, Piece.SOUTH_WEST)); + world.setBlockState(pos.east(), state.with(PIECE, Piece.NORTH_EAST)); + world.setBlockState(pos.south().east(), state.with(PIECE, Piece.SOUTH_EAST)); + } + + @Override + protected void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) { + super.onStateReplaced(state, world, pos, newState, moved); + if (newState.isOf(this)) return; + for (BlockPos blockPos : getBlocks(pos, state)) { + if (blockPos.equals(pos)) continue; BlockState blockState = world.getBlockState(blockPos); - if (blockState.getBlock() == this) world.breakBlock(blockPos, blockPos.equals(pos)); + if (blockState.isOf(this)) world.breakBlock(blockPos, false); } - - return super.onBreak(world, pos, state, player); } + public List getBlocks(BlockPos pos, BlockState state) { List blocks = new ArrayList<>(); if (state.getBlock() != this) return blocks; @@ -68,7 +103,6 @@ public enum Piece implements StringIdentifiable { SOUTH_WEST, SOUTH_EAST; - @Override public String asString() { return this.name().toLowerCase(Locale.ROOT); } } diff --git a/src/main/java/dev/spiritstudios/hollow/block/HollowLogBlock.java b/src/main/java/dev/spiritstudios/hollow/block/HollowLogBlock.java index 37cbcdd..4259a01 100644 --- a/src/main/java/dev/spiritstudios/hollow/block/HollowLogBlock.java +++ b/src/main/java/dev/spiritstudios/hollow/block/HollowLogBlock.java @@ -1,9 +1,11 @@ package dev.spiritstudios.hollow.block; +import dev.spiritstudios.hollow.data.LogTypeData; import net.minecraft.block.*; import net.minecraft.fluid.FluidState; import net.minecraft.fluid.Fluids; import net.minecraft.item.ItemPlacementContext; +import net.minecraft.registry.Registries; import net.minecraft.state.StateManager; import net.minecraft.state.property.BooleanProperty; import net.minecraft.state.property.Properties; @@ -39,21 +41,31 @@ public class HollowLogBlock extends PillarBlock implements Waterloggable { public static final BooleanProperty WATERLOGGED = Properties.WATERLOGGED; public static final BooleanProperty MOSSY = BooleanProperty.of("mossy"); - public String insideTexture; - public String sideTexture; - public String endTexture; + public final LogTypeData typeData; - public HollowLogBlock(Settings settings, String sideTexture, String insideTexture, String endTexture) { + public HollowLogBlock(Settings settings, LogTypeData typeData) { super(settings); - this.insideTexture = insideTexture; - this.sideTexture = sideTexture; - this.endTexture = endTexture; + this.typeData = typeData; setDefaultState(getDefaultState() .with(AXIS, Direction.Axis.Y) .with(WATERLOGGED, false) .with(MOSSY, false)); } + public static HollowLogBlock of(Block block) { + return new HollowLogBlock( + AbstractBlock.Settings.copy(block), + LogTypeData.byId(Registries.BLOCK.getId(block)) + ); + } + + public static HollowLogBlock ofStripped(Block block) { + return new HollowLogBlock( + AbstractBlock.Settings.copy(block), + LogTypeData.byIdStripped(Registries.BLOCK.getId(block)) + ); + } + @Override protected void appendProperties(StateManager.Builder builder) { builder.add(Properties.AXIS, WATERLOGGED, MOSSY); @@ -85,10 +97,9 @@ public FluidState getFluidState(BlockState state) { @Override public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) { - if (state.get(WATERLOGGED)) { + if (state.get(WATERLOGGED)) world.scheduleFluidTick(pos, Fluids.WATER, Fluids.WATER.getTickRate(world)); - } - + if (direction == Direction.UP) { Block above = neighborState.getBlock(); return state.with(MOSSY, (above == Blocks.MOSS_CARPET) || (above == Blocks.MOSS_BLOCK)); diff --git a/src/main/java/dev/spiritstudios/hollow/block/PolyporeBlock.java b/src/main/java/dev/spiritstudios/hollow/block/PolyporeBlock.java index 26bc2a1..6e85587 100644 --- a/src/main/java/dev/spiritstudios/hollow/block/PolyporeBlock.java +++ b/src/main/java/dev/spiritstudios/hollow/block/PolyporeBlock.java @@ -1,8 +1,8 @@ package dev.spiritstudios.hollow.block; import com.mojang.serialization.MapCodec; -import dev.spiritstudios.hollow.HollowTags; -import dev.spiritstudios.specter.api.core.util.VoxelShapeHelper; +import dev.spiritstudios.hollow.registry.HollowBlocks; +import dev.spiritstudios.specter.api.core.math.VoxelShapeHelper; import net.minecraft.block.*; import net.minecraft.item.ItemPlacementContext; import net.minecraft.item.ItemStack; @@ -21,7 +21,7 @@ public class PolyporeBlock extends PlantBlock implements Fertilizable { public static final IntProperty POLYPORE_AMOUNT = IntProperty.of("amount", 1, 3); - + public static final VoxelShape SHAPE_NORTH = Block.createCuboidShape(1, 1, 8, 15, 15, 16); public static final VoxelShape SHAPE_SOUTH = VoxelShapeHelper.rotateHorizontal(Direction.SOUTH, Direction.NORTH, SHAPE_NORTH); public static final VoxelShape SHAPE_EAST = VoxelShapeHelper.rotateHorizontal(Direction.EAST, Direction.NORTH, SHAPE_NORTH); @@ -35,7 +35,7 @@ public PolyporeBlock(Settings settings) { .with(Properties.HORIZONTAL_FACING, Direction.NORTH) .with(POLYPORE_AMOUNT, 1)); } - + @Override protected void appendProperties(StateManager.Builder builder) { @@ -51,29 +51,36 @@ public boolean canReplace(BlockState state, ItemPlacementContext context) { public BlockState getPlacementState(ItemPlacementContext ctx) { BlockState blockState = ctx.getWorld().getBlockState(ctx.getBlockPos()); if (blockState.isOf(this)) return blockState.cycle(POLYPORE_AMOUNT); - + for (Direction direction : ctx.getPlacementDirections()) { if (direction.getAxis().isHorizontal()) { BlockState blockState2 = getDefaultState().with(Properties.HORIZONTAL_FACING, direction.getOpposite()); if (blockState2.canPlaceAt(ctx.getWorld(), ctx.getBlockPos())) return blockState2; } } - + return null; } @Override - public boolean isTransparent(BlockState state, BlockView world, BlockPos pos) { return true; } + public boolean isTransparent(BlockState state, BlockView world, BlockPos pos) { + return true; + } @Override - public boolean isFertilizable(WorldView world, BlockPos pos, BlockState state) { return true; } + public boolean isFertilizable(WorldView world, BlockPos pos, BlockState state) { + return true; + } @Override - public boolean canGrow(World world, Random random, BlockPos pos, BlockState state) { return true; } + public boolean canGrow(World world, Random random, BlockPos pos, BlockState state) { + return true; + } @Override public void grow(ServerWorld world, Random random, BlockPos pos, BlockState state) { - if (state.get(POLYPORE_AMOUNT) < 3) world.setBlockState(pos, state.cycle(POLYPORE_AMOUNT), Block.NOTIFY_LISTENERS); + if (state.get(POLYPORE_AMOUNT) < 3) + world.setBlockState(pos, state.cycle(POLYPORE_AMOUNT), Block.NOTIFY_LISTENERS); else dropStack(world, pos, new ItemStack(this)); } @@ -93,11 +100,13 @@ public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) { Direction direction = state.get(Properties.HORIZONTAL_FACING); BlockPos blockPos = pos.offset(direction.getOpposite()); BlockState blockState = world.getBlockState(blockPos); - + return blockState.isSideSolidFullSquare(world, blockPos, direction) && - (blockState.isIn(BlockTags.LOGS) || blockState.isIn(HollowTags.HOLLOW_LOGS)); + blockState.isIn(HollowBlocks.Tags.POLYPORE_PLACEABLE_ON); } @Override - protected MapCodec getCodec() { return CODEC; } + protected MapCodec getCodec() { + return CODEC; + } } diff --git a/src/main/java/dev/spiritstudios/hollow/block/RootVinesBlock.java b/src/main/java/dev/spiritstudios/hollow/block/RootVinesBlock.java deleted file mode 100644 index 79ad8c1..0000000 --- a/src/main/java/dev/spiritstudios/hollow/block/RootVinesBlock.java +++ /dev/null @@ -1,65 +0,0 @@ -package dev.spiritstudios.hollow.block; - -import net.minecraft.block.*; -import net.minecraft.fluid.FluidState; -import net.minecraft.fluid.Fluids; -import net.minecraft.item.ItemPlacementContext; -import net.minecraft.state.StateManager; -import net.minecraft.state.property.BooleanProperty; -import net.minecraft.state.property.Properties; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Direction; -import net.minecraft.world.WorldAccess; -import net.minecraft.world.WorldView; -import org.jetbrains.annotations.Nullable; - -public class RootVinesBlock extends Block implements Waterloggable { - private static final BooleanProperty WATERLOGGED = Properties.WATERLOGGED; - private static final BooleanProperty UP = Properties.UP; - - public RootVinesBlock(AbstractBlock.Settings settings) { - super(settings); - this.setDefaultState(this.stateManager.getDefaultState().with(WATERLOGGED, false).with(UP, false)); - } - - @Override - protected void appendProperties(StateManager.Builder builder) { - builder.add(WATERLOGGED); - builder.add(UP); - } - - @Override - public FluidState getFluidState(BlockState state) { - return state.get(WATERLOGGED) ? Fluids.WATER.getStill(false) : super.getFluidState(state); - } - - @Nullable - @Override - public BlockState getPlacementState(ItemPlacementContext ctx) { - BlockState blockState = super.getPlacementState(ctx); - if (blockState != null) { - FluidState fluidState = ctx.getWorld().getFluidState(ctx.getBlockPos()); - return blockState.with(WATERLOGGED, fluidState.getFluid() == Fluids.WATER); - } else return null; - } - - @Override - public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) { - BlockPos blockPos = pos.up(); - BlockState blockState = world.getBlockState(blockPos); - return blockState.isSideSolidFullSquare(world, blockPos, Direction.DOWN) || blockState.getBlock() == this; - } - - @Override - public BlockState getStateForNeighborUpdate( - BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos - ) { - if (direction == Direction.DOWN && neighborState.getBlock() == this) return state.with(UP, true); - - if (direction == Direction.UP && !this.canPlaceAt(state, world, pos)) return Blocks.AIR.getDefaultState(); - else { - if (state.get(WATERLOGGED)) world.scheduleFluidTick(pos, Fluids.WATER, Fluids.WATER.getTickRate(world)); - return super.getStateForNeighborUpdate(state, direction, neighborState, world, pos, neighborPos); - } - } -} diff --git a/src/main/java/dev/spiritstudios/hollow/block/SculkJawBlock.java b/src/main/java/dev/spiritstudios/hollow/block/SculkJawBlock.java index 12fe0d3..0665f79 100644 --- a/src/main/java/dev/spiritstudios/hollow/block/SculkJawBlock.java +++ b/src/main/java/dev/spiritstudios/hollow/block/SculkJawBlock.java @@ -1,33 +1,23 @@ package dev.spiritstudios.hollow.block; -import dev.spiritstudios.hollow.Hollow; -import dev.spiritstudios.hollow.registry.HollowSoundEventRegistrar; +import dev.spiritstudios.hollow.registry.HollowDamageTypes; +import dev.spiritstudios.hollow.registry.HollowEntityTypes; +import dev.spiritstudios.hollow.registry.HollowSoundEvents; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.SculkBlock; import net.minecraft.entity.Entity; -import net.minecraft.entity.damage.DamageSource; -import net.minecraft.entity.damage.DamageType; -import net.minecraft.entity.mob.WardenEntity; import net.minecraft.particle.ParticleTypes; -import net.minecraft.registry.RegistryKey; -import net.minecraft.registry.RegistryKeys; import net.minecraft.server.world.ServerWorld; import net.minecraft.sound.SoundCategory; import net.minecraft.sound.SoundEvents; import net.minecraft.state.StateManager; import net.minecraft.state.property.BooleanProperty; -import net.minecraft.util.Identifier; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.random.Random; import net.minecraft.world.World; -import java.util.Set; - public class SculkJawBlock extends SculkBlock { - public static final RegistryKey SCULK_JAW_DAMAGE_TYPE = RegistryKey.of(RegistryKeys.DAMAGE_TYPE, Identifier.of(Hollow.MODID, "sculk_jaw")); - public static final BooleanProperty ACTIVE = BooleanProperty.of("active"); public SculkJawBlock(Settings settings) { @@ -42,30 +32,15 @@ protected void appendProperties(StateManager.Builder builder) @Override public void onSteppedOn(World world, BlockPos pos, BlockState state, Entity entity) { - if (!entity.bypassesSteppingEffects() && !world.isClient() && !(entity instanceof WardenEntity)) { - if (!world.getBlockState(pos).get(ACTIVE)) - world.playSound(null, pos.up(), HollowSoundEventRegistrar.SCULK_JAW_BITE, SoundCategory.BLOCKS, 1F, 0.6F); - - world.setBlockState(pos, state.with(ACTIVE, true)); - - Vec3d centerPos = pos.toCenterPos(); - entity.teleport( - (ServerWorld) world, - centerPos.getX(), - centerPos.getY(), - centerPos.getZ(), - Set.of(), - entity.getYaw(), - entity.getPitch() - ); + if (world.isClient() || entity.getType().isIn(HollowEntityTypes.Tags.IMMUNE_TO_SCULK_JAW)) { + super.onSteppedOn(world, pos, state, entity); + return; } - super.onSteppedOn(world, pos, state, entity); - } + if (!world.getBlockState(pos).get(ACTIVE)) + world.playSound(null, pos.up(), HollowSoundEvents.SCULK_JAW_BITE, SoundCategory.BLOCKS, 1F, 0.6F); - @Override - public void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity) { - if (!state.get(ACTIVE)) return; + world.setBlockState(pos, state.with(ACTIVE, true)); if (world.isClient) { Random random = world.getRandom(); @@ -87,19 +62,7 @@ public void onEntityCollision(BlockState state, World world, BlockPos pos, Entit return; } - DamageSource damageSource = new DamageSource(world.getRegistryManager().get(RegistryKeys.DAMAGE_TYPE).entryOf(SCULK_JAW_DAMAGE_TYPE)); - entity.damage(damageSource, 1F); - - Vec3d centerPos = pos.toCenterPos(); - entity.teleport( - (ServerWorld) world, - centerPos.getX(), - centerPos.getY(), - centerPos.getZ(), - Set.of(), - entity.getYaw(), - entity.getPitch() - ); + entity.damage(world.getDamageSources().create(HollowDamageTypes.SCULK_JAW), 1F); if (world.getTime() % 5 == 0) { world.playSound( @@ -111,9 +74,6 @@ public void onEntityCollision(BlockState state, World world, BlockPos pos, Entit 1F ); } - - if (world.random.nextFloat() <= 0.0025F) - world.setBlockState(pos, state.with(ACTIVE, false)); } @Override @@ -123,6 +83,6 @@ public boolean hasRandomTicks(BlockState state) { @Override public void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random random) { - if (state.get(ACTIVE)) world.setBlockState(pos, state.with(ACTIVE, false)); + world.setBlockState(pos, state.with(ACTIVE, false)); } } diff --git a/src/main/java/dev/spiritstudios/hollow/block/StoneChestBlock.java b/src/main/java/dev/spiritstudios/hollow/block/StoneChestBlock.java index 28ab126..ff89991 100644 --- a/src/main/java/dev/spiritstudios/hollow/block/StoneChestBlock.java +++ b/src/main/java/dev/spiritstudios/hollow/block/StoneChestBlock.java @@ -2,7 +2,7 @@ import com.mojang.serialization.MapCodec; import dev.spiritstudios.hollow.block.entity.StoneChestBlockEntity; -import dev.spiritstudios.specter.api.core.util.VoxelShapeHelper; +import dev.spiritstudios.specter.api.core.math.VoxelShapeHelper; import net.minecraft.block.*; import net.minecraft.block.entity.BlockEntity; import net.minecraft.block.enums.ChestType; @@ -163,7 +163,7 @@ && getFacing(neighborState) == direction.getOpposite()) { @Override protected ItemActionResult onUseWithItem(ItemStack stack, BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { - if (world.isClient) return ItemActionResult.SUCCESS; + if (world.isClient) return ItemActionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION; StoneChestBlockEntity blockEntity = (StoneChestBlockEntity) world.getBlockEntity(pos); return Objects.requireNonNull(blockEntity).use(player, hand, hit.getSide()); diff --git a/src/main/java/dev/spiritstudios/hollow/block/StoneChestLidBlock.java b/src/main/java/dev/spiritstudios/hollow/block/StoneChestLidBlock.java index b7c36a4..1273a9b 100644 --- a/src/main/java/dev/spiritstudios/hollow/block/StoneChestLidBlock.java +++ b/src/main/java/dev/spiritstudios/hollow/block/StoneChestLidBlock.java @@ -1,6 +1,6 @@ package dev.spiritstudios.hollow.block; -import dev.spiritstudios.specter.api.core.util.VoxelShapeHelper; +import dev.spiritstudios.specter.api.core.math.VoxelShapeHelper; import net.minecraft.block.*; import net.minecraft.block.enums.ChestType; import net.minecraft.fluid.FluidState; @@ -17,6 +17,7 @@ import net.minecraft.util.math.Direction; import net.minecraft.util.shape.VoxelShape; import net.minecraft.world.BlockView; +import net.minecraft.world.World; import net.minecraft.world.WorldAccess; import org.jetbrains.annotations.Nullable; @@ -24,7 +25,8 @@ public class StoneChestLidBlock extends Block { public static final DirectionProperty FACING = HorizontalFacingBlock.FACING; public static final EnumProperty CHEST_TYPE = Properties.CHEST_TYPE; public static final BooleanProperty WATERLOGGED = Properties.WATERLOGGED; - + + // region VoxelShapes public static final VoxelShape SHAPE_SINGLE = Block.createCuboidShape(1, 0, 1, 15, 4, 15); public static final VoxelShape SHAPE_LEFT_NORTH = Block.createCuboidShape(1, 0, 1, 16, 4, 15); @@ -36,6 +38,7 @@ public class StoneChestLidBlock extends Block { public static final VoxelShape SHAPE_RIGHT_EAST = VoxelShapeHelper.rotateHorizontal(Direction.EAST, Direction.NORTH, SHAPE_RIGHT_NORTH); public static final VoxelShape SHAPE_RIGHT_SOUTH = VoxelShapeHelper.rotateHorizontal(Direction.SOUTH, Direction.NORTH, SHAPE_RIGHT_NORTH); public static final VoxelShape SHAPE_RIGHT_WEST = VoxelShapeHelper.rotateHorizontal(Direction.WEST, Direction.NORTH, SHAPE_RIGHT_NORTH); + // endregion public StoneChestLidBlock(Settings settings) { super(settings); @@ -80,12 +83,6 @@ private Direction getNeighborChestDirection(ItemPlacementContext ctx, Direction return blockState.isOf(this) && blockState.get(CHEST_TYPE) == ChestType.SINGLE ? blockState.get(FACING) : null; } - @Override - public BlockRenderType getRenderType(BlockState state) { return BlockRenderType.MODEL; } - - @Override - protected void appendProperties(StateManager.Builder builder) { builder.add(FACING, CHEST_TYPE, WATERLOGGED); } - @Override public BlockState rotate(BlockState state, BlockRotation rotation) { return state.with(FACING, rotation.rotate(state.get(FACING))); } @@ -98,7 +95,9 @@ public BlockState getStateForNeighborUpdate( ) { if (state.get(WATERLOGGED)) world.scheduleFluidTick(pos, Fluids.WATER, Fluids.WATER.getTickRate(world)); - if (neighborState.isOf(this) && direction.getAxis().isHorizontal()) { + if (!neighborState.isOf(this) || !direction.getAxis().isHorizontal()) { + if (getFacing(state) == direction) return state.with(CHEST_TYPE, ChestType.SINGLE); + } else { ChestType chestType = neighborState.get(CHEST_TYPE); if (state.get(CHEST_TYPE) == ChestType.SINGLE && chestType != ChestType.SINGLE @@ -106,11 +105,23 @@ public BlockState getStateForNeighborUpdate( && getFacing(neighborState) == direction.getOpposite()) { return state.with(CHEST_TYPE, chestType.getOpposite()); } - } else if (getFacing(state) == direction) return state.with(CHEST_TYPE, ChestType.SINGLE); + } return super.getStateForNeighborUpdate(state, direction, neighborState, world, pos, neighborPos); } + @Override + protected void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) { + super.onStateReplaced(state, world, pos, newState, moved); + if (state.isOf(newState.getBlock())) return; + ChestType type = state.get(CHEST_TYPE); + if (type == ChestType.SINGLE) return; + + Direction facing = state.get(FACING); + BlockPos otherPos = pos.offset(type == ChestType.LEFT ? facing.rotateYClockwise() : facing.rotateYCounterclockwise()); + world.breakBlock(otherPos, false); + } + public static Direction getFacing(BlockState state) { Direction direction = state.get(FACING); return state.get(CHEST_TYPE) == ChestType.LEFT ? direction.rotateYClockwise() : direction.rotateYCounterclockwise(); @@ -145,4 +156,12 @@ public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos po return SHAPE_SINGLE; } } + + // region Settings + @Override + public BlockRenderType getRenderType(BlockState state) { return BlockRenderType.MODEL; } + + @Override + protected void appendProperties(StateManager.Builder builder) { builder.add(FACING, CHEST_TYPE, WATERLOGGED); } + // endregion } diff --git a/src/main/java/dev/spiritstudios/hollow/block/TwigBlock.java b/src/main/java/dev/spiritstudios/hollow/block/TwigBlock.java index 5f00443..1fd5185 100644 --- a/src/main/java/dev/spiritstudios/hollow/block/TwigBlock.java +++ b/src/main/java/dev/spiritstudios/hollow/block/TwigBlock.java @@ -16,6 +16,7 @@ public TwigBlock(Settings settings) { super(settings); } + // region Settings @Override public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { return SHAPE; @@ -31,4 +32,5 @@ public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) { protected boolean canPathfindThrough(BlockState state, NavigationType type) { return type == NavigationType.AIR && !this.collidable || super.canPathfindThrough(state, type); } + // endregion } diff --git a/src/main/java/dev/spiritstudios/hollow/block/entity/EchoingPotBlockEntity.java b/src/main/java/dev/spiritstudios/hollow/block/entity/EchoingPotBlockEntity.java index 90a5206..6459d9e 100644 --- a/src/main/java/dev/spiritstudios/hollow/block/entity/EchoingPotBlockEntity.java +++ b/src/main/java/dev/spiritstudios/hollow/block/entity/EchoingPotBlockEntity.java @@ -1,9 +1,10 @@ package dev.spiritstudios.hollow.block.entity; -import dev.spiritstudios.hollow.registry.HollowBlockEntityRegistrar; +import dev.spiritstudios.hollow.registry.HollowBlockEntityTypes; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.entity.BlockEntity; +import net.minecraft.block.entity.DecoratedPotBlockEntity; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.ai.WardenAngerManager; import net.minecraft.entity.mob.WardenEntity; @@ -22,6 +23,7 @@ import net.minecraft.util.math.Box; import net.minecraft.util.math.random.Random; import net.minecraft.world.World; +import net.minecraft.world.event.GameEvent; import org.jetbrains.annotations.Nullable; import java.util.List; @@ -29,62 +31,48 @@ public class EchoingPotBlockEntity extends BlockEntity { public int activeTime = 0; + public long lastWobbleTime; + public DecoratedPotBlockEntity.WobbleType lastWobbleType; public EchoingPotBlockEntity(BlockPos pos, BlockState state) { - super(HollowBlockEntityRegistrar.ECHOING_POT_BLOCK_ENTITY, pos, state); + super(HollowBlockEntityTypes.ECHOING_POT_BLOCK_ENTITY, pos, state); } public static void tick(World world, BlockPos pos, BlockState state, EchoingPotBlockEntity blockEntity) { - if (blockEntity.activeTime <= 0) return; - if (!world.isClient) { - blockEntity.activeTime--; - blockEntity.markDirty(); - world.updateListeners(pos, state, state, Block.NOTIFY_LISTENERS); - - List wardens = world.getEntitiesByClass( - WardenEntity.class, - Box.from(pos.toCenterPos()).expand(16), - warden -> true - ); - - wardens.forEach(warden -> { - WardenAngerManager angerManager = warden.getAngerManager(); - - Optional target = angerManager.getPrimeSuspect(); - if (target.isEmpty()) return; + } - angerManager.removeSuspect(target.get()); - }); - } else { - Random random = world.getRandom(); - for (int i = 0; i < 2; ++i) { - float x = 2.0F * random.nextFloat() - 1.0F; - float y = 2.0F * random.nextFloat() - 1.0F; - float z = 2.0F * random.nextFloat() - 1.0F; - world.addParticle( - ParticleTypes.SCULK_SOUL, - (double) pos.getX() + 0.5 + (x * 0.25), - (double) pos.getY() + 1, - (double) pos.getZ() + 0.5 + (z * 0.25), - (x * 0.0075F), - (y * 0.075F), - (z * 0.0075F) - ); - } + public void use(PlayerEntity player, Hand hand) { +// if (!player.getStackInHand(hand).isOf(Items.ECHO_SHARD) || activeTime > 0) { + wobble(DecoratedPotBlockEntity.WobbleType.NEGATIVE); + player.getWorld().playSound(null, pos, SoundEvents.BLOCK_DECORATED_POT_INSERT_FAIL, SoundCategory.BLOCKS, 1.0F, 1.0F); + player.getWorld().emitGameEvent(player, GameEvent.BLOCK_CHANGE, pos); + return; +// } +// +// activeTime += 300; +// player.getStackInHand(hand).decrement(1); +// wobble(DecoratedPotBlockEntity.WobbleType.POSITIVE); +// player.getWorld().emitGameEvent(player, GameEvent.BLOCK_CHANGE, pos); +// player.getWorld().playSound(null, pos, SoundEvents.BLOCK_DECORATED_POT_INSERT, SoundCategory.BLOCKS, 1.0F, 1.0F); + } - if (world.random.nextInt(5) == 0) - world.playSoundAtBlockCenter(pos, SoundEvents.PARTICLE_SOUL_ESCAPE.value(), SoundCategory.BLOCKS, 0.5F, 1.0F, false); - } + public void wobble(DecoratedPotBlockEntity.WobbleType wobbleType) { + if (this.world != null && !this.world.isClient()) + this.world.addSyncedBlockEvent(this.getPos(), this.getCachedState().getBlock(), 1, wobbleType.ordinal()); } - public void use(PlayerEntity player, Hand hand) { - if (player.getStackInHand(hand).isOf(Items.ECHO_SHARD) && activeTime <= 0) { - activeTime += 300; - player.getStackInHand(hand).decrement(1); - } + @Override + public boolean onSyncedBlockEvent(int type, int data) { + if (this.world == null || type != 1 || data < 0 || data >= DecoratedPotBlockEntity.WobbleType.values().length) + return super.onSyncedBlockEvent(type, data); + + this.lastWobbleTime = this.world.getTime(); + this.lastWobbleType = DecoratedPotBlockEntity.WobbleType.values()[data]; + return true; } + // region NBT @Nullable @Override public Packet toUpdatePacket() { @@ -98,13 +86,14 @@ public NbtCompound toInitialChunkDataNbt(RegistryWrapper.WrapperLookup registryL @Override protected void writeNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup registryLookup) { - nbt.putInt("activeTime", activeTime); + nbt.putInt("ActiveTime", activeTime); super.writeNbt(nbt, registryLookup); } @Override public void readNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup registryLookup) { super.readNbt(nbt, registryLookup); - activeTime = nbt.getInt("activeTime"); + activeTime = nbt.getInt("ActiveTime"); } + // endregion } diff --git a/src/main/java/dev/spiritstudios/hollow/block/entity/JarBlockEntity.java b/src/main/java/dev/spiritstudios/hollow/block/entity/JarBlockEntity.java index d69e15a..e30b192 100644 --- a/src/main/java/dev/spiritstudios/hollow/block/entity/JarBlockEntity.java +++ b/src/main/java/dev/spiritstudios/hollow/block/entity/JarBlockEntity.java @@ -1,6 +1,6 @@ package dev.spiritstudios.hollow.block.entity; -import dev.spiritstudios.hollow.registry.HollowBlockEntityRegistrar; +import dev.spiritstudios.hollow.registry.HollowBlockEntityTypes; import dev.spiritstudios.specter.api.block.entity.InventoryBlockEntity; import net.minecraft.block.Block; import net.minecraft.block.BlockState; @@ -18,7 +18,7 @@ public class JarBlockEntity extends InventoryBlockEntity { public JarBlockEntity(BlockPos pos, BlockState state) { - super(HollowBlockEntityRegistrar.JAR_BLOCK_ENTITY, pos, state, 17); + super(HollowBlockEntityTypes.JAR_BLOCK_ENTITY, pos, state, 17); } public void use(World world, BlockPos pos, PlayerEntity player, Hand hand) { diff --git a/src/main/java/dev/spiritstudios/hollow/block/entity/StoneChestBlockEntity.java b/src/main/java/dev/spiritstudios/hollow/block/entity/StoneChestBlockEntity.java index ec73960..90e3f4b 100644 --- a/src/main/java/dev/spiritstudios/hollow/block/entity/StoneChestBlockEntity.java +++ b/src/main/java/dev/spiritstudios/hollow/block/entity/StoneChestBlockEntity.java @@ -1,7 +1,8 @@ package dev.spiritstudios.hollow.block.entity; -import dev.spiritstudios.hollow.registry.HollowBlockEntityRegistrar; -import dev.spiritstudios.hollow.registry.HollowBlockRegistrar; +import dev.spiritstudios.hollow.registry.HollowBlockEntityTypes; +import dev.spiritstudios.hollow.registry.HollowBlocks; +import dev.spiritstudios.hollow.registry.HollowSoundEvents; import dev.spiritstudios.specter.api.block.entity.LootableInventoryBlockEntity; import net.minecraft.advancement.criterion.Criteria; import net.minecraft.block.BlockState; @@ -14,10 +15,13 @@ import net.minecraft.loot.context.LootContextParameters; import net.minecraft.loot.context.LootContextTypes; import net.minecraft.nbt.NbtCompound; +import net.minecraft.particle.ParticleTypes; import net.minecraft.registry.RegistryWrapper; import net.minecraft.server.MinecraftServer; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.world.ServerWorld; +import net.minecraft.sound.SoundCategory; +import net.minecraft.sound.SoundEvents; import net.minecraft.util.Hand; import net.minecraft.util.ItemActionResult; import net.minecraft.util.math.BlockPos; @@ -25,11 +29,9 @@ import net.minecraft.util.math.Vec3d; import org.jetbrains.annotations.Nullable; -import java.util.stream.IntStream; - public class StoneChestBlockEntity extends LootableInventoryBlockEntity { public StoneChestBlockEntity(BlockPos pos, BlockState state) { - super(HollowBlockEntityRegistrar.STONE_CHEST_BLOCK_ENTITY, pos, state, 27); + super(HollowBlockEntityTypes.STONE_CHEST_BLOCK_ENTITY, pos, state, 27); } public void checkLootInteraction(@Nullable PlayerEntity player, boolean randomSeed) { @@ -57,19 +59,33 @@ public void checkLootInteraction(@Nullable PlayerEntity player, boolean randomSe public void aboveBroken() { if (world == null) return; + if (world.isClient()) return; checkLootInteraction(null, true); Vec3d centerPos = pos.toCenterPos(); inventory.stream() .filter(stack -> !stack.isEmpty()) .map(stack -> new ItemEntity(world, centerPos.getX(), centerPos.getY() + 0.5, centerPos.getZ(), stack)) .forEach(itemEntity -> world.spawnEntity(itemEntity)); + + ((ServerWorld) world).spawnParticles( + ParticleTypes.DUST_PLUME, + (double)pos.getX() + 0.5, + (double)pos.getY() + 0.9, + (double)pos.getZ() + 0.5, + 7, 0.0, 0.0, 0.0, 0.0 + ); + + world.playSound(null, pos, HollowSoundEvents.STONE_CHEST_EXTRACT, SoundCategory.BLOCKS); inventory.clear(); } public ItemActionResult use(PlayerEntity player, Hand hand, Direction side) { - if (player.getStackInHand(hand).isEmpty() || player.getStackInHand(hand).isOf(HollowBlockRegistrar.STONE_CHEST_LID.asItem()) && side.equals(Direction.UP)) - return ItemActionResult.SKIP_DEFAULT_BLOCK_INTERACTION; + if (world == null) return ItemActionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION; + if (player.getStackInHand(hand).isEmpty() || player.getStackInHand(hand).isOf(HollowBlocks.STONE_CHEST_LID.asItem()) && side.equals(Direction.UP)) + return ItemActionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION; + + if (!world.isAir(pos.up())) return ItemActionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION; int slot = -1; @@ -80,10 +96,20 @@ public ItemActionResult use(PlayerEntity player, Hand hand, Direction side) { } } - if (slot == -1) return ItemActionResult.SKIP_DEFAULT_BLOCK_INTERACTION; + if (slot == -1) return ItemActionResult.FAIL; setStack(slot, player.getStackInHand(hand)); player.setStackInHand(hand, ItemStack.EMPTY); + + if (!inventory.isEmpty() && !player.getWorld().isClient()) player.getWorld().playSound( + null, + pos, + SoundEvents.ENTITY_ITEM_PICKUP, + SoundCategory.PLAYERS, + 0.2f, + ((player.getRandom().nextFloat() - player.getRandom().nextFloat()) * 0.7F + 1.0F) * 2.0F + ); + return ItemActionResult.SUCCESS; } diff --git a/src/main/java/dev/spiritstudios/hollow/component/CopperInstrument.java b/src/main/java/dev/spiritstudios/hollow/component/CopperInstrument.java new file mode 100644 index 0000000..3d3fbf3 --- /dev/null +++ b/src/main/java/dev/spiritstudios/hollow/component/CopperInstrument.java @@ -0,0 +1,59 @@ +package dev.spiritstudios.hollow.component; + +import com.mojang.serialization.Codec; +import dev.spiritstudios.hollow.Hollow; +import io.netty.buffer.ByteBuf; +import net.minecraft.network.codec.PacketCodec; +import net.minecraft.network.codec.PacketCodecs; +import net.minecraft.sound.SoundEvent; +import net.minecraft.util.StringIdentifiable; +import net.minecraft.util.function.ValueLists; + +import java.util.function.IntFunction; + +public enum CopperInstrument implements StringIdentifiable { + GREAT_SKY_FALLING(0, "great_sky_falling"), + OLD_HYMN_RESTING(1, "old_hymn_resting"), + PURE_WATER_DESIRE(2, "pure_water_desire"), + HUMBLE_FIRE_MEMORY(3, "humble_fire_memory"), + DRY_URGE_ANGER(4, "dry_urge_anger"), + CLEAR_TEMPER_JOURNEY(5, "clear_temper_journey"), + FRESH_NEST_THOUGHT(6, "fresh_nest_thought"), + SECRET_LAKE_TEAR(7, "secret_lake_tear"), + FEARLESS_RIVER_GIFT(8, "fearless_river_gift"), + SWEET_MOON_LOVE(9, "sweet_moon_love"); + + public static final IntFunction ID_TO_VALUE = ValueLists.createIdToValueFunction( + CopperInstrument::getIndex, + values(), + ValueLists.OutOfBoundsHandling.ZERO + ); + + public static final Codec CODEC = StringIdentifiable.createBasicCodec(CopperInstrument::values); + public static final PacketCodec PACKET_CODEC = PacketCodecs.indexed(ID_TO_VALUE, value -> value.index); + + private final String name; + private final int index; + + public final SoundEvent call; + public final SoundEvent melody; + public final SoundEvent bass; + + CopperInstrument(int index, String name) { + this.name = name; + this.index = index; + + this.call = SoundEvent.of(Hollow.id("horn.call.%d".formatted(index))); + this.melody = SoundEvent.of(Hollow.id("horn.melody.%d".formatted(index))); + this.bass = SoundEvent.of(Hollow.id("horn.bass.%d".formatted(index))); + } + + @Override + public String asString() { + return this.name; + } + + public int getIndex() { + return this.index; + } +} diff --git a/src/main/java/dev/spiritstudios/hollow/data/HollowBiomeTags.java b/src/main/java/dev/spiritstudios/hollow/data/HollowBiomeTags.java new file mode 100644 index 0000000..e0aadc2 --- /dev/null +++ b/src/main/java/dev/spiritstudios/hollow/data/HollowBiomeTags.java @@ -0,0 +1,10 @@ +package dev.spiritstudios.hollow.data; + +import dev.spiritstudios.hollow.Hollow; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.registry.tag.TagKey; +import net.minecraft.world.biome.Biome; + +public final class HollowBiomeTags { + public static final TagKey HAS_CLOSER_FOG = TagKey.of(RegistryKeys.BIOME, Hollow.id("has_closer_fog")); +} diff --git a/src/main/java/dev/spiritstudios/hollow/data/LogTypeData.java b/src/main/java/dev/spiritstudios/hollow/data/LogTypeData.java new file mode 100644 index 0000000..9711579 --- /dev/null +++ b/src/main/java/dev/spiritstudios/hollow/data/LogTypeData.java @@ -0,0 +1,38 @@ +package dev.spiritstudios.hollow.data; + +import com.mojang.datafixers.util.Either; +import com.mojang.serialization.Codec; +import com.mojang.serialization.codecs.RecordCodecBuilder; +import net.minecraft.util.Identifier; + +import java.util.function.Function; + +public record LogTypeData(Identifier id, Identifier sideTexture, Identifier insideTexture, Identifier endTexture) { + public static final Codec CODEC = Codec.either( + RecordCodecBuilder.create(instance -> instance.group( + Identifier.CODEC.fieldOf("id").forGetter(LogTypeData::id), + Identifier.CODEC.fieldOf("side_texture").forGetter(LogTypeData::sideTexture), + Identifier.CODEC.fieldOf("inside_texture").forGetter(LogTypeData::insideTexture), + Identifier.CODEC.fieldOf("end_texture").forGetter(LogTypeData::endTexture) + ).apply(instance, LogTypeData::new)), + Identifier.CODEC + ).xmap(either -> either.map(Function.identity(), LogTypeData::byId), Either::left); + + public static LogTypeData byId(Identifier id) { + return new LogTypeData( + id, + id.withPrefixedPath("block/"), + id.withPrefixedPath("block/stripped_"), + id.withPrefixedPath("block/").withSuffixedPath("_top") + ); + } + + public static LogTypeData byIdStripped(Identifier id) { + return new LogTypeData( + id, + id.withPrefixedPath("block/"), + id.withPrefixedPath("block/"), + id.withPrefixedPath("block/").withSuffixedPath("_top") + ); + } +} diff --git a/src/main/java/dev/spiritstudios/hollow/datagen/AdvancementProvider.java b/src/main/java/dev/spiritstudios/hollow/datagen/AdvancementProvider.java new file mode 100644 index 0000000..619e6be --- /dev/null +++ b/src/main/java/dev/spiritstudios/hollow/datagen/AdvancementProvider.java @@ -0,0 +1,45 @@ +package dev.spiritstudios.hollow.datagen; + +import dev.spiritstudios.hollow.registry.HollowCriteria; +import dev.spiritstudios.hollow.registry.HollowItems; +import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; +import net.fabricmc.fabric.api.datagen.v1.provider.FabricAdvancementProvider; +import net.minecraft.advancement.Advancement; +import net.minecraft.advancement.AdvancementEntry; +import net.minecraft.advancement.AdvancementFrame; +import net.minecraft.advancement.criterion.TickCriterion; +import net.minecraft.registry.RegistryWrapper; +import net.minecraft.text.Text; +import net.minecraft.util.Identifier; + +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Consumer; + +public class AdvancementProvider extends FabricAdvancementProvider { + protected AdvancementProvider(FabricDataOutput output, CompletableFuture registryLookup) { + super(output, registryLookup); + } + + @SuppressWarnings("removal") + @Override + public void generateAdvancement(RegistryWrapper.WrapperLookup wrapperLookup, Consumer consumer) { + Advancement.Builder.createUntelemetered() + .display( + HollowItems.FIREFLY_SPAWN_EGG, + Text.translatable("advancements.husbandry.witnessed_frog_poisoning.title"), + Text.translatable("advancements.husbandry.witnessed_frog_poisoning.description"), + null, + AdvancementFrame.TASK, + true, + true, + false + ) + .parent(Identifier.ofVanilla("husbandry/root")) + .criterion( + "witnessed_frog_poisoning", + HollowCriteria.FROG_POISONED.create(new TickCriterion.Conditions(Optional.empty())) + ) + .build(consumer, "husbandry/witnessed_frog_poisoning"); + } +} diff --git a/src/main/java/dev/spiritstudios/hollow/datagen/BlockMetatagProvider.java b/src/main/java/dev/spiritstudios/hollow/datagen/BlockMetatagProvider.java new file mode 100644 index 0000000..d28df55 --- /dev/null +++ b/src/main/java/dev/spiritstudios/hollow/datagen/BlockMetatagProvider.java @@ -0,0 +1,57 @@ +package dev.spiritstudios.hollow.datagen; + +import dev.spiritstudios.hollow.block.HollowLogBlock; +import dev.spiritstudios.hollow.registry.HollowBlocks; +import dev.spiritstudios.specter.api.block.BlockMetatags; +import dev.spiritstudios.specter.api.block.FlammableBlockData; +import dev.spiritstudios.specter.api.core.reflect.ReflectionHelper; +import dev.spiritstudios.specter.api.registry.metatag.datagen.MetatagProvider; +import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; +import net.minecraft.block.Block; +import net.minecraft.data.DataOutput; +import net.minecraft.registry.RegistryWrapper; + +import java.util.concurrent.CompletableFuture; +import java.util.function.Consumer; + +public class BlockMetatagProvider extends MetatagProvider { + protected BlockMetatagProvider(FabricDataOutput dataOutput, CompletableFuture registriesFuture) { + super(dataOutput, registriesFuture, DataOutput.OutputType.DATA_PACK); + } + + @Override + protected void configure(Consumer> provider, RegistryWrapper.WrapperLookup lookup) { + MetatagBuilder flammableBuilder = create(BlockMetatags.FLAMMABLE); + + ReflectionHelper.getStaticFields( + HollowBlocks.class, + HollowLogBlock.class + ).forEach(pair -> + flammableBuilder.put(pair.value(), new FlammableBlockData(5, 5))); + + provider.accept(flammableBuilder); + + provider.accept(create(BlockMetatags.WAXABLE) + .put(HollowBlocks.COPPER_PILLAR, HollowBlocks.WAXED_COPPER_PILLAR) + .put(HollowBlocks.EXPOSED_COPPER_PILLAR, HollowBlocks.WAXED_EXPOSED_COPPER_PILLAR) + .put(HollowBlocks.WEATHERED_COPPER_PILLAR, HollowBlocks.WAXED_WEATHERED_COPPER_PILLAR) + .put(HollowBlocks.OXIDIZED_COPPER_PILLAR, HollowBlocks.WAXED_OXIDIZED_COPPER_PILLAR)); + + provider.accept(create(BlockMetatags.STRIPPABLE) + .put(HollowBlocks.OAK_HOLLOW_LOG, HollowBlocks.STRIPPED_OAK_HOLLOW_LOG) + .put(HollowBlocks.SPRUCE_HOLLOW_LOG, HollowBlocks.STRIPPED_SPRUCE_HOLLOW_LOG) + .put(HollowBlocks.BIRCH_HOLLOW_LOG, HollowBlocks.STRIPPED_BIRCH_HOLLOW_LOG) + .put(HollowBlocks.JUNGLE_HOLLOW_LOG, HollowBlocks.STRIPPED_JUNGLE_HOLLOW_LOG) + .put(HollowBlocks.ACACIA_HOLLOW_LOG, HollowBlocks.STRIPPED_ACACIA_HOLLOW_LOG) + .put(HollowBlocks.DARK_OAK_HOLLOW_LOG, HollowBlocks.STRIPPED_DARK_OAK_HOLLOW_LOG) + .put(HollowBlocks.CRIMSON_HOLLOW_STEM, HollowBlocks.STRIPPED_CRIMSON_HOLLOW_STEM) + .put(HollowBlocks.WARPED_HOLLOW_STEM, HollowBlocks.STRIPPED_WARPED_HOLLOW_STEM) + .put(HollowBlocks.MANGROVE_HOLLOW_LOG, HollowBlocks.STRIPPED_MANGROVE_HOLLOW_LOG) + .put(HollowBlocks.CHERRY_HOLLOW_LOG, HollowBlocks.STRIPPED_CHERRY_HOLLOW_LOG)); + + provider.accept(create(BlockMetatags.OXIDIZABLE) + .put(HollowBlocks.COPPER_PILLAR, HollowBlocks.EXPOSED_COPPER_PILLAR) + .put(HollowBlocks.EXPOSED_COPPER_PILLAR, HollowBlocks.WEATHERED_COPPER_PILLAR) + .put(HollowBlocks.WEATHERED_COPPER_PILLAR, HollowBlocks.OXIDIZED_COPPER_PILLAR)); + } +} diff --git a/src/main/java/dev/spiritstudios/hollow/datagen/ConfiguredFeatureProvider.java b/src/main/java/dev/spiritstudios/hollow/datagen/ConfiguredFeatureProvider.java new file mode 100644 index 0000000..3fbb4cf --- /dev/null +++ b/src/main/java/dev/spiritstudios/hollow/datagen/ConfiguredFeatureProvider.java @@ -0,0 +1,119 @@ +package dev.spiritstudios.hollow.datagen; + +import dev.spiritstudios.hollow.Hollow; +import dev.spiritstudios.hollow.registry.HollowBlocks; +import dev.spiritstudios.hollow.worldgen.decorator.BigBranchTreeDecorator; +import dev.spiritstudios.hollow.worldgen.decorator.BranchTreeDecorator; +import dev.spiritstudios.hollow.worldgen.decorator.PolyporeTreeDecorator; +import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; +import net.fabricmc.fabric.api.datagen.v1.provider.FabricDynamicRegistryProvider; +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.registry.RegistryWrapper; +import net.minecraft.util.collection.DataPool; +import net.minecraft.world.gen.feature.*; +import net.minecraft.world.gen.stateprovider.BlockStateProvider; +import net.minecraft.world.gen.stateprovider.WeightedBlockStateProvider; +import net.minecraft.world.gen.treedecorator.LeavesVineTreeDecorator; + +import java.util.List; +import java.util.concurrent.CompletableFuture; + +import static dev.spiritstudios.hollow.worldgen.feature.HollowConfiguredFeatures.createRandomPatch; +import static dev.spiritstudios.hollow.worldgen.feature.HollowConfiguredFeatures.hangingLeavestreeBuilder; + +public class ConfiguredFeatureProvider extends FabricDynamicRegistryProvider { + public ConfiguredFeatureProvider(FabricDataOutput output, CompletableFuture registriesFuture) { + super(output, registriesFuture); + } + + @Override + protected void configure(RegistryWrapper.WrapperLookup registries, Entries entries) { + RegistryWrapper> lookup = registries.getWrapperOrThrow(RegistryKeys.CONFIGURED_FEATURE); + + lookup.streamKeys() + .filter(key -> + key.getValue().getNamespace().equals(Hollow.MODID)) + .forEach(key -> + entries.add(key, lookup.getOrThrow(key).value())); + + entries.add( + TreeConfiguredFeatures.BIRCH_BEES_0002, + new ConfiguredFeature<>( + Feature.TREE, + hangingLeavestreeBuilder( + Blocks.BIRCH_LOG, Blocks.BIRCH_LEAVES, + 8, 5, 0, + 2, 0.25F, 0.4F + ).decorators(List.of( + new PolyporeTreeDecorator(BlockStateProvider.of(HollowBlocks.POLYPORE)), + new BranchTreeDecorator(BlockStateProvider.of(Blocks.BIRCH_LOG), 0.5F, 2) + )).ignoreVines().build() + ) + ); + + entries.add( + TreeConfiguredFeatures.SUPER_BIRCH_BEES_0002, + new ConfiguredFeature<>( + Feature.TREE, + hangingLeavestreeBuilder( + Blocks.BIRCH_LOG, Blocks.BIRCH_LEAVES, + 8, 5, 6, + 2, 0.25F, 0.4F + ).decorators(List.of( + new PolyporeTreeDecorator(BlockStateProvider.of(HollowBlocks.POLYPORE)), + new BranchTreeDecorator(BlockStateProvider.of(Blocks.BIRCH_LOG), 0.5F, 5) + )).ignoreVines().build() + ) + ); + + entries.add( + TreeConfiguredFeatures.SWAMP_OAK, + new ConfiguredFeature<>( + Feature.TREE, + hangingLeavestreeBuilder( + Blocks.OAK_LOG, Blocks.OAK_LEAVES, + 8, 2, 0, + 3, 1.0F, 0.5F + ).decorators(List.of( + new LeavesVineTreeDecorator(0.05F), + new BigBranchTreeDecorator(BlockStateProvider.of(Blocks.OAK_LOG), 0.5F) + )).build() + ) + ); + + entries.add( + VegetationConfiguredFeatures.PATCH_WATERLILY, + createRandomPatch( + new WeightedBlockStateProvider(DataPool.builder() + .add(Blocks.LILY_PAD.getDefaultState(), 4) + .add(HollowBlocks.LOTUS_LILYPAD.getDefaultState(), 1) + .build()), + 10 + ) + ); + + entries.add( + VegetationConfiguredFeatures.FLOWER_SWAMP, + new ConfiguredFeature<>( + Feature.FLOWER, + new RandomPatchFeatureConfig( + 64, 6, 2, + PlacedFeatures.createEntry( + Feature.SIMPLE_BLOCK, + new SimpleBlockFeatureConfig(new WeightedBlockStateProvider(DataPool.builder() + .add(Blocks.BLUE_ORCHID.getDefaultState()) + .add(HollowBlocks.ROOTED_ORCHID.getDefaultState()) + .build())) + ) + ) + ) + ); + } + + @Override + public String getName() { + return "Hollow/Configured Features"; + } +} diff --git a/src/main/java/dev/spiritstudios/hollow/datagen/HollowDatagen.java b/src/main/java/dev/spiritstudios/hollow/datagen/HollowDatagen.java deleted file mode 100644 index f9f7d27..0000000 --- a/src/main/java/dev/spiritstudios/hollow/datagen/HollowDatagen.java +++ /dev/null @@ -1,16 +0,0 @@ -package dev.spiritstudios.hollow.datagen; - -import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint; -import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator; - -public class HollowDatagen implements DataGeneratorEntrypoint { - @Override - public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator) { - FabricDataGenerator.Pack pack = fabricDataGenerator.createPack(); - - pack.addProvider(ModelProvider::new); - pack.addProvider(LootTableProvider::new); - pack.addProvider(RecipeProvider::new); - pack.addProvider(ItemGroupProvider::new); - } -} diff --git a/src/main/java/dev/spiritstudios/hollow/datagen/ItemGroupProvider.java b/src/main/java/dev/spiritstudios/hollow/datagen/ItemGroupProvider.java deleted file mode 100644 index 1e23700..0000000 --- a/src/main/java/dev/spiritstudios/hollow/datagen/ItemGroupProvider.java +++ /dev/null @@ -1,61 +0,0 @@ -package dev.spiritstudios.hollow.datagen; - -import dev.spiritstudios.hollow.registry.HollowBlockRegistrar; -import dev.spiritstudios.hollow.registry.HollowDataComponentRegistrar; -import dev.spiritstudios.hollow.registry.HollowItemRegistrar; -import dev.spiritstudios.specter.api.core.util.ReflectionHelper; -import dev.spiritstudios.specter.api.item.datagen.SpecterItemGroupProvider; -import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; -import net.minecraft.block.Block; -import net.minecraft.component.ComponentChanges; -import net.minecraft.item.ItemStack; -import net.minecraft.registry.Registries; -import net.minecraft.registry.RegistryWrapper; -import net.minecraft.util.Identifier; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.concurrent.CompletableFuture; -import java.util.function.BiConsumer; - -import static dev.spiritstudios.hollow.Hollow.MODID; - -public class ItemGroupProvider extends SpecterItemGroupProvider { - public ItemGroupProvider(FabricDataOutput dataOutput, CompletableFuture registriesFuture) { - super(dataOutput, registriesFuture); - } - - @Override - protected void generate(BiConsumer provider, RegistryWrapper.WrapperLookup lookup) { - List items = new ArrayList<>(); - ReflectionHelper.forEachStaticField( - HollowBlockRegistrar.class, - Block.class, - (block, name, field) -> { - ItemStack stack = new ItemStack(block.asItem()); - if (!stack.isEmpty()) items.add(stack); - } - ); - - Arrays.stream(HollowDataComponentRegistrar.CopperInstrument.values()).map(instrument -> new ItemStack( - Registries.ITEM.getEntry(HollowItemRegistrar.COPPER_HORN), - 1, - ComponentChanges.builder() - .add(HollowDataComponentRegistrar.COPPER_INSTRUMENT, instrument) - .build() - )).forEach(items::add); - - items.add(HollowItemRegistrar.FIREFLY_SPAWN_EGG.getDefaultStack()); - items.add(HollowItemRegistrar.MUSIC_DISC_POSTMORTEM.getDefaultStack()); - - provider.accept( - Identifier.of(MODID, "hollow"), - ItemGroupData.of( - Identifier.of(MODID, "hollow"), - HollowBlockRegistrar.BIRCH_HOLLOW_LOG, - items - ) - ); - } -} diff --git a/src/main/java/dev/spiritstudios/hollow/datagen/LootTableProvider.java b/src/main/java/dev/spiritstudios/hollow/datagen/LootTableProvider.java index aeea870..0a42c94 100644 --- a/src/main/java/dev/spiritstudios/hollow/datagen/LootTableProvider.java +++ b/src/main/java/dev/spiritstudios/hollow/datagen/LootTableProvider.java @@ -1,10 +1,23 @@ package dev.spiritstudios.hollow.datagen; import dev.spiritstudios.hollow.block.HollowLogBlock; -import dev.spiritstudios.hollow.registry.HollowBlockRegistrar; -import dev.spiritstudios.specter.api.core.util.ReflectionHelper; +import dev.spiritstudios.hollow.block.PolyporeBlock; +import dev.spiritstudios.hollow.registry.HollowBlocks; +import dev.spiritstudios.specter.api.core.reflect.ReflectionHelper; import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; import net.fabricmc.fabric.api.datagen.v1.provider.FabricBlockLootTableProvider; +import net.minecraft.block.Blocks; +import net.minecraft.block.SeaPickleBlock; +import net.minecraft.block.TallPlantBlock; +import net.minecraft.block.enums.DoubleBlockHalf; +import net.minecraft.loot.LootPool; +import net.minecraft.loot.LootTable; +import net.minecraft.loot.condition.BlockStatePropertyLootCondition; +import net.minecraft.loot.entry.ItemEntry; +import net.minecraft.loot.entry.LootPoolEntry; +import net.minecraft.loot.function.SetCountLootFunction; +import net.minecraft.loot.provider.number.ConstantLootNumberProvider; +import net.minecraft.predicate.StatePredicate; import net.minecraft.registry.RegistryWrapper; import java.util.List; @@ -18,26 +31,61 @@ protected LootTableProvider(FabricDataOutput dataOutput, CompletableFuture this.addDrop(block)); + this.addDrop(HollowBlocks.CATTAIL); + this.addDrop(HollowBlocks.CATTAIL_STEM, HollowBlocks.CATTAIL); + this.addDrop(HollowBlocks.TWIG); + this.addDrop(HollowBlocks.LOTUS_LILYPAD); + this.addDrop(HollowBlocks.GIANT_LILYPAD); + this.addDrop(HollowBlocks.CAMPION, block -> this.dropsWithProperty(block, TallPlantBlock.HALF, DoubleBlockHalf.LOWER)); +// this.addDrop(HollowBlocks.PURPLE_WILDFLOWER, this.flowerbedDrops(HollowBlocks.PURPLE_WILDFLOWER)); +// this.addDrop(HollowBlocks.WHITE_WILDFLOWER, this.flowerbedDrops(HollowBlocks.WHITE_WILDFLOWER)); +// this.addDrop(HollowBlocks.BLUE_WILDFLOWER, this.flowerbedDrops(HollowBlocks.BLUE_WILDFLOWER)); +// this.addDrop(HollowBlocks.PINK_WILDFLOWER, this.flowerbedDrops(HollowBlocks.PINK_WILDFLOWER)); + + this.addDrop(HollowBlocks.PAEONIA); + this.addPottedPlantDrops(HollowBlocks.POTTED_PAEONIA); + this.addDrop(HollowBlocks.ROOTED_ORCHID); + this.addPottedPlantDrops(HollowBlocks.POTTED_ROOTED_ORCHID); + + this.addDrop( + HollowBlocks.POLYPORE, + block -> LootTable.builder().pool(LootPool.builder() + .rolls(ConstantLootNumberProvider.create(1.0F)) + .with(this.applyExplosionDecay(HollowBlocks.POLYPORE, ItemEntry.builder(block).apply( + List.of(2, 3), + polypore -> + SetCountLootFunction.builder(ConstantLootNumberProvider.create(polypore)) + .conditionally( + BlockStatePropertyLootCondition.builder(block) + .properties(StatePredicate.Builder.create().exactMatch(PolyporeBlock.POLYPORE_AMOUNT, polypore)) + ) + )))) + ); + + this.addDrop(HollowBlocks.FIREFLY_JAR); + this.addDrop(HollowBlocks.JAR, this.nameableContainerDrops(HollowBlocks.JAR)); + + + ReflectionHelper.getStaticFields( + HollowBlocks.class, + HollowLogBlock.class + ).forEach(pair -> this.addDrop(pair.value())); List.of( - HollowBlockRegistrar.COPPER_PILLAR, - HollowBlockRegistrar.EXPOSED_COPPER_PILLAR, - HollowBlockRegistrar.WEATHERED_COPPER_PILLAR, - HollowBlockRegistrar.OXIDIZED_COPPER_PILLAR, - - HollowBlockRegistrar.WAXED_COPPER_PILLAR, - HollowBlockRegistrar.WAXED_EXPOSED_COPPER_PILLAR, - HollowBlockRegistrar.WAXED_WEATHERED_COPPER_PILLAR, - HollowBlockRegistrar.WAXED_OXIDIZED_COPPER_PILLAR - ).forEach(this::addDrop); + HollowBlocks.COPPER_PILLAR, + HollowBlocks.EXPOSED_COPPER_PILLAR, + HollowBlocks.WEATHERED_COPPER_PILLAR, + HollowBlocks.OXIDIZED_COPPER_PILLAR, + HollowBlocks.WAXED_COPPER_PILLAR, + HollowBlocks.WAXED_EXPOSED_COPPER_PILLAR, + HollowBlocks.WAXED_WEATHERED_COPPER_PILLAR, + HollowBlocks.WAXED_OXIDIZED_COPPER_PILLAR + ).forEach(this::addDrop); } } diff --git a/src/main/java/dev/spiritstudios/hollow/datagen/ModelProvider.java b/src/main/java/dev/spiritstudios/hollow/datagen/ModelProvider.java index e9e3f90..5202cc5 100644 --- a/src/main/java/dev/spiritstudios/hollow/datagen/ModelProvider.java +++ b/src/main/java/dev/spiritstudios/hollow/datagen/ModelProvider.java @@ -3,11 +3,14 @@ import com.google.common.collect.ImmutableMap; import dev.spiritstudios.hollow.block.GiantLilyPadBlock; import dev.spiritstudios.hollow.block.HollowLogBlock; -import dev.spiritstudios.hollow.registry.HollowBlockRegistrar; -import dev.spiritstudios.specter.api.core.util.ReflectionHelper; +import dev.spiritstudios.hollow.block.SculkJawBlock; +import dev.spiritstudios.hollow.registry.HollowBlocks; +import dev.spiritstudios.hollow.registry.HollowItems; +import dev.spiritstudios.specter.api.core.reflect.ReflectionHelper; import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; import net.fabricmc.fabric.api.datagen.v1.provider.FabricModelProvider; import net.minecraft.block.Block; +import net.minecraft.block.Blocks; import net.minecraft.data.client.*; import net.minecraft.state.property.Properties; import net.minecraft.util.Identifier; @@ -27,12 +30,130 @@ public ModelProvider(FabricDataOutput output) { super(output); } + @Override + public void generateBlockStateModels(BlockStateModelGenerator generator) { + ReflectionHelper.getStaticFields(HollowBlocks.class, HollowLogBlock.class) + .forEach(pair -> registerHollowLog(generator, pair.value())); + + generator.registerFlowerPotPlant(HollowBlocks.PAEONIA, HollowBlocks.POTTED_PAEONIA, BlockStateModelGenerator.TintType.NOT_TINTED); + generator.registerFlowerPotPlant(HollowBlocks.ROOTED_ORCHID, HollowBlocks.POTTED_ROOTED_ORCHID, BlockStateModelGenerator.TintType.NOT_TINTED); + + Identifier campionTop = generator.createSubModel(HollowBlocks.CAMPION, "_top", BlockStateModelGenerator.TintType.NOT_TINTED.getCrossModel(), TextureMap::cross); + Identifier campionBottom = generator.createSubModel(HollowBlocks.CAMPION, "_bottom", BlockStateModelGenerator.TintType.NOT_TINTED.getCrossModel(), TextureMap::cross); + + generator.registerDoubleBlock(HollowBlocks.CAMPION, campionTop, campionBottom); + generator.registerItemModel(HollowBlocks.CAMPION.asItem()); + + generator.blockStateCollector.accept(BlockStateModelGenerator.createBlockStateWithRandomHorizontalRotations(HollowBlocks.TWIG, ModelIds.getBlockModelId(HollowBlocks.TWIG))); + generator.registerItemModel(HollowBlocks.TWIG); + + Models.GENERATED_TWO_LAYERS.upload( + ModelIds.getItemModelId(HollowItems.LOTUS_LILYPAD), + TextureMap.layered( + TextureMap.getId(Blocks.LILY_PAD), + TextureMap.getId(HollowItems.LOTUS_LILYPAD) + ), + generator.modelCollector + ); + generator.blockStateCollector.accept(BlockStateModelGenerator.createBlockStateWithRandomHorizontalRotations(HollowBlocks.LOTUS_LILYPAD, ModelIds.getBlockModelId(HollowBlocks.LOTUS_LILYPAD))); + + generator.blockStateCollector.accept( + VariantsBlockStateSupplier.create(HollowBlocks.ECHOING_POT, BlockStateVariant.create().put(VariantSettings.MODEL, ModelIds.getBlockModelId(HollowBlocks.ECHOING_POT))) + .coordinate(BlockStateModelGenerator.createNorthDefaultHorizontalRotationStates())); + + registerSculkJaw(generator); + + generator.registerItemModel(HollowItems.GIANT_LILYPAD); + createGiantLilyPadBlockState(generator); + + generator.registerItemModel(HollowBlocks.CATTAIL, "_top"); + generator.registerTintableCrossBlockState( + HollowBlocks.CATTAIL, + BlockStateModelGenerator.TintType.NOT_TINTED, + TextureMap.cross(TextureMap.getSubId(HollowBlocks.CATTAIL, "_top")) + ); + + generator.registerAxisRotated(HollowBlocks.COPPER_PILLAR, TexturedModel.END_FOR_TOP_CUBE_COLUMN, TexturedModel.END_FOR_TOP_CUBE_COLUMN_HORIZONTAL); + generator.registerAxisRotated(HollowBlocks.EXPOSED_COPPER_PILLAR, TexturedModel.END_FOR_TOP_CUBE_COLUMN, TexturedModel.END_FOR_TOP_CUBE_COLUMN_HORIZONTAL); + generator.registerAxisRotated(HollowBlocks.WEATHERED_COPPER_PILLAR, TexturedModel.END_FOR_TOP_CUBE_COLUMN, TexturedModel.END_FOR_TOP_CUBE_COLUMN_HORIZONTAL); + generator.registerAxisRotated(HollowBlocks.OXIDIZED_COPPER_PILLAR, TexturedModel.END_FOR_TOP_CUBE_COLUMN, TexturedModel.END_FOR_TOP_CUBE_COLUMN_HORIZONTAL); + + registerCopperPillarWaxed(generator, HollowBlocks.WAXED_COPPER_PILLAR, HollowBlocks.COPPER_PILLAR); + registerCopperPillarWaxed(generator, HollowBlocks.WAXED_EXPOSED_COPPER_PILLAR, HollowBlocks.EXPOSED_COPPER_PILLAR); + registerCopperPillarWaxed(generator, HollowBlocks.WAXED_WEATHERED_COPPER_PILLAR, HollowBlocks.WEATHERED_COPPER_PILLAR); + registerCopperPillarWaxed(generator, HollowBlocks.WAXED_OXIDIZED_COPPER_PILLAR, HollowBlocks.OXIDIZED_COPPER_PILLAR); + + generator.registerItemModel(HollowBlocks.JAR.asItem()); + generator.registerSimpleState(HollowBlocks.JAR); + + generator.registerItemModel(HollowBlocks.FIREFLY_JAR.asItem()); + generator.registerStateWithModelReference(HollowBlocks.FIREFLY_JAR, HollowBlocks.JAR); + +// registerFlowerbed(generator, HollowBlocks.PINK_WILDFLOWER); +// registerFlowerbed(generator, HollowBlocks.BLUE_WILDFLOWER); +// registerFlowerbed(generator, HollowBlocks.WHITE_WILDFLOWER); +// registerFlowerbed(generator, HollowBlocks.PURPLE_WILDFLOWER); + } + + @Override + public void generateItemModels(ItemModelGenerator generator) { + generator.register(HollowBlocks.POLYPORE.asItem(), Models.GENERATED); + generator.register(HollowItems.MUSIC_DISC_POSTMORTEM, Models.GENERATED); + + generator.writer.accept( + ModelIds.getItemModelId(HollowItems.FIREFLY_SPAWN_EGG), + new SimpleModelSupplier(ModelIds.getMinecraftNamespacedItem("template_spawn_egg")) + ); + } + + // region Helpers + public final void registerSculkJaw(BlockStateModelGenerator generator) { + Identifier inactive = Models.CUBE_TOP.upload( + HollowBlocks.SCULK_JAW, + new TextureMap() + .put(TextureKey.TOP, TextureMap.getId(HollowBlocks.SCULK_JAW)) + .put(TextureKey.SIDE, TextureMap.getId(Blocks.SCULK)), + generator.modelCollector + ); + + Identifier active = Models.CUBE_TOP.upload( + ModelIds.getBlockSubModelId(HollowBlocks.SCULK_JAW, "_active"), + new TextureMap() + .put(TextureKey.TOP, TextureMap.getSubId(HollowBlocks.SCULK_JAW, "_active")) + .put(TextureKey.SIDE, TextureMap.getId(Blocks.SCULK)), + generator.modelCollector + ); + + generator.blockStateCollector.accept(VariantsBlockStateSupplier.create(HollowBlocks.SCULK_JAW) + .coordinate(BlockStateModelGenerator.createBooleanModelMap( + SculkJawBlock.ACTIVE, + active, inactive + ))); + } + + private static void registerHollowLog(BlockStateModelGenerator generator, HollowLogBlock block) { + TextureMap textureMap = new TextureMap().put(TextureKey.SIDE, block.typeData.sideTexture()).put(TextureKey.INSIDE, block.typeData.insideTexture()).put(TextureKey.END, block.typeData.endTexture()); + Identifier hollowLog = HOLLOW_LOG.upload(block, textureMap, generator.modelCollector); + Identifier hollowLogHorizontal = HOLLOW_LOG_HORIZONTAL.upload(block, textureMap, generator.modelCollector); + Identifier hollowLogHorizontalMossy = HOLLOW_LOG_HORIZONTAL_MOSSY.upload(block, textureMap, generator.modelCollector); + + generator.blockStateCollector.accept(createAxisRotatedBlockStateWithMossy(block, hollowLog, hollowLogHorizontal, hollowLogHorizontalMossy)); + } + + private static void registerCopperPillarWaxed(BlockStateModelGenerator blockStateModelGenerator, Block block, Block unWaxed) { + blockStateModelGenerator.registerAxisRotated( + block, + TexturedModel.makeFactory((Block b) -> TextureMap.sideAndEndForTop(unWaxed), Models.CUBE_COLUMN), + TexturedModel.makeFactory((Block b) -> TextureMap.sideAndEndForTop(unWaxed), Models.CUBE_COLUMN_HORIZONTAL) + ); + } + private static void createGiantLilyPadBlockState(BlockStateModelGenerator blockStateModelGenerator) { Identifier[] modelIds = new Identifier[4]; for (int i = 0; i < 4; i++) { TextureMap textureMap = new TextureMap().put(TextureKey.TEXTURE, Identifier.of(MODID, "block/giant_lilypad_" + i)); Model model = new Model(Optional.of(Identifier.of(MODID, "block/giant_lilypad_template")), Optional.of("_" + i), TextureKey.TEXTURE); - modelIds[i] = model.upload(HollowBlockRegistrar.GIANT_LILYPAD, textureMap, blockStateModelGenerator.modelCollector); + modelIds[i] = model.upload(HollowBlocks.GIANT_LILYPAD, textureMap, blockStateModelGenerator.modelCollector); } Map north = ImmutableMap.of( @@ -63,7 +184,7 @@ private static void createGiantLilyPadBlockState(BlockStateModelGenerator blockS GiantLilyPadBlock.Piece.SOUTH_WEST, modelIds[1] ); - BlockStateSupplier supplier = VariantsBlockStateSupplier.create(HollowBlockRegistrar.GIANT_LILYPAD).coordinate( + BlockStateSupplier supplier = VariantsBlockStateSupplier.create(HollowBlocks.GIANT_LILYPAD).coordinate( BlockStateVariantMap.create(GiantLilyPadBlock.FACING, GiantLilyPadBlock.PIECE).register( (direction, piece) -> { BlockStateVariant variant = BlockStateVariant.create(); @@ -91,7 +212,7 @@ private static void createGiantLilyPadBlockState(BlockStateModelGenerator blockS ); blockStateModelGenerator.blockStateCollector.accept(supplier); - blockStateModelGenerator.excludeFromSimpleItemModelGeneration(HollowBlockRegistrar.GIANT_LILYPAD); + blockStateModelGenerator.excludeFromSimpleItemModelGeneration(HollowBlocks.GIANT_LILYPAD); } private static BlockStateSupplier createAxisRotatedBlockStateWithMossy(Block block, Identifier verticalModelId, Identifier horizontalModelId, Identifier horizontalMossyModelId) { @@ -121,62 +242,106 @@ private static BlockStateSupplier createAxisRotatedBlockStateWithMossy(Block blo ); } - @Override - public void generateBlockStateModels(BlockStateModelGenerator blockStateModelGenerator) { - ReflectionHelper.forEachStaticField(HollowBlockRegistrar.class, HollowLogBlock.class, (block, name, field) -> { - TextureMap textureMap = new TextureMap().put(TextureKey.SIDE, Identifier.of("minecraft", "block/" + block.sideTexture)).put(TextureKey.INSIDE, Identifier.ofVanilla("block/" + block.insideTexture)).put(TextureKey.END, Identifier.of("minecraft", "block/" + block.endTexture)); - Identifier hollowLog = HOLLOW_LOG.upload(block, textureMap, blockStateModelGenerator.modelCollector); - Identifier hollowLogHorizontal = HOLLOW_LOG_HORIZONTAL.upload(block, textureMap, blockStateModelGenerator.modelCollector); - Identifier hollowLogHorizontalMossy = HOLLOW_LOG_HORIZONTAL_MOSSY.upload(block, textureMap, blockStateModelGenerator.modelCollector); - blockStateModelGenerator.blockStateCollector.accept(createAxisRotatedBlockStateWithMossy(block, hollowLog, hollowLogHorizontal, hollowLogHorizontalMossy)); - }); - - blockStateModelGenerator.registerFlowerPotPlant(HollowBlockRegistrar.PAEONIA, HollowBlockRegistrar.POTTED_PAEONIA, BlockStateModelGenerator.TintType.NOT_TINTED); - blockStateModelGenerator.registerFlowerPotPlant(HollowBlockRegistrar.ROOTED_ORCHID, HollowBlockRegistrar.POTTED_ROOTED_ORCHID, BlockStateModelGenerator.TintType.NOT_TINTED); - - Identifier campionTop = blockStateModelGenerator.createSubModel(HollowBlockRegistrar.CAMPION, "_top", BlockStateModelGenerator.TintType.NOT_TINTED.getCrossModel(), TextureMap::cross); - Identifier campionBottom = blockStateModelGenerator.createSubModel(HollowBlockRegistrar.CAMPION, "_bottom", BlockStateModelGenerator.TintType.NOT_TINTED.getCrossModel(), TextureMap::cross); - blockStateModelGenerator.registerDoubleBlock(HollowBlockRegistrar.CAMPION, campionTop, campionBottom); - blockStateModelGenerator.excludeFromSimpleItemModelGeneration(HollowBlockRegistrar.CAMPION); - - blockStateModelGenerator.registerItemModel(HollowBlockRegistrar.TWIG); - blockStateModelGenerator.blockStateCollector.accept(BlockStateModelGenerator.createBlockStateWithRandomHorizontalRotations(HollowBlockRegistrar.TWIG, ModelIds.getBlockModelId(HollowBlockRegistrar.TWIG))); - - blockStateModelGenerator.blockStateCollector.accept(BlockStateModelGenerator.createBlockStateWithRandomHorizontalRotations(HollowBlockRegistrar.LOTUS_LILYPAD, ModelIds.getBlockModelId(HollowBlockRegistrar.LOTUS_LILYPAD))); - blockStateModelGenerator.excludeFromSimpleItemModelGeneration(HollowBlockRegistrar.LOTUS_LILYPAD); - - blockStateModelGenerator.blockStateCollector.accept( - VariantsBlockStateSupplier.create(HollowBlockRegistrar.ECHOING_POT, BlockStateVariant.create().put(VariantSettings.MODEL, ModelIds.getBlockModelId(HollowBlockRegistrar.ECHOING_POT))) - .coordinate(BlockStateModelGenerator.createNorthDefaultHorizontalRotationStates())); - - createGiantLilyPadBlockState(blockStateModelGenerator); - - blockStateModelGenerator.registerAxisRotated(HollowBlockRegistrar.COPPER_PILLAR, TexturedModel.END_FOR_TOP_CUBE_COLUMN, TexturedModel.END_FOR_TOP_CUBE_COLUMN_HORIZONTAL); - blockStateModelGenerator.registerAxisRotated(HollowBlockRegistrar.EXPOSED_COPPER_PILLAR, TexturedModel.END_FOR_TOP_CUBE_COLUMN, TexturedModel.END_FOR_TOP_CUBE_COLUMN_HORIZONTAL); - blockStateModelGenerator.registerAxisRotated(HollowBlockRegistrar.WEATHERED_COPPER_PILLAR, TexturedModel.END_FOR_TOP_CUBE_COLUMN, TexturedModel.END_FOR_TOP_CUBE_COLUMN_HORIZONTAL); - blockStateModelGenerator.registerAxisRotated(HollowBlockRegistrar.OXIDIZED_COPPER_PILLAR, TexturedModel.END_FOR_TOP_CUBE_COLUMN, TexturedModel.END_FOR_TOP_CUBE_COLUMN_HORIZONTAL); + public static final TexturedModel.Factory FLOWERBED_1 = TexturedModel.makeFactory( + block -> new TextureMap() + .put(TextureKey.FLOWERBED, TextureMap.getId(block)) + .put(TextureKey.STEM, Identifier.ofVanilla("block/pink_petals_stem")), + Models.FLOWERBED_1 + ); + public static final TexturedModel.Factory FLOWERBED_2 = TexturedModel.makeFactory( + block -> new TextureMap() + .put(TextureKey.FLOWERBED, TextureMap.getId(block)) + .put(TextureKey.STEM, Identifier.ofVanilla("block/pink_petals_stem")), + Models.FLOWERBED_2 + ); + public static final TexturedModel.Factory FLOWERBED_3 = TexturedModel.makeFactory( + block -> new TextureMap() + .put(TextureKey.FLOWERBED, TextureMap.getId(block)) + .put(TextureKey.STEM, Identifier.ofVanilla("block/pink_petals_stem")), + Models.FLOWERBED_3 + ); + public static final TexturedModel.Factory FLOWERBED_4 = TexturedModel.makeFactory( + block -> new TextureMap() + .put(TextureKey.FLOWERBED, TextureMap.getId(block)) + .put(TextureKey.STEM, Identifier.ofVanilla("block/pink_petals_stem")), + Models.FLOWERBED_4 + ); - registerCopperPillarWaxed(blockStateModelGenerator, HollowBlockRegistrar.WAXED_COPPER_PILLAR, HollowBlockRegistrar.COPPER_PILLAR); - registerCopperPillarWaxed(blockStateModelGenerator, HollowBlockRegistrar.WAXED_EXPOSED_COPPER_PILLAR, HollowBlockRegistrar.EXPOSED_COPPER_PILLAR); - registerCopperPillarWaxed(blockStateModelGenerator, HollowBlockRegistrar.WAXED_WEATHERED_COPPER_PILLAR, HollowBlockRegistrar.WEATHERED_COPPER_PILLAR); - registerCopperPillarWaxed(blockStateModelGenerator, HollowBlockRegistrar.WAXED_OXIDIZED_COPPER_PILLAR, HollowBlockRegistrar.OXIDIZED_COPPER_PILLAR); + private static void registerFlowerbed(BlockStateModelGenerator generator, Block flowerbed) { + generator.registerItemModel(flowerbed.asItem()); + Identifier one = FLOWERBED_1.upload(flowerbed, generator.modelCollector); + Identifier two = FLOWERBED_2.upload(flowerbed, generator.modelCollector); + Identifier three = FLOWERBED_3.upload(flowerbed, generator.modelCollector); + Identifier four = FLOWERBED_4.upload(flowerbed, generator.modelCollector); - blockStateModelGenerator.excludeFromSimpleItemModelGeneration(HollowBlockRegistrar.JAR); - blockStateModelGenerator.excludeFromSimpleItemModelGeneration(HollowBlockRegistrar.FIREFLY_JAR); - blockStateModelGenerator.registerSimpleState(HollowBlockRegistrar.JAR); - blockStateModelGenerator.registerStateWithModelReference(HollowBlockRegistrar.FIREFLY_JAR, HollowBlockRegistrar.JAR); - } - - public void registerCopperPillarWaxed(BlockStateModelGenerator blockStateModelGenerator, Block block, Block unWaxed) { - blockStateModelGenerator.registerAxisRotated( - block, - TexturedModel.makeFactory((Block b) -> TextureMap.sideAndEndForTop(unWaxed), Models.CUBE_COLUMN), - TexturedModel.makeFactory((Block b) -> TextureMap.sideAndEndForTop(unWaxed), Models.CUBE_COLUMN_HORIZONTAL) + generator.blockStateCollector.accept( + MultipartBlockStateSupplier.create(flowerbed) + .with( + When.create().set(Properties.FLOWER_AMOUNT, 1, 2, 3, 4).set(Properties.HORIZONTAL_FACING, Direction.NORTH), + BlockStateVariant.create().put(VariantSettings.MODEL, one) + ) + .with( + When.create().set(Properties.FLOWER_AMOUNT, 1, 2, 3, 4).set(Properties.HORIZONTAL_FACING, Direction.EAST), + BlockStateVariant.create().put(VariantSettings.MODEL, one).put(VariantSettings.Y, VariantSettings.Rotation.R90) + ) + .with( + When.create().set(Properties.FLOWER_AMOUNT, 1, 2, 3, 4).set(Properties.HORIZONTAL_FACING, Direction.SOUTH), + BlockStateVariant.create().put(VariantSettings.MODEL, one).put(VariantSettings.Y, VariantSettings.Rotation.R180) + ) + .with( + When.create().set(Properties.FLOWER_AMOUNT, 1, 2, 3, 4).set(Properties.HORIZONTAL_FACING, Direction.WEST), + BlockStateVariant.create().put(VariantSettings.MODEL, one).put(VariantSettings.Y, VariantSettings.Rotation.R270) + ) + .with( + When.create().set(Properties.FLOWER_AMOUNT, 2, 3, 4).set(Properties.HORIZONTAL_FACING, Direction.NORTH), + BlockStateVariant.create().put(VariantSettings.MODEL, two) + ) + .with( + When.create().set(Properties.FLOWER_AMOUNT, 2, 3, 4).set(Properties.HORIZONTAL_FACING, Direction.EAST), + BlockStateVariant.create().put(VariantSettings.MODEL, two).put(VariantSettings.Y, VariantSettings.Rotation.R90) + ) + .with( + When.create().set(Properties.FLOWER_AMOUNT, 2, 3, 4).set(Properties.HORIZONTAL_FACING, Direction.SOUTH), + BlockStateVariant.create().put(VariantSettings.MODEL, two).put(VariantSettings.Y, VariantSettings.Rotation.R180) + ) + .with( + When.create().set(Properties.FLOWER_AMOUNT, 2, 3, 4).set(Properties.HORIZONTAL_FACING, Direction.WEST), + BlockStateVariant.create().put(VariantSettings.MODEL, two).put(VariantSettings.Y, VariantSettings.Rotation.R270) + ) + .with( + When.create().set(Properties.FLOWER_AMOUNT, 3, 4).set(Properties.HORIZONTAL_FACING, Direction.NORTH), + BlockStateVariant.create().put(VariantSettings.MODEL, three) + ) + .with( + When.create().set(Properties.FLOWER_AMOUNT, 3, 4).set(Properties.HORIZONTAL_FACING, Direction.EAST), + BlockStateVariant.create().put(VariantSettings.MODEL, three).put(VariantSettings.Y, VariantSettings.Rotation.R90) + ) + .with( + When.create().set(Properties.FLOWER_AMOUNT, 3, 4).set(Properties.HORIZONTAL_FACING, Direction.SOUTH), + BlockStateVariant.create().put(VariantSettings.MODEL, three).put(VariantSettings.Y, VariantSettings.Rotation.R180) + ) + .with( + When.create().set(Properties.FLOWER_AMOUNT, 3, 4).set(Properties.HORIZONTAL_FACING, Direction.WEST), + BlockStateVariant.create().put(VariantSettings.MODEL, three).put(VariantSettings.Y, VariantSettings.Rotation.R270) + ) + .with( + When.create().set(Properties.FLOWER_AMOUNT, 4).set(Properties.HORIZONTAL_FACING, Direction.NORTH), + BlockStateVariant.create().put(VariantSettings.MODEL, four) + ) + .with( + When.create().set(Properties.FLOWER_AMOUNT, 4).set(Properties.HORIZONTAL_FACING, Direction.EAST), + BlockStateVariant.create().put(VariantSettings.MODEL, four).put(VariantSettings.Y, VariantSettings.Rotation.R90) + ) + .with( + When.create().set(Properties.FLOWER_AMOUNT, 4).set(Properties.HORIZONTAL_FACING, Direction.SOUTH), + BlockStateVariant.create().put(VariantSettings.MODEL, four).put(VariantSettings.Y, VariantSettings.Rotation.R180) + ) + .with( + When.create().set(Properties.FLOWER_AMOUNT, 4).set(Properties.HORIZONTAL_FACING, Direction.WEST), + BlockStateVariant.create().put(VariantSettings.MODEL, four).put(VariantSettings.Y, VariantSettings.Rotation.R270) + ) ); } - @Override - public void generateItemModels(ItemModelGenerator itemModelGenerator) { - - } + // endregion } diff --git a/src/main/java/dev/spiritstudios/hollow/datagen/PlacedFeatureProvider.java b/src/main/java/dev/spiritstudios/hollow/datagen/PlacedFeatureProvider.java new file mode 100644 index 0000000..7446af3 --- /dev/null +++ b/src/main/java/dev/spiritstudios/hollow/datagen/PlacedFeatureProvider.java @@ -0,0 +1,92 @@ +package dev.spiritstudios.hollow.datagen; + +import dev.spiritstudios.hollow.Hollow; +import dev.spiritstudios.hollow.worldgen.feature.HollowConfiguredFeatures; +import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; +import net.fabricmc.fabric.api.datagen.v1.provider.FabricDynamicRegistryProvider; +import net.minecraft.block.Blocks; +import net.minecraft.registry.RegistryEntryLookup; +import net.minecraft.registry.RegistryKey; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.registry.RegistryWrapper; +import net.minecraft.util.collection.DataPool; +import net.minecraft.util.math.intprovider.ConstantIntProvider; +import net.minecraft.util.math.intprovider.IntProvider; +import net.minecraft.util.math.intprovider.WeightedListIntProvider; +import net.minecraft.world.Heightmap; +import net.minecraft.world.gen.feature.*; +import net.minecraft.world.gen.placementmodifier.*; + +import java.util.List; +import java.util.concurrent.CompletableFuture; + +public class PlacedFeatureProvider extends FabricDynamicRegistryProvider { + public PlacedFeatureProvider(FabricDataOutput output, CompletableFuture registriesFuture) { + super(output, registriesFuture); + } + + @Override + protected void configure(RegistryWrapper.WrapperLookup registries, Entries entries) { + RegistryWrapper lookup = registries.getWrapperOrThrow(RegistryKeys.PLACED_FEATURE); + + lookup.streamKeys() + .filter(key -> + key.getValue().getNamespace().equals(Hollow.MODID)) + .forEach(key -> + entries.add(key, lookup.getOrThrow(key).value())); + + // region Replacements + PlacedFeatureDatagenHelper helper = new PlacedFeatureDatagenHelper( + registries.getWrapperOrThrow(RegistryKeys.CONFIGURED_FEATURE), + entries + ); + + helper.add( + VegetationPlacedFeatures.TREES_BIRCH, + TreeConfiguredFeatures.BIRCH_BEES_0002, + CountPlacementModifier.of(new WeightedListIntProvider(DataPool.builder() + .add(ConstantIntProvider.create(9), 9) + .add(ConstantIntProvider.create(8), 1) + .build())), + HeightmapPlacementModifier.of(Heightmap.Type.OCEAN_FLOOR), + BiomePlacementModifier.of(), + SquarePlacementModifier.of(), + SurfaceWaterDepthFilterPlacementModifier.of(0), + PlacedFeatures.wouldSurvive(Blocks.BIRCH_SAPLING) + ); + + helper.add( + VegetationPlacedFeatures.BIRCH_TALL, + VegetationConfiguredFeatures.BIRCH_TALL, + CountPlacementModifier.of(new WeightedListIntProvider(DataPool.builder() + .add(ConstantIntProvider.create(9), 9) + .add(ConstantIntProvider.create(8), 1) + .build())), + HeightmapPlacementModifier.of(Heightmap.Type.OCEAN_FLOOR), + BiomePlacementModifier.of(), + SquarePlacementModifier.of(), + SurfaceWaterDepthFilterPlacementModifier.of(0), + PlacedFeatures.wouldSurvive(Blocks.BIRCH_SAPLING) + ); + + // endregion + } + + private record PlacedFeatureDatagenHelper(RegistryEntryLookup> lookup, + Entries entries) { + public void add(RegistryKey key, RegistryKey> configuredKey, PlacementModifier... modifiers) { + entries.add( + key, + new PlacedFeature( + lookup.getOrThrow(configuredKey), + List.of(modifiers) + ) + ); + } + } + + @Override + public String getName() { + return "Hollow/Placed Features"; + } +} diff --git a/src/main/java/dev/spiritstudios/hollow/datagen/RecipeProvider.java b/src/main/java/dev/spiritstudios/hollow/datagen/RecipeProvider.java index a222fbe..c22aa40 100644 --- a/src/main/java/dev/spiritstudios/hollow/datagen/RecipeProvider.java +++ b/src/main/java/dev/spiritstudios/hollow/datagen/RecipeProvider.java @@ -2,9 +2,10 @@ import dev.spiritstudios.hollow.block.HollowLogBlock; import dev.spiritstudios.hollow.block.OxidizablePillarBlock; -import dev.spiritstudios.hollow.registry.HollowBlockRegistrar; -import dev.spiritstudios.hollow.registry.HollowDataComponentRegistrar; -import dev.spiritstudios.hollow.registry.HollowItemRegistrar; +import dev.spiritstudios.hollow.component.CopperInstrument; +import dev.spiritstudios.hollow.registry.HollowBlocks; +import dev.spiritstudios.hollow.registry.HollowDataComponentTypes; +import dev.spiritstudios.hollow.registry.HollowItems; import dev.spiritstudios.specter.api.item.datagen.SpecterShapedRecipeJsonBuilder; import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; import net.fabricmc.fabric.api.datagen.v1.provider.FabricRecipeProvider; @@ -38,16 +39,16 @@ public RecipeProvider(FabricDataOutput output, CompletableFuture { @@ -62,25 +63,25 @@ public void generate(RecipeExporter exporter) { } ); - createCopperHornRecipe(exporter, Instruments.PONDER_GOAT_HORN, HollowDataComponentRegistrar.CopperInstrument.GREAT_SKY_FALLING); - createCopperHornRecipe(exporter, Instruments.SING_GOAT_HORN, HollowDataComponentRegistrar.CopperInstrument.OLD_HYMN_RESTING); - createCopperHornRecipe(exporter, Instruments.SEEK_GOAT_HORN, HollowDataComponentRegistrar.CopperInstrument.PURE_WATER_DESIRE); - createCopperHornRecipe(exporter, Instruments.FEEL_GOAT_HORN, HollowDataComponentRegistrar.CopperInstrument.HUMBLE_FIRE_MEMORY); - createCopperHornRecipe(exporter, Instruments.ADMIRE_GOAT_HORN, HollowDataComponentRegistrar.CopperInstrument.DRY_URGE_ANGER); - createCopperHornRecipe(exporter, Instruments.CALL_GOAT_HORN, HollowDataComponentRegistrar.CopperInstrument.CLEAR_TEMPER_JOURNEY); - createCopperHornRecipe(exporter, Instruments.YEARN_GOAT_HORN, HollowDataComponentRegistrar.CopperInstrument.FRESH_NEST_THOUGHT); - createCopperHornRecipe(exporter, Instruments.DREAM_GOAT_HORN, HollowDataComponentRegistrar.CopperInstrument.SECRET_LAKE_TEAR); + createCopperHornRecipe(exporter, Instruments.PONDER_GOAT_HORN, CopperInstrument.GREAT_SKY_FALLING); + createCopperHornRecipe(exporter, Instruments.SING_GOAT_HORN, CopperInstrument.OLD_HYMN_RESTING); + createCopperHornRecipe(exporter, Instruments.SEEK_GOAT_HORN, CopperInstrument.PURE_WATER_DESIRE); + createCopperHornRecipe(exporter, Instruments.FEEL_GOAT_HORN, CopperInstrument.HUMBLE_FIRE_MEMORY); + createCopperHornRecipe(exporter, Instruments.ADMIRE_GOAT_HORN, CopperInstrument.DRY_URGE_ANGER); + createCopperHornRecipe(exporter, Instruments.CALL_GOAT_HORN, CopperInstrument.CLEAR_TEMPER_JOURNEY); + createCopperHornRecipe(exporter, Instruments.YEARN_GOAT_HORN, CopperInstrument.FRESH_NEST_THOUGHT); + createCopperHornRecipe(exporter, Instruments.DREAM_GOAT_HORN, CopperInstrument.SECRET_LAKE_TEAR); Map.of( - HollowBlockRegistrar.COPPER_PILLAR, Blocks.CUT_COPPER_SLAB, - HollowBlockRegistrar.EXPOSED_COPPER_PILLAR, Blocks.EXPOSED_CUT_COPPER_SLAB, - HollowBlockRegistrar.WEATHERED_COPPER_PILLAR, Blocks.WEATHERED_CUT_COPPER_SLAB, - HollowBlockRegistrar.OXIDIZED_COPPER_PILLAR, Blocks.OXIDIZED_CUT_COPPER_SLAB, + HollowBlocks.COPPER_PILLAR, Blocks.CUT_COPPER_SLAB, + HollowBlocks.EXPOSED_COPPER_PILLAR, Blocks.EXPOSED_CUT_COPPER_SLAB, + HollowBlocks.WEATHERED_COPPER_PILLAR, Blocks.WEATHERED_CUT_COPPER_SLAB, + HollowBlocks.OXIDIZED_COPPER_PILLAR, Blocks.OXIDIZED_CUT_COPPER_SLAB, - HollowBlockRegistrar.WAXED_COPPER_PILLAR, Blocks.WAXED_CUT_COPPER_SLAB, - HollowBlockRegistrar.WAXED_EXPOSED_COPPER_PILLAR, Blocks.WAXED_EXPOSED_CUT_COPPER_SLAB, - HollowBlockRegistrar.WAXED_WEATHERED_COPPER_PILLAR, Blocks.WAXED_WEATHERED_CUT_COPPER_SLAB, - HollowBlockRegistrar.WAXED_OXIDIZED_COPPER_PILLAR, Blocks.WAXED_OXIDIZED_CUT_COPPER_SLAB + HollowBlocks.WAXED_COPPER_PILLAR, Blocks.WAXED_CUT_COPPER_SLAB, + HollowBlocks.WAXED_EXPOSED_COPPER_PILLAR, Blocks.WAXED_EXPOSED_CUT_COPPER_SLAB, + HollowBlocks.WAXED_WEATHERED_COPPER_PILLAR, Blocks.WAXED_WEATHERED_CUT_COPPER_SLAB, + HollowBlocks.WAXED_OXIDIZED_COPPER_PILLAR, Blocks.WAXED_OXIDIZED_CUT_COPPER_SLAB ).forEach( (pillar, slab) -> ShapedRecipeJsonBuilder.create(RecipeCategory.BUILDING_BLOCKS, pillar) .input('#', slab) @@ -100,12 +101,12 @@ public void createHollowLogRecipe(RecipeExporter exporter, HollowLogBlock block, .offerTo(exporter); } - public void createCopperHornRecipe(RecipeExporter exporter, RegistryKey goat, HollowDataComponentRegistrar.CopperInstrument copper) { + public void createCopperHornRecipe(RecipeExporter exporter, RegistryKey goat, CopperInstrument copper) { SpecterShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, new ItemStack( - Registries.ITEM.getEntry(HollowItemRegistrar.COPPER_HORN), + Registries.ITEM.getEntry(HollowItems.COPPER_HORN), 1, ComponentChanges.builder() - .add(HollowDataComponentRegistrar.COPPER_INSTRUMENT, copper) + .add(HollowDataComponentTypes.COPPER_INSTRUMENT, copper) .build() )) .group("hollow_copper_horn") diff --git a/src/main/java/dev/spiritstudios/hollow/datagen/tag/BiomeTagProvider.java b/src/main/java/dev/spiritstudios/hollow/datagen/tag/BiomeTagProvider.java new file mode 100644 index 0000000..207e3d2 --- /dev/null +++ b/src/main/java/dev/spiritstudios/hollow/datagen/tag/BiomeTagProvider.java @@ -0,0 +1,23 @@ +package dev.spiritstudios.hollow.datagen.tag; + +import dev.spiritstudios.hollow.data.HollowBiomeTags; +import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; +import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider; +import net.fabricmc.fabric.api.tag.convention.v2.ConventionalBiomeTags; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.registry.RegistryWrapper; +import net.minecraft.world.biome.Biome; + +import java.util.concurrent.CompletableFuture; + +public class BiomeTagProvider extends FabricTagProvider { + public BiomeTagProvider(FabricDataOutput output, CompletableFuture completableFuture) { + super(output, RegistryKeys.BIOME, completableFuture); + } + + @Override + protected void configure(RegistryWrapper.WrapperLookup wrapperLookup) { + getOrCreateTagBuilder(HollowBiomeTags.HAS_CLOSER_FOG) + .forceAddTag(ConventionalBiomeTags.IS_SWAMP); + } +} \ No newline at end of file diff --git a/src/main/java/dev/spiritstudios/hollow/datagen/tag/BlockTagProvider.java b/src/main/java/dev/spiritstudios/hollow/datagen/tag/BlockTagProvider.java new file mode 100644 index 0000000..f5e6d2b --- /dev/null +++ b/src/main/java/dev/spiritstudios/hollow/datagen/tag/BlockTagProvider.java @@ -0,0 +1,64 @@ +package dev.spiritstudios.hollow.datagen.tag; + +import dev.spiritstudios.hollow.block.HollowLogBlock; +import dev.spiritstudios.hollow.registry.HollowBlocks; +import dev.spiritstudios.specter.api.core.reflect.ReflectionHelper; +import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; +import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider; +import net.minecraft.block.Block; +import net.minecraft.registry.RegistryWrapper; +import net.minecraft.registry.tag.BlockTags; + +import java.util.concurrent.CompletableFuture; + +public class BlockTagProvider extends FabricTagProvider.BlockTagProvider { + public BlockTagProvider(FabricDataOutput output, CompletableFuture registriesFuture) { + super(output, registriesFuture); + } + + @Override + protected void configure(RegistryWrapper.WrapperLookup wrapperLookup) { + FabricTagProvider.FabricTagBuilder hollowLogs = getOrCreateTagBuilder(HollowBlocks.Tags.HOLLOW_LOGS); + FabricTagProvider.FabricTagBuilder axeMineable = getOrCreateTagBuilder(BlockTags.AXE_MINEABLE); + + ReflectionHelper.getStaticFields( + HollowBlocks.class, + HollowLogBlock.class + ).forEach(pair -> { + hollowLogs.add(pair.value()); + axeMineable.add(pair.value()); + }); + + getOrCreateTagBuilder(BlockTags.PICKAXE_MINEABLE) + .add(HollowBlocks.ECHOING_POT) + .add(HollowBlocks.STONE_CHEST) + .add(HollowBlocks.STONE_CHEST_LID) + .add(HollowBlocks.COPPER_PILLAR) + .add(HollowBlocks.WEATHERED_COPPER_PILLAR) + .add(HollowBlocks.EXPOSED_COPPER_PILLAR) + .add(HollowBlocks.OXIDIZED_COPPER_PILLAR) + .add(HollowBlocks.WAXED_COPPER_PILLAR) + .add(HollowBlocks.WAXED_WEATHERED_COPPER_PILLAR) + .add(HollowBlocks.WAXED_EXPOSED_COPPER_PILLAR) + .add(HollowBlocks.WAXED_OXIDIZED_COPPER_PILLAR); + + getOrCreateTagBuilder(BlockTags.HOE_MINEABLE) + .add(HollowBlocks.SCULK_JAW); + + getOrCreateTagBuilder(BlockTags.FLOWER_POTS) + .add(HollowBlocks.POTTED_ROOTED_ORCHID) + .add(HollowBlocks.POTTED_PAEONIA); + + getOrCreateTagBuilder(BlockTags.SMALL_FLOWERS) + .add(HollowBlocks.PAEONIA) + .add(HollowBlocks.ROOTED_ORCHID) + .add(HollowBlocks.LOTUS_LILYPAD); + + getOrCreateTagBuilder(BlockTags.TALL_FLOWERS) + .add(HollowBlocks.CAMPION); + + getOrCreateTagBuilder(HollowBlocks.Tags.POLYPORE_PLACEABLE_ON) + .forceAddTag(BlockTags.LOGS) + .addTag(HollowBlocks.Tags.HOLLOW_LOGS); + } +} diff --git a/src/main/java/dev/spiritstudios/hollow/datagen/tag/EntityTypeTagProvider.java b/src/main/java/dev/spiritstudios/hollow/datagen/tag/EntityTypeTagProvider.java new file mode 100644 index 0000000..d0f4d5c --- /dev/null +++ b/src/main/java/dev/spiritstudios/hollow/datagen/tag/EntityTypeTagProvider.java @@ -0,0 +1,29 @@ +package dev.spiritstudios.hollow.datagen.tag; + +import dev.spiritstudios.hollow.registry.HollowEntityTypes; +import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; +import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider; +import net.minecraft.entity.EntityType; +import net.minecraft.registry.RegistryWrapper; +import net.minecraft.registry.tag.EntityTypeTags; + +import java.util.concurrent.CompletableFuture; + +public class EntityTypeTagProvider extends FabricTagProvider.EntityTypeTagProvider { + public EntityTypeTagProvider(FabricDataOutput output, CompletableFuture completableFuture) { + super(output, completableFuture); + } + + @Override + protected void configure(RegistryWrapper.WrapperLookup wrapperLookup) { + getOrCreateTagBuilder(HollowEntityTypes.Tags.POISONS_FROG) + .add(HollowEntityTypes.FIREFLY); + + getOrCreateTagBuilder(EntityTypeTags.FROG_FOOD) + .add(HollowEntityTypes.FIREFLY); + + getOrCreateTagBuilder(HollowEntityTypes.Tags.IMMUNE_TO_SCULK_JAW) + .add(EntityType.WARDEN); + + } +} diff --git a/src/main/java/dev/spiritstudios/hollow/entity/FireflyEntity.java b/src/main/java/dev/spiritstudios/hollow/entity/FireflyEntity.java index 80be258..0aa162a 100644 --- a/src/main/java/dev/spiritstudios/hollow/entity/FireflyEntity.java +++ b/src/main/java/dev/spiritstudios/hollow/entity/FireflyEntity.java @@ -1,6 +1,6 @@ package dev.spiritstudios.hollow.entity; -import dev.spiritstudios.hollow.registry.HollowBlockRegistrar; +import dev.spiritstudios.hollow.registry.HollowBlocks; import net.minecraft.block.BlockState; import net.minecraft.entity.*; import net.minecraft.entity.ai.AboveGroundTargeting; @@ -101,15 +101,14 @@ public void tick() { @Override public ActionResult interactMob(PlayerEntity player, Hand hand) { ItemStack itemStack = player.getStackInHand(hand); - if (itemStack.getItem() == HollowBlockRegistrar.JAR.asItem() && this.isAlive()) { - player.setStackInHand(hand, itemStack.copyWithCount(itemStack.getCount() - 1)); - player.getInventory().offerOrDrop(new ItemStack(HollowBlockRegistrar.FIREFLY_JAR)); - - this.discard(); - return ActionResult.success(player.getWorld().isClient); - } else { + if (itemStack.getItem() != HollowBlocks.JAR.asItem() || !this.isAlive()) return super.interactMob(player, hand); - } + + player.setStackInHand(hand, itemStack.copyWithCount(itemStack.getCount() - 1)); + player.getInventory().offerOrDrop(new ItemStack(HollowBlocks.FIREFLY_JAR)); + + this.discard(); + return ActionResult.success(player.getWorld().isClient); } @Override diff --git a/src/main/java/dev/spiritstudios/hollow/item/CopperHornItem.java b/src/main/java/dev/spiritstudios/hollow/item/CopperHornItem.java index cffa0c8..d07c64d 100644 --- a/src/main/java/dev/spiritstudios/hollow/item/CopperHornItem.java +++ b/src/main/java/dev/spiritstudios/hollow/item/CopperHornItem.java @@ -1,21 +1,21 @@ package dev.spiritstudios.hollow.item; -import dev.spiritstudios.hollow.Hollow; -import dev.spiritstudios.hollow.registry.HollowDataComponentRegistrar; +import dev.spiritstudios.hollow.component.CopperInstrument; +import dev.spiritstudios.hollow.registry.HollowDataComponentTypes; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.item.Instrument; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.tooltip.TooltipType; -import net.minecraft.registry.RegistryKey; -import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.sound.SoundCategory; import net.minecraft.sound.SoundEvent; import net.minecraft.stat.Stats; import net.minecraft.text.MutableText; import net.minecraft.text.Text; -import net.minecraft.util.*; +import net.minecraft.util.Formatting; +import net.minecraft.util.Hand; +import net.minecraft.util.TypedActionResult; +import net.minecraft.util.UseAction; import net.minecraft.world.World; import net.minecraft.world.event.GameEvent; @@ -27,27 +27,54 @@ public CopperHornItem(Settings settings) { super(settings); } + @Override + public TypedActionResult use(World world, PlayerEntity user, Hand hand) { + ItemStack itemStack = user.getStackInHand(hand); + + Optional instrument = this.getInstrument(itemStack); + if (instrument.isEmpty()) return TypedActionResult.fail(itemStack); + + user.setCurrentHand(hand); + playSound(world, user, instrument.get()); + + user.getItemCooldownManager().set(this, 80); + user.incrementStat(Stats.USED.getOrCreateStat(this)); + + return TypedActionResult.consume(itemStack); + } + + // region Settings + @Override + public UseAction getUseAction(ItemStack stack) { + return UseAction.TOOT_HORN; + } + + @Override + public int getMaxUseTime(ItemStack stack, LivingEntity user) { + return 80; + } + // endregion + @Override public void appendTooltip(ItemStack stack, Item.TooltipContext context, List tooltip, TooltipType type) { super.appendTooltip(stack, context, tooltip, type); - HollowDataComponentRegistrar.CopperInstrument instrument = this.getInstrument(stack).orElse(null); + CopperInstrument instrument = this.getInstrument(stack).orElse(null); if (instrument == null) return; MutableText text = Text.translatable("copper_horn.%s".formatted(instrument.asString())); tooltip.add(text.formatted(Formatting.GRAY)); } - @Override - public int getMaxUseTime(ItemStack stack, LivingEntity user) { - return 80; + private Optional getInstrument(ItemStack stack) { + return Optional.ofNullable(stack.get(HollowDataComponentTypes.COPPER_INSTRUMENT)); } - private static void playSound(World world, PlayerEntity player, HollowDataComponentRegistrar.CopperInstrument instrument) { + private static void playSound(World world, PlayerEntity player, CopperInstrument instrument) { SoundEvent sound; float pitch = 1.0F; float volume = 1.0F; if (player.isSneaking()) { - sound = instrument.soundEvents.get("bass"); + sound = instrument.bass; switch (instrument) { case FEARLESS_RIVER_GIFT -> { pitch = 1.07F; @@ -58,35 +85,11 @@ private static void playSound(World world, PlayerEntity player, HollowDataCompon volume = 1.7F; } } - } else if (player.getPitch() < -45) sound = instrument.soundEvents.get("call"); - else sound = instrument.soundEvents.get("melody"); + } else if (player.getPitch() < -45) sound = instrument.call; + else sound = instrument.melody; world.playSoundFromEntity(player, player, sound, SoundCategory.HOSTILE, volume, pitch); world.emitGameEvent(GameEvent.INSTRUMENT_PLAY, player.getPos(), GameEvent.Emitter.of(player)); } - - @Override - public TypedActionResult use(World world, PlayerEntity user, Hand hand) { - ItemStack itemStack = user.getStackInHand(hand); - Optional instrument = this.getInstrument(itemStack); - if (instrument.isPresent()) { - user.setCurrentHand(hand); - playSound(world, user, instrument.get()); - user.getItemCooldownManager().set(this, 80); - user.incrementStat(Stats.USED.getOrCreateStat(this)); - return TypedActionResult.consume(itemStack); - } else return TypedActionResult.fail(itemStack); - } - - @Override - public UseAction getUseAction(ItemStack stack) { - return UseAction.TOOT_HORN; - } - - private Optional getInstrument(ItemStack stack) { - HollowDataComponentRegistrar.CopperInstrument registryEntry = stack.get(HollowDataComponentRegistrar.COPPER_INSTRUMENT); - if (registryEntry != null) return Optional.of(registryEntry); - return Optional.empty(); - } } diff --git a/src/main/java/dev/spiritstudios/hollow/item/GiantLilyPadItem.java b/src/main/java/dev/spiritstudios/hollow/item/GiantLilyPadItem.java deleted file mode 100644 index f39ef59..0000000 --- a/src/main/java/dev/spiritstudios/hollow/item/GiantLilyPadItem.java +++ /dev/null @@ -1,73 +0,0 @@ -package dev.spiritstudios.hollow.item; - -import dev.spiritstudios.hollow.block.GiantLilyPadBlock; -import net.minecraft.advancement.criterion.Criteria; -import net.minecraft.block.Block; -import net.minecraft.block.BlockState; -import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.fluid.FluidState; -import net.minecraft.fluid.Fluids; -import net.minecraft.item.ItemStack; -import net.minecraft.item.PlaceableOnWaterItem; -import net.minecraft.registry.tag.BlockTags; -import net.minecraft.server.network.ServerPlayerEntity; -import net.minecraft.sound.SoundCategory; -import net.minecraft.sound.SoundEvents; -import net.minecraft.stat.Stats; -import net.minecraft.util.Hand; -import net.minecraft.util.TypedActionResult; -import net.minecraft.util.hit.BlockHitResult; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Direction; -import net.minecraft.world.RaycastContext; -import net.minecraft.world.World; - -public class GiantLilyPadItem extends PlaceableOnWaterItem { - public GiantLilyPadItem(Block block, Settings settings) { super(block, settings); } - - @Override - public TypedActionResult use(World world, PlayerEntity user, Hand hand) { - ItemStack stack = user.getStackInHand(hand); - BlockHitResult rayHit = raycast(world, user, RaycastContext.FluidHandling.SOURCE_ONLY); - if (rayHit.getType() == BlockHitResult.Type.MISS) return TypedActionResult.pass(stack); - if (rayHit.getType() != BlockHitResult.Type.BLOCK) return TypedActionResult.fail(stack); - - BlockPos pos = rayHit.getBlockPos(); - Direction side = rayHit.getSide(); - if ( - !world.canPlayerModifyAt(user, pos) || !user.canPlaceOn(pos, side, stack) - || !world.canPlayerModifyAt(user, pos.east()) || !user.canPlaceOn(pos.east(), side, stack) - || !world.canPlayerModifyAt(user, pos.south()) || !user.canPlaceOn(pos.south(), side, stack) - || !world.canPlayerModifyAt(user, pos.east().south()) || !user.canPlaceOn(pos.east().south(), side, stack) - ) return TypedActionResult.fail(stack); - - BlockPos above = pos.up(); - BlockState state = world.getBlockState(pos); - FluidState fluidState = world.getFluidState(pos); - - if ((!fluidState.isOf(Fluids.WATER) && !state.isIn(BlockTags.ICE)) || !world.isAir(above) - || (!world.getFluidState(pos.east()).isOf(Fluids.WATER) && !world.getBlockState(pos.east()).isIn(BlockTags.ICE)) || !world.isAir(above.east()) - || (!world.getFluidState(pos.south()).isOf(Fluids.WATER) && !world.getBlockState(pos.south()).isIn(BlockTags.ICE)) || !world.isAir(above.south()) - || (!world.getFluidState(pos.east().south()).isOf(Fluids.WATER) && !world.getBlockState(pos.east().south()).isIn(BlockTags.ICE)) || !world.isAir(above.east().south()) - ) return TypedActionResult.fail(stack); - - BlockState lilypadState = this.getBlock().getDefaultState().with(GiantLilyPadBlock.FACING, user.getHorizontalFacing()); - world.setBlockState(above, lilypadState.with(GiantLilyPadBlock.PIECE, GiantLilyPadBlock.Piece.NORTH_WEST), 11); - world.setBlockState(above.east(), lilypadState.with(GiantLilyPadBlock.PIECE, GiantLilyPadBlock.Piece.NORTH_EAST), 11); - world.setBlockState(above.south(), lilypadState.with(GiantLilyPadBlock.PIECE, GiantLilyPadBlock.Piece.SOUTH_WEST), 11); - world.setBlockState(above.east().south(), lilypadState.with(GiantLilyPadBlock.PIECE, GiantLilyPadBlock.Piece.SOUTH_EAST), 11); - - if (user instanceof ServerPlayerEntity serverPlayer) { - Criteria.PLACED_BLOCK.trigger(serverPlayer, above, stack); - Criteria.PLACED_BLOCK.trigger(serverPlayer, above.east(), stack); - Criteria.PLACED_BLOCK.trigger(serverPlayer, above.east().south(), stack); - Criteria.PLACED_BLOCK.trigger(serverPlayer, above.south(), stack); - } - - if (!user.getAbilities().creativeMode) stack.decrement(1); - user.incrementStat(Stats.USED.getOrCreateStat(this)); - world.playSound(user, pos, SoundEvents.BLOCK_LILY_PAD_PLACE, SoundCategory.BLOCKS, 1.0F, 1.0F); - - return TypedActionResult.success(stack); - } -} diff --git a/src/main/java/dev/spiritstudios/hollow/loot/HollowLootTableModifications.java b/src/main/java/dev/spiritstudios/hollow/loot/HollowLootTableModifications.java index 8253f6f..43b06aa 100644 --- a/src/main/java/dev/spiritstudios/hollow/loot/HollowLootTableModifications.java +++ b/src/main/java/dev/spiritstudios/hollow/loot/HollowLootTableModifications.java @@ -1,6 +1,6 @@ package dev.spiritstudios.hollow.loot; -import dev.spiritstudios.hollow.registry.HollowItemRegistrar; +import dev.spiritstudios.hollow.registry.HollowItems; import net.fabricmc.fabric.api.loot.v3.LootTableEvents; import net.minecraft.loot.LootPool; import net.minecraft.loot.LootTables; @@ -15,7 +15,7 @@ public static void init() { if (LootTables.ANCIENT_CITY_CHEST == key) { LootPool.Builder lootPoolBuilder = LootPool.builder() - .with(ItemEntry.builder(HollowItemRegistrar.MUSIC_DISC_POSTMORTEM)) + .with(ItemEntry.builder(HollowItems.MUSIC_DISC_POSTMORTEM)) .conditionally(RandomChanceLootCondition.builder(0.1F)); tableBuilder.pool(lootPoolBuilder); @@ -24,7 +24,7 @@ public static void init() { if (LootTables.PILLAGER_OUTPOST_CHEST == key) { LootPool.Builder lootPoolBuilder = LootPool.builder() .rolls(UniformLootNumberProvider.create(0.0F, 1.0F)) - .with(ItemEntry.builder(HollowItemRegistrar.COPPER_HORN)) + .with(ItemEntry.builder(HollowItems.COPPER_HORN)) .apply(SetCopperInstrumentFunction.builder()); tableBuilder.pool(lootPoolBuilder); diff --git a/src/main/java/dev/spiritstudios/hollow/loot/SetCopperInstrumentFunction.java b/src/main/java/dev/spiritstudios/hollow/loot/SetCopperInstrumentFunction.java index f6b40b1..316b6f4 100644 --- a/src/main/java/dev/spiritstudios/hollow/loot/SetCopperInstrumentFunction.java +++ b/src/main/java/dev/spiritstudios/hollow/loot/SetCopperInstrumentFunction.java @@ -2,9 +2,9 @@ import com.mojang.serialization.MapCodec; import com.mojang.serialization.codecs.RecordCodecBuilder; +import dev.spiritstudios.hollow.component.CopperInstrument; import dev.spiritstudios.hollow.item.CopperHornItem; -import dev.spiritstudios.hollow.registry.HollowDataComponentRegistrar; -import net.minecraft.item.Instrument; +import dev.spiritstudios.hollow.registry.HollowDataComponentTypes; import net.minecraft.item.ItemStack; import net.minecraft.loot.condition.LootCondition; import net.minecraft.loot.context.LootContext; @@ -12,7 +12,6 @@ import net.minecraft.loot.function.LootFunctionType; import net.minecraft.loot.function.LootFunctionTypes; import net.minecraft.loot.function.SetInstrumentLootFunction; -import net.minecraft.registry.tag.TagKey; import java.util.List; @@ -36,13 +35,15 @@ public LootFunctionType getType() { @Override public ItemStack process(ItemStack stack, LootContext context) { - if (stack.getItem() instanceof CopperHornItem) { - HollowDataComponentRegistrar.CopperInstrument[] values = HollowDataComponentRegistrar.CopperInstrument.values(); - stack.set( - HollowDataComponentRegistrar.COPPER_INSTRUMENT, - values[context.getRandom().nextInt(values.length)] - ); - } + if (!(stack.getItem() instanceof CopperHornItem)) return stack; + + CopperInstrument[] values = CopperInstrument.values(); + + stack.set( + HollowDataComponentTypes.COPPER_INSTRUMENT, + values[context.getRandom().nextInt(values.length)] + ); + return stack; } } diff --git a/src/main/java/dev/spiritstudios/hollow/mixin/BulbBlockMixin.java b/src/main/java/dev/spiritstudios/hollow/mixin/BulbBlockMixin.java index bd190ad..20a2179 100644 --- a/src/main/java/dev/spiritstudios/hollow/mixin/BulbBlockMixin.java +++ b/src/main/java/dev/spiritstudios/hollow/mixin/BulbBlockMixin.java @@ -4,6 +4,7 @@ import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; import dev.spiritstudios.hollow.Hollow; import dev.spiritstudios.hollow.HollowConfig; +import dev.spiritstudios.hollow.HollowGameRules; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.BulbBlock; @@ -24,7 +25,7 @@ public BulbBlockMixin(Settings settings) { @WrapOperation(method = "neighborUpdate", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/BulbBlock;update(Lnet/minecraft/block/BlockState;Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/util/math/BlockPos;)V")) private void updateRedirect(BulbBlock instance, BlockState state, ServerWorld world, BlockPos pos, Operation original) { - if (HollowConfig.INSTANCE.revertCopperBulb.get()) + if (world.getGameRules().getBoolean(HollowGameRules.COPPER_BULB_DELAY)) world.scheduleBlockTick(pos, instance, 1); else original.call(instance, state, world, pos); diff --git a/src/main/java/dev/spiritstudios/hollow/mixin/EntityMixin.java b/src/main/java/dev/spiritstudios/hollow/mixin/EntityMixin.java deleted file mode 100644 index 568a058..0000000 --- a/src/main/java/dev/spiritstudios/hollow/mixin/EntityMixin.java +++ /dev/null @@ -1,42 +0,0 @@ -package dev.spiritstudios.hollow.mixin; - - -import dev.spiritstudios.hollow.block.SculkJawBlock; -import dev.spiritstudios.hollow.registry.HollowBlockRegistrar; -import net.minecraft.block.BlockState; -import net.minecraft.entity.Entity; -import net.minecraft.entity.MovementType; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; -import net.minecraft.world.World; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.ModifyVariable; -import org.spongepowered.asm.mixin.injection.Redirect; - -@Mixin(Entity.class) -public abstract class EntityMixin { - - @Shadow public abstract World getWorld(); - - @Shadow public abstract BlockPos getLandingPos(); - - @Shadow protected abstract BlockPos getPosWithYOffset(float offset); - - @Redirect(method = "bypassesSteppingEffects", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;isSneaking()Z")) - private boolean isSneaking(Entity instance) { - if (getWorld().getBlockState(getLandingPos()).getBlock() == HollowBlockRegistrar.SCULK_JAW) return false; - return instance.isSneaking(); - } - - @ModifyVariable(method = "move", at = @At("HEAD"), argsOnly = true) - private Vec3d move(Vec3d movement, MovementType type) { - BlockState block = getWorld().getBlockState(getPosWithYOffset(0)); - if (type == MovementType.SELF && block.getBlock() == HollowBlockRegistrar.SCULK_JAW && block.get(SculkJawBlock.ACTIVE)) { - return Vec3d.ZERO; - } - return movement; - } -} - diff --git a/src/main/java/dev/spiritstudios/hollow/mixin/FrogEatEntityTaskMixin.java b/src/main/java/dev/spiritstudios/hollow/mixin/FrogEatEntityTaskMixin.java index af925ed..43112d2 100644 --- a/src/main/java/dev/spiritstudios/hollow/mixin/FrogEatEntityTaskMixin.java +++ b/src/main/java/dev/spiritstudios/hollow/mixin/FrogEatEntityTaskMixin.java @@ -1,6 +1,9 @@ package dev.spiritstudios.hollow.mixin; -import dev.spiritstudios.hollow.entity.FireflyEntity; +import dev.spiritstudios.hollow.HollowGameRules; +import dev.spiritstudios.hollow.registry.HollowCriteria; +import dev.spiritstudios.hollow.registry.HollowEntityTypes; +import net.fabricmc.fabric.api.networking.v1.PlayerLookup; import net.minecraft.entity.Entity; import net.minecraft.entity.ai.brain.task.FrogEatEntityTask; import net.minecraft.entity.effect.StatusEffectInstance; @@ -15,14 +18,22 @@ import java.util.Optional; @Mixin(FrogEatEntityTask.class) -public class FrogEatEntityTaskMixin { +public abstract class FrogEatEntityTaskMixin { @Inject(method = "eat", at = @At("HEAD")) private void eat(ServerWorld world, FrogEntity frog, CallbackInfo ci) { - Optional entity = frog.getFrogTarget(); - if (entity.isEmpty()) return; - if (entity.get() instanceof FireflyEntity && world.random.nextFloat() > 0.75F) { - StatusEffectInstance statusEffectInstance = new StatusEffectInstance(StatusEffects.POISON, 100, 0); - frog.addStatusEffect(statusEffectInstance); - } + if (!world.getGameRules().getBoolean(HollowGameRules.DO_FROG_POISONING)) return; + + Optional target = frog.getFrogTarget(); + if (target.isEmpty()) return; + if (!target.get().getType().isIn(HollowEntityTypes.Tags.POISONS_FROG) || world.random.nextFloat() <= 0.75F) return; + + StatusEffectInstance statusEffectInstance = new StatusEffectInstance( + StatusEffects.POISON, + 100, + 0 + ); + + frog.addStatusEffect(statusEffectInstance); + PlayerLookup.tracking(frog).forEach(HollowCriteria.FROG_POISONED::trigger); } } diff --git a/src/main/java/dev/spiritstudios/hollow/mixin/SaplingGeneratorMixin.java b/src/main/java/dev/spiritstudios/hollow/mixin/SaplingGeneratorMixin.java index 4736121..7d922f7 100644 --- a/src/main/java/dev/spiritstudios/hollow/mixin/SaplingGeneratorMixin.java +++ b/src/main/java/dev/spiritstudios/hollow/mixin/SaplingGeneratorMixin.java @@ -1,33 +1,27 @@ package dev.spiritstudios.hollow.mixin; +import com.llamalad7.mixinextras.injector.wrapmethod.WrapMethod; +import com.llamalad7.mixinextras.injector.wrapoperation.Operation; import net.minecraft.block.SaplingGenerator; import net.minecraft.registry.RegistryKey; -import net.minecraft.registry.RegistryKeys; -import net.minecraft.util.Identifier; import net.minecraft.util.math.random.Random; import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.feature.TreeConfiguredFeatures; +import org.jetbrains.annotations.Nullable; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - -import static dev.spiritstudios.hollow.Hollow.MODID; @Mixin(SaplingGenerator.class) -public class SaplingGeneratorMixin { - @Shadow @Final private String id; - - @Inject(method = "getSmallTreeFeature", at = @At("HEAD"), cancellable = true) - protected void getSmallTreeFeature(Random random, boolean bees, CallbackInfoReturnable>> cir) { - if (!this.id.equals("birch")) return; - cir.setReturnValue(RegistryKey.of(RegistryKeys.CONFIGURED_FEATURE, Identifier.of(MODID, "birch_bees_0002"))); - } +public abstract class SaplingGeneratorMixin { + @Shadow + @Final + private String id; - @Inject(method = "getMegaTreeFeature", at = @At("HEAD"), cancellable = true) - protected void getMegaTreeFeature(Random random, CallbackInfoReturnable>> cir) { - if (!this.id.equals("birch")) return; - cir.setReturnValue(RegistryKey.of(RegistryKeys.CONFIGURED_FEATURE, Identifier.of(MODID, "birch_tall"))); + @WrapMethod(method = "getSmallTreeFeature") + protected @Nullable RegistryKey> getSmallTreeFeature(Random random, boolean flowersNearby, Operation>> original) { + return !this.id.equals("birch") ? + original.call(random, flowersNearby) : + TreeConfiguredFeatures.BIRCH_BEES_0002; } } diff --git a/src/main/java/dev/spiritstudios/hollow/mixin/SculkBlockMixin.java b/src/main/java/dev/spiritstudios/hollow/mixin/SculkBlockMixin.java index 8a8019c..8975cfc 100644 --- a/src/main/java/dev/spiritstudios/hollow/mixin/SculkBlockMixin.java +++ b/src/main/java/dev/spiritstudios/hollow/mixin/SculkBlockMixin.java @@ -3,7 +3,7 @@ import com.llamalad7.mixinextras.injector.wrapoperation.Operation; import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; import com.llamalad7.mixinextras.sugar.Local; -import dev.spiritstudios.hollow.registry.HollowBlockRegistrar; +import dev.spiritstudios.hollow.registry.HollowBlocks; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.SculkBlock; @@ -12,22 +12,21 @@ import net.minecraft.world.WorldAccess; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Redirect; @Mixin(SculkBlock.class) public abstract class SculkBlockMixin { - @Redirect(method = "getExtraBlockState", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/Block;getDefaultState()Lnet/minecraft/block/BlockState;", ordinal = 1)) - private BlockState getExtraBlockState(Block instance, @Local(argsOnly = true) Random random) { - return random.nextFloat() > 0.35F ? HollowBlockRegistrar.SCULK_JAW.getDefaultState() : instance.getDefaultState(); + @WrapOperation(method = "getExtraBlockState", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/Block;getDefaultState()Lnet/minecraft/block/BlockState;", ordinal = 1)) + private BlockState getExtraBlockState(Block instance, Operation original, @Local(argsOnly = true) Random random) { + return random.nextFloat() < 0.35F ? HollowBlocks.SCULK_JAW.getDefaultState() : original.call(instance); } @WrapOperation(method = "shouldNotDecay", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/BlockState;isOf(Lnet/minecraft/block/Block;)Z", ordinal = 1)) private static boolean shouldNotDecay(BlockState state, Block block, Operation original) { - return state.isOf(HollowBlockRegistrar.SCULK_JAW) || original.call(state, block); + return state.isOf(HollowBlocks.SCULK_JAW) || original.call(state, block); } @WrapOperation(method = "spread", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/WorldAccess;setBlockState(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;I)Z")) private boolean spread(WorldAccess instance, BlockPos pos, BlockState state, int i, Operation original) { - return original.call(instance, state.isOf(HollowBlockRegistrar.SCULK_JAW) ? pos.down() : pos, state, i); + return original.call(instance, state.isOf(HollowBlocks.SCULK_JAW) ? pos.down() : pos, state, i); } } diff --git a/src/main/java/dev/spiritstudios/hollow/mixin/SculkVeinBlockMixin.java b/src/main/java/dev/spiritstudios/hollow/mixin/SculkVeinBlockMixin.java new file mode 100644 index 0000000..688f42e --- /dev/null +++ b/src/main/java/dev/spiritstudios/hollow/mixin/SculkVeinBlockMixin.java @@ -0,0 +1,40 @@ +package dev.spiritstudios.hollow.mixin; + +import com.llamalad7.mixinextras.injector.wrapoperation.Operation; +import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; +import dev.spiritstudios.hollow.registry.HollowBlocks; +import net.minecraft.block.*; +import net.minecraft.item.ItemPlacementContext; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.world.BlockView; +import net.minecraft.world.WorldAccess; +import org.jetbrains.annotations.Nullable; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; + +@Mixin(SculkVeinBlock.class) +public abstract class SculkVeinBlockMixin extends MultifaceGrowthBlock { + public SculkVeinBlockMixin(Settings settings) { + super(settings); + } + + @WrapOperation(method = "place", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/SculkVeinBlock;canGrowOn(Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/Direction;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Z")) + private static boolean canGrowOn(BlockView blockView, Direction direction, BlockPos blockPos, BlockState blockState, Operation original) { + return original.call(blockView, direction, blockPos, blockState) && !blockState.isOf(HollowBlocks.SCULK_JAW); + } + + @WrapOperation( + method = "spreadAtSamePosition", + at = @At(value = "INVOKE", target = "Lnet/minecraft/block/BlockState;isOf(Lnet/minecraft/block/Block;)Z", ordinal = 1) + ) + private boolean spreadAtSamePosition(BlockState instance, Block block, Operation original) { + return original.call(instance, block) || original.call(instance, HollowBlocks.SCULK_JAW); + } + + @Override + public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) { + if (neighborState.isOf(HollowBlocks.SCULK_JAW) && direction == Direction.DOWN) return Blocks.AIR.getDefaultState(); + return super.getStateForNeighborUpdate(state, direction, neighborState, world, pos, neighborPos); + } +} diff --git a/src/main/java/dev/spiritstudios/hollow/mixin/SculkVeinGrowCheckerMixin.java b/src/main/java/dev/spiritstudios/hollow/mixin/SculkVeinGrowCheckerMixin.java index 5ec4f2f..1bda445 100644 --- a/src/main/java/dev/spiritstudios/hollow/mixin/SculkVeinGrowCheckerMixin.java +++ b/src/main/java/dev/spiritstudios/hollow/mixin/SculkVeinGrowCheckerMixin.java @@ -1,21 +1,23 @@ package dev.spiritstudios.hollow.mixin; +import com.llamalad7.mixinextras.injector.wrapmethod.WrapMethod; import com.llamalad7.mixinextras.injector.wrapoperation.Operation; import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; -import dev.spiritstudios.hollow.registry.HollowBlockRegistrar; +import dev.spiritstudios.hollow.registry.HollowBlocks; import net.minecraft.block.Block; import net.minecraft.block.BlockState; -import net.minecraft.block.SculkVeinBlock; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.world.BlockView; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; -@Mixin(SculkVeinBlock.SculkVeinGrowChecker.class) -public class SculkVeinGrowCheckerMixin { - @WrapOperation( - method = "canGrow(Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/Direction;Lnet/minecraft/block/BlockState;)Z", - at = @At(value = "INVOKE", target = "Lnet/minecraft/block/BlockState;isOf(Lnet/minecraft/block/Block;)Z", ordinal = 0) +@Mixin(targets = "net.minecraft.block.SculkVeinBlock.SculkVeinGrowChecker") +public abstract class SculkVeinGrowCheckerMixin { + @WrapMethod( + method = "canGrow(Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/Direction;Lnet/minecraft/block/BlockState;)Z" ) - private boolean canGrow(BlockState instance, Block block, Operation original) { - return original.call(instance, block) || instance.isOf(HollowBlockRegistrar.SCULK_JAW); + private boolean canGrow(BlockView world, BlockPos pos, BlockPos growPos, Direction direction, BlockState state, Operation original) { + return original.call(world, pos, growPos, direction, state) && !world.getBlockState(pos.down()).isOf(HollowBlocks.SCULK_JAW); } } diff --git a/src/main/java/dev/spiritstudios/hollow/registry/HollowBlockEntityRegistrar.java b/src/main/java/dev/spiritstudios/hollow/registry/HollowBlockEntityTypes.java similarity index 67% rename from src/main/java/dev/spiritstudios/hollow/registry/HollowBlockEntityRegistrar.java rename to src/main/java/dev/spiritstudios/hollow/registry/HollowBlockEntityTypes.java index a2d25f5..edc46d2 100644 --- a/src/main/java/dev/spiritstudios/hollow/registry/HollowBlockEntityRegistrar.java +++ b/src/main/java/dev/spiritstudios/hollow/registry/HollowBlockEntityTypes.java @@ -3,11 +3,10 @@ import dev.spiritstudios.hollow.block.entity.EchoingPotBlockEntity; import dev.spiritstudios.hollow.block.entity.JarBlockEntity; import dev.spiritstudios.hollow.block.entity.StoneChestBlockEntity; -import dev.spiritstudios.specter.api.registry.registration.BlockEntityTypeRegistrar; import net.minecraft.block.entity.BlockEntityType; -public class HollowBlockEntityRegistrar implements BlockEntityTypeRegistrar { - public static final BlockEntityType JAR_BLOCK_ENTITY = BlockEntityType.Builder.create(JarBlockEntity::new, HollowBlockRegistrar.JAR).build(); - public static final BlockEntityType ECHOING_POT_BLOCK_ENTITY = BlockEntityType.Builder.create(EchoingPotBlockEntity::new, HollowBlockRegistrar.ECHOING_POT).build(); - public static final BlockEntityType STONE_CHEST_BLOCK_ENTITY = BlockEntityType.Builder.create(StoneChestBlockEntity::new, HollowBlockRegistrar.STONE_CHEST).build(); +public final class HollowBlockEntityTypes { + public static final BlockEntityType JAR_BLOCK_ENTITY = BlockEntityType.Builder.create(JarBlockEntity::new, HollowBlocks.JAR).build(); + public static final BlockEntityType ECHOING_POT_BLOCK_ENTITY = BlockEntityType.Builder.create(EchoingPotBlockEntity::new, HollowBlocks.ECHOING_POT).build(); + public static final BlockEntityType STONE_CHEST_BLOCK_ENTITY = BlockEntityType.Builder.create(StoneChestBlockEntity::new, HollowBlocks.STONE_CHEST).build(); } diff --git a/src/main/java/dev/spiritstudios/hollow/registry/HollowBlockRegistrar.java b/src/main/java/dev/spiritstudios/hollow/registry/HollowBlockRegistrar.java deleted file mode 100644 index 53c4d69..0000000 --- a/src/main/java/dev/spiritstudios/hollow/registry/HollowBlockRegistrar.java +++ /dev/null @@ -1,245 +0,0 @@ -package dev.spiritstudios.hollow.registry; - -import dev.spiritstudios.hollow.block.*; -import dev.spiritstudios.specter.api.registry.registration.BlockRegistrar; -import net.minecraft.block.*; -import net.minecraft.block.enums.DoubleBlockHalf; -import net.minecraft.block.enums.NoteBlockInstrument; -import net.minecraft.block.piston.PistonBehavior; -import net.minecraft.entity.effect.StatusEffects; -import net.minecraft.item.BlockItem; -import net.minecraft.item.Item; -import net.minecraft.registry.Registries; -import net.minecraft.registry.Registry; -import net.minecraft.sound.BlockSoundGroup; -import net.minecraft.util.Identifier; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.shape.VoxelShape; -import net.minecraft.world.BlockView; - -@SuppressWarnings("unused") -public class HollowBlockRegistrar implements BlockRegistrar { - public static final HollowLogBlock STRIPPED_OAK_HOLLOW_LOG = new HollowLogBlock(AbstractBlock.Settings.copy(Blocks.STRIPPED_OAK_LOG), "stripped_oak_log", "stripped_oak_log", "stripped_oak_log_top"); - public static final HollowLogBlock OAK_HOLLOW_LOG = new HollowLogBlock(AbstractBlock.Settings.copy(Blocks.OAK_LOG), "oak_log", "stripped_oak_log", "oak_log_top"); - - public static final HollowLogBlock STRIPPED_SPRUCE_HOLLOW_LOG = new HollowLogBlock(AbstractBlock.Settings.copy(Blocks.STRIPPED_SPRUCE_LOG), "stripped_spruce_log", "stripped_spruce_log", "stripped_spruce_log_top"); - public static final HollowLogBlock SPRUCE_HOLLOW_LOG = new HollowLogBlock(AbstractBlock.Settings.copy(Blocks.SPRUCE_LOG), "spruce_log", "stripped_spruce_log", "spruce_log_top"); - - public static final HollowLogBlock STRIPPED_BIRCH_HOLLOW_LOG = new HollowLogBlock(AbstractBlock.Settings.copy(Blocks.STRIPPED_BIRCH_LOG), "stripped_birch_log", "stripped_birch_log", "stripped_birch_log_top"); - public static final HollowLogBlock BIRCH_HOLLOW_LOG = new HollowLogBlock(AbstractBlock.Settings.copy(Blocks.BIRCH_LOG), "birch_log", "stripped_birch_log", "birch_log_top"); - - public static final HollowLogBlock STRIPPED_JUNGLE_HOLLOW_LOG = new HollowLogBlock(AbstractBlock.Settings.copy(Blocks.STRIPPED_JUNGLE_LOG), "stripped_jungle_log", "stripped_jungle_log", "stripped_jungle_log_top"); - public static final HollowLogBlock JUNGLE_HOLLOW_LOG = new HollowLogBlock(AbstractBlock.Settings.copy(Blocks.JUNGLE_LOG), "jungle_log", "stripped_jungle_log", "jungle_log_top"); - - public static final HollowLogBlock STRIPPED_ACACIA_HOLLOW_LOG = new HollowLogBlock(AbstractBlock.Settings.copy(Blocks.STRIPPED_ACACIA_LOG), "stripped_acacia_log", "stripped_acacia_log", "stripped_acacia_log_top"); - public static final HollowLogBlock ACACIA_HOLLOW_LOG = new HollowLogBlock(AbstractBlock.Settings.copy(Blocks.ACACIA_LOG), "acacia_log", "stripped_acacia_log", "acacia_log_top"); - - public static final HollowLogBlock STRIPPED_DARK_OAK_HOLLOW_LOG = new HollowLogBlock(AbstractBlock.Settings.copy(Blocks.STRIPPED_DARK_OAK_LOG), "stripped_dark_oak_log", "stripped_dark_oak_log", "stripped_dark_oak_log_top"); - public static final HollowLogBlock DARK_OAK_HOLLOW_LOG = new HollowLogBlock(AbstractBlock.Settings.copy(Blocks.DARK_OAK_LOG), "dark_oak_log", "stripped_dark_oak_log", "dark_oak_log_top"); - - public static final HollowLogBlock STRIPPED_CRIMSON_HOLLOW_STEM = new HollowLogBlock(AbstractBlock.Settings.copy(Blocks.STRIPPED_CRIMSON_STEM), "stripped_crimson_stem", "stripped_crimson_stem", "stripped_crimson_stem_top"); - public static final HollowLogBlock CRIMSON_HOLLOW_STEM = new HollowLogBlock(AbstractBlock.Settings.copy(Blocks.CRIMSON_STEM), "crimson_stem", "stripped_crimson_stem", "crimson_stem_top"); - - public static final HollowLogBlock STRIPPED_WARPED_HOLLOW_STEM = new HollowLogBlock(AbstractBlock.Settings.copy(Blocks.STRIPPED_WARPED_STEM), "stripped_warped_stem", "stripped_warped_stem", "stripped_warped_stem_top"); - public static final HollowLogBlock WARPED_HOLLOW_STEM = new HollowLogBlock(AbstractBlock.Settings.copy(Blocks.WARPED_STEM), "warped_stem", "stripped_warped_stem", "warped_stem_top"); - - public static final HollowLogBlock STRIPPED_MANGROVE_HOLLOW_LOG = new HollowLogBlock(AbstractBlock.Settings.copy(Blocks.STRIPPED_MANGROVE_LOG), "stripped_mangrove_log", "stripped_mangrove_log", "stripped_mangrove_log_top"); - public static final HollowLogBlock MANGROVE_HOLLOW_LOG = new HollowLogBlock(AbstractBlock.Settings.copy(Blocks.MANGROVE_LOG), "mangrove_log", "stripped_mangrove_log", "mangrove_log_top"); - - public static final HollowLogBlock STRIPPED_CHERRY_HOLLOW_LOG = new HollowLogBlock(AbstractBlock.Settings.copy(Blocks.STRIPPED_CHERRY_LOG), "stripped_cherry_log", "stripped_cherry_log", "stripped_cherry_log_top"); - public static final HollowLogBlock CHERRY_HOLLOW_LOG = new HollowLogBlock(AbstractBlock.Settings.copy(Blocks.CHERRY_LOG), "cherry_log", "stripped_cherry_log", "cherry_log_top"); - - public static final EchoingPotBlock ECHOING_POT = new EchoingPotBlock( - AbstractBlock.Settings.create() - .mapColor(MapColor.DEEPSLATE_GRAY) - .strength(3.0F, 6.0F) - .sounds(BlockSoundGroup.POLISHED_DEEPSLATE) - ); - - public static final FlowerBlock PAEONIA = new FlowerBlock( - StatusEffects.GLOWING, - 5, - AbstractBlock.Settings.create() - .mapColor(MapColor.DARK_GREEN) - .noCollision() - .breakInstantly() - .sounds(BlockSoundGroup.GRASS) - .offset(AbstractBlock.OffsetType.XZ) - .pistonBehavior(PistonBehavior.DESTROY) - ); - - public static final FlowerBlock ROOTED_ORCHID = new FlowerBlock( - StatusEffects.SATURATION, - 0.35F, - AbstractBlock.Settings.create() - .mapColor(MapColor.DARK_GREEN) - .noCollision() - .breakInstantly() - .sounds(BlockSoundGroup.GRASS) - .offset(AbstractBlock.OffsetType.XZ) - .pistonBehavior(PistonBehavior.DESTROY) - ); - - public static final TallFlowerBlock CAMPION = new TallFlowerBlock( - AbstractBlock.Settings.create() - .mapColor(MapColor.DARK_GREEN) - .noCollision() - .breakInstantly() - .sounds(BlockSoundGroup.GRASS) - .offset(AbstractBlock.OffsetType.XZ) - .burnable() - - .pistonBehavior(PistonBehavior.DESTROY) - ) { - @Override - public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { - if (state.get(HALF) == DoubleBlockHalf.UPPER) return Block.createCuboidShape(0.0, 0.0, 0.0, 16.0, 8.0, 16.0); - return super.getOutlineShape(state, world, pos, context); - } - }; - - public static final TwigBlock TWIG = new TwigBlock( - AbstractBlock.Settings.create() - .mapColor(MapColor.OAK_TAN) - .noCollision() - .breakInstantly() - .sounds(BlockSoundGroup.GRASS) - .burnable() - .nonOpaque() - .pistonBehavior(PistonBehavior.DESTROY) - ); - - public static final RootVinesBlock ROOT_VINES = new RootVinesBlock( - AbstractBlock.Settings.create() - .mapColor(MapColor.DIRT_BROWN) - .replaceable() - .noCollision() - .breakInstantly() - .sounds(BlockSoundGroup.HANGING_ROOTS) - .offset(AbstractBlock.OffsetType.XZ) - .burnable() - .pistonBehavior(PistonBehavior.DESTROY) - ); - - public static final CattailBlock CATTAIL = new CattailBlock( - AbstractBlock.Settings.create() - .mapColor(MapColor.WATER_BLUE) - .replaceable() - .noCollision() - .breakInstantly() - .sounds(BlockSoundGroup.WET_GRASS) - .offset(AbstractBlock.OffsetType.XZ) - .pistonBehavior(PistonBehavior.DESTROY) - ); - - - @NoBlockItem - public static final LilyPadBlock LOTUS_LILYPAD = new LilyPadBlock( - AbstractBlock.Settings.create() - .mapColor(MapColor.DARK_GREEN) - .breakInstantly() - .sounds(BlockSoundGroup.LILY_PAD) - .nonOpaque() - .pistonBehavior(PistonBehavior.DESTROY) - ); - - @NoBlockItem - public static final Block GIANT_LILYPAD = new GiantLilyPadBlock( - AbstractBlock.Settings.create() - .mapColor(MapColor.DARK_GREEN) - .breakInstantly() - .sounds(BlockSoundGroup.LILY_PAD) - .nonOpaque() - .pistonBehavior(PistonBehavior.DESTROY) - ); - - public static final PolyporeBlock POLYPORE = new PolyporeBlock( - AbstractBlock.Settings.create() - .mapColor(MapColor.OAK_TAN) - .noCollision() - .breakInstantly() - .sounds(BlockSoundGroup.GRASS) - .pistonBehavior(PistonBehavior.DESTROY) - .solidBlock(Blocks::never) - ); - - public static final Block SCULK_JAW = new SculkJawBlock( - AbstractBlock.Settings.create() - .mapColor(MapColor.BLACK) - .strength(0.2F) - .sounds(BlockSoundGroup.SCULK) - ); - - public static final Block JAR = new JarBlock( - AbstractBlock.Settings.create() - .mapColor(MapColor.OAK_TAN) - .strength(0.2F) - .sounds(BlockSoundGroup.GLASS) - .nonOpaque() - .pistonBehavior(PistonBehavior.DESTROY) - ); - - public static final Block FIREFLY_JAR = new FireflyJarBlock( - AbstractBlock.Settings.create() - .mapColor(MapColor.OAK_TAN) - .strength(0.2F) - .sounds(BlockSoundGroup.GLASS) - .nonOpaque() - .pistonBehavior(PistonBehavior.DESTROY) - .luminance(state -> 15) - ); - - public static final Block STONE_CHEST = new StoneChestBlock( - AbstractBlock.Settings.create() - .mapColor(MapColor.DEEPSLATE_GRAY) - .requiresTool() - .instrument(NoteBlockInstrument.BASEDRUM) - .strength(6.0F, 6.0F) - .sounds(BlockSoundGroup.DEEPSLATE) - ); - - public static final Block STONE_CHEST_LID = new StoneChestLidBlock( - AbstractBlock.Settings.create() - .mapColor(MapColor.DEEPSLATE_GRAY) - .requiresTool() - .instrument(NoteBlockInstrument.BASEDRUM) - .strength(3.0F, 6.0F) - .sounds(BlockSoundGroup.DEEPSLATE) - ); - - public static final Block COPPER_PILLAR = new OxidizablePillarBlock( - Oxidizable.OxidationLevel.UNAFFECTED, - AbstractBlock.Settings.create() - .mapColor(MapColor.ORANGE) - .requiresTool() - .strength(3.0F, 6.0F) - .luminance(state -> 15) - .sounds(BlockSoundGroup.COPPER) - ); - - public static final Block EXPOSED_COPPER_PILLAR = new OxidizablePillarBlock( - Oxidizable.OxidationLevel.EXPOSED, - AbstractBlock.Settings.copy(COPPER_PILLAR).mapColor(MapColor.TERRACOTTA_LIGHT_GRAY) - ); - - public static final Block WEATHERED_COPPER_PILLAR = new OxidizablePillarBlock( - Oxidizable.OxidationLevel.WEATHERED, - AbstractBlock.Settings.copy(COPPER_PILLAR).mapColor(MapColor.DARK_AQUA) - ); - - public static final Block OXIDIZED_COPPER_PILLAR = new OxidizablePillarBlock( - Oxidizable.OxidationLevel.OXIDIZED, - AbstractBlock.Settings.copy(COPPER_PILLAR).mapColor(MapColor.TEAL) - ); - - public static final Block WAXED_COPPER_PILLAR = new PillarBlock(AbstractBlock.Settings.copy(COPPER_PILLAR)); - public static final Block WAXED_EXPOSED_COPPER_PILLAR = new PillarBlock(AbstractBlock.Settings.copy(EXPOSED_COPPER_PILLAR)); - public static final Block WAXED_WEATHERED_COPPER_PILLAR = new PillarBlock(AbstractBlock.Settings.copy(WEATHERED_COPPER_PILLAR)); - public static final Block WAXED_OXIDIZED_COPPER_PILLAR = new PillarBlock(AbstractBlock.Settings.copy(OXIDIZED_COPPER_PILLAR)); - - @NoBlockItem - public static final Block POTTED_PAEONIA = Blocks.createFlowerPotBlock(PAEONIA); - - @NoBlockItem - public static final Block POTTED_ROOTED_ORCHID = Blocks.createFlowerPotBlock(ROOTED_ORCHID); -} diff --git a/src/main/java/dev/spiritstudios/hollow/registry/HollowBlocks.java b/src/main/java/dev/spiritstudios/hollow/registry/HollowBlocks.java new file mode 100644 index 0000000..f226ae2 --- /dev/null +++ b/src/main/java/dev/spiritstudios/hollow/registry/HollowBlocks.java @@ -0,0 +1,213 @@ +package dev.spiritstudios.hollow.registry; + +import dev.spiritstudios.hollow.Hollow; +import dev.spiritstudios.hollow.block.*; +import dev.spiritstudios.specter.api.registry.annotations.NoBlockItem; +import net.minecraft.block.*; +import net.minecraft.block.enums.NoteBlockInstrument; +import net.minecraft.block.piston.PistonBehavior; +import net.minecraft.entity.effect.StatusEffects; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.registry.tag.TagKey; +import net.minecraft.sound.BlockSoundGroup; + +@SuppressWarnings("unused") +public final class HollowBlocks { + // region Hollow logs + public static final HollowLogBlock OAK_HOLLOW_LOG = HollowLogBlock.of(Blocks.OAK_LOG); + public static final HollowLogBlock STRIPPED_OAK_HOLLOW_LOG = HollowLogBlock.ofStripped(Blocks.STRIPPED_OAK_LOG); + + public static final HollowLogBlock SPRUCE_HOLLOW_LOG = HollowLogBlock.of(Blocks.SPRUCE_LOG); + public static final HollowLogBlock STRIPPED_SPRUCE_HOLLOW_LOG = HollowLogBlock.ofStripped(Blocks.STRIPPED_SPRUCE_LOG); + + public static final HollowLogBlock BIRCH_HOLLOW_LOG = HollowLogBlock.of(Blocks.BIRCH_LOG); + public static final HollowLogBlock STRIPPED_BIRCH_HOLLOW_LOG = HollowLogBlock.ofStripped(Blocks.STRIPPED_BIRCH_LOG); + + public static final HollowLogBlock JUNGLE_HOLLOW_LOG = HollowLogBlock.of(Blocks.JUNGLE_LOG); + public static final HollowLogBlock STRIPPED_JUNGLE_HOLLOW_LOG = HollowLogBlock.ofStripped(Blocks.STRIPPED_JUNGLE_LOG); + + public static final HollowLogBlock ACACIA_HOLLOW_LOG = HollowLogBlock.of(Blocks.ACACIA_LOG); + public static final HollowLogBlock STRIPPED_ACACIA_HOLLOW_LOG = HollowLogBlock.ofStripped(Blocks.STRIPPED_ACACIA_LOG); + + public static final HollowLogBlock DARK_OAK_HOLLOW_LOG = HollowLogBlock.of(Blocks.DARK_OAK_LOG); + public static final HollowLogBlock STRIPPED_DARK_OAK_HOLLOW_LOG = HollowLogBlock.ofStripped(Blocks.STRIPPED_DARK_OAK_LOG); + + public static final HollowLogBlock CRIMSON_HOLLOW_STEM = HollowLogBlock.of(Blocks.CRIMSON_STEM); + public static final HollowLogBlock STRIPPED_CRIMSON_HOLLOW_STEM = HollowLogBlock.ofStripped(Blocks.STRIPPED_CRIMSON_STEM); + + public static final HollowLogBlock WARPED_HOLLOW_STEM = HollowLogBlock.of(Blocks.WARPED_STEM); + public static final HollowLogBlock STRIPPED_WARPED_HOLLOW_STEM = HollowLogBlock.ofStripped(Blocks.STRIPPED_WARPED_STEM); + + public static final HollowLogBlock MANGROVE_HOLLOW_LOG = HollowLogBlock.of(Blocks.MANGROVE_LOG); + public static final HollowLogBlock STRIPPED_MANGROVE_HOLLOW_LOG = HollowLogBlock.ofStripped(Blocks.STRIPPED_MANGROVE_LOG); + + public static final HollowLogBlock CHERRY_HOLLOW_LOG = HollowLogBlock.of(Blocks.CHERRY_LOG); + public static final HollowLogBlock STRIPPED_CHERRY_HOLLOW_LOG = HollowLogBlock.ofStripped(Blocks.STRIPPED_CHERRY_LOG); + // endregion + + public static final EchoingPotBlock ECHOING_POT = new EchoingPotBlock( + AbstractBlock.Settings.create() + .mapColor(MapColor.DEEPSLATE_GRAY) + .strength(3.0F, 6.0F) + .sounds(BlockSoundGroup.DECORATED_POT) + .pistonBehavior(PistonBehavior.DESTROY) + .nonOpaque() + ); + + public static final FlowerBlock PAEONIA = new FlowerBlock( + StatusEffects.GLOWING, + 5, + AbstractBlock.Settings.copy(Blocks.ALLIUM) + ); + + public static final FlowerBlock ROOTED_ORCHID = new FlowerBlock( + StatusEffects.SATURATION, + 0.35F, + AbstractBlock.Settings.copy(Blocks.BLUE_ORCHID) + ); + + public static final TallFlowerBlock CAMPION = new CampionBlock(AbstractBlock.Settings.copy(Blocks.PEONY)); + + public static final TwigBlock TWIG = new TwigBlock( + AbstractBlock.Settings.create() + .mapColor(MapColor.OAK_TAN) + .noCollision() + .breakInstantly() + .sounds(BlockSoundGroup.GRASS) + .burnable() + .nonOpaque() + .pistonBehavior(PistonBehavior.DESTROY) + ); + + @NoBlockItem + public static final CattailStemBlock CATTAIL_STEM = new CattailStemBlock( + AbstractBlock.Settings.create() + .mapColor(MapColor.WATER_BLUE) + .replaceable() + .noCollision() + .breakInstantly() + .sounds(BlockSoundGroup.WET_GRASS) + .offset(AbstractBlock.OffsetType.XZ) + .pistonBehavior(PistonBehavior.DESTROY) + ); + + public static final CattailBlock CATTAIL = new CattailBlock(AbstractBlock.Settings.copy(CATTAIL_STEM)); + + @NoBlockItem + public static final LilyPadBlock LOTUS_LILYPAD = new LilyPadBlock(AbstractBlock.Settings.copy(Blocks.LILY_PAD)); + + @NoBlockItem + public static final Block GIANT_LILYPAD = new GiantLilyPadBlock(AbstractBlock.Settings.copy(Blocks.LILY_PAD)); + + public static final PolyporeBlock POLYPORE = new PolyporeBlock( + AbstractBlock.Settings.create() + .mapColor(MapColor.OAK_TAN) + .noCollision() + .breakInstantly() + .sounds(BlockSoundGroup.GRASS) + .pistonBehavior(PistonBehavior.DESTROY) + .solidBlock(Blocks::never) + ); + + public static final Block SCULK_JAW = new SculkJawBlock( + AbstractBlock.Settings.copy(Blocks.SCULK) + .velocityMultiplier(0.25F) + .jumpVelocityMultiplier(0.0F) + .strength(3.0F, 3.0F) + .luminance(state -> state.get(SculkJawBlock.ACTIVE) ? 6 : 0) + ); + + public static final Block JAR = new JarBlock( + AbstractBlock.Settings.create() + .mapColor(MapColor.OAK_TAN) + .strength(0.2F) + .sounds(BlockSoundGroup.GLASS) + .nonOpaque() + .pistonBehavior(PistonBehavior.DESTROY) + ); + + public static final Block FIREFLY_JAR = new FireflyJarBlock(AbstractBlock.Settings.copy(JAR) + .luminance(state -> 15)); + + public static final Block STONE_CHEST = new StoneChestBlock( + AbstractBlock.Settings.create() + .mapColor(MapColor.DEEPSLATE_GRAY) + .requiresTool() + .instrument(NoteBlockInstrument.BASEDRUM) + .strength(6.0F, 6.0F) + .sounds(BlockSoundGroup.DEEPSLATE) + ); + + public static final Block STONE_CHEST_LID = new StoneChestLidBlock(AbstractBlock.Settings.copy(STONE_CHEST) + .strength(3.0F, 6.0F)); + + // region Copper Pillar + public static final Block COPPER_PILLAR = new OxidizablePillarBlock( + Oxidizable.OxidationLevel.UNAFFECTED, + AbstractBlock.Settings.create() + .mapColor(MapColor.ORANGE) + .requiresTool() + .strength(3.0F, 6.0F) + .luminance(state -> 15) + .sounds(BlockSoundGroup.COPPER) + ); + + public static final Block EXPOSED_COPPER_PILLAR = new OxidizablePillarBlock( + Oxidizable.OxidationLevel.EXPOSED, + AbstractBlock.Settings.copy(COPPER_PILLAR).mapColor(MapColor.TERRACOTTA_LIGHT_GRAY) + ); + + public static final Block WEATHERED_COPPER_PILLAR = new OxidizablePillarBlock( + Oxidizable.OxidationLevel.WEATHERED, + AbstractBlock.Settings.copy(COPPER_PILLAR).mapColor(MapColor.DARK_AQUA) + ); + + public static final Block OXIDIZED_COPPER_PILLAR = new OxidizablePillarBlock( + Oxidizable.OxidationLevel.OXIDIZED, + AbstractBlock.Settings.copy(COPPER_PILLAR).mapColor(MapColor.TEAL) + ); + + public static final Block WAXED_COPPER_PILLAR = new PillarBlock(AbstractBlock.Settings.copy(COPPER_PILLAR)); + public static final Block WAXED_EXPOSED_COPPER_PILLAR = new PillarBlock(AbstractBlock.Settings.copy(EXPOSED_COPPER_PILLAR)); + public static final Block WAXED_WEATHERED_COPPER_PILLAR = new PillarBlock(AbstractBlock.Settings.copy(WEATHERED_COPPER_PILLAR)); + public static final Block WAXED_OXIDIZED_COPPER_PILLAR = new PillarBlock(AbstractBlock.Settings.copy(OXIDIZED_COPPER_PILLAR)); + // endregion + + @NoBlockItem + public static final Block POTTED_PAEONIA = Blocks.createFlowerPotBlock(PAEONIA); + + @NoBlockItem + public static final Block POTTED_ROOTED_ORCHID = Blocks.createFlowerPotBlock(ROOTED_ORCHID); + + // region Wildflowers +// public static final Block PINK_WILDFLOWER = new FlowerbedBlock(AbstractBlock.Settings.create() +// .mapColor(MapColor.PINK) +// .noCollision() +// .sounds(BlockSoundGroup.PINK_PETALS) +// .pistonBehavior(PistonBehavior.DESTROY)); +// +// public static final Block BLUE_WILDFLOWER = new FlowerbedBlock(AbstractBlock.Settings.create() +// .mapColor(MapColor.TERRACOTTA_BLUE) +// .noCollision() +// .sounds(BlockSoundGroup.PINK_PETALS) +// .pistonBehavior(PistonBehavior.DESTROY)); +// +// public static final Block PURPLE_WILDFLOWER = new FlowerbedBlock(AbstractBlock.Settings.create() +// .mapColor(MapColor.PURPLE) +// .noCollision() +// .sounds(BlockSoundGroup.PINK_PETALS) +// .pistonBehavior(PistonBehavior.DESTROY)); +// +// public static final Block WHITE_WILDFLOWER = new FlowerbedBlock(AbstractBlock.Settings.create() +// .mapColor(MapColor.WHITE_GRAY) +// .noCollision() +// .sounds(BlockSoundGroup.PINK_PETALS) +// .pistonBehavior(PistonBehavior.DESTROY)); + // endregion + + public static final class Tags { + public static final TagKey HOLLOW_LOGS = TagKey.of(RegistryKeys.BLOCK, Hollow.id("hollow_logs")); + + public static final TagKey POLYPORE_PLACEABLE_ON = TagKey.of(RegistryKeys.BLOCK, Hollow.id("polypore_placeable_on")); + } +} diff --git a/src/main/java/dev/spiritstudios/hollow/registry/HollowCriteria.java b/src/main/java/dev/spiritstudios/hollow/registry/HollowCriteria.java new file mode 100644 index 0000000..10a6833 --- /dev/null +++ b/src/main/java/dev/spiritstudios/hollow/registry/HollowCriteria.java @@ -0,0 +1,7 @@ +package dev.spiritstudios.hollow.registry; + +import net.minecraft.advancement.criterion.TickCriterion; + +public final class HollowCriteria { + public static final TickCriterion FROG_POISONED = new TickCriterion(); +} diff --git a/src/main/java/dev/spiritstudios/hollow/registry/HollowDamageTypes.java b/src/main/java/dev/spiritstudios/hollow/registry/HollowDamageTypes.java new file mode 100644 index 0000000..afa7d30 --- /dev/null +++ b/src/main/java/dev/spiritstudios/hollow/registry/HollowDamageTypes.java @@ -0,0 +1,10 @@ +package dev.spiritstudios.hollow.registry; + +import dev.spiritstudios.hollow.Hollow; +import net.minecraft.entity.damage.DamageType; +import net.minecraft.registry.RegistryKey; +import net.minecraft.registry.RegistryKeys; + +public final class HollowDamageTypes { + public static final RegistryKey SCULK_JAW = RegistryKey.of(RegistryKeys.DAMAGE_TYPE, Hollow.id("sculk_jaw")); +} diff --git a/src/main/java/dev/spiritstudios/hollow/registry/HollowDataComponentRegistrar.java b/src/main/java/dev/spiritstudios/hollow/registry/HollowDataComponentRegistrar.java deleted file mode 100644 index cee60f9..0000000 --- a/src/main/java/dev/spiritstudios/hollow/registry/HollowDataComponentRegistrar.java +++ /dev/null @@ -1,80 +0,0 @@ -package dev.spiritstudios.hollow.registry; - -import com.mojang.serialization.Codec; -import com.mojang.serialization.MapCodec; -import dev.spiritstudios.specter.api.registry.registration.MinecraftRegistrar; -import dev.spiritstudios.specter.api.registry.registration.Registrar; -import io.netty.buffer.ByteBuf; -import net.minecraft.component.ComponentType; -import net.minecraft.network.codec.PacketCodec; -import net.minecraft.network.codec.PacketCodecs; -import net.minecraft.registry.Registries; -import net.minecraft.registry.Registry; -import net.minecraft.sound.SoundEvent; -import net.minecraft.util.Identifier; -import net.minecraft.util.Rarity; -import net.minecraft.util.StringIdentifiable; -import net.minecraft.util.function.ValueLists; - -import java.util.Map; -import java.util.function.IntFunction; -import java.util.function.ToIntFunction; - -public class HollowDataComponentRegistrar implements MinecraftRegistrar> { - public static final ComponentType COPPER_INSTRUMENT = ComponentType.builder() - .codec(CopperInstrument.CODEC) - .packetCodec(CopperInstrument.PACKET_CODEC) - .build(); - - public enum CopperInstrument implements StringIdentifiable { - GREAT_SKY_FALLING(0, "great_sky_falling"), - OLD_HYMN_RESTING(1, "old_hymn_resting"), - PURE_WATER_DESIRE(2, "pure_water_desire"), - HUMBLE_FIRE_MEMORY(3, "humble_fire_memory"), - DRY_URGE_ANGER(4, "dry_urge_anger"), - CLEAR_TEMPER_JOURNEY(5, "clear_temper_journey"), - FRESH_NEST_THOUGHT(6, "fresh_nest_thought"), - SECRET_LAKE_TEAR(7, "secret_lake_tear"), - FEARLESS_RIVER_GIFT(8, "fearless_river_gift"), - SWEET_MOON_LOVE(9, "sweet_moon_love"); - - public static final Codec CODEC = StringIdentifiable.createBasicCodec(CopperInstrument::values); - public static final IntFunction ID_TO_VALUE = ValueLists.createIdToValueFunction(CopperInstrument::getIndex, values(), ValueLists.OutOfBoundsHandling.ZERO); - public static final PacketCodec PACKET_CODEC = PacketCodecs.indexed(ID_TO_VALUE, value -> value.index); - - private final String name; - private final int index; - - public final Map soundEvents; - - CopperInstrument(int index, String name) { - this.name = name; - this.index = index; - - this.soundEvents = Map.of( - "call", SoundEvent.of(Identifier.of("hollow", "horn.call.%d".formatted(index))), - "melody", SoundEvent.of(Identifier.of("hollow", "horn.melody.%d".formatted(index))), - "bass", SoundEvent.of(Identifier.of("hollow", "horn.bass.%d".formatted(index))) - ); - } - - @Override - public String asString() { - return this.name; - } - - public int getIndex() { - return this.index; - } - } - - @Override - public Registry> getRegistry() { - return Registries.DATA_COMPONENT_TYPE; - } - - @Override - public Class> getObjectType() { - return Registrar.fixGenerics(ComponentType.class); - } -} diff --git a/src/main/java/dev/spiritstudios/hollow/registry/HollowDataComponentTypes.java b/src/main/java/dev/spiritstudios/hollow/registry/HollowDataComponentTypes.java new file mode 100644 index 0000000..26d07bf --- /dev/null +++ b/src/main/java/dev/spiritstudios/hollow/registry/HollowDataComponentTypes.java @@ -0,0 +1,12 @@ +package dev.spiritstudios.hollow.registry; + +import dev.spiritstudios.hollow.component.CopperInstrument; +import net.minecraft.component.ComponentType; + +public final class HollowDataComponentTypes { + public static final ComponentType COPPER_INSTRUMENT = ComponentType.builder() + .codec(CopperInstrument.CODEC) + .packetCodec(CopperInstrument.PACKET_CODEC) + .cache() + .build(); +} diff --git a/src/main/java/dev/spiritstudios/hollow/registry/HollowEntityTypeRegistrar.java b/src/main/java/dev/spiritstudios/hollow/registry/HollowEntityTypeRegistrar.java deleted file mode 100644 index c43ffb6..0000000 --- a/src/main/java/dev/spiritstudios/hollow/registry/HollowEntityTypeRegistrar.java +++ /dev/null @@ -1,13 +0,0 @@ -package dev.spiritstudios.hollow.registry; - -import dev.spiritstudios.hollow.entity.FireflyEntity; -import dev.spiritstudios.specter.api.registry.registration.EntityTypeRegistrar; -import net.minecraft.entity.EntityType; -import net.minecraft.entity.SpawnGroup; - -@SuppressWarnings("unused") -public class HollowEntityTypeRegistrar implements EntityTypeRegistrar { - public static EntityType FIREFLY = EntityType.Builder - .create(FireflyEntity::new, SpawnGroup.AMBIENT) - .dimensions(0.125F, 0.0625F).maxTrackingRange(8).build(); -} diff --git a/src/main/java/dev/spiritstudios/hollow/registry/HollowEntityTypes.java b/src/main/java/dev/spiritstudios/hollow/registry/HollowEntityTypes.java new file mode 100644 index 0000000..be6dce0 --- /dev/null +++ b/src/main/java/dev/spiritstudios/hollow/registry/HollowEntityTypes.java @@ -0,0 +1,23 @@ +package dev.spiritstudios.hollow.registry; + +import dev.spiritstudios.hollow.Hollow; +import dev.spiritstudios.hollow.entity.FireflyEntity; +import net.minecraft.entity.EntityType; +import net.minecraft.entity.SpawnGroup; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.registry.tag.TagKey; + +@SuppressWarnings("unused") +public final class HollowEntityTypes { + public static final EntityType FIREFLY = EntityType.Builder + .create(FireflyEntity::new, SpawnGroup.AMBIENT) + .dimensions(0.125F, 0.0625F) + .maxTrackingRange(20) + .build(); + + public static final class Tags { + public static final TagKey> IMMUNE_TO_SCULK_JAW = TagKey.of(RegistryKeys.ENTITY_TYPE, Hollow.id("immune_to_sculk_jaw")); + + public static final TagKey> POISONS_FROG = TagKey.of(RegistryKeys.ENTITY_TYPE, Hollow.id("poisons_frog")); + } +} diff --git a/src/main/java/dev/spiritstudios/hollow/registry/HollowFeatureRegistrar.java b/src/main/java/dev/spiritstudios/hollow/registry/HollowFeatureRegistrar.java deleted file mode 100644 index 94cc311..0000000 --- a/src/main/java/dev/spiritstudios/hollow/registry/HollowFeatureRegistrar.java +++ /dev/null @@ -1,29 +0,0 @@ -package dev.spiritstudios.hollow.registry; - -import dev.spiritstudios.hollow.worldgen.CattailFeature; -import dev.spiritstudios.hollow.worldgen.FallenTreeFeature; -import dev.spiritstudios.hollow.worldgen.FallenTreeFeatureConfig; -import dev.spiritstudios.hollow.worldgen.GiantLilypadFeature; -import dev.spiritstudios.specter.api.registry.registration.MinecraftRegistrar; -import dev.spiritstudios.specter.api.registry.registration.Registrar; -import net.minecraft.registry.Registries; -import net.minecraft.registry.Registry; -import net.minecraft.world.gen.feature.DefaultFeatureConfig; -import net.minecraft.world.gen.feature.Feature; - -@SuppressWarnings("unused") -public class HollowFeatureRegistrar implements MinecraftRegistrar> { - @Override - public Registry> getRegistry() { - return Registries.FEATURE; - } - - public static final Feature FALLEN_TREE = new FallenTreeFeature(FallenTreeFeatureConfig.CODEC); - public static final Feature GIANT_LILYPAD = new GiantLilypadFeature(DefaultFeatureConfig.CODEC); - public static final Feature CATTAILS = new CattailFeature(DefaultFeatureConfig.CODEC); - - @Override - public Class> getObjectType() { - return Registrar.fixGenerics(Feature.class); - } -} diff --git a/src/main/java/dev/spiritstudios/hollow/registry/HollowFeatures.java b/src/main/java/dev/spiritstudios/hollow/registry/HollowFeatures.java new file mode 100644 index 0000000..653eb50 --- /dev/null +++ b/src/main/java/dev/spiritstudios/hollow/registry/HollowFeatures.java @@ -0,0 +1,14 @@ +package dev.spiritstudios.hollow.registry; + +import dev.spiritstudios.hollow.worldgen.feature.CattailFeature; +import dev.spiritstudios.hollow.worldgen.feature.FallenTreeFeature; +import dev.spiritstudios.hollow.worldgen.feature.GiantLilypadFeature; +import net.minecraft.world.gen.feature.DefaultFeatureConfig; +import net.minecraft.world.gen.feature.Feature; + +@SuppressWarnings("unused") +public final class HollowFeatures { + public static final Feature FALLEN_TREE = new FallenTreeFeature(); + public static final Feature GIANT_LILYPAD = new GiantLilypadFeature(); + public static final Feature CATTAILS = new CattailFeature(); +} diff --git a/src/main/java/dev/spiritstudios/hollow/registry/HollowFoliagePlacerTypes.java b/src/main/java/dev/spiritstudios/hollow/registry/HollowFoliagePlacerTypes.java new file mode 100644 index 0000000..d8dfe4c --- /dev/null +++ b/src/main/java/dev/spiritstudios/hollow/registry/HollowFoliagePlacerTypes.java @@ -0,0 +1,8 @@ +package dev.spiritstudios.hollow.registry; + +import dev.spiritstudios.hollow.worldgen.foliage.BlobWithHangingFoliagePlacer; +import net.minecraft.world.gen.foliage.FoliagePlacerType; + +public final class HollowFoliagePlacerTypes { + public static final FoliagePlacerType BLOB_WITH_HANGING = new FoliagePlacerType<>(BlobWithHangingFoliagePlacer.CODEC); +} diff --git a/src/main/java/dev/spiritstudios/hollow/registry/HollowItemRegistrar.java b/src/main/java/dev/spiritstudios/hollow/registry/HollowItemRegistrar.java deleted file mode 100644 index 8e8a666..0000000 --- a/src/main/java/dev/spiritstudios/hollow/registry/HollowItemRegistrar.java +++ /dev/null @@ -1,26 +0,0 @@ -package dev.spiritstudios.hollow.registry; - -import dev.spiritstudios.hollow.item.CopperHornItem; -import dev.spiritstudios.hollow.item.GiantLilyPadItem; -import dev.spiritstudios.specter.api.registry.registration.ItemRegistrar; -import net.minecraft.item.Item; -import net.minecraft.item.PlaceableOnWaterItem; -import net.minecraft.item.SpawnEggItem; -import net.minecraft.registry.RegistryKey; -import net.minecraft.registry.RegistryKeys; -import net.minecraft.util.Identifier; -import net.minecraft.util.Rarity; - -import static dev.spiritstudios.hollow.Hollow.MODID; - -@SuppressWarnings("unused") -public class HollowItemRegistrar implements ItemRegistrar { - public static Item FIREFLY_SPAWN_EGG = new SpawnEggItem(HollowEntityTypeRegistrar.FIREFLY, 0x102F4E, 0xCAAF94, new Item.Settings()); - - public static Item LOTUS_LILYPAD = new PlaceableOnWaterItem(HollowBlockRegistrar.LOTUS_LILYPAD, new Item.Settings()); - public static Item GIANT_LILYPAD = new GiantLilyPadItem(HollowBlockRegistrar.GIANT_LILYPAD, new Item.Settings()); - - public static Item MUSIC_DISC_POSTMORTEM = new Item(new Item.Settings().maxCount(1).rarity(Rarity.RARE).jukeboxPlayable(RegistryKey.of(RegistryKeys.JUKEBOX_SONG, Identifier.of(MODID, "postmortem")))); - - public static Item COPPER_HORN = new CopperHornItem(new Item.Settings().maxCount(1)); -} diff --git a/src/main/java/dev/spiritstudios/hollow/registry/HollowItems.java b/src/main/java/dev/spiritstudios/hollow/registry/HollowItems.java new file mode 100644 index 0000000..f5e4d37 --- /dev/null +++ b/src/main/java/dev/spiritstudios/hollow/registry/HollowItems.java @@ -0,0 +1,31 @@ +package dev.spiritstudios.hollow.registry; + +import dev.spiritstudios.hollow.Hollow; +import dev.spiritstudios.hollow.item.CopperHornItem; +import net.minecraft.item.Item; +import net.minecraft.item.PlaceableOnWaterItem; +import net.minecraft.item.SpawnEggItem; +import net.minecraft.registry.RegistryKey; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.util.Rarity; + +@SuppressWarnings("unused") +public final class HollowItems { + public static final Item FIREFLY_SPAWN_EGG = new SpawnEggItem( + HollowEntityTypes.FIREFLY, + 0x102F4E, 0xCAAF94, + new Item.Settings() + ); + + public static final Item LOTUS_LILYPAD = new PlaceableOnWaterItem(HollowBlocks.LOTUS_LILYPAD, new Item.Settings()); + public static final Item GIANT_LILYPAD = new PlaceableOnWaterItem(HollowBlocks.GIANT_LILYPAD, new Item.Settings()); + + public static final Item MUSIC_DISC_POSTMORTEM = new Item( + new Item.Settings() + .maxCount(1) + .rarity(Rarity.RARE) + .jukeboxPlayable(RegistryKey.of(RegistryKeys.JUKEBOX_SONG, Hollow.id("postmortem"))) + ); + + public static final Item COPPER_HORN = new CopperHornItem(new Item.Settings().maxCount(1)); +} diff --git a/src/main/java/dev/spiritstudios/hollow/registry/HollowParticleRegistrar.java b/src/main/java/dev/spiritstudios/hollow/registry/HollowParticleRegistrar.java deleted file mode 100644 index 02203df..0000000 --- a/src/main/java/dev/spiritstudios/hollow/registry/HollowParticleRegistrar.java +++ /dev/null @@ -1,23 +0,0 @@ -package dev.spiritstudios.hollow.registry; - -import dev.spiritstudios.specter.api.registry.registration.MinecraftRegistrar; -import dev.spiritstudios.specter.api.registry.registration.Registrar; -import net.fabricmc.fabric.api.particle.v1.FabricParticleTypes; -import net.minecraft.particle.ParticleType; -import net.minecraft.particle.SimpleParticleType; -import net.minecraft.registry.Registries; -import net.minecraft.registry.Registry; - -public class HollowParticleRegistrar implements MinecraftRegistrar> { - public static final SimpleParticleType FIREFLY_JAR = FabricParticleTypes.simple(); - - @Override - public Registry> getRegistry() { - return Registries.PARTICLE_TYPE; - } - - @Override - public Class> getObjectType() { - return Registrar.fixGenerics(ParticleType.class); - } -} diff --git a/src/main/java/dev/spiritstudios/hollow/registry/HollowParticleTypes.java b/src/main/java/dev/spiritstudios/hollow/registry/HollowParticleTypes.java new file mode 100644 index 0000000..ecc8857 --- /dev/null +++ b/src/main/java/dev/spiritstudios/hollow/registry/HollowParticleTypes.java @@ -0,0 +1,8 @@ +package dev.spiritstudios.hollow.registry; + +import net.fabricmc.fabric.api.particle.v1.FabricParticleTypes; +import net.minecraft.particle.SimpleParticleType; + +public final class HollowParticleTypes { + public static final SimpleParticleType FIREFLY_JAR = FabricParticleTypes.simple(); +} diff --git a/src/main/java/dev/spiritstudios/hollow/registry/HollowSoundEventRegistrar.java b/src/main/java/dev/spiritstudios/hollow/registry/HollowSoundEventRegistrar.java deleted file mode 100644 index 260963c..0000000 --- a/src/main/java/dev/spiritstudios/hollow/registry/HollowSoundEventRegistrar.java +++ /dev/null @@ -1,27 +0,0 @@ -package dev.spiritstudios.hollow.registry; - -import dev.spiritstudios.specter.api.registry.registration.MinecraftRegistrar; -import dev.spiritstudios.specter.api.registry.registration.SoundEventRegistrar; -import net.minecraft.registry.Registries; -import net.minecraft.registry.Registry; -import net.minecraft.sound.SoundEvent; -import net.minecraft.util.Identifier; - -import static dev.spiritstudios.hollow.Hollow.MODID; - -public class HollowSoundEventRegistrar implements SoundEventRegistrar { - @Name("music_disc.postmortem") - public static final SoundEvent MUSIC_DISC_POSTMORTEM = SoundEvent.of(Identifier.of(MODID, "music_disc.postmortem")); - - @Name("music.birch_forest") - public static final SoundEvent MUSIC_BIRCH_FOREST = SoundEvent.of(Identifier.of(MODID, "music.birch_forest")); - - @Name("music.swamp") - public static final SoundEvent MUSIC_SWAMP = SoundEvent.of(Identifier.of(MODID, "music.swamp")); - - @Name("music.deep_dark") - public static final SoundEvent MUSIC_DEEP_DARK = SoundEvent.of(Identifier.of(MODID, "music.deep_dark")); - - @Name("block.sculk_jaw.bite") - public static final SoundEvent SCULK_JAW_BITE = SoundEvent.of(Identifier.of(MODID, "block.sculk_jaw.bite")); -} diff --git a/src/main/java/dev/spiritstudios/hollow/registry/HollowSoundEvents.java b/src/main/java/dev/spiritstudios/hollow/registry/HollowSoundEvents.java new file mode 100644 index 0000000..cfb7fb2 --- /dev/null +++ b/src/main/java/dev/spiritstudios/hollow/registry/HollowSoundEvents.java @@ -0,0 +1,25 @@ +package dev.spiritstudios.hollow.registry; + +import dev.spiritstudios.hollow.Hollow; +import dev.spiritstudios.specter.api.registry.annotations.Name; +import net.minecraft.sound.SoundEvent; + +public final class HollowSoundEvents { + @Name("music_disc.postmortem") + public static final SoundEvent MUSIC_DISC_POSTMORTEM = SoundEvent.of(Hollow.id("music_disc.postmortem")); + + @Name("music.birch_forest") + public static final SoundEvent MUSIC_BIRCH_FOREST = SoundEvent.of(Hollow.id("music.birch_forest")); + + @Name("music.swamp") + public static final SoundEvent MUSIC_SWAMP = SoundEvent.of(Hollow.id("music.swamp")); + + @Name("music.deep_dark") + public static final SoundEvent MUSIC_DEEP_DARK = SoundEvent.of(Hollow.id("music.deep_dark")); + + @Name("block.sculk_jaw.bite") + public static final SoundEvent SCULK_JAW_BITE = SoundEvent.of(Hollow.id("block.sculk_jaw.bite")); + + @Name("block.stone_chest.extract") + public static final SoundEvent STONE_CHEST_EXTRACT = SoundEvent.of(Hollow.id("block.stone_chest.extract")); +} diff --git a/src/main/java/dev/spiritstudios/hollow/registry/HollowTreeDecoratorRegistrar.java b/src/main/java/dev/spiritstudios/hollow/registry/HollowTreeDecoratorRegistrar.java deleted file mode 100644 index f8d115c..0000000 --- a/src/main/java/dev/spiritstudios/hollow/registry/HollowTreeDecoratorRegistrar.java +++ /dev/null @@ -1,27 +0,0 @@ -package dev.spiritstudios.hollow.registry; - -import dev.spiritstudios.hollow.worldgen.BigBranchTreeDecorator; -import dev.spiritstudios.hollow.worldgen.BranchTreeDecorator; -import dev.spiritstudios.hollow.worldgen.PolyporeTreeDecorator; -import dev.spiritstudios.specter.api.registry.registration.MinecraftRegistrar; -import dev.spiritstudios.specter.api.registry.registration.Registrar; -import net.minecraft.registry.Registries; -import net.minecraft.registry.Registry; -import net.minecraft.world.gen.treedecorator.TreeDecoratorType; - -@SuppressWarnings("unused") -public class HollowTreeDecoratorRegistrar implements MinecraftRegistrar> { - @Override - public Registry> getRegistry() { - return Registries.TREE_DECORATOR_TYPE; - } - - public static final TreeDecoratorType BRANCH_TREE_DECORATOR = new TreeDecoratorType<>(BranchTreeDecorator.CODEC); - public static final TreeDecoratorType POLYPORE_TREE_DECORATOR = new TreeDecoratorType<>(PolyporeTreeDecorator.CODEC); - public static final TreeDecoratorType BIG_BRANCH_TREE_DECORATOR = new TreeDecoratorType<>(BigBranchTreeDecorator.CODEC); - - @Override - public Class> getObjectType() { - return Registrar.fixGenerics(TreeDecoratorType.class); - } -} diff --git a/src/main/java/dev/spiritstudios/hollow/registry/HollowTreeDecoratorTypes.java b/src/main/java/dev/spiritstudios/hollow/registry/HollowTreeDecoratorTypes.java new file mode 100644 index 0000000..e293ab5 --- /dev/null +++ b/src/main/java/dev/spiritstudios/hollow/registry/HollowTreeDecoratorTypes.java @@ -0,0 +1,13 @@ +package dev.spiritstudios.hollow.registry; + +import dev.spiritstudios.hollow.worldgen.decorator.BigBranchTreeDecorator; +import dev.spiritstudios.hollow.worldgen.decorator.BranchTreeDecorator; +import dev.spiritstudios.hollow.worldgen.decorator.PolyporeTreeDecorator; +import net.minecraft.world.gen.treedecorator.TreeDecoratorType; + +@SuppressWarnings("unused") +public final class HollowTreeDecoratorTypes { + public static final TreeDecoratorType BRANCH_TREE_DECORATOR = new TreeDecoratorType<>(BranchTreeDecorator.CODEC); + public static final TreeDecoratorType POLYPORE_TREE_DECORATOR = new TreeDecoratorType<>(PolyporeTreeDecorator.CODEC); + public static final TreeDecoratorType BIG_BRANCH_TREE_DECORATOR = new TreeDecoratorType<>(BigBranchTreeDecorator.CODEC); +} diff --git a/src/main/java/dev/spiritstudios/hollow/worldgen/FallenTreeFeature.java b/src/main/java/dev/spiritstudios/hollow/worldgen/FallenTreeFeature.java deleted file mode 100644 index 6d45ae6..0000000 --- a/src/main/java/dev/spiritstudios/hollow/worldgen/FallenTreeFeature.java +++ /dev/null @@ -1,75 +0,0 @@ -package dev.spiritstudios.hollow.worldgen; - -import com.mojang.serialization.Codec; -import dev.spiritstudios.hollow.block.HollowLogBlock; -import dev.spiritstudios.hollow.block.PolyporeBlock; -import dev.spiritstudios.hollow.registry.HollowBlockRegistrar; -import dev.spiritstudios.specter.api.core.exception.UnreachableException; -import net.minecraft.block.Block; -import net.minecraft.block.BlockState; -import net.minecraft.block.Blocks; -import net.minecraft.state.property.Properties; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Direction; -import net.minecraft.util.math.random.Random; -import net.minecraft.world.Heightmap; -import net.minecraft.world.StructureWorldAccess; -import net.minecraft.world.gen.feature.Feature; -import net.minecraft.world.gen.feature.util.FeatureContext; - -public class FallenTreeFeature extends Feature { - public FallenTreeFeature(Codec configCodec) { - super(configCodec); - } - - @Override - public boolean generate(FeatureContext context) { - BlockPos origin = context.getOrigin(); - Random random = context.getRandom(); - BlockState state = context.getConfig().stateProvider().get(random, origin); - StructureWorldAccess world = context.getWorld(); - - int size = random.nextBetween(3, 5); - Direction.Axis axis = random.nextBoolean() ? Direction.Axis.X : Direction.Axis.Z; - state = state.withIfExists(Properties.AXIS, axis); - - origin = world.getTopPosition(Heightmap.Type.MOTION_BLOCKING, origin); - - for (int i = 0; i < size; i++) { - BlockPos pos = origin.offset(axis, i); - if ((!world.isAir(pos) && !world.getBlockState(pos).isReplaceable()) || !world.getBlockState(pos.down()).isSolidBlock(world, pos.down())) - return false; - } - - for (int i = 0; i < size; i++) { - BlockPos pos = origin.offset(axis, i); - world.setBlockState(pos, state, Block.NOTIFY_LISTENERS); - - if (world.isAir(pos.up()) && random.nextInt(2) == 0 && context.getConfig().mossy()) { - world.setBlockState(pos.up(), Blocks.MOSS_CARPET.getDefaultState(), 2); - world.setBlockState(pos, state.with(HollowLogBlock.MOSSY, true), 2); - } - - Direction direction = switch (axis) { - case X -> random.nextBoolean() ? Direction.NORTH : Direction.SOUTH; - case Z -> random.nextBoolean() ? Direction.EAST : Direction.WEST; - default -> throw new UnreachableException(); - }; - - if (!context.getConfig().polypore() || random.nextInt(2) != 0) continue; - - BlockPos polyporePos = pos.offset(direction); - if (!world.isAir(polyporePos)) continue; - - world.setBlockState( - polyporePos, - HollowBlockRegistrar.POLYPORE.getDefaultState() - .with(Properties.HORIZONTAL_FACING, direction) - .with(PolyporeBlock.POLYPORE_AMOUNT, random.nextBetween(1, 3)), - Block.NOTIFY_LISTENERS - ); - } - - return true; - } -} diff --git a/src/main/java/dev/spiritstudios/hollow/worldgen/FallenTreeFeatureConfig.java b/src/main/java/dev/spiritstudios/hollow/worldgen/FallenTreeFeatureConfig.java deleted file mode 100644 index d73050f..0000000 --- a/src/main/java/dev/spiritstudios/hollow/worldgen/FallenTreeFeatureConfig.java +++ /dev/null @@ -1,14 +0,0 @@ -package dev.spiritstudios.hollow.worldgen; - -import com.mojang.serialization.Codec; -import com.mojang.serialization.codecs.RecordCodecBuilder; -import net.minecraft.world.gen.feature.FeatureConfig; -import net.minecraft.world.gen.stateprovider.BlockStateProvider; - -public record FallenTreeFeatureConfig(BlockStateProvider stateProvider, boolean polypore, boolean mossy) implements FeatureConfig { - public static final Codec CODEC = RecordCodecBuilder.create(instance -> instance.group( - BlockStateProvider.TYPE_CODEC.fieldOf("state_provider").forGetter(config -> config.stateProvider), - Codec.BOOL.fieldOf("polypore").orElse(false).forGetter(config -> config.polypore), - Codec.BOOL.fieldOf("mossy").orElse(false).forGetter(config -> config.mossy) - ).apply(instance, FallenTreeFeatureConfig::new)); -} diff --git a/src/main/java/dev/spiritstudios/hollow/worldgen/HollowBiomeModifications.java b/src/main/java/dev/spiritstudios/hollow/worldgen/HollowBiomeModifications.java index d71cabf..f8f35d9 100644 --- a/src/main/java/dev/spiritstudios/hollow/worldgen/HollowBiomeModifications.java +++ b/src/main/java/dev/spiritstudios/hollow/worldgen/HollowBiomeModifications.java @@ -3,154 +3,103 @@ import dev.spiritstudios.hollow.Hollow; import dev.spiritstudios.hollow.HollowConfig; import dev.spiritstudios.hollow.entity.FireflyEntity; -import dev.spiritstudios.hollow.registry.HollowEntityTypeRegistrar; -import dev.spiritstudios.hollow.registry.HollowSoundEventRegistrar; -import net.fabricmc.fabric.api.biome.v1.BiomeModificationContext; -import net.fabricmc.fabric.api.biome.v1.BiomeModifications; -import net.fabricmc.fabric.api.biome.v1.BiomeSelectors; -import net.fabricmc.fabric.api.biome.v1.ModificationPhase; +import dev.spiritstudios.hollow.registry.HollowEntityTypes; +import dev.spiritstudios.hollow.registry.HollowSoundEvents; +import dev.spiritstudios.hollow.worldgen.feature.HollowPlacedFeatures; +import net.fabricmc.fabric.api.biome.v1.*; import net.minecraft.entity.SpawnGroup; import net.minecraft.entity.SpawnRestriction; import net.minecraft.registry.Registries; -import net.minecraft.registry.RegistryKey; -import net.minecraft.registry.RegistryKeys; import net.minecraft.sound.MusicSound; -import net.minecraft.util.Identifier; import net.minecraft.world.Heightmap; import net.minecraft.world.biome.BiomeKeys; import net.minecraft.world.gen.GenerationStep; -import net.minecraft.world.gen.feature.PlacedFeature; import net.minecraft.world.gen.feature.VegetationPlacedFeatures; +import java.util.function.Predicate; + public class HollowBiomeModifications { public static void init() { - BiomeModifications.addSpawn(BiomeSelectors.includeByKey( - BiomeKeys.SWAMP, - BiomeKeys.MANGROVE_SWAMP - ), SpawnGroup.AMBIENT, HollowEntityTypeRegistrar.FIREFLY, 5, 10, 15); - SpawnRestriction.register(HollowEntityTypeRegistrar.FIREFLY, SpawnRestriction.getLocation(HollowEntityTypeRegistrar.FIREFLY), Heightmap.Type.WORLD_SURFACE, FireflyEntity::canSpawn); + Predicate birch = BiomeSelectors.includeByKey( + BiomeKeys.BIRCH_FOREST, + BiomeKeys.OLD_GROWTH_BIRCH_FOREST + ); - BiomeModifications.create(Identifier.of(Hollow.MODID, "better_swamps_replace")).add(ModificationPhase.REPLACEMENTS, BiomeSelectors.includeByKey( + Predicate swamps = BiomeSelectors.includeByKey( BiomeKeys.SWAMP, BiomeKeys.MANGROVE_SWAMP - ), context -> { - BiomeModificationContext.GenerationSettingsContext generationSettings = context.getGenerationSettings(); - - if (generationSettings.removeFeature(VegetationPlacedFeatures.PATCH_WATERLILY)) - generationSettings.addFeature(GenerationStep.Feature.VEGETAL_DECORATION, getPlacedFeature("patch_waterlily")); - }); + ); - BiomeModifications.create(Identifier.of(Hollow.MODID, "better_swamp_replace")).add(ModificationPhase.REPLACEMENTS, BiomeSelectors.includeByKey( - BiomeKeys.SWAMP - ), context -> { - BiomeModificationContext.GenerationSettingsContext generationSettings = context.getGenerationSettings(); + BiomeModifications.addSpawn( + swamps, + SpawnGroup.AMBIENT, + HollowEntityTypes.FIREFLY, + 5, + 10, 15 + ); - if (generationSettings.removeFeature(VegetationPlacedFeatures.TREES_SWAMP)) - generationSettings.addFeature(GenerationStep.Feature.VEGETAL_DECORATION, getPlacedFeature("trees_swamp")); + SpawnRestriction.register(HollowEntityTypes.FIREFLY, SpawnRestriction.getLocation(HollowEntityTypes.FIREFLY), Heightmap.Type.WORLD_SURFACE, FireflyEntity::canSpawn); - if (generationSettings.removeFeature(VegetationPlacedFeatures.FLOWER_SWAMP)) - generationSettings.addFeature(GenerationStep.Feature.VEGETAL_DECORATION, getPlacedFeature("swamp_flowers")); - }); - - BiomeModifications.create(Identifier.of(Hollow.MODID, "better_swamp_add")).add(ModificationPhase.ADDITIONS, BiomeSelectors.includeByKey( - BiomeKeys.SWAMP - ), context -> { + BiomeModifications.create(Hollow.id("hollow_swamp")).add(ModificationPhase.ADDITIONS, BiomeSelectors.includeByKey(BiomeKeys.SWAMP), context -> { BiomeModificationContext.GenerationSettingsContext generationSettings = context.getGenerationSettings(); if (HollowConfig.INSTANCE.music.get()) context.getEffects().setMusic(new MusicSound( - Registries.SOUND_EVENT.getEntry(HollowSoundEventRegistrar.MUSIC_SWAMP), + Registries.SOUND_EVENT.getEntry(HollowSoundEvents.MUSIC_SWAMP), 12000, 24000, false )); - generationSettings.addFeature(GenerationStep.Feature.VEGETAL_DECORATION, getPlacedFeature("fallen_oak")); - generationSettings.addFeature(GenerationStep.Feature.VEGETAL_DECORATION, getPlacedFeature("huge_brown_mushroom")); + generationSettings.addFeature(GenerationStep.Feature.VEGETAL_DECORATION, HollowPlacedFeatures.HUGE_BROWN_MUSHROOM_SWAMP); }); - BiomeModifications.create(Identifier.of(Hollow.MODID, "better_oak_add")).add(ModificationPhase.ADDITIONS, BiomeSelectors.includeByKey( - BiomeKeys.FOREST, - BiomeKeys.FLOWER_FOREST - ), context -> { + BiomeModifications.create(Hollow.id("hollow_swamps")).add(ModificationPhase.ADDITIONS, swamps, context -> { BiomeModificationContext.GenerationSettingsContext generationSettings = context.getGenerationSettings(); - generationSettings.addFeature(GenerationStep.Feature.VEGETAL_DECORATION, getPlacedFeature("fallen_oak")); + generationSettings.addFeature(GenerationStep.Feature.VEGETAL_DECORATION, HollowPlacedFeatures.PATCH_TWIG); + generationSettings.addFeature(GenerationStep.Feature.VEGETAL_DECORATION, HollowPlacedFeatures.PATCH_GIANT_LILYPAD); + generationSettings.addFeature(GenerationStep.Feature.VEGETAL_DECORATION, HollowPlacedFeatures.CATTAILS); }); - BiomeModifications.create(Identifier.of(Hollow.MODID, "better_swamps_add")).add(ModificationPhase.ADDITIONS, BiomeSelectors.includeByKey( - BiomeKeys.SWAMP, - BiomeKeys.MANGROVE_SWAMP - ), context -> { - BiomeModificationContext.GenerationSettingsContext generationSettings = context.getGenerationSettings(); - - generationSettings.addFeature(GenerationStep.Feature.VEGETAL_DECORATION, getPlacedFeature("patch_twig")); - generationSettings.addFeature(GenerationStep.Feature.VEGETAL_DECORATION, getPlacedFeature("patch_giant_lilypad")); - generationSettings.addFeature(GenerationStep.Feature.VEGETAL_DECORATION, getPlacedFeature("cattails")); - }); + BiomeModifications.addFeature( + BiomeSelectors.includeByKey(BiomeKeys.FOREST, BiomeKeys.FLOWER_FOREST, BiomeKeys.SWAMP), + GenerationStep.Feature.VEGETAL_DECORATION, + HollowPlacedFeatures.FALLEN_OAK + ); - BiomeModifications.create(Identifier.of(Hollow.MODID, "better_birch_add")).add(ModificationPhase.ADDITIONS, BiomeSelectors.includeByKey( - BiomeKeys.BIRCH_FOREST, - BiomeKeys.OLD_GROWTH_BIRCH_FOREST - ), context -> { + BiomeModifications.create(Hollow.id("hollow_birch")).add(ModificationPhase.ADDITIONS, birch, context -> { BiomeModificationContext.GenerationSettingsContext generationSettings = context.getGenerationSettings(); - BiomeModificationContext.EffectsContext effects = context.getEffects(); if (HollowConfig.INSTANCE.music.get()) - effects.setMusic(new MusicSound( - Registries.SOUND_EVENT.getEntry(HollowSoundEventRegistrar.MUSIC_BIRCH_FOREST), + context.getEffects().setMusic(new MusicSound( + Registries.SOUND_EVENT.getEntry(HollowSoundEvents.MUSIC_BIRCH_FOREST), 12000, 24000, false )); - effects.setWaterColor(0x43D5EE); - effects.setWaterFogColor(0x41f33); - - generationSettings.addFeature(GenerationStep.Feature.VEGETAL_DECORATION, getPlacedFeature("fallen_birch")); - generationSettings.addFeature(GenerationStep.Feature.VEGETAL_DECORATION, getPlacedFeature("patch_twig")); - }); - - BiomeModifications.create(Identifier.of(Hollow.MODID, "better_birch_replace")).add(ModificationPhase.REPLACEMENTS, BiomeSelectors.includeByKey( - BiomeKeys.BIRCH_FOREST, - BiomeKeys.OLD_GROWTH_BIRCH_FOREST - ), context -> { + generationSettings.addFeature(GenerationStep.Feature.VEGETAL_DECORATION, HollowPlacedFeatures.PATCH_TWIG); + generationSettings.addFeature(GenerationStep.Feature.VEGETAL_DECORATION, HollowPlacedFeatures.PATCH_TALL_GRASS_BIRCH); + generationSettings.addFeature(GenerationStep.Feature.VEGETAL_DECORATION, HollowPlacedFeatures.PATCH_CAMPION); + generationSettings.addFeature(GenerationStep.Feature.VEGETAL_DECORATION, HollowPlacedFeatures.FALLEN_BIRCH); + }).add(ModificationPhase.REPLACEMENTS, birch, context -> { BiomeModificationContext.GenerationSettingsContext generationSettings = context.getGenerationSettings(); - if (generationSettings.removeFeature(VegetationPlacedFeatures.TREES_BIRCH)) - generationSettings.addFeature(GenerationStep.Feature.VEGETAL_DECORATION, getPlacedFeature("trees_birch")); - if (generationSettings.removeFeature(VegetationPlacedFeatures.BIRCH_TALL)) - generationSettings.addFeature(GenerationStep.Feature.VEGETAL_DECORATION, getPlacedFeature("birch_tall")); + if (generationSettings.removeFeature(VegetationPlacedFeatures.PATCH_GRASS_FOREST)) + generationSettings.addFeature(GenerationStep.Feature.VEGETAL_DECORATION, HollowPlacedFeatures.PATCH_GRASS_BIRCH); + }).add(ModificationPhase.REMOVALS, birch, context -> + context.getGenerationSettings().removeFeature(VegetationPlacedFeatures.PATCH_PUMPKIN)); - if (generationSettings.removeFeature(VegetationPlacedFeatures.FLOWER_DEFAULT) && generationSettings.removeFeature(VegetationPlacedFeatures.FOREST_FLOWERS)) { - generationSettings.addFeature(GenerationStep.Feature.VEGETAL_DECORATION, getPlacedFeature("patch_lilac")); - generationSettings.addFeature(GenerationStep.Feature.VEGETAL_DECORATION, getPlacedFeature("patch_campion")); - generationSettings.addFeature(GenerationStep.Feature.VEGETAL_DECORATION, getPlacedFeature("birch_forest_flowers")); - } - }); - - BiomeModifications.create(Identifier.of(Hollow.MODID, "better_birch_remove")).add(ModificationPhase.REMOVALS, BiomeSelectors.includeByKey( - BiomeKeys.BIRCH_FOREST, - BiomeKeys.OLD_GROWTH_BIRCH_FOREST - ), context -> { - BiomeModificationContext.GenerationSettingsContext generationSettings = context.getGenerationSettings(); - - generationSettings.removeFeature(VegetationPlacedFeatures.PATCH_PUMPKIN); - }); - - BiomeModifications.create(Identifier.of(Hollow.MODID, "deep_dark_music")).add(ModificationPhase.ADDITIONS, BiomeSelectors.includeByKey( + BiomeModifications.create(Hollow.id("deep_dark_music")).add(ModificationPhase.ADDITIONS, BiomeSelectors.includeByKey( BiomeKeys.DEEP_DARK ), context -> { if (HollowConfig.INSTANCE.music.get()) context.getEffects().setMusic(new MusicSound( - Registries.SOUND_EVENT.getEntry(HollowSoundEventRegistrar.MUSIC_DEEP_DARK), + Registries.SOUND_EVENT.getEntry(HollowSoundEvents.MUSIC_DEEP_DARK), 12000, 24000, false )); }); } - - public static RegistryKey getPlacedFeature(String id) { - return RegistryKey.of(RegistryKeys.PLACED_FEATURE, Identifier.of(Hollow.MODID, id)); - } } diff --git a/src/main/java/dev/spiritstudios/hollow/worldgen/BigBranchTreeDecorator.java b/src/main/java/dev/spiritstudios/hollow/worldgen/decorator/BigBranchTreeDecorator.java similarity index 93% rename from src/main/java/dev/spiritstudios/hollow/worldgen/BigBranchTreeDecorator.java rename to src/main/java/dev/spiritstudios/hollow/worldgen/decorator/BigBranchTreeDecorator.java index c7b8934..e274002 100644 --- a/src/main/java/dev/spiritstudios/hollow/worldgen/BigBranchTreeDecorator.java +++ b/src/main/java/dev/spiritstudios/hollow/worldgen/decorator/BigBranchTreeDecorator.java @@ -1,9 +1,9 @@ -package dev.spiritstudios.hollow.worldgen; +package dev.spiritstudios.hollow.worldgen.decorator; import com.mojang.serialization.Codec; import com.mojang.serialization.MapCodec; import com.mojang.serialization.codecs.RecordCodecBuilder; -import dev.spiritstudios.hollow.registry.HollowTreeDecoratorRegistrar; +import dev.spiritstudios.hollow.registry.HollowTreeDecoratorTypes; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import net.minecraft.block.BlockState; import net.minecraft.state.property.Properties; @@ -28,7 +28,7 @@ public BigBranchTreeDecorator(BlockStateProvider stateProvider, float probabilit @Override protected TreeDecoratorType getType() { - return HollowTreeDecoratorRegistrar.BIG_BRANCH_TREE_DECORATOR; + return HollowTreeDecoratorTypes.BIG_BRANCH_TREE_DECORATOR; } @Override diff --git a/src/main/java/dev/spiritstudios/hollow/worldgen/BranchTreeDecorator.java b/src/main/java/dev/spiritstudios/hollow/worldgen/decorator/BranchTreeDecorator.java similarity index 53% rename from src/main/java/dev/spiritstudios/hollow/worldgen/BranchTreeDecorator.java rename to src/main/java/dev/spiritstudios/hollow/worldgen/decorator/BranchTreeDecorator.java index b224892..8e0d675 100644 --- a/src/main/java/dev/spiritstudios/hollow/worldgen/BranchTreeDecorator.java +++ b/src/main/java/dev/spiritstudios/hollow/worldgen/decorator/BranchTreeDecorator.java @@ -1,9 +1,9 @@ -package dev.spiritstudios.hollow.worldgen; +package dev.spiritstudios.hollow.worldgen.decorator; import com.mojang.serialization.Codec; import com.mojang.serialization.MapCodec; import com.mojang.serialization.codecs.RecordCodecBuilder; -import dev.spiritstudios.hollow.registry.HollowTreeDecoratorRegistrar; +import dev.spiritstudios.hollow.registry.HollowTreeDecoratorTypes; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import net.minecraft.block.BeehiveBlock; import net.minecraft.block.BlockState; @@ -18,23 +18,29 @@ import net.minecraft.world.gen.treedecorator.TreeDecorator; import net.minecraft.world.gen.treedecorator.TreeDecoratorType; +import java.util.HashSet; +import java.util.Set; + public class BranchTreeDecorator extends TreeDecorator { public static final MapCodec CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group( BlockStateProvider.TYPE_CODEC.fieldOf("provider").forGetter(decorator -> decorator.stateProvider), - Codec.floatRange(0.0F, 1.0F).fieldOf("probability").forGetter(decorator -> decorator.probability) + Codec.floatRange(0.0F, 1.0F).fieldOf("probability").forGetter(decorator -> decorator.probability), + Codec.INT.fieldOf("max_amount").forGetter(decorator -> decorator.maxAmount) ).apply(instance, BranchTreeDecorator::new)); - - public BranchTreeDecorator(BlockStateProvider stateProvider, float probability) { + + public BranchTreeDecorator(BlockStateProvider stateProvider, float probability, int maxAmount) { this.stateProvider = stateProvider; this.probability = probability; + this.maxAmount = maxAmount; } - - public final BlockStateProvider stateProvider; - public final float probability; - + + private final BlockStateProvider stateProvider; + private final float probability; + private final int maxAmount; + @Override protected TreeDecoratorType getType() { - return HollowTreeDecoratorRegistrar.BRANCH_TREE_DECORATOR; + return HollowTreeDecoratorTypes.BRANCH_TREE_DECORATOR; } @Override @@ -44,37 +50,48 @@ public void generate(Generator generator) { if (random.nextFloat() > probability) return; + int amount = 0; + + Set branches = new HashSet<>(); for (BlockPos pos : logs) { + if (amount >= maxAmount) break; + if (pos.getY() < (logs.getFirst().getY() + logs.getLast().getY()) / 2) continue; - + Direction direction = Direction.fromHorizontal(random.nextInt(4)); BlockPos branch = pos.offset(direction); + if (branches.contains(pos.getY() + 1) || branches.contains(pos.getY() - 1)) continue; + if (!generator.isAir(branch)) continue; - + BlockState state = stateProvider.get(random, branch); state = state.withIfExists(Properties.AXIS, direction.getAxis()); generator.replace(branch, state); + branches.add(branch.getY()); + + amount++; - if (random.nextBetween(0, 32) != 0) break; - - BlockPos beeHive = branch.down(); - if (!generator.isAir(beeHive)) continue; - - Direction hiveDirection = direction; - if (random.nextBoolean()) hiveDirection = random.nextBoolean() ? direction.rotateClockwise(Direction.Axis.Y) : direction.rotateCounterclockwise(Direction.Axis.Y); - - generator.replace(beeHive, Blocks.BEE_NEST.getDefaultState().with(BeehiveBlock.FACING, hiveDirection)); - generator.getWorld().getBlockEntity(beeHive, BlockEntityType.BEEHIVE).ifPresent(beehive -> { - int beeCount = 2 + random.nextInt(2); - - for (int i = 0; i < beeCount; i++) { - BeehiveBlockEntity.BeeData beeData = BeehiveBlockEntity.BeeData.create(random.nextInt(599)); - beehive.addBee(beeData); - } - }); - - break; + if (random.nextBetween(0, 32) == 0) generateBeehive(generator, branch, direction, random); } } + + private static void generateBeehive(Generator generator, BlockPos branch, Direction direction, Random random) { + BlockPos beeHive = branch.down(); + if (!generator.isAir(beeHive)) return; + + Direction hiveDirection = direction; + if (random.nextBoolean()) + hiveDirection = random.nextBoolean() ? direction.rotateClockwise(Direction.Axis.Y) : direction.rotateCounterclockwise(Direction.Axis.Y); + + generator.replace(beeHive, Blocks.BEE_NEST.getDefaultState().with(BeehiveBlock.FACING, hiveDirection)); + generator.getWorld().getBlockEntity(beeHive, BlockEntityType.BEEHIVE).ifPresent(beehive -> { + int beeCount = 2 + random.nextInt(2); + + for (int i = 0; i < beeCount; i++) { + BeehiveBlockEntity.BeeData beeData = BeehiveBlockEntity.BeeData.create(random.nextInt(599)); + beehive.addBee(beeData); + } + }); + } } diff --git a/src/main/java/dev/spiritstudios/hollow/worldgen/PolyporeTreeDecorator.java b/src/main/java/dev/spiritstudios/hollow/worldgen/decorator/PolyporeTreeDecorator.java similarity index 88% rename from src/main/java/dev/spiritstudios/hollow/worldgen/PolyporeTreeDecorator.java rename to src/main/java/dev/spiritstudios/hollow/worldgen/decorator/PolyporeTreeDecorator.java index 89b5939..e4dc2a1 100644 --- a/src/main/java/dev/spiritstudios/hollow/worldgen/PolyporeTreeDecorator.java +++ b/src/main/java/dev/spiritstudios/hollow/worldgen/decorator/PolyporeTreeDecorator.java @@ -1,9 +1,8 @@ -package dev.spiritstudios.hollow.worldgen; +package dev.spiritstudios.hollow.worldgen.decorator; import com.mojang.serialization.MapCodec; import dev.spiritstudios.hollow.block.PolyporeBlock; -import dev.spiritstudios.hollow.registry.HollowTreeDecoratorRegistrar; -import it.unimi.dsi.fastutil.objects.ObjectArrayList; +import dev.spiritstudios.hollow.registry.HollowTreeDecoratorTypes; import net.minecraft.block.BlockState; import net.minecraft.state.property.Properties; import net.minecraft.util.math.BlockPos; @@ -28,7 +27,7 @@ public PolyporeTreeDecorator(BlockStateProvider stateProvider) { @Override protected TreeDecoratorType getType() { - return HollowTreeDecoratorRegistrar.POLYPORE_TREE_DECORATOR; + return HollowTreeDecoratorTypes.POLYPORE_TREE_DECORATOR; } @Override diff --git a/src/main/java/dev/spiritstudios/hollow/worldgen/CattailFeature.java b/src/main/java/dev/spiritstudios/hollow/worldgen/feature/CattailFeature.java similarity index 52% rename from src/main/java/dev/spiritstudios/hollow/worldgen/CattailFeature.java rename to src/main/java/dev/spiritstudios/hollow/worldgen/feature/CattailFeature.java index 411c653..b337260 100644 --- a/src/main/java/dev/spiritstudios/hollow/worldgen/CattailFeature.java +++ b/src/main/java/dev/spiritstudios/hollow/worldgen/feature/CattailFeature.java @@ -1,10 +1,10 @@ -package dev.spiritstudios.hollow.worldgen; +package dev.spiritstudios.hollow.worldgen.feature; import com.mojang.serialization.Codec; import dev.spiritstudios.hollow.block.CattailBlock; -import dev.spiritstudios.hollow.registry.HollowBlockRegistrar; +import dev.spiritstudios.hollow.block.CattailStemBlock; +import dev.spiritstudios.hollow.registry.HollowBlocks; import net.minecraft.block.Block; -import net.minecraft.block.Blocks; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.random.Random; import net.minecraft.world.Heightmap; @@ -14,8 +14,8 @@ import net.minecraft.world.gen.feature.util.FeatureContext; public class CattailFeature extends Feature { - public CattailFeature(Codec configCodec) { - super(configCodec); + public CattailFeature() { + super(DefaultFeatureConfig.CODEC); } @Override @@ -25,24 +25,29 @@ public boolean generate(FeatureContext context) { StructureWorldAccess world = context.getWorld(); BlockPos pos = origin.withY(world.getTopY(Heightmap.Type.OCEAN_FLOOR, origin.getX(), origin.getZ())); - if (!world.getBlockState(pos).isOf(Blocks.WATER)) return false; - - world.setBlockState(pos, HollowBlockRegistrar.CATTAIL.getDefaultState(), Block.NOTIFY_LISTENERS); + if (!HollowBlocks.CATTAIL.getDefaultState().canPlaceAt(world, pos)) return false; + if (!world.isWater(pos)) return false; + + world.setBlockState( + pos, + HollowBlocks.CATTAIL_STEM.getDefaultState().with(CattailStemBlock.BOTTOM, true), + Block.NOTIFY_LISTENERS + ); pos = pos.up(); while (world.isWater(pos)) { - world.setBlockState(pos, HollowBlockRegistrar.CATTAIL.getDefaultState().with(CattailBlock.PIECE, CattailBlock.Piece.MIDDLE), Block.NOTIFY_LISTENERS); + world.setBlockState(pos, HollowBlocks.CATTAIL_STEM.getDefaultState(), Block.NOTIFY_LISTENERS); pos = pos.up(); } - int height = random.nextBetween(1, 3); + int height = random.nextBetween(1, 4); for (int i = 0; i < height; i++) { - world.setBlockState(pos, HollowBlockRegistrar.CATTAIL.getDefaultState().with(CattailBlock.PIECE, CattailBlock.Piece.MIDDLE).with(CattailBlock.WATERLOGGED, false), Block.NOTIFY_ALL); + world.setBlockState(pos, HollowBlocks.CATTAIL_STEM.getDefaultState().with(CattailBlock.WATERLOGGED, false), Block.NOTIFY_ALL); pos = pos.up(); } - world.setBlockState(pos, HollowBlockRegistrar.CATTAIL.getDefaultState().with(CattailBlock.PIECE, CattailBlock.Piece.TOP).with(CattailBlock.WATERLOGGED, false), Block.NOTIFY_ALL); + world.setBlockState(pos, HollowBlocks.CATTAIL.getDefaultState().with(CattailBlock.WATERLOGGED, false), Block.NOTIFY_ALL); return true; } diff --git a/src/main/java/dev/spiritstudios/hollow/worldgen/feature/FallenTreeFeature.java b/src/main/java/dev/spiritstudios/hollow/worldgen/feature/FallenTreeFeature.java new file mode 100644 index 0000000..aff4382 --- /dev/null +++ b/src/main/java/dev/spiritstudios/hollow/worldgen/feature/FallenTreeFeature.java @@ -0,0 +1,105 @@ +package dev.spiritstudios.hollow.worldgen.feature; + +import com.mojang.serialization.Codec; +import com.mojang.serialization.codecs.RecordCodecBuilder; +import dev.spiritstudios.hollow.block.HollowLogBlock; +import dev.spiritstudios.hollow.block.PolyporeBlock; +import dev.spiritstudios.hollow.registry.HollowBlocks; +import dev.spiritstudios.specter.api.core.exception.UnreachableException; +import net.fabricmc.fabric.api.tag.convention.v2.ConventionalBlockTags; +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.registry.tag.BlockTags; +import net.minecraft.state.property.Properties; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.util.math.random.Random; +import net.minecraft.world.Heightmap; +import net.minecraft.world.StructureWorldAccess; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.FeatureConfig; +import net.minecraft.world.gen.feature.util.FeatureContext; +import net.minecraft.world.gen.stateprovider.BlockStateProvider; + +public class FallenTreeFeature extends Feature { + public FallenTreeFeature() { + super(Config.CODEC); + } + + @Override + public boolean generate(FeatureContext context) { + BlockPos origin = context.getOrigin(); + StructureWorldAccess world = context.getWorld(); + + origin = world.getTopPosition(Heightmap.Type.MOTION_BLOCKING, origin); + + Random random = context.getRandom(); + BlockState state = context.getConfig().stateProvider().get(random, origin); + Config config = context.getConfig(); + + int size = config.baseHeight + random.nextInt(config.variance); + + Direction.Axis axis = random.nextBoolean() ? Direction.Axis.X : Direction.Axis.Z; + state = state.withIfExists(Properties.AXIS, axis); + + + for (int i = 0; i < size; i++) { + BlockPos pos = origin.offset(axis, i); + if ((!world.isAir(pos) && !world.getBlockState(pos).isReplaceable()) || !world.getBlockState(pos.down()).isSolidBlock(world, pos.down())) + return false; + } + + for (int i = 0; i < size; i++) { + BlockPos pos = origin.offset(axis, i); + world.setBlockState(pos, state, Block.NOTIFY_ALL); + + if (world.isAir(pos.up())) { + BlockState top = config.topBlockProvider().get(random, pos.up()); + world.setBlockState(pos.up(), top, Block.NOTIFY_ALL); + if (top.isOf(Blocks.MOSS_CARPET)) + world.setBlockState(pos, state.withIfExists(HollowLogBlock.MOSSY, true), Block.NOTIFY_ALL); + } + + Direction direction = switch (axis) { + case X -> random.nextBoolean() ? Direction.NORTH : Direction.SOUTH; + case Z -> random.nextBoolean() ? Direction.EAST : Direction.WEST; + default -> throw new UnreachableException(); + }; + + BlockPos sidePos = pos.offset(direction); + BlockState sideState = world.getBlockState(sidePos); + if (!sideState.isAir() && !sideState.isReplaceable()) continue; + if (sideState.isOf(Blocks.TALL_GRASS) || sideState.isIn(BlockTags.TALL_FLOWERS)) continue; + + world.setBlockState( + sidePos, + config.sideBlockProvider.get(random, sidePos) + .withIfExists(Properties.HORIZONTAL_FACING, direction) + .withIfExists(Properties.NORTH, direction == Direction.SOUTH) + .withIfExists(Properties.SHORT, direction == Direction.NORTH) + .withIfExists(Properties.EAST, direction == Direction.WEST) + .withIfExists(Properties.WEST, direction == Direction.EAST), + Block.NOTIFY_ALL + ); + } + + return true; + } + + public record Config( + BlockStateProvider stateProvider, + int baseHeight, + int variance, + BlockStateProvider topBlockProvider, + BlockStateProvider sideBlockProvider + ) implements FeatureConfig { + public static final Codec CODEC = RecordCodecBuilder.create(instance -> instance.group( + BlockStateProvider.TYPE_CODEC.fieldOf("state_provider").forGetter(Config::stateProvider), + Codec.INT.optionalFieldOf("base_height", 3).forGetter(Config::baseHeight), + Codec.INT.optionalFieldOf("variance", 2).forGetter(Config::variance), + BlockStateProvider.TYPE_CODEC.fieldOf("top_block_provider").forGetter(Config::topBlockProvider), + BlockStateProvider.TYPE_CODEC.fieldOf("side_block_provider").forGetter(Config::sideBlockProvider) + ).apply(instance, Config::new)); + } +} diff --git a/src/main/java/dev/spiritstudios/hollow/worldgen/GiantLilypadFeature.java b/src/main/java/dev/spiritstudios/hollow/worldgen/feature/GiantLilypadFeature.java similarity index 75% rename from src/main/java/dev/spiritstudios/hollow/worldgen/GiantLilypadFeature.java rename to src/main/java/dev/spiritstudios/hollow/worldgen/feature/GiantLilypadFeature.java index 31d4162..0cac649 100644 --- a/src/main/java/dev/spiritstudios/hollow/worldgen/GiantLilypadFeature.java +++ b/src/main/java/dev/spiritstudios/hollow/worldgen/feature/GiantLilypadFeature.java @@ -1,8 +1,8 @@ -package dev.spiritstudios.hollow.worldgen; +package dev.spiritstudios.hollow.worldgen.feature; -import com.mojang.serialization.Codec; import dev.spiritstudios.hollow.block.GiantLilyPadBlock; -import dev.spiritstudios.hollow.registry.HollowBlockRegistrar; +import dev.spiritstudios.hollow.registry.HollowBlocks; +import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.util.math.BlockPos; @@ -14,8 +14,8 @@ import net.minecraft.world.gen.feature.util.FeatureContext; public class GiantLilypadFeature extends Feature { - public GiantLilypadFeature(Codec configCodec) { - super(configCodec); + public GiantLilypadFeature() { + super(DefaultFeatureConfig.CODEC); } @Override @@ -33,12 +33,12 @@ public boolean generate(FeatureContext context) { if (!canPlaceAt(world, pos)) return false; Direction facing = Direction.fromHorizontal(random.nextInt(4)); - BlockState lilypadState = HollowBlockRegistrar.GIANT_LILYPAD.getDefaultState().with(GiantLilyPadBlock.FACING, facing); + BlockState lilypadState = HollowBlocks.GIANT_LILYPAD.getDefaultState().with(GiantLilyPadBlock.FACING, facing); - world.setBlockState(pos, lilypadState.with(GiantLilyPadBlock.PIECE, GiantLilyPadBlock.Piece.NORTH_WEST), 11); - world.setBlockState(pos.east(), lilypadState.with(GiantLilyPadBlock.PIECE, GiantLilyPadBlock.Piece.NORTH_EAST), 11); - world.setBlockState(pos.south(), lilypadState.with(GiantLilyPadBlock.PIECE, GiantLilyPadBlock.Piece.SOUTH_WEST), 11); - world.setBlockState(pos.east().south(), lilypadState.with(GiantLilyPadBlock.PIECE, GiantLilyPadBlock.Piece.SOUTH_EAST), 11); + world.setBlockState(pos, lilypadState.with(GiantLilyPadBlock.PIECE, GiantLilyPadBlock.Piece.NORTH_WEST), Block.NOTIFY_ALL_AND_REDRAW); + world.setBlockState(pos.east(), lilypadState.with(GiantLilyPadBlock.PIECE, GiantLilyPadBlock.Piece.NORTH_EAST), Block.NOTIFY_ALL_AND_REDRAW); + world.setBlockState(pos.south(), lilypadState.with(GiantLilyPadBlock.PIECE, GiantLilyPadBlock.Piece.SOUTH_WEST), Block.NOTIFY_ALL_AND_REDRAW); + world.setBlockState(pos.east().south(), lilypadState.with(GiantLilyPadBlock.PIECE, GiantLilyPadBlock.Piece.SOUTH_EAST), Block.NOTIFY_ALL_AND_REDRAW); return true; } diff --git a/src/main/java/dev/spiritstudios/hollow/worldgen/feature/HollowConfiguredFeatures.java b/src/main/java/dev/spiritstudios/hollow/worldgen/feature/HollowConfiguredFeatures.java new file mode 100644 index 0000000..6eebfdf --- /dev/null +++ b/src/main/java/dev/spiritstudios/hollow/worldgen/feature/HollowConfiguredFeatures.java @@ -0,0 +1,132 @@ +package dev.spiritstudios.hollow.worldgen.feature; + +import dev.spiritstudios.hollow.Hollow; +import dev.spiritstudios.hollow.block.PolyporeBlock; +import dev.spiritstudios.hollow.registry.HollowBlocks; +import dev.spiritstudios.hollow.registry.HollowFeatures; +import dev.spiritstudios.hollow.worldgen.foliage.BlobWithHangingFoliagePlacer; +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.registry.Registerable; +import net.minecraft.registry.RegistryKey; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.registry.entry.RegistryEntry; +import net.minecraft.util.Identifier; +import net.minecraft.util.collection.DataPool; +import net.minecraft.util.math.intprovider.ConstantIntProvider; +import net.minecraft.world.gen.feature.*; +import net.minecraft.world.gen.feature.size.TwoLayersFeatureSize; +import net.minecraft.world.gen.stateprovider.BlockStateProvider; +import net.minecraft.world.gen.stateprovider.WeightedBlockStateProvider; +import net.minecraft.world.gen.trunk.StraightTrunkPlacer; + +public final class HollowConfiguredFeatures { + public static final RegistryKey> FALLEN_OAK = of("fallen_oak"); + public static final RegistryKey> FALLEN_BIRCH = of("fallen_birch"); + + public static final RegistryKey> PATCH_TWIG = of("patch_twig"); + public static final RegistryKey> PATCH_CAMPION = of("patch_campion"); + public static final RegistryKey> PATCH_GIANT_LILYPAD = of("patch_giant_lilypad"); + + public static final RegistryKey> CATTAILS = of("cattails"); + + public static void bootstrap(Registerable> featureRegisterable) { + featureRegisterable.register( + FALLEN_OAK, + new ConfiguredFeature<>( + HollowFeatures.FALLEN_TREE, + new FallenTreeFeature.Config( + BlockStateProvider.of(HollowBlocks.OAK_HOLLOW_LOG), + 3, 2, + new WeightedBlockStateProvider(DataPool.builder() + .add(Blocks.AIR.getDefaultState(), 5) + .add(Blocks.MOSS_CARPET.getDefaultState(), 5) + .build()), + new WeightedBlockStateProvider(DataPool.builder() + .add(Blocks.AIR.getDefaultState(), 6) + .add(Blocks.VINE.getDefaultState(), 4) + .build()) + ) + ) + ); + + featureRegisterable.register( + FALLEN_BIRCH, + new ConfiguredFeature<>( + HollowFeatures.FALLEN_TREE, + new FallenTreeFeature.Config( + BlockStateProvider.of(HollowBlocks.BIRCH_HOLLOW_LOG), + 3, 2, + new WeightedBlockStateProvider(DataPool.builder() + .add(Blocks.AIR.getDefaultState(), 5) + .add(Blocks.MOSS_CARPET.getDefaultState(), 5) + .build()), + new WeightedBlockStateProvider(DataPool.builder() + .add(Blocks.AIR.getDefaultState(), 4) + .add(HollowBlocks.POLYPORE.getDefaultState().with(PolyporeBlock.POLYPORE_AMOUNT, 1), 2) + .add(HollowBlocks.POLYPORE.getDefaultState().with(PolyporeBlock.POLYPORE_AMOUNT, 2), 2) + .add(HollowBlocks.POLYPORE.getDefaultState().with(PolyporeBlock.POLYPORE_AMOUNT, 3), 2) + .build()) + ) + ) + ); + + featureRegisterable.register(PATCH_TWIG, createRandomPatch(HollowBlocks.TWIG, 10)); + featureRegisterable.register(PATCH_CAMPION, createRandomPatch(HollowBlocks.CAMPION, 96)); + featureRegisterable.register( + PATCH_GIANT_LILYPAD, + createRandomPatch( + PlacedFeatures.createEntry(HollowFeatures.GIANT_LILYPAD, new DefaultFeatureConfig()), + 10 + ) + ); + + featureRegisterable.register( + CATTAILS, + new ConfiguredFeature<>( + HollowFeatures.CATTAILS, + new DefaultFeatureConfig() + ) + ); + } + + public static RegistryKey> of(String id) { + return RegistryKey.of(RegistryKeys.CONFIGURED_FEATURE, Identifier.of(Hollow.MODID, id)); + } + + public static ConfiguredFeature createRandomPatch(RegistryEntry feature, int tries) { + return new ConfiguredFeature<>( + Feature.RANDOM_PATCH, + ConfiguredFeatures.createRandomPatchFeatureConfig( + tries, + feature + ) + ); + } + + public static ConfiguredFeature createRandomPatch(BlockStateProvider block, int tries) { + return createRandomPatch( + PlacedFeatures.createEntry( + Feature.SIMPLE_BLOCK, + new SimpleBlockFeatureConfig(block) + ), + tries + ); + + } + + private static ConfiguredFeature createRandomPatch(Block block, int tries) { + return createRandomPatch(BlockStateProvider.of(block), tries); + } + + public static TreeFeatureConfig.Builder hangingLeavestreeBuilder(Block log, Block leaves, int baseHeight, int firstRandomHeight, int secondRandomHeight, int radius, float hangingLeavesChance, float hangingLeavesExtensionChance) { + return new TreeFeatureConfig.Builder( + BlockStateProvider.of(log), + new StraightTrunkPlacer(baseHeight, firstRandomHeight, secondRandomHeight), + BlockStateProvider.of(leaves), + new BlobWithHangingFoliagePlacer(ConstantIntProvider.create(radius), ConstantIntProvider.create(0), 3, hangingLeavesChance, hangingLeavesExtensionChance), + new TwoLayersFeatureSize(1, 0, 1) + ); + } +} \ No newline at end of file diff --git a/src/main/java/dev/spiritstudios/hollow/worldgen/feature/HollowPlacedFeatures.java b/src/main/java/dev/spiritstudios/hollow/worldgen/feature/HollowPlacedFeatures.java new file mode 100644 index 0000000..f1bcd74 --- /dev/null +++ b/src/main/java/dev/spiritstudios/hollow/worldgen/feature/HollowPlacedFeatures.java @@ -0,0 +1,133 @@ +package dev.spiritstudios.hollow.worldgen.feature; + +import dev.spiritstudios.hollow.Hollow; +import net.minecraft.registry.*; +import net.minecraft.util.Identifier; +import net.minecraft.util.math.intprovider.ClampedIntProvider; +import net.minecraft.util.math.intprovider.UniformIntProvider; +import net.minecraft.world.Heightmap; +import net.minecraft.world.gen.feature.*; +import net.minecraft.world.gen.placementmodifier.*; + +import java.util.List; + +public final class HollowPlacedFeatures { + public static final RegistryKey CATTAILS = of("cattails"); + + public static final RegistryKey PATCH_TWIG = of("patch_twig"); + public static final RegistryKey PATCH_CAMPION = of("patch_campion"); + public static final RegistryKey PATCH_GIANT_LILYPAD = of("patch_giant_lilypad"); + public static final RegistryKey PATCH_GRASS_BIRCH = of("patch_grass_birch"); + public static final RegistryKey PATCH_TALL_GRASS_BIRCH = of("patch_tall_grass_birch"); + + public static final RegistryKey FALLEN_BIRCH = of("fallen_birch"); + public static final RegistryKey FALLEN_OAK = of("fallen_oak"); + + public static final RegistryKey HUGE_BROWN_MUSHROOM_SWAMP = of("huge_brown_mushroom_swamp"); + + public static void bootstrap(Registerable featureRegisterable) { + PlacedFeatureHelper helper = new PlacedFeatureHelper(featureRegisterable.getRegistryLookup(RegistryKeys.CONFIGURED_FEATURE), featureRegisterable); + + helper.add( + FALLEN_BIRCH, + HollowConfiguredFeatures.FALLEN_BIRCH, + SquarePlacementModifier.of(), + HeightmapPlacementModifier.of(Heightmap.Type.WORLD_SURFACE_WG), + BiomePlacementModifier.of(), + RarityFilterPlacementModifier.of(4) + ); + + helper.add( + FALLEN_OAK, + HollowConfiguredFeatures.FALLEN_OAK, + SquarePlacementModifier.of(), + HeightmapPlacementModifier.of(Heightmap.Type.WORLD_SURFACE_WG), + BiomePlacementModifier.of(), + RarityFilterPlacementModifier.of(4) + ); + + helper.add( + CATTAILS, + HollowConfiguredFeatures.CATTAILS, + CountPlacementModifier.of(2), + RarityFilterPlacementModifier.of(2), + PlacedFeatures.OCEAN_FLOOR_WG_HEIGHTMAP, + BiomePlacementModifier.of(), + SquarePlacementModifier.of() + ); + + helper.add( + PATCH_TWIG, + HollowConfiguredFeatures.PATCH_TWIG, + CountPlacementModifier.of(2), + RarityFilterPlacementModifier.of(2), + HeightmapPlacementModifier.of(Heightmap.Type.MOTION_BLOCKING), + BiomePlacementModifier.of(), + SquarePlacementModifier.of() + ); + + helper.add( + PATCH_CAMPION, + HollowConfiguredFeatures.PATCH_CAMPION, + RarityFilterPlacementModifier.of(7), + SquarePlacementModifier.of(), + PlacedFeatures.MOTION_BLOCKING_HEIGHTMAP, + CountPlacementModifier.of(ClampedIntProvider.create(UniformIntProvider.create(-3, 1), 0, 1)), + BiomePlacementModifier.of() + ); + + helper.add( + PATCH_GRASS_BIRCH, + VegetationConfiguredFeatures.PATCH_GRASS, + CountPlacementModifier.of(20), + HeightmapPlacementModifier.of(Heightmap.Type.WORLD_SURFACE_WG), + BiomePlacementModifier.of(), + SquarePlacementModifier.of() + ); + + helper.add( + PATCH_TALL_GRASS_BIRCH, + VegetationConfiguredFeatures.PATCH_TALL_GRASS, + CountPlacementModifier.of(1), + HeightmapPlacementModifier.of(Heightmap.Type.MOTION_BLOCKING), + BiomePlacementModifier.of(), + SquarePlacementModifier.of() + ); + + helper.add( + HUGE_BROWN_MUSHROOM_SWAMP, + TreeConfiguredFeatures.HUGE_BROWN_MUSHROOM, + CountPlacementModifier.of(1), + RarityFilterPlacementModifier.of(2), + HeightmapPlacementModifier.of(Heightmap.Type.MOTION_BLOCKING), + BiomePlacementModifier.of(), + SquarePlacementModifier.of() + ); + + helper.add( + PATCH_GIANT_LILYPAD, + HollowConfiguredFeatures.PATCH_GIANT_LILYPAD, + CountPlacementModifier.of(1), + HeightmapPlacementModifier.of(Heightmap.Type.WORLD_SURFACE_WG), + BiomePlacementModifier.of(), + SquarePlacementModifier.of() + ); + } + + public static RegistryKey of(String id) { + return RegistryKey.of(RegistryKeys.PLACED_FEATURE, Identifier.of(Hollow.MODID, id)); + } + + private record PlacedFeatureHelper(RegistryEntryLookup> lookup, + Registerable featureRegisterable) { + public void add(RegistryKey key, RegistryKey> configuredKey, PlacementModifier... modifiers) { + featureRegisterable.register( + key, + new PlacedFeature( + lookup.getOrThrow(configuredKey), + List.of(modifiers) + ) + ); + } + } +} \ No newline at end of file diff --git a/src/main/java/dev/spiritstudios/hollow/worldgen/foliage/BlobWithHangingFoliagePlacer.java b/src/main/java/dev/spiritstudios/hollow/worldgen/foliage/BlobWithHangingFoliagePlacer.java new file mode 100644 index 0000000..577dc65 --- /dev/null +++ b/src/main/java/dev/spiritstudios/hollow/worldgen/foliage/BlobWithHangingFoliagePlacer.java @@ -0,0 +1,74 @@ +package dev.spiritstudios.hollow.worldgen.foliage; + +import com.mojang.serialization.Codec; +import com.mojang.serialization.MapCodec; +import com.mojang.serialization.codecs.RecordCodecBuilder; +import dev.spiritstudios.hollow.registry.HollowFoliagePlacerTypes; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.intprovider.IntProvider; +import net.minecraft.util.math.random.Random; +import net.minecraft.world.TestableWorld; +import net.minecraft.world.gen.feature.TreeFeatureConfig; +import net.minecraft.world.gen.foliage.FoliagePlacer; +import net.minecraft.world.gen.foliage.FoliagePlacerType; + +public class BlobWithHangingFoliagePlacer extends FoliagePlacer { + public static final MapCodec CODEC = RecordCodecBuilder.mapCodec(instance -> + fillFoliagePlacerFields(instance).and(instance.group( + Codec.intRange(0, 16).fieldOf("height").forGetter(placer -> placer.height), + Codec.floatRange(0.0F, 1.0F).fieldOf("hanging_leaves_chance").forGetter(placer -> placer.hangingLeavesChance), + Codec.floatRange(0.0F, 1.0F).fieldOf("hanging_leaves_extension_chance").forGetter(placer -> placer.hangingLeavesExtensionChance) + ) + ).apply(instance, BlobWithHangingFoliagePlacer::new)); + + protected final int height; + protected final float hangingLeavesChance; + protected final float hangingLeavesExtensionChance; + + public BlobWithHangingFoliagePlacer(IntProvider radius, IntProvider offset, int height, float hangingLeavesChance, float hangingLeavesExtensionChance) { + super(radius, offset); + this.height = height; + this.hangingLeavesChance = hangingLeavesChance; + this.hangingLeavesExtensionChance = hangingLeavesExtensionChance; + } + + @Override + protected FoliagePlacerType getType() { + return HollowFoliagePlacerTypes.BLOB_WITH_HANGING; + } + + @Override + protected void generate( + TestableWorld world, + FoliagePlacer.BlockPlacer placer, + Random random, + TreeFeatureConfig config, + int trunkHeight, + FoliagePlacer.TreeNode treeNode, + int foliageHeight, + int radius, + int offset + ) { + BlockPos adjustedPos = treeNode.getCenter().up(offset); + + for (int i = offset - foliageHeight; i <= offset; i++) { + this.generateSquareWithHangingLeaves( + world, placer, random, config, + adjustedPos, + Math.max(radius + treeNode.getFoliageRadius() - 1 - i / 2, 0), i, + treeNode.isGiantTrunk(), + hangingLeavesChance, hangingLeavesExtensionChance + ); + } + } + + @Override + public int getRandomHeight(Random random, int trunkHeight, TreeFeatureConfig config) { + return this.height; + } + + @Override + protected boolean isInvalidForLeaves(Random random, int dx, int y, int dz, int radius, boolean giantTrunk) { + return dx == radius && dz == radius && (random.nextInt(2) == 0 || y == 0); + } +} diff --git a/src/main/resources/assets/hollow/blockstates/cattail.json b/src/main/resources/assets/hollow/blockstates/cattail.json deleted file mode 100644 index f7f3d78..0000000 --- a/src/main/resources/assets/hollow/blockstates/cattail.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "variants": { - "reeds_part=base": { - "model": "hollow:block/cattail_base" - }, - "reeds_part=middle": [ - { - "model": "hollow:block/cattail_middle" - }, - { - "model": "hollow:block/cattail_middle_2" - } - ], - "reeds_part=top": { - "model": "hollow:block/cattail_top" - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/hollow/blockstates/cattail_stem.json b/src/main/resources/assets/hollow/blockstates/cattail_stem.json new file mode 100644 index 0000000..cd8d7b7 --- /dev/null +++ b/src/main/resources/assets/hollow/blockstates/cattail_stem.json @@ -0,0 +1,13 @@ +{ + "variants": { + "bottom=false": [ + { + "model": "hollow:block/cattail_middle" + }, + { + "model": "hollow:block/cattail_middle_2" + } + ], + "bottom=true": { "model": "hollow:block/cattail_base" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hollow/blockstates/root_vines.json b/src/main/resources/assets/hollow/blockstates/root_vines.json deleted file mode 100644 index 491ccee..0000000 --- a/src/main/resources/assets/hollow/blockstates/root_vines.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "variants": { - "up=false": { - "model": "hollow:block/root_vines_head" - }, - "up=true": { - "model": "hollow:block/root_vines_body" - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/hollow/lang/en_us.json b/src/main/resources/assets/hollow/lang/en_us.json index 2c17b72..4139816 100644 --- a/src/main/resources/assets/hollow/lang/en_us.json +++ b/src/main/resources/assets/hollow/lang/en_us.json @@ -41,7 +41,6 @@ "block.hollow.echoing_pot": "Echoing Pot", "block.hollow.stone_chest": "Stone Chest", "block.hollow.stone_chest_lid": "Stone Chest Lid", - "block.hollow.root_vines": "Root Vines", "block.hollow.cattail": "Cattail", "death.attack.sculk_jaw.player": "%1$s was ripped to shreds", "death.attack.sculk_jaw": "%1$s was ripped to shreds", @@ -50,8 +49,6 @@ "item.hollow.copper_horn": "Copper Horn", "jukebox_song.hollow.postmortem": "WorldWidePixel - Postmortem", "subtitles.block.sculk_jaw.bite": "Sculk Jaw bites", - "advancements.adventure.diversity_win.title": "Diversity Win", - "advancements.adventure.diversity_win.description": "Get one of every dye.", "config.hollow.hollow.title": "Hollow", "config.hollow.hollow.revertCopperBulb": "Revert Copper Bulb", "config.hollow.hollow.revertCopperBulb.tooltip": "Whether to revert the Copper Bulb to it's original 1-tick delay. If you aren't a redstoner, you can ignore this.", @@ -96,5 +93,9 @@ "subtitles.copper_horn.gift": "Gift", "subtitles.copper_horn.sweet": "Sweet", "subtitles.copper_horn.moon": "Moon", - "subtitles.copper_horn.love": "Love" + "subtitles.copper_horn.love": "Love", + "gamerule.doFrogPoisoning": "Allow Frog poisoning", + "advancements.husbandry.witnessed_frog_poisoning.title": "Poisonous To Frogs", + "advancements.husbandry.witnessed_frog_poisoning.description": "Witness a Frog be poisoned upon eating a Firefly", + "entity.hollow.firefly": "Firefly" } \ No newline at end of file diff --git a/src/main/resources/assets/hollow/models/block/echoing_pot.json b/src/main/resources/assets/hollow/models/block/echoing_pot.json index a7578a6..6fbf2e4 100644 --- a/src/main/resources/assets/hollow/models/block/echoing_pot.json +++ b/src/main/resources/assets/hollow/models/block/echoing_pot.json @@ -1,44 +1,38 @@ { "credit": "Made with Blockbench", "parent": "block/block", + "texture_size": [64, 64], "textures": { - "0": "hollow:block/echoing_pot_side_2", - "1": "hollow:block/echoing_pot_side", - "2": "hollow:block/echoing_pot_top", - "3": "hollow:block/echoing_pot_side_3", - "particle": "hollow:block/echoing_pot_side_2" + "2": "hollow:block/echoing_pot", + "particle": "block/chiseled_deepslate" }, "elements": [ { + "name": "base", "from": [1, 0, 1], - "to": [15, 13, 15], + "to": [15, 14, 15], "faces": { - "north": {"uv": [1, 1, 15, 14], "texture": "#0"}, - "east": {"uv": [15, 1, 1, 14], "texture": "#3"}, - "south": {"uv": [1, 1, 15, 14], "texture": "#0"}, - "west": {"uv": [15, 1, 1, 14], "texture": "#3"}, - "up": {"uv": [1, 1, 15, 15], "texture": "#1"}, - "down": {"uv": [1, 1, 15, 15], "texture": "#1"} + "north": {"uv": [3.5, 3.5, 7, 7], "texture": "#2"}, + "east": {"uv": [0, 3.5, 3.5, 7], "texture": "#2"}, + "south": {"uv": [10.5, 3.5, 14, 7], "texture": "#2"}, + "west": {"uv": [7, 3.5, 10.5, 7], "texture": "#2"}, + "up": {"uv": [7, 3.5, 3.5, 0], "texture": "#2"}, + "down": {"uv": [10.5, 0, 7, 3.5], "texture": "#2"} } }, { - "from": [3, 13, 3], - "to": [13, 15, 13], + "name": "spout", + "from": [4, 14, 4], + "to": [12, 16, 12], + "rotation": {"angle": 0, "axis": "y", "origin": [7, 14, 7]}, "faces": { - "north": {"uv": [3, 5, 13, 7], "rotation": 180, "texture": "#0"}, - "east": {"uv": [3, 5, 13, 7], "rotation": 180, "texture": "#0"}, - "south": {"uv": [3, 5, 13, 7], "rotation": 180, "texture": "#0"}, - "west": {"uv": [3, 5, 13, 7], "rotation": 180, "texture": "#0"}, - "up": {"uv": [0, 0, 10, 10], "texture": "#2"} + "north": {"uv": [2, 9, 4, 9.5], "texture": "#2"}, + "east": {"uv": [0, 9, 2, 9.5], "texture": "#2"}, + "south": {"uv": [6, 9, 8, 9.5], "texture": "#2"}, + "west": {"uv": [4, 9, 6, 9.5], "texture": "#2"}, + "up": {"uv": [4, 9, 2, 7], "texture": "#2"}, + "down": {"uv": [6, 7, 4, 9], "texture": "#2"} } } - ], - "groups": [ - { - "name": "VoxelShapes", - "origin": [0, 0, 0], - "color": 0, - "children": [0, 1] - } ] } \ No newline at end of file diff --git a/src/main/resources/assets/hollow/models/block/lotus_lilypad.json b/src/main/resources/assets/hollow/models/block/lotus_lilypad.json index ba5b7ee..2d97edb 100644 --- a/src/main/resources/assets/hollow/models/block/lotus_lilypad.json +++ b/src/main/resources/assets/hollow/models/block/lotus_lilypad.json @@ -47,6 +47,50 @@ "west": {"uv": [1, 9, 2, 11], "texture": "#1"} } }, + { + "from": [10, 0.5, 7], + "to": [10, 2.5, 10], + "rotation": {"angle": 0, "axis": "y", "origin": [10, 1, 8.5]}, + "faces": { + "north": {"uv": [0, 0, 0, 2], "texture": "#1"}, + "east": {"uv": [3, 1, 6, 3], "texture": "#1"}, + "south": {"uv": [0, 0, 0, 2], "texture": "#1"}, + "west": {"uv": [3, 1, 6, 3], "texture": "#1"} + } + }, + { + "from": [7, 0.5, 7], + "to": [7, 2.5, 10], + "rotation": {"angle": 0, "axis": "y", "origin": [7, 1, 8.5]}, + "faces": { + "north": {"uv": [0, 0, 0, 2], "texture": "#1"}, + "east": {"uv": [3, 1, 6, 3], "texture": "#1"}, + "south": {"uv": [0, 0, 0, 2], "texture": "#1"}, + "west": {"uv": [3, 1, 6, 3], "texture": "#1"} + } + }, + { + "from": [7, 0.5, 10], + "to": [10, 2.5, 10], + "rotation": {"angle": 0, "axis": "y", "origin": [8.5, 1, 10]}, + "faces": { + "north": {"uv": [3, 1, 6, 3], "texture": "#1"}, + "east": {"uv": [0, 0, 0, 2], "texture": "#1"}, + "south": {"uv": [3, 1, 6, 3], "texture": "#1"}, + "west": {"uv": [0, 0, 0, 2], "texture": "#1"} + } + }, + { + "from": [7, 0.5, 7], + "to": [10, 2.5, 7], + "rotation": {"angle": 0, "axis": "y", "origin": [8.5, 1, 7]}, + "faces": { + "north": {"uv": [3, 1, 6, 3], "texture": "#1"}, + "east": {"uv": [0, 0, 0, 2], "texture": "#1"}, + "south": {"uv": [3, 1, 6, 3], "texture": "#1"}, + "west": {"uv": [0, 0, 0, 2], "texture": "#1"} + } + }, { "from": [7, 1.64813, 1.22798], "to": [10, 1.64813, 7.22798], diff --git a/src/main/resources/assets/hollow/models/block/one_polypore.json b/src/main/resources/assets/hollow/models/block/one_polypore.json index 7e8e2f5..cf47282 100644 --- a/src/main/resources/assets/hollow/models/block/one_polypore.json +++ b/src/main/resources/assets/hollow/models/block/one_polypore.json @@ -16,8 +16,8 @@ "east": {"uv": [0, 0, 4, 0], "texture": "#0"}, "south": {"uv": [0, 0, 4, 0], "texture": "#0"}, "west": {"uv": [0, 0, 4, 0], "texture": "#0"}, - "up": {"uv": [10, 4, 6, 0], "texture": "#0"}, - "down": {"uv": [10, 0, 6, 4], "texture": "#0"} + "up": {"uv": [14, 13, 10, 9], "texture": "#0"}, + "down": {"uv": [16, 0, 12, 4], "texture": "#0"} } } ] diff --git a/src/main/resources/assets/hollow/models/block/root_vines_body.json b/src/main/resources/assets/hollow/models/block/root_vines_body.json deleted file mode 100644 index a73f103..0000000 --- a/src/main/resources/assets/hollow/models/block/root_vines_body.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "minecraft:block/cross", - "textures": { - "cross": "hollow:block/root_vines_body" - } -} \ No newline at end of file diff --git a/src/main/resources/assets/hollow/models/block/root_vines_head.json b/src/main/resources/assets/hollow/models/block/root_vines_head.json deleted file mode 100644 index fde4520..0000000 --- a/src/main/resources/assets/hollow/models/block/root_vines_head.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "minecraft:block/cross", - "textures": { - "cross": "hollow:block/root_vines_head" - } -} \ No newline at end of file diff --git a/src/main/resources/assets/hollow/models/block/sculk_jaw.json b/src/main/resources/assets/hollow/models/block/sculk_jaw.json deleted file mode 100644 index 2637bb8..0000000 --- a/src/main/resources/assets/hollow/models/block/sculk_jaw.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "parent": "block/cube_top", - "textures": { - "top": "hollow:block/sculk_jaw", - "side": "minecraft:block/sculk" - } -} \ No newline at end of file diff --git a/src/main/resources/assets/hollow/models/block/sculk_jaw_active.json b/src/main/resources/assets/hollow/models/block/sculk_jaw_active.json deleted file mode 100644 index 705473b..0000000 --- a/src/main/resources/assets/hollow/models/block/sculk_jaw_active.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "parent": "block/cube_top", - "textures": { - "top": "hollow:block/sculk_jaw_active", - "side": "minecraft:block/sculk" - } -} \ No newline at end of file diff --git a/src/main/resources/assets/hollow/models/block/stone_chest.json b/src/main/resources/assets/hollow/models/block/stone_chest.json index 08e68f3..071eb18 100644 --- a/src/main/resources/assets/hollow/models/block/stone_chest.json +++ b/src/main/resources/assets/hollow/models/block/stone_chest.json @@ -1,45 +1,38 @@ { "credit": "Made with Blockbench", - "texture_size": [64, 64], "parent": "block/block", + "texture_size": [64, 64], "textures": { - "3": "hollow:block/stone_chest", - "particle": "minecraft:block/chiseled_deepslate" + "0": "hollow:block/stone_chest_single", + "particle": "block/chiseled_deepslate" }, "elements": [ { "name": "chest", "from": [1, 1, 1], "to": [15, 16, 15], + "rotation": {"angle": 0, "axis": "y", "origin": [16, 0, 0]}, "faces": { - "north": {"uv": [4, 0, 7.5, 3.75], "texture": "#3"}, - "east": {"uv": [4, 3.75, 7.5, 7.5], "texture": "#3"}, - "south": {"uv": [7.5, 0, 11, 3.75], "texture": "#3"}, - "west": {"uv": [7.5, 3.75, 11, 7.5], "texture": "#3"}, - "up": {"uv": [7.5, 11, 4, 7.5], "texture": "#3"}, - "down": {"uv": [11, 7.5, 7.5, 11], "texture": "#3"} + "north": {"uv": [3.5, 3.5, 7, 7.25], "texture": "#0"}, + "east": {"uv": [0, 3.5, 3.5, 7.25], "texture": "#0"}, + "south": {"uv": [7, 3.5, 10.5, 7.25], "texture": "#0"}, + "west": {"uv": [10.5, 3.5, 14, 7.25], "texture": "#0"}, + "up": {"uv": [7, 3.5, 3.5, 0], "texture": "#0", "cullface": "up"} } }, { "name": "base", "from": [0, 0, 0], "to": [16, 1, 16], + "rotation": {"angle": 0, "axis": "y", "origin": [16, 0, 0]}, "faces": { - "north": {"uv": [0, 8, 4, 8.25], "texture": "#3"}, - "east": {"uv": [0, 8.25, 4, 8.5], "texture": "#3"}, - "south": {"uv": [0, 8.5, 4, 8.75], "texture": "#3"}, - "west": {"uv": [0, 8.75, 4, 9], "texture": "#3"}, - "up": {"uv": [4, 4, 0, 0], "texture": "#3"}, - "down": {"uv": [4, 4, 0, 8], "texture": "#3"} + "north": {"uv": [0, 8, 4, 8.25], "texture": "#0", "cullface": "north"}, + "east": {"uv": [0, 8, 4, 8.25], "texture": "#0", "cullface": "east"}, + "south": {"uv": [0, 8, 4, 8.25], "texture": "#0", "cullface": "south"}, + "west": {"uv": [0, 8, 4, 8.25], "texture": "#0", "cullface": "west"}, + "up": {"uv": [4, 12, 0, 8], "texture": "#0"}, + "down": {"uv": [4, 12, 0, 16], "texture": "#0", "cullface": "down"} } } - ], - "groups": [ - { - "name": "stone_chest", - "origin": [0, 0, 0], - "color": 0, - "children": [0, 1] - } ] } \ No newline at end of file diff --git a/src/main/resources/assets/hollow/models/block/stone_chest_left.json b/src/main/resources/assets/hollow/models/block/stone_chest_left.json index 995ca7d..2baa8ec 100644 --- a/src/main/resources/assets/hollow/models/block/stone_chest_left.json +++ b/src/main/resources/assets/hollow/models/block/stone_chest_left.json @@ -1,35 +1,32 @@ { "credit": "Made with Blockbench", "texture_size": [64, 64], - "parent": "block/block", "textures": { - "0": "hollow:block/stone_chest_double", - "particle": "minecraft:block/chiseled_deepslate" + "all": "hollow:block/stone_chest", + "particle": "block/chiseled_deepslate" }, "elements": [ { - "name": "chest_right", - "from": [1, 1, 1], - "to": [16, 16, 15], + "from": [0, 0, 0], + "to": [16, 1, 16], + "rotation": {"angle": 0, "axis": "y", "origin": [16, 0, 0]}, "faces": { - "north": {"uv": [1.875, 4, 3.75, 5.875], "texture": "#0"}, - "south": {"uv": [4, 1.875, 5.875, 3.75], "texture": "#0"}, - "west": {"uv": [1.875, 5.875, 3.625, 7.75], "texture": "#0"}, - "up": {"uv": [7.75, 3.625, 5.875, 1.875], "texture": "#0"}, - "down": {"uv": [5.5, 5.875, 3.625, 7.625], "texture": "#0"} + "north": {"uv": [4, 11, 8, 11.25], "texture": "#all", "cullface": "north"}, + "south": {"uv": [4, 11, 8, 11.25], "texture": "#all", "cullface": "south"}, + "west": {"uv": [4, 11, 8, 11.25], "texture": "#all", "cullface": "west"}, + "up": {"uv": [8, 15, 4, 11], "texture": "#all"}, + "down": {"uv": [8, 11, 4, 15], "texture": "#all", "cullface": "down"} } }, { - "name": "base_right", - "from": [0, 0, 0], - "to": [16, 1, 16], + "from": [1, 1, 1], + "to": [16, 16, 15], + "rotation": {"angle": 0, "axis": "y", "origin": [16, 0, 0]}, "faces": { - "north": {"uv": [7.25, 4.125, 9.25, 4.25], "texture": "#0"}, - "east": {"uv": [7.25, 4.25, 9.25, 4.375], "texture": "#0"}, - "south": {"uv": [7.25, 4.375, 9.25, 4.5], "texture": "#0"}, - "west": {"uv": [7.25, 4.5, 9.25, 4.625], "texture": "#0"}, - "up": {"uv": [4, 2, 2, 0], "texture": "#0"}, - "down": {"uv": [4, 2, 2, 4], "texture": "#0"} + "north": {"uv": [7.25, 7.25, 11, 11], "texture": "#all"}, + "south": {"uv": [11, 0, 7.25, 3.75], "texture": "#all"}, + "west": {"uv": [11, 7.25, 14.5, 11], "texture": "#all"}, + "up": {"uv": [11, 7.25, 7.25, 3.75], "texture": "#all", "cullface": "up"} } } ] diff --git a/src/main/resources/assets/hollow/models/block/stone_chest_lid.json b/src/main/resources/assets/hollow/models/block/stone_chest_lid.json index 3c9ea9e..7237f8c 100644 --- a/src/main/resources/assets/hollow/models/block/stone_chest_lid.json +++ b/src/main/resources/assets/hollow/models/block/stone_chest_lid.json @@ -1,23 +1,23 @@ { "credit": "Made with Blockbench", - "texture_size": [32, 32], "parent": "block/block", + "texture_size": [32, 32], "textures": { - "1": "hollow:block/stone_chest_lid", - "particle": "minecraft:block/polished_deepslate" + "2": "hollow:block/stone_chest_lid_single", + "particle": "block/chiseled_deepslate" }, "elements": [ { - "name": "lid", "from": [1, 0, 1], "to": [15, 4, 15], + "rotation": {"angle": 0, "axis": "y", "origin": [16, -22, 0]}, "faces": { - "north": {"uv": [7, 0, 14, 2], "texture": "#1"}, - "east": {"uv": [7, 2, 14, 4], "texture": "#1"}, - "south": {"uv": [7, 4, 14, 6], "texture": "#1"}, - "west": {"uv": [7, 6, 14, 8], "texture": "#1"}, - "up": {"uv": [7, 7, 0, 0], "texture": "#1"}, - "down": {"uv": [7, 7, 0, 14], "texture": "#1"} + "north": {"uv": [7, 0, 14, 2], "texture": "#2"}, + "east": {"uv": [7, 6, 14, 8], "texture": "#2"}, + "south": {"uv": [7, 2, 14, 4], "texture": "#2"}, + "west": {"uv": [7, 4, 14, 6], "texture": "#2"}, + "up": {"uv": [7, 7, 0, 0], "texture": "#2"}, + "down": {"uv": [7, 7, 0, 14], "texture": "#2", "cullface": "down"} } } ] diff --git a/src/main/resources/assets/hollow/models/block/stone_chest_lid_left.json b/src/main/resources/assets/hollow/models/block/stone_chest_lid_left.json index 73d79fb..dbea76a 100644 --- a/src/main/resources/assets/hollow/models/block/stone_chest_lid_left.json +++ b/src/main/resources/assets/hollow/models/block/stone_chest_lid_left.json @@ -1,22 +1,21 @@ { "credit": "Made with Blockbench", - "texture_size": [64, 64], - "parent": "block/block", + "texture_size": [32, 32], "textures": { - "0": "hollow:block/stone_chest_lid_double", - "particle": "minecraft:block/polished_deepslate" + "all": "hollow:block/stone_chest_lid", + "particle": "block/chiseled_deepslate" }, "elements": [ { - "name": "lid_right", "from": [1, 0, 1], "to": [16, 4, 15], + "rotation": {"angle": 0, "axis": "y", "origin": [16, -22, 0]}, "faces": { - "north": {"uv": [7.5, 0, 11.25, 1], "texture": "#0"}, - "south": {"uv": [7.5, 1, 11.25, 2], "texture": "#0"}, - "west": {"uv": [7.5, 3, 11, 4], "texture": "#0"}, - "up": {"uv": [7.5, 3.5, 3.75, 0], "texture": "#0"}, - "down": {"uv": [7.5, 3.5, 3.75, 7], "texture": "#0"} + "north": {"uv": [7.5, 2, 15, 4], "texture": "#all"}, + "south": {"uv": [15, 0, 7.5, 2], "texture": "#all"}, + "west": {"uv": [8, 11, 15, 13], "texture": "#all"}, + "up": {"uv": [15, 11, 7.5, 4], "texture": "#all"}, + "down": {"uv": [15, 4, 7.5, 11], "texture": "#all", "cullface": "down"} } } ] diff --git a/src/main/resources/assets/hollow/models/block/stone_chest_lid_right.json b/src/main/resources/assets/hollow/models/block/stone_chest_lid_right.json index 66cfc70..1aeced2 100644 --- a/src/main/resources/assets/hollow/models/block/stone_chest_lid_right.json +++ b/src/main/resources/assets/hollow/models/block/stone_chest_lid_right.json @@ -1,22 +1,21 @@ { "credit": "Made with Blockbench", - "texture_size": [64, 64], - "parent": "block/block", + "texture_size": [32, 32], "textures": { - "0": "hollow:block/stone_chest_lid_double", - "particle": "minecraft:block/polished_deepslate" + "all": "hollow:block/stone_chest_lid", + "particle": "block/chiseled_deepslate" }, "elements": [ { - "name": "lid_left", "from": [0, 0, 1], "to": [15, 4, 15], + "rotation": {"angle": 0, "axis": "y", "origin": [0, -22, 0]}, "faces": { - "north": {"uv": [0, 7, 3.75, 8], "texture": "#0"}, - "east": {"uv": [7.5, 2, 11, 3], "texture": "#0"}, - "south": {"uv": [3.75, 7, 7.5, 8], "texture": "#0"}, - "up": {"uv": [3.75, 3.5, 0, 0], "texture": "#0"}, - "down": {"uv": [3.75, 3.5, 0, 7], "texture": "#0"} + "north": {"uv": [0, 2, 7.5, 4], "texture": "#all"}, + "east": {"uv": [0, 11, 7, 13], "texture": "#all"}, + "south": {"uv": [7.5, 0, 0, 2], "texture": "#all"}, + "up": {"uv": [7.5, 11, 0, 4], "texture": "#all"}, + "down": {"uv": [7.5, 4, 0, 11], "texture": "#all", "cullface": "down"} } } ] diff --git a/src/main/resources/assets/hollow/models/block/stone_chest_right.json b/src/main/resources/assets/hollow/models/block/stone_chest_right.json index 7b46eaf..68c8daa 100644 --- a/src/main/resources/assets/hollow/models/block/stone_chest_right.json +++ b/src/main/resources/assets/hollow/models/block/stone_chest_right.json @@ -1,35 +1,30 @@ { "credit": "Made with Blockbench", "texture_size": [64, 64], - "parent": "block/block", "textures": { - "0": "hollow:block/stone_chest_double", - "particle": "minecraft:block/chiseled_deepslate" + "all": "hollow:block/stone_chest", + "particle": "block/chiseled_deepslate" }, "elements": [ { - "name": "chest_left", "from": [0, 1, 1], "to": [15, 16, 15], "faces": { - "north": {"uv": [0, 4, 1.875, 5.875], "texture": "#0"}, - "east": {"uv": [3.75, 4, 5.5, 5.875], "texture": "#0"}, - "south": {"uv": [4, 0, 5.875, 1.875], "texture": "#0"}, - "up": {"uv": [7.375, 7.375, 5.5, 5.625], "texture": "#0"}, - "down": {"uv": [1.875, 5.875, 0, 7.625], "texture": "#0"} + "north": {"uv": [3.5, 7.25, 7.25, 11], "texture": "#all"}, + "east": {"uv": [0, 7.25, 3.5, 11], "texture": "#all"}, + "south": {"uv": [7.25, 0, 3.5, 3.75], "texture": "#all"}, + "up": {"uv": [7.25, 7.25, 3.5, 3.75], "texture": "#all", "cullface": "up"} } }, { - "name": "base_left", "from": [0, 0, 0], "to": [16, 1, 16], "faces": { - "north": {"uv": [5.875, 3.625, 7.875, 3.75], "texture": "#0"}, - "east": {"uv": [7.25, 3.75, 9.25, 3.875], "texture": "#0"}, - "south": {"uv": [7.25, 3.875, 9.25, 4], "texture": "#0"}, - "west": {"uv": [7.25, 4, 9.25, 4.125], "texture": "#0"}, - "up": {"uv": [2, 2, 0, 0], "texture": "#0"}, - "down": {"uv": [2, 2, 0, 4], "texture": "#0"} + "north": {"uv": [0, 11, 4, 11.25], "texture": "#all", "cullface": "north"}, + "east": {"uv": [0, 11, 4, 11.25], "texture": "#all", "cullface": "east"}, + "south": {"uv": [0, 11, 4, 11.25], "texture": "#all", "cullface": "south"}, + "up": {"uv": [4, 15, 0, 11], "texture": "#all"}, + "down": {"uv": [4, 11, 0, 15], "texture": "#all", "cullface": "down"} } } ] diff --git a/src/main/resources/assets/hollow/models/block/three_polypore.json b/src/main/resources/assets/hollow/models/block/three_polypore.json index a61d5ea..c174922 100644 --- a/src/main/resources/assets/hollow/models/block/three_polypore.json +++ b/src/main/resources/assets/hollow/models/block/three_polypore.json @@ -16,8 +16,8 @@ "east": {"uv": [0, 0, 4, 0], "texture": "#0"}, "south": {"uv": [0, 0, 4, 0], "texture": "#0"}, "west": {"uv": [0, 0, 4, 0], "texture": "#0"}, - "up": {"uv": [10, 4, 6, 0], "texture": "#0"}, - "down": {"uv": [10, 0, 6, 4], "texture": "#0"} + "up": {"uv": [14, 13, 10, 9], "texture": "#0"}, + "down": {"uv": [16, 0, 12, 4], "texture": "#0"} } }, { @@ -31,7 +31,7 @@ "south": {"uv": [0, 0, 5, 0], "texture": "#0"}, "west": {"uv": [0, 0, 6, 0], "texture": "#0"}, "up": {"uv": [5, 15, 0, 9], "texture": "#0"}, - "down": {"uv": [5, 9, 0, 15], "texture": "#0"} + "down": {"uv": [10, 9, 5, 15], "texture": "#0"} } }, { @@ -45,7 +45,7 @@ "south": {"uv": [0, 0, 6, 0], "texture": "#0"}, "west": {"uv": [0, 0, 9, 0], "texture": "#0"}, "up": {"uv": [6, 9, 0, 0], "texture": "#0"}, - "down": {"uv": [6, 0, 0, 9], "texture": "#0"} + "down": {"uv": [12, 0, 6, 9], "texture": "#0"} } } ] diff --git a/src/main/resources/assets/hollow/models/block/two_polypore.json b/src/main/resources/assets/hollow/models/block/two_polypore.json index ab74d56..190fb7f 100644 --- a/src/main/resources/assets/hollow/models/block/two_polypore.json +++ b/src/main/resources/assets/hollow/models/block/two_polypore.json @@ -16,8 +16,8 @@ "east": {"uv": [0, 0, 4, 0], "texture": "#0"}, "south": {"uv": [0, 0, 4, 0], "texture": "#0"}, "west": {"uv": [0, 0, 4, 0], "texture": "#0"}, - "up": {"uv": [10, 4, 6, 0], "texture": "#0"}, - "down": {"uv": [10, 0, 6, 4], "texture": "#0"} + "up": {"uv": [14, 13, 10, 9], "texture": "#0"}, + "down": {"uv": [16, 0, 12, 4], "texture": "#0"} } }, { @@ -31,7 +31,7 @@ "south": {"uv": [0, 0, 5, 0], "texture": "#0"}, "west": {"uv": [0, 0, 6, 0], "texture": "#0"}, "up": {"uv": [5, 15, 0, 9], "texture": "#0"}, - "down": {"uv": [5, 9, 0, 15], "texture": "#0"} + "down": {"uv": [10, 9, 5, 15], "texture": "#0"} } } ] diff --git a/src/main/resources/assets/hollow/models/item/firefly_spawn_egg.json b/src/main/resources/assets/hollow/models/item/firefly_spawn_egg.json deleted file mode 100644 index 7a2c6da..0000000 --- a/src/main/resources/assets/hollow/models/item/firefly_spawn_egg.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "parent": "item/template_spawn_egg" -} \ No newline at end of file diff --git a/src/main/resources/assets/hollow/models/item/root_vines.json b/src/main/resources/assets/hollow/models/item/root_vines.json deleted file mode 100644 index a145bcb..0000000 --- a/src/main/resources/assets/hollow/models/item/root_vines.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "minecraft:item/generated", - "textures": { - "layer0": "hollow:block/root_vines_head" - } -} \ No newline at end of file diff --git a/src/main/resources/assets/hollow/sounds.json b/src/main/resources/assets/hollow/sounds.json index e73ad26..8cab590 100644 --- a/src/main/resources/assets/hollow/sounds.json +++ b/src/main/resources/assets/hollow/sounds.json @@ -57,6 +57,26 @@ } ] }, + "block.stone_chest.extract": { + "sounds": [ + { + "name": "block/decorated_pot/insert1", + "volume": 0.9 + }, + { + "name": "block/decorated_pot/insert2", + "volume": 0.9 + }, + { + "name": "block/decorated_pot/insert3", + "volume": 0.9 + }, + { + "name": "block/decorated_pot/insert4", + "volume": 0.9 + } + ] + }, "block.sculk_jaw.bite": { "subtitle": "subtitles.block.sculk_jaw.bite", "sounds": [ diff --git a/src/main/resources/assets/hollow/textures/block/blue_wildflower.png b/src/main/resources/assets/hollow/textures/block/blue_wildflower.png new file mode 100644 index 0000000..1e65619 Binary files /dev/null and b/src/main/resources/assets/hollow/textures/block/blue_wildflower.png differ diff --git a/src/main/resources/assets/hollow/textures/block/echoing_pot.png b/src/main/resources/assets/hollow/textures/block/echoing_pot.png new file mode 100644 index 0000000..249bc7c Binary files /dev/null and b/src/main/resources/assets/hollow/textures/block/echoing_pot.png differ diff --git a/src/main/resources/assets/hollow/textures/block/echoing_pot_side.png b/src/main/resources/assets/hollow/textures/block/echoing_pot_side.png deleted file mode 100644 index 718dc30..0000000 Binary files a/src/main/resources/assets/hollow/textures/block/echoing_pot_side.png and /dev/null differ diff --git a/src/main/resources/assets/hollow/textures/block/echoing_pot_side_2.png b/src/main/resources/assets/hollow/textures/block/echoing_pot_side_2.png deleted file mode 100644 index 5570851..0000000 Binary files a/src/main/resources/assets/hollow/textures/block/echoing_pot_side_2.png and /dev/null differ diff --git a/src/main/resources/assets/hollow/textures/block/echoing_pot_side_3.png b/src/main/resources/assets/hollow/textures/block/echoing_pot_side_3.png deleted file mode 100644 index 13e0471..0000000 Binary files a/src/main/resources/assets/hollow/textures/block/echoing_pot_side_3.png and /dev/null differ diff --git a/src/main/resources/assets/hollow/textures/block/echoing_pot_top.png b/src/main/resources/assets/hollow/textures/block/echoing_pot_top.png deleted file mode 100644 index af79f2b..0000000 Binary files a/src/main/resources/assets/hollow/textures/block/echoing_pot_top.png and /dev/null differ diff --git a/src/main/resources/assets/hollow/textures/block/lotus_lilypad.png b/src/main/resources/assets/hollow/textures/block/lotus_lilypad.png index 8dc6692..1bd4e6a 100644 Binary files a/src/main/resources/assets/hollow/textures/block/lotus_lilypad.png and b/src/main/resources/assets/hollow/textures/block/lotus_lilypad.png differ diff --git a/src/main/resources/assets/hollow/textures/block/pink_wildflower.png b/src/main/resources/assets/hollow/textures/block/pink_wildflower.png new file mode 100644 index 0000000..ad61286 Binary files /dev/null and b/src/main/resources/assets/hollow/textures/block/pink_wildflower.png differ diff --git a/src/main/resources/assets/hollow/textures/block/polypore.png b/src/main/resources/assets/hollow/textures/block/polypore.png index 300844c..5ca04e5 100644 Binary files a/src/main/resources/assets/hollow/textures/block/polypore.png and b/src/main/resources/assets/hollow/textures/block/polypore.png differ diff --git a/src/main/resources/assets/hollow/textures/block/purple_wildflower.png b/src/main/resources/assets/hollow/textures/block/purple_wildflower.png new file mode 100644 index 0000000..ae18b90 Binary files /dev/null and b/src/main/resources/assets/hollow/textures/block/purple_wildflower.png differ diff --git a/src/main/resources/assets/hollow/textures/block/root_vines_body.png b/src/main/resources/assets/hollow/textures/block/root_vines_body.png deleted file mode 100644 index 5d05e15..0000000 Binary files a/src/main/resources/assets/hollow/textures/block/root_vines_body.png and /dev/null differ diff --git a/src/main/resources/assets/hollow/textures/block/root_vines_head.png b/src/main/resources/assets/hollow/textures/block/root_vines_head.png deleted file mode 100644 index f3db520..0000000 Binary files a/src/main/resources/assets/hollow/textures/block/root_vines_head.png and /dev/null differ diff --git a/src/main/resources/assets/hollow/textures/block/sculk_jaw.png b/src/main/resources/assets/hollow/textures/block/sculk_jaw.png index c6fe42f..ed5bac0 100644 Binary files a/src/main/resources/assets/hollow/textures/block/sculk_jaw.png and b/src/main/resources/assets/hollow/textures/block/sculk_jaw.png differ diff --git a/src/main/resources/assets/hollow/textures/block/stone_chest.png b/src/main/resources/assets/hollow/textures/block/stone_chest.png index eb003bd..1b165c1 100644 Binary files a/src/main/resources/assets/hollow/textures/block/stone_chest.png and b/src/main/resources/assets/hollow/textures/block/stone_chest.png differ diff --git a/src/main/resources/assets/hollow/textures/block/stone_chest_double.png b/src/main/resources/assets/hollow/textures/block/stone_chest_double.png deleted file mode 100644 index c95458c..0000000 Binary files a/src/main/resources/assets/hollow/textures/block/stone_chest_double.png and /dev/null differ diff --git a/src/main/resources/assets/hollow/textures/block/stone_chest_lid.png b/src/main/resources/assets/hollow/textures/block/stone_chest_lid.png index e1c9226..63e8a97 100644 Binary files a/src/main/resources/assets/hollow/textures/block/stone_chest_lid.png and b/src/main/resources/assets/hollow/textures/block/stone_chest_lid.png differ diff --git a/src/main/resources/assets/hollow/textures/block/stone_chest_lid_double.png b/src/main/resources/assets/hollow/textures/block/stone_chest_lid_double.png deleted file mode 100644 index 95ad944..0000000 Binary files a/src/main/resources/assets/hollow/textures/block/stone_chest_lid_double.png and /dev/null differ diff --git a/src/main/resources/assets/hollow/textures/block/stone_chest_lid_single.png b/src/main/resources/assets/hollow/textures/block/stone_chest_lid_single.png new file mode 100644 index 0000000..a8ecefa Binary files /dev/null and b/src/main/resources/assets/hollow/textures/block/stone_chest_lid_single.png differ diff --git a/src/main/resources/assets/hollow/textures/block/stone_chest_single.png b/src/main/resources/assets/hollow/textures/block/stone_chest_single.png new file mode 100644 index 0000000..1fe83ec Binary files /dev/null and b/src/main/resources/assets/hollow/textures/block/stone_chest_single.png differ diff --git a/src/main/resources/assets/hollow/textures/block/white_wildflower.png b/src/main/resources/assets/hollow/textures/block/white_wildflower.png new file mode 100644 index 0000000..db0d941 Binary files /dev/null and b/src/main/resources/assets/hollow/textures/block/white_wildflower.png differ diff --git a/src/main/resources/assets/hollow/textures/item/blue_wildflower.png b/src/main/resources/assets/hollow/textures/item/blue_wildflower.png new file mode 100644 index 0000000..50d55bc Binary files /dev/null and b/src/main/resources/assets/hollow/textures/item/blue_wildflower.png differ diff --git a/src/main/resources/assets/hollow/textures/item/pink_wildflower.png b/src/main/resources/assets/hollow/textures/item/pink_wildflower.png new file mode 100644 index 0000000..10a72e8 Binary files /dev/null and b/src/main/resources/assets/hollow/textures/item/pink_wildflower.png differ diff --git a/src/main/resources/assets/hollow/textures/item/polypore.png b/src/main/resources/assets/hollow/textures/item/polypore.png index 44d5ac1..cf0d29d 100644 Binary files a/src/main/resources/assets/hollow/textures/item/polypore.png and b/src/main/resources/assets/hollow/textures/item/polypore.png differ diff --git a/src/main/resources/assets/hollow/textures/item/purple_wildflower.png b/src/main/resources/assets/hollow/textures/item/purple_wildflower.png new file mode 100644 index 0000000..fca60ef Binary files /dev/null and b/src/main/resources/assets/hollow/textures/item/purple_wildflower.png differ diff --git a/src/main/resources/assets/hollow/textures/item/white_wildflower.png b/src/main/resources/assets/hollow/textures/item/white_wildflower.png new file mode 100644 index 0000000..eea19ac Binary files /dev/null and b/src/main/resources/assets/hollow/textures/item/white_wildflower.png differ diff --git a/src/main/resources/data/hollow/tags/worldgen/biome/closer_fog.json b/src/main/resources/data/hollow/tags/worldgen/biome/closer_fog.json deleted file mode 100644 index 0f5eb22..0000000 --- a/src/main/resources/data/hollow/tags/worldgen/biome/closer_fog.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "values": [ - "minecraft:swamp", - "minecraft:mangrove_swamp" - ] -} \ No newline at end of file diff --git a/src/main/resources/data/hollow/worldgen/configured_feature/birch_forest_flowers.json b/src/main/resources/data/hollow/worldgen/configured_feature/birch_forest_flowers.json deleted file mode 100644 index 5802b88..0000000 --- a/src/main/resources/data/hollow/worldgen/configured_feature/birch_forest_flowers.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "type": "minecraft:simple_random_selector", - "config": { - "features": [ - { - "feature": { - "type": "minecraft:no_bonemeal_flower", - "config": { - "feature": { - "feature": { - "type": "minecraft:simple_block", - "config": { - "to_place": { - "type": "minecraft:simple_state_provider", - "state": { - "Name": "minecraft:allium" - } - } - } - }, - "placement": [ - { - "type": "minecraft:block_predicate_filter", - "predicate": { - "type": "minecraft:matching_blocks", - "blocks": "minecraft:air" - } - } - ] - }, - "tries": 10, - "xz_spread": 7, - "y_spread": 3 - } - }, - "placement": [] - }, - { - "feature": { - "type": "minecraft:no_bonemeal_flower", - "config": { - "feature": { - "feature": { - "type": "minecraft:simple_block", - "config": { - "to_place": { - "type": "minecraft:simple_state_provider", - "state": { - "Name": "minecraft:oxeye_daisy" - } - } - } - }, - "placement": [ - { - "type": "minecraft:block_predicate_filter", - "predicate": { - "type": "minecraft:matching_blocks", - "blocks": "minecraft:air" - } - } - ] - }, - "tries": 10, - "xz_spread": 7, - "y_spread": 3 - } - }, - "placement": [] - }, - { - "feature": { - "type": "minecraft:no_bonemeal_flower", - "config": { - "feature": { - "feature": { - "type": "minecraft:simple_block", - "config": { - "to_place": { - "type": "minecraft:simple_state_provider", - "state": { - "Name": "hollow:paeonia" - } - } - } - }, - "placement": [ - { - "type": "minecraft:block_predicate_filter", - "predicate": { - "type": "minecraft:matching_blocks", - "blocks": "minecraft:air" - } - } - ] - }, - "tries": 10, - "xz_spread": 7, - "y_spread": 3 - } - }, - "placement": [] - } - ] - } -} \ No newline at end of file diff --git a/src/main/resources/data/hollow/worldgen/configured_feature/birch_tall.json b/src/main/resources/data/hollow/worldgen/configured_feature/birch_tall.json deleted file mode 100644 index c01763d..0000000 --- a/src/main/resources/data/hollow/worldgen/configured_feature/birch_tall.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "minecraft:random_selector", - "config": { - "default": "hollow:birch_bees_0002", - "features": [ - { - "chance": 0.5, - "feature": "hollow:super_birch_bees_0002" - } - ] - } -} \ No newline at end of file diff --git a/src/main/resources/data/hollow/worldgen/configured_feature/fallen_birch.json b/src/main/resources/data/hollow/worldgen/configured_feature/fallen_birch.json deleted file mode 100644 index 97c00b9..0000000 --- a/src/main/resources/data/hollow/worldgen/configured_feature/fallen_birch.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "type": "hollow:fallen_tree", - "config": { - "state_provider": { - "type": "minecraft:simple_state_provider", - "state": { - "Name": "hollow:birch_hollow_log" - } - }, - "polypore": true, - "mossy": true - } -} \ No newline at end of file diff --git a/src/main/resources/data/hollow/worldgen/configured_feature/fallen_oak.json b/src/main/resources/data/hollow/worldgen/configured_feature/fallen_oak.json deleted file mode 100644 index f1c4932..0000000 --- a/src/main/resources/data/hollow/worldgen/configured_feature/fallen_oak.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "hollow:fallen_tree", - "config": { - "state_provider": { - "type": "minecraft:simple_state_provider", - "state": { - "Name": "hollow:oak_hollow_log" - } - }, - "mossy": true - } -} \ No newline at end of file diff --git a/src/main/resources/data/hollow/worldgen/configured_feature/patch_lilac.json b/src/main/resources/data/hollow/worldgen/configured_feature/patch_lilac.json deleted file mode 100644 index 464e5a8..0000000 --- a/src/main/resources/data/hollow/worldgen/configured_feature/patch_lilac.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "type": "minecraft:random_patch", - "config": { - "feature": { - "feature": { - "type": "minecraft:simple_block", - "config": { - "to_place": { - "type": "minecraft:simple_state_provider", - "state": { - "Name": "minecraft:lilac", - "Properties": { - "half": "lower" - } - } - } - } - }, - "placement": [ - { - "type": "minecraft:block_predicate_filter", - "predicate": { - "type": "minecraft:all_of", - "predicates": [ - { - "type": "minecraft:matching_blocks", - "blocks": "minecraft:air" - } - ] - } - } - ] - }, - "tries": 10, - "xz_spread": 7, - "y_spread": 3 - } -} diff --git a/src/main/resources/data/hollow/worldgen/configured_feature/swamp_flowers.json b/src/main/resources/data/hollow/worldgen/configured_feature/swamp_flowers.json deleted file mode 100644 index 33fb26d..0000000 --- a/src/main/resources/data/hollow/worldgen/configured_feature/swamp_flowers.json +++ /dev/null @@ -1,139 +0,0 @@ -{ - "type": "minecraft:simple_random_selector", - "config": { - "features": [ - { - "feature": { - "type": "minecraft:no_bonemeal_flower", - "config": { - "feature": { - "feature": { - "type": "minecraft:simple_block", - "config": { - "to_place": { - "type": "minecraft:simple_state_provider", - "state": { - "Name": "minecraft:blue_orchid" - } - } - } - }, - "placement": [ - { - "type": "minecraft:block_predicate_filter", - "predicate": { - "type": "minecraft:matching_blocks", - "blocks": "minecraft:air" - } - } - ] - }, - "tries": 10, - "xz_spread": 7, - "y_spread": 3 - } - }, - "placement": [] - }, - { - "feature": { - "type": "minecraft:no_bonemeal_flower", - "config": { - "feature": { - "feature": { - "type": "minecraft:simple_block", - "config": { - "to_place": { - "type": "minecraft:simple_state_provider", - "state": { - "Name": "minecraft:lily_of_the_valley" - } - } - } - }, - "placement": [ - { - "type": "minecraft:block_predicate_filter", - "predicate": { - "type": "minecraft:matching_blocks", - "blocks": "minecraft:air" - } - } - ] - }, - "tries": 10, - "xz_spread": 7, - "y_spread": 3 - } - }, - "placement": [] - }, - { - "feature": { - "type": "minecraft:no_bonemeal_flower", - "config": { - "feature": { - "feature": { - "type": "minecraft:simple_block", - "config": { - "to_place": { - "type": "minecraft:simple_state_provider", - "state": { - "Name": "hollow:rooted_orchid" - } - } - } - }, - "placement": [ - { - "type": "minecraft:block_predicate_filter", - "predicate": { - "type": "minecraft:matching_blocks", - "blocks": "minecraft:air" - } - } - ] - }, - "tries": 10, - "xz_spread": 7, - "y_spread": 3 - } - }, - "placement": [] - }, - { - "feature": { - "type": "minecraft:no_bonemeal_flower", - "config": { - "feature": { - "feature": { - "type": "minecraft:simple_block", - "config": { - "to_place": { - "type": "minecraft:simple_state_provider", - "state": { - "Name": "minecraft:azure_bluet" - } - } - } - }, - "placement": [ - { - "type": "minecraft:block_predicate_filter", - "predicate": { - "type": "minecraft:matching_blocks", - "blocks": "minecraft:air" - } - } - ] - }, - "tries": 10, - "xz_spread": 7, - "y_spread": 3 - } - }, - "placement": [] - } - ] - } -} \ No newline at end of file diff --git a/src/main/resources/data/hollow/worldgen/placed_feature/birch_bees_0002.json b/src/main/resources/data/hollow/worldgen/placed_feature/birch_bees_0002.json deleted file mode 100644 index 4e9abbf..0000000 --- a/src/main/resources/data/hollow/worldgen/placed_feature/birch_bees_0002.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "feature": "hollow:birch_bees_0002", - "placement": [ - { - "type": "minecraft:block_predicate_filter", - "predicate": { - "type": "minecraft:would_survive", - "state": { - "Name": "minecraft:birch_sapling", - "Properties": { - "stage": "0" - } - } - } - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/hollow/worldgen/placed_feature/birch_forest_flowers.json b/src/main/resources/data/hollow/worldgen/placed_feature/birch_forest_flowers.json deleted file mode 100644 index 78915dc..0000000 --- a/src/main/resources/data/hollow/worldgen/placed_feature/birch_forest_flowers.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "feature": "hollow:birch_forest_flowers", - "placement": [ - { - "type": "minecraft:in_square" - }, - { - "type": "minecraft:heightmap", - "heightmap": "MOTION_BLOCKING" - }, - { - "type": "minecraft:count", - "count": 5 - }, - { - "type": "minecraft:rarity_filter", - "chance": 2 - }, - { - "type": "minecraft:biome" - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/hollow/worldgen/placed_feature/birch_tall.json b/src/main/resources/data/hollow/worldgen/placed_feature/birch_tall.json deleted file mode 100644 index 0a37165..0000000 --- a/src/main/resources/data/hollow/worldgen/placed_feature/birch_tall.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "feature": "hollow:birch_tall", - "placement": [ - { - "type": "minecraft:count", - "count": { - "type": "minecraft:weighted_list", - "distribution": [ - { - "data": 10, - "weight": 9 - }, - { - "data": 11, - "weight": 1 - } - ] - } - }, - { - "type": "minecraft:in_square" - }, - { - "type": "minecraft:surface_water_depth_filter", - "max_water_depth": 0 - }, - { - "type": "minecraft:heightmap", - "heightmap": "OCEAN_FLOOR" - }, - { - "type": "minecraft:biome" - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/hollow/worldgen/placed_feature/fallen_birch.json b/src/main/resources/data/hollow/worldgen/placed_feature/fallen_birch.json deleted file mode 100644 index 6f97a37..0000000 --- a/src/main/resources/data/hollow/worldgen/placed_feature/fallen_birch.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "feature": "hollow:fallen_birch", - "placement": [ - { - "type": "minecraft:block_predicate_filter", - "predicate": { - "type": "minecraft:would_survive", - "state": { - "Name": "hollow:birch_hollow_log" - } - } - }, - { - "type": "minecraft:count", - "count": 1 - }, - { - "type": "minecraft:in_square" - }, - { - "type": "minecraft:heightmap", - "heightmap": "WORLD_SURFACE_WG" - }, - { - "type": "minecraft:biome" - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/hollow/worldgen/placed_feature/fallen_oak.json b/src/main/resources/data/hollow/worldgen/placed_feature/fallen_oak.json deleted file mode 100644 index 1d903be..0000000 --- a/src/main/resources/data/hollow/worldgen/placed_feature/fallen_oak.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "feature": "hollow:fallen_oak", - "placement": [ - { - "type": "minecraft:block_predicate_filter", - "predicate": { - "type": "minecraft:would_survive", - "state": { - "Name": "hollow:oak_hollow_log" - } - } - }, - { - "type": "minecraft:count", - "count": 1 - }, - { - "type": "minecraft:in_square" - }, - { - "type": "minecraft:heightmap", - "heightmap": "WORLD_SURFACE_WG" - }, - { - "type": "minecraft:biome" - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/hollow/worldgen/placed_feature/super_birch_bees_0002.json b/src/main/resources/data/hollow/worldgen/placed_feature/super_birch_bees_0002.json deleted file mode 100644 index 33ea79f..0000000 --- a/src/main/resources/data/hollow/worldgen/placed_feature/super_birch_bees_0002.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "feature": "hollow:super_birch_bees_0002", - "placement": [ - { - "type": "minecraft:block_predicate_filter", - "predicate": { - "type": "minecraft:would_survive", - "state": { - "Name": "minecraft:birch_sapling", - "Properties": { - "stage": "0" - } - } - } - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/hollow/worldgen/placed_feature/swamp_flowers.json b/src/main/resources/data/hollow/worldgen/placed_feature/swamp_flowers.json deleted file mode 100644 index b444ad9..0000000 --- a/src/main/resources/data/hollow/worldgen/placed_feature/swamp_flowers.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "feature": "hollow:swamp_flowers", - "placement": [ - { - "type": "minecraft:in_square" - }, - { - "type": "minecraft:heightmap", - "heightmap": "MOTION_BLOCKING" - }, - { - "type": "minecraft:count", - "count": 5 - }, - { - "type": "minecraft:rarity_filter", - "chance": 2 - }, - { - "type": "minecraft:biome" - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/minecraft/advancement/adventure/diversity_win.json b/src/main/resources/data/minecraft/advancement/adventure/diversity_win.json deleted file mode 100644 index be387a3..0000000 --- a/src/main/resources/data/minecraft/advancement/adventure/diversity_win.json +++ /dev/null @@ -1,111 +0,0 @@ -{ - "display": { - "icon": { - "id": "minecraft:beacon" - }, - "title": { - "translate": "advancements.adventure.diversity_win.title" - }, - "description": { - "translate": "advancements.adventure.diversity_win.description" - }, - "frame": "challenge", - "show_toast": true, - "announce_to_chat": true, - "hidden": false - }, - "parent": "minecraft:adventure/root", - "criteria": { - "diverse_inventory": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { - "items": [ - "minecraft:yellow_dye" - ] - }, - { - "items": [ - "minecraft:white_dye" - ] - }, - { - "items": [ - "minecraft:red_dye" - ] - }, - { - "items": [ - "minecraft:purple_dye" - ] - }, - { - "items": [ - "minecraft:pink_dye" - ] - }, - { - "items": [ - "minecraft:orange_dye" - ] - }, - { - "items": [ - "minecraft:magenta_dye" - ] - }, - { - "items": [ - "minecraft:lime_dye" - ] - }, - { - "items": [ - "minecraft:light_gray_dye" - ] - }, - { - "items": [ - "minecraft:light_blue_dye" - ] - }, - { - "items": [ - "minecraft:green_dye" - ] - }, - { - "items": [ - "minecraft:gray_dye" - ] - }, - { - "items": [ - "minecraft:cyan_dye" - ] - }, - { - "items": [ - "minecraft:brown_dye" - ] - }, - { - "items": [ - "minecraft:blue_dye" - ] - }, - { - "items": [ - "minecraft:black_dye" - ] - } - ] - } - - } - }, - "requirements": [[ - "diverse_inventory" - ]] -} diff --git a/src/main/resources/data/minecraft/tags/block/flower_pots.json b/src/main/resources/data/minecraft/tags/block/flower_pots.json deleted file mode 100644 index 64c17ab..0000000 --- a/src/main/resources/data/minecraft/tags/block/flower_pots.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "replace": false, - "values": [ - "hollow:potted_paeonia", - "hollow:potted_rooted_orchid" - ] -} \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/block/small_flowers.json b/src/main/resources/data/minecraft/tags/block/small_flowers.json deleted file mode 100644 index fcb20e8..0000000 --- a/src/main/resources/data/minecraft/tags/block/small_flowers.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "replace": false, - "values": [ - "hollow:paeonia", - "hollow:lotus_lilypad", - "hollow:rooted_orchid" - ] -} \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/block/mineable/hoe.json b/src/main/resources/data/minecraft/tags/damage_type/no_knockback.json similarity index 100% rename from src/main/resources/data/minecraft/tags/block/mineable/hoe.json rename to src/main/resources/data/minecraft/tags/damage_type/no_knockback.json diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 30c3582..d4b31f1 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -1,7 +1,7 @@ { "schemaVersion": 1, - "id": "hollow", - "version": "${version}", + "id": "${mod_id}", + "version": "${mod_version}", "name": "Hollow", "description": "A mod about hollow logs and hollow promises.", "authors": [ @@ -38,10 +38,10 @@ ], "accessWidener": "hollow.accesswidener", "depends": { - "fabricloader": ">=${loader_version}", - "minecraft": "~${minecraft_version}", + "fabricloader": ">=${fabric_loader_version}", + "minecraft": "~${minecraft_version}-", "fabric-api": "*", "java": ">=21", - "specter": "*" + "specter-core": "*" } } diff --git a/src/main/resources/hollow.accesswidener b/src/main/resources/hollow.accesswidener index ac7d069..7cdfc73 100644 --- a/src/main/resources/hollow.accesswidener +++ b/src/main/resources/hollow.accesswidener @@ -1,7 +1,2 @@ accessWidener v2 named -accessible field net/minecraft/block/AbstractBlock settings Lnet/minecraft/block/AbstractBlock$Settings; -accessible method net/minecraft/world/gen/feature/TreeConfiguredFeatures builder (Lnet/minecraft/block/Block;Lnet/minecraft/block/Block;IIII)Lnet/minecraft/world/gen/feature/TreeFeatureConfig$Builder; -accessible class net/minecraft/block/SculkVeinBlock$SculkVeinGrowChecker -accessible field net/minecraft/entity/ai/WardenAngerManager suspectUuidsToAngerLevel Lit/unimi/dsi/fastutil/objects/Object2IntMap; -accessible field net/minecraft/entity/ai/WardenAngerManager suspects Ljava/util/ArrayList; accessible class net/minecraft/client/render/BackgroundRenderer$FogData \ No newline at end of file diff --git a/src/main/resources/hollow.mixins.json b/src/main/resources/hollow.mixins.json index 19505b2..c9334c5 100644 --- a/src/main/resources/hollow.mixins.json +++ b/src/main/resources/hollow.mixins.json @@ -5,10 +5,10 @@ "compatibilityLevel": "JAVA_21", "mixins": [ "BulbBlockMixin", - "EntityMixin", "FrogEatEntityTaskMixin", "SaplingGeneratorMixin", "SculkBlockMixin", + "SculkVeinBlockMixin", "SculkVeinGrowCheckerMixin" ], "injectors": { diff --git a/src/main/resources/resourcepacks/hollow_music/assets/cabinetapi/biome_effects/birch.json b/src/main/resources/resourcepacks/hollow_music/assets/cabinetapi/biome_effects/birch.json deleted file mode 100644 index 5b110ec..0000000 --- a/src/main/resources/resourcepacks/hollow_music/assets/cabinetapi/biome_effects/birch.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "targets": [ - "minecraft:birch_forest", - "minecraft:old_growth_birch_forest" - ], - "water_color": 4445678, - "water_fog_color": 270131, - "music": { - "max_delay": 24000, - "min_delay": 12000, - "replace_current_music": false, - "sound": { "sound_id":"hollow:music.birch_forest" } - } -} \ No newline at end of file diff --git a/src/main/resources/resourcepacks/hollow_music/assets/cabinetapi/biome_effects/deep_dark.json b/src/main/resources/resourcepacks/hollow_music/assets/cabinetapi/biome_effects/deep_dark.json deleted file mode 100644 index 607fd61..0000000 --- a/src/main/resources/resourcepacks/hollow_music/assets/cabinetapi/biome_effects/deep_dark.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "targets": [ - "minecraft:deep_dark" - ], - "music": { - "max_delay": 24000, - "min_delay": 12000, - "replace_current_music": false, - "sound": { "sound_id":"hollow:music.deep_dark" } - } -} \ No newline at end of file diff --git a/src/main/resources/resourcepacks/hollow_music/assets/cabinetapi/biome_effects/swamps.json b/src/main/resources/resourcepacks/hollow_music/assets/cabinetapi/biome_effects/swamps.json deleted file mode 100644 index 3a4b6d9..0000000 --- a/src/main/resources/resourcepacks/hollow_music/assets/cabinetapi/biome_effects/swamps.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "targets": [ - "minecraft:swamp", - "minecraft:mangrove_swamp" - ], - "music": { - "max_delay": 24000, - "min_delay": 12000, - "replace_current_music": false, - "sound": { "sound_id":"hollow:music.swamp" } - } -} \ No newline at end of file diff --git a/src/main/resources/resourcepacks/hollow_music/pack.mcmeta b/src/main/resources/resourcepacks/hollow_music/pack.mcmeta deleted file mode 100644 index 2375fb5..0000000 --- a/src/main/resources/resourcepacks/hollow_music/pack.mcmeta +++ /dev/null @@ -1,6 +0,0 @@ -{ - "pack": { - "pack_format": 34, - "description": "Custom biome music. Made by WorldWidePixel." - } -} \ No newline at end of file diff --git a/src/main/resources/resourcepacks/hollow_music/pack.png b/src/main/resources/resourcepacks/hollow_music/pack.png deleted file mode 100644 index 607d7e9..0000000 Binary files a/src/main/resources/resourcepacks/hollow_music/pack.png and /dev/null differ