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 9c28fcc18..05ef54838 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 @@ -66,7 +66,7 @@ public void setupObjects() { } bookObjects.add(bookObject); } - faceObject(bookObjects.get(0)); + faceObject(bookObjects.get(1)); } public abstract void openScreen(boolean ignoreNextMouseClick); 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 74ae73053..5a67dd483 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 @@ -90,6 +90,9 @@ public static void renderWavyIcon(ResourceLocation location, PoseStack stack, in } public static void renderWavyIcon(ResourceLocation location, PoseStack stack, int x, int y, int z) { + renderWavyIcon(location, stack, x, y, 0, 16, 16); + } + public static void renderWavyIcon(ResourceLocation location, PoseStack stack, int x, int y, int z, int textureWidth, int textureHeight) { ExtendedShaderInstance shaderInstance = (ExtendedShaderInstance) LodestoneShaderRegistry.DISTORTED_TEXTURE.getInstance().get(); shaderInstance.safeGetUniform("YFrequency").set(10f); shaderInstance.safeGetUniform("XFrequency").set(12f); @@ -108,12 +111,12 @@ public static void renderWavyIcon(ResourceLocation location, PoseStack stack, in RenderSystem.enableBlend(); RenderSystem.disableDepthTest(); RenderSystem.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); - renderTexture(location, stack, builder, x, y, 0, 0, 16, 16, 16, 16); + renderTexture(location, stack, builder, x, y, 0, 0, textureWidth, textureHeight); builder.setAlpha(0.1f); - renderTexture(location, stack, builder, x - 1, y, 0, 0, 16, 16, 16, 16); - renderTexture(location, stack, builder, x + 1, y, 0, 0, 16, 16, 16, 16); - renderTexture(location, stack, builder, x, y - 1, 0, 0, 16, 16, 16, 16); - renderTexture(location, stack, builder, x, y + 1, 0, 0, 16, 16, 16, 16); + renderTexture(location, stack, builder, x - 1, y, 0, 0, textureWidth, textureHeight); + renderTexture(location, stack, builder, x + 1, y, 0, 0, textureWidth, textureHeight); + renderTexture(location, stack, builder, x, y - 1, 0, 0, textureWidth, textureHeight); + renderTexture(location, stack, builder, x, y + 1, 0, 0, textureWidth, textureHeight); shaderInstance.setUniformDefaults(); RenderSystem.enableDepthTest(); RenderSystem.defaultBlendFunc(); @@ -128,6 +131,10 @@ public static void renderTexture(ResourceLocation texture, PoseStack poseStack, renderTexture(texture, poseStack, VFX_BUILDER, x, y, u, v, width, height, textureWidth, textureHeight); } + public static void renderTexture(ResourceLocation texture, PoseStack poseStack, VFXBuilders.ScreenVFXBuilder builder, int x, int y, float u, float v, int width, int height) { + renderTexture(texture, poseStack, builder, x, y, u, v, width, height, width, height); + } + public static void renderTexture(ResourceLocation texture, PoseStack poseStack, VFXBuilders.ScreenVFXBuilder builder, int x, int y, float u, float v, int width, int height, int textureWidth, int textureHeight) { builder.setPositionWithWidth(x, y, width, height) .setShaderTexture(texture) 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 23030f2b6..634e30b0a 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 @@ -121,10 +121,21 @@ public static void openCodexViaItem() { screen.playSweetenedSound(SoundRegistry.ARCANA_CODEX_OPEN, 1.25f); } + public static void openCodexViaTransition() { + getScreenInstance().openScreen(false); + screen.faceObject(screen.bookObjects.get(0)); + screen.playSound(SoundRegistry.ARCANA_TRANSITION_NORMAL, 1.25f, 1f); + } + public static void setupEntries() { ENTRIES.clear(); Item EMPTY = ItemStack.EMPTY.getItem(); + ENTRIES.add(new BookEntry( + "chronicles_of_the_void", 0, -1) + .setWidgetSupplier((s, e, x, y) -> new ScreenOpenerObject(s, e, x, y, VoidProgressionScreen::openCodexViaTransition, malumPath("textures/gui/book/icons/void_button.png"), 20, 20)) + .setWidgetConfig(w -> w.setStyle(BookWidgetStyle.DARK_GRAND_RUNEWOOD)) + ); ENTRIES.add(new BookEntry( "introduction", 0, 0) .setWidgetConfig(w -> w.setIcon(ENCYCLOPEDIA_ARCANA).setStyle(BookWidgetStyle.GILDED_RUNEWOOD)) @@ -137,7 +148,7 @@ public static void setupEntries() { ENTRIES.add(new BookEntry( "spirit_crystals", 0, 1) - .setWidgetSupplier((s, e, x, y) -> new IconObject(s, e, malumPath("textures/gui/book/icons/soul_shard.png"), x, y)) + .setWidgetSupplier((s, e, x, y) -> new IconObject(s, e, x, y, malumPath("textures/gui/book/icons/soul_shard.png"))) .setWidgetConfig(w -> w.setStyle(BookWidgetStyle.DARK_SMALL_RUNEWOOD)) .addPage(new HeadlineTextPage("spirit_crystals", "spirit_crystals.1")) .addPage(new TextPage("spirit_crystals.2")) diff --git a/src/main/java/com/sammy/malum/client/screen/codex/BookWidgetStyle.java b/src/main/java/com/sammy/malum/client/screen/codex/BookWidgetStyle.java index eec9e8c67..38674d784 100644 --- a/src/main/java/com/sammy/malum/client/screen/codex/BookWidgetStyle.java +++ b/src/main/java/com/sammy/malum/client/screen/codex/BookWidgetStyle.java @@ -4,45 +4,60 @@ import static com.sammy.malum.MalumMod.malumPath; -public record BookWidgetStyle(ResourceLocation frameTexture, ResourceLocation fillingTexture) { +public record BookWidgetStyle(ResourceLocation frameTexture, ResourceLocation fillingTexture, int textureWidth, int textureHeight) { + + public BookWidgetStyle(ResourceLocation frameTexture, ResourceLocation fillingTexture, int dimensions) { + this(frameTexture, fillingTexture, dimensions, dimensions); + } + public BookWidgetStyle(ResourceLocation frameTexture, ResourceLocation fillingTexture) { + this(frameTexture, fillingTexture, 32, 32); + } private static final ResourceLocation RUNEWOOD_FRAME = texturePath("runewood_frame"); private static final ResourceLocation GILDED_RUNEWOOD_FRAME = texturePath("runewood_frame_gilded"); private static final ResourceLocation SMALL_RUNEWOOD_FRAME = texturePath("runewood_frame_small"); private static final ResourceLocation TOTEMIC_RUNEWOOD_FRAME = texturePath("runewood_frame_totemic"); + private static final ResourceLocation GRAND_RUNEWOOD_FRAME = texturePath("runewood_frame_grand"); private static final ResourceLocation SOULWOOD_FRAME = texturePath("soulwood_frame"); private static final ResourceLocation GILDED_SOULWOOD_FRAME = texturePath("soulwood_frame_gilded"); private static final ResourceLocation SMALL_SOULWOOD_FRAME = texturePath("soulwood_frame_small"); private static final ResourceLocation TOTEMIC_SOULWOOD_FRAME = texturePath("soulwood_frame_totemic"); + private static final ResourceLocation GRAND_SOULWOOD_FRAME = texturePath("soulwood_frame_grand"); private static final ResourceLocation PAPER_FILLING = texturePath("paper_filling"); private static final ResourceLocation GILDED_PAPER_FILLING = texturePath("paper_filling_gilded"); private static final ResourceLocation SMALL_PAPER_FILLING = texturePath("paper_filling_small"); + private static final ResourceLocation GRAND_PAPER_FILLING = texturePath("paper_filling_grand"); private static final ResourceLocation DARK_FILLING = texturePath("dark_filling"); private static final ResourceLocation GILDED_DARK_FILLING = texturePath("dark_filling_gilded"); private static final ResourceLocation SMALL_DARK_FILLING = texturePath("dark_filling_small"); + private static final ResourceLocation GRAND_DARK_FILLING = texturePath("dark_filling_grand"); public static final BookWidgetStyle RUNEWOOD = new BookWidgetStyle(RUNEWOOD_FRAME, PAPER_FILLING); public static final BookWidgetStyle TOTEMIC_RUNEWOOD = new BookWidgetStyle(TOTEMIC_RUNEWOOD_FRAME, PAPER_FILLING); public static final BookWidgetStyle GILDED_RUNEWOOD = new BookWidgetStyle(GILDED_RUNEWOOD_FRAME, GILDED_PAPER_FILLING); public static final BookWidgetStyle SMALL_RUNEWOOD = new BookWidgetStyle(SMALL_RUNEWOOD_FRAME, SMALL_PAPER_FILLING); + public static final BookWidgetStyle GRAND_RUNEWOOD = new BookWidgetStyle(GRAND_RUNEWOOD_FRAME, GRAND_PAPER_FILLING, 40); public static final BookWidgetStyle DARK_RUNEWOOD = new BookWidgetStyle(RUNEWOOD_FRAME, DARK_FILLING); public static final BookWidgetStyle DARK_TOTEMIC_RUNEWOOD = new BookWidgetStyle(TOTEMIC_RUNEWOOD_FRAME, DARK_FILLING); public static final BookWidgetStyle DARK_GILDED_RUNEWOOD = new BookWidgetStyle(GILDED_RUNEWOOD_FRAME, GILDED_DARK_FILLING); public static final BookWidgetStyle DARK_SMALL_RUNEWOOD = new BookWidgetStyle(SMALL_RUNEWOOD_FRAME, SMALL_DARK_FILLING); + public static final BookWidgetStyle DARK_GRAND_RUNEWOOD = new BookWidgetStyle(GRAND_RUNEWOOD_FRAME, GRAND_DARK_FILLING, 40); public static final BookWidgetStyle SOULWOOD = new BookWidgetStyle(SOULWOOD_FRAME, PAPER_FILLING); public static final BookWidgetStyle TOTEMIC_SOULWOOD = new BookWidgetStyle(TOTEMIC_SOULWOOD_FRAME, PAPER_FILLING); public static final BookWidgetStyle GILDED_SOULWOOD = new BookWidgetStyle(GILDED_SOULWOOD_FRAME, GILDED_PAPER_FILLING); public static final BookWidgetStyle SMALL_SOULWOOD = new BookWidgetStyle(SMALL_SOULWOOD_FRAME, SMALL_PAPER_FILLING); + public static final BookWidgetStyle GRAND_SOULWOOD = new BookWidgetStyle(GRAND_SOULWOOD_FRAME, GRAND_PAPER_FILLING, 40); public static final BookWidgetStyle DARK_SOULWOOD = new BookWidgetStyle(SOULWOOD_FRAME, DARK_FILLING); public static final BookWidgetStyle DARK_TOTEMIC_SOULWOOD = new BookWidgetStyle(TOTEMIC_SOULWOOD_FRAME, DARK_FILLING); public static final BookWidgetStyle DARK_GILDED_SOULWOOD = new BookWidgetStyle(GILDED_SOULWOOD_FRAME, GILDED_DARK_FILLING); public static final BookWidgetStyle DARK_SMALL_SOULWOOD = new BookWidgetStyle(SMALL_SOULWOOD_FRAME, SMALL_DARK_FILLING); + public static final BookWidgetStyle DARK_GRAND_SOULWOOD = new BookWidgetStyle(GRAND_SOULWOOD_FRAME, GRAND_DARK_FILLING, 40); public static ResourceLocation texturePath(String name) { return malumPath("textures/gui/book/widgets/" + name + ".png"); 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 365d8a2de..a73759956 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 @@ -1,6 +1,7 @@ package com.sammy.malum.client.screen.codex; import com.mojang.blaze3d.vertex.PoseStack; +import com.sammy.malum.client.screen.codex.objects.*; import com.sammy.malum.common.events.SetupMalumCodexEntriesEvent; import com.sammy.malum.registry.common.SoundRegistry; import net.minecraft.client.Minecraft; @@ -55,7 +56,7 @@ public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float partia GL11.glDisable(GL_SCISSOR_TEST); renderTransparentTexture(FRAME_FADE_TEXTURE, poseStack, guiLeft, guiTop, 0, 0, bookWidth, bookHeight); - renderTexture(FRAME_TEXTURE, poseStack, guiLeft, guiTop, 1, 1, bookWidth, bookHeight); + renderTexture(FRAME_TEXTURE, poseStack, guiLeft, guiTop, 0, 0, bookWidth, bookHeight); lateEntryRender(guiGraphics, mouseX, mouseY, partialTicks); } @@ -105,93 +106,101 @@ public static VoidProgressionScreen getScreenInstance() { public static void openCodexViaItem() { getScreenInstance().openScreen(true); - setupEntries(); screen.playSweetenedSound(SoundRegistry.ARCANA_CODEX_OPEN, 1.25f); - screen.setupObjects(); + } + + public static void openCodexViaTransition() { + getScreenInstance().openScreen(false); + screen.faceObject(screen.bookObjects.get(0)); + screen.playSound(SoundRegistry.ARCANA_TRANSITION_EVIL, 1.25f, 1f); } public static void setupEntries() { VOID_ENTRIES.clear(); VOID_ENTRIES.add(new BookEntry( - "void.introduction", 0, -1) + "research_of_the_rejected", 0, -9) + .setWidgetSupplier((s, e, x, y) -> new ScreenOpenerObject(s, e, x, y, ArcanaProgressionScreen::openCodexViaTransition, malumPath("textures/gui/book/icons/arcana_button.png"), 20, 20)) + .setWidgetConfig(w -> w.setStyle(BookWidgetStyle.DARK_GRAND_SOULWOOD)) + ); + VOID_ENTRIES.add(new BookEntry( + "void.introduction", 0, -8) .setWidgetConfig(w -> w.setIcon(ENCYCLOPEDIA_ARCANA).setStyle(BookWidgetStyle.GILDED_SOULWOOD)) ); VOID_ENTRIES.add(new BookEntry( - "void.weeping_well", 0, 1) + "void.weeping_well", 0, -6) .setWidgetConfig(w -> w.setIcon(BLIGHTED_EARTH).setStyle(BookWidgetStyle.SOULWOOD)) ); VOID_ENTRIES.add(new BookEntry( - "void.null_slate", -2, 2) + "void.null_slate", -2, -5) .setWidgetConfig(w -> w.setIcon(NULL_SLATE).setStyle(BookWidgetStyle.SOULWOOD)) ); VOID_ENTRIES.add(new BookEntry( - "void.void_salts", -1, 3) + "void.void_salts", -1, -4) .setWidgetConfig(w -> w.setIcon(VOID_SALTS).setStyle(BookWidgetStyle.SOULWOOD)) ); VOID_ENTRIES.add(new BookEntry( - "void.auric_embers", 1, 3) + "void.auric_embers", 1, -4) .setWidgetConfig(w -> w.setIcon(AURIC_EMBERS).setStyle(BookWidgetStyle.SOULWOOD)) ); VOID_ENTRIES.add(new BookEntry( - "void.mnemotic_fragment", 2, 2) + "void.mnemotic_fragment", 2, -5) .setWidgetConfig(w -> w.setIcon(MNEMONIC_FRAGMENT).setStyle(BookWidgetStyle.SOULWOOD)) ); VOID_ENTRIES.add(new BookEntry( - "void.ring_of_growing_flesh", -3, 4) + "void.ring_of_growing_flesh", -3, -3) .setWidgetConfig(w -> w.setIcon(RING_OF_GROWING_FLESH).setStyle(BookWidgetStyle.SOULWOOD)) ); VOID_ENTRIES.add(new BookEntry( - "void.ring_of_gruesome_satiation", -4, 5) + "void.ring_of_gruesome_satiation", -4, -2) .setWidgetConfig(w -> w.setIcon(RING_OF_GRUESOME_SATIATION).setStyle(BookWidgetStyle.SOULWOOD)) ); VOID_ENTRIES.add(new BookEntry( - "void.necklace_of_the_watcher", -2, 5) + "void.necklace_of_the_watcher", -2, -2) .setWidgetConfig(w -> w.setIcon(NECKLACE_OF_THE_WATCHER).setStyle(BookWidgetStyle.SOULWOOD)) ); VOID_ENTRIES.add(new BookEntry( - "void.necklace_of_the_hidden_blade", -3, 6) + "void.necklace_of_the_hidden_blade", -3, -1) .setWidgetConfig(w -> w.setIcon(NECKLACE_OF_THE_HIDDEN_BLADE).setStyle(BookWidgetStyle.SOULWOOD)) ); VOID_ENTRIES.add(new BookEntry( - "void.soul_stained_steel_staff", 3, 4) + "void.soul_stained_steel_staff", 3, -3) .setWidgetConfig(w -> w.setIcon(SOUL_STAINED_STEEL_STAFF).setStyle(BookWidgetStyle.SOULWOOD)) ); VOID_ENTRIES.add(new BookEntry( - "void.something2", 4, 5) + "void.something2", 4, -2) .setWidgetConfig(w -> w.setIcon(BARRIER).setStyle(BookWidgetStyle.SOULWOOD)) ); VOID_ENTRIES.add(new BookEntry( - "void.something3", 2, 5) + "void.something3", 2, -2) .setWidgetConfig(w -> w.setIcon(BARRIER).setStyle(BookWidgetStyle.SOULWOOD)) ); VOID_ENTRIES.add(new BookEntry( - "void.something4", 3, 6) + "void.something4", 3, -1) .setWidgetConfig(w -> w.setIcon(BARRIER).setStyle(BookWidgetStyle.SOULWOOD)) ); - VOID_ENTRIES.add(new BookEntry( - "void.anomalous_design", 0, 6) + "void.anomalous_design", 0, -1) .setWidgetConfig(w -> w.setIcon(ANOMALOUS_DESIGN).setStyle(BookWidgetStyle.SOULWOOD)) ); VOID_ENTRIES.add(new BookEntry( - "void.fused_consciousness", 0, 7) + "void.fused_consciousness", 0, 0) .setWidgetConfig(w -> w.setIcon(FUSED_CONSCIOUSNESS).setStyle(BookWidgetStyle.GILDED_SOULWOOD)) ); VOID_ENTRIES.add(new BookEntry( - "void.belt_of_the_limitless", -2, 8) + "void.belt_of_the_limitless", -2, 1) .setWidgetConfig(w -> w.setIcon(BELT_OF_THE_LIMITLESS).setStyle(BookWidgetStyle.SOULWOOD)) ); VOID_ENTRIES.add(new BookEntry( - "void.stellar_mechanism", 2, 8) + "void.stellar_mechanism", 2, 1) .setWidgetConfig(w -> w.setIcon(STELLAR_MECHANISM).setStyle(BookWidgetStyle.SOULWOOD)) ); VOID_ENTRIES.add(new BookEntry( - "void.staff_of_the_auric_flame", 0, 9) + "void.staff_of_the_auric_flame", 0, 2) .setWidgetConfig(w -> w.setIcon(STAFF_OF_THE_AURIC_FLAME).setStyle(BookWidgetStyle.SOULWOOD)) ); } diff --git a/src/main/java/com/sammy/malum/client/screen/codex/objects/EntryObject.java b/src/main/java/com/sammy/malum/client/screen/codex/objects/EntryObject.java index 6cd19550d..4d5672014 100644 --- a/src/main/java/com/sammy/malum/client/screen/codex/objects/EntryObject.java +++ b/src/main/java/com/sammy/malum/client/screen/codex/objects/EntryObject.java @@ -32,13 +32,12 @@ public void click(float xOffset, float yOffset, double mouseX, double mouseY) { @Override public void render(Minecraft minecraft, GuiGraphics guiGraphics, float xOffset, float yOffset, int mouseX, int mouseY, float partialTicks) { - int posX = offsetPosX(xOffset); - int posY = offsetPosY(yOffset); + int posX = offsetPosX(xOffset) - (style.textureWidth()-32)/2; + int posY = offsetPosY(yOffset) - (style.textureHeight()-32)/2; final PoseStack poseStack = guiGraphics.pose(); - final int offset = getFrameOffset(); renderTransparentTexture(WIDGET_FADE_TEXTURE, poseStack, posX - 13, posY - 13, 0, 0, 58, 58); - renderTexture(style.frameTexture(), poseStack, posX - offset, posY - offset, 0, 0, width, height); - renderTexture(style.fillingTexture(), poseStack, posX - offset, posY - offset, 0, 0, width, height); + renderTexture(style.frameTexture(), poseStack, posX, posY, 0, 0, style.textureWidth(), style.textureHeight()); + renderTexture(style.fillingTexture(), poseStack, posX, posY, 0, 0, style.textureWidth(), style.textureHeight()); if (iconStack != null) { guiGraphics.renderItem(iconStack, posX + 8, posY + 8); } diff --git a/src/main/java/com/sammy/malum/client/screen/codex/objects/IconObject.java b/src/main/java/com/sammy/malum/client/screen/codex/objects/IconObject.java index 874325d25..ee613b68b 100644 --- a/src/main/java/com/sammy/malum/client/screen/codex/objects/IconObject.java +++ b/src/main/java/com/sammy/malum/client/screen/codex/objects/IconObject.java @@ -14,15 +14,22 @@ public class IconObject extends EntryObject { public final ResourceLocation textureLocation; + public final int textureWidth; + public final int textureHeight; - public IconObject(AbstractProgressionCodexScreen screen, BookEntry entry, ResourceLocation textureLocation, int posX, int posY) { + public IconObject(AbstractProgressionCodexScreen screen, BookEntry entry, int posX, int posY, ResourceLocation textureLocation) { + this(screen, entry, posX, posY, textureLocation, 16, 16); + } + public IconObject(AbstractProgressionCodexScreen screen, BookEntry entry, int posX, int posY, ResourceLocation textureLocation, int textureWidth, int textureHeight) { super(screen, entry, posX, posY); this.textureLocation = textureLocation; + this.textureWidth = textureWidth; + this.textureHeight = textureHeight; } @Override public void render(Minecraft minecraft, GuiGraphics guiGraphics, float xOffset, float yOffset, int mouseX, int mouseY, float partialTicks) { super.render(minecraft, guiGraphics, xOffset, yOffset, mouseX, mouseY, partialTicks); - renderWavyIcon(textureLocation, guiGraphics.pose(), offsetPosX(xOffset) + 8, offsetPosY(yOffset) + 8); + renderWavyIcon(textureLocation, guiGraphics.pose(), offsetPosX(xOffset) + 8 - (style.textureWidth()-32)/4, offsetPosY(yOffset) + 8 - (style.textureHeight()-32)/4, 0, textureWidth, textureHeight); } } \ No newline at end of file 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 new file mode 100644 index 000000000..9132323f9 --- /dev/null +++ b/src/main/java/com/sammy/malum/client/screen/codex/objects/ScreenOpenerObject.java @@ -0,0 +1,22 @@ +package com.sammy.malum.client.screen.codex.objects; + +import com.sammy.malum.client.screen.codex.*; +import net.minecraft.resources.*; + +public class ScreenOpenerObject extends IconObject{ + private final Runnable screenOpener; + public ScreenOpenerObject(AbstractProgressionCodexScreen screen, BookEntry entry, int posX, int posY, Runnable screenOpener, ResourceLocation textureLocation) { + super(screen, entry, posX, posY, textureLocation); + this.screenOpener = screenOpener; + } + + public ScreenOpenerObject(AbstractProgressionCodexScreen screen, BookEntry entry, int posX, int posY, Runnable screenOpener, ResourceLocation textureLocation, int textureWidth, int textureHeight) { + super(screen, entry, posX, posY, textureLocation, textureWidth, textureHeight); + this.screenOpener = screenOpener; + } + + @Override + public void click(float xOffset, float yOffset, double mouseX, double mouseY) { + screenOpener.run(); + } +} diff --git a/src/main/java/com/sammy/malum/common/entity/bolt/AuricFlameBoltEntity.java b/src/main/java/com/sammy/malum/common/entity/bolt/AuricFlameBoltEntity.java index cb93ae9ab..efc17d8f0 100644 --- a/src/main/java/com/sammy/malum/common/entity/bolt/AuricFlameBoltEntity.java +++ b/src/main/java/com/sammy/malum/common/entity/bolt/AuricFlameBoltEntity.java @@ -7,22 +7,18 @@ import com.sammy.malum.registry.common.item.*; import com.sammy.malum.visual_effects.*; import com.sammy.malum.visual_effects.networked.*; -import net.minecraft.network.chat.*; import net.minecraft.sounds.*; import net.minecraft.util.*; import net.minecraft.world.entity.*; -import net.minecraft.world.entity.player.*; import net.minecraft.world.entity.projectile.*; import net.minecraft.world.item.*; import net.minecraft.world.level.*; import net.minecraft.world.phys.*; import net.minecraftforge.api.distmarker.*; -import team.lodestar.lodestone.helpers.*; 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.spin.*; import team.lodestar.lodestone.systems.particle.render_types.*; import java.util.*; @@ -83,19 +79,17 @@ public void tick() { } Vec3 newMotion = diff.normalize().scale(speed); final double dot = motion.normalize().dot(diff.normalize()); - if (dot < 0.9f) { + if (dot < 0.8f) { return; } if (newMotion.length() == 0) { newMotion = newMotion.add(0.01, 0, 0); } - float angleScalar = (float) ((dot - 0.9f) * 10f); - float distanceScalar = (float) (0.2f + 1f - Math.min(25f, diff.length()) / 25f); - float horizontalFactor = 0.4f * distanceScalar * angleScalar; - float verticalFactor = 0.6f * distanceScalar * angleScalar; - final double x = Mth.lerp(horizontalFactor, motion.x, newMotion.x); - final double y = Mth.lerp(verticalFactor, motion.y, newMotion.y); - final double z = Mth.lerp(horizontalFactor, motion.z, newMotion.z); + float angleScalar = (float) ((dot - 0.8f) * 5f); + float factor = 0.15f * angleScalar; + final double x = Mth.lerp(factor, motion.x, newMotion.x); + final double y = Mth.lerp(factor, motion.y, newMotion.y); + final double z = Mth.lerp(factor, motion.z, newMotion.z); setDeltaMovement(new Vec3(x, y, z)); } } @@ -133,12 +127,12 @@ public void spawnParticles() { lightSpecs.getBloomBuilder().multiplyLifetime(1.25f).setMotion(norm); lightSpecs.spawnParticles(); final Consumer behavior = p -> p.setParticleMotion(p.getParticleSpeed().scale(0.98f)); - SparkParticleBuilder.create(ParticleRegistry.SLASH) + SparkParticleBuilder.create(ParticleRegistry.BOLT) .setTransparencyData(GenericParticleData.create(0.5f * scalar, 0.2f * scalar, 0f).setEasing(Easing.SINE_IN_OUT, Easing.SINE_IN).build()) - .setScaleData(GenericParticleData.create(0.5f * scalar).build()) + .setScaleData(GenericParticleData.create(0.75f * scalar, 0.1f * scalar).setEasing(Easing.QUAD_OUT).build()) .setLengthData(GenericParticleData.create(2.4f * Math.min(1f, scalar*2), 0.2f * Math.min(1f, scalar*2)).setEasing(Easing.CUBIC_IN).build()) .setColorData(level.getGameTime() % 6L == 0 ? AuricFlameStaffItem.REVERSE_AURIC_COLOR_DATA : AuricFlameStaffItem.AURIC_COLOR_DATA) - .setLifetime(Math.min(6 + age * 3, 30)) + .setLifetime(Math.min(6 + age * 3, 45)) .setMotion(norm) .enableNoClip() .enableForcedSpawn() diff --git a/src/main/java/com/sammy/malum/common/item/EncyclopediaArcanaItem.java b/src/main/java/com/sammy/malum/common/item/EncyclopediaArcanaItem.java index cb4402c17..0c084fae5 100644 --- a/src/main/java/com/sammy/malum/common/item/EncyclopediaArcanaItem.java +++ b/src/main/java/com/sammy/malum/common/item/EncyclopediaArcanaItem.java @@ -17,13 +17,8 @@ public EncyclopediaArcanaItem(Properties properties) { @Override public InteractionResultHolder use(Level level, Player player, InteractionHand hand) { - boolean isNearWeepingWell = TouchOfDarknessHandler.checkForWeepingWell(player).isPresent(); if (level.isClientSide) { - if (isNearWeepingWell) { - VoidProgressionScreen.openCodexViaItem(); - } else { - ArcanaProgressionScreen.openCodexViaItem(); - } + ArcanaProgressionScreen.openCodexViaItem(); player.swing(hand); return InteractionResultHolder.success(player.getItemInHand(hand)); } diff --git a/src/main/java/com/sammy/malum/common/item/curiosities/weapons/staff/AuricFlameStaffItem.java b/src/main/java/com/sammy/malum/common/item/curiosities/weapons/staff/AuricFlameStaffItem.java index 3908df631..ae149329c 100644 --- a/src/main/java/com/sammy/malum/common/item/curiosities/weapons/staff/AuricFlameStaffItem.java +++ b/src/main/java/com/sammy/malum/common/item/curiosities/weapons/staff/AuricFlameStaffItem.java @@ -65,9 +65,9 @@ public int getProjectileCount(Level level, LivingEntity livingEntity, float pct) @Override public void fireProjectile(LivingEntity player, ItemStack stack, Level level, InteractionHand hand, float chargePercentage, int count) { final float ceil = (float) Math.ceil(count / 2f); - float spread = count > 0 ? ceil * 0.2f * (count % 2L == 0 ? 1 : -1) : 0f; + float spread = count > 0 ? ceil * 0.075f * (count % 2L == 0 ? 1 : -1) : 0f; float pitchOffset = 6f - (3f + ceil); - int spawnDelay = (int) (ceil * 4); + int spawnDelay = count * 3; float velocity = 2f; float magicDamage = (float) player.getAttributes().getValue(LodestoneAttributeRegistry.MAGIC_DAMAGE.get()); Vec3 pos = getProjectileSpawnPos(player, hand, 0.5f, 0.5f); 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 91f231eb0..cdb15a518 100644 --- a/src/main/java/com/sammy/malum/registry/client/ParticleRegistry.java +++ b/src/main/java/com/sammy/malum/registry/client/ParticleRegistry.java @@ -27,7 +27,7 @@ public class ParticleRegistry { public static RegistryObject STRANGE_SMOKE = PARTICLES.register("strange_smoke", LodestoneParticleType::new); public static RegistryObject ROUND_SPARK = PARTICLES.register("round_spark", LodestoneSparkParticleType::new); - public static RegistryObject SLASH = PARTICLES.register("slash", LodestoneSparkParticleType::new); + public static RegistryObject BOLT = PARTICLES.register("bolt", LodestoneSparkParticleType::new); public static RegistryObject RITUAL_CIRCLE = PARTICLES.register("ritual_circle", LodestoneDirectionalParticleType::new); public static RegistryObject RITUAL_CIRCLE_WISP = PARTICLES.register("ritual_circle_wisp", LodestoneDirectionalParticleType::new); @@ -51,7 +51,7 @@ public static void registerParticleFactory(RegisterParticleProvidersEvent event) Minecraft.getInstance().particleEngine.register(STAR.get(), LodestoneParticleType.Factory::new); Minecraft.getInstance().particleEngine.register(ROUND_SPARK.get(), LodestoneSparkParticleType.Factory::new); - Minecraft.getInstance().particleEngine.register(SLASH.get(), LodestoneSparkParticleType.Factory::new); + Minecraft.getInstance().particleEngine.register(BOLT.get(), LodestoneSparkParticleType.Factory::new); Minecraft.getInstance().particleEngine.register(RITUAL_CIRCLE.get(), LodestoneDirectionalParticleType.Factory::new); Minecraft.getInstance().particleEngine.register(RITUAL_CIRCLE_WISP.get(), LodestoneDirectionalParticleType.Factory::new); diff --git a/src/main/resources/assets/malum/particles/bolt.json b/src/main/resources/assets/malum/particles/bolt.json new file mode 100644 index 000000000..ae3e4ade0 --- /dev/null +++ b/src/main/resources/assets/malum/particles/bolt.json @@ -0,0 +1,5 @@ +{ + "textures": [ + "malum:bolt" + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/malum/particles/slash.json b/src/main/resources/assets/malum/particles/slash.json deleted file mode 100644 index 1f99ad8b9..000000000 --- a/src/main/resources/assets/malum/particles/slash.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "textures": [ - "malum:slash0", - "malum:slash1", - "malum:slash2", - "malum:slash2" - ] -} \ No newline at end of file diff --git a/src/main/resources/assets/malum/textures/gui/book/icons/arcana_button.png b/src/main/resources/assets/malum/textures/gui/book/icons/arcana_button.png new file mode 100644 index 000000000..c451c301b Binary files /dev/null and b/src/main/resources/assets/malum/textures/gui/book/icons/arcana_button.png differ diff --git a/src/main/resources/assets/malum/textures/gui/book/icons/soul_shard.png b/src/main/resources/assets/malum/textures/gui/book/icons/soul_shard.png index 35925b7ff..870df947e 100644 Binary files a/src/main/resources/assets/malum/textures/gui/book/icons/soul_shard.png and b/src/main/resources/assets/malum/textures/gui/book/icons/soul_shard.png differ diff --git a/src/main/resources/assets/malum/textures/gui/book/icons/void_button.png b/src/main/resources/assets/malum/textures/gui/book/icons/void_button.png new file mode 100644 index 000000000..76eacd178 Binary files /dev/null and b/src/main/resources/assets/malum/textures/gui/book/icons/void_button.png differ diff --git a/src/main/resources/assets/malum/textures/gui/book/widgets/dark_filling_grand.png b/src/main/resources/assets/malum/textures/gui/book/widgets/dark_filling_grand.png new file mode 100644 index 000000000..0a0999978 Binary files /dev/null and b/src/main/resources/assets/malum/textures/gui/book/widgets/dark_filling_grand.png differ diff --git a/src/main/resources/assets/malum/textures/gui/book/widgets/paper_filling_grand.png b/src/main/resources/assets/malum/textures/gui/book/widgets/paper_filling_grand.png new file mode 100644 index 000000000..12739da96 Binary files /dev/null and b/src/main/resources/assets/malum/textures/gui/book/widgets/paper_filling_grand.png differ diff --git a/src/main/resources/assets/malum/textures/gui/book/widgets/runewood_frame_grand.png b/src/main/resources/assets/malum/textures/gui/book/widgets/runewood_frame_grand.png new file mode 100644 index 000000000..e715e37ee Binary files /dev/null and b/src/main/resources/assets/malum/textures/gui/book/widgets/runewood_frame_grand.png differ diff --git a/src/main/resources/assets/malum/textures/gui/book/widgets/soulwood_frame_grand.png b/src/main/resources/assets/malum/textures/gui/book/widgets/soulwood_frame_grand.png new file mode 100644 index 000000000..4d910963b Binary files /dev/null and b/src/main/resources/assets/malum/textures/gui/book/widgets/soulwood_frame_grand.png differ diff --git a/src/main/resources/assets/malum/textures/item/encyclopedia_arcana.png b/src/main/resources/assets/malum/textures/item/encyclopedia_arcana.png index f96c8d088..a2d6cfa99 100644 Binary files a/src/main/resources/assets/malum/textures/item/encyclopedia_arcana.png and b/src/main/resources/assets/malum/textures/item/encyclopedia_arcana.png differ diff --git a/src/main/resources/assets/malum/textures/particle/bolt.png b/src/main/resources/assets/malum/textures/particle/bolt.png new file mode 100644 index 000000000..1cfbaaaa8 Binary files /dev/null and b/src/main/resources/assets/malum/textures/particle/bolt.png differ diff --git a/src/main/resources/assets/malum/textures/particle/slash0.png b/src/main/resources/assets/malum/textures/particle/slash0.png deleted file mode 100644 index db47958ef..000000000 Binary files a/src/main/resources/assets/malum/textures/particle/slash0.png and /dev/null differ diff --git a/src/main/resources/assets/malum/textures/particle/slash1.png b/src/main/resources/assets/malum/textures/particle/slash1.png deleted file mode 100644 index 6e9761727..000000000 Binary files a/src/main/resources/assets/malum/textures/particle/slash1.png and /dev/null differ diff --git a/src/main/resources/assets/malum/textures/particle/slash2.png b/src/main/resources/assets/malum/textures/particle/slash2.png deleted file mode 100644 index 16af6f74a..000000000 Binary files a/src/main/resources/assets/malum/textures/particle/slash2.png and /dev/null differ