Skip to content

Commit

Permalink
1.1.0, Darkest Depths.
Browse files Browse the repository at this point in the history
  • Loading branch information
CallMeEchoCodes authored Mar 25, 2024
2 parents 10e5658 + 1c6f113 commit 63dba17
Show file tree
Hide file tree
Showing 144 changed files with 4,061 additions and 140 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches:
- main
- dev

jobs:
build:
Expand Down
45 changes: 14 additions & 31 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '1.5-SNAPSHOT'
id "fabric-loom" version "1.5-SNAPSHOT"
}

version = project.mod_version
Expand All @@ -11,19 +11,11 @@ base {

repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
filter {
includeGroup "maven.modrinth"
}
maven { url "https://maven.callmeecho.dev/releases" }
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
mavenLocal()
}

loom {
Expand All @@ -33,7 +25,7 @@ loom {
name("Minecraft Data")
vmArg("-Dfabric-api.datagen")
vmArg("-Dfabric-api.datagen.output-dir=${file("src/main/generated")}")
vmArg("-Dfabric-api.datagen.modid=${project.archives_base_name}")
vmArg("-Dfabric-api.datagen.modid=${project.properties.archives_base_name}")

runDir("build/datagen")
}
Expand All @@ -50,43 +42,34 @@ sourceSets {
}
}

configurations.all {
// check for updates every build
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}

dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"

modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

include "com.github.CallMeEchoCodes:CabinetAPI:main-SNAPSHOT"
modImplementation "com.github.CallMeEchoCodes:CabinetAPI:main-SNAPSHOT"
include "dev.callmeecho:CabinetAPI:${project.cabinet_version}"
modImplementation "dev.callmeecho:CabinetAPI:${project.cabinet_version}"

modCompileOnly "maven.modrinth:lambdynamiclights:2.3.2+1.20.1"
}

processResources {
inputs.property "version", project.version
inputs.property "minecraft_version", project.minecraft_version
inputs.property "loader_version", project.loader_version
inputs.property "version", project.properties.version
inputs.property "minecraft_version", project.properties.minecraft_version
inputs.property "loader_version", project.properties.loader_version
filteringCharset "UTF-8"

filesMatching("fabric.mod.json") {
expand "version": project.version,
"minecraft_version": project.minecraft_version,
"loader_version": project.loader_version
"minecraft_version": project.properties.minecraft_version,
"loader_version": project.properties.loader_version
}
}

def targetJavaVersion = 17
tasks.withType(JavaCompile).configureEach {
// ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
// If Javadoc is generated, this must be specified in that task too.
it.options.encoding = "UTF-8"
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
it.options.release.set(targetJavaVersion)
Expand All @@ -104,6 +87,6 @@ java {

jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}" }
rename { "${it}_${project.properties.archives_base_name}" }
}
}
7 changes: 5 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
org.gradle.jvmargs=-Xmx2G
org.gradle.parallel=true

minecraft_version=1.20.1
yarn_mappings=1.20.1+build.10
loader_version=0.15.7
mod_version=1.0.0

mod_version=1.1.0
maven_group=dev.callmeecho
archives_base_name=hollow

