Skip to content

Commit 7624019

Browse files
authored
Merge branch 'SammySemicolon:1.21.1' into 1.21.1
2 parents 1686bfe + 03b743a commit 7624019

File tree

30 files changed

+260
-72
lines changed

30 files changed

+260
-72
lines changed

changelogs/1.8.2.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
# Tweaks
22
- The healing rite now only triggers if the healing would actually have an effect, bless thy ears
33
- Spellwoven Sprites now break blocks as if the player did it, this fires the BlockDropsEvent with the breaker being listed as the player, hopefully allowing for better compatibility with any loot modifying effects
4+
- Updated and exposed to the config the transparency of the malignant scarf in first person
45

56
# Curio Changes
67

78
Belt of the Prospector
89
- Grants a 50% chance to gain Avarice when collecting valuables
910
- Avarice increases fortune chance by 10%, up to 100%
1011
- No longer shields valuables from explosions
12+
- This behavior will be moved to a different system
13+
- Entry updated accordingly
1114

1215
# Geas Changes
1316

@@ -36,4 +39,5 @@ Pact of the Pyromaniac
3639
- Updated some Brilliance textures
3740

3841
# Bugfixes
42+
- Fixed some substantial lag that appears due to the new weeping well renderer on some machines
3943
- Fixed some render ordering issues with Wind Tunnels

