Skip to content

Commit

Permalink
reorganize
Browse files Browse the repository at this point in the history
  • Loading branch information
mizuri-n committed Apr 24, 2024
1 parent 9d18d70 commit e31e63b
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 19 deletions.
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ org.gradle.jvmargs=-Xmx2G
bta_version=7.1

# Loader
loader_version=0.14.19-babric.3-bta
loader_version=0.15.6-babric.4-bta

# HalpLibe
halplibe_version=3.5.2
halplibe_version=3.5.3

prismatic_version=3.0.3-7.1
prismatic_version=3.1.2-7.1

# Mod
mod_version=1.0.4
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/mizurin/shieldmod/armorRecipeColor.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
package mizurin.shieldmod;

import com.mojang.nbt.CompoundTag;
import mizurin.shieldmod.item.ArmorColored;
import net.minecraft.core.data.registry.recipe.SearchQuery;
import net.minecraft.core.data.registry.recipe.entry.RecipeEntryCraftingDynamic;
import net.minecraft.core.item.Item;
import net.minecraft.core.item.ItemDye;
import net.minecraft.core.item.ItemStack;
import net.minecraft.core.player.inventory.InventoryCrafting;
import net.minecraft.core.util.helper.Color;
import useless.prismaticlibe.IColoredArmor;
import useless.prismaticlibe.debug.ItemArmorColored;

import java.util.ArrayList;
import java.util.HashMap;
Expand Down Expand Up @@ -37,7 +36,7 @@ public ItemStack getCraftingResult(InventoryCrafting inventorycrafting) {
for (int y = 0; y < 3; ++y) {
ItemStack stack = inventorycrafting.getItemStackAt(x, y);
if (stack == null) continue;
if (stack.getItem() instanceof IColoredArmor) {
if (stack.getItem() instanceof ArmorColored) {
armorStack = stack;
} else if (dyeMap.containsKey(stack.getItem())) {
dyeStacks.add(stack);
Expand Down Expand Up @@ -102,7 +101,7 @@ public boolean matches(InventoryCrafting crafting) {
for (int y = 0; y < 3; ++y) {
ItemStack stack = crafting.getItemStackAt(x, y);
if (stack == null) continue;
if (stack.getItem() instanceof IColoredArmor) {
if (stack.getItem() instanceof ArmorColored) {
if (armorStack != null) {
return false;
}
Expand Down
15 changes: 7 additions & 8 deletions src/main/java/mizurin/shieldmod/item/ArmorColored.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@

import java.awt.*;

public class ArmorColored extends ItemArmor implements IColoredArmor, IColored {
public class ArmorColored extends ItemArmor implements IColored, IColoredArmor {
public static final String MOD_ID = ShieldMod.MOD_ID;
public static final int[][] baseColor = new int[][] {
TextureHelper.getOrCreateItemTexture(ShieldMod.MOD_ID, "leather_helmet.png"),
TextureHelper.getOrCreateItemTexture(ShieldMod.MOD_ID, "leather_chestplate.png"),
TextureHelper.getOrCreateItemTexture(ShieldMod.MOD_ID, "leather_leggings.png"),
TextureHelper.getOrCreateItemTexture(ShieldMod.MOD_ID, "leather_boots.png")};
private final int[][] armorColor = new int[][] {
TextureHelper.getOrCreateItemTexture(ShieldMod.MOD_ID, "armor/leather_helmet.png"),
TextureHelper.getOrCreateItemTexture(ShieldMod.MOD_ID, "armor/leather_chestplate.png"),
TextureHelper.getOrCreateItemTexture(ShieldMod.MOD_ID, "armor/leather_leggings.png"),
TextureHelper.getOrCreateItemTexture(ShieldMod.MOD_ID, "armor/leather_boots.png")};

public ArmorColored(String name, int id, ArmorMaterial material, int armorPiece) {
super(name, id, material, armorPiece);
Expand All @@ -36,10 +36,9 @@ public Color getColor(ItemStack itemStack){
}
@Override
public ColoredTexture[] getTextures(ItemStack itemStack) {
return new ColoredTexture[]{new ColoredTexture(baseColor[armorPiece], getColor(itemStack))};
return new ColoredTexture[]{new ColoredTexture(armorColor[armorPiece], getColor(itemStack))};
}

@Override
public ColoredArmorTexture[] getArmorTextures(ItemStack itemStack) {
return new ColoredArmorTexture[]{new ColoredArmorTexture("leather", getColor(itemStack))};
}
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/mizurin/shieldmod/item/Shields.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
import turniplabs.halplibe.helper.ItemHelper;
import mizurin.shieldmod.ShieldMod;
import org.slf4j.Logger;
import useless.prismaticlibe.IColoredArmor;
import useless.prismaticlibe.debug.ItemArmorColored;
import net.minecraft.core.item.material.ArmorMaterial;
import turniplabs.halplibe.helper.ArmorHelper;

public class Shields {
public static final String MOD_ID = ShieldMod.MOD_ID;
Expand Down
1 change: 0 additions & 1 deletion src/main/java/mizurin/shieldmod/recipeColor.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package mizurin.shieldmod;

import com.mojang.nbt.CompoundTag;
import net.minecraft.client.util.helper.Colors;
import net.minecraft.core.data.registry.recipe.SearchQuery;
import net.minecraft.core.data.registry.recipe.entry.RecipeEntryCraftingDynamic;
import net.minecraft.core.item.Item;
Expand Down

0 comments on commit e31e63b

Please sign in to comment.