diff --git a/aseprite/malum_textures.ase b/aseprite/malum_textures.ase index 6d7ff2311..3fa664c60 100644 Binary files a/aseprite/malum_textures.ase and b/aseprite/malum_textures.ase differ diff --git a/build.gradle.kts b/build.gradle.kts index a2c332718..cfaf68677 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -25,10 +25,12 @@ java { neoForge { version.set(project.property("neo_version").toString()) + parchment { mappingsVersion.set(project.property("parchment_mappings_version").toString()) minecraftVersion.set(project.property("parchment_minecraft_version").toString()) } + setAccessTransformers( "src/main/resources/META-INF/accesstransformer.cfg", "src/main/resources/META-INF/recipebuilders.cfg", @@ -212,11 +214,6 @@ java { } -tasks.jar.configure { - archiveClassifier.set("pure") -} - - //jar { //// exclude 'com/sammy/malum/core/data/**' diff --git a/src/generated/resources/assets/malum/blockstates/chronopulser.json b/src/generated/resources/assets/malum/blockstates/chronopulser.json new file mode 100644 index 000000000..3b6fd5ae3 --- /dev/null +++ b/src/generated/resources/assets/malum/blockstates/chronopulser.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "malum:block/chronopulser" + } + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/malum/blockstates/pulsebank.json b/src/generated/resources/assets/malum/blockstates/pulsebank.json new file mode 100644 index 000000000..407a38fd8 --- /dev/null +++ b/src/generated/resources/assets/malum/blockstates/pulsebank.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "malum:block/pulsebank" + } + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/malum/lang/en_us.json b/src/generated/resources/assets/malum/lang/en_us.json index 047393377..d6f657a63 100644 --- a/src/generated/resources/assets/malum/lang/en_us.json +++ b/src/generated/resources/assets/malum/lang/en_us.json @@ -67,6 +67,7 @@ "block.malum.checkered_twisted_rock": "Checkered Twisted Rock", "block.malum.chiseled_tainted_rock": "Chiseled Tainted Rock", "block.malum.chiseled_twisted_rock": "Chiseled Twisted Rock", + "block.malum.chronopulser": "Chronopulser", "block.malum.clinging_blight": "Clinging Blight", "block.malum.cthonic_gold_cluster": "Cthonic Gold Cluster", "block.malum.cthonic_gold_ore": "Cthonic Gold Ore", @@ -105,6 +106,7 @@ "block.malum.polished_twisted_rock_stairs": "Polished Twisted Rock Stairs", "block.malum.polished_twisted_rock_wall": "Polished Twisted Rock Wall", "block.malum.primordial_soup": "The Weeping Well", + "block.malum.pulsebank": "Pulsebank", "block.malum.repair_pylon": "Repair Pylon", "block.malum.repair_pylon_component": "Repair Pylon Component", "block.malum.revealed_runewood_log": "Revealed Runewood Log", diff --git a/src/generated/resources/assets/malum/models/block/chronopulser.json b/src/generated/resources/assets/malum/models/block/chronopulser.json new file mode 100644 index 000000000..b38aa375e --- /dev/null +++ b/src/generated/resources/assets/malum/models/block/chronopulser.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/cube_bottom_top", + "textures": { + "bottom": "malum:block/redstone/runewood_frame_bottom", + "side": "malum:block/redstone/chronopulser_side", + "top": "malum:block/redstone/runewood_frame_top" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/malum/models/block/pulsebank.json b/src/generated/resources/assets/malum/models/block/pulsebank.json new file mode 100644 index 000000000..a85d18fba --- /dev/null +++ b/src/generated/resources/assets/malum/models/block/pulsebank.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/cube_bottom_top", + "textures": { + "bottom": "malum:block/redstone/runewood_frame_bottom", + "side": "malum:block/redstone/pulsebank_side", + "top": "malum:block/redstone/runewood_frame_top" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/malum/models/item/chronopulser.json b/src/generated/resources/assets/malum/models/item/chronopulser.json new file mode 100644 index 000000000..03d0d4078 --- /dev/null +++ b/src/generated/resources/assets/malum/models/item/chronopulser.json @@ -0,0 +1,3 @@ +{ + "parent": "malum:block/chronopulser" +} \ No newline at end of file diff --git a/src/generated/resources/assets/malum/models/item/pulsebank.json b/src/generated/resources/assets/malum/models/item/pulsebank.json new file mode 100644 index 000000000..c83cfa856 --- /dev/null +++ b/src/generated/resources/assets/malum/models/item/pulsebank.json @@ -0,0 +1,3 @@ +{ + "parent": "malum:block/pulsebank" +} \ No newline at end of file diff --git a/src/generated/resources/data/malum/enchantment/spirit_plunder.json b/src/generated/resources/data/malum/enchantment/spirit_plunder.json index df223dad8..3355c253e 100644 --- a/src/generated/resources/data/malum/enchantment/spirit_plunder.json +++ b/src/generated/resources/data/malum/enchantment/spirit_plunder.json @@ -1,21 +1,34 @@ { - "anvil_cost": 1, + "anvil_cost": 10, "description": { "translate": "enchantment.malum.spirit_plunder" }, + "effects": { + "minecraft:attributes": [ + { + "amount": { + "type": "minecraft:linear", + "base": 1.0, + "per_level_above_first": 1.0 + }, + "attribute": "malum:spirit_spoils", + "id": "malum:enchantment.spirit_spoils", + "operation": "add_value" + } + ] + }, "max_cost": { - "base": 6, - "per_level_above_first": 10 + "base": 200, + "per_level_above_first": 0 }, "max_level": 2, "min_cost": { - "base": 1, - "per_level_above_first": 10 + "base": 55, + "per_level_above_first": 0 }, - "primary_items": "#malum:soul_shatter_capable_weapons", "slots": [ - "hand" + "mainhand" ], - "supported_items": "#malum:soul_shatter_capable_weapons", - "weight": 10 + "supported_items": "#malum:enchantable/spirit_spoils", + "weight": 1 } \ No newline at end of file diff --git a/src/generated/resources/data/malum/loot_table/blocks/chronopulser.json b/src/generated/resources/data/malum/loot_table/blocks/chronopulser.json new file mode 100644 index 000000000..925bfb786 --- /dev/null +++ b/src/generated/resources/data/malum/loot_table/blocks/chronopulser.json @@ -0,0 +1,21 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "malum:chronopulser" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "malum:blocks/chronopulser" +} \ No newline at end of file diff --git a/src/generated/resources/data/malum/loot_table/blocks/pulsebank.json b/src/generated/resources/data/malum/loot_table/blocks/pulsebank.json new file mode 100644 index 000000000..589e3891b --- /dev/null +++ b/src/generated/resources/data/malum/loot_table/blocks/pulsebank.json @@ -0,0 +1,21 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "malum:pulsebank" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "malum:blocks/pulsebank" +} \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/tags/block/mineable/axe.json b/src/generated/resources/data/minecraft/tags/block/mineable/axe.json index 5cc9f4754..9ccd62d11 100644 --- a/src/generated/resources/data/minecraft/tags/block/mineable/axe.json +++ b/src/generated/resources/data/minecraft/tags/block/mineable/axe.json @@ -12,6 +12,8 @@ "malum:runewood_totem_pole", "malum:soulwood_totem_base", "malum:soulwood_totem_pole", + "malum:chronopulser", + "malum:pulsebank", "malum:soulwoven_banner", "malum:stripped_runewood_log", "malum:runewood_log", diff --git a/src/generated/resources/data/minecraft/tags/block/mineable/pickaxe.json b/src/generated/resources/data/minecraft/tags/block/mineable/pickaxe.json index 9118a4dd0..7ca045b62 100644 --- a/src/generated/resources/data/minecraft/tags/block/mineable/pickaxe.json +++ b/src/generated/resources/data/minecraft/tags/block/mineable/pickaxe.json @@ -6,6 +6,8 @@ "malum:spirit_catalyzer_component", "malum:repair_pylon", "malum:repair_pylon_component", + "malum:chronopulser", + "malum:pulsebank", "malum:spirit_mote", "malum:void_depot", "malum:weeping_well_bricks", diff --git a/src/main/java/com/sammy/malum/client/RenderUtils.java b/src/main/java/com/sammy/malum/client/RenderUtils.java index dcbdebe19..f9e6517af 100644 --- a/src/main/java/com/sammy/malum/client/RenderUtils.java +++ b/src/main/java/com/sammy/malum/client/RenderUtils.java @@ -10,6 +10,7 @@ import team.lodestar.lodestone.systems.rendering.*; import team.lodestar.lodestone.systems.rendering.trail.*; +import javax.annotation.Nullable; import java.awt.*; import java.util.List; import java.util.*; @@ -55,7 +56,10 @@ public static void renderEntityTrail(PoseStack poseStack, VFXBuilders.WorldVFXBu public static void drawCube(PoseStack poseStack, VFXBuilders.WorldVFXBuilder builder, float scale, CubeVertexData cubeVertexData) { drawCube(poseStack, builder, builder, scale, cubeVertexData); } - public static void drawCube(PoseStack poseStack, VFXBuilders.WorldVFXBuilder builder, VFXBuilders.WorldVFXBuilder sideBuilder, float scale, CubeVertexData cubeVertexData) { + public static void drawCubeSides(PoseStack poseStack, VFXBuilders.WorldVFXBuilder builder, float scale, CubeVertexData cubeVertexData) { + drawCube(poseStack, null, builder, scale, cubeVertexData); + } + public static void drawCube(PoseStack poseStack, @Nullable VFXBuilders.WorldVFXBuilder builder, VFXBuilders.WorldVFXBuilder sideBuilder, float scale, CubeVertexData cubeVertexData) { Vector3f[] bottomVertices = cubeVertexData.bottomVertices; Vector3f[] topVertices = cubeVertexData.topVertices; Collection offsetMap = cubeVertexData.offsetMap; @@ -66,8 +70,10 @@ public static void drawCube(PoseStack poseStack, VFXBuilders.WorldVFXBuilder bui for (Vector3f[] offsets : offsetMap) { drawSide(poseStack, sideBuilder, offsets); } - drawSide(poseStack, builder, new Vector3f[]{bottomVertices[3], bottomVertices[2], bottomVertices[1], bottomVertices[0]}); - drawSide(poseStack, builder, topVertices); + if (builder != null) { + drawSide(poseStack, builder, new Vector3f[]{bottomVertices[3], bottomVertices[2], bottomVertices[1], bottomVertices[0]}); + drawSide(poseStack, builder, topVertices); + } poseStack.popPose(); } diff --git a/src/main/java/com/sammy/malum/client/renderer/block/ChronopulserRenderer.java b/src/main/java/com/sammy/malum/client/renderer/block/ChronopulserRenderer.java new file mode 100644 index 000000000..1168e2a0b --- /dev/null +++ b/src/main/java/com/sammy/malum/client/renderer/block/ChronopulserRenderer.java @@ -0,0 +1,59 @@ +package com.sammy.malum.client.renderer.block; + +import com.mojang.blaze3d.vertex.PoseStack; +import com.mojang.math.Axis; +import com.sammy.malum.MalumMod; +import com.sammy.malum.client.RenderUtils; +import com.sammy.malum.client.SpiritBasedWorldVFXBuilder; +import com.sammy.malum.common.block.curiosities.redstone.ChronopulserBlockEntity; +import com.sammy.malum.common.block.curiosities.totem.TotemPoleBlockEntity; +import com.sammy.malum.common.item.ether.EtherItem; +import com.sammy.malum.core.systems.spirit.MalumSpiritType; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.MultiBufferSource; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.renderer.blockentity.BlockEntityRenderer; +import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider; +import net.minecraft.core.Direction; +import net.minecraft.util.Mth; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import org.joml.Vector3f; +import team.lodestar.lodestone.helpers.ColorHelper; +import team.lodestar.lodestone.helpers.EasingHelper; +import team.lodestar.lodestone.registry.client.LodestoneRenderTypes; +import team.lodestar.lodestone.systems.easing.Easing; +import team.lodestar.lodestone.systems.rendering.VFXBuilders; +import team.lodestar.lodestone.systems.rendering.rendeertype.RenderTypeToken; +import team.lodestar.lodestone.systems.rendering.rendeertype.ShaderUniformHandler; + +import java.awt.*; + +import static com.sammy.malum.client.RenderUtils.drawCube; +import static com.sammy.malum.client.RenderUtils.drawCubeSides; + + +public class ChronopulserRenderer implements BlockEntityRenderer { + + private static final RenderTypeToken TOKEN = RenderTypeToken.createToken(MalumMod.malumPath("textures/block/redstone/chronopulser_overlay.png")); + private static final Color COLOR = new Color(170, 15, 1); + + public ChronopulserRenderer(BlockEntityRendererProvider.Context context) { + } + + @Override + public void render(ChronopulserBlockEntity blockEntityIn, float partialTicks, PoseStack poseStack, MultiBufferSource bufferIn, int combinedLightIn, int combinedOverlayIn) { + float pct = Mth.clamp(1 - (blockEntityIn.timer / 15f), 0, 1); + if (pct > 0) { + float alpha = Easing.CUBIC_OUT.clamped(pct, 0, 1) * 0.8f; + float glowAlpha = Easing.SINE_OUT.clamped(pct, 0, 1) * 0.4f; + var cubeVertexData = RenderUtils.makeCubePositions(1f); + var builder = VFXBuilders.createWorld() + .setColor(COLOR); + poseStack.pushPose(); + drawCubeSides(poseStack, builder.setAlpha(alpha).setRenderType(LodestoneRenderTypes.TRANSPARENT_TEXTURE.applyAndCache(TOKEN)), 1.00125f, cubeVertexData); + drawCubeSides(poseStack, builder.setAlpha(glowAlpha).setRenderType(LodestoneRenderTypes.ADDITIVE_TEXTURE.applyAndCache(TOKEN)), 1.0025f, cubeVertexData); + poseStack.popPose(); + } + } +} diff --git a/src/main/java/com/sammy/malum/client/renderer/block/MoteOfManaRenderer.java b/src/main/java/com/sammy/malum/client/renderer/block/MoteOfManaRenderer.java index 2b4ce1a19..28bcf0fc4 100644 --- a/src/main/java/com/sammy/malum/client/renderer/block/MoteOfManaRenderer.java +++ b/src/main/java/com/sammy/malum/client/renderer/block/MoteOfManaRenderer.java @@ -13,7 +13,7 @@ import static com.sammy.malum.client.RenderUtils.*; -public class MoteOfManaRenderer implements BlockEntityRenderer { +public class MoteOfManaRenderer implements BlockEntityRenderer { public static final RenderTypeToken MOTE_OF_MANA = RenderTypeToken.createToken(MalumMod.malumPath("textures/block/spirit_mote.png")); @@ -21,9 +21,9 @@ public MoteOfManaRenderer(BlockEntityRendererProvider.Context context) { } @Override - public void render(MoteOfManaBlockEntity blockEntityIn, float partialTicks, PoseStack poseStack, MultiBufferSource bufferIn, int combinedLightIn, int combinedOverlayIn) { + public void render(ManaMoteBlockEntity blockEntityIn, float partialTicks, PoseStack poseStack, MultiBufferSource bufferIn, int combinedLightIn, int combinedOverlayIn) { poseStack.pushPose(); - MalumSpiritType spiritType = MalumSpiritType.getSpiritType(blockEntityIn.getBlockState().getValue(SpiritMoteBlock.SPIRIT_TYPE)); + MalumSpiritType spiritType = MalumSpiritType.getSpiritType(blockEntityIn.getBlockState().getValue(ManaMoteBlock.SPIRIT_TYPE)); var builder = SpiritBasedWorldVFXBuilder.create(spiritType) .setRenderType(LodestoneRenderTypes.ADDITIVE_TEXTURE.applyAndCache(MOTE_OF_MANA)); diff --git a/src/main/java/com/sammy/malum/client/renderer/block/PulsebankRenderer.java b/src/main/java/com/sammy/malum/client/renderer/block/PulsebankRenderer.java new file mode 100644 index 000000000..2455837f2 --- /dev/null +++ b/src/main/java/com/sammy/malum/client/renderer/block/PulsebankRenderer.java @@ -0,0 +1,45 @@ +package com.sammy.malum.client.renderer.block; + +import com.mojang.blaze3d.vertex.PoseStack; +import com.sammy.malum.MalumMod; +import com.sammy.malum.client.RenderUtils; +import com.sammy.malum.common.block.curiosities.redstone.ChronopulserBlockEntity; +import com.sammy.malum.common.block.curiosities.redstone.PulsebankBlockEntity; +import net.minecraft.client.renderer.MultiBufferSource; +import net.minecraft.client.renderer.blockentity.BlockEntityRenderer; +import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider; +import net.minecraft.util.Mth; +import team.lodestar.lodestone.registry.client.LodestoneRenderTypes; +import team.lodestar.lodestone.systems.easing.Easing; +import team.lodestar.lodestone.systems.rendering.VFXBuilders; +import team.lodestar.lodestone.systems.rendering.rendeertype.RenderTypeToken; + +import java.awt.*; + +import static com.sammy.malum.client.RenderUtils.drawCubeSides; + + +public class PulsebankRenderer implements BlockEntityRenderer { + + private static final RenderTypeToken TOKEN = RenderTypeToken.createToken(MalumMod.malumPath("textures/block/redstone/pulsebank_overlay.png")); + private static final Color COLOR = new Color(170, 15, 1); + + public PulsebankRenderer(BlockEntityRendererProvider.Context context) { + } + + @Override + public void render(PulsebankBlockEntity blockEntityIn, float partialTicks, PoseStack poseStack, MultiBufferSource bufferIn, int combinedLightIn, int combinedOverlayIn) { + float pct = Mth.clamp(blockEntityIn.timer / 40f, 0, 1); + if (pct > 0) { + float alpha = Easing.CUBIC_OUT.clamped(pct, 0, 1) * 0.8f; + float glowAlpha = Easing.SINE_OUT.clamped(pct, 0, 1) * 0.4f; + var cubeVertexData = RenderUtils.makeCubePositions(1f); + var builder = VFXBuilders.createWorld() + .setColor(COLOR); + poseStack.pushPose(); + drawCubeSides(poseStack, builder.setAlpha(alpha).setRenderType(LodestoneRenderTypes.TRANSPARENT_TEXTURE.applyAndCache(TOKEN)), 1.00125f, cubeVertexData); + drawCubeSides(poseStack, builder.setAlpha(glowAlpha).setRenderType(LodestoneRenderTypes.ADDITIVE_TEXTURE.applyAndCache(TOKEN)), 1.0025f, cubeVertexData); + poseStack.popPose(); + } + } +} diff --git a/src/main/java/com/sammy/malum/client/screen/codex/entries/ArtificeEntries.java b/src/main/java/com/sammy/malum/client/screen/codex/entries/ArtificeEntries.java index 2127e693c..c71a68b65 100644 --- a/src/main/java/com/sammy/malum/client/screen/codex/entries/ArtificeEntries.java +++ b/src/main/java/com/sammy/malum/client/screen/codex/entries/ArtificeEntries.java @@ -35,10 +35,7 @@ public static void setupEntries(ArcanaProgressionScreen screen) { )) ); - screen.addEntry("something1", 4, 8, b -> {}); -// screen.addEntry("something2", 5, 8, b -> {}); - - screen.addEntry("ether", 5, 8, b -> b + screen.addEntry("ether", 4, 8, b -> b .configureWidget(w -> w.setIcon(ETHER)) .addPage(new HeadlineTextPage("ether", "ether.1")) .addPage(SpiritInfusionPage.fromOutput(ETHER.get())) @@ -58,6 +55,14 @@ public static void setupEntries(ArcanaProgressionScreen screen) { ) ); + screen.addEntry("basic_artifice", 5, 8, b -> b + .configureWidget(w -> w.setIcon(CHRONOPULSER)) + .addPage(new HeadlineTextPage("basic_artifice", "basic_artifice.1")) + .addPage(new TextPage("basic_artifice.2")) + .addPage(new HeadlineTextPage("basic_artifice.pulsebank", "basic_artifice.pulsebank.1")) + .addPage(new HeadlineTextPage("basic_artifice.chronopulser", "basic_artifice.chronopulser.1")) + ); + screen.addEntry("soulwoven_silk", 4, 5, b -> b .configureWidget(w -> w.setIcon(SOULWOVEN_SILK)) .addPage(new HeadlineTextPage("soulwoven_silk", "soulwoven_silk.1")) diff --git a/src/main/java/com/sammy/malum/common/block/curiosities/mana_mote/SpiritMoteBlock.java b/src/main/java/com/sammy/malum/common/block/curiosities/mana_mote/ManaMoteBlock.java similarity index 81% rename from src/main/java/com/sammy/malum/common/block/curiosities/mana_mote/SpiritMoteBlock.java rename to src/main/java/com/sammy/malum/common/block/curiosities/mana_mote/ManaMoteBlock.java index 3d79eead8..c6580a3b0 100644 --- a/src/main/java/com/sammy/malum/common/block/curiosities/mana_mote/SpiritMoteBlock.java +++ b/src/main/java/com/sammy/malum/common/block/curiosities/mana_mote/ManaMoteBlock.java @@ -9,11 +9,11 @@ import java.util.function.*; -public class SpiritMoteBlock extends LodestoneEntityBlock { +public class ManaMoteBlock extends LodestoneEntityBlock { public static final SpiritTypeProperty SPIRIT_TYPE = SpiritTypeRegistry.SPIRIT_TYPE_PROPERTY; - public SpiritMoteBlock(Properties properties) { + public ManaMoteBlock(Properties properties) { super(properties); this.registerDefaultState(this.stateDefinition.any().setValue(SPIRIT_TYPE, "sacred")); } @@ -25,6 +25,6 @@ protected void createBlockStateDefinition(StateDefinition.Builder consumer) { - consumer.accept(new SpiritMoteBlockClientExtension()); + consumer.accept(new ManaMoteBlockClientExtension()); } } diff --git a/src/main/java/com/sammy/malum/common/block/curiosities/mana_mote/SpiritMoteBlockClientExtension.java b/src/main/java/com/sammy/malum/common/block/curiosities/mana_mote/ManaMoteBlockClientExtension.java similarity index 78% rename from src/main/java/com/sammy/malum/common/block/curiosities/mana_mote/SpiritMoteBlockClientExtension.java rename to src/main/java/com/sammy/malum/common/block/curiosities/mana_mote/ManaMoteBlockClientExtension.java index ad7b2b41f..523003d23 100644 --- a/src/main/java/com/sammy/malum/common/block/curiosities/mana_mote/SpiritMoteBlockClientExtension.java +++ b/src/main/java/com/sammy/malum/common/block/curiosities/mana_mote/ManaMoteBlockClientExtension.java @@ -9,7 +9,7 @@ import net.minecraft.world.phys.*; import net.neoforged.neoforge.client.extensions.common.IClientBlockExtensions; -public class SpiritMoteBlockClientExtension implements IClientBlockExtensions { +public class ManaMoteBlockClientExtension implements IClientBlockExtensions { @Override public boolean addHitEffects(BlockState state, Level level, HitResult target, ParticleEngine manager) { @@ -18,8 +18,8 @@ public boolean addHitEffects(BlockState state, Level level, HitResult target, Pa @Override public boolean addDestroyEffects(BlockState state, Level level, BlockPos pos, ParticleEngine manager) { - if (state.getBlock() instanceof SpiritMoteBlock) { - SpiritMoteParticleEffects.destroy(level, pos, state, MalumSpiritType.getSpiritType(state.getValue(SpiritMoteBlock.SPIRIT_TYPE))); + if (state.getBlock() instanceof ManaMoteBlock) { + SpiritMoteParticleEffects.destroy(level, pos, state, MalumSpiritType.getSpiritType(state.getValue(ManaMoteBlock.SPIRIT_TYPE))); } return true; } diff --git a/src/main/java/com/sammy/malum/common/block/curiosities/mana_mote/MoteOfManaBlockEntity.java b/src/main/java/com/sammy/malum/common/block/curiosities/mana_mote/ManaMoteBlockEntity.java similarity index 60% rename from src/main/java/com/sammy/malum/common/block/curiosities/mana_mote/MoteOfManaBlockEntity.java rename to src/main/java/com/sammy/malum/common/block/curiosities/mana_mote/ManaMoteBlockEntity.java index d06c1364d..8166c7d39 100644 --- a/src/main/java/com/sammy/malum/common/block/curiosities/mana_mote/MoteOfManaBlockEntity.java +++ b/src/main/java/com/sammy/malum/common/block/curiosities/mana_mote/ManaMoteBlockEntity.java @@ -5,8 +5,8 @@ import net.minecraft.world.level.block.state.BlockState; import team.lodestar.lodestone.systems.blockentity.LodestoneBlockEntity; -public class MoteOfManaBlockEntity extends LodestoneBlockEntity { - public MoteOfManaBlockEntity(BlockPos pos, BlockState state) { - super(BlockEntityRegistry.SPIRIT_MOTE.get(), pos, state); +public class ManaMoteBlockEntity extends LodestoneBlockEntity { + public ManaMoteBlockEntity(BlockPos pos, BlockState state) { + super(BlockEntityRegistry.MANA_MOTE.get(), pos, state); } } diff --git a/src/main/java/com/sammy/malum/common/block/curiosities/redstone/ChronopulserBlock.java b/src/main/java/com/sammy/malum/common/block/curiosities/redstone/ChronopulserBlock.java new file mode 100644 index 000000000..00da8f8d8 --- /dev/null +++ b/src/main/java/com/sammy/malum/common/block/curiosities/redstone/ChronopulserBlock.java @@ -0,0 +1,66 @@ +package com.sammy.malum.common.block.curiosities.redstone; + +import com.sammy.malum.common.block.curiosities.banner.SoulwovenBannerBlockEntity; +import com.sammy.malum.registry.common.item.DataComponentRegistry; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.util.RandomSource; +import net.minecraft.util.StringRepresentable; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.context.BlockPlaceContext; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.LevelAccessor; +import net.minecraft.world.level.LevelReader; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.block.RedStoneOreBlock; +import net.minecraft.world.level.block.RedstoneTorchBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.StateDefinition; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import net.minecraft.world.phys.HitResult; +import net.minecraft.world.phys.shapes.Shapes; +import net.minecraft.world.phys.shapes.VoxelShape; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import team.lodestar.lodestone.helpers.block.BlockStateHelper; +import team.lodestar.lodestone.systems.block.LodestoneEntityBlock; + +import java.util.Arrays; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +public class ChronopulserBlock extends LodestoneEntityBlock { + + public static final BooleanProperty LIT = BlockStateProperties.LIT; + + public ChronopulserBlock(Properties properties) { + super(properties); + this.registerDefaultState(this.defaultBlockState().setValue(LIT, false)); + } + + @Override + protected void tick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) { + level.setBlock(pos, state.setValue(ChronopulserBlock.LIT, false), 3); + } + + @Override + protected boolean isSignalSource(BlockState state) { + return true; + } + + @Override + protected int getSignal(BlockState blockState, BlockGetter blockAccess, BlockPos pos, Direction side) { + return blockState.getValue(LIT) ? 15 : 0; + } + + @Override + protected void createBlockStateDefinition(StateDefinition.Builder builder) { + builder.add(LIT); + } +} \ No newline at end of file diff --git a/src/main/java/com/sammy/malum/common/block/curiosities/redstone/ChronopulserBlockEntity.java b/src/main/java/com/sammy/malum/common/block/curiosities/redstone/ChronopulserBlockEntity.java new file mode 100644 index 000000000..10d1ab5c9 --- /dev/null +++ b/src/main/java/com/sammy/malum/common/block/curiosities/redstone/ChronopulserBlockEntity.java @@ -0,0 +1,77 @@ +package com.sammy.malum.common.block.curiosities.redstone; + +import com.sammy.malum.common.data_components.SoulwovenBannerPatternData; +import com.sammy.malum.common.item.spirit.SpiritShardItem; +import com.sammy.malum.core.systems.spirit.MalumSpiritType; +import com.sammy.malum.registry.common.ParticleEffectTypeRegistry; +import com.sammy.malum.registry.common.SoundRegistry; +import com.sammy.malum.registry.common.SpiritTypeRegistry; +import com.sammy.malum.registry.common.block.BlockEntityRegistry; +import com.sammy.malum.registry.common.item.DataComponentRegistry; +import com.sammy.malum.visual_effects.networked.data.ColorEffectData; +import com.sammy.malum.visual_effects.networked.data.PositionEffectData; +import net.minecraft.core.BlockPos; +import net.minecraft.core.HolderLookup; +import net.minecraft.core.component.DataComponentMap; +import net.minecraft.core.particles.DustParticleOptions; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.sounds.SoundEvents; +import net.minecraft.sounds.SoundSource; +import net.minecraft.util.Mth; +import net.minecraft.world.InteractionHand; +import net.minecraft.world.ItemInteractionResult; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.phys.Vec3; +import net.neoforged.neoforge.common.ItemAbilities; +import team.lodestar.lodestone.helpers.block.BlockStateHelper; +import team.lodestar.lodestone.systems.blockentity.LodestoneBlockEntity; + +import javax.annotation.Nullable; + +public class ChronopulserBlockEntity extends LodestoneBlockEntity { + + public int timer; + public int frequency = 80; + public ChronopulserBlockEntity(BlockPos pos, BlockState state) { + super(BlockEntityRegistry.CHRONOPULSER.get(), pos, state); + } + + @Override + public void tick() { + super.tick(); + timer++; + if (timer >= frequency) { + + timer = 0; + if (level instanceof ServerLevel) { + level.setBlock(getBlockPos(), getBlockState().setValue(ChronopulserBlock.LIT, true), 3); + level.scheduleTick(worldPosition, getBlockState().getBlock(), 10); + BlockStateHelper.updateAndNotifyState(level, worldPosition); + } else { + Vec3 center = getBlockPos().getCenter(); + float offset = 0.625f; + level.addParticle(DustParticleOptions.REDSTONE, center.x+ offset, center.y, center.z, 0, 0, 0); + level.addParticle(DustParticleOptions.REDSTONE, center.x-offset, center.y, center.z, 0, 0, 0); + level.addParticle(DustParticleOptions.REDSTONE, center.x, center.y, center.z+offset, 0, 0, 0); + level.addParticle(DustParticleOptions.REDSTONE, center.x, center.y, center.z-offset, 0, 0, 0); + } + } + } + + @Override + protected void loadAdditional(CompoundTag pTag, HolderLookup.Provider pRegistries) { + super.loadAdditional(pTag, pRegistries); + timer = pTag.getInt("timer"); + frequency = pTag.getInt("frequency"); + } + + @Override + protected void saveAdditional(CompoundTag tag, HolderLookup.Provider registries) { + super.saveAdditional(tag, registries); + tag.putInt("timer", timer); + tag.putInt("frequency", frequency); + } +} \ No newline at end of file diff --git a/src/main/java/com/sammy/malum/common/block/curiosities/redstone/PulsebankBlock.java b/src/main/java/com/sammy/malum/common/block/curiosities/redstone/PulsebankBlock.java new file mode 100644 index 000000000..90e1eb4b8 --- /dev/null +++ b/src/main/java/com/sammy/malum/common/block/curiosities/redstone/PulsebankBlock.java @@ -0,0 +1,75 @@ +package com.sammy.malum.common.block.curiosities.redstone; + +import com.sammy.malum.common.block.curiosities.banner.SoulwovenBannerBlock; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.util.RandomSource; +import net.minecraft.util.StringRepresentable; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.StateDefinition; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import team.lodestar.lodestone.helpers.block.BlockStateHelper; +import team.lodestar.lodestone.systems.block.LodestoneEntityBlock; + +import java.util.Arrays; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +public class PulsebankBlock extends LodestoneEntityBlock { + + public static final EnumProperty SIGNAL_INPUT = EnumProperty.create("signal_input", SignalInput.class); + + public PulsebankBlock(Properties properties) { + super(properties); + this.registerDefaultState(this.defaultBlockState().setValue(SIGNAL_INPUT, SignalInput.NONE)); + } + + @Override + protected boolean isSignalSource(BlockState state) { + return true; + } + + @Override + protected int getSignal(BlockState blockState, BlockGetter blockAccess, BlockPos pos, Direction side) { + SignalInput input = blockState.getValue(SIGNAL_INPUT); + if (input.equals(SignalInput.NONE)) { + return 0; + } + Direction direction = input.direction; + return !side.equals(direction) ? 15 : 0; + } + + @Override + protected void createBlockStateDefinition(StateDefinition.Builder builder) { + builder.add(SIGNAL_INPUT); + } + + public enum SignalInput implements StringRepresentable { + NONE(null), + DOWN(Direction.DOWN), + UP(Direction.UP), + NORTH(Direction.NORTH), + SOUTH(Direction.SOUTH), + WEST(Direction.WEST), + EAST(Direction.EAST); + + private static final SignalInput[] VALUES = SignalInput.values(); + protected static final Map DIRECTION_MAP = Arrays.stream(VALUES).filter(b -> b.direction != null && b.direction.getAxis().isHorizontal()).collect(Collectors.toMap(b -> b.direction, b -> b)); + public final Direction direction; + final String name = name().toLowerCase(Locale.ROOT); + + SignalInput(Direction direction) { + this.direction = direction; + } + + @Override + public String getSerializedName() { + return name; + } + } +} \ No newline at end of file diff --git a/src/main/java/com/sammy/malum/common/block/curiosities/redstone/PulsebankBlockEntity.java b/src/main/java/com/sammy/malum/common/block/curiosities/redstone/PulsebankBlockEntity.java new file mode 100644 index 000000000..7ba6ea767 --- /dev/null +++ b/src/main/java/com/sammy/malum/common/block/curiosities/redstone/PulsebankBlockEntity.java @@ -0,0 +1,63 @@ +package com.sammy.malum.common.block.curiosities.redstone; + +import com.sammy.malum.registry.common.block.BlockEntityRegistry; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.core.HolderLookup; +import net.minecraft.core.particles.DustParticleOptions; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.phys.Vec3; +import team.lodestar.lodestone.helpers.block.BlockStateHelper; +import team.lodestar.lodestone.systems.blockentity.LodestoneBlockEntity; + +import static com.sammy.malum.common.block.curiosities.redstone.PulsebankBlock.SIGNAL_INPUT; + +public class PulsebankBlockEntity extends LodestoneBlockEntity { + + public int timer; + public PulsebankBlockEntity(BlockPos pos, BlockState state) { + super(BlockEntityRegistry.PULSEBANK.get(), pos, state); + } + + @Override + public void onNeighborUpdate(BlockState state, BlockPos pos, BlockPos neighbor) { + if (!state.getValue(SIGNAL_INPUT).equals(PulsebankBlock.SignalInput.NONE)) { + return; + } + BlockPos offset = pos.subtract(neighbor); + Direction direction = Direction.fromDelta(offset.getX(), offset.getY(), offset.getZ()); + if (direction == null) { + return; + } + int signal = level.getSignal(neighbor, direction.getOpposite()); + if (signal > 0) { + timer = 40; + level.setBlock(pos, state.setValue(SIGNAL_INPUT, PulsebankBlock.SignalInput.DIRECTION_MAP.get(direction)), 3); + } + } + + @Override + public void tick() { + super.tick(); + if (timer > 0) { + timer--; + if (timer == 0) { + level.setBlock(getBlockPos(), getBlockState().setValue(PulsebankBlock.SIGNAL_INPUT, PulsebankBlock.SignalInput.NONE), 3); + } + } + } + + @Override + protected void loadAdditional(CompoundTag pTag, HolderLookup.Provider pRegistries) { + super.loadAdditional(pTag, pRegistries); + timer = pTag.getInt("timer"); + } + + @Override + protected void saveAdditional(CompoundTag tag, HolderLookup.Provider registries) { + super.saveAdditional(tag, registries); + tag.putInt("timer", timer); + } +} \ No newline at end of file diff --git a/src/main/java/com/sammy/malum/core/systems/spirit/MalumSpiritType.java b/src/main/java/com/sammy/malum/core/systems/spirit/MalumSpiritType.java index 14c20e232..28a8a2732 100644 --- a/src/main/java/com/sammy/malum/core/systems/spirit/MalumSpiritType.java +++ b/src/main/java/com/sammy/malum/core/systems/spirit/MalumSpiritType.java @@ -140,6 +140,6 @@ public BlockState getTotemPoleBlockState(boolean isCorrupt, BlockHitResult hit) } public BlockState getSpiritMoteBlockState() { - return BlockRegistry.SPIRIT_MOTE.get().defaultBlockState().setValue(SpiritMoteBlock.SPIRIT_TYPE, identifier); + return BlockRegistry.SPIRIT_MOTE.get().defaultBlockState().setValue(ManaMoteBlock.SPIRIT_TYPE, identifier); } } diff --git a/src/main/java/com/sammy/malum/data/block/MalumBlockStates.java b/src/main/java/com/sammy/malum/data/block/MalumBlockStates.java index e293edb52..ddd631ae1 100644 --- a/src/main/java/com/sammy/malum/data/block/MalumBlockStates.java +++ b/src/main/java/com/sammy/malum/data/block/MalumBlockStates.java @@ -216,6 +216,9 @@ protected void registerStatesAndModels() { MalumBlockStateSmithTypes.CALCIFIED_BLIGHT.act(data, CALCIFIED_BLIGHT); MalumBlockStateSmithTypes.TALL_CALCIFIED_BLIGHT.act(data, TALL_CALCIFIED_BLIGHT); + setTexturePath("redstone/"); + BlockStateSmithTypes.CUSTOM_MODEL.act(data, ItemModelSmithTypes.BLOCK_MODEL_ITEM, this::simpleBlock, this::redstoneMachineBlock, CHRONOPULSER, PULSEBANK); + setTexturePath(""); itemModelProvider.setTexturePath("ether/"); BlockStateSmithTypes.CUSTOM_MODEL.act(data, ItemModelSmithTypes.GENERATED_ITEM, this::simpleBlock, this::etherModel, ETHER); @@ -267,6 +270,14 @@ public ModelFile columnCapModel(Block block) { return models().cubeBottomTop(name, side, bottom, top); } + public ModelFile redstoneMachineBlock(Block block) { + String name = getBlockName(block); + ResourceLocation top = getBlockTexture("runewood_frame_top"); + ResourceLocation bottom = getBlockTexture("runewood_frame_bottom"); + ResourceLocation side = getBlockTexture(name + "_side"); + return models().cubeBottomTop(name, side, bottom, top); + } + public ModelFile cutRockBlockModel(Block block) { String name = getBlockName(block); int index = name.indexOf("_"); diff --git a/src/main/java/com/sammy/malum/registry/client/HiddenTagRegistry.java b/src/main/java/com/sammy/malum/registry/client/HiddenTagRegistry.java index 2bcb5f2ee..3bf71cb64 100644 --- a/src/main/java/com/sammy/malum/registry/client/HiddenTagRegistry.java +++ b/src/main/java/com/sammy/malum/registry/client/HiddenTagRegistry.java @@ -41,7 +41,7 @@ public static void attachFeatureFlags(FeatureFlagSet set) { public static void hideItems(BuildCreativeModeTabContentsEvent event) { List> disabledTags = HiddenTagHandler.tagsToHide(); - var iterator = event.getParentEntries().iterator(); + var iterator = event.getTab().getDisplayItems().iterator(); while (iterator.hasNext()) { var entry = iterator.next(); diff --git a/src/main/java/com/sammy/malum/registry/common/block/BlockEntityRegistry.java b/src/main/java/com/sammy/malum/registry/common/block/BlockEntityRegistry.java index 591470ce9..73ea00d93 100644 --- a/src/main/java/com/sammy/malum/registry/common/block/BlockEntityRegistry.java +++ b/src/main/java/com/sammy/malum/registry/common/block/BlockEntityRegistry.java @@ -6,6 +6,10 @@ import com.sammy.malum.common.block.curiosities.mana_mote.*; import com.sammy.malum.common.block.curiosities.obelisk.brilliant.*; import com.sammy.malum.common.block.curiosities.obelisk.runewood.*; +import com.sammy.malum.common.block.curiosities.redstone.ChronopulserBlock; +import com.sammy.malum.common.block.curiosities.redstone.ChronopulserBlockEntity; +import com.sammy.malum.common.block.curiosities.redstone.PulsebankBlock; +import com.sammy.malum.common.block.curiosities.redstone.PulsebankBlockEntity; import com.sammy.malum.common.block.curiosities.repair_pylon.*; import com.sammy.malum.common.block.curiosities.ritual_plinth.*; import com.sammy.malum.common.block.curiosities.runic_workbench.*; @@ -61,8 +65,12 @@ public class BlockEntityRegistry { public static final DeferredHolder, BlockEntityType> TOTEM_BASE = BLOCK_ENTITY_TYPES.register("totem_base", () -> BlockEntityType.Builder.of(TotemBaseBlockEntity::new, getBlocks(TotemBaseBlock.class)).build(null)); public static final DeferredHolder, BlockEntityType> TOTEM_POLE = BLOCK_ENTITY_TYPES.register("totem_pole", () -> BlockEntityType.Builder.of(TotemPoleBlockEntity::new, getBlocks(TotemPoleBlock.class)).build(null)); + public static final DeferredHolder, BlockEntityType> CHRONOPULSER = BLOCK_ENTITY_TYPES.register("chronopulser", () -> BlockEntityType.Builder.of(ChronopulserBlockEntity::new, getBlocks(ChronopulserBlock.class)).build(null)); + public static final DeferredHolder, BlockEntityType> PULSEBANK = BLOCK_ENTITY_TYPES.register("pulsebank", () -> BlockEntityType.Builder.of(PulsebankBlockEntity::new, getBlocks(PulsebankBlock.class)).build(null)); + + public static final DeferredHolder, BlockEntityType> SOULWOVEN_BANNER = BLOCK_ENTITY_TYPES.register("soulwoven_banner", () -> BlockEntityType.Builder.of(SoulwovenBannerBlockEntity::new, getBlocks(SoulwovenBannerBlock.class)).build(null)); - public static final DeferredHolder, BlockEntityType> SPIRIT_MOTE = BLOCK_ENTITY_TYPES.register("mote_of_mana", () -> BlockEntityType.Builder.of(MoteOfManaBlockEntity::new, getBlocks(SpiritMoteBlock.class)).build(null)); + public static final DeferredHolder, BlockEntityType> MANA_MOTE = BLOCK_ENTITY_TYPES.register("mote_of_mana", () -> BlockEntityType.Builder.of(ManaMoteBlockEntity::new, getBlocks(ManaMoteBlock.class)).build(null)); public static Block[] getBlocks(Class... blockClasses) { Collection> blocks = BlockRegistry.BLOCKS.getEntries(); @@ -99,11 +107,13 @@ public static void registerRenderer(EntityRenderersEvent.RegisterRenderers event event.registerBlockEntityRenderer(REPAIR_PYLON.get(), RepairPylonRenderer::new); event.registerBlockEntityRenderer(TOTEM_BASE.get(), TotemBaseRenderer::new); event.registerBlockEntityRenderer(TOTEM_POLE.get(), TotemPoleRenderer::new); + event.registerBlockEntityRenderer(CHRONOPULSER.get(), ChronopulserRenderer::new); + event.registerBlockEntityRenderer(PULSEBANK.get(), PulsebankRenderer::new); event.registerBlockEntityRenderer(RITUAL_PLINTH.get(), RitualPlinthRenderer::new); event.registerBlockEntityRenderer(ITEM_STAND.get(), MalumItemHolderRenderer::new); event.registerBlockEntityRenderer(ITEM_PEDESTAL.get(), MalumItemHolderRenderer::new); event.registerBlockEntityRenderer(SPIRIT_JAR.get(), SpiritJarRenderer::new); - event.registerBlockEntityRenderer(SPIRIT_MOTE.get(), MoteOfManaRenderer::new); + event.registerBlockEntityRenderer(MANA_MOTE.get(), MoteOfManaRenderer::new); event.registerBlockEntityRenderer(SOULWOVEN_BANNER.get(), SoulwovenBannerRenderer::new); } } diff --git a/src/main/java/com/sammy/malum/registry/common/block/BlockRegistry.java b/src/main/java/com/sammy/malum/registry/common/block/BlockRegistry.java index 037ef3a0c..cb6ac1c32 100644 --- a/src/main/java/com/sammy/malum/registry/common/block/BlockRegistry.java +++ b/src/main/java/com/sammy/malum/registry/common/block/BlockRegistry.java @@ -8,6 +8,8 @@ import com.sammy.malum.common.block.curiosities.obelisk.*; import com.sammy.malum.common.block.curiosities.obelisk.brilliant.*; import com.sammy.malum.common.block.curiosities.obelisk.runewood.*; +import com.sammy.malum.common.block.curiosities.redstone.ChronopulserBlock; +import com.sammy.malum.common.block.curiosities.redstone.PulsebankBlock; import com.sammy.malum.common.block.curiosities.repair_pylon.*; import com.sammy.malum.common.block.curiosities.ritual_plinth.*; import com.sammy.malum.common.block.curiosities.runic_workbench.*; @@ -88,7 +90,10 @@ public class BlockRegistry { public static final DeferredHolder SOULWOOD_TOTEM_BASE = BLOCKS.register("soulwood_totem_base", () -> new TotemBaseBlock<>(MalumBlockProperties.SOULWOOD().addTag(RITE_IMMUNE).noOcclusion(), true).setBlockEntity(BlockEntityRegistry.TOTEM_BASE)); public static final DeferredHolder SOULWOOD_TOTEM_POLE = BLOCKS.register("soulwood_totem_pole", () -> new TotemPoleBlock<>(MalumBlockProperties.SOULWOOD().addTag(RITE_IMMUNE).noOcclusion(), BlockRegistry.SOULWOOD_LOG, true).setBlockEntity(BlockEntityRegistry.TOTEM_POLE)); - public static final DeferredHolder SPIRIT_MOTE = BLOCKS.register("spirit_mote", () -> new SpiritMoteBlock(MalumBlockProperties.MANA_MOTE_BLOCK()).setBlockEntity(BlockEntityRegistry.SPIRIT_MOTE)); + public static final DeferredHolder CHRONOPULSER = BLOCKS.register("chronopulser", () -> new ChronopulserBlock(MalumBlockProperties.REDSTONE_MACHINE()).setBlockEntity(BlockEntityRegistry.CHRONOPULSER)); + public static final DeferredHolder PULSEBANK = BLOCKS.register("pulsebank", () -> new PulsebankBlock(MalumBlockProperties.REDSTONE_MACHINE()).setBlockEntity(BlockEntityRegistry.PULSEBANK)); + + public static final DeferredHolder SPIRIT_MOTE = BLOCKS.register("spirit_mote", () -> new ManaMoteBlock(MalumBlockProperties.MANA_MOTE_BLOCK()).setBlockEntity(BlockEntityRegistry.MANA_MOTE)); public static final DeferredHolder VOID_CONDUIT = BLOCKS.register("void_conduit", () -> new VoidConduitBlock<>(MalumBlockProperties.PRIMORDIAL_SOUP()).setBlockEntity(BlockEntityRegistry.VOID_CONDUIT)); public static final DeferredHolder PRIMORDIAL_SOUP = BLOCKS.register("primordial_soup", () -> new PrimordialSoupBlock(MalumBlockProperties.PRIMORDIAL_SOUP())); @@ -497,7 +502,7 @@ public static void setBlockColors(RegisterColorHandlersEvent.Block event) { }, SOULWOOD_LEAVES.get(), BUDDING_SOULWOOD_LEAVES.get(), HANGING_SOULWOOD_LEAVES.get()); blockColors.register((s, l, p, c) -> { - var spiritType = MalumSpiritType.getSpiritType(s.getValue(SpiritMoteBlock.SPIRIT_TYPE)); + var spiritType = MalumSpiritType.getSpiritType(s.getValue(ManaMoteBlock.SPIRIT_TYPE)); var color = spiritType.getPrimaryColor(); int red = color.getRed(); int green = color.getGreen(); diff --git a/src/main/java/com/sammy/malum/registry/common/block/MalumBlockProperties.java b/src/main/java/com/sammy/malum/registry/common/block/MalumBlockProperties.java index bd5c46855..a8e485601 100644 --- a/src/main/java/com/sammy/malum/registry/common/block/MalumBlockProperties.java +++ b/src/main/java/com/sammy/malum/registry/common/block/MalumBlockProperties.java @@ -11,6 +11,8 @@ import java.awt.*; +import static net.minecraft.world.level.block.Blocks.COPPER_BLOCK; + public class MalumBlockProperties { public static LodestoneBlockProperties SPIRITED_GLASS() { @@ -321,6 +323,17 @@ public static LodestoneBlockProperties TWISTED_ETHER_BRAZIER() { .lightLevel((b) -> 14); } + public static LodestoneBlockProperties REDSTONE_MACHINE() { + return new LodestoneBlockProperties() + .mapColor(COPPER_BLOCK.defaultMapColor()) + .strength(3.0F, 6.0F) + .sound(SoundType.COPPER_BULB) + .requiresCorrectToolForDrops() + .isRedstoneConductor(Blocks::never) + .needsPickaxe() + .needsAxe(); + } + public static LodestoneBlockProperties MANA_MOTE_BLOCK() { return new LodestoneBlockProperties() .mapColor(MapColor.COLOR_LIGHT_BLUE) diff --git a/src/main/java/com/sammy/malum/registry/common/item/ItemRegistry.java b/src/main/java/com/sammy/malum/registry/common/item/ItemRegistry.java index b9e25c204..99e4231fd 100644 --- a/src/main/java/com/sammy/malum/registry/common/item/ItemRegistry.java +++ b/src/main/java/com/sammy/malum/registry/common/item/ItemRegistry.java @@ -458,9 +458,9 @@ public static DeferredHolder register(String name, Ite //region crafting blocks public static final DeferredHolder SPIRIT_ALTAR = register("spirit_altar", DEFAULT_PROPERTIES(), (p) -> new BlockItem(BlockRegistry.SPIRIT_ALTAR.get(), p)); - public static final DeferredHolder RUNIC_WORKBENCH = register("runic_workbench", DEFAULT_PROPERTIES(), (p) -> new BlockItem(BlockRegistry.RUNIC_WORKBENCH.get(), p)); public static final DeferredHolder RUNEWOOD_OBELISK = register("runewood_obelisk", DEFAULT_PROPERTIES(), (p) -> new MultiBlockItem(BlockRegistry.RUNEWOOD_OBELISK.get(), p, RunewoodObeliskBlockEntity.STRUCTURE)); public static final DeferredHolder BRILLIANT_OBELISK = register("brilliant_obelisk", DEFAULT_PROPERTIES(), (p) -> new MultiBlockItem(BlockRegistry.BRILLIANT_OBELISK.get(), p, BrilliantObeliskBlockEntity.STRUCTURE)); + public static final DeferredHolder RUNIC_WORKBENCH = register("runic_workbench", DEFAULT_PROPERTIES(), (p) -> new BlockItem(BlockRegistry.RUNIC_WORKBENCH.get(), p)); public static final DeferredHolder SPIRIT_JAR = register("spirit_jar", DEFAULT_PROPERTIES(), (p) -> new SpiritJarItem(BlockRegistry.SPIRIT_JAR.get(), p)); public static final DeferredHolder SPIRIT_CRUCIBLE = register("spirit_crucible", DEFAULT_PROPERTIES(), (p) -> new MultiBlockItem(BlockRegistry.SPIRIT_CRUCIBLE.get(), p, SpiritCrucibleCoreBlockEntity.STRUCTURE)); public static final DeferredHolder SPIRIT_CATALYZER = register("spirit_catalyzer", DEFAULT_PROPERTIES(), (p) -> new MultiBlockItem(BlockRegistry.SPIRIT_CATALYZER.get(), p, SpiritCatalyzerCoreBlockEntity.STRUCTURE)); @@ -469,6 +469,9 @@ public static DeferredHolder register(String name, Ite public static final DeferredHolder SOULWOOD_TOTEM_BASE = register("soulwood_totem_base", DEFAULT_PROPERTIES(), (p) -> new BlockItem(BlockRegistry.SOULWOOD_TOTEM_BASE.get(), p)); public static final DeferredHolder RITUAL_PLINTH = register("ritual_plinth", DEFAULT_PROPERTIES(), (p) -> new BlockItem(BlockRegistry.RITUAL_PLINTH.get(), p)); + public static final DeferredHolder CHRONOPULSER = register("chronopulser", DEFAULT_PROPERTIES(), (p) -> new BlockItem(BlockRegistry.CHRONOPULSER.get(), p)); + public static final DeferredHolder PULSEBANK = register("pulsebank", DEFAULT_PROPERTIES(), (p) -> new BlockItem(BlockRegistry.PULSEBANK.get(), p)); + public static final DeferredHolder WEAVERS_WORKBENCH = register("weavers_workbench", COSMETIC_PROPERTIES(), (p) -> new BlockItem(BlockRegistry.WEAVERS_WORKBENCH.get(), p)); //endregion diff --git a/src/main/resources/assets/malum/models/block/soulwoven_banner_directional.json b/src/main/resources/assets/malum/models/block/soulwoven_banner_directional.json index 287c5f199..2f09c3b1b 100644 --- a/src/main/resources/assets/malum/models/block/soulwoven_banner_directional.json +++ b/src/main/resources/assets/malum/models/block/soulwoven_banner_directional.json @@ -26,7 +26,7 @@ "rotation": {"angle": 0, "axis": "y", "origin": [7, 9, 0]}, "faces": { "north": {"uv": [0, 6, 16, 16], "texture": "#wood", "cullface": "north"}, - "south": {"uv": [0, 6, 16, 16], "texture": "#wood"} + "south": {"uv": [0, 6, 16, 16], "texture": "#wood", "cullface": "north"} } }, { diff --git a/src/main/resources/assets/malum/sounds/brazier/braizer_loop.ogg b/src/main/resources/assets/malum/sounds/brazier/braizer_loop.ogg new file mode 100644 index 000000000..89dc54315 Binary files /dev/null and b/src/main/resources/assets/malum/sounds/brazier/braizer_loop.ogg differ diff --git a/src/main/resources/assets/malum/sounds/brazier/brazier_end1.ogg b/src/main/resources/assets/malum/sounds/brazier/brazier_end1.ogg new file mode 100644 index 000000000..b9cae46ca Binary files /dev/null and b/src/main/resources/assets/malum/sounds/brazier/brazier_end1.ogg differ diff --git a/src/main/resources/assets/malum/sounds/brazier/brazier_end2.ogg b/src/main/resources/assets/malum/sounds/brazier/brazier_end2.ogg new file mode 100644 index 000000000..8ef473282 Binary files /dev/null and b/src/main/resources/assets/malum/sounds/brazier/brazier_end2.ogg differ diff --git a/src/main/resources/assets/malum/sounds/brazier/brazier_end3.ogg b/src/main/resources/assets/malum/sounds/brazier/brazier_end3.ogg new file mode 100644 index 000000000..ce57f0fde Binary files /dev/null and b/src/main/resources/assets/malum/sounds/brazier/brazier_end3.ogg differ diff --git a/src/main/resources/assets/malum/sounds/brazier/brazier_sacrifice1.ogg b/src/main/resources/assets/malum/sounds/brazier/brazier_sacrifice1.ogg new file mode 100644 index 000000000..b656d4cbd Binary files /dev/null and b/src/main/resources/assets/malum/sounds/brazier/brazier_sacrifice1.ogg differ diff --git a/src/main/resources/assets/malum/sounds/brazier/brazier_sacrifice2.ogg b/src/main/resources/assets/malum/sounds/brazier/brazier_sacrifice2.ogg new file mode 100644 index 000000000..f72a54d3b Binary files /dev/null and b/src/main/resources/assets/malum/sounds/brazier/brazier_sacrifice2.ogg differ diff --git a/src/main/resources/assets/malum/sounds/brazier/brazier_sacrifice3.ogg b/src/main/resources/assets/malum/sounds/brazier/brazier_sacrifice3.ogg new file mode 100644 index 000000000..23bb63fda Binary files /dev/null and b/src/main/resources/assets/malum/sounds/brazier/brazier_sacrifice3.ogg differ diff --git a/src/main/resources/assets/malum/sounds/brazier/brazier_sacrifice4.ogg b/src/main/resources/assets/malum/sounds/brazier/brazier_sacrifice4.ogg new file mode 100644 index 000000000..d6e875d47 Binary files /dev/null and b/src/main/resources/assets/malum/sounds/brazier/brazier_sacrifice4.ogg differ diff --git a/src/main/resources/assets/malum/sounds/brazier/brazier_start1.ogg b/src/main/resources/assets/malum/sounds/brazier/brazier_start1.ogg new file mode 100644 index 000000000..e7ffc4577 Binary files /dev/null and b/src/main/resources/assets/malum/sounds/brazier/brazier_start1.ogg differ diff --git a/src/main/resources/assets/malum/sounds/brazier/brazier_start2.ogg b/src/main/resources/assets/malum/sounds/brazier/brazier_start2.ogg new file mode 100644 index 000000000..6ce658f4e Binary files /dev/null and b/src/main/resources/assets/malum/sounds/brazier/brazier_start2.ogg differ diff --git a/src/main/resources/assets/malum/sounds/brazier/brazier_start3.ogg b/src/main/resources/assets/malum/sounds/brazier/brazier_start3.ogg new file mode 100644 index 000000000..21cf22aac Binary files /dev/null and b/src/main/resources/assets/malum/sounds/brazier/brazier_start3.ogg differ diff --git a/src/main/resources/assets/malum/sounds/equip_sounds/charm/equip_charm1.ogg b/src/main/resources/assets/malum/sounds/equip_sounds/charm/equip_charm1.ogg new file mode 100644 index 000000000..9465d8028 Binary files /dev/null and b/src/main/resources/assets/malum/sounds/equip_sounds/charm/equip_charm1.ogg differ diff --git a/src/main/resources/assets/malum/sounds/equip_sounds/charm/equip_charm2.ogg b/src/main/resources/assets/malum/sounds/equip_sounds/charm/equip_charm2.ogg new file mode 100644 index 000000000..401550afb Binary files /dev/null and b/src/main/resources/assets/malum/sounds/equip_sounds/charm/equip_charm2.ogg differ diff --git a/src/main/resources/assets/malum/sounds/equip_sounds/charm/equip_charm3.ogg b/src/main/resources/assets/malum/sounds/equip_sounds/charm/equip_charm3.ogg new file mode 100644 index 000000000..48eba5070 Binary files /dev/null and b/src/main/resources/assets/malum/sounds/equip_sounds/charm/equip_charm3.ogg differ diff --git a/src/main/resources/assets/malum/textures/block/redstone/chronopulser_overlay.png b/src/main/resources/assets/malum/textures/block/redstone/chronopulser_overlay.png new file mode 100644 index 000000000..cc4cdf9d0 Binary files /dev/null and b/src/main/resources/assets/malum/textures/block/redstone/chronopulser_overlay.png differ diff --git a/src/main/resources/assets/malum/textures/block/redstone/chronopulser_side.png b/src/main/resources/assets/malum/textures/block/redstone/chronopulser_side.png new file mode 100644 index 000000000..5d4070b8f Binary files /dev/null and b/src/main/resources/assets/malum/textures/block/redstone/chronopulser_side.png differ diff --git a/src/main/resources/assets/malum/textures/block/redstone/pulsebank_overlay.png b/src/main/resources/assets/malum/textures/block/redstone/pulsebank_overlay.png new file mode 100644 index 000000000..3f51ac6e4 Binary files /dev/null and b/src/main/resources/assets/malum/textures/block/redstone/pulsebank_overlay.png differ diff --git a/src/main/resources/assets/malum/textures/block/redstone/pulsebank_side.png b/src/main/resources/assets/malum/textures/block/redstone/pulsebank_side.png new file mode 100644 index 000000000..10dd17d60 Binary files /dev/null and b/src/main/resources/assets/malum/textures/block/redstone/pulsebank_side.png differ diff --git a/src/main/resources/assets/malum/textures/block/redstone/runewood_frame_bottom.png b/src/main/resources/assets/malum/textures/block/redstone/runewood_frame_bottom.png new file mode 100644 index 000000000..a463e6aae Binary files /dev/null and b/src/main/resources/assets/malum/textures/block/redstone/runewood_frame_bottom.png differ diff --git a/src/main/resources/assets/malum/textures/block/redstone/runewood_frame_top.png b/src/main/resources/assets/malum/textures/block/redstone/runewood_frame_top.png new file mode 100644 index 000000000..9f8a907f2 Binary files /dev/null and b/src/main/resources/assets/malum/textures/block/redstone/runewood_frame_top.png differ diff --git a/src/main/resources/pack.mcmeta b/src/main/resources/pack.mcmeta index 9484530b2..4688e9daa 100644 --- a/src/main/resources/pack.mcmeta +++ b/src/main/resources/pack.mcmeta @@ -1,7 +1,7 @@ { "pack": { - "description": "Malum resources", - "pack_format": 10 + "description": "${modId} resources", + "pack_format": 16 }, "fusion": { "overrides_folder": "fusion" diff --git a/src/main/templates/META-INF/neoforge.mods.toml b/src/main/templates/META-INF/neoforge.mods.toml index d33636956..594d9fee7 100644 --- a/src/main/templates/META-INF/neoforge.mods.toml +++ b/src/main/templates/META-INF/neoforge.mods.toml @@ -9,6 +9,18 @@ displayName="${mod_name}" authors="${mod_authors}" description='''${mod_description}''' +[[accessTransformers]] +file = "META-INF/accesstransformer.cfg" + +[[accessTransformers]] +file = "META-INF/blockproperties.cfg" + +[[accessTransformers]] +file = "META-INF/recipebuilders.cfg" + +[[accessTransformers]] +file = "META-INF/renderstates.cfg" + [[mixins]] config="${mod_id}.mixins.json"