diff --git a/src/generated/resources/assets/malum/lang/en_us.json b/src/generated/resources/assets/malum/lang/en_us.json index 0a05cebbc..bfc5c4a12 100644 --- a/src/generated/resources/assets/malum/lang/en_us.json +++ b/src/generated/resources/assets/malum/lang/en_us.json @@ -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", @@ -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", diff --git a/src/generated/resources/assets/malum/models/item/soul_stained_steel_staff.json b/src/generated/resources/assets/malum/models/item/mnemonic_hex_staff.json similarity index 54% rename from src/generated/resources/assets/malum/models/item/soul_stained_steel_staff.json rename to src/generated/resources/assets/malum/models/item/mnemonic_hex_staff.json index 5621a1575..8c2b74d20 100644 --- a/src/generated/resources/assets/malum/models/item/soul_stained_steel_staff.json +++ b/src/generated/resources/assets/malum/models/item/mnemonic_hex_staff.json @@ -1,6 +1,6 @@ { "parent": "minecraft:item/handheld", "textures": { - "layer0": "malum:item/soul_stained_steel_staff" + "layer0": "malum:item/mnemonic_hex_staff" } } \ No newline at end of file diff --git a/src/generated/resources/data/malum/recipes/spirit_infusion/belt_of_the_starved.json b/src/generated/resources/data/malum/recipes/spirit_infusion/belt_of_the_starved.json index 7d8c08eae..8bd64d87a 100644 --- a/src/generated/resources/data/malum/recipes/spirit_infusion/belt_of_the_starved.json +++ b/src/generated/resources/data/malum/recipes/spirit_infusion/belt_of_the_starved.json @@ -32,7 +32,7 @@ }, { "type": "aqueous", - "count": 8 + "count": 16 }, { "type": "arcane", diff --git a/src/generated/resources/data/malum/recipes/spirit_infusion/soul_stained_steel_staff.json b/src/generated/resources/data/malum/recipes/spirit_infusion/mnemonic_hex_staff.json similarity index 92% rename from src/generated/resources/data/malum/recipes/spirit_infusion/soul_stained_steel_staff.json rename to src/generated/resources/data/malum/recipes/spirit_infusion/mnemonic_hex_staff.json index eaa2be7db..6708e3afa 100644 --- a/src/generated/resources/data/malum/recipes/spirit_infusion/soul_stained_steel_staff.json +++ b/src/generated/resources/data/malum/recipes/spirit_infusion/mnemonic_hex_staff.json @@ -15,7 +15,7 @@ "item": "malum:soulwood_planks" }, "output": { - "item": "malum:soul_stained_steel_staff" + "item": "malum:mnemonic_hex_staff" }, "spirits": [ { diff --git a/src/generated/resources/data/malum/recipes/spirit_infusion/staff_of_the_auric_flame.json b/src/generated/resources/data/malum/recipes/spirit_infusion/staff_of_the_auric_flame.json index 9a56be08a..7afdb7ef1 100644 --- a/src/generated/resources/data/malum/recipes/spirit_infusion/staff_of_the_auric_flame.json +++ b/src/generated/resources/data/malum/recipes/spirit_infusion/staff_of_the_auric_flame.json @@ -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" diff --git a/src/generated/resources/data/malum/tags/items/soul_hunter_weapon.json b/src/generated/resources/data/malum/tags/items/soul_hunter_weapon.json index 5ed92eed2..8422bd7c8 100644 --- a/src/generated/resources/data/malum/tags/items/soul_hunter_weapon.json +++ b/src/generated/resources/data/malum/tags/items/soul_hunter_weapon.json @@ -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", diff --git a/src/generated/resources/data/malum/tags/items/staff.json b/src/generated/resources/data/malum/tags/items/staff.json index 97dad0997..a9293852d 100644 --- a/src/generated/resources/data/malum/tags/items/staff.json +++ b/src/generated/resources/data/malum/tags/items/staff.json @@ -1,6 +1,6 @@ { "values": [ - "malum:soul_stained_steel_staff", + "malum:mnemonic_hex_staff", "malum:staff_of_the_auric_flame" ] } \ No newline at end of file diff --git a/src/main/java/com/sammy/malum/client/screen/codex/AbstractProgressionCodexScreen.java b/src/main/java/com/sammy/malum/client/screen/codex/AbstractProgressionCodexScreen.java index 435d92648..7eb7a3d46 100644 --- a/src/main/java/com/sammy/malum/client/screen/codex/AbstractProgressionCodexScreen.java +++ b/src/main/java/com/sammy/malum/client/screen/codex/AbstractProgressionCodexScreen.java @@ -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.*; @@ -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> bookObjects = new ArrayList<>(); @@ -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; + } } \ No newline at end of file diff --git a/src/main/java/com/sammy/malum/client/screen/codex/ArcanaCodexHelper.java b/src/main/java/com/sammy/malum/client/screen/codex/ArcanaCodexHelper.java index 10370a3a0..b47a925b0 100644 --- a/src/main/java/com/sammy/malum/client/screen/codex/ArcanaCodexHelper.java +++ b/src/main/java/com/sammy/malum/client/screen/codex/ArcanaCodexHelper.java @@ -43,7 +43,7 @@ public enum BookTheme { } public static 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); diff --git a/src/main/java/com/sammy/malum/client/screen/codex/ArcanaProgressionScreen.java b/src/main/java/com/sammy/malum/client/screen/codex/ArcanaProgressionScreen.java index 6b92abd92..1cc029290 100644 --- a/src/main/java/com/sammy/malum/client/screen/codex/ArcanaProgressionScreen.java +++ b/src/main/java/com/sammy/malum/client/screen/codex/ArcanaProgressionScreen.java @@ -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; } diff --git a/src/main/java/com/sammy/malum/client/screen/codex/VoidProgressionScreen.java b/src/main/java/com/sammy/malum/client/screen/codex/VoidProgressionScreen.java index ac1f64e66..a167e0db6 100644 --- a/src/main/java/com/sammy/malum/client/screen/codex/VoidProgressionScreen.java +++ b/src/main/java/com/sammy/malum/client/screen/codex/VoidProgressionScreen.java @@ -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; } diff --git a/src/main/java/com/sammy/malum/client/screen/codex/objects/ScreenOpenerObject.java b/src/main/java/com/sammy/malum/client/screen/codex/objects/ScreenOpenerObject.java index c8b76ffe1..de4baa345 100644 --- a/src/main/java/com/sammy/malum/client/screen/codex/objects/ScreenOpenerObject.java +++ b/src/main/java/com/sammy/malum/client/screen/codex/objects/ScreenOpenerObject.java @@ -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 extends IconObject { @@ -19,8 +18,5 @@ public ScreenOpenerObject(T screen, BookEntry 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; - } } } diff --git a/src/main/java/com/sammy/malum/common/block/blight/BlightedSoilBlock.java b/src/main/java/com/sammy/malum/common/block/blight/BlightedSoilBlock.java index 3310cfb9f..60b3ef27c 100644 --- a/src/main/java/com/sammy/malum/common/block/blight/BlightedSoilBlock.java +++ b/src/main/java/com/sammy/malum/common/block/blight/BlightedSoilBlock.java @@ -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; @@ -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) { diff --git a/src/main/java/com/sammy/malum/common/entity/bolt/AbstractBoltProjectileEntity.java b/src/main/java/com/sammy/malum/common/entity/bolt/AbstractBoltProjectileEntity.java index 31a1b52b4..b818ddc2e 100644 --- a/src/main/java/com/sammy/malum/common/entity/bolt/AbstractBoltProjectileEntity.java +++ b/src/main/java/com/sammy/malum/common/entity/bolt/AbstractBoltProjectileEntity.java @@ -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)) { @@ -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 diff --git a/src/main/java/com/sammy/malum/common/item/curiosities/weapons/staff/HexStaffItem.java b/src/main/java/com/sammy/malum/common/item/curiosities/weapons/staff/HexStaffItem.java index ba9775c2b..7b4453f92 100644 --- a/src/main/java/com/sammy/malum/common/item/curiosities/weapons/staff/HexStaffItem.java +++ b/src/main/java/com/sammy/malum/common/item/curiosities/weapons/staff/HexStaffItem.java @@ -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); 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 9e401c1be..c4c085235 100644 --- a/src/main/java/com/sammy/malum/core/events/RuntimeEvents.java +++ b/src/main/java/com/sammy/malum/core/events/RuntimeEvents.java @@ -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 {