diff --git a/src/main/java/net/atlas/combatify/Combatify.java b/src/main/java/net/atlas/combatify/Combatify.java index 05fccfae..c5f77eea 100644 --- a/src/main/java/net/atlas/combatify/Combatify.java +++ b/src/main/java/net/atlas/combatify/Combatify.java @@ -6,6 +6,7 @@ import net.atlas.combatify.enchantment.PiercingEnchantment; import net.atlas.combatify.extensions.ItemExtensions; import net.atlas.combatify.item.ItemRegistry; +import net.atlas.combatify.item.TieredShieldItem; import net.atlas.combatify.networking.NetworkingHandler; import net.atlas.combatify.util.*; import net.fabricmc.api.ModInitializer; @@ -36,6 +37,7 @@ public class Combatify implements ModInitializer { public static ItemConfig ITEMS; public static ResourceLocation modDetectionNetworkChannel = id("networking"); public NetworkingHandler networkingHandler; + public static final List shields = new ArrayListExtensions<>(); public static final List unmoddedPlayers = new ArrayListExtensions<>(); public static final Map isPlayerAttacking = new HashMap<>(); public static final Map finalizingAttack = new HashMap<>(); @@ -64,6 +66,11 @@ public void onInitialize() { Event event = ItemGroupEvents.modifyEntriesEvent(CreativeModeTabs.COMBAT); event.register(entries -> entries.addAfter(NETHERITE_SWORD, ItemRegistry.WOODEN_KNIFE, ItemRegistry.STONE_KNIFE, ItemRegistry.IRON_KNIFE, ItemRegistry.GOLD_KNIFE, ItemRegistry.DIAMOND_KNIFE, ItemRegistry.NETHERITE_KNIFE, ItemRegistry.WOODEN_LONGSWORD, ItemRegistry.STONE_LONGSWORD, ItemRegistry.IRON_LONGSWORD, ItemRegistry.GOLD_LONGSWORD, ItemRegistry.DIAMOND_LONGSWORD, ItemRegistry.NETHERITE_LONGSWORD)); } + if (CONFIG.tieredShields()) { + TieredShieldItem.init(); + Event event = ItemGroupEvents.modifyEntriesEvent(CreativeModeTabs.COMBAT); + event.register(entries -> entries.addAfter(Items.SHIELD, TieredShieldItem.WOODEN_SHIELD, TieredShieldItem.IRON_SHIELD, TieredShieldItem.GOLD_SHIELD, TieredShieldItem.DIAMOND_SHIELD, TieredShieldItem.NETHERITE_SHIELD)); + } if(CONFIG.piercer()) { PiercingEnchantment.registerEnchants(); } diff --git a/src/main/java/net/atlas/combatify/CombatifyClient.java b/src/main/java/net/atlas/combatify/CombatifyClient.java index 1c2b60d6..2b86f84f 100644 --- a/src/main/java/net/atlas/combatify/CombatifyClient.java +++ b/src/main/java/net/atlas/combatify/CombatifyClient.java @@ -5,8 +5,12 @@ import net.atlas.combatify.extensions.IOptions; import net.atlas.combatify.networking.ClientNetworkingHandler; import net.fabricmc.api.ClientModInitializer; +import net.fabricmc.fabric.api.client.rendering.v1.EntityModelLayerRegistry; import net.minecraft.client.OptionInstance; +import net.minecraft.client.model.ShieldModel; +import net.minecraft.client.model.geom.ModelLayerLocation; import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; import java.util.Arrays; import java.util.Objects; @@ -14,6 +18,11 @@ import static net.minecraft.client.Options.genericValueLabel; public class CombatifyClient implements ClientModInitializer { + public static final ModelLayerLocation WOODEN_SHIELD_MODEL_LAYER = new ModelLayerLocation(new ResourceLocation("combatify", "wooden_shield"),"main"); + public static final ModelLayerLocation IRON_SHIELD_MODEL_LAYER = new ModelLayerLocation(new ResourceLocation("combatify", "iron_shield"),"main"); + public static final ModelLayerLocation GOLDEN_SHIELD_MODEL_LAYER = new ModelLayerLocation(new ResourceLocation("combatify", "golden_shield"),"main"); + public static final ModelLayerLocation DIAMOND_SHIELD_MODEL_LAYER = new ModelLayerLocation(new ResourceLocation("combatify", "diamond_shield"),"main"); + public static final ModelLayerLocation NETHERITE_SHIELD_MODEL_LAYER = new ModelLayerLocation(new ResourceLocation("combatify", "netherite_shield"),"main"); public static final OptionInstance autoAttack = OptionInstance.createBoolean("options.autoAttack", true); public static final OptionInstance shieldCrouch = OptionInstance.createBoolean("options.shieldCrouch", true); public static final OptionInstance rhythmicAttacks = OptionInstance.createBoolean("options.rhythmicAttack",true); @@ -44,5 +53,12 @@ public class CombatifyClient implements ClientModInitializer { @Override public void onInitializeClient() { clientNetworkingHandler = new ClientNetworkingHandler(); + if (Combatify.CONFIG.tieredShields()) { + EntityModelLayerRegistry.registerModelLayer(WOODEN_SHIELD_MODEL_LAYER, ShieldModel::createLayer); + EntityModelLayerRegistry.registerModelLayer(IRON_SHIELD_MODEL_LAYER, ShieldModel::createLayer); + EntityModelLayerRegistry.registerModelLayer(GOLDEN_SHIELD_MODEL_LAYER, ShieldModel::createLayer); + EntityModelLayerRegistry.registerModelLayer(DIAMOND_SHIELD_MODEL_LAYER, ShieldModel::createLayer); + EntityModelLayerRegistry.registerModelLayer(NETHERITE_SHIELD_MODEL_LAYER, ShieldModel::createLayer); + } } } diff --git a/src/main/java/net/atlas/combatify/config/CombatifyConfigModel.java b/src/main/java/net/atlas/combatify/config/CombatifyConfigModel.java index 4832a054..ce3712c3 100644 --- a/src/main/java/net/atlas/combatify/config/CombatifyConfigModel.java +++ b/src/main/java/net/atlas/combatify/config/CombatifyConfigModel.java @@ -26,6 +26,8 @@ public class CombatifyConfigModel { @RestartRequired public boolean configOnlyWeapons = false; @RestartRequired + public boolean tieredShields = false; + @RestartRequired public boolean piercer = false; @RestartRequired public boolean defender = false; diff --git a/src/main/java/net/atlas/combatify/config/ConfigurableItemData.java b/src/main/java/net/atlas/combatify/config/ConfigurableItemData.java index b1f8a056..69b5e8da 100644 --- a/src/main/java/net/atlas/combatify/config/ConfigurableItemData.java +++ b/src/main/java/net/atlas/combatify/config/ConfigurableItemData.java @@ -15,7 +15,8 @@ public class ConfigurableItemData { public final BlockingType blockingType; public final Double blockStrength; public final Double blockKbRes; - ConfigurableItemData(Double attackDamage, Double attackSpeed, Double attackReach, Double chargedReach, Integer stackSize, Integer cooldown, Boolean cooldownAfter, WeaponType weaponType, BlockingType blockingType, Double blockStrength, Double blockKbRes) { + public final Integer enchantability; + ConfigurableItemData(Double attackDamage, Double attackSpeed, Double attackReach, Double chargedReach, Integer stackSize, Integer cooldown, Boolean cooldownAfter, WeaponType weaponType, BlockingType blockingType, Double blockStrength, Double blockKbRes, Integer enchantability) { damage = clamp(attackDamage, -10, 1000); speed = clamp(attackSpeed, -1, 7.5); reach = clamp(attackReach, 0, 1024); @@ -27,6 +28,7 @@ public class ConfigurableItemData { this.blockingType = blockingType; this.blockStrength = clamp(blockStrength, 0, 1000); this.blockKbRes = clamp(blockKbRes, 0, 1); + this.enchantability = clamp(enchantability, 0, 1000); } public static Integer clamp(Integer i, int j, int k) { if (i == null) diff --git a/src/main/java/net/atlas/combatify/config/ItemConfig.java b/src/main/java/net/atlas/combatify/config/ItemConfig.java index a8c6d9cd..df6eafa2 100644 --- a/src/main/java/net/atlas/combatify/config/ItemConfig.java +++ b/src/main/java/net/atlas/combatify/config/ItemConfig.java @@ -311,6 +311,7 @@ public void loadFromNetwork(FriendlyByteBuf buf) { BlockingType bType = Combatify.registeredTypes.get(ResourceLocation.tryParse(blockingType)); Double blockStrength = buf1.readDouble(); Double blockKbRes = buf1.readDouble(); + Integer enchantlevel = buf1.readInt(); if(damage == -100) damage = null; if(speed == -10) @@ -330,7 +331,7 @@ public void loadFromNetwork(FriendlyByteBuf buf) { switch (weaponType) { case "SWORD", "LONGSWORD", "AXE", "PICKAXE", "HOE", "SHOVEL", "KNIFE", "TRIDENT" -> type = WeaponType.fromID(weaponType); } - return new ConfigurableItemData(damage, speed, reach, chargedReach, stackSize, cooldown, cooldownAfter, type, bType, blockStrength, blockKbRes); + return new ConfigurableItemData(damage, speed, reach, chargedReach, stackSize, cooldown, cooldownAfter, type, bType, blockStrength, blockKbRes, enchantlevel); }); configuredWeapons = buf.readMap(buf1 -> WeaponType.fromID(buf1.readUtf()), buf1 -> { Double damageOffset = buf1.readDouble(); @@ -378,6 +379,7 @@ public void saveToNetwork(FriendlyByteBuf buf) { buf12.writeUtf(configurableItemData.blockingType == null ? "blank" : configurableItemData.blockingType.getName().toString()); buf12.writeDouble(configurableItemData.blockStrength == null ? -10 : configurableItemData.blockStrength); buf12.writeDouble(configurableItemData.blockKbRes == null ? -10 : configurableItemData.blockKbRes); + buf12.writeInt(configurableItemData.enchantability == null ? -10 : configurableItemData.enchantability); }); buf.writeMap(configuredWeapons, (buf1, type) -> buf1.writeUtf(type.name()), (buf12, configurableWeaponData) -> { buf12.writeDouble(configurableWeaponData.damageOffset == null ? -10 : configurableWeaponData.damageOffset); @@ -401,6 +403,7 @@ public void parseItemConfig(Item item, JsonObject jsonObject) { BlockingType blockingType = null; Double blockStrength = null; Double blockKbRes = null; + Integer enchantment_level = null; if (jsonObject.has("damage")) damage = getDouble(jsonObject, "damage"); if (jsonObject.has("speed")) @@ -450,7 +453,9 @@ public void parseItemConfig(Item item, JsonObject jsonObject) { blockStrength = getDouble(jsonObject, "damage_protection"); if (jsonObject.has("block_knockback_resistance")) blockKbRes = getDouble(jsonObject, "block_knockback_resistance"); - ConfigurableItemData configurableItemData = new ConfigurableItemData(damage, speed, reach, chargedReach, stack_size, cooldown, cooldownAfterUse, type, blockingType, blockStrength, blockKbRes); + if (jsonObject.has("enchantment_level")) + cooldown = getInt(jsonObject, "enchantment_level"); + ConfigurableItemData configurableItemData = new ConfigurableItemData(damage, speed, reach, chargedReach, stack_size, cooldown, cooldownAfterUse, type, blockingType, blockStrength, blockKbRes, enchantment_level); configuredItems.put(item, configurableItemData); } } diff --git a/src/main/java/net/atlas/combatify/enchantment/DefendingEnchantment.java b/src/main/java/net/atlas/combatify/enchantment/DefendingEnchantment.java index 941b1498..b9d6e306 100644 --- a/src/main/java/net/atlas/combatify/enchantment/DefendingEnchantment.java +++ b/src/main/java/net/atlas/combatify/enchantment/DefendingEnchantment.java @@ -28,7 +28,7 @@ public int getMaxCost(int level) { @Override public boolean canEnchant(ItemStack stack) { - return stack.getItem() instanceof ItemExtensions; + return !((ItemExtensions) stack.getItem()).getBlockingType().isEmpty(); } @Override diff --git a/src/main/java/net/atlas/combatify/extensions/Tierable.java b/src/main/java/net/atlas/combatify/extensions/Tierable.java new file mode 100644 index 00000000..7894a89a --- /dev/null +++ b/src/main/java/net/atlas/combatify/extensions/Tierable.java @@ -0,0 +1,7 @@ +package net.atlas.combatify.extensions; + +import net.minecraft.world.item.Tier; + +public interface Tierable { + Tier getTier(); +} diff --git a/src/main/java/net/atlas/combatify/item/TieredShieldItem.java b/src/main/java/net/atlas/combatify/item/TieredShieldItem.java new file mode 100644 index 00000000..7fb64777 --- /dev/null +++ b/src/main/java/net/atlas/combatify/item/TieredShieldItem.java @@ -0,0 +1,95 @@ +package net.atlas.combatify.item; + +import net.atlas.combatify.Combatify; +import net.atlas.combatify.config.ConfigurableItemData; +import net.atlas.combatify.config.ConfigurableWeaponData; +import net.atlas.combatify.extensions.ItemExtensions; +import net.atlas.combatify.extensions.LivingEntityExtensions; +import net.atlas.combatify.extensions.Tierable; +import net.atlas.combatify.util.BlockingType; +import net.fabricmc.api.EnvType; +import net.fabricmc.loader.api.FabricLoader; +import net.minecraft.client.renderer.item.ItemProperties; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.*; + +import static net.atlas.combatify.Combatify.id; +import static net.atlas.combatify.Combatify.shields; +import static net.atlas.combatify.item.ItemRegistry.registerItem; + +public class TieredShieldItem extends ShieldItem implements Tierable, ItemExtensions { + public final Tier tier; + public static final Item WOODEN_SHIELD = registerItem(id("wooden_shield"), new TieredShieldItem(Tiers.WOOD, new Item.Properties().durability(Tiers.WOOD.getUses() * 6))); + public static final Item IRON_SHIELD = registerItem(id("iron_shield"), new TieredShieldItem(Tiers.IRON, new Item.Properties().durability(Tiers.IRON.getUses() * 6))); + public static final Item GOLD_SHIELD = registerItem(id("golden_shield"), new TieredShieldItem(Tiers.GOLD, new Item.Properties().durability(Tiers.GOLD.getUses() * 6))); + public static final Item DIAMOND_SHIELD = registerItem(id("diamond_shield"), new TieredShieldItem(Tiers.DIAMOND, new Item.Properties().durability(Tiers.DIAMOND.getUses() * 6))); + public static final Item NETHERITE_SHIELD = registerItem(id("netherite_shield"), new TieredShieldItem(Tiers.NETHERITE, new Item.Properties().durability(Tiers.NETHERITE.getUses() * 6).fireResistant())); + + public TieredShieldItem(Tier tier, Properties properties) { + super(properties); + this.tier = tier; + shields.add(this); + if(FabricLoader.getInstance().getEnvironmentType() == EnvType.CLIENT) + registerModelPredicate(); + } + + private void registerModelPredicate() { + ItemProperties.register(this, new ResourceLocation("blocking"), (itemStack, clientWorld, livingEntity, i) -> + livingEntity != null && livingEntity.isUsingItem() && ((LivingEntityExtensions)livingEntity).getBlockingItem() == itemStack ? 1.0F : 0.0F); + } + + + public int getEnchantmentValue() { + return this.tier.getEnchantmentValue(); + } + + public boolean isValidRepairItem(ItemStack itemStack, ItemStack itemStack2) { + return this.tier.getRepairIngredient().test(itemStack2); + } + + @Override + public Tier getTier() { + return tier; + } + public static void init() { + + } + + @Override + public void setStackSize(int stackSize) { + this.maxStackSize = stackSize; + } + + @Override + public double getChargedAttackBonus() { + Item item = this; + double chargedBonus = 1.0; + if(Combatify.ITEMS.configuredItems.containsKey(item)) { + ConfigurableItemData configurableItemData = Combatify.ITEMS.configuredItems.get(item); + if (configurableItemData.type != null) + if (Combatify.ITEMS.configuredWeapons.containsKey(configurableItemData.type)) + if (Combatify.ITEMS.configuredWeapons.get(configurableItemData.type).chargedReach != null) + chargedBonus = Combatify.ITEMS.configuredWeapons.get(configurableItemData.type).chargedReach; + if (configurableItemData.chargedReach != null) + chargedBonus = configurableItemData.chargedReach; + } + return chargedBonus; + } + + @Override + public BlockingType getBlockingType() { + if(Combatify.ITEMS != null && Combatify.ITEMS.configuredItems.containsKey(this)) { + ConfigurableItemData configurableItemData = Combatify.ITEMS.configuredItems.get(this); + if (configurableItemData.blockingType != null) { + return configurableItemData.blockingType; + } + if (configurableItemData.type != null && Combatify.ITEMS.configuredWeapons.containsKey(configurableItemData.type)) { + ConfigurableWeaponData configurableWeaponData = Combatify.ITEMS.configuredWeapons.get(configurableItemData.type); + if (configurableWeaponData.blockingType != null) { + return configurableWeaponData.blockingType; + } + } + } + return Combatify.registeredTypes.get(new ResourceLocation("new_shield")); + } +} diff --git a/src/main/java/net/atlas/combatify/mixin/EnchantmentHelperMixin.java b/src/main/java/net/atlas/combatify/mixin/EnchantmentHelperMixin.java index 92e3f4ab..2b9a486f 100644 --- a/src/main/java/net/atlas/combatify/mixin/EnchantmentHelperMixin.java +++ b/src/main/java/net/atlas/combatify/mixin/EnchantmentHelperMixin.java @@ -2,7 +2,10 @@ import com.llamalad7.mixinextras.injector.ModifyExpressionValue; import com.llamalad7.mixinextras.sugar.Local; +import net.atlas.combatify.Combatify; +import net.atlas.combatify.config.ConfigurableItemData; import net.atlas.combatify.extensions.CustomEnchantment; +import net.atlas.combatify.extensions.ItemExtensions; import net.atlas.combatify.util.CustomEnchantmentHelper; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.enchantment.Enchantment; @@ -10,11 +13,38 @@ import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; +@SuppressWarnings("unused") @Mixin(EnchantmentHelper.class) public abstract class EnchantmentHelperMixin implements CustomEnchantmentHelper { - @SuppressWarnings("unused") @ModifyExpressionValue(method = "getAvailableEnchantmentResults", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/item/enchantment/EnchantmentCategory;canEnchant(Lnet/minecraft/world/item/Item;)Z")) private static boolean redirectCanEnchant(boolean original, @Local(ordinal = 0) Enchantment currentEnchantment, @Local(ordinal = 0) ItemStack itemStack) { return currentEnchantment instanceof CustomEnchantment customEnchantment && itemStack != null ? customEnchantment.isAcceptibleConditions(itemStack) : original; } + + @ModifyExpressionValue(method = "getEnchantmentCost", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/item/Item;getEnchantmentValue()I")) + private static int getEnchantmentValue(int original, @Local(ordinal = 0) ItemStack stack) { + if(Combatify.ITEMS != null && Combatify.ITEMS.configuredItems.containsKey(stack.getItem())) { + ConfigurableItemData configurableItemData = Combatify.ITEMS.configuredItems.get(stack.getItem()); + if (configurableItemData.enchantability != null) { + return configurableItemData.enchantability; + } + } + if(!((ItemExtensions)stack.getItem()).getBlockingType().isEmpty() && original == 0) { + return 14; + } + return original; + } + @ModifyExpressionValue(method = "selectEnchantment", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/item/Item;getEnchantmentValue()I")) + private static int getEnchantmentValue1(int original, @Local(ordinal = 0) ItemStack stack) { + if(Combatify.ITEMS != null && Combatify.ITEMS.configuredItems.containsKey(stack.getItem())) { + ConfigurableItemData configurableItemData = Combatify.ITEMS.configuredItems.get(stack.getItem()); + if (configurableItemData.enchantability != null) { + return configurableItemData.enchantability; + } + } + if(!((ItemExtensions)stack.getItem()).getBlockingType().isEmpty() && original == 0) { + return 14; + } + return original; + } } diff --git a/src/main/java/net/atlas/combatify/mixin/ItemStackMixin.java b/src/main/java/net/atlas/combatify/mixin/ItemStackMixin.java index d09b8488..9a3cd247 100644 --- a/src/main/java/net/atlas/combatify/mixin/ItemStackMixin.java +++ b/src/main/java/net/atlas/combatify/mixin/ItemStackMixin.java @@ -44,6 +44,9 @@ public abstract class ItemStackMixin { @Final public static DecimalFormat ATTRIBUTE_MODIFIER_FORMAT; + @Shadow + public abstract boolean isEnchanted(); + @Inject(method = "getTooltipLines", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/item/ItemStack;hasTag()Z", ordinal = 0)) public void addHoverText(@Nullable Player player, TooltipFlag tooltipFlag, CallbackInfoReturnable> cir, @Local(ordinal = 0) List tooltip) { ItemExtensions item = (ItemExtensions) getItem(); @@ -173,6 +176,12 @@ public InteractionResult addBlockAbility(InteractionResult original, @Local(ordi } return original; } + + @ModifyReturnValue(method = "isEnchantable", at = @At(value = "RETURN")) + public boolean addEnchantability(boolean original) { + return (!((ItemExtensions)getItem()).getBlockingType().isEmpty() && !isEnchanted()) || original; + } + @ModifyReturnValue(method = "use", at = @At(value = "RETURN")) public InteractionResultHolder addBlockAbility(InteractionResultHolder original, @Local(ordinal = 0) Level world, @Local(ordinal = 0) Player player, @Local(ordinal = 0) InteractionHand hand) { InteractionResultHolder holder = null; diff --git a/src/main/java/net/atlas/combatify/mixin/PiglinAiMixin.java b/src/main/java/net/atlas/combatify/mixin/PiglinAiMixin.java new file mode 100644 index 00000000..5a6f5b24 --- /dev/null +++ b/src/main/java/net/atlas/combatify/mixin/PiglinAiMixin.java @@ -0,0 +1,29 @@ +package net.atlas.combatify.mixin; + +import com.llamalad7.mixinextras.injector.ModifyReturnValue; +import com.llamalad7.mixinextras.sugar.Local; +import net.atlas.combatify.item.TieredShieldItem; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.entity.monster.piglin.PiglinAi; +import net.minecraft.world.item.*; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; + +@SuppressWarnings("unused") +@Mixin(PiglinAi.class) +public class PiglinAiMixin { + @ModifyReturnValue(method = "isWearingGold", at = @At(value = "RETURN")) + private static boolean includeHoldingShield(boolean original, @Local(ordinal = 0) LivingEntity livingEntity) { + boolean bl = false; + Iterable iterable = livingEntity.getHandSlots(); + + for (ItemStack itemStack : iterable) { + Item item = itemStack.getItem(); + if(item instanceof TieredShieldItem tieredShield && tieredShield.getTier() == Tiers.GOLD) { + bl = true; + } + } + + return original || bl; + } +} diff --git a/src/main/java/net/atlas/combatify/mixin/PlayerMixin.java b/src/main/java/net/atlas/combatify/mixin/PlayerMixin.java index 8d2a5964..b98e1668 100644 --- a/src/main/java/net/atlas/combatify/mixin/PlayerMixin.java +++ b/src/main/java/net/atlas/combatify/mixin/PlayerMixin.java @@ -7,6 +7,7 @@ import com.llamalad7.mixinextras.sugar.ref.LocalFloatRef; import net.atlas.combatify.Combatify; import net.atlas.combatify.item.NewAttributes; +import net.atlas.combatify.item.TieredShieldItem; import net.atlas.combatify.util.CustomEnchantmentHelper; import net.atlas.combatify.extensions.*; import net.minecraft.core.particles.ParticleTypes; @@ -130,6 +131,10 @@ public void blockUsingShield(@NotNull LivingEntity attacker, CallbackInfo ci) { @Override public boolean ctsShieldDisable(float damage, Item item) { player.getCooldowns().addCooldown(item, (int)(damage * 20.0F)); + if (item instanceof TieredShieldItem) + for (TieredShieldItem tieredShieldItem : Combatify.shields) + if (item != tieredShieldItem) + player.getCooldowns().addCooldown(tieredShieldItem, (int)(damage * 20.0F)); player.stopUsingItem(); player.level().broadcastEntityEvent(player, (byte)30); return true; diff --git a/src/main/java/net/atlas/combatify/mixin/RendererMixin.java b/src/main/java/net/atlas/combatify/mixin/RendererMixin.java new file mode 100644 index 00000000..f4b245d1 --- /dev/null +++ b/src/main/java/net/atlas/combatify/mixin/RendererMixin.java @@ -0,0 +1,152 @@ +package net.atlas.combatify.mixin; + +import com.mojang.blaze3d.vertex.PoseStack; +import com.mojang.blaze3d.vertex.VertexConsumer; +import com.mojang.datafixers.util.Pair; +import net.atlas.combatify.Combatify; +import net.atlas.combatify.CombatifyClient; +import net.atlas.combatify.item.TieredShieldItem; +import net.minecraft.client.model.ShieldModel; +import net.minecraft.client.model.geom.EntityModelSet; +import net.minecraft.client.renderer.BlockEntityWithoutLevelRenderer; +import net.minecraft.client.renderer.MultiBufferSource; +import net.minecraft.client.renderer.Sheets; +import net.minecraft.client.renderer.blockentity.BannerRenderer; +import net.minecraft.client.renderer.entity.ItemRenderer; +import net.minecraft.client.renderer.texture.TextureAtlas; +import net.minecraft.client.resources.model.Material; +import net.minecraft.core.Holder; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.DyeColor; +import net.minecraft.world.item.ItemDisplayContext; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.ShieldItem; +import net.minecraft.world.level.block.entity.BannerBlockEntity; +import net.minecraft.world.level.block.entity.BannerPattern; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import java.util.List; + +@SuppressWarnings("deprecation") +@Mixin(BlockEntityWithoutLevelRenderer.class) +public class RendererMixin { + private ShieldModel modelWoodenShield; + private ShieldModel modelIronShield; + private ShieldModel modelGoldenShield; + private ShieldModel modelDiamondShield; + private ShieldModel modelNetheriteShield; + private static final Material WOODEN_SHIELD_BASE = new Material(Sheets.SHIELD_SHEET, new ResourceLocation("entity/shield_base")); + private static final Material WOODEN_SHIELD_BASE_NO_PATTERN = new Material(Sheets.SHIELD_SHEET, new ResourceLocation("entity/shield_base_nopattern")); + private static final Material IRON_SHIELD_BASE = new Material(TextureAtlas.LOCATION_BLOCKS, new ResourceLocation("combatify/iron_shield_base")); + private static final Material IRON_SHIELD_BASE_NO_PATTERN = new Material(TextureAtlas.LOCATION_BLOCKS, new ResourceLocation("combatify/iron_shield_base_nopattern")); + private static final Material GOLDEN_SHIELD_BASE = new Material(TextureAtlas.LOCATION_BLOCKS, new ResourceLocation("combatify/golden_shield_base")); + private static final Material GOLDEN_SHIELD_BASE_NO_PATTERN = new Material(TextureAtlas.LOCATION_BLOCKS, new ResourceLocation("combatify/golden_shield_base_nopattern")); + private static final Material DIAMOND_SHIELD_BASE = new Material(TextureAtlas.LOCATION_BLOCKS, new ResourceLocation("combatify/diamond_shield_base")); + private static final Material DIAMOND_SHIELD_BASE_NO_PATTERN = new Material(TextureAtlas.LOCATION_BLOCKS, new ResourceLocation("combatify/diamond_shield_base_nopattern")); + private static final Material NETHERITE_SHIELD_BASE = new Material(TextureAtlas.LOCATION_BLOCKS, new ResourceLocation("combatify/netherite_shield_base")); + private static final Material NETHERITE_SHIELD_BASE_NO_PATTERN = new Material(TextureAtlas.LOCATION_BLOCKS, new ResourceLocation("combatify/netherite_shield_base_nopattern")); + + @Final + @Shadow + private EntityModelSet entityModelSet; + + + @Inject(method = "onResourceManagerReload", at = @At("HEAD")) + private void setModelNetheriteShield(CallbackInfo ci){ + if (Combatify.CONFIG.tieredShields()) { + this.modelWoodenShield = new ShieldModel(this.entityModelSet.bakeLayer(CombatifyClient.WOODEN_SHIELD_MODEL_LAYER)); + this.modelIronShield = new ShieldModel(this.entityModelSet.bakeLayer(CombatifyClient.IRON_SHIELD_MODEL_LAYER)); + this.modelGoldenShield = new ShieldModel(this.entityModelSet.bakeLayer(CombatifyClient.GOLDEN_SHIELD_MODEL_LAYER)); + this.modelDiamondShield = new ShieldModel(this.entityModelSet.bakeLayer(CombatifyClient.DIAMOND_SHIELD_MODEL_LAYER)); + this.modelNetheriteShield = new ShieldModel(this.entityModelSet.bakeLayer(CombatifyClient.NETHERITE_SHIELD_MODEL_LAYER)); + } + } + + @Inject(method = "renderByItem", at = @At("HEAD")) + private void mainRender(ItemStack stack, ItemDisplayContext itemDisplayContext, PoseStack poseStack, MultiBufferSource multiBufferSource, int i, int j, CallbackInfo ci) { + if (Combatify.CONFIG.tieredShields()) { + if (stack.is(TieredShieldItem.WOODEN_SHIELD)) { + boolean bl = stack.getTagElement("BlockEntityTag") != null; + poseStack.pushPose(); + poseStack.scale(1.0F, -1.0F, -1.0F); + Material spriteIdentifier = bl ? WOODEN_SHIELD_BASE : WOODEN_SHIELD_BASE_NO_PATTERN; + VertexConsumer vertexConsumer = spriteIdentifier.sprite().wrap(ItemRenderer.getFoilBufferDirect(multiBufferSource, modelWoodenShield.renderType(spriteIdentifier.atlasLocation()), true, stack.hasFoil())); + modelWoodenShield.handle().render(poseStack, vertexConsumer, i, j, 1.0F, 1.0F, 1.0F, 1.0F); + if (bl) { + List, DyeColor>> list = BannerBlockEntity.createPatterns(ShieldItem.getColor(stack), BannerBlockEntity.getItemPatterns(stack)); + BannerRenderer.renderPatterns(poseStack, multiBufferSource, i, j, modelWoodenShield.plate(), spriteIdentifier, false, list, stack.hasFoil()); + } else { + modelWoodenShield.plate().render(poseStack, vertexConsumer, i, j, 1.0F, 1.0F, 1.0F, 1.0F); + } + poseStack.popPose(); + } + if (stack.is(TieredShieldItem.IRON_SHIELD)) { + boolean bl = stack.getTagElement("BlockEntityTag") != null; + poseStack.pushPose(); + poseStack.scale(1.0F, -1.0F, -1.0F); + Material spriteIdentifier = bl ? IRON_SHIELD_BASE : IRON_SHIELD_BASE_NO_PATTERN; + VertexConsumer vertexConsumer = spriteIdentifier.sprite().wrap(ItemRenderer.getFoilBufferDirect(multiBufferSource, modelIronShield.renderType(spriteIdentifier.atlasLocation()), true, stack.hasFoil())); + modelIronShield.handle().render(poseStack, vertexConsumer, i, j, 1.0F, 1.0F, 1.0F, 1.0F); + if (bl) { + List, DyeColor>> list = BannerBlockEntity.createPatterns(ShieldItem.getColor(stack), BannerBlockEntity.getItemPatterns(stack)); + BannerRenderer.renderPatterns(poseStack, multiBufferSource, i, j, modelIronShield.plate(), spriteIdentifier, false, list, stack.hasFoil()); + } else { + modelIronShield.plate().render(poseStack, vertexConsumer, i, j, 1.0F, 1.0F, 1.0F, 1.0F); + } + poseStack.popPose(); + } + if (stack.is(TieredShieldItem.GOLD_SHIELD)) { + boolean bl = stack.getTagElement("BlockEntityTag") != null; + poseStack.pushPose(); + poseStack.scale(1.0F, -1.0F, -1.0F); + Material spriteIdentifier = bl ? GOLDEN_SHIELD_BASE : GOLDEN_SHIELD_BASE_NO_PATTERN; + VertexConsumer vertexConsumer = spriteIdentifier.sprite().wrap(ItemRenderer.getFoilBufferDirect(multiBufferSource, modelGoldenShield.renderType(spriteIdentifier.atlasLocation()), true, stack.hasFoil())); + modelGoldenShield.handle().render(poseStack, vertexConsumer, i, j, 1.0F, 1.0F, 1.0F, 1.0F); + if (bl) { + List, DyeColor>> list = BannerBlockEntity.createPatterns(ShieldItem.getColor(stack), BannerBlockEntity.getItemPatterns(stack)); + BannerRenderer.renderPatterns(poseStack, multiBufferSource, i, j, modelGoldenShield.plate(), spriteIdentifier, false, list, stack.hasFoil()); + } else { + modelGoldenShield.plate().render(poseStack, vertexConsumer, i, j, 1.0F, 1.0F, 1.0F, 1.0F); + } + poseStack.popPose(); + } + if (stack.is(TieredShieldItem.DIAMOND_SHIELD)) { + boolean bl = stack.getTagElement("BlockEntityTag") != null; + poseStack.pushPose(); + poseStack.scale(1.0F, -1.0F, -1.0F); + Material spriteIdentifier = bl ? DIAMOND_SHIELD_BASE : DIAMOND_SHIELD_BASE_NO_PATTERN; + VertexConsumer vertexConsumer = spriteIdentifier.sprite().wrap(ItemRenderer.getFoilBufferDirect(multiBufferSource, modelDiamondShield.renderType(spriteIdentifier.atlasLocation()), true, stack.hasFoil())); + modelDiamondShield.handle().render(poseStack, vertexConsumer, i, j, 1.0F, 1.0F, 1.0F, 1.0F); + if (bl) { + List, DyeColor>> list = BannerBlockEntity.createPatterns(ShieldItem.getColor(stack), BannerBlockEntity.getItemPatterns(stack)); + BannerRenderer.renderPatterns(poseStack, multiBufferSource, i, j, modelDiamondShield.plate(), spriteIdentifier, false, list, stack.hasFoil()); + } else { + modelDiamondShield.plate().render(poseStack, vertexConsumer, i, j, 1.0F, 1.0F, 1.0F, 1.0F); + } + poseStack.popPose(); + } + if (stack.is(TieredShieldItem.NETHERITE_SHIELD)) { + boolean bl = stack.getTagElement("BlockEntityTag") != null; + poseStack.pushPose(); + poseStack.scale(1.0F, -1.0F, -1.0F); + Material spriteIdentifier = bl ? NETHERITE_SHIELD_BASE : NETHERITE_SHIELD_BASE_NO_PATTERN; + VertexConsumer vertexConsumer = spriteIdentifier.sprite().wrap(ItemRenderer.getFoilBufferDirect(multiBufferSource, modelNetheriteShield.renderType(spriteIdentifier.atlasLocation()), true, stack.hasFoil())); + modelNetheriteShield.handle().render(poseStack, vertexConsumer, i, j, 1.0F, 1.0F, 1.0F, 1.0F); + if (bl) { + List, DyeColor>> list = BannerBlockEntity.createPatterns(ShieldItem.getColor(stack), BannerBlockEntity.getItemPatterns(stack)); + BannerRenderer.renderPatterns(poseStack, multiBufferSource, i, j, modelNetheriteShield.plate(), spriteIdentifier, false, list, stack.hasFoil()); + } else { + modelNetheriteShield.plate().render(poseStack, vertexConsumer, i, j, 1.0F, 1.0F, 1.0F, 1.0F); + } + poseStack.popPose(); + } + } + } + + +} diff --git a/src/main/java/net/atlas/combatify/mixin/ShapedRecipeMixin.java b/src/main/java/net/atlas/combatify/mixin/ShapedRecipeMixin.java new file mode 100644 index 00000000..757f21b2 --- /dev/null +++ b/src/main/java/net/atlas/combatify/mixin/ShapedRecipeMixin.java @@ -0,0 +1,36 @@ +package net.atlas.combatify.mixin; + +import net.atlas.combatify.Combatify; +import net.atlas.combatify.item.TieredShieldItem; +import net.minecraft.core.NonNullList; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.Items; +import net.minecraft.world.item.crafting.CraftingBookCategory; +import net.minecraft.world.item.crafting.ShapedRecipe; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Mutable; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(ShapedRecipe.class) +public class ShapedRecipeMixin { + @Mutable + @Shadow + @Final + ItemStack result; + + @Inject(method = "(Lnet/minecraft/resources/ResourceLocation;Ljava/lang/String;Lnet/minecraft/world/item/crafting/CraftingBookCategory;IILnet/minecraft/core/NonNullList;Lnet/minecraft/world/item/ItemStack;Z)V", at = @At(value = "RETURN")) + public void changeResult(ResourceLocation resourceLocation, String string, CraftingBookCategory craftingBookCategory, int i, int j, NonNullList nonNullList, ItemStack itemStack, boolean bl, CallbackInfo ci) { + if(Combatify.CONFIG.tieredShields() && itemStack.is(Items.SHIELD)) { + ItemStack stack = new ItemStack(TieredShieldItem.WOODEN_SHIELD, itemStack.getCount()); + stack.setPopTime(itemStack.getPopTime()); + if(itemStack.getTag() != null) + stack.setTag(itemStack.getTag().copy()); + result = stack; + } + } +} diff --git a/src/main/java/net/atlas/combatify/mixin/ShieldDecorationRecipeMixin.java b/src/main/java/net/atlas/combatify/mixin/ShieldDecorationRecipeMixin.java new file mode 100644 index 00000000..c4889054 --- /dev/null +++ b/src/main/java/net/atlas/combatify/mixin/ShieldDecorationRecipeMixin.java @@ -0,0 +1,22 @@ +package net.atlas.combatify.mixin; + +import com.llamalad7.mixinextras.injector.ModifyExpressionValue; +import com.llamalad7.mixinextras.sugar.Local; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.ShieldItem; +import net.minecraft.world.item.crafting.ShieldDecorationRecipe; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; + +@Mixin(ShieldDecorationRecipe.class) +public class ShieldDecorationRecipeMixin { + @ModifyExpressionValue(method = "matches", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/item/ItemStack;is(Lnet/minecraft/world/item/Item;)Z")) + public boolean makeAllShieldsWork(boolean original, @Local(ordinal = 2) ItemStack shield) { + return shield.getItem() instanceof ShieldItem || original; + } + + @ModifyExpressionValue(method = "assemble", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/item/ItemStack;is(Lnet/minecraft/world/item/Item;)Z")) + public boolean makeAllShieldsWork1(boolean original, @Local(ordinal = 2) ItemStack shield) { + return shield.getItem() instanceof ShieldItem || original; + } +} diff --git a/src/main/java/net/atlas/combatify/util/NewShieldBlockingType.java b/src/main/java/net/atlas/combatify/util/NewShieldBlockingType.java index af4751b1..40993991 100644 --- a/src/main/java/net/atlas/combatify/util/NewShieldBlockingType.java +++ b/src/main/java/net/atlas/combatify/util/NewShieldBlockingType.java @@ -5,7 +5,9 @@ import net.atlas.combatify.Combatify; import net.atlas.combatify.config.ConfigurableItemData; import net.atlas.combatify.enchantment.DefendingEnchantment; +import net.atlas.combatify.extensions.Tierable; import net.minecraft.tags.DamageTypeTags; +import net.minecraft.util.Mth; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResultHolder; import net.minecraft.world.damagesource.DamageSource; @@ -13,6 +15,9 @@ import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.Tier; +import net.minecraft.world.item.TieredItem; +import net.minecraft.world.item.Tiers; import net.minecraft.world.item.enchantment.EnchantmentHelper; import net.minecraft.world.level.Level; import org.jetbrains.annotations.NotNull; @@ -25,10 +30,12 @@ public NewShieldBlockingType(String name) { @Override public void block(LivingEntity instance, @Nullable Entity entity, ItemStack blockingItem, DamageSource source, LocalFloatRef amount, LocalFloatRef f, LocalFloatRef g, LocalBooleanRef bl) { + if (instance instanceof Player player && player.getCooldowns().isOnCooldown(blockingItem.getItem())) + return; boolean hurt = false; - if (source.is(DamageTypeTags.IS_EXPLOSION) || source.is(DamageTypeTags.IS_PROJECTILE)) { + if (source.is(DamageTypeTags.IS_EXPLOSION) || source.is(DamageTypeTags.IS_PROJECTILE)) g.set(amount.get()); - } else { + else { float actualStrength = this.getShieldBlockDamageValue(blockingItem); g.set(amount.get() * actualStrength); entity = source.getDirectEntity(); @@ -37,27 +44,31 @@ public void block(LivingEntity instance, @Nullable Entity entity, ItemStack bloc hurt = true; instance.blockUsingShield((LivingEntity) entity); } - bl.set(true); } if (!hurt) instance.hurtCurrentlyUsedShield(g.get()); amount.set(amount.get() - g.get()); + bl.set(true); } @Override public float getShieldBlockDamageValue(ItemStack stack) { - float strengthIncrease = 0.5F; if(Combatify.ITEMS != null && Combatify.ITEMS.configuredItems.containsKey(stack.getItem())) { ConfigurableItemData configurableItemData = Combatify.ITEMS.configuredItems.get(stack.getItem()); if (configurableItemData.blockStrength != null) { - strengthIncrease = (float) (configurableItemData.blockStrength / 100.0); + return (float) (configurableItemData.blockStrength / 100.0) + (EnchantmentHelper.getItemEnchantmentLevel(DefendingEnchantment.DEFENDER, stack) * 0.1F); } } + Tier var2 = stack.getItem() instanceof TieredItem tieredItem ? tieredItem.getTier() : Tiers.WOOD; + if (stack.getItem() instanceof Tierable tierable) + var2 = tierable.getTier(); + float strengthIncrease = (var2.getAttackDamageBonus()) / 2F - 2F; + strengthIncrease = Mth.ceil(strengthIncrease); if(Combatify.CONFIG.defender()) { - strengthIncrease += EnchantmentHelper.getItemEnchantmentLevel(DefendingEnchantment.DEFENDER, stack) * 0.1; + strengthIncrease += EnchantmentHelper.getItemEnchantmentLevel(DefendingEnchantment.DEFENDER, stack); } - return strengthIncrease; + return Math.min(0.5F + (strengthIncrease * 0.1F), 1); } @Override @@ -68,7 +79,12 @@ public double getShieldKnockbackResistanceValue(ItemStack stack) { return configurableItemData.blockKbRes; } } - return 0.5; + Tier var2 = stack.getItem() instanceof TieredItem tieredItem ? tieredItem.getTier() : Tiers.WOOD; + if (stack.getItem() instanceof Tierable tierable) + var2 = tierable.getTier(); + if (var2.getLevel() >= 4) + return 0.5; + return 0.25; } @Override diff --git a/src/main/java/net/atlas/combatify/util/SwordBlockingType.java b/src/main/java/net/atlas/combatify/util/SwordBlockingType.java index f126d733..4c4c58ea 100644 --- a/src/main/java/net/atlas/combatify/util/SwordBlockingType.java +++ b/src/main/java/net/atlas/combatify/util/SwordBlockingType.java @@ -6,6 +6,7 @@ import net.atlas.combatify.config.ConfigurableItemData; import net.atlas.combatify.enchantment.DefendingEnchantment; import net.atlas.combatify.extensions.LivingEntityExtensions; +import net.atlas.combatify.extensions.Tierable; import net.minecraft.tags.DamageTypeTags; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResultHolder; @@ -57,7 +58,9 @@ public float getShieldBlockDamageValue(ItemStack stack) { return (float) (configurableItemData.blockStrength / 100.0) + (EnchantmentHelper.getItemEnchantmentLevel(DefendingEnchantment.DEFENDER, stack) * 0.1F); } } - Tier var2 = stack.getItem() instanceof TieredItem tieredItem ? tieredItem.getTier() : Tiers.NETHERITE; + Tier var2 = stack.getItem() instanceof TieredItem tieredItem ? tieredItem.getTier() : Tiers.WOOD; + if (stack.getItem() instanceof Tierable tierable) + var2 = tierable.getTier(); float strengthIncrease = var2.getAttackDamageBonus() <= 1.0F ? -1F : 0.0F; strengthIncrease += Combatify.CONFIG.swordProtectionEfficacy(); strengthIncrease = Math.max(strengthIncrease, -3); diff --git a/src/main/java/net/atlas/combatify/util/TestBlockingType.java b/src/main/java/net/atlas/combatify/util/TestBlockingType.java index b3325520..660a254b 100644 --- a/src/main/java/net/atlas/combatify/util/TestBlockingType.java +++ b/src/main/java/net/atlas/combatify/util/TestBlockingType.java @@ -5,6 +5,7 @@ import net.atlas.combatify.Combatify; import net.atlas.combatify.config.ConfigurableItemData; import net.atlas.combatify.enchantment.DefendingEnchantment; +import net.atlas.combatify.extensions.Tierable; import net.minecraft.tags.DamageTypeTags; import net.minecraft.util.Mth; import net.minecraft.world.InteractionHand; @@ -57,7 +58,9 @@ public float getShieldBlockDamageValue(ItemStack stack) { return (float) (configurableItemData.blockStrength / 100.0) + (EnchantmentHelper.getItemEnchantmentLevel(DefendingEnchantment.DEFENDER, stack) * 0.1F); } } - Tier var2 = stack.getItem() instanceof TieredItem tieredItem ? tieredItem.getTier() : Tiers.NETHERITE; + Tier var2 = stack.getItem() instanceof TieredItem tieredItem ? tieredItem.getTier() : Tiers.WOOD; + if (stack.getItem() instanceof Tierable tierable) + var2 = tierable.getTier(); float strengthIncrease = (var2.getAttackDamageBonus()) / 2F - 2F; strengthIncrease = Mth.ceil(strengthIncrease); if(Combatify.CONFIG.defender()) { @@ -73,7 +76,9 @@ public double getShieldKnockbackResistanceValue(ItemStack stack) { return configurableItemData.blockKbRes; } } - Tier var2 = stack.getItem() instanceof TieredItem tieredItem ? tieredItem.getTier() : Tiers.NETHERITE; + Tier var2 = stack.getItem() instanceof TieredItem tieredItem ? tieredItem.getTier() : Tiers.WOOD; + if (stack.getItem() instanceof Tierable tierable) + var2 = tierable.getTier(); if (var2.getLevel() >= 4) return 0.5; return 0.25; diff --git a/src/main/resources/assets/combatify/lang/en_us.json b/src/main/resources/assets/combatify/lang/en_us.json index e3ea978e..4d9fe98c 100644 --- a/src/main/resources/assets/combatify/lang/en_us.json +++ b/src/main/resources/assets/combatify/lang/en_us.json @@ -11,6 +11,96 @@ "item.combatify.golden_longsword": "Golden Longsword", "item.combatify.diamond_longsword": "Diamond Longsword", "item.combatify.netherite_longsword": "Netherite Longsword", + "item.combatify.wooden_shield": "Wooden Shield", + "item.combatify.iron_shield": "Iron Shield", + "item.combatify.golden_shield": "Golden Shield", + "item.combatify.diamond_shield": "Diamond Shield", + "item.combatify.netherite_shield": "Netherite Shield", + "item.combatify.wooden_shield.red": "Red Wooden Shield", + "item.combatify.wooden_shield.orange": "Orange Wooden Shield", + "item.combatify.wooden_shield.yellow": "Yellow Wooden Shield", + "item.combatify.wooden_shield.lime": "Lime Wooden Shield", + "item.combatify.wooden_shield.green": "Green Wooden Shield", + "item.combatify.wooden_shield.light_blue": "Light Blue Wooden Shield", + "item.combatify.wooden_shield.cyan": "Cyan Wooden Shield", + "item.combatify.wooden_shield.blue": "Blue Wooden Shield", + "item.combatify.wooden_shield.purple": "Purple Wooden Shield", + "item.combatify.wooden_shield.magenta": "Magenta Wooden Shield", + "item.combatify.wooden_shield.pink": "Pink Wooden Shield", + "item.combatify.wooden_shield.brown": "Brown Wooden Shield", + "item.combatify.wooden_shield.white": "White Wooden Shield", + "item.combatify.wooden_shield.light_gray": "Light Gray Wooden Shield", + "item.combatify.wooden_shield.gray": "Gray Wooden Shield", + "item.combatify.wooden_shield.dark_gray": "Dark Gray Wooden Shield", + "item.combatify.wooden_shield.black": "Black Wooden Shield", + "item.combatify.iron_shield.red": "Red Iron Shield", + "item.combatify.iron_shield.orange": "Orange Iron Shield", + "item.combatify.iron_shield.yellow": "Yellow Iron Shield", + "item.combatify.iron_shield.lime": "Lime Iron Shield", + "item.combatify.iron_shield.green": "Green Iron Shield", + "item.combatify.iron_shield.light_blue": "Light Blue Iron Shield", + "item.combatify.iron_shield.cyan": "Cyan Iron Shield", + "item.combatify.iron_shield.blue": "Blue Iron Shield", + "item.combatify.iron_shield.purple": "Purple Iron Shield", + "item.combatify.iron_shield.magenta": "Magenta Iron Shield", + "item.combatify.iron_shield.pink": "Pink Iron Shield", + "item.combatify.iron_shield.brown": "Brown Iron Shield", + "item.combatify.iron_shield.white": "White Iron Shield", + "item.combatify.iron_shield.light_gray": "Light Gray Iron Shield", + "item.combatify.iron_shield.gray": "Gray Iron Shield", + "item.combatify.iron_shield.dark_gray": "Dark Gray Iron Shield", + "item.combatify.iron_shield.black": "Black Iron Shield", + "item.combatify.golden_shield.red": "Red Golden Shield", + "item.combatify.golden_shield.orange": "Orange Golden Shield", + "item.combatify.golden_shield.yellow": "Yellow Golden Shield", + "item.combatify.golden_shield.lime": "Lime Golden Shield", + "item.combatify.golden_shield.green": "Green Golden Shield", + "item.combatify.golden_shield.light_blue": "Light Blue Golden Shield", + "item.combatify.golden_shield.cyan": "Cyan Golden Shield", + "item.combatify.golden_shield.blue": "Blue Golden Shield", + "item.combatify.golden_shield.purple": "Purple Golden Shield", + "item.combatify.golden_shield.magenta": "Magenta Golden Shield", + "item.combatify.golden_shield.pink": "Pink Golden Shield", + "item.combatify.golden_shield.brown": "Brown Golden Shield", + "item.combatify.golden_shield.white": "White Golden Shield", + "item.combatify.golden_shield.light_gray": "Light Gray Golden Shield", + "item.combatify.golden_shield.gray": "Gray Golden Shield", + "item.combatify.golden_shield.dark_gray": "Dark Gray Golden Shield", + "item.combatify.golden_shield.black": "Black Golden Shield", + "item.combatify.diamond_shield.red": "Red Diamond Shield", + "item.combatify.diamond_shield.orange": "Orange Diamond Shield", + "item.combatify.diamond_shield.yellow": "Yellow Diamond Shield", + "item.combatify.diamond_shield.lime": "Lime Diamond Shield", + "item.combatify.diamond_shield.green": "Green Diamond Shield", + "item.combatify.diamond_shield.light_blue": "Light Blue Diamond Shield", + "item.combatify.diamond_shield.cyan": "Cyan Diamond Shield", + "item.combatify.diamond_shield.blue": "Blue Diamond Shield", + "item.combatify.diamond_shield.purple": "Purple Diamond Shield", + "item.combatify.diamond_shield.magenta": "Magenta Diamond Shield", + "item.combatify.diamond_shield.pink": "Pink Diamond Shield", + "item.combatify.diamond_shield.brown": "Brown Diamond Shield", + "item.combatify.diamond_shield.white": "White Diamond Shield", + "item.combatify.diamond_shield.light_gray": "Light Gray Diamond Shield", + "item.combatify.diamond_shield.gray": "Gray Diamond Shield", + "item.combatify.diamond_shield.dark_gray": "Dark Gray Diamond Shield", + "item.combatify.diamond_shield.black": "Black Diamond Shield", + "item.combatify.netherite_shield.red": "Red Netherite Shield", + "item.combatify.netherite_shield.orange": "Orange Netherite Shield", + "item.combatify.netherite_shield.yellow": "Yellow Netherite Shield", + "item.combatify.netherite_shield.lime": "Lime Netherite Shield", + "item.combatify.netherite_shield.green": "Green Netherite Shield", + "item.combatify.netherite_shield.light_blue": "Light Blue Netherite Shield", + "item.combatify.netherite_shield.cyan": "Cyan Netherite Shield", + "item.combatify.netherite_shield.blue": "Blue Netherite Shield", + "item.combatify.netherite_shield.purple": "Purple Netherite Shield", + "item.combatify.netherite_shield.magenta": "Magenta Netherite Shield", + "item.combatify.netherite_shield.pink": "Pink Netherite Shield", + "item.combatify.netherite_shield.brown": "Brown Netherite Shield", + "item.combatify.netherite_shield.white": "White Netherite Shield", + "item.combatify.netherite_shield.light_gray": "Light Gray Netherite Shield", + "item.combatify.netherite_shield.gray": "Gray Netherite Shield", + "item.combatify.netherite_shield.dark_gray": "Dark Gray Netherite Shield", + "item.combatify.netherite_shield.black": "Black Netherite Shield", "enchantment.combatify.defender" : "Defender", "enchantment.combatify.piercer" : "Piercer", "enchantment.minecraft.cleaving" : "Cleaving", @@ -48,6 +138,7 @@ "text.config.combatify-config.option.autoAttackAllowed": "Option for servers which will prevent using auto-attack on client", "text.config.combatify-config.option.bowMomentumDamage": "Bow damage is influenced by the arrow momentum", "text.config.combatify-config.option.configOnlyWeapons": "Adds Knives and Longswords with their own respective stats and abilities.", + "text.config.combatify-config.option.tieredShields": "Adds Tiered Shields which get stronger per level.", "text.config.combatify-config.option.piercer": "Adds enchantment Piercer, which allows for disabling of shields, as well as adding 10% armor piercing. Incompat with Damage Enchantments.", "text.config.combatify-config.option.defender": "Adds enchantment Defender, which decreases shield disable time by 0.5s, and increases protection for shields and swords.", "text.config.combatify-config.option.attackReach": "Attack Reach Enabled", diff --git a/src/main/resources/assets/combatify/models/item/diamond_shield.json b/src/main/resources/assets/combatify/models/item/diamond_shield.json new file mode 100644 index 00000000..d3048acf --- /dev/null +++ b/src/main/resources/assets/combatify/models/item/diamond_shield.json @@ -0,0 +1,53 @@ +{ + "parent": "builtin/entity", + "gui_light": "front", + "textures": { + "particle": "block/diamond_block" + }, + "display": { + "thirdperson_righthand": { + "rotation": [ 0, 90, 0 ], + "translation": [ 10, 6, -4 ], + "scale": [ 1, 1, 1 ] + }, + "thirdperson_lefthand": { + "rotation": [ 0, 90, 0 ], + "translation": [ 10, 6, 12 ], + "scale": [ 1, 1, 1 ] + }, + "firstperson_righthand": { + "rotation": [ 0, 180, 5 ], + "translation": [ -5, 0, -10 ], + "scale": [ 1.25, 1.25, 1.25 ] + }, + "firstperson_lefthand": { + "rotation": [ 0, 180, 5 ], + "translation": [ 15, -2, -10 ], + "scale": [ 1.25, 1.25, 1.25 ] + }, + "gui": { + "rotation": [ 15, -25, -5 ], + "translation": [ 2, 3, 0 ], + "scale": [ 0.65, 0.65, 0.65 ] + }, + "fixed": { + "rotation": [ 0, 180, 0 ], + "translation": [ -2, 4, -5], + "scale":[ 0.5, 0.5, 0.5] + }, + "ground": { + "rotation": [ 0, 0, 0 ], + "translation": [ 4, 4, 2], + "scale":[ 0.25, 0.25, 0.25] + } + }, + "overrides": [ + { + "predicate": { + "blocking": 1 + }, + "model": "combatify:item/diamond_shield_blocking" + } + ] +} + diff --git a/src/main/resources/assets/combatify/models/item/diamond_shield_blocking.json b/src/main/resources/assets/combatify/models/item/diamond_shield_blocking.json new file mode 100644 index 00000000..639da8cf --- /dev/null +++ b/src/main/resources/assets/combatify/models/item/diamond_shield_blocking.json @@ -0,0 +1,34 @@ +{ + "parent": "builtin/entity", + "gui_light": "front", + "textures": { + "particle": "block/diamond_block" + }, + "display": { + "thirdperson_righthand": { + "rotation": [ 45, 135, 0 ], + "translation": [ 3.51, 11, -2 ], + "scale": [ 1, 1, 1 ] + }, + "thirdperson_lefthand": { + "rotation": [ 45, 135, 0 ], + "translation": [ 13.51, 3, 5 ], + "scale": [ 1, 1, 1 ] + }, + "firstperson_righthand": { + "rotation": [ 0, 180, -5 ], + "translation": [ -15, 5, -11 ], + "scale": [ 1.25, 1.25, 1.25 ] + }, + "firstperson_lefthand": { + "rotation": [ 0, 180, -5 ], + "translation": [ 5, 5, -11 ], + "scale": [ 1.25, 1.25, 1.25 ] + }, + "gui": { + "rotation": [ 15, -25, -5 ], + "translation": [ 2, 3, 0 ], + "scale": [ 0.65, 0.65, 0.65 ] + } + } +} diff --git a/src/main/resources/assets/combatify/models/item/golden_shield.json b/src/main/resources/assets/combatify/models/item/golden_shield.json new file mode 100644 index 00000000..4a16e21c --- /dev/null +++ b/src/main/resources/assets/combatify/models/item/golden_shield.json @@ -0,0 +1,53 @@ +{ + "parent": "builtin/entity", + "gui_light": "front", + "textures": { + "particle": "block/gold_block" + }, + "display": { + "thirdperson_righthand": { + "rotation": [ 0, 90, 0 ], + "translation": [ 10, 6, -4 ], + "scale": [ 1, 1, 1 ] + }, + "thirdperson_lefthand": { + "rotation": [ 0, 90, 0 ], + "translation": [ 10, 6, 12 ], + "scale": [ 1, 1, 1 ] + }, + "firstperson_righthand": { + "rotation": [ 0, 180, 5 ], + "translation": [ -5, 0, -10 ], + "scale": [ 1.25, 1.25, 1.25 ] + }, + "firstperson_lefthand": { + "rotation": [ 0, 180, 5 ], + "translation": [ 15, -2, -10 ], + "scale": [ 1.25, 1.25, 1.25 ] + }, + "gui": { + "rotation": [ 15, -25, -5 ], + "translation": [ 2, 3, 0 ], + "scale": [ 0.65, 0.65, 0.65 ] + }, + "fixed": { + "rotation": [ 0, 180, 0 ], + "translation": [ -2, 4, -5], + "scale":[ 0.5, 0.5, 0.5] + }, + "ground": { + "rotation": [ 0, 0, 0 ], + "translation": [ 4, 4, 2], + "scale":[ 0.25, 0.25, 0.25] + } + }, + "overrides": [ + { + "predicate": { + "blocking": 1 + }, + "model": "combatify:item/golden_shield_blocking" + } + ] +} + diff --git a/src/main/resources/assets/combatify/models/item/golden_shield_blocking.json b/src/main/resources/assets/combatify/models/item/golden_shield_blocking.json new file mode 100644 index 00000000..fa4947a3 --- /dev/null +++ b/src/main/resources/assets/combatify/models/item/golden_shield_blocking.json @@ -0,0 +1,34 @@ +{ + "parent": "builtin/entity", + "gui_light": "front", + "textures": { + "particle": "block/gold_block" + }, + "display": { + "thirdperson_righthand": { + "rotation": [ 45, 135, 0 ], + "translation": [ 3.51, 11, -2 ], + "scale": [ 1, 1, 1 ] + }, + "thirdperson_lefthand": { + "rotation": [ 45, 135, 0 ], + "translation": [ 13.51, 3, 5 ], + "scale": [ 1, 1, 1 ] + }, + "firstperson_righthand": { + "rotation": [ 0, 180, -5 ], + "translation": [ -15, 5, -11 ], + "scale": [ 1.25, 1.25, 1.25 ] + }, + "firstperson_lefthand": { + "rotation": [ 0, 180, -5 ], + "translation": [ 5, 5, -11 ], + "scale": [ 1.25, 1.25, 1.25 ] + }, + "gui": { + "rotation": [ 15, -25, -5 ], + "translation": [ 2, 3, 0 ], + "scale": [ 0.65, 0.65, 0.65 ] + } + } +} diff --git a/src/main/resources/assets/combatify/models/item/iron_shield.json b/src/main/resources/assets/combatify/models/item/iron_shield.json new file mode 100644 index 00000000..65d858ea --- /dev/null +++ b/src/main/resources/assets/combatify/models/item/iron_shield.json @@ -0,0 +1,53 @@ +{ + "parent": "builtin/entity", + "gui_light": "front", + "textures": { + "particle": "block/iron_block" + }, + "display": { + "thirdperson_righthand": { + "rotation": [ 0, 90, 0 ], + "translation": [ 10, 6, -4 ], + "scale": [ 1, 1, 1 ] + }, + "thirdperson_lefthand": { + "rotation": [ 0, 90, 0 ], + "translation": [ 10, 6, 12 ], + "scale": [ 1, 1, 1 ] + }, + "firstperson_righthand": { + "rotation": [ 0, 180, 5 ], + "translation": [ -5, 0, -10 ], + "scale": [ 1.25, 1.25, 1.25 ] + }, + "firstperson_lefthand": { + "rotation": [ 0, 180, 5 ], + "translation": [ 15, -2, -10 ], + "scale": [ 1.25, 1.25, 1.25 ] + }, + "gui": { + "rotation": [ 15, -25, -5 ], + "translation": [ 2, 3, 0 ], + "scale": [ 0.65, 0.65, 0.65 ] + }, + "fixed": { + "rotation": [ 0, 180, 0 ], + "translation": [ -2, 4, -5], + "scale":[ 0.5, 0.5, 0.5] + }, + "ground": { + "rotation": [ 0, 0, 0 ], + "translation": [ 4, 4, 2], + "scale":[ 0.25, 0.25, 0.25] + } + }, + "overrides": [ + { + "predicate": { + "blocking": 1 + }, + "model": "combatify:item/iron_shield_blocking" + } + ] +} + diff --git a/src/main/resources/assets/combatify/models/item/iron_shield_blocking.json b/src/main/resources/assets/combatify/models/item/iron_shield_blocking.json new file mode 100644 index 00000000..76eab466 --- /dev/null +++ b/src/main/resources/assets/combatify/models/item/iron_shield_blocking.json @@ -0,0 +1,34 @@ +{ + "parent": "builtin/entity", + "gui_light": "front", + "textures": { + "particle": "block/iron_block" + }, + "display": { + "thirdperson_righthand": { + "rotation": [ 45, 135, 0 ], + "translation": [ 3.51, 11, -2 ], + "scale": [ 1, 1, 1 ] + }, + "thirdperson_lefthand": { + "rotation": [ 45, 135, 0 ], + "translation": [ 13.51, 3, 5 ], + "scale": [ 1, 1, 1 ] + }, + "firstperson_righthand": { + "rotation": [ 0, 180, -5 ], + "translation": [ -15, 5, -11 ], + "scale": [ 1.25, 1.25, 1.25 ] + }, + "firstperson_lefthand": { + "rotation": [ 0, 180, -5 ], + "translation": [ 5, 5, -11 ], + "scale": [ 1.25, 1.25, 1.25 ] + }, + "gui": { + "rotation": [ 15, -25, -5 ], + "translation": [ 2, 3, 0 ], + "scale": [ 0.65, 0.65, 0.65 ] + } + } +} diff --git a/src/main/resources/assets/combatify/models/item/netherite_shield.json b/src/main/resources/assets/combatify/models/item/netherite_shield.json new file mode 100644 index 00000000..8ce89769 --- /dev/null +++ b/src/main/resources/assets/combatify/models/item/netherite_shield.json @@ -0,0 +1,53 @@ +{ + "parent": "builtin/entity", + "gui_light": "front", + "textures": { + "particle": "block/netherite_block" + }, + "display": { + "thirdperson_righthand": { + "rotation": [ 0, 90, 0 ], + "translation": [ 10, 6, -4 ], + "scale": [ 1, 1, 1 ] + }, + "thirdperson_lefthand": { + "rotation": [ 0, 90, 0 ], + "translation": [ 10, 6, 12 ], + "scale": [ 1, 1, 1 ] + }, + "firstperson_righthand": { + "rotation": [ 0, 180, 5 ], + "translation": [ -5, 0, -10 ], + "scale": [ 1.25, 1.25, 1.25 ] + }, + "firstperson_lefthand": { + "rotation": [ 0, 180, 5 ], + "translation": [ 15, -2, -10 ], + "scale": [ 1.25, 1.25, 1.25 ] + }, + "gui": { + "rotation": [ 15, -25, -5 ], + "translation": [ 2, 3, 0 ], + "scale": [ 0.65, 0.65, 0.65 ] + }, + "fixed": { + "rotation": [ 0, 180, 0 ], + "translation": [ -2, 4, -5], + "scale":[ 0.5, 0.5, 0.5] + }, + "ground": { + "rotation": [ 0, 0, 0 ], + "translation": [ 4, 4, 2], + "scale":[ 0.25, 0.25, 0.25] + } + }, + "overrides": [ + { + "predicate": { + "blocking": 1 + }, + "model": "combatify:item/netherite_shield_blocking" + } + ] +} + diff --git a/src/main/resources/assets/combatify/models/item/netherite_shield_blocking.json b/src/main/resources/assets/combatify/models/item/netherite_shield_blocking.json new file mode 100644 index 00000000..346eb01a --- /dev/null +++ b/src/main/resources/assets/combatify/models/item/netherite_shield_blocking.json @@ -0,0 +1,34 @@ +{ + "parent": "builtin/entity", + "gui_light": "front", + "textures": { + "particle": "block/netherite_block" + }, + "display": { + "thirdperson_righthand": { + "rotation": [ 45, 135, 0 ], + "translation": [ 3.51, 11, -2 ], + "scale": [ 1, 1, 1 ] + }, + "thirdperson_lefthand": { + "rotation": [ 45, 135, 0 ], + "translation": [ 13.51, 3, 5 ], + "scale": [ 1, 1, 1 ] + }, + "firstperson_righthand": { + "rotation": [ 0, 180, -5 ], + "translation": [ -15, 5, -11 ], + "scale": [ 1.25, 1.25, 1.25 ] + }, + "firstperson_lefthand": { + "rotation": [ 0, 180, -5 ], + "translation": [ 5, 5, -11 ], + "scale": [ 1.25, 1.25, 1.25 ] + }, + "gui": { + "rotation": [ 15, -25, -5 ], + "translation": [ 2, 3, 0 ], + "scale": [ 0.65, 0.65, 0.65 ] + } + } +} diff --git a/src/main/resources/assets/combatify/models/item/wooden_shield.json b/src/main/resources/assets/combatify/models/item/wooden_shield.json new file mode 100644 index 00000000..0abb39a8 --- /dev/null +++ b/src/main/resources/assets/combatify/models/item/wooden_shield.json @@ -0,0 +1,53 @@ +{ + "parent": "builtin/entity", + "gui_light": "front", + "textures": { + "particle": "block/dark_oak_planks" + }, + "display": { + "thirdperson_righthand": { + "rotation": [ 0, 90, 0 ], + "translation": [ 10, 6, -4 ], + "scale": [ 1, 1, 1 ] + }, + "thirdperson_lefthand": { + "rotation": [ 0, 90, 0 ], + "translation": [ 10, 6, 12 ], + "scale": [ 1, 1, 1 ] + }, + "firstperson_righthand": { + "rotation": [ 0, 180, 5 ], + "translation": [ -5, 0, -10 ], + "scale": [ 1.25, 1.25, 1.25 ] + }, + "firstperson_lefthand": { + "rotation": [ 0, 180, 5 ], + "translation": [ 15, -2, -10 ], + "scale": [ 1.25, 1.25, 1.25 ] + }, + "gui": { + "rotation": [ 15, -25, -5 ], + "translation": [ 2, 3, 0 ], + "scale": [ 0.65, 0.65, 0.65 ] + }, + "fixed": { + "rotation": [ 0, 180, 0 ], + "translation": [ -2, 4, -5], + "scale":[ 0.5, 0.5, 0.5] + }, + "ground": { + "rotation": [ 0, 0, 0 ], + "translation": [ 4, 4, 2], + "scale":[ 0.25, 0.25, 0.25] + } + }, + "overrides": [ + { + "predicate": { + "blocking": 1 + }, + "model": "combatify:item/wooden_shield_blocking" + } + ] +} + diff --git a/src/main/resources/assets/combatify/models/item/wooden_shield_blocking.json b/src/main/resources/assets/combatify/models/item/wooden_shield_blocking.json new file mode 100644 index 00000000..071f2705 --- /dev/null +++ b/src/main/resources/assets/combatify/models/item/wooden_shield_blocking.json @@ -0,0 +1,34 @@ +{ + "parent": "builtin/entity", + "gui_light": "front", + "textures": { + "particle": "block/dark_oak_planks" + }, + "display": { + "thirdperson_righthand": { + "rotation": [ 45, 135, 0 ], + "translation": [ 3.51, 11, -2 ], + "scale": [ 1, 1, 1 ] + }, + "thirdperson_lefthand": { + "rotation": [ 45, 135, 0 ], + "translation": [ 13.51, 3, 5 ], + "scale": [ 1, 1, 1 ] + }, + "firstperson_righthand": { + "rotation": [ 0, 180, -5 ], + "translation": [ -15, 5, -11 ], + "scale": [ 1.25, 1.25, 1.25 ] + }, + "firstperson_lefthand": { + "rotation": [ 0, 180, -5 ], + "translation": [ 5, 5, -11 ], + "scale": [ 1.25, 1.25, 1.25 ] + }, + "gui": { + "rotation": [ 15, -25, -5 ], + "translation": [ 2, 3, 0 ], + "scale": [ 0.65, 0.65, 0.65 ] + } + } +} diff --git a/src/main/resources/assets/minecraft/atlases/blocks.json b/src/main/resources/assets/minecraft/atlases/blocks.json new file mode 100644 index 00000000..f581ec7b --- /dev/null +++ b/src/main/resources/assets/minecraft/atlases/blocks.json @@ -0,0 +1,9 @@ +{ + "sources": [ + { + "type": "directory", + "source": "combatify", + "prefix": "combatify/" + } + ] +} diff --git a/src/main/resources/assets/minecraft/textures/combatify/diamond_shield_base.png b/src/main/resources/assets/minecraft/textures/combatify/diamond_shield_base.png new file mode 100644 index 00000000..099916dc Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/combatify/diamond_shield_base.png differ diff --git a/src/main/resources/assets/minecraft/textures/combatify/diamond_shield_base_nopattern.png b/src/main/resources/assets/minecraft/textures/combatify/diamond_shield_base_nopattern.png new file mode 100644 index 00000000..0f5df15e Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/combatify/diamond_shield_base_nopattern.png differ diff --git a/src/main/resources/assets/minecraft/textures/combatify/golden_shield_base.png b/src/main/resources/assets/minecraft/textures/combatify/golden_shield_base.png new file mode 100644 index 00000000..b48197e0 Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/combatify/golden_shield_base.png differ diff --git a/src/main/resources/assets/minecraft/textures/combatify/golden_shield_base_nopattern.png b/src/main/resources/assets/minecraft/textures/combatify/golden_shield_base_nopattern.png new file mode 100644 index 00000000..9dab6037 Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/combatify/golden_shield_base_nopattern.png differ diff --git a/src/main/resources/assets/minecraft/textures/combatify/iron_shield_base.png b/src/main/resources/assets/minecraft/textures/combatify/iron_shield_base.png new file mode 100644 index 00000000..2e574144 Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/combatify/iron_shield_base.png differ diff --git a/src/main/resources/assets/minecraft/textures/combatify/iron_shield_base_nopattern.png b/src/main/resources/assets/minecraft/textures/combatify/iron_shield_base_nopattern.png new file mode 100644 index 00000000..3a8ba525 Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/combatify/iron_shield_base_nopattern.png differ diff --git a/src/main/resources/assets/minecraft/textures/combatify/netherite_shield_base.png b/src/main/resources/assets/minecraft/textures/combatify/netherite_shield_base.png new file mode 100644 index 00000000..738a0a5c Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/combatify/netherite_shield_base.png differ diff --git a/src/main/resources/assets/minecraft/textures/combatify/netherite_shield_base_nopattern.png b/src/main/resources/assets/minecraft/textures/combatify/netherite_shield_base_nopattern.png new file mode 100644 index 00000000..502c831f Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/combatify/netherite_shield_base_nopattern.png differ diff --git a/src/main/resources/combatify.mixins.json b/src/main/resources/combatify.mixins.json index 997c61d1..cf689e82 100644 --- a/src/main/resources/combatify.mixins.json +++ b/src/main/resources/combatify.mixins.json @@ -33,6 +33,7 @@ "MobEffectMixin", "MobMixin", "OwoOptionAccessor", + "PiglinAiMixin", "PlayerListMixin", "PlayerMixin", "PotionItemMixin", @@ -44,6 +45,8 @@ "ServerGameInteractPacketMixin", "ServerGamePacketMixin", "ServerPlayerMixin", + "ShapedRecipeMixin", + "ShieldDecorationRecipeMixin", "ShieldItemMixin", "ShovelItemMixin", "SnowballMixin", @@ -66,6 +69,7 @@ "MinecraftMixin", "MultiPlayerGameModeMixin", "OptionsMixin", + "RendererMixin", "RenderSystemMixin", "VideoSettingsMixin" ], diff --git a/src/main/resources/data/combatify/advancements/recipes/combat/diamond_knife.json b/src/main/resources/data/combatify/advancements/recipes/combat/diamond_knife.json new file mode 100644 index 00000000..f862d8ec --- /dev/null +++ b/src/main/resources/data/combatify/advancements/recipes/combat/diamond_knife.json @@ -0,0 +1,35 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_diamond": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:diamond" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "combatify:diamond_knife" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_diamond", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "combatify:diamond_knife" + ] + }, + "sends_telemetry_event": false +} diff --git a/src/main/resources/data/combatify/advancements/recipes/combat/diamond_longsword.json b/src/main/resources/data/combatify/advancements/recipes/combat/diamond_longsword.json new file mode 100644 index 00000000..87549c3a --- /dev/null +++ b/src/main/resources/data/combatify/advancements/recipes/combat/diamond_longsword.json @@ -0,0 +1,35 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_diamond": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:diamond" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "combatify:diamond_longsword" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_diamond", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "combatify:diamond_longsword" + ] + }, + "sends_telemetry_event": false +} diff --git a/src/main/resources/data/combatify/advancements/recipes/combat/diamond_shield.json b/src/main/resources/data/combatify/advancements/recipes/combat/diamond_shield.json new file mode 100644 index 00000000..11cd30da --- /dev/null +++ b/src/main/resources/data/combatify/advancements/recipes/combat/diamond_shield.json @@ -0,0 +1,35 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_diamond": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:diamond" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "combatify:diamond_shield" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_diamond", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "combatify:diamond_shield" + ] + }, + "sends_telemetry_event": false +} diff --git a/src/main/resources/data/combatify/advancements/recipes/combat/golden_knife.json b/src/main/resources/data/combatify/advancements/recipes/combat/golden_knife.json new file mode 100644 index 00000000..17759fba --- /dev/null +++ b/src/main/resources/data/combatify/advancements/recipes/combat/golden_knife.json @@ -0,0 +1,35 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_gold_ingot": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:gold_ingot" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "combatify:golden_knife" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_gold_ingot", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "combatify:golden_knife" + ] + }, + "sends_telemetry_event": false +} diff --git a/src/main/resources/data/combatify/advancements/recipes/combat/golden_longsword.json b/src/main/resources/data/combatify/advancements/recipes/combat/golden_longsword.json new file mode 100644 index 00000000..921e7e43 --- /dev/null +++ b/src/main/resources/data/combatify/advancements/recipes/combat/golden_longsword.json @@ -0,0 +1,35 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_gold_ingot": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:gold_ingot" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "combatify:golden_longsword" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_gold_ingot", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "combatify:golden_longsword" + ] + }, + "sends_telemetry_event": false +} diff --git a/src/main/resources/data/combatify/advancements/recipes/combat/golden_shield.json b/src/main/resources/data/combatify/advancements/recipes/combat/golden_shield.json new file mode 100644 index 00000000..7492584b --- /dev/null +++ b/src/main/resources/data/combatify/advancements/recipes/combat/golden_shield.json @@ -0,0 +1,35 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_gold_ingot": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:gold_ingot" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "combatify:golden_shield" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_gold_ingot", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "combatify:golden_shield" + ] + }, + "sends_telemetry_event": false +} diff --git a/src/main/resources/data/combatify/advancements/recipes/combat/iron_knife.json b/src/main/resources/data/combatify/advancements/recipes/combat/iron_knife.json new file mode 100644 index 00000000..9d7b92c3 --- /dev/null +++ b/src/main/resources/data/combatify/advancements/recipes/combat/iron_knife.json @@ -0,0 +1,35 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_iron_ingot": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:iron_ingot" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "combatify:iron_knife" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_iron_ingot", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "combatify:iron_knife" + ] + }, + "sends_telemetry_event": false +} diff --git a/src/main/resources/data/combatify/advancements/recipes/combat/iron_longsword.json b/src/main/resources/data/combatify/advancements/recipes/combat/iron_longsword.json new file mode 100644 index 00000000..c9c13203 --- /dev/null +++ b/src/main/resources/data/combatify/advancements/recipes/combat/iron_longsword.json @@ -0,0 +1,35 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_iron_ingot": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:iron_ingot" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "combatify:iron_longsword" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_iron_ingot", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "combatify:iron_longsword" + ] + }, + "sends_telemetry_event": false +} diff --git a/src/main/resources/data/combatify/advancements/recipes/combat/iron_shield.json b/src/main/resources/data/combatify/advancements/recipes/combat/iron_shield.json new file mode 100644 index 00000000..e8c1e5ed --- /dev/null +++ b/src/main/resources/data/combatify/advancements/recipes/combat/iron_shield.json @@ -0,0 +1,35 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_iron_ingot": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:iron_ingot" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "combatify:iron_shield" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_iron_ingot", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "combatify:iron_shield" + ] + }, + "sends_telemetry_event": false +} diff --git a/src/main/resources/data/combatify/advancements/recipes/combat/netherite_knife.json b/src/main/resources/data/combatify/advancements/recipes/combat/netherite_knife.json new file mode 100644 index 00000000..9f120bdf --- /dev/null +++ b/src/main/resources/data/combatify/advancements/recipes/combat/netherite_knife.json @@ -0,0 +1,35 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_netherite_ingot": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:netherite_ingot" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "combatify:netherite_knife" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_netherite_ingot", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "combatify:netherite_knife" + ] + }, + "sends_telemetry_event": false +} diff --git a/src/main/resources/data/combatify/advancements/recipes/combat/netherite_longsword.json b/src/main/resources/data/combatify/advancements/recipes/combat/netherite_longsword.json new file mode 100644 index 00000000..fd27591c --- /dev/null +++ b/src/main/resources/data/combatify/advancements/recipes/combat/netherite_longsword.json @@ -0,0 +1,35 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_netherite_ingot": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:netherite_ingot" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "combatify:netherite_longsword" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_netherite_ingot", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "combatify:netherite_longsword" + ] + }, + "sends_telemetry_event": false +} diff --git a/src/main/resources/data/combatify/advancements/recipes/combat/netherite_shield.json b/src/main/resources/data/combatify/advancements/recipes/combat/netherite_shield.json new file mode 100644 index 00000000..bbc8dbcc --- /dev/null +++ b/src/main/resources/data/combatify/advancements/recipes/combat/netherite_shield.json @@ -0,0 +1,35 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_netherite_ingot": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:netherite_ingot" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "combatify:netherite_shield" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_netherite_ingot", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "combatify:netherite_shield" + ] + }, + "sends_telemetry_event": false +} diff --git a/src/main/resources/data/combatify/advancements/recipes/combat/stone_knife.json b/src/main/resources/data/combatify/advancements/recipes/combat/stone_knife.json new file mode 100644 index 00000000..f58859bc --- /dev/null +++ b/src/main/resources/data/combatify/advancements/recipes/combat/stone_knife.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_stone": { + "conditions": { + "items": [ + { + "tag": "minecraft:stone_tool_materials" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "combatify:stone_knife" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_stone", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "combatify:stone_knife" + ] + }, + "sends_telemetry_event": false +} diff --git a/src/main/resources/data/combatify/advancements/recipes/combat/stone_longsword.json b/src/main/resources/data/combatify/advancements/recipes/combat/stone_longsword.json new file mode 100644 index 00000000..acfdc66b --- /dev/null +++ b/src/main/resources/data/combatify/advancements/recipes/combat/stone_longsword.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_stone": { + "conditions": { + "items": [ + { + "tag": "minecraft:stone_tool_materials" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "combatify:stone_longsword" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_stone", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "combatify:stone_longsword" + ] + }, + "sends_telemetry_event": false +} diff --git a/src/main/resources/data/combatify/advancements/recipes/combat/wooden_knife.json b/src/main/resources/data/combatify/advancements/recipes/combat/wooden_knife.json new file mode 100644 index 00000000..09a4e22e --- /dev/null +++ b/src/main/resources/data/combatify/advancements/recipes/combat/wooden_knife.json @@ -0,0 +1,35 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_stick": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:stick" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "combatify:wooden_knife" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_stick", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "combatify:wooden_knife" + ] + }, + "sends_telemetry_event": false +} diff --git a/src/main/resources/data/combatify/advancements/recipes/combat/wooden_longsword.json b/src/main/resources/data/combatify/advancements/recipes/combat/wooden_longsword.json new file mode 100644 index 00000000..91583259 --- /dev/null +++ b/src/main/resources/data/combatify/advancements/recipes/combat/wooden_longsword.json @@ -0,0 +1,35 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_stick": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:stick" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "combatify:wooden_longsword" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_stick", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "combatify:wooden_longsword" + ] + }, + "sends_telemetry_event": false +} diff --git a/src/main/resources/data/combatify/recipes/diamond_knife.json b/src/main/resources/data/combatify/recipes/diamond_knife.json index 19eb1ab3..cd97afab 100644 --- a/src/main/resources/data/combatify/recipes/diamond_knife.json +++ b/src/main/resources/data/combatify/recipes/diamond_knife.json @@ -1,5 +1,6 @@ { "type": "minecraft:crafting_shaped", + "category": "equipment", "pattern": [ " X", " #" @@ -14,5 +15,6 @@ }, "result": { "item": "combatify:diamond_knife" - } + }, + "show_notification": true } diff --git a/src/main/resources/data/combatify/recipes/diamond_longsword.json b/src/main/resources/data/combatify/recipes/diamond_longsword.json index 8c214cc0..aa0a822c 100644 --- a/src/main/resources/data/combatify/recipes/diamond_longsword.json +++ b/src/main/resources/data/combatify/recipes/diamond_longsword.json @@ -1,5 +1,6 @@ { "type": "minecraft:crafting_shaped", + "category": "equipment", "pattern": [ " X", " X", @@ -15,5 +16,6 @@ }, "result": { "item": "combatify:diamond_longsword" - } + }, + "show_notification": true } diff --git a/src/main/resources/data/combatify/recipes/diamond_shield.json b/src/main/resources/data/combatify/recipes/diamond_shield.json new file mode 100644 index 00000000..356dc5c7 --- /dev/null +++ b/src/main/resources/data/combatify/recipes/diamond_shield.json @@ -0,0 +1,18 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "equipment", + "pattern": [ + "XXX", + "XXX", + " X " + ], + "key": { + "X": { + "item": "minecraft:diamond" + } + }, + "result": { + "item": "combatify:diamond_shield" + }, + "show_notification": true +} diff --git a/src/main/resources/data/combatify/recipes/golden_knife.json b/src/main/resources/data/combatify/recipes/golden_knife.json index 18040962..f9b8e72e 100644 --- a/src/main/resources/data/combatify/recipes/golden_knife.json +++ b/src/main/resources/data/combatify/recipes/golden_knife.json @@ -1,5 +1,6 @@ { "type": "minecraft:crafting_shaped", + "category": "equipment", "pattern": [ " X", " #" @@ -14,5 +15,6 @@ }, "result": { "item": "combatify:golden_knife" - } + }, + "show_notification": true } diff --git a/src/main/resources/data/combatify/recipes/golden_longsword.json b/src/main/resources/data/combatify/recipes/golden_longsword.json index a110a3e1..d35e6de9 100644 --- a/src/main/resources/data/combatify/recipes/golden_longsword.json +++ b/src/main/resources/data/combatify/recipes/golden_longsword.json @@ -1,5 +1,6 @@ { "type": "minecraft:crafting_shaped", + "category": "equipment", "pattern": [ " X", " X", @@ -15,5 +16,6 @@ }, "result": { "item": "combatify:golden_longsword" - } + }, + "show_notification": true } diff --git a/src/main/resources/data/combatify/recipes/golden_shield.json b/src/main/resources/data/combatify/recipes/golden_shield.json new file mode 100644 index 00000000..3797e21a --- /dev/null +++ b/src/main/resources/data/combatify/recipes/golden_shield.json @@ -0,0 +1,18 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "equipment", + "pattern": [ + "XXX", + "XXX", + " X " + ], + "key": { + "X": { + "item": "minecraft:gold_ingot" + } + }, + "result": { + "item": "combatify:golden_shield" + }, + "show_notification": true +} diff --git a/src/main/resources/data/combatify/recipes/iron_knife.json b/src/main/resources/data/combatify/recipes/iron_knife.json index bef07c3d..7b408e9e 100644 --- a/src/main/resources/data/combatify/recipes/iron_knife.json +++ b/src/main/resources/data/combatify/recipes/iron_knife.json @@ -1,5 +1,6 @@ { "type": "minecraft:crafting_shaped", + "category": "equipment", "pattern": [ " X", " #" @@ -14,5 +15,6 @@ }, "result": { "item": "combatify:iron_knife" - } + }, + "show_notification": true } diff --git a/src/main/resources/data/combatify/recipes/iron_longsword.json b/src/main/resources/data/combatify/recipes/iron_longsword.json index 2419916c..818548d8 100644 --- a/src/main/resources/data/combatify/recipes/iron_longsword.json +++ b/src/main/resources/data/combatify/recipes/iron_longsword.json @@ -1,5 +1,6 @@ { "type": "minecraft:crafting_shaped", + "category": "equipment", "pattern": [ " X", " X", @@ -15,5 +16,6 @@ }, "result": { "item": "combatify:iron_longsword" - } + }, + "show_notification": true } diff --git a/src/main/resources/data/combatify/recipes/iron_shield.json b/src/main/resources/data/combatify/recipes/iron_shield.json new file mode 100644 index 00000000..37683f1d --- /dev/null +++ b/src/main/resources/data/combatify/recipes/iron_shield.json @@ -0,0 +1,21 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "equipment", + "pattern": [ + "X#X", + "XXX", + " X " + ], + "key": { + "X": { + "item": "minecraft:iron_ingot" + }, + "#": { + "item": "minecraft:iron_block" + } + }, + "result": { + "item": "combatify:iron_shield" + }, + "show_notification": true +} diff --git a/src/main/resources/data/combatify/recipes/netherite_shield.json b/src/main/resources/data/combatify/recipes/netherite_shield.json new file mode 100644 index 00000000..f41a2c2e --- /dev/null +++ b/src/main/resources/data/combatify/recipes/netherite_shield.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:smithing_transform", + "addition": { + "item": "minecraft:netherite_ingot" + }, + "base": { + "item": "combatify:diamond_shield" + }, + "result": { + "item": "combatify:netherite_shield" + }, + "template": { + "item": "minecraft:netherite_upgrade_smithing_template" + } +} diff --git a/src/main/resources/data/combatify/recipes/stone_knife.json b/src/main/resources/data/combatify/recipes/stone_knife.json index 071b45a3..2bb1c164 100644 --- a/src/main/resources/data/combatify/recipes/stone_knife.json +++ b/src/main/resources/data/combatify/recipes/stone_knife.json @@ -1,5 +1,6 @@ { "type": "minecraft:crafting_shaped", + "category": "equipment", "pattern": [ " X", " #" @@ -14,5 +15,6 @@ }, "result": { "item": "combatify:stone_knife" - } + }, + "show_notification": true } diff --git a/src/main/resources/data/combatify/recipes/stone_longsword.json b/src/main/resources/data/combatify/recipes/stone_longsword.json index 1c057f09..d2bfa500 100644 --- a/src/main/resources/data/combatify/recipes/stone_longsword.json +++ b/src/main/resources/data/combatify/recipes/stone_longsword.json @@ -1,5 +1,6 @@ { "type": "minecraft:crafting_shaped", + "category": "equipment", "pattern": [ " X", " X", @@ -15,5 +16,6 @@ }, "result": { "item": "combatify:stone_longsword" - } + }, + "show_notification": true } diff --git a/src/main/resources/data/combatify/recipes/wooden_knife.json b/src/main/resources/data/combatify/recipes/wooden_knife.json index 9e3bed0e..7c02fb58 100644 --- a/src/main/resources/data/combatify/recipes/wooden_knife.json +++ b/src/main/resources/data/combatify/recipes/wooden_knife.json @@ -1,5 +1,6 @@ { "type": "minecraft:crafting_shaped", + "category": "equipment", "pattern": [ " X", " #" @@ -14,5 +15,6 @@ }, "result": { "item": "combatify:wooden_knife" - } + }, + "show_notification": true } diff --git a/src/main/resources/data/combatify/recipes/wooden_longsword.json b/src/main/resources/data/combatify/recipes/wooden_longsword.json index 224497a7..156b4e13 100644 --- a/src/main/resources/data/combatify/recipes/wooden_longsword.json +++ b/src/main/resources/data/combatify/recipes/wooden_longsword.json @@ -1,5 +1,6 @@ { "type": "minecraft:crafting_shaped", + "category": "equipment", "pattern": [ " X", " X", @@ -15,5 +16,6 @@ }, "result": { "item": "combatify:wooden_longsword" - } + }, + "show_notification": true } diff --git a/src/main/resources/data/minecraft/tags/items/piglin_loved.json b/src/main/resources/data/minecraft/tags/items/piglin_loved.json new file mode 100644 index 00000000..9f145c07 --- /dev/null +++ b/src/main/resources/data/minecraft/tags/items/piglin_loved.json @@ -0,0 +1,7 @@ +{ + "values": [ + "combatify:golden_knife", + "combatify:golden_longsword", + "combatify:golden_shield" + ] +}