diff --git a/gradle.properties b/gradle.properties index 86a239c1a..0dc5a66dd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ org.gradle.daemon=false # Dependency Version minecraftVersion=1.18.2 forgeVersion=40.2.0 -lodestoneVersion=1.4.2.448 +lodestoneVersion=1.4.2.469 forgegradleVersion=5.1.53 mixingradleVersion=0.7-SNAPSHOT librarianVersion=1.+ diff --git a/src/main/java/com/sammy/malum/client/ParticleEffects.java b/src/main/java/com/sammy/malum/client/ParticleEffects.java deleted file mode 100644 index e4911a7d8..000000000 --- a/src/main/java/com/sammy/malum/client/ParticleEffects.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.sammy.malum.client; - -import com.sammy.malum.registry.client.*; -import net.minecraft.world.level.Level; -import net.minecraft.world.phys.Vec3; -import team.lodestar.lodestone.setup.LodestoneParticleRegistry; -import team.lodestar.lodestone.systems.particle.SimpleParticleOptions; -import team.lodestar.lodestone.systems.particle.WorldParticleBuilder; -import team.lodestar.lodestone.systems.particle.data.ColorParticleData; -import team.lodestar.lodestone.systems.particle.data.GenericParticleData; -import team.lodestar.lodestone.systems.particle.data.SpinParticleData; - -import java.awt.*; -import java.util.Random; - -import static net.minecraft.util.Mth.nextFloat; - -public class ParticleEffects { - public static void spawnSpiritGlimmerParticles(Level level, double x, double y, double z, Color color, Color endColor) { - spawnSpiritGlimmerParticles(level, x, y, z, 1, Vec3.ZERO, color, endColor); - } - - public static void spawnSpiritGlimmerParticles(Level level, double x, double y, double z, float alphaMultiplier, Vec3 extraVelocity, Color color, Color endColor) { - Random rand = level.getRandom(); - WorldParticleBuilder.create(LodestoneParticleRegistry.TWINKLE_PARTICLE) - .setTransparencyData(GenericParticleData.create(0.4f * alphaMultiplier, 0f).build()) - .setScaleData(GenericParticleData.create(0.25f + rand.nextFloat() * 0.1f, 0).build()) - .setColorData(ColorParticleData.create(color, endColor).build()) - .setLifetime(5 + rand.nextInt(4)) - .setRandomOffset(0.05f) - .enableNoClip() - .addMotion(extraVelocity.x, extraVelocity.y, extraVelocity.z) - .setRandomMotion(0.02f, 0.02f) - .setDiscardFunction(SimpleParticleOptions.ParticleDiscardFunctionType.INVISIBLE) - .spawn(level, x, y, z); - - spiritLightSpecs(level, x, y, z, 1, extraVelocity, color, endColor); - } - - public static void spiritLightSpecs(Level level, double x, double y, double z, Color color, Color endColor) { - spiritLightSpecs(level, x, y, z, 1, Vec3.ZERO, color, endColor); - } - - public static void spiritLightSpecs(Level level, double x, double y, double z, float alphaMultiplier, Vec3 extraVelocity, Color color, Color endColor) { - Random rand = level.getRandom(); - final ColorParticleData colorData = ColorParticleData.create(color, endColor).setCoefficient(1.25f).build(); - final SpinParticleData spinData = SpinParticleData.createRandomDirection(rand, nextFloat(rand, 0.05f, 0.1f)).randomSpinOffset(rand).build(); - - WorldParticleBuilder.create(rand.nextFloat() < 0.8 ? ParticleRegistry.LIGHT_SPEC_SMALL : ParticleRegistry.LIGHT_SPEC_LARGE) - .setTransparencyData(GenericParticleData.create(0.8f, 0f).build()) - .setSpinData(spinData) - .setScaleData(GenericParticleData.create(0.025f, 0.25f + rand.nextFloat() * 0.05f, 0).build()) - .setColorData(colorData) - .setLifetime(10 + rand.nextInt(5)) - .enableNoClip() - .setRandomOffset(0.01f) - .addMotion(extraVelocity) - .addActor(p -> p.setParticleSpeed(p.getParticleSpeed().scale(0.95f))) - .spawn(level, x, y, z); - - WorldParticleBuilder.create(LodestoneParticleRegistry.WISP_PARTICLE) - .setTransparencyData(GenericParticleData.create(0.4f * alphaMultiplier, 0f).build()) - .setSpinData(spinData) - .setScaleData(GenericParticleData.create(0.05f, 0.1f + rand.nextFloat() * 0.05f, 0).build()) - .setColorData(colorData) - .setLifetime(10 + rand.nextInt(5)) - .enableNoClip() - .addMotion(extraVelocity) - .addActor(p -> p.setParticleSpeed(p.getParticleSpeed().scale(0.95f))) - .spawn(level, x, y, z) - .setScaleData(GenericParticleData.create(0.075f, 0.15f + rand.nextFloat() * 0.05f, 0).build()) - .spawn(level, x, y, z); - } -} diff --git a/src/main/java/com/sammy/malum/client/particles/spiritflame/SpiritFlameParticleType.java b/src/main/java/com/sammy/malum/client/particles/spiritflame/SpiritFlameParticleType.java index 7ab47c68f..9a63881f0 100644 --- a/src/main/java/com/sammy/malum/client/particles/spiritflame/SpiritFlameParticleType.java +++ b/src/main/java/com/sammy/malum/client/particles/spiritflame/SpiritFlameParticleType.java @@ -18,7 +18,7 @@ public SpiritFlameParticleType() { @Override public Codec codec() { - return WorldParticleOptions.codecFor(this); + return WorldParticleOptions.worldCodec(this); } public static class Factory implements ParticleProvider { diff --git a/src/main/java/com/sammy/malum/client/renderer/block/ItemPedestalRenderer.java b/src/main/java/com/sammy/malum/client/renderer/block/ItemPedestalRenderer.java deleted file mode 100644 index 51be76dd9..000000000 --- a/src/main/java/com/sammy/malum/client/renderer/block/ItemPedestalRenderer.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.sammy.malum.client.renderer.block; - -import com.mojang.blaze3d.vertex.PoseStack; -import com.mojang.math.Vector3f; -import com.sammy.malum.common.block.storage.ItemPedestalBlockEntity; -import com.sammy.malum.common.item.spirit.SpiritShardItem; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.MultiBufferSource; -import net.minecraft.client.renderer.block.model.ItemTransforms; -import net.minecraft.client.renderer.blockentity.BlockEntityRenderer; -import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider; -import net.minecraft.client.renderer.entity.ItemRenderer; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.Level; - -import static net.minecraft.client.renderer.texture.OverlayTexture.NO_OVERLAY; - - -public class ItemPedestalRenderer implements BlockEntityRenderer { - public ItemPedestalRenderer(BlockEntityRendererProvider.Context context) { - } - - @Override - public void render(ItemPedestalBlockEntity blockEntityIn, float partialTicks, PoseStack poseStack, MultiBufferSource bufferIn, int combinedLightIn, int combinedOverlayIn) { - Level level = Minecraft.getInstance().level; - ItemRenderer itemRenderer = Minecraft.getInstance().getItemRenderer(); - ItemStack stack = blockEntityIn.inventory.getStackInSlot(0); - if (!stack.isEmpty()) { - poseStack.pushPose(); - Vector3f offset = new Vector3f(blockEntityIn.itemOffset()); - if (stack.getItem() instanceof SpiritShardItem) { - double y = Math.sin((((level.getGameTime() % 360) + partialTicks)) / 20f) * 0.1f; - poseStack.translate(0, y, 0); - } - poseStack.translate(offset.x(), offset.y(), offset.z()); - poseStack.mulPose(Vector3f.YP.rotationDegrees(((level.getGameTime() % 360) + partialTicks) * 3)); - poseStack.scale(0.6f, 0.6f, 0.6f); - itemRenderer.renderStatic(stack, ItemTransforms.TransformType.FIXED, combinedLightIn, NO_OVERLAY, poseStack, bufferIn, 0); - poseStack.popPose(); - } - } -} \ No newline at end of file diff --git a/src/main/java/com/sammy/malum/client/renderer/block/ItemStandRenderer.java b/src/main/java/com/sammy/malum/client/renderer/block/MalumItemHolderRenderer.java similarity index 61% rename from src/main/java/com/sammy/malum/client/renderer/block/ItemStandRenderer.java rename to src/main/java/com/sammy/malum/client/renderer/block/MalumItemHolderRenderer.java index a2f2de7a7..96996350b 100644 --- a/src/main/java/com/sammy/malum/client/renderer/block/ItemStandRenderer.java +++ b/src/main/java/com/sammy/malum/client/renderer/block/MalumItemHolderRenderer.java @@ -2,8 +2,7 @@ import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.math.Vector3f; -import com.sammy.malum.common.block.storage.ItemStandBlockEntity; -import com.sammy.malum.common.item.spirit.SpiritShardItem; +import com.sammy.malum.common.block.storage.*; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.block.model.ItemTransforms; @@ -12,27 +11,24 @@ import net.minecraft.client.renderer.entity.ItemRenderer; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; +import net.minecraft.world.phys.*; import static net.minecraft.client.renderer.texture.OverlayTexture.NO_OVERLAY; -public class ItemStandRenderer implements BlockEntityRenderer { - public ItemStandRenderer(BlockEntityRendererProvider.Context context) { +public class MalumItemHolderRenderer implements BlockEntityRenderer { + public MalumItemHolderRenderer(BlockEntityRendererProvider.Context context) { } @Override - public void render(ItemStandBlockEntity blockEntityIn, float partialTicks, PoseStack poseStack, MultiBufferSource bufferIn, int combinedLightIn, int combinedOverlayIn) { + public void render(MalumItemHolderBlockEntity blockEntityIn, float partialTicks, PoseStack poseStack, MultiBufferSource bufferIn, int combinedLightIn, int combinedOverlayIn) { Level level = Minecraft.getInstance().level; ItemRenderer itemRenderer = Minecraft.getInstance().getItemRenderer(); ItemStack stack = blockEntityIn.inventory.getStackInSlot(0); if (!stack.isEmpty()) { poseStack.pushPose(); - Vector3f offset = new Vector3f(blockEntityIn.itemOffset()); - if (stack.getItem() instanceof SpiritShardItem) { - double y = Math.sin(((level.getGameTime() + partialTicks)) / 20f) * 0.05f; - poseStack.translate(0, y, 0); - } - poseStack.translate(offset.x(), offset.y(), offset.z()); + Vec3 itemOffset = blockEntityIn.getItemOffset(); + poseStack.translate(itemOffset.x(), itemOffset.y(), itemOffset.z()); poseStack.mulPose(Vector3f.YP.rotationDegrees(((level.getGameTime() % 360) + partialTicks) * 3)); poseStack.scale(0.6f, 0.6f, 0.6f); itemRenderer.renderStatic(stack, ItemTransforms.TransformType.FIXED, combinedLightIn, NO_OVERLAY, poseStack, bufferIn, 0); diff --git a/src/main/java/com/sammy/malum/client/renderer/block/SoulVialRenderer.java b/src/main/java/com/sammy/malum/client/renderer/block/SoulVialRenderer.java index dc35ceb2f..947da9d5d 100644 --- a/src/main/java/com/sammy/malum/client/renderer/block/SoulVialRenderer.java +++ b/src/main/java/com/sammy/malum/client/renderer/block/SoulVialRenderer.java @@ -1,7 +1,7 @@ package com.sammy.malum.client.renderer.block; import com.mojang.blaze3d.vertex.PoseStack; -import com.sammy.malum.common.block.storage.SoulVialBlockEntity; +import com.sammy.malum.common.block.storage.vial.SoulVialBlockEntity; import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.blockentity.BlockEntityRenderer; import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider; diff --git a/src/main/java/com/sammy/malum/client/renderer/block/SpiritJarRenderer.java b/src/main/java/com/sammy/malum/client/renderer/block/SpiritJarRenderer.java index e96456ca3..076c6c4e3 100644 --- a/src/main/java/com/sammy/malum/client/renderer/block/SpiritJarRenderer.java +++ b/src/main/java/com/sammy/malum/client/renderer/block/SpiritJarRenderer.java @@ -2,7 +2,7 @@ import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.math.Vector3f; -import com.sammy.malum.common.block.storage.SpiritJarBlockEntity; +import com.sammy.malum.common.block.storage.jar.SpiritJarBlockEntity; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.block.model.ItemTransforms; @@ -24,7 +24,7 @@ public void render(SpiritJarBlockEntity blockEntityIn, float partialTicks, PoseS ItemRenderer itemRenderer = Minecraft.getInstance().getItemRenderer(); if (blockEntityIn.type != null) { poseStack.pushPose(); - double y = 0.5f + Math.sin((level.getGameTime() + partialTicks) / 20f) * 0.2f; + double y = 0.5f + (float)Math.sin((level.getGameTime() % 360) / 20f) * 0.2f; poseStack.translate(0.5f, y, 0.5f); poseStack.mulPose(Vector3f.YP.rotationDegrees(((level.getGameTime() % 360) + partialTicks) * 3)); poseStack.scale(0.6f, 0.6f, 0.6f); diff --git a/src/main/java/com/sammy/malum/client/renderer/entity/FloatingItemEntityRenderer.java b/src/main/java/com/sammy/malum/client/renderer/entity/FloatingItemEntityRenderer.java index 50dda27a1..255140c24 100644 --- a/src/main/java/com/sammy/malum/client/renderer/entity/FloatingItemEntityRenderer.java +++ b/src/main/java/com/sammy/malum/client/renderer/entity/FloatingItemEntityRenderer.java @@ -47,17 +47,17 @@ public void render(FloatingItemEntity entity, float entityYaw, float partialTick float x = (float) Mth.lerp(partialTicks, entity.xOld, entity.getX()); float y = (float) Mth.lerp(partialTicks, entity.yOld, entity.getY()); float z = (float) Mth.lerp(partialTicks, entity.zOld, entity.getZ()); - trailPoints.add(new TrailPoint(new Vec3(x, y + entity.getYOffset(partialTicks) + 0.25F, z).add(entity.getDeltaMovement().multiply(partialTicks, partialTicks, partialTicks)))); + trailPoints.add(new TrailPoint(new Vec3(x, y + entity.getYOffset(partialTicks) + 0.25F, z).add(entity.getDeltaMovement().scale(1+partialTicks)))); poseStack.translate(-x, -y, -z); VFXBuilders.WorldVFXBuilder builder = VFXBuilders.createWorld().setPosColorTexLightmapDefaultFormat(); VertexConsumer lightBuffer = DELAYED_RENDER.getBuffer(LIGHT_TYPE); for (int i = 0; i < 2; i++) { - float size = 0.4f + i * 0.2f; + float size = 0.2f + i * 0.2f; float alpha = (0.7f - i * 0.35f); builder.setAlpha(alpha) - .renderTrail(lightBuffer, poseStack, trailPoints, f -> size, f -> builder.setAlpha(alpha * f).setColor(ColorHelper.colorLerp(Easing.SINE_IN, f * 3f, entity.endColor, entity.startColor))) - .renderTrail(lightBuffer, poseStack, trailPoints, f -> 1.5f * size, f -> builder.setAlpha(alpha * f / 2f).setColor(ColorHelper.colorLerp(Easing.SINE_IN, f * 2f, entity.endColor, entity.startColor))) - .renderTrail(lightBuffer, poseStack, trailPoints, f -> size * 2.5f, f -> builder.setAlpha(alpha * f / 4f).setColor(ColorHelper.colorLerp(Easing.SINE_IN, f * 2f, entity.endColor, entity.startColor))); + .renderTrail(lightBuffer, poseStack, trailPoints, f -> size, f -> builder.setAlpha(alpha * f).setColor(ColorHelper.colorLerp(Easing.SINE_IN, f * 2f, entity.endColor, entity.startColor))) + .renderTrail(lightBuffer, poseStack, trailPoints, f -> 1.5f * size, f -> builder.setAlpha(alpha * f / 2f).setColor(ColorHelper.colorLerp(Easing.SINE_IN, f * 1.5f, entity.endColor, entity.startColor))) + .renderTrail(lightBuffer, poseStack, trailPoints, f -> size * 2.5f, f -> builder.setAlpha(alpha * f / 4f).setColor(ColorHelper.colorLerp(Easing.SINE_IN, f * 1.5f, entity.endColor, entity.startColor))); } poseStack.translate(x, y, z); } diff --git a/src/main/java/com/sammy/malum/client/renderer/item/SpiritJarItemRenderer.java b/src/main/java/com/sammy/malum/client/renderer/item/SpiritJarItemRenderer.java index 03df0469a..6fb53d2b6 100644 --- a/src/main/java/com/sammy/malum/client/renderer/item/SpiritJarItemRenderer.java +++ b/src/main/java/com/sammy/malum/client/renderer/item/SpiritJarItemRenderer.java @@ -1,7 +1,7 @@ package com.sammy.malum.client.renderer.item; import com.mojang.blaze3d.vertex.PoseStack; -import com.sammy.malum.common.block.storage.SpiritJarBlockEntity; +import com.sammy.malum.common.block.storage.jar.SpiritJarBlockEntity; import com.sammy.malum.common.item.spirit.SpiritJarItem; import com.sammy.malum.core.helper.SpiritHelper; import com.sammy.malum.registry.common.block.BlockRegistry; diff --git a/src/main/java/com/sammy/malum/common/block/curiosities/obelisk/RunewoodObeliskBlockEntity.java b/src/main/java/com/sammy/malum/common/block/curiosities/obelisk/RunewoodObeliskBlockEntity.java index e16e1c770..5343a9892 100644 --- a/src/main/java/com/sammy/malum/common/block/curiosities/obelisk/RunewoodObeliskBlockEntity.java +++ b/src/main/java/com/sammy/malum/common/block/curiosities/obelisk/RunewoodObeliskBlockEntity.java @@ -11,6 +11,7 @@ import team.lodestar.lodestone.systems.easing.*; import team.lodestar.lodestone.systems.multiblock.*; import team.lodestar.lodestone.systems.particle.*; +import team.lodestar.lodestone.systems.particle.builder.*; import team.lodestar.lodestone.systems.particle.data.*; import java.awt.*; diff --git a/src/main/java/com/sammy/malum/common/block/curiosities/spirit_altar/IAltarProvider.java b/src/main/java/com/sammy/malum/common/block/curiosities/spirit_altar/IAltarProvider.java deleted file mode 100644 index ceccc0209..000000000 --- a/src/main/java/com/sammy/malum/common/block/curiosities/spirit_altar/IAltarProvider.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.sammy.malum.common.block.curiosities.spirit_altar; - -import net.minecraft.core.BlockPos; -import net.minecraft.world.phys.Vec3; -import team.lodestar.lodestone.systems.blockentity.LodestoneBlockEntityInventory; - -public interface IAltarProvider -{ - LodestoneBlockEntityInventory getInventoryForAltar(); - Vec3 getItemPosForAltar(); - BlockPos getBlockPosForAltar(); -} diff --git a/src/main/java/com/sammy/malum/common/block/curiosities/spirit_altar/SpiritAltarBlockEntity.java b/src/main/java/com/sammy/malum/common/block/curiosities/spirit_altar/SpiritAltarBlockEntity.java index 178e77e40..2c6ca44b6 100644 --- a/src/main/java/com/sammy/malum/common/block/curiosities/spirit_altar/SpiritAltarBlockEntity.java +++ b/src/main/java/com/sammy/malum/common/block/curiosities/spirit_altar/SpiritAltarBlockEntity.java @@ -1,6 +1,6 @@ package com.sammy.malum.common.block.curiosities.spirit_altar; -import com.sammy.malum.client.*; +import com.sammy.malum.common.block.storage.*; import com.sammy.malum.common.item.spirit.*; import com.sammy.malum.common.packets.particle.curiosities.altar.*; import com.sammy.malum.common.recipe.*; @@ -9,6 +9,7 @@ import com.sammy.malum.core.systems.spirit.*; import com.sammy.malum.registry.common.*; import com.sammy.malum.registry.common.block.*; +import com.sammy.malum.visual_effects.*; import net.minecraft.core.*; import net.minecraft.nbt.*; import net.minecraft.sounds.*; @@ -31,6 +32,7 @@ import team.lodestar.lodestone.systems.blockentity.*; import team.lodestar.lodestone.systems.easing.*; import team.lodestar.lodestone.systems.particle.*; +import team.lodestar.lodestone.systems.particle.builder.*; import team.lodestar.lodestone.systems.particle.data.*; import team.lodestar.lodestone.systems.recipe.*; @@ -42,7 +44,6 @@ import java.util.stream.*; import static com.sammy.malum.registry.common.PacketRegistry.*; -import static com.sammy.malum.registry.common.SpiritTypeRegistry.SACRED_SPIRIT; public class SpiritAltarBlockEntity extends LodestoneBlockEntity { @@ -276,9 +277,9 @@ public boolean consume() { int extras = extrasInventory.nonEmptyItemAmount; if (extras < recipe.extraItems.size()) { progress *= 0.8f; - Collection altarProviders = BlockHelper.getBlockEntities(IAltarProvider.class, level, worldPosition, HORIZONTAL_RANGE, VERTICAL_RANGE, HORIZONTAL_RANGE); - for (IAltarProvider provider : altarProviders) { - LodestoneBlockEntityInventory inventoryForAltar = provider.getInventoryForAltar(); + Collection altarProviders = BlockHelper.getBlockEntities(IMalumSpecialItemAccessPoint.class, level, worldPosition, HORIZONTAL_RANGE, VERTICAL_RANGE, HORIZONTAL_RANGE); + for (IMalumSpecialItemAccessPoint provider : altarProviders) { + LodestoneBlockEntityInventory inventoryForAltar = provider.getSuppliedInventory(); ItemStack providedStack = inventoryForAltar.getStackInSlot(0); IngredientWithCount requestedItem = recipe.extraItems.get(extras); boolean matches = requestedItem.matches(providedStack); @@ -293,12 +294,12 @@ public boolean consume() { requestedItem = recipe.extraItems.get(extras); matches = requestedItem.matches(providedStack); if (matches) { - level.playSound(null, provider.getBlockPosForAltar(), SoundRegistry.ALTAR_CONSUME.get(), SoundSource.BLOCKS, 1, 0.9f + level.random.nextFloat() * 0.2f); - Vec3 providedItemPos = provider.getItemPosForAltar(); - MALUM_CHANNEL.send(PacketDistributor.TRACKING_CHUNK.with(() -> level.getChunkAt(provider.getBlockPosForAltar())), new AltarConsumeParticlePacket(providedStack, recipe.spirits.stream().map(s -> s.type.identifier).collect(Collectors.toList()), providedItemPos.x, providedItemPos.y, providedItemPos.z, itemPos.x, itemPos.y, itemPos.z)); + level.playSound(null, provider.getAccessPointBlockPos(), SoundRegistry.ALTAR_CONSUME.get(), SoundSource.BLOCKS, 1, 0.9f + level.random.nextFloat() * 0.2f); + Vec3 providedItemPos = provider.getItemCenterPos(); + MALUM_CHANNEL.send(PacketDistributor.TRACKING_CHUNK.with(() -> level.getChunkAt(provider.getAccessPointBlockPos())), new AltarConsumeParticlePacket(providedStack, recipe.spirits.stream().map(s -> s.type.identifier).collect(Collectors.toList()), providedItemPos.x, providedItemPos.y, providedItemPos.z, itemPos.x, itemPos.y, itemPos.z)); extrasInventory.insertItem(level, providedStack.split(requestedItem.count)); inventoryForAltar.updateData(); - BlockHelper.updateAndNotifyState(level, provider.getBlockPosForAltar()); + BlockHelper.updateAndNotifyState(level, provider.getAccessPointBlockPos()); break; } } @@ -410,10 +411,11 @@ public void passiveParticles() { Vec3 offset = getSpiritOffset(spiritsRendered++, 0); Color color = spiritSplinterItem.type.getPrimaryColor(); Color endColor = spiritSplinterItem.type.getSecondaryColor(); - double x = getBlockPos().getX() + offset.x(); - double y = getBlockPos().getY() + offset.y(); - double z = getBlockPos().getZ() + offset.z(); - ParticleEffects.spawnSpiritGlimmerParticles(level, x, y, z, color, endColor); + final BlockPos blockPos = getBlockPos(); + double x = blockPos.getX() + offset.x(); + double y = blockPos.getY() + offset.y(); + double z = blockPos.getZ() + offset.z(); + SpiritLightSpecs.spiritLightSpecs(level, new Vec3(blockPos.getX()+offset.x, blockPos.getY()+offset.y, blockPos.getZ()+offset.z), color, endColor); if (recipe != null) { Vec3 velocity = new Vec3(x, y, z).subtract(itemPos).normalize().scale(particleVelocityMultiplier); WorldParticleBuilder.create(LodestoneParticleRegistry.WISP_PARTICLE) diff --git a/src/main/java/com/sammy/malum/common/block/curiosities/spirit_crucible/SpiritCatalyzerCoreBlockEntity.java b/src/main/java/com/sammy/malum/common/block/curiosities/spirit_crucible/SpiritCatalyzerCoreBlockEntity.java index b8ce5ecef..2d5526785 100644 --- a/src/main/java/com/sammy/malum/common/block/curiosities/spirit_crucible/SpiritCatalyzerCoreBlockEntity.java +++ b/src/main/java/com/sammy/malum/common/block/curiosities/spirit_crucible/SpiritCatalyzerCoreBlockEntity.java @@ -24,7 +24,7 @@ import team.lodestar.lodestone.systems.multiblock.HorizontalDirectionStructure; import team.lodestar.lodestone.systems.multiblock.MultiBlockCoreEntity; import team.lodestar.lodestone.systems.multiblock.MultiBlockStructure; -import team.lodestar.lodestone.systems.particle.WorldParticleBuilder; +import team.lodestar.lodestone.systems.particle.builder.*; import team.lodestar.lodestone.systems.particle.data.ColorParticleData; import team.lodestar.lodestone.systems.particle.data.GenericParticleData; import team.lodestar.lodestone.systems.particle.data.SpinParticleData; diff --git a/src/main/java/com/sammy/malum/common/block/curiosities/spirit_crucible/SpiritCrucibleCoreBlockEntity.java b/src/main/java/com/sammy/malum/common/block/curiosities/spirit_crucible/SpiritCrucibleCoreBlockEntity.java index 4d260fecd..f4b247526 100644 --- a/src/main/java/com/sammy/malum/common/block/curiosities/spirit_crucible/SpiritCrucibleCoreBlockEntity.java +++ b/src/main/java/com/sammy/malum/common/block/curiosities/spirit_crucible/SpiritCrucibleCoreBlockEntity.java @@ -1,6 +1,6 @@ package com.sammy.malum.common.block.curiosities.spirit_crucible; -import com.sammy.malum.client.ParticleEffects; +import com.sammy.malum.visual_effects.SpiritLightSpecs; import com.sammy.malum.common.block.curiosities.tablet.ITabletTracker; import com.sammy.malum.common.block.curiosities.tablet.TwistedTabletBlockEntity; import com.sammy.malum.common.item.impetus.ImpetusItem; @@ -42,7 +42,7 @@ import team.lodestar.lodestone.systems.multiblock.MultiBlockCoreEntity; import team.lodestar.lodestone.systems.multiblock.MultiBlockStructure; import team.lodestar.lodestone.systems.particle.SimpleParticleOptions; -import team.lodestar.lodestone.systems.particle.WorldParticleBuilder; +import team.lodestar.lodestone.systems.particle.builder.*; import team.lodestar.lodestone.systems.particle.data.ColorParticleData; import team.lodestar.lodestone.systems.particle.data.GenericParticleData; import team.lodestar.lodestone.systems.particle.data.SpinParticleData; @@ -339,7 +339,7 @@ public void tick() { public void repair() { Vec3 itemPos = getItemPos(this); - Vec3 providedItemPos = validTablet.getItemPos(); + Vec3 providedItemPos = validTablet.getItemCenterPos(); ItemStack damagedItem = inventory.getStackInSlot(0); ItemStack repairMaterial = validTablet.inventory.getStackInSlot(0); ItemStack result = SpiritRepairRecipe.getRepairRecipeOutput(damagedItem); @@ -463,7 +463,7 @@ public void passiveParticles() { double x = getBlockPos().getX() + offset.x(); double y = getBlockPos().getY() + offset.y(); double z = getBlockPos().getZ() + offset.z(); - ParticleEffects.spawnSpiritGlimmerParticles(level, x, y, z, color, endColor); + SpiritLightSpecs.spiritLightSpecs(level, new Vec3(x,y,z), color, endColor); } } } @@ -488,7 +488,7 @@ public void passiveParticles() { for (int i = 0; i < colors.size(); i++) { Color color = colors.get(i); Color endColor = endColors.get(i); - Vec3 tabletItemPos = tabletBlockEntity.getItemPos(); + Vec3 tabletItemPos = tabletBlockEntity.getItemCenterPos(); Vec3 velocity = tabletItemPos.subtract(itemPos).normalize().scale(-0.1f); starParticles(itemPos, color, endColor); diff --git a/src/main/java/com/sammy/malum/common/block/curiosities/tablet/TwistedTabletBlockEntity.java b/src/main/java/com/sammy/malum/common/block/curiosities/tablet/TwistedTabletBlockEntity.java index 541a8135b..af1f0ddd2 100644 --- a/src/main/java/com/sammy/malum/common/block/curiosities/tablet/TwistedTabletBlockEntity.java +++ b/src/main/java/com/sammy/malum/common/block/curiosities/tablet/TwistedTabletBlockEntity.java @@ -1,6 +1,7 @@ package com.sammy.malum.common.block.curiosities.tablet; -import com.sammy.malum.common.block.storage.ItemStandBlockEntity; +import com.sammy.malum.common.block.storage.stand.ItemStandBlockEntity; +import com.sammy.malum.common.item.spirit.*; import com.sammy.malum.registry.common.block.BlockEntityRegistry; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -14,9 +15,11 @@ public TwistedTabletBlockEntity(BlockPos pos, BlockState state) { } @Override - public Vec3 itemOffset() { + public Vec3 getItemOffset() { Direction direction = getBlockState().getValue(BlockStateProperties.FACING); - Vec3 directionVector = new Vec3(direction.getStepX(), direction.getStepY(), direction.getStepZ()); - return new Vec3(0.5f + directionVector.x() * 0.25f, 0.5f + directionVector.y() * 0.4f, 0.5f + directionVector.z() * 0.25f); + float xOffset = direction.getStepX() * 0.25f; + float yOffset = direction.getStepY() * 0.4f + (inventory.getStackInSlot(0).getItem() instanceof SpiritShardItem ? (float)Math.sin((level.getGameTime() % 360) / 20f) * 0.05f : 0); + float zOffset = direction.getStepY() * 0.25f; + return new Vec3(0.5f - xOffset, 0.5f - yOffset, 0.5f - zOffset); } } diff --git a/src/main/java/com/sammy/malum/common/block/curiosities/totem/TotemBaseBlockEntity.java b/src/main/java/com/sammy/malum/common/block/curiosities/totem/TotemBaseBlockEntity.java index c0090f90a..605c92f3d 100644 --- a/src/main/java/com/sammy/malum/common/block/curiosities/totem/TotemBaseBlockEntity.java +++ b/src/main/java/com/sammy/malum/common/block/curiosities/totem/TotemBaseBlockEntity.java @@ -1,6 +1,6 @@ package com.sammy.malum.common.block.curiosities.totem; -import com.sammy.malum.common.block.storage.ItemStandBlockEntity; +import com.sammy.malum.common.block.storage.stand.ItemStandBlockEntity; import com.sammy.malum.common.packets.particle.curiosities.rite.SpiritRiteActivationEffectPacket; import com.sammy.malum.core.helper.SpiritHelper; import com.sammy.malum.registry.common.SoundRegistry; diff --git a/src/main/java/com/sammy/malum/common/block/curiosities/totem/TotemPoleBlockEntity.java b/src/main/java/com/sammy/malum/common/block/curiosities/totem/TotemPoleBlockEntity.java index f880970e4..1eefb7588 100644 --- a/src/main/java/com/sammy/malum/common/block/curiosities/totem/TotemPoleBlockEntity.java +++ b/src/main/java/com/sammy/malum/common/block/curiosities/totem/TotemPoleBlockEntity.java @@ -1,7 +1,7 @@ package com.sammy.malum.common.block.curiosities.totem; import com.google.common.collect.Sets; -import com.sammy.malum.common.block.storage.ItemStandBlockEntity; +import com.sammy.malum.common.block.storage.stand.ItemStandBlockEntity; import com.sammy.malum.common.packets.particle.curiosities.rite.generic.TotemPoleActivationEffectPacket; import com.sammy.malum.core.helper.SpiritHelper; import com.sammy.malum.core.systems.spirit.MalumSpiritType; @@ -31,7 +31,7 @@ import team.lodestar.lodestone.systems.blockentity.LodestoneBlockEntity; import team.lodestar.lodestone.systems.easing.Easing; import team.lodestar.lodestone.systems.particle.SimpleParticleOptions; -import team.lodestar.lodestone.systems.particle.WorldParticleBuilder; +import team.lodestar.lodestone.systems.particle.builder.*; import team.lodestar.lodestone.systems.particle.data.ColorParticleData; import team.lodestar.lodestone.systems.particle.data.GenericParticleData; import team.lodestar.lodestone.systems.particle.data.SpinParticleData; @@ -232,7 +232,7 @@ public void onBreak(@Nullable Player player) { public void filterParticles(ItemStandBlockEntity itemStandBlockEntity) { if (level.getGameTime() % 6L == 0) { if (!itemStandBlockEntity.inventory.getStackInSlot(0).isEmpty()) { - Vec3 itemPos = itemStandBlockEntity.getItemPos(); + Vec3 itemPos = itemStandBlockEntity.getItemCenterPos(); WorldParticleBuilder.create(LodestoneParticleRegistry.STAR_PARTICLE) .setTransparencyData(GenericParticleData.create(0.04f, 0.1f, 0f).build()) .setScaleData(GenericParticleData.create(0.5f, 1f + level.random.nextFloat() * 0.1f, 0).setEasing(Easing.QUINTIC_IN, Easing.CUBIC_IN_OUT).build()) diff --git a/src/main/java/com/sammy/malum/common/block/curiosities/weeping_well/VoidConduitBlockEntity.java b/src/main/java/com/sammy/malum/common/block/curiosities/weeping_well/VoidConduitBlockEntity.java index 4eb4c61e1..582f553ac 100644 --- a/src/main/java/com/sammy/malum/common/block/curiosities/weeping_well/VoidConduitBlockEntity.java +++ b/src/main/java/com/sammy/malum/common/block/curiosities/weeping_well/VoidConduitBlockEntity.java @@ -21,6 +21,7 @@ import team.lodestar.lodestone.systems.blockentity.*; import team.lodestar.lodestone.systems.easing.*; import team.lodestar.lodestone.systems.particle.*; +import team.lodestar.lodestone.systems.particle.builder.*; import team.lodestar.lodestone.systems.particle.data.*; import team.lodestar.lodestone.systems.particle.world.*; diff --git a/src/main/java/com/sammy/malum/common/block/ether/EtherBlockEntity.java b/src/main/java/com/sammy/malum/common/block/ether/EtherBlockEntity.java index 1ee6da2af..a487b18b9 100644 --- a/src/main/java/com/sammy/malum/common/block/ether/EtherBlockEntity.java +++ b/src/main/java/com/sammy/malum/common/block/ether/EtherBlockEntity.java @@ -21,7 +21,7 @@ import team.lodestar.lodestone.systems.blockentity.LodestoneBlockEntity; import team.lodestar.lodestone.systems.easing.Easing; import team.lodestar.lodestone.systems.particle.SimpleParticleOptions; -import team.lodestar.lodestone.systems.particle.WorldParticleBuilder; +import team.lodestar.lodestone.systems.particle.builder.*; import team.lodestar.lodestone.systems.particle.data.ColorParticleData; import team.lodestar.lodestone.systems.particle.data.GenericParticleData; import team.lodestar.lodestone.systems.particle.data.SpinParticleData; diff --git a/src/main/java/com/sammy/malum/common/block/nature/SapFilledLogBlock.java b/src/main/java/com/sammy/malum/common/block/nature/SapFilledLogBlock.java index 7fdede809..fee687e7e 100644 --- a/src/main/java/com/sammy/malum/common/block/nature/SapFilledLogBlock.java +++ b/src/main/java/com/sammy/malum/common/block/nature/SapFilledLogBlock.java @@ -18,7 +18,7 @@ import net.minecraftforge.items.ItemHandlerHelper; import team.lodestar.lodestone.helpers.BlockHelper; import team.lodestar.lodestone.setup.LodestoneParticleRegistry; -import team.lodestar.lodestone.systems.particle.WorldParticleBuilder; +import team.lodestar.lodestone.systems.particle.builder.*; import team.lodestar.lodestone.systems.particle.data.ColorParticleData; import team.lodestar.lodestone.systems.particle.data.GenericParticleData; import team.lodestar.lodestone.systems.particle.data.SpinParticleData; diff --git a/src/main/java/com/sammy/malum/common/block/storage/IMalumSpecialItemAccessPoint.java b/src/main/java/com/sammy/malum/common/block/storage/IMalumSpecialItemAccessPoint.java new file mode 100644 index 000000000..7ee16a4c2 --- /dev/null +++ b/src/main/java/com/sammy/malum/common/block/storage/IMalumSpecialItemAccessPoint.java @@ -0,0 +1,13 @@ +package com.sammy.malum.common.block.storage; + +import net.minecraft.core.BlockPos; +import net.minecraft.world.phys.Vec3; +import team.lodestar.lodestone.systems.blockentity.LodestoneBlockEntityInventory; + +public interface IMalumSpecialItemAccessPoint +{ + LodestoneBlockEntityInventory getSuppliedInventory(); + Vec3 getItemCenterPos(); + Vec3 getItemOffset(); + BlockPos getAccessPointBlockPos(); +} diff --git a/src/main/java/com/sammy/malum/common/block/storage/ItemPedestalBlockEntity.java b/src/main/java/com/sammy/malum/common/block/storage/ItemPedestalBlockEntity.java deleted file mode 100644 index ac1fd2dff..000000000 --- a/src/main/java/com/sammy/malum/common/block/storage/ItemPedestalBlockEntity.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.sammy.malum.common.block.storage; - -import com.sammy.malum.client.*; -import com.sammy.malum.common.block.curiosities.spirit_altar.*; -import com.sammy.malum.common.item.spirit.*; -import com.sammy.malum.registry.common.block.*; -import net.minecraft.core.*; -import net.minecraft.world.level.block.entity.*; -import net.minecraft.world.level.block.state.*; -import net.minecraft.world.phys.*; -import team.lodestar.lodestone.helpers.*; -import team.lodestar.lodestone.systems.blockentity.*; - -public class ItemPedestalBlockEntity extends ItemHolderBlockEntity implements IAltarProvider { - - public ItemPedestalBlockEntity(BlockEntityType type, BlockPos pos, BlockState state) { - super(type, pos, state); - } - public ItemPedestalBlockEntity(BlockPos pos, BlockState state) { - this(BlockEntityRegistry.ITEM_PEDESTAL.get(), pos, state); - inventory = new LodestoneBlockEntityInventory(1, 64) { - @Override - public void onContentsChanged(int slot) { - super.onContentsChanged(slot); - BlockHelper.updateAndNotifyState(level, worldPosition); - } - }; - } - - @Override - public LodestoneBlockEntityInventory getInventoryForAltar() { - return inventory; - } - - @Override - public Vec3 getItemPosForAltar() { - return getItemPos(); - } - - @Override - public BlockPos getBlockPosForAltar() { - return worldPosition; - } - - public Vec3 getItemPos() { - return BlockHelper.fromBlockPos(getBlockPos()).add(itemOffset()); - } - - public Vec3 itemOffset() { - return new Vec3(0.5f, 1.1f, 0.5f); - } - - @Override - public void tick() { - if (level.isClientSide) { - if (inventory.getStackInSlot(0).getItem() instanceof SpiritShardItem item) { - Vec3 pos = getItemPos(); - double x = pos.x; - double y = pos.y + Math.sin((level.getGameTime() ) / 20f) * 0.1f; - double z = pos.z; - ParticleEffects.spawnSpiritGlimmerParticles(level, x, y, z, item.type.getPrimaryColor(), item.type.getSecondaryColor()); - } - } - } -} diff --git a/src/main/java/com/sammy/malum/common/block/storage/ItemStandBlockEntity.java b/src/main/java/com/sammy/malum/common/block/storage/ItemStandBlockEntity.java deleted file mode 100644 index b2162e570..000000000 --- a/src/main/java/com/sammy/malum/common/block/storage/ItemStandBlockEntity.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.sammy.malum.common.block.storage; - -import com.sammy.malum.client.*; -import com.sammy.malum.common.block.curiosities.spirit_altar.*; -import com.sammy.malum.common.block.curiosities.totem.*; -import com.sammy.malum.common.item.spirit.*; -import com.sammy.malum.registry.common.block.*; -import net.minecraft.core.*; -import net.minecraft.world.entity.*; -import net.minecraft.world.item.*; -import net.minecraft.world.level.block.entity.*; -import net.minecraft.world.level.block.state.*; -import net.minecraft.world.level.block.state.properties.*; -import net.minecraft.world.phys.*; -import team.lodestar.lodestone.helpers.*; -import team.lodestar.lodestone.systems.blockentity.*; - - -public class ItemStandBlockEntity extends ItemHolderBlockEntity implements IAltarProvider { - - public ItemStandBlockEntity(BlockEntityType type, BlockPos pos, BlockState state) { - super(type, pos, state); - inventory = new LodestoneBlockEntityInventory(1, 64) { - @Override - public void onContentsChanged(int slot) { - super.onContentsChanged(slot); - BlockHelper.updateAndNotifyState(level, worldPosition); - } - }; - } - - public ItemStandBlockEntity(BlockPos pos, BlockState state) { - this(BlockEntityRegistry.ITEM_STAND.get(), pos, state); - } - - @Override - public LodestoneBlockEntityInventory getInventoryForAltar() { - return inventory; - } - - @Override - public Vec3 getItemPosForAltar() { - return getItemPos(); - } - - @Override - public BlockPos getBlockPosForAltar() { - return worldPosition; - } - - public Vec3 getItemPos() { - return BlockHelper.fromBlockPos(getBlockPos()).add(itemOffset()); - } - - public Vec3 itemOffset() { - Direction direction = getBlockState().getValue(BlockStateProperties.FACING); - Vec3 directionVector = new Vec3(direction.getStepX(), direction.getStepY(), direction.getStepZ()); - return new Vec3(0.5f - directionVector.x() * 0.25f, 0.5f - directionVector.y() * 0.1f, 0.5f - directionVector.z() * 0.25f); - } - - @Override - public void onPlace(LivingEntity placer, ItemStack stack) { - Direction direction = getBlockState().getValue(BlockStateProperties.FACING); - BlockPos totemPolePos = getBlockPos().relative(direction.getOpposite()); - if (level.getBlockEntity(totemPolePos) instanceof TotemPoleBlockEntity totemPole) { - TotemBaseBlockEntity totemBase = totemPole.totemBase; - if (totemBase != null) { - totemBase.addFilter(this); - BlockHelper.updateState(level, totemBase.getBlockPos()); - BlockHelper.updateState(level, totemPole.getBlockPos()); - } - } - } - - @Override - public void tick() { - if (level.isClientSide) { - if (inventory.getStackInSlot(0).getItem() instanceof SpiritShardItem item) { - Vec3 pos = getItemPos(); - double x = pos.x; - double y = pos.y + Math.sin((level.getGameTime()) / 20f) * 0.05f; - double z = pos.z; - ParticleEffects.spawnSpiritGlimmerParticles(level, x, y, z, item.type.getPrimaryColor(), item.type.getSecondaryColor()); - } - } - } -} diff --git a/src/main/java/com/sammy/malum/common/block/storage/MalumItemHolderBlockEntity.java b/src/main/java/com/sammy/malum/common/block/storage/MalumItemHolderBlockEntity.java new file mode 100644 index 000000000..33cd41222 --- /dev/null +++ b/src/main/java/com/sammy/malum/common/block/storage/MalumItemHolderBlockEntity.java @@ -0,0 +1,52 @@ +package com.sammy.malum.common.block.storage; + +import com.sammy.malum.common.item.spirit.*; +import com.sammy.malum.core.systems.spirit.*; +import com.sammy.malum.visual_effects.*; +import net.minecraft.core.*; +import net.minecraft.world.level.block.entity.*; +import net.minecraft.world.level.block.state.*; +import net.minecraft.world.phys.*; +import team.lodestar.lodestone.helpers.*; +import team.lodestar.lodestone.systems.blockentity.*; + +public abstract class MalumItemHolderBlockEntity extends ItemHolderBlockEntity implements IMalumSpecialItemAccessPoint { + + public MalumItemHolderBlockEntity(BlockEntityType type, BlockPos pos, BlockState state) { + super(type, pos, state); + inventory = new LodestoneBlockEntityInventory(1, 64) { + @Override + public void onContentsChanged(int slot) { + super.onContentsChanged(slot); + BlockHelper.updateAndNotifyState(level, worldPosition); + } + }; + } + + @Override + public LodestoneBlockEntityInventory getSuppliedInventory() { + return inventory; + } + + @Override + public Vec3 getItemCenterPos() { + final BlockPos blockPos = getBlockPos(); + final Vec3 offset = getItemOffset(); + return new Vec3(blockPos.getX()+offset.x, blockPos.getY()+offset.y, blockPos.getZ()+offset.z); + } + + @Override + public BlockPos getAccessPointBlockPos() { + return worldPosition; + } + + @Override + public void tick() { + if (level.isClientSide) { + if (inventory.getStackInSlot(0).getItem() instanceof SpiritShardItem item) { + MalumSpiritType type = item.type; + SpiritLightSpecs.stationarySpiritLightSpecs(level, getItemCenterPos(), type.getPrimaryColor(), type.getSecondaryColor()); + } + } + } +} \ No newline at end of file diff --git a/src/main/java/com/sammy/malum/common/block/storage/SpiritJarBlock.java b/src/main/java/com/sammy/malum/common/block/storage/jar/SpiritJarBlock.java similarity index 98% rename from src/main/java/com/sammy/malum/common/block/storage/SpiritJarBlock.java rename to src/main/java/com/sammy/malum/common/block/storage/jar/SpiritJarBlock.java index a0d7cf44d..b367585e9 100644 --- a/src/main/java/com/sammy/malum/common/block/storage/SpiritJarBlock.java +++ b/src/main/java/com/sammy/malum/common/block/storage/jar/SpiritJarBlock.java @@ -1,4 +1,4 @@ -package com.sammy.malum.common.block.storage; +package com.sammy.malum.common.block.storage.jar; import com.sammy.malum.registry.common.SpiritTypeRegistry; import net.minecraft.core.BlockPos; diff --git a/src/main/java/com/sammy/malum/common/block/storage/SpiritJarBlockEntity.java b/src/main/java/com/sammy/malum/common/block/storage/jar/SpiritJarBlockEntity.java similarity index 95% rename from src/main/java/com/sammy/malum/common/block/storage/SpiritJarBlockEntity.java rename to src/main/java/com/sammy/malum/common/block/storage/jar/SpiritJarBlockEntity.java index bcd763edd..666ac5e25 100644 --- a/src/main/java/com/sammy/malum/common/block/storage/SpiritJarBlockEntity.java +++ b/src/main/java/com/sammy/malum/common/block/storage/jar/SpiritJarBlockEntity.java @@ -1,6 +1,6 @@ -package com.sammy.malum.common.block.storage; +package com.sammy.malum.common.block.storage.jar; -import com.sammy.malum.client.ParticleEffects; +import com.sammy.malum.visual_effects.SpiritLightSpecs; import com.sammy.malum.common.item.spirit.SpiritShardItem; import com.sammy.malum.common.item.curiosities.SpiritPouchItem; import com.sammy.malum.core.helper.SpiritHelper; @@ -17,6 +17,7 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.phys.*; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.common.capabilities.Capability; @@ -28,7 +29,7 @@ import team.lodestar.lodestone.setup.LodestoneParticleRegistry; import team.lodestar.lodestone.systems.blockentity.LodestoneBlockEntity; import team.lodestar.lodestone.systems.container.ItemInventory; -import team.lodestar.lodestone.systems.particle.WorldParticleBuilder; +import team.lodestar.lodestone.systems.particle.builder.*; import team.lodestar.lodestone.systems.particle.data.ColorParticleData; import team.lodestar.lodestone.systems.particle.data.GenericParticleData; import team.lodestar.lodestone.systems.particle.data.SpinParticleData; @@ -238,9 +239,9 @@ public void tick() { if (level.isClientSide) { if (type != null) { double x = getBlockPos().getX() + 0.5f; - double y = getBlockPos().getY() + 0.5f + Math.sin(level.getGameTime() / 20f) * 0.2f; + double y = getBlockPos().getY() + 0.5f + (float)Math.sin((level.getGameTime() % 360) / 20f) * 0.2f; double z = getBlockPos().getZ() + 0.5f; - ParticleEffects.spawnSpiritGlimmerParticles(level, x, y, z, type.getPrimaryColor(), type.getSecondaryColor()); + SpiritLightSpecs.stationarySpiritLightSpecs(level, new Vec3(x, y, z), type.getPrimaryColor(), type.getSecondaryColor()); } } } diff --git a/src/main/java/com/sammy/malum/common/block/storage/ItemPedestalBlock.java b/src/main/java/com/sammy/malum/common/block/storage/pedestal/ItemPedestalBlock.java similarity index 92% rename from src/main/java/com/sammy/malum/common/block/storage/ItemPedestalBlock.java rename to src/main/java/com/sammy/malum/common/block/storage/pedestal/ItemPedestalBlock.java index 9e4091769..f1d4be72a 100644 --- a/src/main/java/com/sammy/malum/common/block/storage/ItemPedestalBlock.java +++ b/src/main/java/com/sammy/malum/common/block/storage/pedestal/ItemPedestalBlock.java @@ -1,4 +1,4 @@ -package com.sammy.malum.common.block.storage; +package com.sammy.malum.common.block.storage.pedestal; import net.minecraft.core.BlockPos; import net.minecraft.world.level.BlockGetter; @@ -17,16 +17,14 @@ import java.util.stream.Stream; -public class ItemPedestalBlock extends WaterLoggedEntityBlock -{ +public class ItemPedestalBlock extends WaterLoggedEntityBlock { public static final VoxelShape SHAPE = Stream.of( Block.box(4, 0, 4, 12, 4, 12), Block.box(5, 4, 5, 11, 10, 11), Block.box(3, 10, 3, 13, 13, 13) ).reduce((v1, v2) -> Shapes.join(v1, v2, BooleanOp.OR)).get(); - public ItemPedestalBlock(Properties properties) - { + public ItemPedestalBlock(Properties properties) { super(properties); } @@ -48,4 +46,4 @@ public int getAnalogOutputSignal(BlockState pState, Level pLevel, BlockPos pPos) public VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) { return SHAPE; } -} +} \ No newline at end of file diff --git a/src/main/java/com/sammy/malum/common/block/storage/pedestal/ItemPedestalBlockEntity.java b/src/main/java/com/sammy/malum/common/block/storage/pedestal/ItemPedestalBlockEntity.java new file mode 100644 index 000000000..f564f640a --- /dev/null +++ b/src/main/java/com/sammy/malum/common/block/storage/pedestal/ItemPedestalBlockEntity.java @@ -0,0 +1,32 @@ +package com.sammy.malum.common.block.storage.pedestal; + +import com.sammy.malum.common.block.storage.*; +import com.sammy.malum.common.item.spirit.*; +import com.sammy.malum.registry.common.block.*; +import com.sammy.malum.visual_effects.*; +import net.minecraft.core.*; +import net.minecraft.world.level.block.entity.*; +import net.minecraft.world.level.block.state.*; +import net.minecraft.world.phys.*; +import team.lodestar.lodestone.helpers.*; + +public class ItemPedestalBlockEntity extends MalumItemHolderBlockEntity { + + public static final Vec3 PEDESTAL_ITEM_OFFSET = new Vec3(0.5f, 1.1f, 0.5f); + + public ItemPedestalBlockEntity(BlockEntityType type, BlockPos pos, BlockState state) { + super(type, pos, state); + } + + public ItemPedestalBlockEntity(BlockPos pos, BlockState state) { + this(BlockEntityRegistry.ITEM_PEDESTAL.get(), pos, state); + } + + @Override + public Vec3 getItemOffset() { + if (inventory.getStackInSlot(0).getItem() instanceof SpiritShardItem) { + return PEDESTAL_ITEM_OFFSET.add(0, (float)Math.sin((level.getGameTime() % 360) / 20f) * 0.05f, 0); + } + return PEDESTAL_ITEM_OFFSET; + } +} \ No newline at end of file diff --git a/src/main/java/com/sammy/malum/common/block/storage/WoodItemPedestalBlock.java b/src/main/java/com/sammy/malum/common/block/storage/pedestal/WoodItemPedestalBlock.java similarity index 94% rename from src/main/java/com/sammy/malum/common/block/storage/WoodItemPedestalBlock.java rename to src/main/java/com/sammy/malum/common/block/storage/pedestal/WoodItemPedestalBlock.java index 306fafb3a..bf6978287 100644 --- a/src/main/java/com/sammy/malum/common/block/storage/WoodItemPedestalBlock.java +++ b/src/main/java/com/sammy/malum/common/block/storage/pedestal/WoodItemPedestalBlock.java @@ -1,4 +1,4 @@ -package com.sammy.malum.common.block.storage; +package com.sammy.malum.common.block.storage.pedestal; import net.minecraft.core.BlockPos; import net.minecraft.world.level.BlockGetter; diff --git a/src/main/java/com/sammy/malum/common/block/storage/ItemStandBlock.java b/src/main/java/com/sammy/malum/common/block/storage/stand/ItemStandBlock.java similarity index 98% rename from src/main/java/com/sammy/malum/common/block/storage/ItemStandBlock.java rename to src/main/java/com/sammy/malum/common/block/storage/stand/ItemStandBlock.java index 6c5efc625..0442e78d9 100644 --- a/src/main/java/com/sammy/malum/common/block/storage/ItemStandBlock.java +++ b/src/main/java/com/sammy/malum/common/block/storage/stand/ItemStandBlock.java @@ -1,4 +1,4 @@ -package com.sammy.malum.common.block.storage; +package com.sammy.malum.common.block.storage.stand; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -71,7 +71,6 @@ public VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, Co return super.getShape(state, level, pos, context); } - @Override protected void createBlockStateDefinition(StateDefinition.Builder builder) { builder.add(FACING); diff --git a/src/main/java/com/sammy/malum/common/block/storage/stand/ItemStandBlockEntity.java b/src/main/java/com/sammy/malum/common/block/storage/stand/ItemStandBlockEntity.java new file mode 100644 index 000000000..9813feece --- /dev/null +++ b/src/main/java/com/sammy/malum/common/block/storage/stand/ItemStandBlockEntity.java @@ -0,0 +1,49 @@ +package com.sammy.malum.common.block.storage.stand; + +import com.sammy.malum.common.block.curiosities.totem.*; +import com.sammy.malum.common.block.storage.*; +import com.sammy.malum.common.item.spirit.*; +import com.sammy.malum.registry.common.block.*; +import net.minecraft.core.*; +import net.minecraft.world.entity.*; +import net.minecraft.world.item.*; +import net.minecraft.world.level.block.entity.*; +import net.minecraft.world.level.block.state.*; +import net.minecraft.world.level.block.state.properties.*; +import net.minecraft.world.phys.*; +import team.lodestar.lodestone.helpers.*; + + +public class ItemStandBlockEntity extends MalumItemHolderBlockEntity { + + public ItemStandBlockEntity(BlockEntityType type, BlockPos pos, BlockState state) { + super(type, pos, state); + } + + public ItemStandBlockEntity(BlockPos pos, BlockState state) { + this(BlockEntityRegistry.ITEM_STAND.get(), pos, state); + } + + @Override + public Vec3 getItemOffset() { + Direction direction = getBlockState().getValue(BlockStateProperties.FACING); + float xOffset = direction.getStepX() * 0.25f; + float yOffset = direction.getStepY() * 0.1f + (inventory.getStackInSlot(0).getItem() instanceof SpiritShardItem ? (float)Math.sin((level.getGameTime() % 360) / 20f) * 0.05f : 0); + float zOffset = direction.getStepZ() * 0.25f; + return new Vec3(0.5f - xOffset, 0.5f - yOffset, 0.5f - zOffset); + } + + @Override + public void onPlace(LivingEntity placer, ItemStack stack) { + Direction direction = getBlockState().getValue(BlockStateProperties.FACING); + BlockPos totemPolePos = getBlockPos().relative(direction.getOpposite()); + if (level.getBlockEntity(totemPolePos) instanceof TotemPoleBlockEntity totemPole) { + TotemBaseBlockEntity totemBase = totemPole.totemBase; + if (totemBase != null) { + totemBase.addFilter(this); + BlockHelper.updateState(level, totemBase.getBlockPos()); + BlockHelper.updateState(level, totemPole.getBlockPos()); + } + } + } +} diff --git a/src/main/java/com/sammy/malum/common/block/storage/SoulVialBlock.java b/src/main/java/com/sammy/malum/common/block/storage/vial/SoulVialBlock.java similarity index 97% rename from src/main/java/com/sammy/malum/common/block/storage/SoulVialBlock.java rename to src/main/java/com/sammy/malum/common/block/storage/vial/SoulVialBlock.java index f7cc72df6..0944b6624 100644 --- a/src/main/java/com/sammy/malum/common/block/storage/SoulVialBlock.java +++ b/src/main/java/com/sammy/malum/common/block/storage/vial/SoulVialBlock.java @@ -1,4 +1,4 @@ -package com.sammy.malum.common.block.storage; +package com.sammy.malum.common.block.storage.vial; import net.minecraft.core.BlockPos; import net.minecraft.world.level.BlockGetter; diff --git a/src/main/java/com/sammy/malum/common/block/storage/SoulVialBlockEntity.java b/src/main/java/com/sammy/malum/common/block/storage/vial/SoulVialBlockEntity.java similarity index 96% rename from src/main/java/com/sammy/malum/common/block/storage/SoulVialBlockEntity.java rename to src/main/java/com/sammy/malum/common/block/storage/vial/SoulVialBlockEntity.java index 20debd247..ccb679d22 100644 --- a/src/main/java/com/sammy/malum/common/block/storage/SoulVialBlockEntity.java +++ b/src/main/java/com/sammy/malum/common/block/storage/vial/SoulVialBlockEntity.java @@ -1,6 +1,5 @@ -package com.sammy.malum.common.block.storage; +package com.sammy.malum.common.block.storage.vial; -import com.sammy.malum.client.ParticleEffects; import com.sammy.malum.core.systems.item.ISoulContainerItem; import com.sammy.malum.core.systems.spirit.MalumEntitySpiritData; import com.sammy.malum.registry.common.block.BlockEntityRegistry; @@ -13,7 +12,6 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.phys.Vec3; import team.lodestar.lodestone.helpers.BlockHelper; import team.lodestar.lodestone.helpers.ItemHelper; import team.lodestar.lodestone.systems.blockentity.LodestoneBlockEntity; diff --git a/src/main/java/com/sammy/malum/common/entity/night_terror/NightTerrorSeekerEntity.java b/src/main/java/com/sammy/malum/common/entity/night_terror/NightTerrorSeekerEntity.java index 93ee524d7..ae7a4f52f 100644 --- a/src/main/java/com/sammy/malum/common/entity/night_terror/NightTerrorSeekerEntity.java +++ b/src/main/java/com/sammy/malum/common/entity/night_terror/NightTerrorSeekerEntity.java @@ -1,8 +1,8 @@ package com.sammy.malum.common.entity.night_terror; -import com.sammy.malum.client.*; import com.sammy.malum.registry.common.*; import com.sammy.malum.registry.common.entity.*; +import com.sammy.malum.visual_effects.*; import net.minecraft.nbt.*; import net.minecraft.network.protocol.*; import net.minecraft.util.*; @@ -16,6 +16,7 @@ import team.lodestar.lodestone.setup.*; import team.lodestar.lodestone.systems.easing.*; import team.lodestar.lodestone.systems.particle.*; +import team.lodestar.lodestone.systems.particle.builder.*; import team.lodestar.lodestone.systems.particle.data.*; import team.lodestar.lodestone.systems.particle.world.*; @@ -209,7 +210,7 @@ public static void spawnParticles(NightTerrorSeekerEntity nightTerrorSeekerEntit double lerpY = Mth.lerp(pDelta, oy, y) + motion.y / 4f; double lerpZ = Mth.lerp(pDelta, oz, z) + motion.z / 4f; float alphaMultiplier = (0.35f + extraAlpha) * Math.min(1, nightTerrorSeekerEntity.age * 0.2f); - ParticleEffects.spiritLightSpecs(nightTerrorSeekerEntity.level, lerpX, lerpY, lerpZ, alphaMultiplier*0.8f, norm, firstColor, firstColor.darker()); + SpiritLightSpecs.spiritLightSpecs(nightTerrorSeekerEntity.level, new Vec3(lerpX, lerpY, lerpZ), firstColor, firstColor.darker(), b -> b.setMotion(norm)); final ColorParticleData.ColorParticleDataBuilder colorDataBuilder = ColorParticleData.create(NIGHT_TERROR_DARK, NIGHT_TERROR_DARK) .setEasing(Easing.QUINTIC_OUT) diff --git a/src/main/java/com/sammy/malum/common/entity/nitrate/EthericNitrateEntity.java b/src/main/java/com/sammy/malum/common/entity/nitrate/EthericNitrateEntity.java index 5cb65cdc1..43a6db629 100644 --- a/src/main/java/com/sammy/malum/common/entity/nitrate/EthericNitrateEntity.java +++ b/src/main/java/com/sammy/malum/common/entity/nitrate/EthericNitrateEntity.java @@ -1,8 +1,8 @@ package com.sammy.malum.common.entity.nitrate; -import com.sammy.malum.client.*; import com.sammy.malum.common.packets.particle.curiosities.nitrate.*; import com.sammy.malum.registry.common.entity.*; +import com.sammy.malum.visual_effects.*; import net.minecraft.server.level.*; import net.minecraft.util.*; import net.minecraft.world.entity.*; @@ -12,6 +12,7 @@ import team.lodestar.lodestone.setup.*; import team.lodestar.lodestone.systems.easing.*; import team.lodestar.lodestone.systems.particle.*; +import team.lodestar.lodestone.systems.particle.builder.*; import team.lodestar.lodestone.systems.particle.data.*; import team.lodestar.lodestone.systems.particle.world.*; @@ -78,7 +79,7 @@ public static void spawnParticles(EthericNitrateEntity ethericNitrateEntity) { double lerpY = Mth.lerp(pDelta, oy, y) - motion.y / 4f; double lerpZ = Mth.lerp(pDelta, oz, z) - motion.z / 4f; float alphaMultiplier = (0.35f + extraAlpha) * Math.min(1, ethericNitrateEntity.windUp * 2); - ParticleEffects.spiritLightSpecs(ethericNitrateEntity.level, lerpX, lerpY, lerpZ, alphaMultiplier, norm, firstColor, SECOND_COLOR); + SpiritLightSpecs.spiritLightSpecs(ethericNitrateEntity.level, new Vec3(lerpX, lerpY, lerpZ), firstColor, SECOND_COLOR, b -> b.setMotion(norm)); final ColorParticleData.ColorParticleDataBuilder colorDataBuilder = ColorParticleData.create(SECOND_COLOR, SECOND_SMOKE_COLOR) .setEasing(Easing.QUINTIC_OUT) diff --git a/src/main/java/com/sammy/malum/common/entity/nitrate/VividNitrateEntity.java b/src/main/java/com/sammy/malum/common/entity/nitrate/VividNitrateEntity.java index 043a0ed84..0df419ff4 100644 --- a/src/main/java/com/sammy/malum/common/entity/nitrate/VividNitrateEntity.java +++ b/src/main/java/com/sammy/malum/common/entity/nitrate/VividNitrateEntity.java @@ -1,8 +1,8 @@ package com.sammy.malum.common.entity.nitrate; -import com.sammy.malum.client.*; import com.sammy.malum.common.packets.particle.curiosities.nitrate.*; import com.sammy.malum.registry.common.entity.*; +import com.sammy.malum.visual_effects.*; import net.minecraft.server.level.*; import net.minecraft.util.*; import net.minecraft.world.entity.*; @@ -13,6 +13,7 @@ import team.lodestar.lodestone.setup.*; import team.lodestar.lodestone.systems.easing.*; import team.lodestar.lodestone.systems.particle.*; +import team.lodestar.lodestone.systems.particle.builder.*; import team.lodestar.lodestone.systems.particle.data.*; import team.lodestar.lodestone.systems.particle.world.*; @@ -118,7 +119,7 @@ public static void spawnParticles(VividNitrateEntity vividNitrateEntity) { double lerpY = Mth.lerp(pDelta, oy, y) - motion.y / 4f; double lerpZ = Mth.lerp(pDelta, oz, z) - motion.z / 4f; float alphaMultiplier = (0.30f + extraAlpha) * Math.min(1, vividNitrateEntity.windUp * 2); - ParticleEffects.spiritLightSpecs(vividNitrateEntity.level, lerpX, lerpY, lerpZ, alphaMultiplier + 0.1f, norm, firstColor, secondColor); + SpiritLightSpecs.spiritLightSpecs(vividNitrateEntity.level, new Vec3(lerpX, lerpY, lerpZ), firstColor, secondColor, b -> b.setMotion(norm)); final ColorParticleData.ColorParticleDataBuilder colorDataBuilder = ColorParticleData.create(secondColor, SECOND_SMOKE_COLOR) .setEasing(Easing.QUINTIC_OUT) diff --git a/src/main/java/com/sammy/malum/common/entity/spirit/SpiritItemEntity.java b/src/main/java/com/sammy/malum/common/entity/spirit/SpiritItemEntity.java index d6f8f9b6e..02aee4e85 100644 --- a/src/main/java/com/sammy/malum/common/entity/spirit/SpiritItemEntity.java +++ b/src/main/java/com/sammy/malum/common/entity/spirit/SpiritItemEntity.java @@ -1,11 +1,11 @@ package com.sammy.malum.common.entity.spirit; -import com.sammy.malum.client.*; import com.sammy.malum.common.entity.*; import com.sammy.malum.common.item.spirit.*; import com.sammy.malum.core.handlers.*; import com.sammy.malum.registry.common.*; import com.sammy.malum.registry.common.entity.*; +import com.sammy.malum.visual_effects.*; import net.minecraft.nbt.*; import net.minecraft.server.level.*; import net.minecraft.sounds.*; @@ -64,8 +64,7 @@ public boolean fireImmune() { public void spawnParticles(double x, double y, double z) { Vec3 motion = getDeltaMovement(); Vec3 norm = motion.normalize().scale(0.05f); - float extraAlpha = (float) motion.length(); - ParticleEffects.spiritLightSpecs(level, x, y, z, 0.55f + extraAlpha, norm, startColor, endColor); + SpiritLightSpecs.spiritLightSpecs(level, new Vec3(x, y, z), startColor, endColor, builder -> builder.setMotion(norm)); } @Override diff --git a/src/main/java/com/sammy/malum/common/item/curiosities/nitrate/EthericNitrateItem.java b/src/main/java/com/sammy/malum/common/item/curiosities/nitrate/EthericNitrateItem.java index ff694489c..b221ca65f 100644 --- a/src/main/java/com/sammy/malum/common/item/curiosities/nitrate/EthericNitrateItem.java +++ b/src/main/java/com/sammy/malum/common/item/curiosities/nitrate/EthericNitrateItem.java @@ -6,7 +6,7 @@ import team.lodestar.lodestone.helpers.ColorHelper; import team.lodestar.lodestone.setup.LodestoneScreenParticleRegistry; import team.lodestar.lodestone.systems.easing.Easing; -import team.lodestar.lodestone.systems.particle.ScreenParticleBuilder; +import team.lodestar.lodestone.systems.particle.builder.*; import team.lodestar.lodestone.systems.particle.data.ColorParticleData; import team.lodestar.lodestone.systems.particle.data.GenericParticleData; import team.lodestar.lodestone.systems.particle.data.SpinParticleData; diff --git a/src/main/java/com/sammy/malum/common/item/curiosities/nitrate/VividNitrateItem.java b/src/main/java/com/sammy/malum/common/item/curiosities/nitrate/VividNitrateItem.java index 89a6a68cc..1fdd42516 100644 --- a/src/main/java/com/sammy/malum/common/item/curiosities/nitrate/VividNitrateItem.java +++ b/src/main/java/com/sammy/malum/common/item/curiosities/nitrate/VividNitrateItem.java @@ -5,7 +5,7 @@ import net.minecraft.world.level.Level; import team.lodestar.lodestone.setup.LodestoneScreenParticleRegistry; import team.lodestar.lodestone.systems.easing.Easing; -import team.lodestar.lodestone.systems.particle.ScreenParticleBuilder; +import team.lodestar.lodestone.systems.particle.builder.*; import team.lodestar.lodestone.systems.particle.data.ColorParticleData; import team.lodestar.lodestone.systems.particle.data.GenericParticleData; import team.lodestar.lodestone.systems.particle.data.SpinParticleData; diff --git a/src/main/java/com/sammy/malum/common/item/ether/EtherBrazierItem.java b/src/main/java/com/sammy/malum/common/item/ether/EtherBrazierItem.java index 2eea2f8d7..2bef2a1fa 100644 --- a/src/main/java/com/sammy/malum/common/item/ether/EtherBrazierItem.java +++ b/src/main/java/com/sammy/malum/common/item/ether/EtherBrazierItem.java @@ -5,7 +5,7 @@ import net.minecraft.world.level.block.Block; import team.lodestar.lodestone.setup.LodestoneScreenParticleRegistry; import team.lodestar.lodestone.systems.easing.Easing; -import team.lodestar.lodestone.systems.particle.ScreenParticleBuilder; +import team.lodestar.lodestone.systems.particle.builder.*; import team.lodestar.lodestone.systems.particle.data.ColorParticleData; import team.lodestar.lodestone.systems.particle.data.GenericParticleData; import team.lodestar.lodestone.systems.particle.data.SpinParticleData; diff --git a/src/main/java/com/sammy/malum/common/item/ether/EtherItem.java b/src/main/java/com/sammy/malum/common/item/ether/EtherItem.java index 70b518a3a..9b782391e 100644 --- a/src/main/java/com/sammy/malum/common/item/ether/EtherItem.java +++ b/src/main/java/com/sammy/malum/common/item/ether/EtherItem.java @@ -5,7 +5,7 @@ import net.minecraft.world.level.block.Block; import team.lodestar.lodestone.setup.LodestoneScreenParticleRegistry; import team.lodestar.lodestone.systems.easing.Easing; -import team.lodestar.lodestone.systems.particle.ScreenParticleBuilder; +import team.lodestar.lodestone.systems.particle.builder.*; import team.lodestar.lodestone.systems.particle.data.ColorParticleData; import team.lodestar.lodestone.systems.particle.data.GenericParticleData; import team.lodestar.lodestone.systems.particle.data.SpinParticleData; diff --git a/src/main/java/com/sammy/malum/common/item/ether/EtherTorchItem.java b/src/main/java/com/sammy/malum/common/item/ether/EtherTorchItem.java index 9d78a3d49..d49e49c46 100644 --- a/src/main/java/com/sammy/malum/common/item/ether/EtherTorchItem.java +++ b/src/main/java/com/sammy/malum/common/item/ether/EtherTorchItem.java @@ -11,7 +11,7 @@ import net.minecraft.world.phys.shapes.CollisionContext; import team.lodestar.lodestone.setup.LodestoneScreenParticleRegistry; import team.lodestar.lodestone.systems.easing.Easing; -import team.lodestar.lodestone.systems.particle.ScreenParticleBuilder; +import team.lodestar.lodestone.systems.particle.builder.*; import team.lodestar.lodestone.systems.particle.data.ColorParticleData; import team.lodestar.lodestone.systems.particle.data.GenericParticleData; import team.lodestar.lodestone.systems.particle.data.SpinParticleData; diff --git a/src/main/java/com/sammy/malum/common/item/spirit/SpiritShardItem.java b/src/main/java/com/sammy/malum/common/item/spirit/SpiritShardItem.java index fa99e34ab..285c798c6 100644 --- a/src/main/java/com/sammy/malum/common/item/spirit/SpiritShardItem.java +++ b/src/main/java/com/sammy/malum/common/item/spirit/SpiritShardItem.java @@ -1,8 +1,8 @@ package com.sammy.malum.common.item.spirit; -import com.sammy.malum.client.*; import com.sammy.malum.core.systems.item.IFloatingGlowItem; import com.sammy.malum.core.systems.spirit.MalumSpiritType; +import com.sammy.malum.visual_effects.*; import net.minecraft.network.chat.Component; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; @@ -11,11 +11,8 @@ import org.jetbrains.annotations.Nullable; import team.lodestar.lodestone.handlers.screenparticle.ParticleEmitterHandler.ItemParticleSupplier; import team.lodestar.lodestone.systems.particle.screen.*; -import team.lodestar.lodestone.systems.particle.screen.base.ScreenParticle; import java.awt.*; -import java.util.ArrayList; -import java.util.HashMap; import java.util.List; public class SpiritShardItem extends Item implements IFloatingGlowItem, ItemParticleSupplier { diff --git a/src/main/java/com/sammy/malum/common/packets/particle/SuccessfulSoulHarvestParticlePacket.java b/src/main/java/com/sammy/malum/common/packets/particle/SuccessfulSoulHarvestParticlePacket.java index e60201b22..aaf56451b 100644 --- a/src/main/java/com/sammy/malum/common/packets/particle/SuccessfulSoulHarvestParticlePacket.java +++ b/src/main/java/com/sammy/malum/common/packets/particle/SuccessfulSoulHarvestParticlePacket.java @@ -9,6 +9,7 @@ import net.minecraftforge.network.simple.*; import team.lodestar.lodestone.setup.*; import team.lodestar.lodestone.systems.particle.*; +import team.lodestar.lodestone.systems.particle.builder.*; import team.lodestar.lodestone.systems.particle.data.*; import java.awt.*; diff --git a/src/main/java/com/sammy/malum/common/packets/particle/curiosities/altar/AltarConsumeParticlePacket.java b/src/main/java/com/sammy/malum/common/packets/particle/curiosities/altar/AltarConsumeParticlePacket.java index 44c79dfab..71e26b97f 100644 --- a/src/main/java/com/sammy/malum/common/packets/particle/curiosities/altar/AltarConsumeParticlePacket.java +++ b/src/main/java/com/sammy/malum/common/packets/particle/curiosities/altar/AltarConsumeParticlePacket.java @@ -12,6 +12,7 @@ import net.minecraftforge.network.simple.*; import team.lodestar.lodestone.setup.*; import team.lodestar.lodestone.systems.particle.*; +import team.lodestar.lodestone.systems.particle.builder.*; import team.lodestar.lodestone.systems.particle.data.*; import java.awt.*; diff --git a/src/main/java/com/sammy/malum/common/packets/particle/curiosities/altar/AltarCraftParticlePacket.java b/src/main/java/com/sammy/malum/common/packets/particle/curiosities/altar/AltarCraftParticlePacket.java index f59084af5..dc94ac355 100644 --- a/src/main/java/com/sammy/malum/common/packets/particle/curiosities/altar/AltarCraftParticlePacket.java +++ b/src/main/java/com/sammy/malum/common/packets/particle/curiosities/altar/AltarCraftParticlePacket.java @@ -11,6 +11,7 @@ import net.minecraftforge.network.simple.*; import team.lodestar.lodestone.setup.*; import team.lodestar.lodestone.systems.particle.*; +import team.lodestar.lodestone.systems.particle.builder.*; import team.lodestar.lodestone.systems.particle.data.*; import java.awt.*; diff --git a/src/main/java/com/sammy/malum/common/packets/particle/curiosities/blight/BlightMistParticlePacket.java b/src/main/java/com/sammy/malum/common/packets/particle/curiosities/blight/BlightMistParticlePacket.java index 5f7a4058a..08b4b1b3d 100644 --- a/src/main/java/com/sammy/malum/common/packets/particle/curiosities/blight/BlightMistParticlePacket.java +++ b/src/main/java/com/sammy/malum/common/packets/particle/curiosities/blight/BlightMistParticlePacket.java @@ -12,6 +12,7 @@ import team.lodestar.lodestone.setup.*; import team.lodestar.lodestone.systems.easing.*; import team.lodestar.lodestone.systems.particle.*; +import team.lodestar.lodestone.systems.particle.builder.*; import team.lodestar.lodestone.systems.particle.data.*; import team.lodestar.lodestone.systems.particle.world.*; diff --git a/src/main/java/com/sammy/malum/common/packets/particle/curiosities/blight/BlightTransformItemParticlePacket.java b/src/main/java/com/sammy/malum/common/packets/particle/curiosities/blight/BlightTransformItemParticlePacket.java index 6b93ea2bd..0c4366242 100644 --- a/src/main/java/com/sammy/malum/common/packets/particle/curiosities/blight/BlightTransformItemParticlePacket.java +++ b/src/main/java/com/sammy/malum/common/packets/particle/curiosities/blight/BlightTransformItemParticlePacket.java @@ -14,6 +14,7 @@ import team.lodestar.lodestone.setup.*; import team.lodestar.lodestone.systems.easing.*; import team.lodestar.lodestone.systems.particle.*; +import team.lodestar.lodestone.systems.particle.builder.*; import team.lodestar.lodestone.systems.particle.data.*; import team.lodestar.lodestone.systems.particle.world.*; diff --git a/src/main/java/com/sammy/malum/common/packets/particle/curiosities/nitrate/EthericNitrateParticlePacket.java b/src/main/java/com/sammy/malum/common/packets/particle/curiosities/nitrate/EthericNitrateParticlePacket.java index 228653426..26a74c08b 100644 --- a/src/main/java/com/sammy/malum/common/packets/particle/curiosities/nitrate/EthericNitrateParticlePacket.java +++ b/src/main/java/com/sammy/malum/common/packets/particle/curiosities/nitrate/EthericNitrateParticlePacket.java @@ -11,6 +11,7 @@ import team.lodestar.lodestone.setup.*; import team.lodestar.lodestone.systems.easing.*; import team.lodestar.lodestone.systems.particle.*; +import team.lodestar.lodestone.systems.particle.builder.*; import team.lodestar.lodestone.systems.particle.data.*; import java.util.*; diff --git a/src/main/java/com/sammy/malum/common/packets/particle/curiosities/nitrate/VividNitrateBounceParticlePacket.java b/src/main/java/com/sammy/malum/common/packets/particle/curiosities/nitrate/VividNitrateBounceParticlePacket.java index bdf09db95..fdca50794 100644 --- a/src/main/java/com/sammy/malum/common/packets/particle/curiosities/nitrate/VividNitrateBounceParticlePacket.java +++ b/src/main/java/com/sammy/malum/common/packets/particle/curiosities/nitrate/VividNitrateBounceParticlePacket.java @@ -12,7 +12,7 @@ import team.lodestar.lodestone.setup.LodestoneParticleRegistry; import team.lodestar.lodestone.systems.easing.Easing; import team.lodestar.lodestone.systems.particle.SimpleParticleOptions; -import team.lodestar.lodestone.systems.particle.WorldParticleBuilder; +import team.lodestar.lodestone.systems.particle.builder.*; import team.lodestar.lodestone.systems.particle.data.ColorParticleData; import team.lodestar.lodestone.systems.particle.data.GenericParticleData; import team.lodestar.lodestone.systems.particle.data.SpinParticleData; diff --git a/src/main/java/com/sammy/malum/common/packets/particle/curiosities/rite/AerialBlockFallRiteEffectPacket.java b/src/main/java/com/sammy/malum/common/packets/particle/curiosities/rite/AerialBlockFallRiteEffectPacket.java index 242e1df14..44ea84593 100644 --- a/src/main/java/com/sammy/malum/common/packets/particle/curiosities/rite/AerialBlockFallRiteEffectPacket.java +++ b/src/main/java/com/sammy/malum/common/packets/particle/curiosities/rite/AerialBlockFallRiteEffectPacket.java @@ -12,6 +12,7 @@ import team.lodestar.lodestone.setup.*; import team.lodestar.lodestone.systems.easing.*; import team.lodestar.lodestone.systems.particle.*; +import team.lodestar.lodestone.systems.particle.builder.*; import team.lodestar.lodestone.systems.particle.data.*; import java.awt.*; diff --git a/src/main/java/com/sammy/malum/common/packets/particle/curiosities/rite/InfernalAccelerationRiteEffectPacket.java b/src/main/java/com/sammy/malum/common/packets/particle/curiosities/rite/InfernalAccelerationRiteEffectPacket.java index 75297cd7f..774049053 100644 --- a/src/main/java/com/sammy/malum/common/packets/particle/curiosities/rite/InfernalAccelerationRiteEffectPacket.java +++ b/src/main/java/com/sammy/malum/common/packets/particle/curiosities/rite/InfernalAccelerationRiteEffectPacket.java @@ -12,6 +12,7 @@ import team.lodestar.lodestone.setup.*; import team.lodestar.lodestone.systems.easing.*; import team.lodestar.lodestone.systems.particle.*; +import team.lodestar.lodestone.systems.particle.builder.*; import team.lodestar.lodestone.systems.particle.data.*; import java.awt.*; diff --git a/src/main/java/com/sammy/malum/common/packets/particle/curiosities/rite/SacredMistRiteEffectPacket.java b/src/main/java/com/sammy/malum/common/packets/particle/curiosities/rite/SacredMistRiteEffectPacket.java index 13cab9e8e..e25819716 100644 --- a/src/main/java/com/sammy/malum/common/packets/particle/curiosities/rite/SacredMistRiteEffectPacket.java +++ b/src/main/java/com/sammy/malum/common/packets/particle/curiosities/rite/SacredMistRiteEffectPacket.java @@ -12,6 +12,7 @@ import team.lodestar.lodestone.setup.*; import team.lodestar.lodestone.systems.easing.*; import team.lodestar.lodestone.systems.particle.*; +import team.lodestar.lodestone.systems.particle.builder.*; import team.lodestar.lodestone.systems.particle.data.*; import java.awt.*; diff --git a/src/main/java/com/sammy/malum/common/packets/particle/curiosities/rite/SpiritRiteActivationEffectPacket.java b/src/main/java/com/sammy/malum/common/packets/particle/curiosities/rite/SpiritRiteActivationEffectPacket.java index f1f95dfde..7e0de4ac5 100644 --- a/src/main/java/com/sammy/malum/common/packets/particle/curiosities/rite/SpiritRiteActivationEffectPacket.java +++ b/src/main/java/com/sammy/malum/common/packets/particle/curiosities/rite/SpiritRiteActivationEffectPacket.java @@ -12,6 +12,7 @@ import team.lodestar.lodestone.setup.*; import team.lodestar.lodestone.systems.easing.*; import team.lodestar.lodestone.systems.particle.*; +import team.lodestar.lodestone.systems.particle.builder.*; import team.lodestar.lodestone.systems.particle.data.*; import java.awt.*; diff --git a/src/main/java/com/sammy/malum/common/packets/particle/curiosities/rite/generic/BlockSparkleParticlePacket.java b/src/main/java/com/sammy/malum/common/packets/particle/curiosities/rite/generic/BlockSparkleParticlePacket.java index fa3d1f724..ab5b2423b 100644 --- a/src/main/java/com/sammy/malum/common/packets/particle/curiosities/rite/generic/BlockSparkleParticlePacket.java +++ b/src/main/java/com/sammy/malum/common/packets/particle/curiosities/rite/generic/BlockSparkleParticlePacket.java @@ -12,6 +12,7 @@ import team.lodestar.lodestone.setup.*; import team.lodestar.lodestone.systems.easing.*; import team.lodestar.lodestone.systems.particle.*; +import team.lodestar.lodestone.systems.particle.builder.*; import team.lodestar.lodestone.systems.particle.data.*; import java.awt.*; diff --git a/src/main/java/com/sammy/malum/common/packets/particle/curiosities/rite/generic/MajorEntityEffectParticlePacket.java b/src/main/java/com/sammy/malum/common/packets/particle/curiosities/rite/generic/MajorEntityEffectParticlePacket.java index 016dd8e4f..9d0c6b264 100644 --- a/src/main/java/com/sammy/malum/common/packets/particle/curiosities/rite/generic/MajorEntityEffectParticlePacket.java +++ b/src/main/java/com/sammy/malum/common/packets/particle/curiosities/rite/generic/MajorEntityEffectParticlePacket.java @@ -11,7 +11,7 @@ import team.lodestar.lodestone.helpers.ColorHelper; import team.lodestar.lodestone.setup.LodestoneParticleRegistry; import team.lodestar.lodestone.systems.easing.Easing; -import team.lodestar.lodestone.systems.particle.WorldParticleBuilder; +import team.lodestar.lodestone.systems.particle.builder.*; import team.lodestar.lodestone.systems.particle.data.ColorParticleData; import team.lodestar.lodestone.systems.particle.data.GenericParticleData; import team.lodestar.lodestone.systems.particle.data.SpinParticleData; diff --git a/src/main/java/com/sammy/malum/common/packets/particle/curiosities/rite/generic/TotemPoleActivationEffectPacket.java b/src/main/java/com/sammy/malum/common/packets/particle/curiosities/rite/generic/TotemPoleActivationEffectPacket.java index 3f4db989a..ec358533a 100644 --- a/src/main/java/com/sammy/malum/common/packets/particle/curiosities/rite/generic/TotemPoleActivationEffectPacket.java +++ b/src/main/java/com/sammy/malum/common/packets/particle/curiosities/rite/generic/TotemPoleActivationEffectPacket.java @@ -11,6 +11,7 @@ import team.lodestar.lodestone.setup.*; import team.lodestar.lodestone.systems.easing.*; import team.lodestar.lodestone.systems.particle.*; +import team.lodestar.lodestone.systems.particle.builder.*; import team.lodestar.lodestone.systems.particle.data.*; import java.awt.*; diff --git a/src/main/java/com/sammy/malum/common/spiritrite/ArcaneRiteType.java b/src/main/java/com/sammy/malum/common/spiritrite/ArcaneRiteType.java index 47a0c0698..d0a72774b 100644 --- a/src/main/java/com/sammy/malum/common/spiritrite/ArcaneRiteType.java +++ b/src/main/java/com/sammy/malum/common/spiritrite/ArcaneRiteType.java @@ -1,7 +1,7 @@ package com.sammy.malum.common.spiritrite; import com.sammy.malum.common.block.blight.BlightedSoilBlock; -import com.sammy.malum.common.block.curiosities.spirit_altar.IAltarProvider; +import com.sammy.malum.common.block.storage.IMalumSpecialItemAccessPoint; import com.sammy.malum.common.block.curiosities.totem.TotemBaseBlockEntity; import com.sammy.malum.common.packets.particle.curiosities.rite.generic.BlockSparkleParticlePacket; import com.sammy.malum.common.packets.particle.curiosities.blight.BlightMistParticlePacket; @@ -84,12 +84,12 @@ public void riteEffect(TotemBaseBlockEntity totemBase) { for (BlockPos p : nearbyBlocks) { BlockPos posToTransmute = p.above(); BlockState stateToTransmute = level.getBlockState(posToTransmute); - if (level.getBlockEntity(posToTransmute) instanceof IAltarProvider iAltarProvider) { - LodestoneBlockEntityInventory inventoryForAltar = iAltarProvider.getInventoryForAltar(); + if (level.getBlockEntity(posToTransmute) instanceof IMalumSpecialItemAccessPoint iMalumSpecialItemAccessPoint) { + LodestoneBlockEntityInventory inventoryForAltar = iMalumSpecialItemAccessPoint.getSuppliedInventory(); ItemStack stack = inventoryForAltar.getStackInSlot(0); var recipe = SpiritTransmutationRecipe.getRecipe(level, stack); if (recipe != null) { - Vec3 itemPos = iAltarProvider.getItemPosForAltar(); + Vec3 itemPos = iMalumSpecialItemAccessPoint.getItemCenterPos(); level.addFreshEntity(new ItemEntity(level, itemPos.x, itemPos.y, itemPos.z, recipe.output.copy())); MALUM_CHANNEL.send(PacketDistributor.TRACKING_CHUNK.with(() -> level.getChunkAt(p)), new BlightTransformItemParticlePacket(List.of(ARCANE_SPIRIT.identifier), itemPos)); inventoryForAltar.getStackInSlot(0).shrink(1); diff --git a/src/main/java/com/sammy/malum/core/events/RuntimeEvents.java b/src/main/java/com/sammy/malum/core/events/RuntimeEvents.java index 1767f4d3a..d82026ff6 100644 --- a/src/main/java/com/sammy/malum/core/events/RuntimeEvents.java +++ b/src/main/java/com/sammy/malum/core/events/RuntimeEvents.java @@ -1,6 +1,6 @@ package com.sammy.malum.core.events; -import com.sammy.malum.common.block.storage.SpiritJarBlock; +import com.sammy.malum.common.block.storage.jar.SpiritJarBlock; import com.sammy.malum.common.capability.MalumItemDataCapability; import com.sammy.malum.common.capability.MalumLivingEntityDataCapability; import com.sammy.malum.common.capability.MalumPlayerDataCapability; diff --git a/src/main/java/com/sammy/malum/core/handlers/SoulWardHandler.java b/src/main/java/com/sammy/malum/core/handlers/SoulWardHandler.java index 1b1a1e8db..13b88c4e5 100644 --- a/src/main/java/com/sammy/malum/core/handlers/SoulWardHandler.java +++ b/src/main/java/com/sammy/malum/core/handlers/SoulWardHandler.java @@ -28,7 +28,7 @@ import team.lodestar.lodestone.helpers.ItemHelper; import team.lodestar.lodestone.setup.LodestoneScreenParticleRegistry; import team.lodestar.lodestone.setup.LodestoneShaderRegistry; -import team.lodestar.lodestone.systems.particle.ScreenParticleBuilder; +import team.lodestar.lodestone.systems.particle.builder.*; import team.lodestar.lodestone.systems.particle.data.ColorParticleData; import team.lodestar.lodestone.systems.particle.data.GenericParticleData; import team.lodestar.lodestone.systems.particle.data.SpinParticleData; diff --git a/src/main/java/com/sammy/malum/core/systems/item/IVoidItem.java b/src/main/java/com/sammy/malum/core/systems/item/IVoidItem.java index 8c05098c8..c39324bc2 100644 --- a/src/main/java/com/sammy/malum/core/systems/item/IVoidItem.java +++ b/src/main/java/com/sammy/malum/core/systems/item/IVoidItem.java @@ -1,6 +1,6 @@ package com.sammy.malum.core.systems.item; -import com.sammy.malum.client.*; +import com.sammy.malum.visual_effects.*; import net.minecraft.world.item.*; import net.minecraft.world.level.*; import team.lodestar.lodestone.handlers.screenparticle.*; diff --git a/src/main/java/com/sammy/malum/data/block/MalumBlockLootTables.java b/src/main/java/com/sammy/malum/data/block/MalumBlockLootTables.java index 7828a7192..f1faee8eb 100644 --- a/src/main/java/com/sammy/malum/data/block/MalumBlockLootTables.java +++ b/src/main/java/com/sammy/malum/data/block/MalumBlockLootTables.java @@ -3,8 +3,8 @@ import com.google.common.collect.ImmutableSet; import com.mojang.datafixers.util.Pair; import com.sammy.malum.common.block.ether.EtherBlock; -import com.sammy.malum.common.block.storage.SoulVialBlock; -import com.sammy.malum.common.block.storage.SpiritJarBlock; +import com.sammy.malum.common.block.storage.vial.SoulVialBlock; +import com.sammy.malum.common.block.storage.jar.SpiritJarBlock; import com.sammy.malum.registry.common.block.BlockRegistry; import com.sammy.malum.registry.common.item.ItemRegistry; import net.minecraft.advancements.critereon.EnchantmentPredicate; diff --git a/src/main/java/com/sammy/malum/registry/client/ParticleRegistry.java b/src/main/java/com/sammy/malum/registry/client/ParticleRegistry.java index 73882f360..b63ebd95a 100644 --- a/src/main/java/com/sammy/malum/registry/client/ParticleRegistry.java +++ b/src/main/java/com/sammy/malum/registry/client/ParticleRegistry.java @@ -22,6 +22,8 @@ public class ParticleRegistry { public static RegistryObject LIGHT_SPEC_SMALL = PARTICLES.register("light_spec_small", LodestoneParticleType::new); public static RegistryObject LIGHT_SPEC_LARGE = PARTICLES.register("light_spec_large", LodestoneParticleType::new); + public static RegistryObject ROUND_SPARK = PARTICLES.register("round_spark", LodestoneSparkParticleType::new); + public static RegistryObject SCYTHE_CUT_ATTACK_PARTICLE = PARTICLES.register("scythe_cut_attack", () -> new SimpleParticleType(true)); public static RegistryObject SCYTHE_SWEEP_ATTACK_PARTICLE = PARTICLES.register("scythe_sweep_attack", () -> new SimpleParticleType(true)); @@ -31,6 +33,8 @@ public static void registerParticleFactory(ParticleFactoryRegisterEvent event) { Minecraft.getInstance().particleEngine.register(LIGHT_SPEC_SMALL.get(), LodestoneParticleType.Factory::new); Minecraft.getInstance().particleEngine.register(LIGHT_SPEC_LARGE.get(), LodestoneParticleType.Factory::new); + Minecraft.getInstance().particleEngine.register(ROUND_SPARK.get(), LodestoneSparkParticleType.Factory::new); + Minecraft.getInstance().particleEngine.register(SCYTHE_CUT_ATTACK_PARTICLE.get(), ScytheAttackParticle.Factory::new); Minecraft.getInstance().particleEngine.register(SCYTHE_SWEEP_ATTACK_PARTICLE.get(), ScytheAttackParticle.Factory::new); } diff --git a/src/main/java/com/sammy/malum/registry/common/ParticleEffectTypeRegistry.java b/src/main/java/com/sammy/malum/registry/common/ParticleEffectTypeRegistry.java index d50c98aca..cdd663ece 100644 --- a/src/main/java/com/sammy/malum/registry/common/ParticleEffectTypeRegistry.java +++ b/src/main/java/com/sammy/malum/registry/common/ParticleEffectTypeRegistry.java @@ -1,8 +1,8 @@ package com.sammy.malum.registry.common; -import com.sammy.malum.client.effects.*; -import com.sammy.malum.client.effects.basic.*; import com.sammy.malum.core.systems.particle_effects.*; +import com.sammy.malum.visual_effects.networked.*; +import com.sammy.malum.visual_effects.networked.basic.*; import java.util.*; 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 6df968abc..26237d6b3 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 @@ -4,8 +4,8 @@ import com.sammy.malum.client.renderer.block.*; import com.sammy.malum.common.block.ether.EtherBlock; import com.sammy.malum.common.block.mana_mote.*; -import com.sammy.malum.common.block.storage.ItemPedestalBlock; -import com.sammy.malum.common.block.storage.ItemStandBlock; +import com.sammy.malum.common.block.storage.pedestal.ItemPedestalBlock; +import com.sammy.malum.common.block.storage.stand.ItemStandBlock; import com.sammy.malum.common.block.curiosities.totem.TotemBaseBlock; import com.sammy.malum.common.block.curiosities.totem.TotemPoleBlock; import com.sammy.malum.common.block.ether.EtherBlockEntity; @@ -16,10 +16,10 @@ import com.sammy.malum.common.block.curiosities.obelisk.BrilliantObeliskBlockEntity; import com.sammy.malum.common.block.curiosities.obelisk.RunewoodObeliskBlockEntity; import com.sammy.malum.common.block.curiosities.spirit_altar.SpiritAltarBlockEntity; -import com.sammy.malum.common.block.storage.ItemPedestalBlockEntity; -import com.sammy.malum.common.block.storage.ItemStandBlockEntity; -import com.sammy.malum.common.block.storage.SoulVialBlockEntity; -import com.sammy.malum.common.block.storage.SpiritJarBlockEntity; +import com.sammy.malum.common.block.storage.pedestal.ItemPedestalBlockEntity; +import com.sammy.malum.common.block.storage.stand.ItemStandBlockEntity; +import com.sammy.malum.common.block.storage.vial.SoulVialBlockEntity; +import com.sammy.malum.common.block.storage.jar.SpiritJarBlockEntity; import com.sammy.malum.common.block.curiosities.tablet.TwistedTabletBlockEntity; import com.sammy.malum.common.block.curiosities.totem.TotemBaseBlockEntity; import com.sammy.malum.common.block.curiosities.totem.TotemPoleBlockEntity; @@ -96,10 +96,10 @@ public static void registerRenderer(EntityRenderersEvent.RegisterRenderers event event.registerBlockEntityRenderer(SPIRIT_ALTAR.get(), SpiritAltarRenderer::new); event.registerBlockEntityRenderer(SPIRIT_CRUCIBLE.get(), SpiritCrucibleRenderer::new); event.registerBlockEntityRenderer(SPIRIT_CATALYZER.get(), SpiritCatalyzerRenderer::new); - event.registerBlockEntityRenderer(TWISTED_TABLET.get(), ItemStandRenderer::new); + event.registerBlockEntityRenderer(TWISTED_TABLET.get(), MalumItemHolderRenderer::new); event.registerBlockEntityRenderer(TOTEM_POLE.get(), TotemPoleRenderer::new); - event.registerBlockEntityRenderer(ITEM_STAND.get(), ItemStandRenderer::new); - event.registerBlockEntityRenderer(ITEM_PEDESTAL.get(), ItemPedestalRenderer::new); + event.registerBlockEntityRenderer(ITEM_STAND.get(), MalumItemHolderRenderer::new); + event.registerBlockEntityRenderer(ITEM_PEDESTAL.get(), MalumItemHolderRenderer::new); event.registerBlockEntityRenderer(SPIRIT_JAR.get(), SpiritJarRenderer::new); event.registerBlockEntityRenderer(SOUL_VIAL.get(), SoulVialRenderer::new); event.registerBlockEntityRenderer(MOTE_OF_MANA.get(), MoteOfManaRenderer::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 857dab9e8..3f14616f6 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 @@ -13,7 +13,10 @@ import com.sammy.malum.common.block.mana_mote.*; import com.sammy.malum.common.block.nature.*; import com.sammy.malum.common.block.nature.soulwood.*; -import com.sammy.malum.common.block.storage.*; +import com.sammy.malum.common.block.storage.jar.*; +import com.sammy.malum.common.block.storage.pedestal.*; +import com.sammy.malum.common.block.storage.stand.*; +import com.sammy.malum.common.block.storage.vial.*; import com.sammy.malum.common.block.the_device.*; import com.sammy.malum.registry.common.*; import com.sammy.malum.registry.common.item.*; diff --git a/src/main/java/com/sammy/malum/client/ScreenParticleEffects.java b/src/main/java/com/sammy/malum/visual_effects/ScreenParticleEffects.java similarity index 98% rename from src/main/java/com/sammy/malum/client/ScreenParticleEffects.java rename to src/main/java/com/sammy/malum/visual_effects/ScreenParticleEffects.java index fdfd91729..53b64c14c 100644 --- a/src/main/java/com/sammy/malum/client/ScreenParticleEffects.java +++ b/src/main/java/com/sammy/malum/visual_effects/ScreenParticleEffects.java @@ -1,4 +1,4 @@ -package com.sammy.malum.client; +package com.sammy.malum.visual_effects; import com.sammy.malum.common.item.ether.*; import net.minecraft.client.*; @@ -8,6 +8,7 @@ import team.lodestar.lodestone.setup.*; import team.lodestar.lodestone.systems.easing.*; import team.lodestar.lodestone.systems.particle.*; +import team.lodestar.lodestone.systems.particle.builder.*; import team.lodestar.lodestone.systems.particle.data.*; import team.lodestar.lodestone.systems.particle.screen.*; import team.lodestar.lodestone.systems.particle.screen.base.*; diff --git a/src/main/java/com/sammy/malum/visual_effects/SpiritLightSpecs.java b/src/main/java/com/sammy/malum/visual_effects/SpiritLightSpecs.java new file mode 100644 index 000000000..03da6fe24 --- /dev/null +++ b/src/main/java/com/sammy/malum/visual_effects/SpiritLightSpecs.java @@ -0,0 +1,78 @@ +package com.sammy.malum.visual_effects; + +import com.sammy.malum.registry.client.*; +import net.minecraft.world.level.Level; +import net.minecraft.world.phys.Vec3; +import org.apache.commons.lang3.function.*; +import team.lodestar.lodestone.helpers.*; +import team.lodestar.lodestone.setup.LodestoneParticleRegistry; +import team.lodestar.lodestone.systems.particle.builder.*; +import team.lodestar.lodestone.systems.particle.data.ColorParticleData; +import team.lodestar.lodestone.systems.particle.data.GenericParticleData; +import team.lodestar.lodestone.systems.particle.data.SpinParticleData; +import team.lodestar.lodestone.systems.particle.world.*; + +import java.awt.*; +import java.util.*; +import java.util.function.*; + +import static net.minecraft.util.Mth.nextFloat; + +public class SpiritLightSpecs { + + public static void stationarySpiritLightSpecs(Level level, Vec3 pos, Color color, Color endColor) { + float distance = 0.4f; + int rotatingSpecs = 2; + long gameTime = level.getGameTime(); + BiFunction> scaleTransparencyScalar = (s, t) -> b -> b.setScaleData(b.getScaleData().scale(s).build()).setTransparencyData(b.getTransparencyData().scale(t).build()); + if (level.getGameTime() % 2L == 0) { + for (int i = 0; i < rotatingSpecs; i++) { + long offsetGameTime = gameTime + i * 120; + double yOffset = Math.sin((offsetGameTime % 360) / 30f) * 0.1f; + Vec3 offsetPosition = DataHelper.rotatingRadialOffset(pos.add(0, yOffset, 0), distance, i, rotatingSpecs, gameTime, 160); + spiritLightSpecs(level, offsetPosition, color, endColor, scaleTransparencyScalar.apply(1.2f, 1f).andThen(b -> b.setLifetime(b.getParticleOptions().lifetimeSupplier.get() * 2)), scaleTransparencyScalar.apply(0.5f, 0.25f)); + } + } + spiritLightSpecs(level, pos, color, endColor, scaleTransparencyScalar.apply(1.7f, 0.5f), scaleTransparencyScalar.apply(1.4f, 0.8f)); + } + + public static void spiritLightSpecs(Level level, Vec3 pos, Color color, Color endColor) { + spiritLightSpecs(level, pos, color, endColor, b -> {}); + } + + public static void spiritLightSpecs(Level level, Vec3 pos, Color color, Color endColor, Consumer consumer) { + spiritLightSpecs(level, pos, color, endColor, consumer, consumer); + } + + public static void spiritLightSpecs(Level level, Vec3 pos, Color color, Color endColor, Consumer lightSpecConsumer, Consumer bloomParticleConsumer) { + Random rand = level.getRandom(); + final ColorParticleData colorData = ColorParticleData.create(color, endColor).setCoefficient(1.25f).build(); + final SpinParticleData spinData = SpinParticleData.createRandomDirection(rand, nextFloat(rand, 0.05f, 0.1f)).randomSpinOffset(rand).build(); + final Consumer slowDown = p -> p.setParticleSpeed(p.getParticleSpeed().scale(0.95f)); + int lifetime = RandomHelper.randomBetween(rand, 10, 20); + SparkParticleBuilder.create(ParticleRegistry.ROUND_SPARK) + .setLengthData(GenericParticleData.create(0.1f, 0.2f).build()) + .setTransparencyData(GenericParticleData.create(0.8f, 0f).build()) + .setScaleData(GenericParticleData.create(0.025f, RandomHelper.randomBetween(rand, 0.2f, 0.3f), 0).build()) + .setColorData(colorData) + .setLifetime(lifetime) + .enableNoClip() + .addActor(slowDown) + .act(AbstractWorldParticleBuilder.class, lightSpecConsumer) + .spawn(level, pos.x, pos.y, pos.z); + + WorldParticleBuilder.create(LodestoneParticleRegistry.WISP_PARTICLE) + .setTransparencyData(GenericParticleData.create(0.25f, 0f).build()) + .setSpinData(spinData) + .setScaleData(GenericParticleData.create(0.05f, RandomHelper.randomBetween(rand, 0.1f, 0.15f), 0).build()) + .setColorData(colorData) + .setLifetime(lifetime) + .enableNoClip() + .addActor(slowDown) + .act(AbstractWorldParticleBuilder.class, bloomParticleConsumer) + .spawn(level, pos.x, pos.y, pos.z) + .setScaleData(GenericParticleData.create(0.075f, RandomHelper.randomBetween(rand, 0.15f, 0.25f), 0).build()) + .act(AbstractWorldParticleBuilder.class, bloomParticleConsumer) + .spawn(level, pos.x, pos.y, pos.z); + } +} diff --git a/src/main/java/com/sammy/malum/client/effects/BlightingMistParticleEffect.java b/src/main/java/com/sammy/malum/visual_effects/networked/BlightingMistParticleEffect.java similarity index 97% rename from src/main/java/com/sammy/malum/client/effects/BlightingMistParticleEffect.java rename to src/main/java/com/sammy/malum/visual_effects/networked/BlightingMistParticleEffect.java index e2d4e51f8..17871da3a 100644 --- a/src/main/java/com/sammy/malum/client/effects/BlightingMistParticleEffect.java +++ b/src/main/java/com/sammy/malum/visual_effects/networked/BlightingMistParticleEffect.java @@ -1,4 +1,4 @@ -package com.sammy.malum.client.effects; +package com.sammy.malum.visual_effects.networked; import com.sammy.malum.core.systems.particle_effects.*; import net.minecraft.core.*; @@ -7,6 +7,7 @@ import team.lodestar.lodestone.setup.*; import team.lodestar.lodestone.systems.easing.*; import team.lodestar.lodestone.systems.particle.*; +import team.lodestar.lodestone.systems.particle.builder.*; import team.lodestar.lodestone.systems.particle.data.*; import team.lodestar.lodestone.systems.particle.world.*; diff --git a/src/main/java/com/sammy/malum/client/effects/SpiritAltarCraftParticleEffect.java b/src/main/java/com/sammy/malum/visual_effects/networked/SpiritAltarCraftParticleEffect.java similarity index 97% rename from src/main/java/com/sammy/malum/client/effects/SpiritAltarCraftParticleEffect.java rename to src/main/java/com/sammy/malum/visual_effects/networked/SpiritAltarCraftParticleEffect.java index bdca4cdf9..4bd6bba46 100644 --- a/src/main/java/com/sammy/malum/client/effects/SpiritAltarCraftParticleEffect.java +++ b/src/main/java/com/sammy/malum/visual_effects/networked/SpiritAltarCraftParticleEffect.java @@ -1,4 +1,4 @@ -package com.sammy.malum.client.effects; +package com.sammy.malum.visual_effects.networked; import com.sammy.malum.core.systems.particle_effects.*; import net.minecraft.util.*; @@ -7,6 +7,7 @@ import team.lodestar.lodestone.setup.*; import team.lodestar.lodestone.systems.easing.*; import team.lodestar.lodestone.systems.particle.*; +import team.lodestar.lodestone.systems.particle.builder.*; import team.lodestar.lodestone.systems.particle.data.*; import java.awt.*; diff --git a/src/main/java/com/sammy/malum/client/effects/SpiritMoteCreationParticleEffect.java b/src/main/java/com/sammy/malum/visual_effects/networked/SpiritMoteCreationParticleEffect.java similarity index 97% rename from src/main/java/com/sammy/malum/client/effects/SpiritMoteCreationParticleEffect.java rename to src/main/java/com/sammy/malum/visual_effects/networked/SpiritMoteCreationParticleEffect.java index a274f65af..450fb6c52 100644 --- a/src/main/java/com/sammy/malum/client/effects/SpiritMoteCreationParticleEffect.java +++ b/src/main/java/com/sammy/malum/visual_effects/networked/SpiritMoteCreationParticleEffect.java @@ -1,4 +1,4 @@ -package com.sammy.malum.client.effects; +package com.sammy.malum.visual_effects.networked; import com.sammy.malum.core.systems.particle_effects.*; import net.minecraft.core.*; @@ -8,6 +8,7 @@ import team.lodestar.lodestone.setup.*; import team.lodestar.lodestone.systems.easing.*; import team.lodestar.lodestone.systems.particle.*; +import team.lodestar.lodestone.systems.particle.builder.*; import team.lodestar.lodestone.systems.particle.data.*; import java.awt.*; diff --git a/src/main/java/com/sammy/malum/client/effects/WeepingWellReactionParticleEffect.java b/src/main/java/com/sammy/malum/visual_effects/networked/WeepingWellReactionParticleEffect.java similarity index 97% rename from src/main/java/com/sammy/malum/client/effects/WeepingWellReactionParticleEffect.java rename to src/main/java/com/sammy/malum/visual_effects/networked/WeepingWellReactionParticleEffect.java index f51109d95..93f893e3d 100644 --- a/src/main/java/com/sammy/malum/client/effects/WeepingWellReactionParticleEffect.java +++ b/src/main/java/com/sammy/malum/visual_effects/networked/WeepingWellReactionParticleEffect.java @@ -1,4 +1,4 @@ -package com.sammy.malum.client.effects; +package com.sammy.malum.visual_effects.networked; import com.sammy.malum.core.systems.particle_effects.*; import net.minecraft.util.*; @@ -7,6 +7,7 @@ import team.lodestar.lodestone.setup.*; import team.lodestar.lodestone.systems.easing.*; import team.lodestar.lodestone.systems.particle.*; +import team.lodestar.lodestone.systems.particle.builder.*; import team.lodestar.lodestone.systems.particle.data.*; import team.lodestar.lodestone.systems.particle.world.*; diff --git a/src/main/java/com/sammy/malum/client/effects/basic/DrippingSmokeParticleEffect.java b/src/main/java/com/sammy/malum/visual_effects/networked/basic/DrippingSmokeParticleEffect.java similarity index 97% rename from src/main/java/com/sammy/malum/client/effects/basic/DrippingSmokeParticleEffect.java rename to src/main/java/com/sammy/malum/visual_effects/networked/basic/DrippingSmokeParticleEffect.java index 49cd79409..5b4311c8d 100644 --- a/src/main/java/com/sammy/malum/client/effects/basic/DrippingSmokeParticleEffect.java +++ b/src/main/java/com/sammy/malum/visual_effects/networked/basic/DrippingSmokeParticleEffect.java @@ -1,4 +1,4 @@ -package com.sammy.malum.client.effects.basic; +package com.sammy.malum.visual_effects.networked.basic; import com.sammy.malum.core.systems.particle_effects.*; import net.minecraft.util.*; @@ -7,6 +7,7 @@ import team.lodestar.lodestone.setup.*; import team.lodestar.lodestone.systems.easing.*; import team.lodestar.lodestone.systems.particle.*; +import team.lodestar.lodestone.systems.particle.builder.*; import team.lodestar.lodestone.systems.particle.data.*; import team.lodestar.lodestone.systems.particle.world.*; diff --git a/src/main/java/com/sammy/malum/client/effects/basic/HexingSmokeParticleEffect.java b/src/main/java/com/sammy/malum/visual_effects/networked/basic/HexingSmokeParticleEffect.java similarity index 97% rename from src/main/java/com/sammy/malum/client/effects/basic/HexingSmokeParticleEffect.java rename to src/main/java/com/sammy/malum/visual_effects/networked/basic/HexingSmokeParticleEffect.java index 8eb695aab..3fd926e43 100644 --- a/src/main/java/com/sammy/malum/client/effects/basic/HexingSmokeParticleEffect.java +++ b/src/main/java/com/sammy/malum/visual_effects/networked/basic/HexingSmokeParticleEffect.java @@ -1,4 +1,4 @@ -package com.sammy.malum.client.effects.basic; +package com.sammy.malum.visual_effects.networked.basic; import com.sammy.malum.core.systems.particle_effects.*; import net.minecraft.util.*; @@ -7,6 +7,7 @@ import team.lodestar.lodestone.setup.*; import team.lodestar.lodestone.systems.easing.*; import team.lodestar.lodestone.systems.particle.*; +import team.lodestar.lodestone.systems.particle.builder.*; import team.lodestar.lodestone.systems.particle.data.*; import java.awt.*; diff --git a/src/main/java/com/sammy/malum/client/effects/basic/RisingSparklesParticleEffect.java b/src/main/java/com/sammy/malum/visual_effects/networked/basic/RisingSparklesParticleEffect.java similarity index 95% rename from src/main/java/com/sammy/malum/client/effects/basic/RisingSparklesParticleEffect.java rename to src/main/java/com/sammy/malum/visual_effects/networked/basic/RisingSparklesParticleEffect.java index 0f7f08986..3b3ba61fb 100644 --- a/src/main/java/com/sammy/malum/client/effects/basic/RisingSparklesParticleEffect.java +++ b/src/main/java/com/sammy/malum/visual_effects/networked/basic/RisingSparklesParticleEffect.java @@ -1,4 +1,4 @@ -package com.sammy.malum.client.effects.basic; +package com.sammy.malum.visual_effects.networked.basic; import com.sammy.malum.core.systems.particle_effects.*; import net.minecraft.util.*; @@ -7,6 +7,7 @@ import team.lodestar.lodestone.setup.*; import team.lodestar.lodestone.systems.easing.*; import team.lodestar.lodestone.systems.particle.*; +import team.lodestar.lodestone.systems.particle.builder.*; import team.lodestar.lodestone.systems.particle.data.*; import java.awt.*; diff --git a/src/main/resources/assets/malum/particles/round_spark.json b/src/main/resources/assets/malum/particles/round_spark.json new file mode 100644 index 000000000..38228e3d4 --- /dev/null +++ b/src/main/resources/assets/malum/particles/round_spark.json @@ -0,0 +1,5 @@ +{ + "textures": [ + "malum:round_spark" + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/malum/textures/particle/light_spec_large.png b/src/main/resources/assets/malum/textures/particle/light_spec_large.png index eb8256875..840c10f71 100644 Binary files a/src/main/resources/assets/malum/textures/particle/light_spec_large.png and b/src/main/resources/assets/malum/textures/particle/light_spec_large.png differ diff --git a/src/main/resources/assets/malum/textures/particle/round_spark.png b/src/main/resources/assets/malum/textures/particle/round_spark.png new file mode 100644 index 000000000..b639815a4 Binary files /dev/null and b/src/main/resources/assets/malum/textures/particle/round_spark.png differ