Plate carrier

This commit is contained in:
Vos
2026-03-10 21:06:04 -05:00
parent f7c0b3b0f8
commit f3b9eb394a
27 changed files with 286 additions and 4 deletions
@@ -0,0 +1,68 @@
{
"parent": "minecraft:item/generated",
"overrides": [
{
"model": "acesbs:item/sovs_plate_carrier_quartz_trim",
"predicate": {
"trim_type": 0.1
}
},
{
"model": "acesbs:item/sovs_plate_carrier_iron_trim",
"predicate": {
"trim_type": 0.2
}
},
{
"model": "acesbs:item/sovs_plate_carrier_netherite_trim",
"predicate": {
"trim_type": 0.3
}
},
{
"model": "acesbs:item/sovs_plate_carrier_redstone_trim",
"predicate": {
"trim_type": 0.4
}
},
{
"model": "acesbs:item/sovs_plate_carrier_copper_trim",
"predicate": {
"trim_type": 0.5
}
},
{
"model": "acesbs:item/sovs_plate_carrier_gold_trim",
"predicate": {
"trim_type": 0.6
}
},
{
"model": "acesbs:item/sovs_plate_carrier_emerald_trim",
"predicate": {
"trim_type": 0.7
}
},
{
"model": "acesbs:item/sovs_plate_carrier_diamond_trim",
"predicate": {
"trim_type": 0.8
}
},
{
"model": "acesbs:item/sovs_plate_carrier_lapis_trim",
"predicate": {
"trim_type": 0.9
}
},
{
"model": "acesbs:item/sovs_plate_carrier_amethyst_trim",
"predicate": {
"trim_type": 1.0
}
}
],
"textures": {
"layer0": "acesbs:item/sovs_plate_carrier"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/sovs_plate_carrier",
"layer1": "minecraft:trims/items/chestplate_trim_amethyst"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/sovs_plate_carrier",
"layer1": "minecraft:trims/items/chestplate_trim_copper"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/sovs_plate_carrier",
"layer1": "minecraft:trims/items/chestplate_trim_diamond"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/sovs_plate_carrier",
"layer1": "minecraft:trims/items/chestplate_trim_emerald"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/sovs_plate_carrier",
"layer1": "minecraft:trims/items/chestplate_trim_gold"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/sovs_plate_carrier",
"layer1": "minecraft:trims/items/chestplate_trim_iron"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/sovs_plate_carrier",
"layer1": "minecraft:trims/items/chestplate_trim_lapis"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/sovs_plate_carrier",
"layer1": "minecraft:trims/items/chestplate_trim_netherite"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/sovs_plate_carrier",
"layer1": "minecraft:trims/items/chestplate_trim_quartz"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/sovs_plate_carrier",
"layer1": "minecraft:trims/items/chestplate_trim_redstone"
}
}
@@ -4,6 +4,8 @@
"acesbs:prisma_steel_chestplate",
"acesbs:prisma_steel_leggings",
"acesbs:prisma_steel_boots",
"acesbs:berserkers_pauldron"
"acesbs:berserkers_pauldron",
"acesbs:wildfire_boots",
"acesbs:sovs_plate_carrier"
]
}
@@ -40,7 +40,7 @@ Items
Armor
X Beserker Pauldron (Special: Skeleton hurt sound)
- Wildfire Boots (Special: Rainbow ember)
X Wildfire Boots (Special: Rainbow ember)
- Fireskip Boots (Infernal Fire effect on water)
- Sov's Plate Carrier
- (Headlamp Armors using Everburn Gold)
@@ -48,7 +48,9 @@ public class ModItemTagProvider extends FabricTagProvider.ItemTagProvider {
.add(PrismaSteelItems.PRISMA_STEEL_CHESTPLATE)
.add(PrismaSteelItems.PRISMA_STEEL_LEGGINGS)
.add(PrismaSteelItems.PRISMA_STEEL_BOOTS)
.add(ModItems.BERSERKERS_PAULDRON);
.add(ModItems.BERSERKERS_PAULDRON)
.add(ModItems.WILDFIRE_BOOTS)
.add(ModItems.SOVS_PLATE_CARRIER);
getOrCreateTagBuilder(ItemTags.TRIM_MATERIALS)
.add(PrismaSteelItems.PRISMA_STEEL);
getOrCreateTagBuilder(ItemTags.TRIM_TEMPLATES)
@@ -106,6 +106,7 @@ public class ModModelProvider extends FabricModelProvider {
itemModelGenerator.registerArmor((ArmorItem) ModItems.BERSERKERS_PAULDRON);
itemModelGenerator.registerArmor((ArmorItem) ModItems.WILDFIRE_BOOTS);
itemModelGenerator.registerArmor((ArmorItem) ModItems.SOVS_PLATE_CARRIER);
itemModelGenerator.register(ModItems.FREN_SPAWN_EGG,
new Model(Optional.of(Identifier.of("item/template_spawn_egg")), Optional.empty()));
@@ -35,9 +35,19 @@ public class ModArmorMaterials {
map.put(ArmorItem.Type.CHESTPLATE, 8);
map.put(ArmorItem.Type.HELMET, 3);
map.put(ArmorItem.Type.BODY, 11);
}), 20, SoundEvents.ITEM_ARMOR_EQUIP_NETHERITE, () -> Ingredient.ofItems(ModItems.INFERNAL_ASHES),
}), 20, SoundEvents.ITEM_ARMOR_EQUIP_LEATHER, () -> Ingredient.ofItems(ModItems.INFERNAL_ASHES),
List.of(new ArmorMaterial.Layer(Identifier.of(AcesBS.MOD_ID, "wildfire"))), 0, 0));
public static final RegistryEntry<ArmorMaterial> PLATES = registerArmorMaterial("plates",
() -> new ArmorMaterial(Util.make(new EnumMap<>(ArmorItem.Type.class), map -> {
map.put(ArmorItem.Type.BOOTS, 0);
map.put(ArmorItem.Type.LEGGINGS, 0);
map.put(ArmorItem.Type.CHESTPLATE, 0);
map.put(ArmorItem.Type.HELMET, 0);
map.put(ArmorItem.Type.BODY, 0);
}), 20, SoundEvents.ITEM_ARMOR_EQUIP_NETHERITE, () -> Ingredient.ofItems(PrismaSteelItems.PRISMA_STEEL),
List.of(new ArmorMaterial.Layer(Identifier.of(AcesBS.MOD_ID, "plates"))), 0, 0));
public static final RegistryEntry<ArmorMaterial> BERSERKERS = registerArmorMaterial("berserkers",
() -> new ArmorMaterial(Util.make(new EnumMap<>(ArmorItem.Type.class), map -> {
map.put(ArmorItem.Type.BOOTS, 2);
@@ -105,6 +105,7 @@ public class ModItemGroups {
entries.add(ModItems.COMBUSTIBLE_LEMON);
entries.add(ModItems.BERSERKERS_PAULDRON);
entries.add(ModItems.WILDFIRE_BOOTS);
entries.add(ModItems.SOVS_PLATE_CARRIER);
})
@@ -144,6 +144,24 @@ public class ModItems {
}
);
public static final Item SOVS_PLATE_CARRIER = ModItems.registerItem("sovs_plate_carrier",
new SovsPlateCarrierArmorItem(ModArmorMaterials.PLATES, ArmorItem.Type.CHESTPLATE, new Item.Settings()
.maxDamage(6)){
@Override
public void appendTooltip(ItemStack stack, TooltipContext context, List<Text> tooltip, TooltipType type) {
if(!Screen.hasShiftDown()){
tooltip.add(Text.translatable("tooltip.acesbs.sovs_plate_carrier_desc"));
tooltip.add(Text.translatable("tooltip.acesbs.generic.shift_more"));
}
else {
tooltip.add(Text.translatable("tooltip.acesbs.sovs_plate_carrier_thanks"));
tooltip.add(Text.translatable("tooltip.acesbs.sovs_plate_carrier_desc2"));
tooltip.add(Text.translatable("tooltip.acesbs.sovs_plate_carrier_desc3"));
}
super.appendTooltip(stack, context, tooltip, type);
}
});
public static final Item WILDFIRE_BOOTS = registerItem("wildfire_boots",
new WildfireArmorItem(ModArmorMaterials.WILDFIRE_ARMOR_MATERIAL, ArmorItem.Type.BOOTS, new Item.Settings()
.maxDamage(ArmorItem.Type.BOOTS.getMaxDamage(15))){
@@ -0,0 +1,27 @@
package com.acethewildfire.acesbs.item.custom;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.LivingEntity;
import net.minecraft.item.ArmorItem;
import net.minecraft.item.ArmorMaterial;
import net.minecraft.item.ItemStack;
import net.minecraft.registry.entry.RegistryEntry;
import net.minecraft.world.World;
public class SovsPlateCarrierArmorItem extends ArmorItem {
public SovsPlateCarrierArmorItem(RegistryEntry<ArmorMaterial> material, Type type, Settings settings) {
super(material, type, settings);
}
public static float getDamageMultiplier(ItemStack stack) {
float durabilityRatio =
(float)(stack.getMaxDamage() - stack.getDamage()) / stack.getMaxDamage();
// 0 durability → 1.0x damage
// full durability → 0.01x damage (99% reduction)
return 1.0f - (durabilityRatio * 0.99f);
}
}
@@ -0,0 +1,35 @@
package com.acethewildfire.acesbs.mixin;
import com.acethewildfire.acesbs.item.custom.SovsPlateCarrierArmorItem;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.LivingEntity;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(ItemStack.class)
public abstract class ItemStackMixin {
@Inject(method = "damage*", at = @At("HEAD"), cancellable = true)
private void preventChestplateBreak(
int amount,
LivingEntity entity,
EquipmentSlot slot,
CallbackInfo cir
) {
ItemStack stack = (ItemStack)(Object)this;
if (stack.getItem() instanceof SovsPlateCarrierArmorItem) {
int newDamage = stack.getDamage() + amount;
if (newDamage >= stack.getMaxDamage()) {
stack.setDamage(stack.getMaxDamage());
cir.cancel(); // cancel breaking
}
}
}
}
@@ -0,0 +1,40 @@
package com.acethewildfire.acesbs.mixin;
import com.acethewildfire.acesbs.item.custom.SovsPlateCarrierArmorItem;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.damage.DamageSource;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyVariable;
@Mixin(LivingEntity.class)
public abstract class LivingEntityMixin {
@ModifyVariable(
method = "damage",
at = @At("HEAD"),
argsOnly = true
)
private float modifyDamage(float amount) {
LivingEntity entity = (LivingEntity)(Object)this;
if (entity instanceof PlayerEntity player) {
ItemStack chest = player.getEquippedStack(EquipmentSlot.CHEST);
if (chest.getItem() instanceof SovsPlateCarrierArmorItem) {
float multiplier =
SovsPlateCarrierArmorItem.getDamageMultiplier(chest);
amount *= multiplier;
}
}
return amount;
}
}
+2
View File
@@ -7,6 +7,8 @@
"CreeperTickMixin",
"CreeperTransformStateMixin",
"EntityMixin",
"LivingEntityMixin",
"ItemStackMixin",
"ExampleMixin"
],
"injectors": {
@@ -43,6 +43,7 @@
"item.acesbs.berserkers_pauldron": "Berserker's Pauldron",
"item.acesbs.wildfire_boots": "Wildfire Boots",
"item.acesbs.sovs_plate_carrier": "Sov's Plate Carrier",
"item.acesbs.kaupen_bow": "Kaupen Bow",
@@ -165,6 +166,11 @@
"tooltip.acesbs.wildfire_boots_desc": "§c§oThere are no walls.§r",
"tooltip.acesbs.wildfire_boots_thanks": "§7§oProgrammed with <3 by/for AceTheWildfire§r",
"tooltip.acesbs.sovs_plate_carrier_desc": "§c§oProtection from Ace... hopefully§r",
"tooltip.acesbs.sovs_plate_carrier_desc2": "Damage reduction scales with item durability.",
"tooltip.acesbs.sovs_plate_carrier_desc3": "Repair with Ballistic Plates.",
"tooltip.acesbs.sovs_plate_carrier_thanks": "§7§oProgrammed with <3 for Sovaeris§r",
"tooltip.acesbs.thanks_sov": "§7§oTextures by Sovaeris§r",
"tooltip.acesbs.combustible_lemon1": "§7§oDo you know who I am?§r",
Binary file not shown.

After

Width:  |  Height:  |  Size: 197 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 173 B

After

Width:  |  Height:  |  Size: 368 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 424 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 467 B

After

Width:  |  Height:  |  Size: 295 B