src/generated/resources/assets/malum/lang/en_us.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,6 +1151,7 @@
11511151
"malum.gui.book.entry.page.headline.basic_artifice.wavemaker": "Wavemaker",
11521152
"malum.gui.book.entry.page.headline.belt_of_the_magebane": "Belt of the Magebane",
11531153
"malum.gui.book.entry.page.headline.belt_of_the_prospector": "Belt of the Prospector",
1154+
"malum.gui.book.entry.page.headline.belt_of_the_prospector.avarice": "Avarice",
11541155
"malum.gui.book.entry.page.headline.belt_of_the_prospector.ring_of_the_demolitionist": "Ring of the Demolitionist",
11551156
"malum.gui.book.entry.page.headline.belt_of_the_prospector.ring_of_the_hoarder": "Ring of the Hoarder",
11561157
"malum.gui.book.entry.page.headline.belt_of_the_starved": "Belt of the Starved",
@@ -1458,7 +1459,9 @@
14581459
"malum.gui.book.entry.page.text.basic_artifice.wavemaker.1": "Earthen seeks to stand, to stay. Given a signal or lack thereof, this acts like a clock, emitting the inverse of the input every so often on a steady rhythm, and emitting the input the rest of the time.",
14591460
"malum.gui.book.entry.page.text.belt_of_the_magebane.1": "The Belt of the Magebane is a simple innovation, but a dangerously effective one. Normally, after being struck by any attack, soul ward will not recover until a long moment after. That moment of downtime has proven itself detrimental far too frequently. But that ends now.",
14601461
"malum.gui.book.entry.page.text.belt_of_the_magebane.2": "While worn, the belt provides a substantial bonus to soul ward recovery rate, while also improving capacity slightly. Furthermore, the belt will absorb the arcane essence of any instance of magical damage that strikes its bearer, converting that repurposed energy into immediate recovery of soul ward.",
1461-
"malum.gui.book.entry.page.text.belt_of_the_prospector.1": "To fuel my various magics and other goals I more often than not find myself needing various earthen treasures. By unearthing said treasures, this belt will temporarily enable a benefit similar to Fortune. Additionally, explosions $idirectly/$ caused by me will break blocks as if using Fortune III, plus the bonus.",
1462+
"malum.gui.book.entry.page.text.belt_of_the_prospector.1": "To fuel my various magics and other goals I more often than not find myself needing various earthen treasures. Through enchanting - specifically through Fortune - I've been able to better suit my tools for extracting multitudes of resource at a time. Within this entry I will detail how Spirit Arcana can be utilized in a similar manner.",
1463+
"malum.gui.book.entry.page.text.belt_of_the_prospector.2": "When Avarice is successfully channeled through a tool with a submaximal Fortune enchantment, the applied bonus will be raised as if Fortune was at it's maximum level. Similarly, The Belt of the Prospector will bless any explosions $iI/$ create with Fortune III, plus the bonus from Avarice.",
1464+
"malum.gui.book.entry.page.text.belt_of_the_prospector.avarice.1": "While wearing the Belt of the Prospector, any valuable resources I extract will carry an imbued intent, an overflowing Avarice. Upon collection of such intent, the carried Avarice is temporarily inscribed onto my soul. Each amplitude of Avarice enables an added One Tenth chance for an additional level of Fortune when breaking blocks.",
14621465
"malum.gui.book.entry.page.text.belt_of_the_prospector.ring_of_the_demolitionist.1": "If raw explosive power is not sufficient, you simply aren't using enough of it. This ring amplifies explosions, mitigating that issue.",
14631466
"malum.gui.book.entry.page.text.belt_of_the_prospector.ring_of_the_hoarder.1": "Explosions are chaotic, and messy, inherently. This is hardly a problem, when I want to cause such rampant destruction to collect resources, but collecting the items is a burden. This ring entangles the explosion with my soul, causing the debris and loot to appear at my location.",
14641467
"malum.gui.book.entry.page.text.belt_of_the_starved.1": "The arcana I collect occasionally have scraps of wishes and desires woven in. Often, given the base nature of what I reap, this comes in the form of hunger, lust, or petty grudges. All of these impurities can be catalyzed into Gluttony, an stacking amplifier towards magic damage.",
@@ -2206,7 +2209,7 @@
22062209
"malum.gui.geas.pact_of_the_berserker.tooltip": "Your pain, their pain",
22072210
"malum.gui.geas.pact_of_the_blastweaver": "Pact Of The Blastweaver",
22082211
"malum.gui.geas.pact_of_the_blastweaver.cons": "Your greed exposes you to your own man-made ruin.\n -Avarice increases incoming explosive damage",
2209-
"malum.gui.geas.pact_of_the_blastweaver.pros": "$m0.6/$Greed and Haste, fueled by Kinetic Impact.\n -Explosions are greatly empowered and grant Avarice upon detonation\n -Avarice gradually improves Fortune Chance\n -Avarice provides additional benefits to Movement Speed, Attack Speed and Mining Speed, up to a Fifty Percent increase",
2212+
"malum.gui.geas.pact_of_the_blastweaver.pros": "$m0.6/$Greed and Haste, fueled by Kinetic Impact.\n -Explosions are greatly empowered and grant Avarice upon detonation\n -Avarice improves Fortune Chance\n -Avarice additionally further empowers explosions",
22102213
"malum.gui.geas.pact_of_the_blastweaver.tooltip": "Draw power from recklessness",
22112214
"malum.gui.geas.pact_of_the_cloudskipper": "Pact Of The Cloudskipper",
22122215
"malum.gui.geas.pact_of_the_cloudskipper.cons": "That which you rely on shall eventually crush you.\n -Fall Damage Taken is Doubled",
@@ -2230,7 +2233,7 @@
22302233
"malum.gui.geas.pact_of_the_lifeweaver.tooltip": "Weave your life into miracles",
22312234
"malum.gui.geas.pact_of_the_lone_druid": "Pact Of The Lone Druid",
22322235
"malum.gui.geas.pact_of_the_lone_druid.cons": "To be unburdened is to cull all shackles\n -Wearing any armour shackles you, damaging your soul",
2233-
"malum.gui.geas.pact_of_the_lone_druid.pros": "$m0.7/$To be complete is to be unburdened.\n -Each empty armour slot grants four Armor and two Armor Toughness\n -Each empty armour slot increases Healing Received by One Fourth",
2236+
"malum.gui.geas.pact_of_the_lone_druid.pros": "$m0.7/$To be complete is to be unburdened.\n -Each empty armour slot grants five points of Armor and two points of Armor Toughness\n -Each empty armour slot increases Healing Received by One Fourth",
22342237
"malum.gui.geas.pact_of_the_lone_druid.tooltip": "Shed your second skin",
22352238
"malum.gui.geas.pact_of_the_parasite": "Pact Of The Parasite",
22362239
"malum.gui.geas.pact_of_the_parasite.cons": "Your fragility is still very much real.\n -Reduces Healing Received by Four Tenths",
@@ -2414,6 +2417,8 @@
24142417
"malum.subtitle.arcane_rock_place": "Block placed",
24152418
"malum.subtitle.arcane_rock_step": "Footsteps",
24162419
"malum.subtitle.arcane_whispers": "Arcane whispers",
2420+
"malum.subtitle.avarice_collected": "Avarice collected",
2421+
"malum.subtitle.avarice_grants_fortune": "Avarice grants fortune",
24172422
"malum.subtitle.blazing_quartz_block_break": "Block broken",
24182423
"malum.subtitle.blazing_quartz_block_fall": "Blazing quartz block fall",
24192424
"malum.subtitle.blazing_quartz_block_hit": "Block breaking",

