Skip to content

Commit

Permalink
bf,,, need
Browse files Browse the repository at this point in the history
  • Loading branch information
SammySemicolon committed Feb 1, 2024
1 parent 53b35d4 commit bdcd7a0
Show file tree
Hide file tree
Showing 16 changed files with 56 additions and 49 deletions.
2 changes: 1 addition & 1 deletion src/generated/resources/assets/malum/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@
"item.malum.mechanical_weave_v2": "Mechanical Weave V2",
"item.malum.mending_diffuser": "Mending Diffuser",
"item.malum.mnemonic_fragment": "Mnemonic Fragment",
"item.malum.mnemonic_hex_staff": "Mnemonic Hex Staff",
"item.malum.natural_quartz": "Natural Quartz",
"item.malum.necklace_of_blissful_harmony": "Necklace of Blissful Harmony",
"item.malum.necklace_of_the_hidden_blade": "Necklace of the Hidden Blade",
Expand Down Expand Up @@ -427,7 +428,6 @@
"item.malum.soul_stained_steel_plating": "Soulstained Steel Plating",
"item.malum.soul_stained_steel_scythe": "Soulstained Steel Scythe",
"item.malum.soul_stained_steel_shovel": "Soulstained Steel Shovel",
"item.malum.soul_stained_steel_staff": "Soulstained Steel Staff",
"item.malum.soul_stained_steel_sword": "Soulstained Steel Sword",
"item.malum.soulwood_boat": "Soulwood Boat",
"item.malum.spectral_lens": "Spectral Lens",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parent": "minecraft:item/handheld",
"textures": {
"layer0": "malum:item/soul_stained_steel_staff"
"layer0": "malum:item/mnemonic_hex_staff"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
},
{
"type": "aqueous",
"count": 8
"count": 16
},
{
"type": "arcane",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"item": "malum:soulwood_planks"
},
"output": {
"item": "malum:soul_stained_steel_staff"
"item": "malum:mnemonic_hex_staff"
},
"spirits": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
],
"input": {
"count": 1,
"item": "malum:soul_stained_steel_staff"
"item": "malum:mnemonic_hex_staff"
},
"output": {
"item": "malum:staff_of_the_auric_flame"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"values": [
"malum:soul_stained_steel_staff",
"malum:mnemonic_hex_staff",
"malum:staff_of_the_auric_flame",
"malum:tyrving",
"malum:crude_scythe",
Expand Down
2 changes: 1 addition & 1 deletion src/generated/resources/data/malum/tags/items/staff.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"values": [
"malum:soul_stained_steel_staff",
"malum:mnemonic_hex_staff",
"malum:staff_of_the_auric_flame"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import net.minecraft.client.gui.*;
import net.minecraft.network.chat.*;
import net.minecraft.resources.*;
import net.minecraft.util.*;
import org.lwjgl.opengl.*;

import java.util.*;
Expand All @@ -27,6 +28,7 @@ public abstract class AbstractProgressionCodexScreen extends AbstractMalumScreen
public float cachedYOffset;
public boolean ignoreNextMouseInput;
public int transitionTimer;
public int timesTransitioned;

public final List<BookObject<?>> bookObjects = new ArrayList<>();

Expand Down Expand Up @@ -239,4 +241,8 @@ public int getGuiLeft() {
public int getGuiTop() {
return (height - bookHeight) / 2;
}

public int getTransitionDuration() {
return 80 - Mth.clamp(timesTransitioned-2, 0, 4) * 10;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public enum BookTheme {
}

public static <T extends AbstractProgressionCodexScreen> void renderTransitionFade(T screen, PoseStack stack) {
final float pct = screen.transitionTimer / 80f;
final float pct = screen.transitionTimer / (float)screen.getTransitionDuration();
float overlayAlpha = Easing.SINE_IN_OUT.ease(pct, 0, 1, 1);
float effectStrength = Easing.QUAD_OUT.ease(pct, 0, 1, 1);
float effectAlpha = Math.min(1, effectStrength * 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ public static void openCodexViaTransition() {
getScreenInstance().openScreen(false);
screen.faceObject(screen.bookObjects.get(0));
screen.playSound(SoundRegistry.ARCANA_TRANSITION_NORMAL, 1.25f, 1f);
screen.timesTransitioned++;
screen.transitionTimer = screen.getTransitionDuration();
EncyclopediaArcanaItem.shouldOpenVoidCodex = false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ public static void openCodexViaTransition() {
getScreenInstance().openScreen(false);
screen.faceObject(screen.bookObjects.get(0));
screen.playSound(SoundRegistry.ARCANA_TRANSITION_EVIL, 1.25f, 1f);
screen.timesTransitioned++;
screen.transitionTimer = screen.getTransitionDuration();
EncyclopediaArcanaItem.shouldOpenVoidCodex = true;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.sammy.malum.client.screen.codex.objects;

import com.sammy.malum.client.screen.codex.*;
import net.minecraft.client.*;
import net.minecraft.resources.*;

public class ScreenOpenerObject<T extends AbstractProgressionCodexScreen> extends IconObject<T> {
Expand All @@ -19,8 +18,5 @@ public ScreenOpenerObject(T screen, BookEntry<T> entry, int posX, int posY, Runn
@Override
public void click(float xOffset, float yOffset, double mouseX, double mouseY) {
screenOpener.run();
if (Minecraft.getInstance().screen instanceof AbstractProgressionCodexScreen screen) {
screen.transitionTimer = 80;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.BonemealableBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.pathfinder.*;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.Shapes;
Expand Down Expand Up @@ -48,6 +49,11 @@ public VoxelShape getVisualShape(BlockState pState, BlockGetter pReader, BlockPo
return Shapes.block();
}

@Override
public boolean isPathfindable(BlockState pState, BlockGetter pLevel, BlockPos pPos, PathComputationType pType) {
return false;
}

@Override
public InteractionResult use(BlockState pState, Level pLevel, BlockPos pPos, Player pPlayer, InteractionHand pHand, BlockHitResult pHit) {
if (pLevel instanceof ServerLevel serverLevel) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ public void onSyncedDataUpdated(EntityDataAccessor<?> pKey) {
fadingAway = entityData.get(DATA_FADING_AWAY);
if (fadingAway) {
age = getMaxAge() - 10;
setDeltaMovement(getDeltaMovement().scale(0.05f));

}
}
if (DATA_SPAWN_DELAY.equals(pKey)) {
Expand Down Expand Up @@ -107,18 +109,21 @@ protected void onHitBlock(BlockHitResult pResult) {
if (fadingAway || spawnDelay > 0) {
return;
}

if (!level().isClientSide) {
getImpactParticleEffect().createPositionedEffect(level(), new PositionEffectData(position().add(getDeltaMovement().scale(0.25f))), new ColorEffectData(SpiritTypeRegistry.WICKED_SPIRIT), HexBoltImpactParticleEffect.createData(getDeltaMovement().reverse().normalize()));
playSound(SoundRegistry.STAFF_STRIKES.get(), 0.5f, Mth.nextFloat(random, 0.9F, 1.5F));
getEntityData().set(DATA_FADING_AWAY, true);
Vec3 vec3 = pResult.getLocation().subtract(position());
Vec3 vec31 = vec3.normalize().scale(0.5f);
this.setPosRaw(getX() - vec31.x, getY() - vec31.y, getZ() - vec31.z);
}
getEntityData().set(DATA_FADING_AWAY, true);
setDeltaMovement(getDeltaMovement().scale(0.05f));
super.onHitBlock(pResult);
}

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

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public int getProjectileCount(Level level, LivingEntity livingEntity, float pct)
public void fireProjectile(LivingEntity player, ItemStack stack, Level level, InteractionHand hand, float chargePercentage, int count) {
float pitchOffset = 3f + count;
int spawnDelay = count * 3;
float velocity = 2.5f + 0.5f * count;
float velocity = 2f + 0.5f * count;
float magicDamage = (float) player.getAttributes().getValue(LodestoneAttributeRegistry.MAGIC_DAMAGE.get());
Vec3 pos = getProjectileSpawnPos(player, hand, 0.5f, 0.5f);
HexBoltEntity entity = new HexBoltEntity(level, pos.x, pos.y, pos.z);
Expand Down
56 changes: 23 additions & 33 deletions src/main/java/com/sammy/malum/core/events/RuntimeEvents.java
Original file line number Diff line number Diff line change
@@ -1,44 +1,34 @@
package com.sammy.malum.core.events;

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;
import com.sammy.malum.common.effect.CorruptedAerialAura;
import com.sammy.malum.common.effect.GluttonyEffect;
import com.sammy.malum.common.effect.InfernalAura;
import com.sammy.malum.common.effect.WickedIntentEffect;
import com.sammy.malum.common.block.storage.jar.*;
import com.sammy.malum.common.capability.*;
import com.sammy.malum.common.effect.*;
import com.sammy.malum.common.enchantment.*;
import com.sammy.malum.common.entity.nitrate.EthericExplosion;
import com.sammy.malum.common.item.cosmetic.curios.CurioTokenOfGratitude;
import com.sammy.malum.common.item.curiosities.curios.alchemical.CurioAlchemicalRing;
import com.sammy.malum.common.item.curiosities.curios.misc.CurioHarmonyNecklace;
import com.sammy.malum.common.item.curiosities.curios.prospector.CurioProspectorBelt;
import com.sammy.malum.common.item.curiosities.curios.rotten.CurioVoraciousRing;
import com.sammy.malum.common.entity.nitrate.*;
import com.sammy.malum.common.item.cosmetic.curios.*;
import com.sammy.malum.common.item.curiosities.curios.alchemical.*;
import com.sammy.malum.common.item.curiosities.curios.misc.*;
import com.sammy.malum.common.item.curiosities.curios.prospector.*;
import com.sammy.malum.common.item.curiosities.curios.rotten.*;
import com.sammy.malum.common.item.curiosities.curios.weeping.*;
import com.sammy.malum.core.handlers.*;
import com.sammy.malum.core.listeners.*;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.ClipContext;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.HitResult;
import net.minecraft.core.*;
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.state.*;
import net.minecraft.world.phys.*;
import net.minecraftforge.event.*;
import net.minecraftforge.event.entity.EntityJoinLevelEvent;
import net.minecraftforge.event.entity.item.ItemExpireEvent;
import net.minecraftforge.event.entity.*;
import net.minecraftforge.event.entity.item.*;
import net.minecraftforge.event.entity.living.*;
import net.minecraftforge.event.entity.player.PlayerEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.event.level.ExplosionEvent;
import net.minecraftforge.eventbus.api.EventPriority;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.event.entity.player.*;
import net.minecraftforge.event.level.*;
import net.minecraftforge.eventbus.api.*;
import net.minecraftforge.fml.common.*;

@Mod.EventBusSubscriber
public class RuntimeEvents {
Expand Down

0 comments on commit bdcd7a0

Please sign in to comment.