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

Compatibility Focus #43

Open
wants to merge 3 commits into
base: 1.19.2/master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ forgeVersion=43.3.5
# Parchment Version
parchmentVersion=2022.11.27
# Mod Information see https://mcforge.readthedocs.io/en/1.18.x/gettingstarted/versioning/#examples
modVersion=2.1.4.0
modVersion=2.1.4.2
modId=manascore
# Mixin Extras
mixinExtrasVersion=0.3.2
mixinExtrasVersion=0.2.0
# Photon: https://modrinth.com/mod/photon-editor/versions?l=forge&g=1.19.2
photonVersion=1.0.7.a
# LDLib: https://modrinth.com/mod/ldlib/versions?l=forge&g=1.19.2
Expand Down
4 changes: 0 additions & 4 deletions src/main/java/com/github/manasmods/manascore/ManasCore.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@
package com.github.manasmods.manascore;

import com.github.manasmods.manascore.attribute.ManasCoreAttributes;
import com.github.manasmods.manascore.config.ManasCoreConfig;
import com.github.manasmods.manascore.network.ManasCoreNetwork;
import com.github.manasmods.manascore.skill.SkillRegistry;
import lombok.Getter;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.ModLoadingContext;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.config.ModConfig.Type;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import org.apache.logging.log4j.LogManager;
Expand All @@ -27,7 +24,6 @@ public final class ManasCore {
private static final Logger logger = LogManager.getLogger();

public ManasCore() {
ModLoadingContext.get().registerConfig(Type.COMMON, ManasCoreConfig.SPEC);
IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();
ManasCoreAttributes.register(modEventBus);
SkillRegistry.register(modEventBus);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,15 @@ public static void applyEntityCrit(final LivingHurtEvent e) {

@SubscribeEvent(priority = EventPriority.HIGH)
public static void modifyCrit(final CriticalHitEvent e) {
float vanillaMultiplier = e.getDamageModifier() / e.getOldDamageModifier();
float critMultiplier = (float) e.getEntity().getAttributeValue(ManasCoreAttributes.CRIT_MULTIPLIER.get());
if (e.isVanillaCritical()) {
e.setDamageModifier(e.getDamageModifier() * (float) e.getEntity().getAttributeValue(ManasCoreAttributes.CRIT_MULTIPLIER.get()));
e.setDamageModifier(vanillaMultiplier * critMultiplier);
return;
}

double critChance = e.getEntity().getAttributeValue(ManasCoreAttributes.CRIT_CHANCE.get()) / 100; // convert to %
float critMultiplier = (float) e.getEntity().getAttributeValue(ManasCoreAttributes.CRIT_MULTIPLIER.get());
CriticalChanceEvent event = new CriticalChanceEvent(e.getEntity(), e.getTarget(), e.getDamageModifier() * critMultiplier, critChance);
CriticalChanceEvent event = new CriticalChanceEvent(e.getEntity(), e.getTarget(), vanillaMultiplier * critMultiplier, critChance);
if (MinecraftForge.EVENT_BUS.post(event)) return;

RandomSource random = e.getEntity().getRandom();
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

12 changes: 3 additions & 9 deletions src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ loaderVersion = "${forgeLoaderVersion}"
license = "GPL-3"
issueTrackerURL = "https://github.com/ManasMods/ManasCore/issues" #optional
[[mods]] #mandatory
modId = "${modId}" #mandatory
modId = "manascore" #mandatory
version = "${modVersion}"
displayName = "ManasCore" #mandatory
updateJSONURL="https://api.modrinth.com/updates/wRRSWpd1/forge_updates.json" #optional
Expand All @@ -15,24 +15,18 @@ description = '''
Utility and Core Library for Manas Mods
'''
#@formatter:off
[[dependencies.${modId}]] #optional
[[dependencies.manascore]] #optional
modId="forge" #mandatory
mandatory=true #mandatory
versionRange="${forgeLoaderVersion}" #mandatory
ordering="NONE"
side="BOTH"
# Here's another dependency
[[dependencies.${modId}]]
[[dependencies.manascore]]
modId="minecraft"
mandatory=true
# This version range declares a minimum of the current minecraft version up to but not including the next major version
versionRange="${minecraftVersionCheck}"
ordering="NONE"
side="BOTH"
[[dependencies.${modId}]]
modId="mixinextras"
mandatory=true
versionRange="[${mixinExtrasVersion},)"
ordering="NONE"
side="BOTH"
##@formatter:on
2 changes: 0 additions & 2 deletions src/main/resources/manascore.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@
"refmap": "manascore.refmap.json",
"mixins": [
"BlockLootAccessor",
"MixinAnvilMenu",
"MixinLivingEntity",
"MixinServerLevel",
"RegistryBuilderAccessor",
"ShapedRecipeBuilderAccessor"
],
"client": [
"AbstractContainerScreenAccessor",
"MixinAnvilScreen",
"MixinMinecraft"
],
"injectors": {
Expand Down
Loading