Skip to content

Commit

Permalink
Combatify 1.2.0 1.20.5-rc2 Beta 5 - CookeyMod, Atlas Config completio…
Browse files Browse the repository at this point in the history
…n (need translations and tooltips still due to it being decades since the last translation update)
  • Loading branch information
Alexandra-Myers committed Apr 21, 2024
1 parent d9ace45 commit 8342b49
Show file tree
Hide file tree
Showing 59 changed files with 2,645 additions and 119 deletions.
17 changes: 15 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ archivesBaseName = project.archives_base_name
version = project.version
group = project.maven_group

configurations {
includeClasspath
}

loom {
accessWidenerPath = file("src/main/resources/combatify.accesswidener")
}
Expand Down Expand Up @@ -49,10 +53,16 @@ dependencies {
mappings loom.officialMojangMappings()
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
// modApi("com.terraformersmc:modmenu:9.0.0")
modApi "com.terraformersmc:modmenu:10.0.0-alpha.1"
modApi "me.shedaniel.cloth:cloth-config-fabric:14.0.125"

implementation "com.moandjiezana.toml:toml4j:${project.toml4j_version}"
includeClasspath("com.moandjiezana.toml:toml4j:${project.toml4j_version}") {
exclude(group: "com.google.code.gson")
}
}

configurations.all {
configurations.configureEach {
resolutionStrategy {
force("net.fabricmc:fabric-loader:${project.loader_version}")
}
Expand Down Expand Up @@ -95,6 +105,9 @@ jar {
from("LICENSE") {
rename { "${it}_${archivesBaseName}" }
}
from {
configurations.includeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
}

// Configure the maven publication
Expand Down
9 changes: 5 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ org.gradle.jvmargs = -Xmx3G
org.gradle.parallel = true

# Mod Properties
version = 1.20.5-1.2.0-BETA-4
version = 1.20.5-1.2.0-BETA-5
maven_group = net.atlas
archives_base_name = combatify
owo_version=0.11.0+1.20
loader_version=0.15.7
fabric_version=0.96.15+1.20.5
minecraft_version=1.20.5-pre1
loader_version=0.15.10
fabric_version=0.97.4+1.20.5
minecraft_version=1.20.5-rc2
toml4j_version=0.7.2
2 changes: 2 additions & 0 deletions src/main/java/net/atlas/combatify/Combatify.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ public class Combatify implements ModInitializer {

@Override
public void onInitialize() {
if (registeredWeaponTypes.isEmpty())
WeaponType.init();
networkingHandler = new NetworkingHandler();
LOGGER.info("Init started.");
if (CONFIG.dispensableTridents())
Expand Down
33 changes: 33 additions & 0 deletions src/main/java/net/atlas/combatify/CombatifyClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,33 @@

import com.mojang.serialization.Codec;
import net.atlas.combatify.config.ShieldIndicatorStatus;
import net.atlas.combatify.config.cookey.ModConfig;
import net.atlas.combatify.extensions.IOptions;
import net.atlas.combatify.keybind.Keybinds;
import net.atlas.combatify.networking.ClientNetworkingHandler;
import net.atlas.combatify.util.PrefixLogger;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.rendering.v1.EntityModelLayerRegistry;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.client.OptionInstance;
import net.minecraft.client.model.ShieldModel;
import net.minecraft.client.model.geom.ModelLayerLocation;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.util.Arrays;
import java.util.Objects;

import static net.minecraft.client.Options.genericValueLabel;

public class CombatifyClient implements ClientModInitializer {
private static final PrefixLogger COOKEY_LOGGER = new PrefixLogger(LogManager.getLogger("CookeyMod"));
private static CombatifyClient instance;

private ModConfig config;
private Keybinds keybinds;
public static final ModelLayerLocation WOODEN_SHIELD_MODEL_LAYER = new ModelLayerLocation(new ResourceLocation("combatify", "wooden_shield"),"main");
public static final ModelLayerLocation IRON_SHIELD_MODEL_LAYER = new ModelLayerLocation(new ResourceLocation("combatify", "iron_shield"),"main");
public static final ModelLayerLocation GOLDEN_SHIELD_MODEL_LAYER = new ModelLayerLocation(new ResourceLocation("combatify", "golden_shield"),"main");
Expand Down Expand Up @@ -62,6 +73,12 @@ public class CombatifyClient implements ClientModInitializer {

@Override
public void onInitializeClient() {
COOKEY_LOGGER.info("Loading CookeyMod...");

instance = this;
config = new ModConfig(this, FabricLoader.getInstance().getConfigDir().resolve("cookeymod").resolve("config.toml"));

keybinds = new Keybinds();
Combatify.LOGGER.info("Client init started.");
ClientNetworkingHandler.init();
if (Combatify.CONFIG.tieredShields()) {
Expand All @@ -72,4 +89,20 @@ public void onInitializeClient() {
EntityModelLayerRegistry.registerModelLayer(NETHERITE_SHIELD_MODEL_LAYER, ShieldModel::createLayer);
}
}

public Logger getCookeyModLogger() {
return COOKEY_LOGGER.unwrap();
}

public ModConfig getConfig() {
return this.config;
}

public Keybinds getKeybinds() {
return keybinds;
}

public static CombatifyClient getInstance() {
return instance;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package net.atlas.combatify.annotation.mixin;

import java.lang.annotation.ElementType;
import java.lang.annotation.Target;

@Target(ElementType.TYPE)
public @interface Incompatible {
/**
* Declares certain mods incompatible with a mixin.
* All mod ids listed here will prevent the mixin from loading
* if they are active in the environment.
*/
String[] value() default "";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package net.atlas.combatify.annotation.mixin;

import java.lang.annotation.ElementType;
import java.lang.annotation.Target;

@Target(ElementType.TYPE)
public @interface ModSpecific {
/**
* Declares a mod-specific mixin.
* Mixins marked with this annotation will only load if one
* of the mod ids listed here is present in the environment.
*/
String[] value() default "";
}
Loading

0 comments on commit 8342b49

Please sign in to comment.