use of WayofTime.bloodmagic.livingArmour.downgrade.LivingArmourUpgradeCrippledArm in project BloodMagic by WayofTime.
the class ModRecipes method addLivingArmourDowngradeRecipes.
public static void addLivingArmourDowngradeRecipes() {
String messageBase = "ritual.bloodmagic.downgradeRitual.dialogue.";
ItemStack bowStack = new ItemStack(Items.BOW);
ItemStack bottleStack = new ItemStack(Items.POTIONITEM, 1, 0);
ItemStack swordStack = new ItemStack(Items.STONE_SWORD);
ItemStack goldenAppleStack = new ItemStack(Items.GOLDEN_APPLE);
ItemStack fleshStack = new ItemStack(Items.ROTTEN_FLESH);
ItemStack shieldStack = new ItemStack(Items.SHIELD);
ItemStack pickStack = new ItemStack(Items.STONE_PICKAXE);
ItemStack minecartStack = new ItemStack(Items.MINECART);
ItemStack stringStack = new ItemStack(Items.STRING);
Map<ItemStack, Pair<String, int[]>> dialogueMap = new HashMap<>();
dialogueMap.put(bowStack, Pair.of("bow", new int[] { 1, 100, 300, 500 }));
dialogueMap.put(bottleStack, Pair.of("quenched", new int[] { 1, 100, 300, 500 }));
dialogueMap.put(swordStack, Pair.of("dulledBlade", new int[] { 1, 100, 300, 500, 700 }));
dialogueMap.put(goldenAppleStack, Pair.of("slowHeal", new int[] { 1, 100, 300, 500, 700 }));
for (Entry<ItemStack, Pair<String, int[]>> entry : dialogueMap.entrySet()) {
ItemStack keyStack = entry.getKey();
String str = entry.getValue().getKey();
Map<Integer, List<ITextComponent>> textMap = new HashMap<>();
for (int tick : entry.getValue().getValue()) {
List<ITextComponent> textList = new ArrayList<>();
textList.add(new TextComponentTranslation("\u00A74%s", new TextComponentTranslation(messageBase + str + "." + tick)));
textMap.put(tick, textList);
}
LivingArmourDowngradeRecipeRegistry.registerDialog(keyStack, textMap);
}
LivingArmourDowngradeRecipeRegistry.registerRecipe(new LivingArmourUpgradeStormTrooper(0), bowStack, Items.ARROW, "string", "ingotIron", "ingotIron");
LivingArmourDowngradeRecipeRegistry.registerRecipe(new LivingArmourUpgradeStormTrooper(1), bowStack, Items.SPECTRAL_ARROW, "ingotGold", "dustRedstone", "dustGlowstone", "gemLapis");
LivingArmourDowngradeRecipeRegistry.registerRecipe(new LivingArmourUpgradeStormTrooper(2), bowStack, "gemDiamond", Items.FIRE_CHARGE, Items.BLAZE_ROD, "feather");
LivingArmourDowngradeRecipeRegistry.registerRecipe(new LivingArmourUpgradeStormTrooper(3), bowStack, Items.PRISMARINE_SHARD, Items.BLAZE_ROD, "feather", "feather");
LivingArmourDowngradeRecipeRegistry.registerRecipe(new LivingArmourUpgradeStormTrooper(4), bowStack, new ItemStack(Items.TIPPED_ARROW, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.TIPPED_ARROW, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.TIPPED_ARROW, 1, OreDictionary.WILDCARD_VALUE));
// LivingArmourDowngradeRecipeRegistry.registerDialog(bowStack, bowMap);
LivingArmourDowngradeRecipeRegistry.registerRecipe(new LivingArmourUpgradeQuenched(0), bottleStack, Items.DRAGON_BREATH);
LivingArmourDowngradeRecipeRegistry.registerRecipe(new LivingArmourUpgradeCrippledArm(0), shieldStack, "gemDiamond");
for (int i = 0; i < 10; i++) {
addRecipeForTieredDowngrade(new LivingArmourUpgradeMeleeDecrease(i), swordStack, i);
addRecipeForTieredDowngrade(new LivingArmourUpgradeSlowHeal(i), goldenAppleStack, i);
addRecipeForTieredDowngrade(new LivingArmourUpgradeBattleHungry(i), fleshStack, i);
addRecipeForTieredDowngrade(new LivingArmourUpgradeDigSlowdown(i), pickStack, i);
addRecipeForTieredDowngrade(new LivingArmourUpgradeDisoriented(i), minecartStack, i);
addRecipeForTieredDowngrade(new LivingArmourUpgradeSlowness(i), stringStack, i);
}
}
use of WayofTime.bloodmagic.livingArmour.downgrade.LivingArmourUpgradeCrippledArm in project BloodMagic by WayofTime.
the class LivingArmourHandler method onPlayerClick.
@SubscribeEvent
public static void onPlayerClick(PlayerInteractEvent event) {
if (event.isCancelable()) {
EntityPlayer player = event.getEntityPlayer();
if (LivingArmour.hasFullSet(player)) {
ItemStack chestStack = player.getItemStackFromSlot(EntityEquipmentSlot.CHEST);
LivingArmour armour = ItemLivingArmour.getLivingArmour(chestStack);
if (armour != null) {
if (event.getHand() == EnumHand.OFF_HAND) {
LivingArmourUpgrade upgrade = ItemLivingArmour.getUpgrade(BloodMagic.MODID + ".upgrade.crippledArm", chestStack);
if (upgrade instanceof LivingArmourUpgradeCrippledArm) {
event.setCanceled(true);
}
}
if (event.getItemStack().getItemUseAction() == EnumAction.DRINK) {
ItemStack drinkStack = event.getItemStack();
// TODO: See if the item is a splash potion? Those should be usable.
LivingArmourUpgrade upgrade = ItemLivingArmour.getUpgrade(BloodMagic.MODID + ".upgrade.quenched", chestStack);
if (upgrade instanceof LivingArmourUpgradeQuenched) {
event.setCanceled(true);
}
}
}
}
}
}
Aggregations