Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The Pan Update #515

Merged
merged 17 commits into from
Jul 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ old_changelog.txt
!updateResources.bat
/.apt_generated_tests/

model
model
/.run
9 changes: 4 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,10 @@ dependencies {
annotationProcessor 'org.ow2.asm:asm-util:7.2'

// These are 1.20.1 dependencies
compileOnly fg.deobf('generic:curios:forge-5.2.0-beta.3+1.20.1')
compileOnly fg.deobf('generic:Patchouli:1.20.1-81-FORGE')
compileOnly fg.deobf('generic:caelus:forge-3.1.0+1.20')
compileOnly fg.deobf('generic:jei:1.18.2-forge-10.2.1.283-stripped')
compileOnly fg.deobf('generic:WorldNameRandomizer:FORGE-1.19.2-v1.5.0')
implementation fg.deobf('generic:curios:forge-5.2.0-beta.3+1.20.1')
implementation fg.deobf('generic:Patchouli:1.20.1-81-FORGE')
implementation fg.deobf('generic:caelus:forge-3.1.0+1.20')
implementation fg.deobf('generic:jei:1.18.2-forge-10.2.1.283-stripped')

// These are 1.19 dependencies
//compileOnly fg.deobf('generic:curios:forge-1.19.4-5.1.5.3')
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Gradle
org.gradle.jvmargs=-Xmx4G -Xms4G
org.gradle.daemon=false
#org.gradle.daemon=false

# The Acknowledgment Edition
the_acknowledgment_edition=20
Expand All @@ -17,7 +17,7 @@ mod_author=Aizistral

mod_description=This mod is designed to provide tools that will aid you in exploring seemingly endless reaches of Minecraft's worlds. As well as new resources, powerful gear and ancient relics - to reward you for doing so. Despite revolving around themes of arcane and mystery, Enigmatic Legacy doesn't stray too far away from what vanilla has to offer, instead attempting to expand upon it's mechanics and fill in the holes left open.

mod_credits=Terraria and some of it's mods, for inspiring my creations functionally and visually; Minecraft Dungeons, for blocks and models that make me question why we don't have anything like this in Minecraft itself; Botania and it's creator known as Vazkii, for some basic code I could conveniently borrow instead of having to re-invent the wheel; frdovahkick, for amazing work over some of the textures in the mod; SkySem, for some models and textures created on-comission; SoulRacer65, for some textures overhauls and entirely new textures.
mod_credits=Terraria and some of it's mods, for inspiring my creations functionally and visually; Minecraft Dungeons, for blocks and models that make me question why we don't have anything like this in Minecraft itself; Botania and it's creator known as Vazkii, for some basic code I could conveniently borrow instead of having to re-invent the wheel; frdovahkick, for amazing work over some of the textures in the mod; SkySem, for some models and textures created on-comission; SoulRacer65, for some textures overhauls and entirely new textures; Cartoony Clangs (hit with spade)_16bit.wav by Timbre -- https://freesound.org/s/91696/ -- License: Attribution NonCommercial 4.0; Shovel Thwack 1.wav by snardin42 -- https://freesound.org/s/73200/ -- License: Creative Commons 0

mod_icon=EL_logo.png
mod_license=Enigmatic Legacy License
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,6 @@ private void onServerStarted(ServerStartedEvent event) {

/**
* Alright boys, it's cleanup time!
* @param event
*/

public void performCleanup() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.util.Objects;
import java.util.function.Supplier;

import com.aizistral.enigmaticlegacy.items.EldritchPan;
import com.aizistral.etherium.core.IEtheriumConfig;

import net.minecraft.resources.ResourceLocation;
Expand All @@ -19,8 +20,9 @@
*/

public enum EnigmaticMaterials implements Tier {
FORBIDDENAXE(0, 2000, 6.0F, 3.0F, 16, () -> Ingredient.EMPTY),
ENDERSLAYER(0, 2000, 6.0F, 3.0F, 16, () -> Ingredient.of(Blocks.OBSIDIAN)),
ELDRITCH_PAN(0, 4000, 6.0F, 3.0F, 24, EldritchPan::getRepairMaterial),
FORBIDDEN_AXE(0, 2000, 6.0F, 3.0F, 16, () -> Ingredient.EMPTY),
ENDER_SLAYER(0, 2000, 6.0F, 3.0F, 16, () -> Ingredient.of(Blocks.OBSIDIAN)),
ETHERIUM(5, 3000, 8.0F, 5.0F, 32, () -> getEtheriumConfig().getRepairMaterial()),
CREATION(6, 10000, 32.0F, 0.0F, 40, () -> Ingredient.EMPTY);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ public ItemStack execute(BlockSource source, ItemStack stack) {
stack.shrink(1);
this.setSuccess(true);
return stack;
} else {
this.setSuccess(false);
return stack;
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
package com.aizistral.enigmaticlegacy.effects;

import com.aizistral.enigmaticlegacy.api.generic.SubscribeConfig;
import com.aizistral.omniconfig.Configuration;
import com.aizistral.omniconfig.wrappers.Omniconfig;
import com.aizistral.omniconfig.wrappers.OmniconfigWrapper;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.effect.MobEffect;
import net.minecraft.world.effect.MobEffectCategory;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.ai.attributes.AttributeModifier;
import net.minecraft.world.entity.ai.attributes.Attributes;

public class GrowingBloodlustEffect extends MobEffect {
public static Omniconfig.DoubleParameter damageBoost = null;
public static Omniconfig.DoubleParameter lifestealBoost = null;
public static Omniconfig.DoubleParameter healthLossLimit = null;
public static Omniconfig.IntParameter healthLossTicks = null;
public static Omniconfig.IntParameter ticksPerLevel = null;

@SubscribeConfig(receiveClient = true)
public static void onConfig(OmniconfigWrapper builder) {
builder.pushPrefix("GrowingBloodlust");

if (builder.config.getSidedType() != Configuration.SidedConfigType.CLIENT) {
damageBoost = builder
.comment("Damage boost granted by the Growing Bloodlust, per level of effect.")
.max(100)
.getDouble("DamageBoost", 0.05);

lifestealBoost = builder
.comment("Lifesteal granted by the Growing Bloodlust, per level of effect.")
.max(100)
.getDouble("LifestealBoost", 0.025);

healthLossTicks = builder
.comment("How often the player loses 1 HP at level one of Growing Bloodlust, in ticks.")
.getInt("HealthLossTicks", 160);

healthLossLimit = builder
.comment("How much health Growing Bloodlust leaves the player with, as a fraction of max health.")
.getDouble("HealthLossLimit", 0.3);

ticksPerLevel = builder
.comment("How lock the The Voracious Pan needs to be held, in ticks, to increase the strength "
+ "of the Growing Bloodlust effect by one level.")
.getInt("TicksPerLevel", 300);
}

builder.popPrefix();
}

public GrowingBloodlustEffect() {
super(MobEffectCategory.BENEFICIAL, 0xC30018);
this.addAttributeModifier(Attributes.ATTACK_DAMAGE, "d88f6930-fefb-4bf7-a418-f368458355ff",
damageBoost.getValue(), AttributeModifier.Operation.MULTIPLY_TOTAL);
}

@Override
public void applyEffectTick(LivingEntity living, int amplifier) {
if (living instanceof ServerPlayer player && !player.isCreative() && !player.isSpectator()) {
if ((player.getHealth() / player.getMaxHealth()) > healthLossLimit.getValue()) {
player.setHealth(player.getHealth() - 1);
}
}
}

@Override
public boolean isDurationEffectTick(int duration, int amplifier) {
int period = healthLossTicks.getValue() / (1 + amplifier);
return duration % period == 0;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
package com.aizistral.enigmaticlegacy.effects;

import com.aizistral.enigmaticlegacy.api.generic.SubscribeConfig;
import com.aizistral.omniconfig.Configuration;
import com.aizistral.omniconfig.wrappers.Omniconfig;
import com.aizistral.omniconfig.wrappers.OmniconfigWrapper;
import com.google.common.collect.ImmutableList;
import net.minecraft.resources.ResourceKey;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.damagesource.DamageType;
import net.minecraft.world.damagesource.DamageTypes;
import net.minecraft.world.effect.MobEffect;
import net.minecraft.world.effect.MobEffectCategory;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.ai.attributes.Attribute;
import net.minecraft.world.entity.ai.attributes.AttributeModifier;
import net.minecraft.world.entity.ai.attributes.Attributes;

import java.util.List;
import java.util.Map;

public class GrowingHungerEffect extends MobEffect {
public static Omniconfig.DoubleParameter damageBoost = null;
public static Omniconfig.DoubleParameter exhaustionGain = null;
public static Omniconfig.IntParameter ticksPerLevel = null;

@SubscribeConfig(receiveClient = true)
public static void onConfig(OmniconfigWrapper builder) {
builder.pushPrefix("GrowingHunger");

if (builder.config.getSidedType() != Configuration.SidedConfigType.CLIENT) {
damageBoost = builder
.comment("Damage boost granted by the Growing Hunger, per level of effect.")
.max(100)
.getDouble("DamageBoost", 0.1);

exhaustionGain = builder
.comment("Exhaustion applied by Growing Hunger every 4 ticks, per level of effect.")
.getDouble("ExhaustionGain", 0.5);

ticksPerLevel = builder
.comment("How lock the The Voracious Pan needs to be held, in ticks, to increase the strength "
+ "of the Growing Hunger effect by one level.")
.getInt("TicksPerLevel", 300);
}

builder.popPrefix();
}

public GrowingHungerEffect() {
super(MobEffectCategory.BENEFICIAL, 0xBD1BE5);
this.addAttributeModifier(Attributes.ATTACK_DAMAGE, "c281d54f-3277-4e4c-899e-c27f4f697b24",
damageBoost.getValue(), AttributeModifier.Operation.MULTIPLY_TOTAL);
}

@Override
public void applyEffectTick(LivingEntity living, int amplifier) {
if (living instanceof ServerPlayer player) {
player.causeFoodExhaustion((float) (exhaustionGain.getValue() * (1 + amplifier)));
}
}

@Override
public boolean isDurationEffectTick(int duration, int amplifier) {
return duration % 4 == 0;
}

}
Loading
Loading