Skip to content

Commit

Permalink
Mreow
Browse files Browse the repository at this point in the history
  • Loading branch information
SammySemicolon committed Apr 20, 2024
1 parent 05f83e4 commit 06bd430
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 122 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,12 @@
import net.minecraft.world.item.crafting.*;
import org.joml.*;
import org.lwjgl.opengl.*;

import team.lodestar.lodestone.registry.client.*;
import team.lodestar.lodestone.systems.easing.*;
import team.lodestar.lodestone.systems.recipe.*;
import team.lodestar.lodestone.systems.rendering.*;
import team.lodestar.lodestone.systems.rendering.shader.*;

import java.lang.*;
import java.lang.Math;
import java.util.*;
import java.util.function.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ public void render(AbstractProgressionCodexScreen screen, GuiGraphics guiGraphic
final int y = getOffsetYPosition() + 8 - (style.textureHeight() - 32) / 4;
renderWavyIcon(textureLocation, guiGraphics.pose(), x, y, 0, textureWidth, textureHeight);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.sammy.malum.client.screen.codex.*;
import com.sammy.malum.client.screen.codex.objects.progression.*;
import com.sammy.malum.client.screen.codex.pages.*;
import com.sammy.malum.client.screen.codex.pages.recipe.*;
import com.sammy.malum.client.screen.codex.pages.text.*;
import com.sammy.malum.common.events.*;
import com.sammy.malum.common.item.codex.*;
Expand Down Expand Up @@ -92,18 +93,18 @@ public void setupEntries() {
.addPage(new TextPage("void.material_study_null_slate.2"))
);

addEntry("void.material_study_void_salts", -3, 4, b -> b
addEntry("void.material_study_mnemonic_fragment", -3, 4, b -> b
.setWidgetConfig(w -> w.setIcon(MNEMONIC_FRAGMENT).setStyle(BookWidgetStyle.SOULWOOD))
.addPage(new WeepingWellTextPage("void.material_study_mnemonic_fragment", "void.material_study_mnemonic_fragment.1", MNEMONIC_FRAGMENT.get()))
.addPage(new TextPage("void.material_study_mnemonic_fragment.2"))
);

addEntry("void.material_study_void_salts", 2, 3, b -> b
.setWidgetConfig(w -> w.setIcon(VOID_SALTS).setStyle(BookWidgetStyle.SOULWOOD))
.addPage(new WeepingWellTextPage("void.material_study_void_salts", "void.material_study_void_salts.1", VOID_SALTS.get()))
.addPage(new TextPage("void.material_study_void_salts.2"))
);

addEntry("void.material_study_mnemonic_fragment", 2, 3, b -> b
.setWidgetConfig(w -> w.setIcon(NULL_SLATE).setStyle(BookWidgetStyle.SOULWOOD))
.addPage(new WeepingWellTextPage("void.material_study_mnemonic_fragment", "void.material_study_mnemonic_fragment.1", NULL_SLATE.get()))
.addPage(new TextPage("void.material_study_mnemonic_fragment.2"))
);

addEntry("void.material_study_auric_embers", 3, 4, b -> b
.setWidgetConfig(w -> w.setIcon(AURIC_EMBERS).setStyle(BookWidgetStyle.SOULWOOD))
.addPage(new WeepingWellTextPage("void.material_study_auric_embers", "void.material_study_auric_embers.1", AURIC_EMBERS.get()))
Expand Down Expand Up @@ -132,42 +133,38 @@ public void setupEntries() {
addEntry("void.staves_as_foci", 0, 9, b -> b
.setWidgetConfig(w -> w.setIcon(MNEMONIC_HEX_STAFF).setStyle(BookWidgetStyle.GILDED_SOULWOOD))
.addReference(new EntryReference(RING_OF_THE_ENDLESS_WELL, BookEntry.build("void.staves_as_foci.ring_of_the_endless_well")))

);



addEntry("void.ring_of_growing_flesh", -3, 9, b -> b
.setWidgetConfig(w -> w.setIcon(RING_OF_GROWING_FLESH).setStyle(BookWidgetStyle.SOULWOOD))
.addPage(new HeadlineTextPage("void.ring_of_growing_flesh", "void.ring_of_growing_flesh.1"))
.addPage(SpiritInfusionPage.fromOutput(RING_OF_GROWING_FLESH.get()))
);
addEntry("void.ring_of_gruesome_satiation", -4, 10, b -> b
.setWidgetConfig(w -> w.setIcon(RING_OF_GRUESOME_SATIATION).setStyle(BookWidgetStyle.SOULWOOD))
.addPage(new HeadlineTextPage("void.ring_of_gruesome_satiation", "void.ring_of_gruesome_satiation.1"))
.addPage(SpiritInfusionPage.fromOutput(RING_OF_GRUESOME_SATIATION.get()))
);
addEntry("void.necklace_of_the_watcher", -3, 11, b -> b
.setWidgetConfig(w -> w.setIcon(NECKLACE_OF_THE_WATCHER).setStyle(BookWidgetStyle.SOULWOOD))
.addPage(new HeadlineTextPage("void.necklace_of_the_watcher", "void.necklace_of_the_watcher.1"))
.addPage(SpiritInfusionPage.fromOutput(NECKLACE_OF_THE_WATCHER.get()))
);
addEntry("void.necklace_of_the_hidden_blade", -4, 12, b -> b
.setWidgetConfig(w -> w.setIcon(NECKLACE_OF_THE_HIDDEN_BLADE).setStyle(BookWidgetStyle.SOULWOOD))
.addPage(new HeadlineTextPage("void.necklace_of_the_hidden_blade", "void.necklace_of_the_hidden_blade.1"))
.addPage(SpiritInfusionPage.fromOutput(NECKLACE_OF_THE_HIDDEN_BLADE.get()))
);

// addEntry("void.malignant_lead", 6, 4, b -> b
// .setWidgetConfig(w -> w.setIcon(MALIGNANT_LEAD).setStyle(BookWidgetStyle.SOULWOOD))
// .addPage(new WeepingWellTextPage("void.malignant_lead", "void.malignant_lead.1", MALIGNANT_LEAD.get()))
// .addPage(new TextPage("void.malignant_lead.2"))
// );
//
// addEntry("void.ring_of_growing_flesh", -3, 4, b -> b
// .setWidgetConfig(w -> w.setIcon(RING_OF_GROWING_FLESH).setStyle(BookWidgetStyle.SOULWOOD))
// .addPage(new HeadlineTextPage("void.ring_of_growing_flesh", "void.ring_of_growing_flesh.1"))
// .addPage(SpiritInfusionPage.fromOutput(RING_OF_GROWING_FLESH.get()))
// );
// addEntry("void.ring_of_gruesome_satiation", -4, 5, b -> b
// .setWidgetConfig(w -> w.setIcon(RING_OF_GRUESOME_SATIATION).setStyle(BookWidgetStyle.SOULWOOD))
// );
// addEntry("void.necklace_of_the_watcher", -2, 5, b -> b
// .setWidgetConfig(w -> w.setIcon(NECKLACE_OF_THE_WATCHER).setStyle(BookWidgetStyle.SOULWOOD))
// );
// addEntry("void.necklace_of_the_hidden_blade", -3, 6, b -> b
// .setWidgetConfig(w -> w.setIcon(NECKLACE_OF_THE_HIDDEN_BLADE).setStyle(BookWidgetStyle.SOULWOOD))
// );
//
// addEntry("void.soul_stained_steel_staff", 3, 4, b -> b
// .setWidgetConfig(w -> w.setIcon(MNEMONIC_HEX_STAFF).setStyle(BookWidgetStyle.SOULWOOD))
// .addPage(new HeadlineTextPage("void.soul_stained_steel_staff", "void.soul_stained_steel_staff.1"))
// .addPage(SpiritInfusionPage.fromOutput(MNEMONIC_HEX_STAFF.get()))
// .addPage(new TextPage("void.soul_stained_steel_staff.2"))
// .addPage(new TextPage("void.soul_stained_steel_staff.3"))
// .addPage(new HeadlineTextPage("void.ring_of_the_plentiful", "void.ring_of_the_plentiful.1"))
// .addPage(SpiritInfusionPage.fromOutput(RING_OF_THE_PLENTIFUL.get()))
// );


// addEntry("void.something2", 4, 5, b -> b
// .setWidgetConfig(w -> w.setIcon(BARRIER).setStyle(BookWidgetStyle.SOULWOOD))
// );
Expand Down
175 changes: 88 additions & 87 deletions src/main/java/com/sammy/malum/common/block/ether/EtherBlockEntity.java
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
package com.sammy.malum.common.block.ether;

import com.sammy.malum.common.item.ether.AbstractEtherItem;
import com.sammy.malum.common.item.ether.EtherItem;
import com.sammy.malum.registry.client.ParticleRegistry;
import com.sammy.malum.registry.common.block.BlockEntityRegistry;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.WallTorchBlock;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.HitResult;
import team.lodestar.lodestone.helpers.BlockHelper;
import team.lodestar.lodestone.helpers.ColorHelper;
import com.sammy.malum.common.item.ether.*;
import com.sammy.malum.registry.client.*;
import com.sammy.malum.registry.common.block.*;
import com.sammy.malum.visual_effects.*;
import net.minecraft.core.*;
import net.minecraft.nbt.*;
import net.minecraft.util.*;
import net.minecraft.world.entity.*;
import net.minecraft.world.entity.player.*;
import net.minecraft.world.item.*;
import net.minecraft.world.level.*;
import net.minecraft.world.level.block.*;
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.registry.common.particle.*;
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.builder.WorldParticleBuilder;
import team.lodestar.lodestone.systems.particle.data.GenericParticleData;
import team.lodestar.lodestone.systems.particle.data.color.ColorParticleData;
import team.lodestar.lodestone.systems.particle.data.spin.SpinParticleData;
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.data.color.*;
import team.lodestar.lodestone.systems.particle.data.spin.*;

import java.awt.*;

Expand Down Expand Up @@ -107,78 +105,81 @@ public void tick() {
if (firstColor == null) {
return;
}
final RandomSource random = level.random;
Block block = getBlockState().getBlock();
Color firstColor = ColorHelper.darker(this.firstColor, 1);
Color secondColor = this.secondColor == null ? firstColor : ColorHelper.brighter(this.secondColor, 1);
double x = worldPosition.getX() + 0.5;
double y = worldPosition.getY() + 0.6;
double z = worldPosition.getZ() + 0.5;
int lifeTime = 14 + level.random.nextInt(4);
float scale = 0.17f + level.random.nextFloat() * 0.03f;
float velocity = 0.04f + level.random.nextFloat() * 0.02f;
double x = worldPosition.getX() + 0.5f;
double y = worldPosition.getY() + 0.5f;
double z = worldPosition.getZ() + 0.5f;

if (block instanceof EtherWallTorchBlock) {
final float offset = 0.15f;
Direction direction = getBlockState().getValue(WallTorchBlock.FACING);
x += direction.getNormal().getX() * -0.15f;
x -= direction.getNormal().getX() * offset;
y += 0.4f;
z -= direction.getNormal().getZ() * offset;
} else if (block instanceof EtherTorchBlock) {
y += 0.3f;
z += direction.getNormal().getZ() * -0.15f;
lifeTime -= 6;
} else if (block instanceof EtherBrazierBlock) {
y -= 0.05f;
}
if (block instanceof EtherTorchBlock) {
y += 0.2f;
lifeTime -= 4;
}
if (block instanceof EtherBrazierBlock) {
y -= 0.2f;
lifeTime -= 2;
scale *= 1.25f;

final ColorParticleData colorData = ColorParticleData.create(firstColor, secondColor).setCoefficient(1.5f).setEasing(Easing.BOUNCE_IN_OUT).build();
if (level.getGameTime() % 8L == 0) {
int lifeTime = RandomHelper.randomBetween(random, 40, 60);
float scale = RandomHelper.randomBetween(random, 0.6f, 0.7f);
float velocity = RandomHelper.randomBetween(random, 0.02f, 0.03f);
var lightSpecs = SpiritLightSpecs.spiritLightSpecs(level, new Vec3(x, y, z), colorData);
lightSpecs.getBuilder()
.setLifetime(lifeTime)
.setScaleData(GenericParticleData.create(scale, 0).setEasing(Easing.SINE_IN_OUT).build())
.setTransparencyData(GenericParticleData.create(0.2f, 0.4f, 0).build())
.addMotion(0, velocity * 1.2f, 0);
lightSpecs.spawnParticlesRaw();
}
WorldParticleBuilder.create(LodestoneParticleRegistry.WISP_PARTICLE)
.setScaleData(GenericParticleData.create(scale, 0).build())
.setTransparencyData(GenericParticleData.create(0.75f, 0.25f).build())
.setColorData(ColorParticleData.create(firstColor, secondColor).setCoefficient(1.4f).setEasing(Easing.BOUNCE_IN_OUT).build())
.setSpinData(SpinParticleData.create(0.2f, 0.4f).setSpinOffset((level.getGameTime() * 0.2f) % 6.28f).setEasing(Easing.QUARTIC_IN).build())
.setLifetime(lifeTime)
.addMotion(0, velocity, 0)
.enableNoClip()
.spawn(level, x, y, z);

WorldParticleBuilder.create(LodestoneParticleRegistry.TWINKLE_PARTICLE)
.setScaleData(GenericParticleData.create(scale * 2, scale * 0.1f).build())
.setTransparencyData(GenericParticleData.create(0.25f, 0).build())
.setColorData(ColorParticleData.create(firstColor, secondColor).setEasing(Easing.SINE_IN).setCoefficient(2.25f).build())
.setSpinData(SpinParticleData.create(0, 2).setEasing(Easing.QUARTIC_IN).build())
.setLifetime(lifeTime)
.enableNoClip()
.spawn(level, x, y, z);

if (level.getGameTime() % 2L == 0) {
y += 0.15f;
if (level.random.nextFloat() < 0.5f) {
WorldParticleBuilder.create(ParticleRegistry.SPIRIT_FLAME_PARTICLE)
.setScaleData(GenericParticleData.create(0.5f, 0.75f, 0).build())
.setColorData(ColorParticleData.create(firstColor, secondColor).setEasing(Easing.CIRC_IN_OUT).setCoefficient(2.5f).build())
.setTransparencyData(GenericParticleData.create(0.2f, 1f, 0).setEasing(Easing.SINE_IN, Easing.QUAD_IN).setCoefficient(3.5f).build())
.setRandomOffset(0.15f, 0.2f)
.addMotion(0, 0.0035f, 0)
.setRandomMotion(0.001f, 0.005f)
.addTickActor(p -> p.setParticleMotion(p.getParticleSpeed().scale(0.985f-level.random.nextFloat() * 0.04f)))
.enableNoClip()
.setDiscardFunction(SimpleParticleOptions.ParticleDiscardFunctionType.ENDING_CURVE_INVISIBLE)
.spawn(level, x, y, z);
}
if (level.random.nextFloat() < 0.25f) {
WorldParticleBuilder.create(ParticleRegistry.SPIRIT_FLAME_PARTICLE)
.setScaleData(GenericParticleData.create(0.3f, 0.5f, 0).build())
.setColorData(ColorParticleData.create(firstColor, secondColor).setEasing(Easing.CIRC_IN_OUT).setCoefficient(3.5f).build())
.setTransparencyData(GenericParticleData.create(0.2f, 1f, 0).setEasing(Easing.SINE_IN, Easing.CIRC_IN_OUT).setCoefficient(3.5f).build())
.setRandomOffset(0.1f, 0.225f)
.addMotion(0, velocity / 2f, 0)
.setRandomMotion(0, 0.015f)
.addTickActor(p -> p.setParticleMotion(p.getParticleSpeed().scale(0.97f-level.random.nextFloat() * 0.025f)))
.enableNoClip()
.setDiscardFunction(SimpleParticleOptions.ParticleDiscardFunctionType.ENDING_CURVE_INVISIBLE)
.spawn(level, x, y, z);
}
int lifeTime = RandomHelper.randomBetween(random, 10, 15);
float scale = RandomHelper.randomBetween(random, 0.15f, 0.2f);
float velocity = RandomHelper.randomBetween(random, 0.02f, 0.03f);
WorldParticleBuilder.create(LodestoneParticleRegistry.WISP_PARTICLE)
.setScaleData(GenericParticleData.create(scale, 0).setEasing(Easing.SINE_IN).build())
.setTransparencyData(GenericParticleData.create(0.3f, 0.6f, 0.1f).setEasing(Easing.QUAD_OUT).build())
.setColorData(colorData)
.setSpinData(SpinParticleData.create(0.2f, 0.4f).setSpinOffset((level.getGameTime() * 0.2f) % 6.28f).setEasing(Easing.QUARTIC_IN).build())
.setLifetime(lifeTime)
.addMotion(0, velocity * 1.5f, 0)
.enableNoClip()
.spawn(level, x, y, z);
lifeTime = 20;
scale = RandomHelper.randomBetween(random, 0.4f, 0.5f);
WorldParticleBuilder.create(LodestoneParticleRegistry.TWINKLE_PARTICLE)
.setScaleData(GenericParticleData.create(scale, 0f).build())
.setTransparencyData(GenericParticleData.create(0.05f, 0.5f).build())
.setColorData(ColorParticleData.create(firstColor, secondColor).setEasing(Easing.SINE_IN).setCoefficient(0.5f).build())
.setSpinData(SpinParticleData.create(0, 0.4f).setEasing(Easing.QUARTIC_IN).build())
.setLifetime(lifeTime)
.enableNoClip()
.spawn(level, x, y, z);
}

if (level.getGameTime() % 4L == 0) {
final long gameTime = level.getGameTime();
float scale = RandomHelper.randomBetween(random, 0.6f, 0.75f);
float velocity = RandomHelper.randomBetween(random, 0f, 0.02f);
float angle = ((gameTime % 24) / 24f) * (float) Math.PI * 2f;
Vec3 offset = new Vec3(Math.sin(angle), 0, Math.cos(angle)).normalize();
Vec3 offsetPosition = new Vec3(x + offset.x * 0.075f, y-0.05f, z + offset.z * 0.075f);
WorldParticleBuilder.create(ParticleRegistry.SPIRIT_FLAME_PARTICLE)
.setScaleData(GenericParticleData.create(scale * 0.75f, scale, 0).build())
.setColorData(ColorParticleData.create(firstColor, secondColor).setEasing(Easing.CIRC_IN_OUT).setCoefficient(2.5f).build())
.setTransparencyData(GenericParticleData.create(0f, 1f, 0).setEasing(Easing.SINE_IN, Easing.QUAD_IN).setCoefficient(3.5f).build())
.addMotion(0, velocity, 0)
.addTickActor(p -> p.setParticleMotion(p.getParticleSpeed().scale(1f - random.nextFloat() * 0f)))
.enableNoClip()
.setDiscardFunction(SimpleParticleOptions.ParticleDiscardFunctionType.ENDING_CURVE_INVISIBLE)
.spawn(level, offsetPosition.x, offsetPosition.y, offsetPosition.z);
}
}
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 06bd430

Please sign in to comment.