From 7f19473efef58e009334a329a063c5bede2d4340 Mon Sep 17 00:00:00 2001 From: Rin Date: Fri, 27 Sep 2024 20:01:32 -0500 Subject: [PATCH] texture fix/nonamedye --- build.gradle | 9 +++++++ gradle.properties | 4 +-- .../java/mizurin/shieldmod/ShieldMod.java | 2 +- .../shieldmod/item/ShieldMaterials.java | 1 + .../java/mizurin/shieldmod/item/Shields.java | 6 +++-- .../mizurin/shieldmod/mixins/ShieldMixin.java | 2 ++ .../java/mizurin/shieldmod/recipeColor.java | 23 ++++++++++++++++++ src/main/java/mizurin/shieldmod/recipes.java | 3 +++ .../shieldmod/textures/armor/leather_1.png | Bin 1336 -> 1231 bytes .../shieldmod/textures/armor/leather_2.png | Bin 677 -> 620 bytes .../item/ammotearstone_shield_test.png | Bin 0 -> 246 bytes .../textures/item/iron_shield_test.png~ | Bin 364 -> 0 bytes .../shieldmod/textures/item/steel_shield.png~ | Bin 310 -> 0 bytes .../textures/item/tearstone_shield_test.png | Bin 0 -> 450 bytes 14 files changed, 45 insertions(+), 5 deletions(-) create mode 100644 src/main/resources/assets/shieldmod/textures/item/ammotearstone_shield_test.png delete mode 100644 src/main/resources/assets/shieldmod/textures/item/iron_shield_test.png~ delete mode 100644 src/main/resources/assets/shieldmod/textures/item/steel_shield.png~ create mode 100644 src/main/resources/assets/shieldmod/textures/item/tearstone_shield_test.png diff --git a/build.gradle b/build.gradle index 9aac69f..44c0107 100644 --- a/build.gradle +++ b/build.gradle @@ -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 { @@ -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" diff --git a/gradle.properties b/gradle.properties index 2f29458..1f1d962 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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 @@ -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 diff --git a/src/main/java/mizurin/shieldmod/ShieldMod.java b/src/main/java/mizurin/shieldmod/ShieldMod.java index 4230ae8..ca561f2 100644 --- a/src/main/java/mizurin/shieldmod/ShieldMod.java +++ b/src/main/java/mizurin/shieldmod/ShieldMod.java @@ -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"); diff --git a/src/main/java/mizurin/shieldmod/item/ShieldMaterials.java b/src/main/java/mizurin/shieldmod/item/ShieldMaterials.java index 086e176..c9800ad 100644 --- a/src/main/java/mizurin/shieldmod/item/ShieldMaterials.java +++ b/src/main/java/mizurin/shieldmod/item/ShieldMaterials.java @@ -25,4 +25,5 @@ public ToolMaterial setEfficiency(float efficiency, float guard) { this.guard = guard; return super.setEfficiency(efficiency, guard); } + } diff --git a/src/main/java/mizurin/shieldmod/item/Shields.java b/src/main/java/mizurin/shieldmod/item/Shields.java index 7b32a66..3f1d56f 100644 --- a/src/main/java/mizurin/shieldmod/item/Shields.java +++ b/src/main/java/mizurin/shieldmod/item/Shields.java @@ -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; @@ -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); @@ -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); @@ -145,5 +146,6 @@ public void initializeItems(){ })) .build(new ArmorColored("armor.boots.leather", 16429, ArmorMaterial.LEATHER, 3)); + } } diff --git a/src/main/java/mizurin/shieldmod/mixins/ShieldMixin.java b/src/main/java/mizurin/shieldmod/mixins/ShieldMixin.java index d2e4a6e..72f4b6a 100644 --- a/src/main/java/mizurin/shieldmod/mixins/ShieldMixin.java +++ b/src/main/java/mizurin/shieldmod/mixins/ShieldMixin.java @@ -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; @@ -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 ci) { diff --git a/src/main/java/mizurin/shieldmod/recipeColor.java b/src/main/java/mizurin/shieldmod/recipeColor.java index 64c819a..40a9e77 100644 --- a/src/main/java/mizurin/shieldmod/recipeColor.java +++ b/src/main/java/mizurin/shieldmod/recipeColor.java @@ -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; @@ -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> dyeMap = new HashMap<>(); private static final Map vanillaDye; + private static final Map 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 diff --git a/src/main/java/mizurin/shieldmod/recipes.java b/src/main/java/mizurin/shieldmod/recipes.java index fbcf716..4c71424 100644 --- a/src/main/java/mizurin/shieldmod/recipes.java +++ b/src/main/java/mizurin/shieldmod/recipes.java @@ -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; @@ -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> WORKBENCH = new RecipeGroup<>(new RecipeSymbol(new ItemStack(Block.workbench))); diff --git a/src/main/resources/assets/shieldmod/textures/armor/leather_1.png b/src/main/resources/assets/shieldmod/textures/armor/leather_1.png index 2042f070f028823521a8728f3f1ca2bf63f61dd8..450c835be41873545d5fc7a995b43c4af5cd31d9 100644 GIT binary patch delta 1190 zcmV;X1X=sI3eO3UIe&pkL_t(&L)Do{PQySDMLWR^Yv$=buw~8xK!^*mLaYHXY+=t; z5Hko?BmoSsrEirx36A3gNK27p_u%@~HT*7@T+kL47E(_(H#g&tj}JFAH00{_x*Hf6 zaOHB@@r<^&w^yy`hWVmH`B|@%NS*>uCDs~)XDZa9tvllibo zd&pu9`cbYp1VoH6I=hI0GM~mfQH1X4&kEX^E|6uWcK5XtT<7NI+~MJ&KWQScC^vml zB7c1%K8!($+}ksQJ!@Fz7*?gY#{x7){aNxCR)B<+-~xx>Q&Ur3D4A-r7-B(bErG^O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s%_x`;V0AC0KNN0cp7@^lYfT;!O z0ZY%xAmAd*KFsMOJ|2%2RiX}9M5zx@0HY%t&gZi`91b>C*5nlTd)YBj1Pow_xS~zb zqpA8g8VyGia0oe_PH#tfeesI60DNWwq;MOA1R5DYMt`tH_>SXnKA$IK4n-0@q+uf> z@v9nwFLV%%59Vd7?ZiLvr#dtqk25`HJ&WdtS|pLx0$3aiTCG+F7LbhD1^`e|91I3F z<_^JJzuy<1HqQV+yWP%wqvwAdqxj*N{S@Yq#bRN7mJdIfO#Z|$7bzl31Vsu97KvIs z#7WR$3vgiqOXgrBJ7s{r$*TWx75?pyxJa>RBC4iTS6bs!Kvi$pKJ|LteuoZQK;sKy z7(-On@@E173n&&0AV9En=$Ff-ZHacfZ8(UsqR#~1X-v-+!B3~tF?;-EEnf+JWl8)l RJiGt^002ovPDHLkV1o8U8an_0 diff --git a/src/main/resources/assets/shieldmod/textures/item/ammotearstone_shield_test.png b/src/main/resources/assets/shieldmod/textures/item/ammotearstone_shield_test.png new file mode 100644 index 0000000000000000000000000000000000000000..498db8f711156c0b4c5f519b5e64f7ce5d31d53e GIT binary patch literal 246 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9F5hd`K7RKu$QD7eDY z#WBRf|80OGUyFgj95sy<3LO6qaBmQu9=u#jpr)<pk zMDomy@3ymDD>WbAdFj9F|>96G0)1elgg zS+R=CGJT%r(gDDJ sT0Z~Ld-tD3-|{=F-{s%kFLZ;!UETEdu?KvNKsPgZy85}Sb4q9e02Iw(2mk;8 literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/shieldmod/textures/item/iron_shield_test.png~ b/src/main/resources/assets/shieldmod/textures/item/iron_shield_test.png~ deleted file mode 100644 index 1bea3ea1f143732b1b01b7c1e035a425ca4fda43..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 364 zcmV-y0h9iTP)>7J%UexZ>xx;GwO;bqgrW$$)G)%q*-1!2FBscaY}$FTP>80qzA*{DR^cr0C&` z?_ei`G=bP44ATrt3m7J0OAD|x0i)5=0LT!ElQPAb32W4lA_xH0v6`}Yf5$@r0000< KMNUMnLSTa2=$V=T diff --git a/src/main/resources/assets/shieldmod/textures/item/steel_shield.png~ b/src/main/resources/assets/shieldmod/textures/item/steel_shield.png~ deleted file mode 100644 index c8ffcab3023f90e0a126c9212abf59362049c320..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 310 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9F5hd`K7RKu$QDEPwD z#WBRfe`)Yt&gKLjAMg7vEV2hAMa&EG%zs>vlyPu8@_gFw2ToUR1o3ptxD#6^x-+w1 z+1_)~ck{Ekx65SyDj1$GUb*Vj)fc<`{)$vZs+>G*u!AZ0HdoSTn{1n~18-OkOkcLL zscX@M%vmY1*CS+I1CCB!p>6a?!I@=|!fmn81}C%67JW_aq7}7sSs2g@oZjSZ#I##?!U-S6mKR#5jrOgz*tm|Nu{2h@Guq;uWAuZPjauKb zjW6}{-e|rR`)Iwh)jbBGxqgy$1tUT8+I)ND$BS(ChW)0CO9Z zN+nb(6*is36q!s0JkKMa&o2j1Gl{F!DkhT&Tc2{dTn>UDEC;mPZJ4IXM6xU+o6TZ8 z9<%5A>h5m#0T}G5taU sq&hJqljG7N?!d6V@?~0d@%~l&1;kRHyR$?C-T(jq07*qoM6N<$f<(%{yZ`_I literal 0 HcmV?d00001