diff --git a/MORES-CHANGELOG.txt b/MORES-CHANGELOG.txt new file mode 100644 index 0000000..f544dce --- /dev/null +++ b/MORES-CHANGELOG.txt @@ -0,0 +1,6 @@ +v1.0.1 +- Added bronze armor to trimmable armor +- Updated full armor effects to show infinite instead of a countdown timer that keeps refreshing +- Updated item groups to match vanilla Minecraft item groups +- Fixed ruby tools burn effect tooltip (and added to tools) +- Harvest level (temporarily?) removed from tooltips on tools \ No newline at end of file diff --git a/build.gradle b/build.gradle index 3b197c6..66a1f13 100644 --- a/build.gradle +++ b/build.gradle @@ -82,7 +82,7 @@ dependencies { modImplementation "maven.modrinth:SfMw2IZN:UO1crPGk" //Custom Shields - modImplementation "com.github.CrimsonDawn45:Fabric-Shield-Lib:v${project.fabric_shield_lib_version}" + modImplementation "maven.modrinth:7SDalH12:xY16zX6k" modImplementation "com.terraformersmc:modmenu:${project.mod_menu_version}" modImplementation "maven.modrinth:midnightlib:${project.midnightlib_version}" modImplementation "com.github.Chocohead:Fabric-ASM:v${project.fabricasm_version}" diff --git a/gradle.properties b/gradle.properties index aa893c3..5fb7b14 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,7 @@ org.gradle.parallel=true # check these on https://fabricmc.net/develop minecraft_version=1.20.1 yarn_mappings=1.20.1+build.10 -loader_version=0.15.3 +loader_version=0.15.11 # Mod Properties mod_version=1.0.1 @@ -14,7 +14,7 @@ maven_group=mod.leronus.mores archives_base_name=mores # Dependencies -fabric_version=0.91.0+1.20.1 +fabric_version=0.92.2+1.20.1 sodium_version=mc1.20.1-0.5.3 fabric_shield_lib_version=1.7.2-1.20.1 diff --git a/src/main/java/mod/leronus/mores/item/custom/ModAxeItem.java b/src/main/java/mod/leronus/mores/item/custom/ModAxeItem.java index 8d262a3..17da187 100644 --- a/src/main/java/mod/leronus/mores/item/custom/ModAxeItem.java +++ b/src/main/java/mod/leronus/mores/item/custom/ModAxeItem.java @@ -1,8 +1,12 @@ package mod.leronus.mores.item.custom; import mod.leronus.mores.item.ModArmorMaterials; +import mod.leronus.mores.item.ModItems; import mod.leronus.mores.item.ModToolMaterials; import net.minecraft.client.item.TooltipContext; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.effect.StatusEffectInstance; +import net.minecraft.entity.effect.StatusEffects; import net.minecraft.item.AxeItem; import net.minecraft.item.ItemStack; import net.minecraft.item.MiningToolItem; @@ -19,6 +23,19 @@ public ModAxeItem(ToolMaterial material, float attackDamage, float attackSpeed, super(material, attackDamage, attackSpeed, settings); } + @Override + public boolean postHit(ItemStack stack, LivingEntity target, LivingEntity attacker) { + //If the item is an onyx battleaxe, apply wither effect on targetEntity + if(stack.getItem() == ModItems.ONYX_AXE) { + target.addStatusEffect(new StatusEffectInstance(StatusEffects.WITHER, 250, 1, false, false)); + } + //If the item is a ruby sword, apply fire effect on targetEntity + if(stack.getItem() == ModItems.RUBY_AXE) { + target.setOnFireFor(5); + } + return super.postHit(stack, target, attacker); + } + @Override public void appendTooltip(ItemStack stack, @Nullable World world, List tooltip, TooltipContext context) { if (stack.getItem() instanceof MiningToolItem item) { diff --git a/src/main/java/mod/leronus/mores/item/custom/ModBattleAxeItem.java b/src/main/java/mod/leronus/mores/item/custom/ModBattleAxeItem.java index 1516f09..e78ba4e 100644 --- a/src/main/java/mod/leronus/mores/item/custom/ModBattleAxeItem.java +++ b/src/main/java/mod/leronus/mores/item/custom/ModBattleAxeItem.java @@ -1,12 +1,13 @@ package mod.leronus.mores.item.custom; import mod.leronus.mores.item.ModItems; +import mod.leronus.mores.item.ModToolMaterials; import net.minecraft.client.item.TooltipContext; import net.minecraft.enchantment.EnchantmentHelper; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.item.SwordItem; -import net.minecraft.item.ToolMaterial; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.effect.StatusEffectInstance; +import net.minecraft.entity.effect.StatusEffects; +import net.minecraft.item.*; import net.minecraft.text.Text; import net.minecraft.util.Formatting; import net.minecraft.world.World; @@ -18,6 +19,25 @@ public class ModBattleAxeItem extends SwordItem { public ModBattleAxeItem(ToolMaterial toolMaterial, int attackDamageModifier, float attackSpeedModifier, Item.Settings settings) { super(toolMaterial, attackDamageModifier, attackSpeedModifier, settings); } + /** + * Called when an enemy is attacked using the sword + * @param stack Itemstack used to attack with + * @param target Target entity that is being attacked + * @param attacker The entity attacking the enemy + * @return Hurt enemy + */ + @Override + public boolean postHit(ItemStack stack, LivingEntity target, LivingEntity attacker) { + //If the item is an onyx battleaxe, apply wither effect on targetEntity + if(stack.getItem() == ModItems.ONYX_BATTLEAXE) { + target.addStatusEffect(new StatusEffectInstance(StatusEffects.WITHER, 250, 1, false, false)); + } + //If the item is a ruby sword, apply fire effect on targetEntity + if(stack.getItem() == ModItems.RUBY_BATTLEAXE) { + target.setOnFireFor(5); + } + return super.postHit(stack, target, attacker); + } @Override public void appendTooltip(ItemStack stack, @Nullable World world, List tooltip, TooltipContext context) { @@ -28,9 +48,9 @@ public void appendTooltip(ItemStack stack, @Nullable World world, List too // } tooltip.add(Text.literal("")); tooltip.add(Text.translatable("mores.durability").formatted(Formatting.GRAY).append(Text.translatable(String.valueOf(stack.getItem().getMaxDamage())).formatted(Formatting.LIGHT_PURPLE))); -// if (stack.getItem() == ModItems.RUBY_SWORD || stack.getItem() == ModItems.RUBY_MACE || stack.getItem() == ModItems.RUBY_BATTLEAXE || stack.getItem() == ModItems.RUBY_DAGGER) { -// tooltip.add(Text.translatable(Formatting.GRAY + "mores.bonus" + Formatting.RED + "Burn Effect")); -// } + if (((ToolItem) stack.getItem()).getMaterial() == ModToolMaterials.RUBY) { + tooltip.add(Text.translatable("mores.bonus").formatted(Formatting.GRAY).append(Text.translatable("mores.burn_effect").formatted(Formatting.RED))); + } } } } diff --git a/src/main/java/mod/leronus/mores/item/custom/ModHoeItem.java b/src/main/java/mod/leronus/mores/item/custom/ModHoeItem.java index 533d777..2f9c785 100644 --- a/src/main/java/mod/leronus/mores/item/custom/ModHoeItem.java +++ b/src/main/java/mod/leronus/mores/item/custom/ModHoeItem.java @@ -1,7 +1,11 @@ package mod.leronus.mores.item.custom; +import mod.leronus.mores.item.ModItems; import mod.leronus.mores.item.ModToolMaterials; import net.minecraft.client.item.TooltipContext; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.effect.StatusEffectInstance; +import net.minecraft.entity.effect.StatusEffects; import net.minecraft.item.HoeItem; import net.minecraft.item.ItemStack; import net.minecraft.item.MiningToolItem; @@ -18,6 +22,19 @@ public ModHoeItem(ToolMaterial material, int attackDamage, float attackSpeed, Se super(material, attackDamage, attackSpeed, settings); } + @Override + public boolean postHit(ItemStack stack, LivingEntity target, LivingEntity attacker) { + //If the item is an onyx battleaxe, apply wither effect on targetEntity + if(stack.getItem() == ModItems.ONYX_HOE) { + target.addStatusEffect(new StatusEffectInstance(StatusEffects.WITHER, 250, 1, false, false)); + } + //If the item is a ruby sword, apply fire effect on targetEntity + if(stack.getItem() == ModItems.RUBY_HOE) { + target.setOnFireFor(5); + } + return super.postHit(stack, target, attacker); + } + @Override public void appendTooltip(ItemStack stack, @Nullable World world, List tooltip, TooltipContext context) { if (stack.getItem() instanceof MiningToolItem item) { diff --git a/src/main/java/mod/leronus/mores/item/custom/ModPickaxeItem.java b/src/main/java/mod/leronus/mores/item/custom/ModPickaxeItem.java index 9329d0f..4d02ce2 100644 --- a/src/main/java/mod/leronus/mores/item/custom/ModPickaxeItem.java +++ b/src/main/java/mod/leronus/mores/item/custom/ModPickaxeItem.java @@ -1,7 +1,11 @@ package mod.leronus.mores.item.custom; +import mod.leronus.mores.item.ModItems; import mod.leronus.mores.item.ModToolMaterials; import net.minecraft.client.item.TooltipContext; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.effect.StatusEffectInstance; +import net.minecraft.entity.effect.StatusEffects; import net.minecraft.item.ItemStack; import net.minecraft.item.MiningToolItem; import net.minecraft.item.PickaxeItem; @@ -18,6 +22,19 @@ public ModPickaxeItem(ToolMaterial material, int attackDamage, float attackSpeed super(material, attackDamage, attackSpeed, settings); } + @Override + public boolean postHit(ItemStack stack, LivingEntity target, LivingEntity attacker) { + //If the item is an onyx battleaxe, apply wither effect on targetEntity + if(stack.getItem() == ModItems.ONYX_PICKAXE) { + target.addStatusEffect(new StatusEffectInstance(StatusEffects.WITHER, 250, 1, false, false)); + } + //If the item is a ruby sword, apply fire effect on targetEntity + if(stack.getItem() == ModItems.RUBY_PICKAXE) { + target.setOnFireFor(5); + } + return super.postHit(stack, target, attacker); + } + @Override public void appendTooltip(ItemStack stack, @Nullable World world, List tooltip, TooltipContext context) { if (stack.getItem() instanceof MiningToolItem item) { diff --git a/src/main/java/mod/leronus/mores/item/custom/ModShovelItem.java b/src/main/java/mod/leronus/mores/item/custom/ModShovelItem.java index 0f21290..745a5d2 100644 --- a/src/main/java/mod/leronus/mores/item/custom/ModShovelItem.java +++ b/src/main/java/mod/leronus/mores/item/custom/ModShovelItem.java @@ -1,7 +1,11 @@ package mod.leronus.mores.item.custom; +import mod.leronus.mores.item.ModItems; import mod.leronus.mores.item.ModToolMaterials; import net.minecraft.client.item.TooltipContext; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.effect.StatusEffectInstance; +import net.minecraft.entity.effect.StatusEffects; import net.minecraft.item.ItemStack; import net.minecraft.item.MiningToolItem; import net.minecraft.item.ShovelItem; @@ -18,6 +22,19 @@ public ModShovelItem(ToolMaterial material, float attackDamage, float attackSpee super(material, attackDamage, attackSpeed, settings); } + @Override + public boolean postHit(ItemStack stack, LivingEntity target, LivingEntity attacker) { + //If the item is an onyx battleaxe, apply wither effect on targetEntity + if(stack.getItem() == ModItems.ONYX_SHOVEL) { + target.addStatusEffect(new StatusEffectInstance(StatusEffects.WITHER, 250, 1, false, false)); + } + //If the item is a ruby sword, apply fire effect on targetEntity + if(stack.getItem() == ModItems.RUBY_SHOVEL) { + target.setOnFireFor(5); + } + return super.postHit(stack, target, attacker); + } + @Override public void appendTooltip(ItemStack stack, @Nullable World world, List tooltip, TooltipContext context) { if (stack.getItem() instanceof MiningToolItem item) { diff --git a/src/main/java/mod/leronus/mores/item/custom/ModSwordItem.java b/src/main/java/mod/leronus/mores/item/custom/ModSwordItem.java index 23a4612..f83fd74 100644 --- a/src/main/java/mod/leronus/mores/item/custom/ModSwordItem.java +++ b/src/main/java/mod/leronus/mores/item/custom/ModSwordItem.java @@ -3,6 +3,7 @@ import com.google.common.collect.ImmutableMultimap; import com.google.common.collect.Multimap; import mod.leronus.mores.item.ModItems; +import mod.leronus.mores.item.ModToolMaterials; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.client.item.TooltipContext; @@ -13,10 +14,7 @@ import net.minecraft.entity.attribute.EntityAttributes; import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.entity.effect.StatusEffects; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.item.SwordItem; -import net.minecraft.item.ToolMaterial; +import net.minecraft.item.*; import net.minecraft.registry.tag.BlockTags; import net.minecraft.text.Text; import net.minecraft.util.Formatting; @@ -56,15 +54,15 @@ public Multimap getAttributeModifiers( @Override public void appendTooltip(ItemStack stack, @Nullable World world, List tooltip, TooltipContext context) { - if (stack.getItem() instanceof ModSwordItem){ - tooltip.add(Text.literal("")); - if (stack.getItem() == ModItems.ONYX_SWORD || stack.getItem() == ModItems.ONYX_MACE || stack.getItem() == ModItems.ONYX_DAGGER) { - tooltip.add(Text.translatable("mores.bonus").formatted(Formatting.GRAY).append(Text.translatable("mores.wither_effect").formatted(Formatting.DARK_GRAY))); - } - tooltip.add(Text.literal("")); - tooltip.add(Text.translatable("mores.durability").formatted(Formatting.GRAY).append(Text.translatable(String.valueOf(stack.getItem().getMaxDamage())).formatted(Formatting.LIGHT_PURPLE))); - if (stack.getItem() == ModItems.RUBY_SWORD || stack.getItem() == ModItems.RUBY_MACE || stack.getItem() == ModItems.RUBY_BATTLEAXE || stack.getItem() == ModItems.RUBY_DAGGER) { - tooltip.add(Text.translatable(Formatting.GRAY + "mores.bonus" + Formatting.RED + "Burn Effect")); + if (stack.getItem() instanceof ToolItem){ + tooltip.add(Text.literal("")); + if (stack.getItem() == ModItems.ONYX_SWORD || stack.getItem() == ModItems.ONYX_MACE || stack.getItem() == ModItems.ONYX_DAGGER) { + tooltip.add(Text.translatable("mores.bonus").formatted(Formatting.GRAY).append(Text.translatable("mores.wither_effect").formatted(Formatting.DARK_GRAY))); + } + tooltip.add(Text.literal("")); + tooltip.add(Text.translatable("mores.durability").formatted(Formatting.GRAY).append(Text.translatable(String.valueOf(stack.getItem().getMaxDamage())).formatted(Formatting.LIGHT_PURPLE))); + if (((ToolItem) stack.getItem()).getMaterial() == ModToolMaterials.RUBY) { + tooltip.add(Text.translatable("mores.bonus").formatted(Formatting.GRAY).append(Text.translatable("mores.burn_effect").formatted(Formatting.RED))); } } } diff --git a/src/main/resources/assets/mores/lang/en_gb.json b/src/main/resources/assets/mores/lang/en_gb.json index 81106a7..968d410 100644 --- a/src/main/resources/assets/mores/lang/en_gb.json +++ b/src/main/resources/assets/mores/lang/en_gb.json @@ -18,6 +18,7 @@ "mores.night_vision": "Night Vision", "mores.water_effects": "Water Breathing & Dolphins", "mores.wither_effect": "Wither Effect", + "mores.burn_effect": "Burn Effect", "mores.auto_smelt": "Automatic Smelting", diff --git a/src/main/resources/assets/mores/lang/en_us.json b/src/main/resources/assets/mores/lang/en_us.json index 6a63d5d..58eb741 100644 --- a/src/main/resources/assets/mores/lang/en_us.json +++ b/src/main/resources/assets/mores/lang/en_us.json @@ -18,6 +18,7 @@ "mores.night_vision": "Night Vision", "mores.water_effects": "Water Breathing & Dolphins", "mores.wither_effect": "Wither Effect", + "mores.burn_effect": "Burn Effect", "mores.auto_smelt": "Automatic Smelting", diff --git a/src/main/resources/assets/mores/lang/nl_nl.json b/src/main/resources/assets/mores/lang/nl_nl.json index 33d528f..37bcec6 100644 --- a/src/main/resources/assets/mores/lang/nl_nl.json +++ b/src/main/resources/assets/mores/lang/nl_nl.json @@ -18,6 +18,7 @@ "mores.night_vision": "Nachtzicht", "mores.water_effects": "Wateradem & Gunst der dolfijnen", "mores.wither_effect": "Verschrompelingseffect", + "mores.burn_effect": "Verbrandingseffect", "mores.auto_smelt": "Automatisch Smelten", "sound.mores.living_duck_sound" : "Eend kwaakt", diff --git a/src/main/resources/assets/mores/lang/zh_cn.json b/src/main/resources/assets/mores/lang/zh_cn.json index 1ca024c..6a7e013 100644 --- a/src/main/resources/assets/mores/lang/zh_cn.json +++ b/src/main/resources/assets/mores/lang/zh_cn.json @@ -18,6 +18,7 @@ "mores.night_vision": "夜视", "mores.water_effects": "水下呼吸 & 海豚的恩惠", "mores.wither_effect": "凋零", + "mores.burn_effect": "Burn Effect", "mores.auto_smelt": "自动熔炼", diff --git a/src/main/resources/data/minecraft/tags/items/trimmable_armor.json b/src/main/resources/data/minecraft/tags/items/trimmable_armor.json index cf3d68f..a80f2f7 100644 --- a/src/main/resources/data/minecraft/tags/items/trimmable_armor.json +++ b/src/main/resources/data/minecraft/tags/items/trimmable_armor.json @@ -33,6 +33,10 @@ "mores:copper_chestplate", "mores:copper_leggings", "mores:copper_boots", + "mores:bronze_helmet", + "mores:bronze_chestplate", + "mores:bronze_leggings", + "mores:bronze_boots", "mores:silver_helmet", "mores:silver_chestplate", "mores:silver_leggings",