Skip to content

Commit

Permalink
Added Void Bloom and some Muria Stuff
Browse files Browse the repository at this point in the history
also improved cutout registering but thats a minor change
  • Loading branch information
JaegerwaldDev committed Dec 10, 2024
1 parent 6c221f5 commit 31d0a17
Show file tree
Hide file tree
Showing 23 changed files with 221 additions and 23 deletions.
16 changes: 11 additions & 5 deletions src/client/java/dev/jaegerwald/voidlings/VoidlingsClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
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.DimensionRenderingRegistry;
import net.minecraft.block.Block;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
Expand All @@ -17,18 +18,23 @@ public class VoidlingsClient implements ClientModInitializer {
@Override
public void onInitializeClient() {
// This entrypoint is suitable for setting up client-specific logic, such as rendering.
BlockRenderLayerMap.INSTANCE.putBlock(ModBlocks.ACID_SPROUTS, RenderLayer.getCutout());
BlockRenderLayerMap.INSTANCE.putBlock(ModBlocks.VOID_TANGLE, RenderLayer.getCutout());
BlockRenderLayerMap.INSTANCE.putBlock(ModBlocks.VOID_TANGLE_PLANT, RenderLayer.getCutout());
BlockRenderLayerMap.INSTANCE.putBlock(ModBlocks.VOID_VINES, RenderLayer.getCutout());
BlockRenderLayerMap.INSTANCE.putBlock(ModBlocks.VOID_VINES_PLANT, RenderLayer.getCutout());
registerBlockCutout(ModBlocks.ACID_SPROUTS);
registerBlockCutout(ModBlocks.VOID_TANGLE);
registerBlockCutout(ModBlocks.VOID_TANGLE_PLANT);
registerBlockCutout(ModBlocks.VOID_VINES);
registerBlockCutout(ModBlocks.VOID_VINES_PLANT);
registerBlockCutout(ModBlocks.VOID_BLOOM);

registerParticlesBcSplitSourcesBS();

DimensionRenderingRegistry.registerDimensionEffects(Identifier.of(Voidlings.MOD_ID, "hollow"), new HollowDimensionEffects());
DimensionRenderingRegistry.registerCloudRenderer(RegistryKey.of(RegistryKeys.WORLD, Identifier.of(Voidlings.MOD_ID, "hollow")), new HollowDimensionEffects.CloudRenderer());
}

private void registerBlockCutout(Block block) {
BlockRenderLayerMap.INSTANCE.putBlock(block, RenderLayer.getCutout());
}

private static void registerParticlesBcSplitSourcesBS() {
ParticleFactoryRegistry particleRegistry = ParticleFactoryRegistry.getInstance();

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "voidlings:block/acid_encased_muria"
}
}
}
21 changes: 21 additions & 0 deletions src/client/resources/assets/voidlings/blockstates/void_bloom.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"variants": {
"": [
{
"model": "voidlings:block/void_bloom"
},
{
"model": "voidlings:block/void_bloom",
"y": 90
},
{
"model": "voidlings:block/void_bloom",
"y": 180
},
{
"model": "voidlings:block/void_bloom",
"y": 270
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"parent": "minecraft:block/cube_column",
"textures": {
"end": "voidlings:block/acid_encased_muria_top",
"side": "voidlings:block/acid_encased_muria"
}
}
16 changes: 16 additions & 0 deletions src/client/resources/assets/voidlings/models/block/void_bloom.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"ambientocclusion": false,
"textures": {
"particle": "voidlings:block/void_bloom",
"texture": "voidlings:block/void_bloom"
},
"elements": [
{ "from": [ 0, 0.25, 0 ],
"to": [ 16, 0.25, 16 ],
"faces": {
"down": { "uv": [ 0, 16, 16, 0 ], "texture": "#texture", "tintindex": 0 },
"up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "tintindex": 0 }
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"parent": "voidlings:block/acid_encased_muria"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "voidlings:item/raw_muria"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "voidlings:block/void_bloom"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 28 additions & 4 deletions src/main/java/dev/jaegerwald/voidlings/block/ModBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import net.minecraft.registry.Registry;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.intprovider.ConstantIntProvider;

public class ModBlocks {
public static final Block BLACK_ACID = registerBlock("black_acid",
Expand All @@ -31,7 +32,7 @@ public class ModBlocks {
.sounds(BlockSoundGroup.WET_GRASS)
.offset(AbstractBlock.OffsetType.XZ)
.pistonBehavior(PistonBehavior.DESTROY)
.luminance(state -> 14)
.luminance(state -> 8)
)
);

Expand Down Expand Up @@ -94,9 +95,8 @@ public class ModBlocks {
new VoidVinesHeadBlock(
AbstractBlock.Settings.create()
.mapColor(MapColor.CYAN)
.ticksRandomly()
.noCollision()
.luminance(VoidVines.getLuminanceSupplier(14))
.luminance(VoidVines.getLuminanceSupplier(8))
.breakInstantly()
.sounds(BlockSoundGroup.WET_GRASS)
.pistonBehavior(PistonBehavior.DESTROY)
Expand All @@ -107,13 +107,37 @@ public class ModBlocks {
AbstractBlock.Settings.create()
.mapColor(MapColor.CYAN)
.noCollision()
.luminance(VoidVines.getLuminanceSupplier(14))
.luminance(VoidVines.getLuminanceSupplier(8))
.breakInstantly()
.sounds(BlockSoundGroup.WET_GRASS)
.pistonBehavior(PistonBehavior.DESTROY)
)
);

public static final Block VOID_BLOOM = registerBlock("void_bloom",
new LilyPadBlock(
AbstractBlock.Settings.create()
.mapColor(MapColor.CYAN)
.breakInstantly()
.sounds(BlockSoundGroup.WET_GRASS)
.nonOpaque()
.noCollision()
.pistonBehavior(PistonBehavior.DESTROY)
)
);

public static final Block ACID_ENCASED_MURIA = registerBlock("acid_encased_muria",
new ExperienceDroppingBlock(
ConstantIntProvider.create(0),
AbstractBlock.Settings.create()
.mapColor(MapColor.DARK_AQUA)
.instrument(NoteBlockInstrument.BASS)
.strength(3.0F, 2.0F)
.sounds(BlockSoundGroup.WET_GRASS)
.requiresTool()
)
);

private static Block registerBlock(String name, Block block) {
registerBlockItem(name, block);
return Registry.register(Registries.BLOCK, Identifier.of(Voidlings.MOD_ID, name), block);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class ModItemGroups {
public static final ItemGroup VOIDLINGS_GROUP = Registry.register(Registries.ITEM_GROUP,
Identifier.of(Voidlings.MOD_ID, "voidlings"),
FabricItemGroup.builder()
.icon(() -> new ItemStack(ModItems.ACID_SPROUTS))
.icon(() -> new ItemStack(ModItems.VOID_LAMINA))
.displayName(Text.translatable("itemgroup.voidlings.items"))
.entries((displayContext, entries) -> {
entries.add(ModItems.VOID_LAMINA);
Expand All @@ -24,10 +24,13 @@ public class ModItemGroups {

entries.add(ModBlocks.ACID_MILDEW);
entries.add(ModBlocks.ACID_MILDEW_CARPET);

entries.add(ModBlocks.VOID_TANGLE);

entries.add(ModBlocks.LIQUID_ACID);
entries.add(ModItems.VOID_BLOOM);

entries.add(ModBlocks.ACID_ENCASED_MURIA);
entries.add(ModItems.RAW_MURIA);
}).build());

public static void registerItemGroups() {
Expand Down
17 changes: 11 additions & 6 deletions src/main/java/dev/jaegerwald/voidlings/item/ModItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,28 @@
import net.minecraft.item.AliasedBlockItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroups;
import net.minecraft.item.PlaceableOnWaterItem;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.util.Identifier;

public class ModItems {
public static final Item BLACK_ACID = registerItem("black_acid", new Item(new Item.Settings()));
public static final Item ACID_SPROUTS = registerItem("acid_sprouts", new Item(new Item.Settings()));
// public static final Item BLACK_ACID = registerItem("black_acid", new Item(new Item.Settings()));
// public static final Item ACID_SPROUTS = registerItem("acid_sprouts", new Item(new Item.Settings()));

public static final Item ACID_MILDEW = registerItem("acid_mildew", new Item(new Item.Settings()));
public static final Item ACID_MILDEW_CARPET = registerItem("acid_mildew_carpet", new Item(new Item.Settings()));
// public static final Item ACID_MILDEW = registerItem("acid_mildew", new Item(new Item.Settings()));
// public static final Item ACID_MILDEW_CARPET = registerItem("acid_mildew_carpet", new Item(new Item.Settings()));

public static final Item VOID_TANGLE = registerItem("void_tangle", new Item(new Item.Settings()));
// public static final Item VOID_TANGLE = registerItem("void_tangle", new Item(new Item.Settings()));

public static final Item LIQUID_ACID = registerItem("liquid_acid", new Item(new Item.Settings()));
// public static final Item LIQUID_ACID = registerItem("liquid_acid", new Item(new Item.Settings()));

public static final Item VOID_LAMINA = registerItem("void_lamina", new AliasedBlockItem(ModBlocks.VOID_VINES, new Item.Settings()));

public static final Item VOID_BLOOM = registerItem("void_bloom", new PlaceableOnWaterItem(ModBlocks.VOID_BLOOM, new Item.Settings()));

public static final Item RAW_MURIA = registerItem("raw_muria", new Item(new Item.Settings()));

private static Item registerItem(String name, Item item) {
return Registry.register(Registries.ITEM, Identifier.of(Voidlings.MOD_ID, name), item);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"replace": false,
"values": [
"voidlings:acid_mildew",
"voidlings:acid_mildew_carpet"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"replace": false,
"values": [
"voidlings:black_acid",
"voidlings:acid_encased_muria"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"voidlings:liquid_acid"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"voidlings:acid_encased_muria"
]
}
5 changes: 0 additions & 5 deletions src/main/resources/data/minecraft/tags/function/load.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:alternatives",
"children": [
{
"type": "minecraft:item",
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"predicates": {
"minecraft:enchantments": [
{
"enchantments": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
}
],
"name": "voidlings:acid_encased_muria"
},
{
"type": "minecraft:item",
"functions": [
{
"enchantment": "minecraft:fortune",
"formula": "minecraft:ore_drops",
"function": "minecraft:apply_bonus"
},
{
"function": "minecraft:explosion_decay"
}
],
"name": "voidlings:raw_muria"
}
]
}
],
"rolls": 1.0
}
],
"random_sequence": "voidlings:blocks/acid_encased_muria"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"name": "voidlings:void_bloom"
}
],
"rolls": 1.0
}
],
"random_sequence": "voidlings:blocks/void_bloom"
}
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"minecraft": "~1.21",
"java": ">=21",
"fabric-api": "*",
"origins": "*",
"origins": "1.13.0-alpha.8",
"stellum": ">=0.1.0"
},
"suggests": {
Expand Down

0 comments on commit 31d0a17

Please sign in to comment.