Skip to content

Commit

Permalink
texture fix/nonamedye
Browse files Browse the repository at this point in the history
  • Loading branch information
Rin committed Sep 28, 2024
1 parent 05b4e7c commit 7f19473
Show file tree
Hide file tree
Showing 14 changed files with 45 additions and 5 deletions.
9 changes: 9 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ repositories {
}
metadataSources { artifact() }
}
ivy {
url = "https://github.com/Gooey-Goo"
patternLayout {
artifact "[organisation]/releases/download/v[revision]/[module]-[revision].jar"
m2compatible = true
}
metadataSources { artifact() }
}
}

dependencies {
Expand All @@ -94,6 +102,7 @@ dependencies {
modImplementation "com.github.Turnip-Labs:bta-halplibe:${project.halplibe_version}"

modImplementation "ModMenu:ModMenu:2.0.6"
implementation("BTANoNameDyes:noname_dyes:1.3")

implementation "org.slf4j:slf4j-api:1.8.0-beta4"
implementation "org.apache.logging.log4j:log4j-slf4j18-impl:2.16.0"
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
org.gradle.jvmargs=-Xmx2G

# BTA
bta_version=7.2_01
bta_version=7.2

# Loader
loader_version=0.15.6-babric.6-bta
Expand All @@ -10,6 +10,6 @@ loader_version=0.15.6-babric.6-bta
halplibe_version=4.1.3

# Mod
mod_version=1.0.7
mod_version=1.0.8
mod_group=Mizuri-n
mod_name=Better with Defense
2 changes: 1 addition & 1 deletion src/main/java/mizurin/shieldmod/ShieldMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class ShieldMod implements ModInitializer, GameStartEntrypoint, ClientSta
public static ArtType paintingRice;
static {
Properties prop = new Properties();
prop.setProperty("starting_item_id", "17000");
prop.setProperty("starting_item_id", "21000");
prop.setProperty("starting_entity_id", "100");
ConfigHandler config = new ConfigHandler(ShieldMod.MOD_ID, prop);
itemID = config.getInt("starting_item_id");
Expand Down
1 change: 1 addition & 0 deletions src/main/java/mizurin/shieldmod/item/ShieldMaterials.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ public ToolMaterial setEfficiency(float efficiency, float guard) {
this.guard = guard;
return super.setEfficiency(efficiency, guard);
}

}
6 changes: 4 additions & 2 deletions src/main/java/mizurin/shieldmod/item/Shields.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import net.minecraft.core.item.Item;
import net.minecraft.core.item.ItemSoup;
import net.minecraft.core.item.tag.ItemTags;
import net.minecraft.core.util.helper.DamageType;
import org.slf4j.LoggerFactory;
import turniplabs.halplibe.helper.ItemBuilder;
import mizurin.shieldmod.ShieldMod;
Expand Down Expand Up @@ -102,7 +103,7 @@ public void initializeItems(){
tearShield = new ItemBuilder(MOD_ID)
.setItemModel(item -> new ItemModelShield(item, new ItemModelColored.ColoredTextureEntry[]
{
new ItemModelColored.ColoredTextureEntry(TextureRegistry.getTexture("shieldmod:item/tearstone_shield"), (s) -> -1)
new ItemModelColored.ColoredTextureEntry(TextureRegistry.getTexture("shieldmod:item/tearstone_shield_test"), (s) -> -1)
}).setFull3D())
.build(new ThrowShield("tear.shield", ++itemID, ShieldMaterials.TOOL_TEAR))
.withTags(ItemTags.PREVENT_CREATIVE_MINING);
Expand All @@ -112,7 +113,7 @@ public void initializeItems(){
.setStackSize(1)
.setItemModel(item -> new ItemModelShield(item, new ItemModelColored.ColoredTextureEntry[]
{
new ItemModelColored.ColoredTextureEntry(TextureRegistry.getTexture("shieldmod:item/ammotearstone_shield"), (s) -> -1)
new ItemModelColored.ColoredTextureEntry(TextureRegistry.getTexture("shieldmod:item/ammotearstone_shield_test"), (s) -> -1)
}).setFull3D())
.build(new Item("tear.shield.ammo", ++itemID))
.withTags(ItemTags.NOT_IN_CREATIVE_MENU);
Expand Down Expand Up @@ -145,5 +146,6 @@ public void initializeItems(){
}))
.build(new ArmorColored("armor.boots.leather", 16429, ArmorMaterial.LEATHER, 3));


}
}
2 changes: 2 additions & 0 deletions src/main/java/mizurin/shieldmod/mixins/ShieldMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import mizurin.shieldmod.item.ShieldMaterials;
import net.minecraft.core.achievement.stat.Stat;
import net.minecraft.core.entity.Entity;
import net.minecraft.core.entity.EntityBobber;
import net.minecraft.core.entity.EntityLiving;
import net.minecraft.core.entity.monster.EntityMonster;
import net.minecraft.core.entity.player.EntityPlayer;
Expand Down Expand Up @@ -57,6 +58,7 @@ public ShieldMixin(World world) {
private ChunkCoordinates playerSpawnCoordinate;



// inject at the top(HEAD) of hurt(), allow us to call return(cancel/set return value)
@Inject(method = "hurt", at = @At("HEAD"), cancellable = true)
public void injectHurt(Entity attacker, int damage, DamageType type, CallbackInfoReturnable<Boolean> ci) {
Expand Down
23 changes: 23 additions & 0 deletions src/main/java/mizurin/shieldmod/recipeColor.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import net.minecraft.core.item.ItemStack;
import net.minecraft.core.player.inventory.InventoryCrafting;
import net.minecraft.core.util.helper.Color;
import goocraft4evr.nonamedyes.item.ModItems;
import turniplabs.halplibe.helper.ModVersionHelper;

import java.util.ArrayList;
import java.util.HashMap;
Expand All @@ -16,16 +18,37 @@

//Special thanks to UselessBullets for being extremely awesome https://github.com/UselessBullets/Lunacy/tree/7.1
public class recipeColor extends RecipeEntryCraftingDynamic {
public static boolean nonamedyesOn = ModVersionHelper.isModPresent("nonamedyes");

public static HashMap<Item, Map<Integer, Color>> dyeMap = new HashMap<>();
private static final Map<Integer, Color> vanillaDye;
private static final Map<Integer, Color> nonameDye;
static {
vanillaDye = new HashMap<>();
nonameDye = new HashMap<>();
ItemDye.field_31002_bk[7] = 13027014;
ItemDye.field_31002_bk[15] = 16777215;
for (int color = 0; color < 16; color++) {
vanillaDye.put(color, new Color().setARGB(ItemDye.field_31002_bk[color]));
}
if (nonamedyesOn){
nonameDye.put(0, new Color().setARGB(11540279)); //crimson
nonameDye.put(1, new Color().setARGB(6627104)); //maroon
nonameDye.put(2, new Color().setARGB(10005149)); //ash.gray
nonameDye.put(3, new Color().setARGB(7236357)); // olive
nonameDye.put(4, new Color().setARGB(13007915)); //ochre
nonameDye.put(5, new Color().setARGB(14063170)); //buff L
nonameDye.put(6, new Color().setARGB(3591599)); //verdigris
nonameDye.put(7, new Color().setARGB(16772730)); //light.yellow L
nonameDye.put(8, new Color().setARGB(3878540)); //indigo
nonameDye.put(9, new Color().setARGB(13887232)); //xanthic
nonameDye.put(10, new Color().setARGB(9191711)); //cinnamon
nonameDye.put(11, new Color().setARGB(2171241)); //navy.blue
nonameDye.put(12, new Color().setARGB(6631797)); //royal.purple
nonameDye.put(13, new Color().setARGB(2788193)); //viridian

dyeMap.put(ModItems.dye, nonameDye);
}
dyeMap.put(Item.dye, vanillaDye);
}
@Override
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/mizurin/shieldmod/recipes.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package mizurin.shieldmod;

import goocraft4evr.nonamedyes.NoNameDyes;
import goocraft4evr.nonamedyes.crafting.RecipeBuilderBleacher;
import net.minecraft.core.block.Block;
import net.minecraft.core.data.registry.Registries;
import net.minecraft.core.data.registry.recipe.RecipeNamespace;
Expand All @@ -14,6 +16,7 @@

import mizurin.shieldmod.item.Shields;


public class recipes implements RecipeEntrypoint {
public static final String MOD_ID = ShieldMod.MOD_ID;
public static final RecipeGroup<RecipeEntryCrafting<?, ?>> WORKBENCH = new RecipeGroup<>(new RecipeSymbol(new ItemStack(Block.workbench)));
Expand Down
Binary file modified src/main/resources/assets/shieldmod/textures/armor/leather_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/main/resources/assets/shieldmod/textures/armor/leather_2.png
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 not shown.
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.

0 comments on commit 7f19473

Please sign in to comment.