Skip to content

Commit b600ee0

Browse files
committed
Implemented Gilded Upgrade Training and Documentation
Trained by directly giving a Piglin a Gold Ingot while wearing a full set of Living Armor.
1 parent 8b66fa7 commit b600ee0

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

  • src/main
    • java/wayoftime/bloodmagic/util/handler/event
    • resources/assets/bloodmagic/patchouli_books/guide/en_us/entries/alchemy_array/living_equipment/armor_upgrades

src/main/java/wayoftime/bloodmagic/util/handler/event/GenericHandler.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import net.minecraft.world.entity.LivingEntity;
1414
import net.minecraft.world.entity.ai.goal.MeleeAttackGoal;
1515
import net.minecraft.world.entity.ai.goal.target.TargetGoal;
16+
import net.minecraft.world.entity.monster.piglin.Piglin;
1617
import net.minecraft.world.entity.player.Player;
1718
import net.minecraft.world.entity.projectile.Arrow;
1819
import net.minecraft.world.entity.projectile.ThrowableProjectile;
@@ -1190,4 +1191,16 @@ public static int getChargeTime(ItemStack stack)
11901191
int i = EnchantmentHelper.getItemEnchantmentLevel(Enchantments.QUICK_CHARGE, stack);
11911192
return i == 0 ? 25 : 25 - 5 * i;
11921193
}
1194+
1195+
@SubscribeEvent
1196+
public void onEntityInteract(PlayerInteractEvent.EntityInteract event){
1197+
if (event.getTarget() instanceof Piglin && event.getItemStack().is(Items.GOLD_INGOT))
1198+
{
1199+
Player player = event.getEntity();
1200+
if (LivingUtil.hasFullSet(player))
1201+
{
1202+
LivingUtil.applyNewExperience(player, LivingArmorRegistrar.UPGRADE_GILDED.get(), 1);
1203+
}
1204+
}
1205+
}
11931206
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "Gilded",
3+
"icon": "minecraft:golden_chestplate",
4+
"category": "bloodmagic:alchemy_array/living_equipment/armor_upgrades",
5+
"pages": [
6+
{
7+
"type": "patchouli:text",
8+
"text": "Effect: Passivises Piglins as if you were wearing Golden Armor.$(br2)Trained by: Giving a Piglin a $(item)Gold Ingot$(). You must give it to them directly, it cannot be dropped on the ground.$(br2)Maximum level: 1"
9+
},
10+
{
11+
"type": "bloodmagic:living_armour_upgrade_table",
12+
"upgrade": "bloodmagic:gilded"
13+
}
14+
]
15+
}

0 commit comments

Comments
 (0)