src/generated/resources/assets/malum/sounds.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,24 @@
364364
],
365365
"subtitle": "malum.subtitle.arcane_whispers"
366366
},
367+
"avarice_collected": {
368+
"sounds": [
369+
"malum:curiosities/avarice/collect1",
370+
"malum:curiosities/avarice/collect2",
371+
"malum:curiosities/avarice/collect3",
372+
"malum:curiosities/avarice/collect4"
373+
],
374+
"subtitle": "malum.subtitle.avarice_collected"
375+
},
376+
"avarice_grants_fortune": {
377+
"sounds": [
378+
"malum:curiosities/avarice/fortune1",
379+
"malum:curiosities/avarice/fortune2",
380+
"malum:curiosities/avarice/fortune3",
381+
"malum:curiosities/avarice/fortune4"
382+
],
383+
"subtitle": "malum.subtitle.avarice_grants_fortune"
384+
},
367385
"blazing_quartz_block_break": {
368386
"sounds": [
369387
"malum:blocks/gemstone/break1",

src/main/java/com/sammy/malum/client/renderer/renderpass/ParallelWorldRenderer.java

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
package com.sammy.malum.client.renderer.renderpass;
22

33
import com.mojang.blaze3d.pipeline.RenderTarget;
4+
import com.mojang.blaze3d.pipeline.TextureTarget;
45
import com.mojang.blaze3d.systems.RenderSystem;
56
import com.mojang.blaze3d.vertex.*;
67
import com.mojang.math.*;
8+
import com.sammy.malum.config.ClientConfig;
79
import com.sammy.malum.registry.client.*;
10+
import com.sammy.malum.registry.common.MalumAttachmentTypes;
811
import dev.kosmx.playerAnim.core.util.*;
912
import net.minecraft.client.Camera;
1013
import net.minecraft.client.DeltaTracker;
1114
import net.minecraft.client.Minecraft;
15+
import net.minecraft.client.player.LocalPlayer;
1216
import net.minecraft.client.renderer.*;
1317
import net.minecraft.util.*;
1418
import org.joml.*;
@@ -24,7 +28,7 @@
2428

2529
public class ParallelWorldRenderer extends BeforeLevelRenderPass {
2630
public static ParallelWorldRenderer INSTANCE;
27-
private final RenderTarget target = TextureHelper.generateTextureTarget(true);
31+
private final RenderTarget target = new TextureTarget(Minecraft.getInstance().getWindow().getWidth()/2, Minecraft.getInstance().getWindow().getHeight()/2, true, Minecraft.ON_OSX);
2832
private static final RenderStateShard.OutputStateShard outputState = StateShardHelper.createOutputState("parallelWorld", () -> INSTANCE.target.bindWrite(false));
2933

3034
public ParallelWorldRenderer() {
@@ -106,7 +110,17 @@ public void render(DeltaTracker deltaTracker, Camera camera, GameRenderer gameRe
106110

107111
@Override
108112
public boolean shouldRender(DeltaTracker deltaTracker, Camera camera, GameRenderer gameRenderer, Matrix4f matrix4f, Matrix4f matrix4f1) {
109-
return true;
113+
if (!ClientConfig.PARALLEL_WORLD.getConfigValue()) {
114+
return false;
115+
}
116+
var player = Minecraft.getInstance().player;
117+
if (player == null) {
118+
return false;
119+
}
120+
if (player.hasData(MalumAttachmentTypes.WEEPING_WELL_INFO)) {
121+
return player.getData(MalumAttachmentTypes.WEEPING_WELL_INFO).isNearWeepingWell;
122+
}
123+
return false;
110124
}
111125

112126
@Override

src/main/java/com/sammy/malum/client/scarf/ScarfRenderHandler.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.sammy.malum.client.scarf;
22

33
import com.mojang.blaze3d.vertex.*;
4+
import com.sammy.malum.config.ClientConfig;
45
import net.minecraft.client.*;
56
import net.minecraft.client.renderer.*;
67
import net.minecraft.core.*;
@@ -129,21 +130,24 @@ public ScarfRenderData setAlpha(float alpha) {
129130
}
130131

131132
public void render(LivingEntity entity, float partialTicks) {
132-
BlockPos blockpos = entity.blockPosition().above(2);
133133
var minecraft = Minecraft.getInstance();
134-
int light = entity.level().hasChunkAt(blockpos) ? LevelRenderer.getLightColor(entity.level(), blockpos) : 0;
135-
var renderType = LodestoneRenderTypes.TEXTURE_FADE.apply(token);
136-
var builder = VFXBuilders.createWorld().setRenderType(renderType).setLight(light).setAlpha(alpha);
137-
var scarfStart = getScarfStart(entity, partialTicks);
138-
float alpha = 1f;
134+
float alpha = this.alpha;
139135
if (entity.equals(minecraft.cameraEntity)) {
140136
if (minecraft.options.getCameraType().isFirstPerson()) {
141-
alpha = 0.75f;
137+
alpha *= ClientConfig.SCARF_OPACITY.getConfigValue();
142138
}
143139
}
140+
if (alpha <= 0) {
141+
return;
142+
}
143+
var blockpos = entity.blockPosition().above(2);
144+
int light = entity.level().hasChunkAt(blockpos) ? LevelRenderer.getLightColor(entity.level(), blockpos) : 0;
145+
var renderType = LodestoneRenderTypes.TEXTURE_FADE.apply(token);
146+
var builder = VFXBuilders.createWorld().setRenderType(renderType).setLight(light).setAlpha(alpha);
147+
var scarfStart = getScarfStart(entity, partialTicks);
144148
points.setOrigin(scarfStart);
145149
//TODO: actually giving it the partial tick makes it jitter when the player is stationary, but not doing so makes it jitter when the player is moving... for whatever reason
146-
builder.setAlpha(alpha).usePartialTicks(0).renderTrail(points,
150+
builder.usePartialTicks(0).renderTrail(points,
147151
f -> Mth.lerp(f, endingScale, scale),
148152
f -> builder.setColor(ColorHelper.colorLerp(Easing.LINEAR, Mth.floor(f * 4) / 4f, secondaryColor, primaryColor))
149153
);

src/main/java/com/sammy/malum/client/screen/codex/entries/TinkeringEntries.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,9 @@ public static void setupEntries(ArcanaProgressionScreen screen) {
174174

175175
screen.addEntry("belt_of_the_prospector", -9, 6, b -> b
176176
.configureWidget(w -> w.setIcon(BELT_OF_THE_PROSPECTOR))
177-
.addPage(new HeadlineTextPage("belt_of_the_prospector", "belt_of_the_prospector.1"))
177+
.addPage(new HeadlineTextItemPage("belt_of_the_prospector", BELT_OF_THE_PROSPECTOR.get()))
178+
.addPage(new HeadlineTextPage("belt_of_the_prospector.avarice"))
179+
.addPage(new TextPage("belt_of_the_prospector.2"))
178180
.addPage(SpiritInfusionPage.fromOutput(BELT_OF_THE_PROSPECTOR.get()))
179181
.addReference(new EntryReference(
180182
RING_OF_THE_HOARDER.get(),

src/main/java/com/sammy/malum/common/data/attachment/AvariceMarkData.java

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
import com.sammy.malum.core.handlers.GeasEffectHandler;
88
import com.sammy.malum.registry.common.MalumAttachmentTypes;
99
import com.sammy.malum.registry.common.MalumMobEffects;
10+
import com.sammy.malum.registry.common.MalumSoundEvents;
1011
import com.sammy.malum.registry.common.MalumTags;
1112
import com.sammy.malum.registry.common.magic.MalumGeasEffectTypes;
13+
import com.sammy.malum.visual_effects.AvariceParticleEffects;
1214
import com.sammy.malum.visual_effects.GeasParticleEffects;
1315
import io.netty.buffer.*;
1416
import net.minecraft.core.BlockPos;
@@ -26,13 +28,12 @@
2628
import net.neoforged.neoforge.event.level.BlockDropsEvent;
2729
import net.neoforged.neoforge.event.tick.EntityTickEvent;
2830
import team.lodestar.lodestone.helpers.EntityHelper;
29-
30-
import java.util.function.Function;
31+
import team.lodestar.lodestone.helpers.SoundHelper;
3132

3233
public class AvariceMarkData {
3334

3435
public static Codec<AvariceMarkData> CODEC = RecordCodecBuilder.create(obj -> obj.group(
35-
Codec.BOOL.optionalFieldOf("hasProspectorMark", false).forGetter(AvariceMarkData::hasProspectorMark),
36+
Codec.BOOL.optionalFieldOf("hasProspectorMark", false).forGetter(AvariceMarkData::hasAvariceMark),
3637
Codec.INT.optionalFieldOf("carriedAvarice", 0).forGetter(AvariceMarkData::getCarriedAvarice)
3738
).apply(obj, AvariceMarkData::new));
3839

@@ -47,7 +48,7 @@ private AvariceMarkData(boolean hasAvariceMark, int carriedAvarice) {
4748
public AvariceMarkData() {
4849
}
4950

50-
public boolean hasProspectorMark() {
51+
public boolean hasAvariceMark() {
5152
return hasAvariceMark;
5253
}
5354

@@ -80,7 +81,7 @@ public static int getAppliedAvarice(LivingEntity entity) {
8081

8182
public void tickData(Entity entity) {
8283
if (entity.level().isClientSide) {
83-
GeasParticleEffects.avariceItemParticles(entity.level(), entity);
84+
AvariceParticleEffects.avariceItemParticles(entity.level(), entity);
8485
}
8586
}
8687

@@ -97,8 +98,8 @@ public static void entityTick(EntityTickEvent.Pre event) {
9798
public static void pickupItem(ItemEntityPickupEvent.Post event) {
9899
ItemEntity entity = event.getItemEntity();
99100
entity.getExistingData(MalumAttachmentTypes.AVARICE_MARK).ifPresent(data -> {
100-
if (data.hasProspectorMark()) {
101-
applyAvarice(event.getPlayer(), data.carriedAvarice);
101+
if (data.hasAvariceMark()) {
102+
applyAvarice(event.getPlayer(), data.carriedAvarice*event.getOriginalStack().getCount());
102103
}
103104
});
104105
}
@@ -122,14 +123,17 @@ public static ItemEntity tryMarkEntity(ItemEntity entity, int amount) {
122123
public static void applyAvarice(LivingEntity target, int amount) {
123124
var effect = MalumMobEffects.AVARICE;
124125
var instance = target.getEffect(effect);
126+
float volume = 1f;
125127
if (instance == null) {
126128
target.addEffect(new MobEffectInstance(effect, 400, amount-1, true, true, true));
127129
} else {
128130
EntityHelper.amplifyEffect(instance, target, amount, 9);
129131
EntityHelper.extendEffect(instance, target, 400, 2400);
132+
volume -= Math.min(instance.getAmplifier()*0.05f, 0.5f);
130133
}
131134
if (GeasEffectHandler.hasGeasEffect(target, MalumGeasEffectTypes.PACT_OF_THE_PROSPECTOR)) {
132135
target.heal(amount*2);
133136
}
137+
SoundHelper.playSound(target, MalumSoundEvents.AVARICE_COLLECT.get(), volume, 0.8f + target.getRandom().nextFloat() * 0.4f);
134138
}
135139
}

src/main/java/com/sammy/malum/common/effect/geas/AvariceEffect.java

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,28 @@
22

33
import com.sammy.malum.*;
44
import com.sammy.malum.registry.common.*;
5+
import com.sammy.malum.registry.common.magic.MalumSpiritTypes;
56
import net.minecraft.resources.*;
7+
import net.minecraft.server.level.ServerLevel;
68
import net.minecraft.world.effect.*;
79
import net.minecraft.world.entity.*;
10+
import net.minecraft.world.phys.Vec3;
811
import team.lodestar.lodestone.helpers.*;
912

13+
import javax.annotation.Nullable;
14+
15+
import static com.sammy.malum.visual_effects.networked.MalumNetworkedParticleEffectColorData.fromSpirits;
16+
1017
public class AvariceEffect extends MobEffect {
1118
public AvariceEffect() {
1219
super(MobEffectCategory.BENEFICIAL, ColorHelper.getColor(255, 230, 93));
13-
final ResourceLocation id = MalumMod.malumPath("prospectors_greed");
1420
}
1521

16-
public static int addFortune(LivingEntity entity) {
22+
public static int addFortune(LivingEntity entity, @Nullable Vec3 position, int enchantmentLevel) {
23+
if (!(entity.level() instanceof ServerLevel level)) {
24+
return 0;
25+
}
26+
1727
var effect = MalumMobEffects.AVARICE;
1828
var instance = entity.getEffect(effect);
1929
if (instance != null) {
@@ -26,6 +36,17 @@ public static int addFortune(LivingEntity entity) {
2636
}
2737
chance--;
2838
}
39+
if (bonus > 0) {
40+
if (enchantmentLevel < 3) {
41+
bonus += 3 - enchantmentLevel;
42+
}
43+
if (position != null) {
44+
MalumParticleEffectTypes.AVARICE_FORTUNE_EFFECT.createEffect(position)
45+
.color(MalumSpiritTypes.INFERNAL_SPIRIT)
46+
.spawn(level);
47+
}
48+
SoundHelper.playSound(entity, MalumSoundEvents.AVARICE_FORTUNE.get(), 1.0f, 0.8f + entity.getRandom().nextFloat() * 0.4f);
49+
}
2950
return bonus;
3051
}
3152
return 0;

src/main/java/com/sammy/malum/common/effect/rite/aura/soulwood/OakenMightEffect.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public static void increaseDamage(LivingDamageEvent.Pre event) {
3131
return;
3232
}
3333
int amplifier = instance.getAmplifier() + 1;
34-
final ItemStack weapon = entity.getWeaponItem();
34+
var weapon = entity.getWeaponItem();
3535
if (weapon.isEmpty() || weapon.is(MalumTags.ItemTags.COUNTS_AS_EMPTY_HAND)) {
3636
amplifier *= 2;
3737
SoundHelper.playSound(entity, MalumSoundEvents.OAKEN_MIGHT_HIT.get(), 1.0f, 0.8f + entity.getRandom().nextFloat() * 0.4f);

0 commit comments

Comments
 (0)