Skip to content

Commit

Permalink
Wawa
Browse files Browse the repository at this point in the history
  • Loading branch information
SammySemicolon committed Jul 3, 2024
1 parent 7a682bf commit 6af7f8e
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 11 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ modLicense=All Rights Reserved
modGroupId=com.sammy.malum
modAuthors=Sammy Semicolon
modDescription=A dark magic mod focused on soul and spirit magic.
lodestoneVersion=1.6.1.212
lodestoneVersion=1.6.1.215
jeiVersion=15.2.0.22
curiosVersion=5.7.1+1.20.1
fusionVersion=1.1.1
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public static void setupEntries(ArcanaProgressionScreen screen) {

screen.addEntry("mote_making", 12, 12, b -> b
.configureWidget(w -> w.setIcon(LAMPLIGHTERS_TONGS))
.addPage(new HeadlineTextItemPage("spirited_glass", "spirited_glass.1", LAMPLIGHTERS_TONGS.get()))
.addPage(new TextPage("spirited_glass.2"))
.addPage(new HeadlineTextItemPage("mote_making", "mote_making.1", LAMPLIGHTERS_TONGS.get()))
.addPage(new TextPage("mote_making.2"))
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ protected void onHitBlock(BlockHitResult result) {

@Override
protected boolean canHitEntity(Entity pTarget) {
return !pTarget.equals(getOwner());
return !pTarget.equals(getOwner()) && super.canHitEntity(pTarget);
}

@Override
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/com/sammy/malum/data/MalumLang.java
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,14 @@ protected void addTranslations() {
addPages("rune_of_the_hells",
"The Rune of the Hells conveys the Rite of the Hells, granting Ifrit's Courage to its wearer at a reduced potency when they are on fire, extinguishing and healing them.");

addSimpleEntryHeader("spirited_glass", "Spirited Glass", "Glass-weaver's Finest");
addPages("spirited_glass",
"");

addSimpleEntryHeader("mote_making", "Mote Making", "Arcana, Squared");
addPages("mote_making",
"A re-imagination of the Tuning Fork; Lamplighter's Tongs are a tool that in function create motes of pure arcana, stabilized by the tool, they function as a source of light.");

addSimpleEntryHeader("mirror_magic", "Mirror magic", "Magic Funnels");
addPages("mirror_magic", "The future holds many secrets..");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ public static void buildRecipes(Consumer<FinishedRecipe> consumer) {
public static void spiritedGlassRecipe(Consumer<FinishedRecipe> consumer, MalumSpiritType spirit, Item glass) {
new SpiritInfusionRecipeBuilder(Ingredient.of(Tags.Items.GLASS), 16, glass, 16)
.addSpirit(spirit, 2)
.addExtraItem(Items.IRON_INGOT, 1)
.build(consumer);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,29 @@
import net.minecraft.util.*;
import net.minecraft.world.level.*;
import net.minecraft.world.level.block.state.*;
import net.minecraft.world.phys.Vec3;
import net.minecraft.world.phys.shapes.*;
import team.lodestar.lodestone.helpers.RandomHelper;
import team.lodestar.lodestone.registry.common.particle.*;
import team.lodestar.lodestone.systems.particle.data.*;
import team.lodestar.lodestone.systems.particle.data.color.*;
import team.lodestar.lodestone.systems.particle.render_types.*;
import team.lodestar.lodestone.systems.particle.world.LodestoneWorldParticle;
import team.lodestar.lodestone.systems.particle.world.options.*;

import java.util.function.Consumer;

public class SpiritMoteParticleEffects {

private static final Consumer<LodestoneWorldParticle> SLOWDOWN = p -> {
Vec3 speed = p.getParticleSpeed();
double d0 = (Math.random() + Math.random() + 1.0D) * (double) 0.15F;
double d1 = Math.sqrt(speed.x * speed.x + speed.y * speed.y + speed.z * speed.z);
p.setParticleSpeed(
speed.x / d1 * d0 * 0.4F,
speed.y / d1 * d0 * 0.4F + 0.1F,
speed.z / d1 * d0 * 0.4F);
};

public static void destroy(Level level, BlockPos pPos, BlockState pState, MalumSpiritType spiritType) {
if (!pState.isAir()) {
VoxelShape voxelshape = pState.getShape(level, pPos);
Expand All @@ -23,16 +37,18 @@ public static void destroy(Level level, BlockPos pPos, BlockState pState, MalumS
.setRenderType(LodestoneWorldParticleRenderType.TERRAIN_SHEET)
.setSpirit(spiritType)
.setGravityStrength(1f)
.setTransparencyData(GenericParticleData.create(0.2f, 0).build())
.setScaleData(GenericParticleData.create(0.125f).build());
.setFrictionStrength(0.98f)
.setTransparencyData(GenericParticleData.create(0.5f, 0).build())
.setScaleData(GenericParticleData.create(0.0625f).build())
.addSpawnActor(SLOWDOWN);

voxelshape.forAllBoxes((minX, minY, minZ, maxX, maxY, maxZ) -> {
double xOffset = Math.min(1.0D, maxX - minX);
double yOffset = Math.min(1.0D, maxY - minY);
double zOffset = Math.min(1.0D, maxZ - minZ);
int xDistance = Math.max(2, Mth.ceil(xOffset / 0.25D));
int yDistance = Math.max(2, Mth.ceil(yOffset / 0.25D));
int zDistance = Math.max(2, Mth.ceil(zOffset / 0.25D));
float xDistance = Math.max(2, Mth.ceil(xOffset / 0.25D));
float yDistance = Math.max(2, Mth.ceil(yOffset / 0.25D));
float zDistance = Math.max(2, Mth.ceil(zOffset / 0.25D));

for(int x = 0; x < xDistance; ++x) {
for(int y = 0; y < yDistance; ++y) {
Expand All @@ -43,8 +59,14 @@ public static void destroy(Level level, BlockPos pPos, BlockState pState, MalumS
double posX = pPos.getX() + motionX * xOffset + minX;
double posY = pPos.getY() + motionY * yOffset + minY;
double posZ = pPos.getZ() + motionZ * zOffset + minZ;
RandomSource random = level.random;
builder
.setMotion(motionX - 0.5f, motionY - 0.5f, motionZ - 0.5f)
.setMotion(
motionX - 0.5f + (random.nextFloat() * 2f - 1f) * 0.4f,
motionY - 0.5f + (random.nextFloat() * 2f - 1f) * 0.4f,
motionZ - 0.5f + (random.nextFloat() * 2f - 1f) * 0.4f
)
.setLifetime(RandomHelper.randomBetween(level.random, 20, 40))
.spawn(level, posX, posY, posZ);
}
}
Expand Down

0 comments on commit 6af7f8e

Please sign in to comment.