fabric_version=0.92.0+1.20.1
owo_version=0.11.2+1.20
cabinet_version=1.1.1+1.20.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 1.20.1 2024-03-08T12:54:43.074554591 Hollow/Model Definitions
// 1.20.1 2024-03-17T16:13:48.575690795 Hollow/Model Definitions
957f8f0186bb09ed323faac324b5df5f8671b02d assets/hollow/models/block/stripped_cherry_hollow_log.json
dc39eb275cecfb4cdd0b15185f9a6f45ac57d158 assets/hollow/models/block/oak_hollow_log.json
551b73de8d5dab1b2e575497400b9e3fc400ba3d assets/hollow/models/block/stripped_crimson_hollow_stem_horizontal_mossy.json
Expand Down Expand Up @@ -26,9 +26,9 @@ c8dddd382d7b95465f1bad6d39b574936c761c2e assets/hollow/blockstates/crimson_hollo
eccde5d9fc0a51d3456d1cbbd861e16fe7a2ae81 assets/hollow/models/block/dark_oak_hollow_log_horizontal.json
cc8a9a697fce263135c4235b3670fa87e01cb576 assets/hollow/models/item/cherry_hollow_log.json
26b0e7415c223877d641d90537bd4fe0b49d9cc6 assets/hollow/models/block/mangrove_hollow_log_horizontal.json
49c39f50a7348608a7c478d87f9459c9f951f7fc assets/hollow/models/block/dark_oak_hollow_log.json
a70d2f5e26a3b6c46e7de183d8aa0b5a569065e9 assets/hollow/models/block/stripped_mangrove_hollow_log.json
a9423afcf70352085e44cb7ef99081a4ae18ef2f assets/hollow/blockstates/spruce_hollow_log.json
49c39f50a7348608a7c478d87f9459c9f951f7fc assets/hollow/models/block/dark_oak_hollow_log.json
966fac768c68e11db000550af53f7777145c3356 assets/hollow/models/block/mangrove_hollow_log_horizontal_mossy.json
d2b27363f222a836291843499134c1c713d8b9ce assets/hollow/models/item/stripped_acacia_hollow_log.json
82865629b9d5c538884c048ed41add5144f69959 assets/hollow/models/block/stripped_cherry_hollow_log_horizontal_mossy.json
Expand Down Expand Up @@ -77,8 +77,8 @@ adf1da65084b7a6ff863997bc07f754171e58dca assets/hollow/models/block/stripped_war
8db731ec79548ebe7a5aa3fea3ff245e4a160377 assets/hollow/models/block/acacia_hollow_log_horizontal_mossy.json
836578f3c86b198f1ceba95c8e1141341f8c6b90 assets/hollow/models/item/jungle_hollow_log.json
61592e06109b7294c04f553a970f46a2506ae4f3 assets/hollow/models/item/stripped_dark_oak_hollow_log.json
a21ff2ad94b2112f95c1bb9925c5e4757c3b0d59 assets/hollow/models/block/acacia_hollow_log.json
d0178037159c2345805fb7dd255a30543bfa3cb3 assets/hollow/models/block/stripped_acacia_hollow_log_horizontal_mossy.json
a21ff2ad94b2112f95c1bb9925c5e4757c3b0d59 assets/hollow/models/block/acacia_hollow_log.json
d37c24fa00564bc4f804814d0bb9956d8e46ea1e assets/hollow/models/block/stripped_birch_hollow_log.json
11da09224c8985ed063a448b3d12ba008357a389 assets/hollow/blockstates/oak_hollow_log.json
38d91c14c8ba0e4cb7f2a10d03ddcf7d957fdae6 assets/hollow/blockstates/stripped_jungle_hollow_log.json
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 1.20.1 2024-03-08T12:54:43.076047995 Hollow/Block Loot Tables
// 1.20.1 2024-03-17T16:13:48.576957648 Hollow/Block Loot Tables
c90504ecf85f2caac3b369f9d1d858efa61d9423 data/hollow/loot_tables/blocks/crimson_hollow_stem.json
e2c52e219bd102fafe6c7ee376f05dc00a70ac46 data/hollow/loot_tables/blocks/stripped_crimson_hollow_stem.json
ee5b1774f2b84542ba3a63ccf9eb0fccfaa9dc8a data/hollow/loot_tables/blocks/stripped_acacia_hollow_log.json
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// 1.20.1 2024-03-08T12:54:43.076295864 Hollow/Recipes
// 1.20.1 2024-03-17T16:13:48.577212637 Hollow/Recipes
0b3df8fc09291b1f2b14eb145201fc55b56a2e4a data/hollow/advancements/recipes/decorations/mangrove_hollow_log.json
689145296a1bdcce023a5fdbaf3f3c2b6dc0fbec data/hollow/recipes/jungle_hollow_log.json
92e83d727e60e17db788d9ae6afe9def0a100aab data/hollow/advancements/recipes/decorations/birch_hollow_log.json
abf06b668cb9e9bf36438a37efc6de0e734695ef data/hollow/advancements/recipes/decorations/acacia_hollow_log.json
7b5799e7631464a36711546b463c47d1161a48e4 data/hollow/recipes/oak_hollow_log.json
33088f2a8bfa861d2d579570821e8c4f7e61e43d data/hollow/recipes/dark_oak_hollow_log.json
85c5637f0a49ddbe39c9a5329f1ec462ea754eaf data/hollow/advancements/recipes/decorations/dark_oak_hollow_log.json
cae6219aa30560643ab69437c80ff286ddf684a6 data/hollow/recipes/warped_hollow_stem.json
85c5637f0a49ddbe39c9a5329f1ec462ea754eaf data/hollow/advancements/recipes/decorations/dark_oak_hollow_log.json
7e411907b3b8902ddd1f81e1c22a16e4682a110d data/hollow/recipes/cherry_hollow_log.json
98989f3511fdd7112aa417c743a8f0a62e930859 data/hollow/recipes/birch_hollow_log.json
1bb2752afa3d97dd0dbfae1c5cf97e690a852085 data/hollow/advancements/recipes/decorations/oak_hollow_log.json
Expand Down
22 changes: 17 additions & 5 deletions src/main/java/dev/callmeecho/hollow/client/HollowClient.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
package dev.callmeecho.hollow.client;

