Skip to content

Commit

Permalink
The mod exists
Browse files Browse the repository at this point in the history
  • Loading branch information
MandL27 committed Oct 22, 2022
1 parent 986e955 commit 6de815f
Show file tree
Hide file tree
Showing 20 changed files with 136 additions and 46 deletions.
6 changes: 6 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ repositories {
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
// for more information about repositories.
maven {
name = 'CurseMaven'
url = 'https://cursemaven.com'
}
}

dependencies {
Expand All @@ -26,6 +30,8 @@ dependencies {

// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

modImplementation "curse.maven:oxidized-506426:3780148"
}

processResources {
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ org.gradle.jvmargs=-Xmx1G

# Mod Properties
mod_version = 1.0.0
maven_group = com.example
archives_base_name = fabric-example-mod
maven_group = net.mandl.oxidizedarmor
archives_base_name = oxidized-armor

# Dependencies
fabric_version=0.53.0+1.18.2
16 changes: 0 additions & 16 deletions src/main/java/net/fabricmc/example/mixin/ExampleMixin.java

This file was deleted.

35 changes: 35 additions & 0 deletions src/main/java/net/mandl/oxidizedarmor/OxidizedArmorItems.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package net.mandl.oxidizedarmor;

import java.util.LinkedHashMap;
import java.util.Map;

import net.mandl.oxidizedarmor.armor.RoseGoldArmorMaterial;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.item.ArmorItem;
import net.minecraft.item.ArmorMaterial;
import net.minecraft.item.Item;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
import safro.oxidized.Oxidized;

public class OxidizedArmorItems {
private static final Map<Identifier, Item> ITEMS = new LinkedHashMap<>();

public static final ArmorMaterial ROSE_GOLD_ARMOR = new RoseGoldArmorMaterial();
public static final Item ROSE_GOLD_HELMET = add("rose_gold_helmet", new ArmorItem(ROSE_GOLD_ARMOR, EquipmentSlot.HEAD, new Item.Settings().group(Oxidized.ITEMGROUP)));
public static final Item ROSE_GOLD_CHESTPLATE = add("rose_gold_chestplate", new ArmorItem(ROSE_GOLD_ARMOR, EquipmentSlot.CHEST, new Item.Settings().group(Oxidized.ITEMGROUP)));
public static final Item ROSE_GOLD_LEGGINGS = add("rose_gold_leggings", new ArmorItem(ROSE_GOLD_ARMOR, EquipmentSlot.LEGS, new Item.Settings().group(Oxidized.ITEMGROUP)));
public static final Item ROSE_GOLD_BOOTS = add("rose_gold_boots", new ArmorItem(ROSE_GOLD_ARMOR, EquipmentSlot.FEET, new Item.Settings().group(Oxidized.ITEMGROUP)));


private static <I extends Item> I add(String name, I item) {
ITEMS.put(new Identifier(OxidizedArmorMod.MODID, name), item);
return item;
}

public static void registerItems() {
for (Identifier id : ITEMS.keySet()) {
Registry.register(Registry.ITEM, id, ITEMS.get(id));
}
}
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
package net.fabricmc.example;
package net.mandl.oxidizedarmor;

import net.fabricmc.api.ModInitializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ExampleMod implements ModInitializer {
public class OxidizedArmorMod implements ModInitializer {
// This logger is used to write text to the console and the log file.
// It is considered best practice to use your mod id as the logger's name.
// That way, it's clear which mod wrote info, warnings, and errors.
public static final Logger LOGGER = LoggerFactory.getLogger("modid");
public static final String MODID = "oxidized-armor";
public static final Logger LOGGER = LoggerFactory.getLogger(MODID);

@Override
public void onInitialize() {
// This code runs as soon as Minecraft is in a mod-load-ready state.
// However, some things (like resources) may still be uninitialized.
// Proceed with mild caution.

LOGGER.info("Hello Fabric world!");
OxidizedArmorItems.registerItems();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package net.mandl.oxidizedarmor.armor;

import net.minecraft.entity.EquipmentSlot;
import net.minecraft.item.ArmorMaterial;
import net.minecraft.item.Items;
import net.minecraft.recipe.Ingredient;
import net.minecraft.sound.SoundEvent;
import net.minecraft.sound.SoundEvents;


public class RoseGoldArmorMaterial implements ArmorMaterial {
private static final int[] BASE_DURABILITY = new int[] {13, 15, 16, 11};
private static final int[] PROTECTION_VALUES = new int[] {2, 5, 6, 2}; // iron

@Override
public int getDurability(EquipmentSlot slot) {
return BASE_DURABILITY[slot.getEntitySlotId()] * 15; // iron
}

@Override
public int getProtectionAmount(EquipmentSlot slot) {
return PROTECTION_VALUES[slot.getEntitySlotId()];
}

@Override
public int getEnchantability() {
return 25; // gold
}

@Override
public SoundEvent getEquipSound() {
return SoundEvents.ITEM_ARMOR_EQUIP_GOLD;
}

@Override
public Ingredient getRepairIngredient() {
return Ingredient.ofItems(Items.COPPER_INGOT);
}

@Override
public String getName() {
return "rose_gold";
}

@Override
public float getToughness() {
return 0f; // anything except diamond or netherite
}

@Override
public float getKnockbackResistance() {
return 0f;
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/main/resources/assets/modid/icon.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "oxidized-armor:item/rose_gold_boots"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "oxidized-armor:item/rose_gold_chestplate"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "oxidized-armor:item/rose_gold_helmet"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "oxidized-armor:item/rose_gold_leggings"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 10 additions & 10 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
{
"schemaVersion": 1,
"id": "modid",
"id": "oxidized-armor",
"version": "${version}",

"name": "Example Mod",
"description": "This is an example description! Tell everyone what your mod is about!",
"name": "Oxidized Armor",
"description": "Extends the Oxidized mod with support for rose gold armor.",
"authors": [
"Me!"
"MandL27"
],
"contact": {
"homepage": "https://fabricmc.net/",
"sources": "https://github.com/FabricMC/fabric-example-mod"
"sources": "https://github.com/MandL27/Oxidized-Armor"
},

"license": "CC0-1.0",
"icon": "assets/modid/icon.png",
"icon": "assets/oxidized-armor/icon.png",

"environment": "*",
"entrypoints": {
"main": [
"net.fabricmc.example.ExampleMod"
"net.mandl.oxidizedarmor.OxidizedArmorMod"
]
},
"mixins": [
"modid.mixins.json"
"oxidized-armor.mixins.json"
],

"depends": {
"fabricloader": ">=0.14.6",
"fabric": "*",
"minecraft": "~1.18.2",
"java": ">=17"
"java": ">=17",
"oxidized": "1.6.4"
},
"suggests": {
"another-mod": "*"
Expand Down
14 changes: 0 additions & 14 deletions src/main/resources/modid.mixins.json

This file was deleted.

0 comments on commit 6de815f

Please sign in to comment.