import dev.callmeecho.cabinetapi.util.ReflectionHelper;
import dev.callmeecho.cabinetapi.registry.RegistrarHandler;
import dev.callmeecho.hollow.client.render.entity.FireflyEntityRenderer;
import dev.callmeecho.hollow.client.render.entity.JarBlockEntityRenderer;
import dev.callmeecho.hollow.main.Hollow;
import dev.callmeecho.hollow.main.block.HollowLogBlock;
import dev.callmeecho.hollow.main.registry.HollowBlockRegistry;
import dev.callmeecho.hollow.main.registry.HollowEntityTypeRegistry;
import dev.callmeecho.hollow.main.registry.HollowItemRegistry;
import dev.callmeecho.hollow.main.particle.FireflyJarParticle;
import dev.callmeecho.hollow.main.registry.*;
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.rendereregistry.v1.BlockEntityRendererRegistry;
import net.fabricmc.fabric.api.client.rendering.v1.ColorProviderRegistry;
import net.fabricmc.fabric.api.client.rendering.v1.EntityRendererRegistry;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.client.render.block.entity.BlockEntityRendererFactories;

public class HollowClient implements ClientModInitializer {
@Override
Expand All @@ -23,11 +29,17 @@ public void onInitializeClient() {
BlockRenderLayerMap.INSTANCE.putBlock(HollowBlockRegistry.CAMPION, RenderLayer.getCutout());
BlockRenderLayerMap.INSTANCE.putBlock(HollowBlockRegistry.POLYPORE, RenderLayer.getCutout());
BlockRenderLayerMap.INSTANCE.putBlock(HollowBlockRegistry.POTTED_PAEONIA, RenderLayer.getCutout());
BlockRenderLayerMap.INSTANCE.putBlock(HollowBlockRegistry.JAR, RenderLayer.getCutout());
BlockRenderLayerMap.INSTANCE.putBlock(HollowBlockRegistry.FIREFLY_JAR, RenderLayer.getCutout());
BlockRenderLayerMap.INSTANCE.putBlock(HollowBlockRegistry.ROOT_VINES, RenderLayer.getCutout());

RegistrarHandler.<HollowLogBlock>forEach(HollowBlockRegistry.class, (block) -> BlockRenderLayerMap.INSTANCE.putBlock(block, RenderLayer.getCutoutMipped()));
BlockEntityRendererFactories.register(HollowBlockEntityRegistry.JAR_BLOCK_ENTITY, JarBlockEntityRenderer::new);

ReflectionHelper.forEachStaticField(HollowBlockRegistry.class, HollowLogBlock.class, (block, name, field) -> BlockRenderLayerMap.INSTANCE.putBlock(block, RenderLayer.getCutoutMipped()));

ColorProviderRegistry.BLOCK.register((state, world, pos, tintIndex) -> world != null && pos != null ? 0x208030 : 0x71C35C, HollowBlockRegistry.LOTUS_LILYPAD);
ColorProviderRegistry.ITEM.register((stack, tintIndex) -> tintIndex == 0 ? 0x71C35C : -1, HollowItemRegistry.LOTUS_LILYPAD);

ParticleFactoryRegistry.getInstance().register(HollowParticleRegistrar.FIREFLY_JAR, FireflyJarParticle.Factory::new);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package dev.callmeecho.hollow.client.render.entity;

import dev.callmeecho.hollow.main.block.entity.JarBlockEntity;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.render.OverlayTexture;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.block.entity.BlockEntityRenderer;
import net.minecraft.client.render.block.entity.BlockEntityRendererFactory;
import net.minecraft.client.render.item.ItemRenderer;
import net.minecraft.client.render.model.json.ModelTransformationMode;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.util.collection.DefaultedList;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.RotationAxis;
import net.minecraft.world.World;

public class JarBlockEntityRenderer implements BlockEntityRenderer<JarBlockEntity> {
public JarBlockEntityRenderer(BlockEntityRendererFactory.Context ignoredCtx) { }

@Override
public void render(JarBlockEntity blockEntity, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay) {
final MinecraftClient client = MinecraftClient.getInstance();
World world = client.world;
ItemRenderer renderer = client.getItemRenderer();
DefaultedList<ItemStack> items = blockEntity.getItems();
if (items.isEmpty() || world == null) return;

matrices.push();
matrices.translate(0.5F, 0.05F, 0.5F);
matrices.scale(0.45F, 0.45F, 0.45F);
matrices.multiply(RotationAxis.POSITIVE_X.rotationDegrees(90.0F));
for (ItemStack item : items) {
matrices.translate(0.0F, 0.0F, -0.0625F);
matrices.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(22.5F));
renderer.renderItem(item, ModelTransformationMode.FIXED, light, OverlayTexture.DEFAULT_UV, matrices, vertexConsumers, null, 0);
}
matrices.pop();
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package dev.callmeecho.hollow.datagen;

import dev.callmeecho.cabinetapi.util.ReflectionHelper;
import dev.callmeecho.cabinetapi.registry.RegistrarHandler;
import dev.callmeecho.hollow.main.block.HollowLogBlock;
import dev.callmeecho.hollow.main.registry.HollowBlockRegistry;
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
import net.fabricmc.fabric.api.datagen.v1.provider.FabricBlockLootTableProvider;
import net.minecraft.block.Block;
import net.minecraft.loot.LootTable;
import net.minecraft.loot.provider.number.ConstantLootNumberProvider;
import net.minecraft.util.Identifier;
Expand All @@ -21,6 +23,9 @@ public void generate() { }

@Override
public void accept(BiConsumer<Identifier, LootTable.Builder> biConsumer) {
RegistrarHandler.<HollowLogBlock>forEach(HollowBlockRegistry.class, (block) -> biConsumer.accept(block.getLootTableId(), this.drops(block, ConstantLootNumberProvider.create(1.0f))));
ReflectionHelper.forEachStaticField(
HollowBlockRegistry.class,
HollowLogBlock.class,
(block, name, field) -> biConsumer.accept(block.getLootTableId(), this.drops(block, ConstantLootNumberProvider.create(1.0f))));
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package dev.callmeecho.hollow.datagen;

import dev.callmeecho.cabinetapi.util.ReflectionHelper;
import dev.callmeecho.cabinetapi.registry.RegistrarHandler;
import dev.callmeecho.hollow.main.block.HollowLogBlock;
import dev.callmeecho.hollow.main.registry.HollowBlockRegistry;
Expand All @@ -23,7 +24,7 @@ public class ModelProvider extends FabricModelProvider {

@Override
public void generateBlockStateModels(BlockStateModelGenerator blockStateModelGenerator) {
RegistrarHandler.<HollowLogBlock>forEach(HollowBlockRegistry.class, (block) -> {
ReflectionHelper.forEachStaticField(HollowBlockRegistry.class, HollowLogBlock.class, (block, name, field) -> {
TextureMap textureMap = new TextureMap().put(TextureKey.SIDE, new Identifier("minecraft", "block/" + block.sideTexture)).put(TextureKey.INSIDE, new Identifier("minecraft", "block/" + block.insideTexture)).put(TextureKey.END, new Identifier("minecraft", "block/" + block.endTexture));
Identifier hollowLog = HOLLOW_LOG.upload(block, textureMap, blockStateModelGenerator.modelCollector);
Identifier hollowLogHorizontal = HOLLOW_LOG_HORIZONTAL.upload(block, textureMap, blockStateModelGenerator.modelCollector);
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/dev/callmeecho/hollow/main/Hollow.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
public class Hollow implements ModInitializer {
public static final String MODID = "hollow";
public static final Logger LOGGER = LoggerFactory.getLogger(MODID);

public static final CabinetItemGroup GROUP = new CabinetItemGroup(new Identifier(MODID, "item_group"), HollowBlockRegistry.BIRCH_HOLLOW_LOG);

@Override
Expand All @@ -23,6 +23,8 @@ public void onInitialize() {
RegistrarHandler.process(HollowEntityTypeRegistry.class, MODID);
RegistrarHandler.process(HollowFeatureRegistry.class, MODID);
RegistrarHandler.process(HollowTreeDecoratorRegistry.class, MODID);
RegistrarHandler.process(HollowBlockEntityRegistry.class, MODID);
RegistrarHandler.process(HollowParticleRegistrar.class, MODID);

FabricDefaultAttributeRegistry.register(HollowEntityTypeRegistry.FIREFLY, FireflyEntity.createFireflyAttributes());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@
import net.minecraft.registry.RegistryKeys;
import net.minecraft.util.Identifier;
import net.minecraft.world.Heightmap;
import net.minecraft.world.biome.BiomeEffects;
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.Optional;

public class HollowBiomeModifications {
public static void init() {
BiomeModifications.addSpawn(BiomeSelectors.includeByKey(
Expand All @@ -35,6 +38,33 @@ public static void init() {
generationSettings.addFeature(GenerationStep.Feature.VEGETAL_DECORATION, getPlacedFeature("patch_waterlily"));
});

BiomeModifications.create(new Identifier(Hollow.MODID, "better_swamp_replace")).add(ModificationPhase.REPLACEMENTS, BiomeSelectors.includeByKey(
BiomeKeys.SWAMP
), context -> {
BiomeModificationContext.GenerationSettingsContext generationSettings = context.getGenerationSettings();

if (generationSettings.removeFeature(VegetationPlacedFeatures.FLOWER_SWAMP))
generationSettings.addFeature(GenerationStep.Feature.VEGETAL_DECORATION, getPlacedFeature("swamp_flowers"));
});

BiomeModifications.create(new Identifier(Hollow.MODID, "better_swamp_add")).add(ModificationPhase.ADDITIONS, BiomeSelectors.includeByKey(
BiomeKeys.SWAMP
), context -> {
BiomeModificationContext.GenerationSettingsContext generationSettings = context.getGenerationSettings();

generationSettings.addFeature(GenerationStep.Feature.VEGETAL_DECORATION, getPlacedFeature("fallen_oak"));
generationSettings.addFeature(GenerationStep.Feature.VEGETAL_DECORATION, getPlacedFeature("huge_brown_mushroom"));
});

BiomeModifications.create(new Identifier(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"));
});

BiomeModifications.create(new Identifier(Hollow.MODID, "better_birch_add")).add(ModificationPhase.ADDITIONS, BiomeSelectors.includeByKey(
BiomeKeys.BIRCH_FOREST,
BiomeKeys.OLD_GROWTH_BIRCH_FOREST
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dev.callmeecho.hollow;
package dev.callmeecho.hollow.main;

import dev.callmeecho.hollow.main.Hollow;
import net.minecraft.block.Block;
Expand Down
Loading

0 comments on commit 63dba17

Please sign in to comment.