Added a couple new Anointments

This includes Holy Water and Hidden Knowledge.
Also fixed the JEI compat for the Alchemy Table so that hovering over the arrow shows the requirements.
This commit is contained in:
WayofTime 2021-01-12 11:44:41 -05:00
parent 4593f1f030
commit 68f917cb5b
32 changed files with 742 additions and 453 deletions

View file

@ -7,12 +7,14 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Optional;
import java.util.Set;
import java.util.UUID;
import java.util.function.Consumer;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Maps;
import com.google.common.collect.Multimap;
import com.google.common.collect.Sets;
import com.google.common.reflect.TypeToken;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
@ -41,7 +43,7 @@ public class Anointment extends ForgeRegistryEntry<Anointment>
public static final Anointment DUMMY = new Anointment(new ResourceLocation("dummy"));
private final ResourceLocation key;
// private final Set<ResourceLocation> incompatible;
private final Set<ResourceLocation> incompatible;
private String translationKey = null;
private final Map<String, Bonus> bonuses;
private IAttributeProvider attributeProvider;
@ -52,12 +54,14 @@ public class Anointment extends ForgeRegistryEntry<Anointment>
public Anointment(ResourceLocation key)
{
this.key = key;
this.incompatible = Sets.newHashSet();
this.bonuses = Maps.newHashMap();
}
public Anointment withBonusSet(String id, Consumer<List<Number>> modifiers)
{
// List<Number> values = DefaultedList.of();
List<Number> values = new ArrayList<Number>();
modifiers.accept(values);
@ -172,6 +176,18 @@ public class Anointment extends ForgeRegistryEntry<Anointment>
return false;
}
public boolean isCompatible(ResourceLocation otherUpgrade)
{
return !incompatible.contains(otherUpgrade);
}
public Anointment addIncompatibility(ResourceLocation key, ResourceLocation... otherKeys)
{
incompatible.add(key);
Collections.addAll(incompatible, otherKeys);
return this;
}
public String getTranslationKey()
{
return translationKey == null ? translationKey = Util.makeTranslationKey("anointment", key) : translationKey;

View file

@ -44,13 +44,38 @@ public class AnointmentHolder
{
anointments.put(anointment, data);
anointment.applyAnointment(this, stack, data.getLevel());
return true;
}
return true;
return false;
}
public boolean canApplyAnointment(ItemStack stack, Anointment anointment, AnointmentData data)
{
ResourceLocation key = anointment.getKey();
for (Anointment containedAnoint : anointments.keySet())
{
ResourceLocation containedKey = containedAnoint.getKey();
if (!anointment.isCompatible(containedKey) || !containedAnoint.isCompatible(key))
{
return false;
}
}
if (anointments.containsKey(anointment))
{
AnointmentData prevData = anointments.get(anointment);
int level = prevData.getLevel();
int remainingDur = prevData.getMaxDamage() - prevData.getDamage();
if (level < data.getLevel() || (level == data.getLevel() && remainingDur < (data.getMaxDamage() - data.getDamage())))
{
return true;
} else
{
return false;
}
}
return true;
}

View file

@ -68,7 +68,7 @@ public class ClientEvents
public static void colorHandlerEvent(ColorHandlerEvent.Item event)
{
event.getItemColors().register(new AnointmentColor(), BloodMagicItems.MELEE_DAMAGE_ANOINTMENT.get(), BloodMagicItems.SILK_TOUCH_ANOINTMENT.get(), BloodMagicItems.FORTUNE_ANOINTMENT.get());
event.getItemColors().register(new AnointmentColor(), BloodMagicItems.MELEE_DAMAGE_ANOINTMENT.get(), BloodMagicItems.SILK_TOUCH_ANOINTMENT.get(), BloodMagicItems.FORTUNE_ANOINTMENT.get(), BloodMagicItems.HOLY_WATER_ANOINTMENT.get(), BloodMagicItems.HIDDEN_KNOWLEDGE_ANOINTMENT.get());
}
@SuppressWarnings("deprecation")

View file

@ -96,6 +96,8 @@ public class GeneratorItemModels extends ItemModelProvider
registerMultiLayerItem(BloodMagicItems.MELEE_DAMAGE_ANOINTMENT.get(), modLoc("item/alchemic_vial"), modLoc("item/alchemic_liquid"), modLoc("item/alchemic_ribbon"));
registerMultiLayerItem(BloodMagicItems.SILK_TOUCH_ANOINTMENT.get(), modLoc("item/alchemic_vial"), modLoc("item/alchemic_liquid"), modLoc("item/alchemic_ribbon"));
registerMultiLayerItem(BloodMagicItems.FORTUNE_ANOINTMENT.get(), modLoc("item/alchemic_vial"), modLoc("item/alchemic_liquid"), modLoc("item/alchemic_ribbon"));
registerMultiLayerItem(BloodMagicItems.HOLY_WATER_ANOINTMENT.get(), modLoc("item/alchemic_vial"), modLoc("item/alchemic_liquid"), modLoc("item/alchemic_ribbon"));
registerMultiLayerItem(BloodMagicItems.HIDDEN_KNOWLEDGE_ANOINTMENT.get(), modLoc("item/alchemic_vial"), modLoc("item/alchemic_liquid"), modLoc("item/alchemic_ribbon"));
}
private void registerCustomFullTexture(Block block, String texturePath)

View file

@ -350,6 +350,8 @@ public class GeneratorLanguage extends LanguageProvider
add("anointment.bloodmagic.melee_damage", "Whetstone");
add("anointment.bloodmagic.silk_touch", "Soft Touch");
add("anointment.bloodmagic.fortune", "Fortunate");
add("anointment.bloodmagic.holy_water", "Holy Light");
add("anointment.bloodmagic.hidden_knowledge", "Hidden Knowledge");
// Guide
add("guide.bloodmagic.name", "Sanguine Scientiem");
@ -534,6 +536,8 @@ public class GeneratorLanguage extends LanguageProvider
addItem(BloodMagicItems.MELEE_DAMAGE_ANOINTMENT, "Honing Oil");
addItem(BloodMagicItems.SILK_TOUCH_ANOINTMENT, "Soft Coating");
addItem(BloodMagicItems.FORTUNE_ANOINTMENT, "Fortuna Extract");
addItem(BloodMagicItems.HOLY_WATER_ANOINTMENT, "Holy Water");
addItem(BloodMagicItems.HIDDEN_KNOWLEDGE_ANOINTMENT, "Liquid Knowledge");
// Alchemy Items
addItem(BloodMagicItems.PLANT_OIL, "Plant Oil");
@ -566,6 +570,9 @@ public class GeneratorLanguage extends LanguageProvider
add("jei.bloodmagic.recipe.consumptionrate", "Consumption: %s LP/t");
add("jei.bloodmagic.recipe.drainrate", "Drain: %s LP/t");
add("jei.bloodmagic.recipe.lpDrained", "Drained: %s LP");
add("jei.bloodmagic.recipe.ticksRequired", "Time: %sTicks");
add("jei.bloodmagic.recipe.altar", "Blood Altar");
add("jei.bloodmagic.recipe.soulforge", "Hellfire Forge");
add("jei.bloodmagic.recipe.alchemyarraycrafting", "Alchemy Array");

View file

@ -219,9 +219,11 @@ public class BloodMagicItems
// Anointments
public static final RegistryObject<Item> SLATE_VIAL = ITEMS.register("slate_vial", () -> new ItemBase(16, "slate_vial"));
public static final RegistryObject<Item> MELEE_DAMAGE_ANOINTMENT = ITEMS.register("melee_anointment", () -> new ItemAnointmentProvider(BloodMagic.rl("melee_damage"), 0xFF0000, 1, 128));
public static final RegistryObject<Item> MELEE_DAMAGE_ANOINTMENT = ITEMS.register("melee_anointment", () -> new ItemAnointmentProvider(BloodMagic.rl("melee_damage"), 0xFF0000, 1, 256));
public static final RegistryObject<Item> SILK_TOUCH_ANOINTMENT = ITEMS.register("silk_touch_anointment", () -> new ItemAnointmentProvider(BloodMagic.rl("silk_touch"), 0x00B0FF, 1, 256));
public static final RegistryObject<Item> FORTUNE_ANOINTMENT = ITEMS.register("fortune_anointment", () -> new ItemAnointmentProvider(BloodMagic.rl("fortune"), 3381504, 1, 128));
public static final RegistryObject<Item> FORTUNE_ANOINTMENT = ITEMS.register("fortune_anointment", () -> new ItemAnointmentProvider(BloodMagic.rl("fortune"), 3381504, 1, 256));
public static final RegistryObject<Item> HOLY_WATER_ANOINTMENT = ITEMS.register("holy_water_anointment", () -> new ItemAnointmentProvider(BloodMagic.rl("holy_water"), 0xC6E6FB, 1, 256));
public static final RegistryObject<Item> HIDDEN_KNOWLEDGE_ANOINTMENT = ITEMS.register("hidden_knowledge_anointment", () -> new ItemAnointmentProvider(BloodMagic.rl("hidden_knowledge"), 0xC8F902, 1, 256));
// Fragments
public static final RegistryObject<Item> IRON_FRAGMENT = BASICITEMS.register("ironfragment", () -> new ItemBase());

View file

@ -24,9 +24,11 @@ public class AlchemyTableRecipeProvider implements ISubRecipeProvider
AlchemyTableRecipeBuilder.alchemyTable(new ItemStack(Items.FLINT, 2), 50, 20, 0).addIngredient(Ingredient.fromItems(Items.GRAVEL)).addIngredient(Ingredient.fromItems(Items.FLINT)).build(consumer, BloodMagic.rl(basePath + "flint_from_gravel"));
AlchemyTableRecipeBuilder.alchemyTable(new ItemStack(Items.LEATHER, 4), 100, 200, 1).addIngredient(Ingredient.fromItems(Items.ROTTEN_FLESH)).addIngredient(Ingredient.fromItems(Items.ROTTEN_FLESH)).addIngredient(Ingredient.fromItems(Items.ROTTEN_FLESH)).addIngredient(Ingredient.fromItems(Items.ROTTEN_FLESH)).addIngredient(Ingredient.fromItems(Items.FLINT)).addIngredient(Ingredient.fromItems(Items.WATER_BUCKET)).build(consumer, BloodMagic.rl(basePath + "leather_from_flesh"));
AlchemyTableRecipeBuilder.alchemyTable(new ItemStack(BloodMagicItems.EXPLOSIVE_POWDER.get()), 500, 200, 1).addIngredient(Ingredient.fromTag(Tags.Items.GUNPOWDER)).addIngredient(Ingredient.fromTag(Tags.Items.GUNPOWDER)).addIngredient(Ingredient.fromTag(BloodMagicTags.DUST_COAL)).build(consumer, BloodMagic.rl(basePath + "explosive_powder"));
AlchemyTableRecipeBuilder.alchemyTable(new ItemStack(Items.BREAD), 100, 200, 1).addIngredient(Ingredient.fromTag(Tags.Items.CROPS_WHEAT)).addIngredient(Ingredient.fromItems(Items.SUGAR)).build(consumer, BloodMagic.rl(basePath + "bread"));
AlchemyTableRecipeBuilder.alchemyTable(new ItemStack(Items.BREAD), 100, 100, 1).addIngredient(Ingredient.fromTag(Tags.Items.CROPS_WHEAT)).addIngredient(Ingredient.fromItems(Items.SUGAR)).build(consumer, BloodMagic.rl(basePath + "bread"));
AlchemyTableRecipeBuilder.alchemyTable(new ItemStack(Blocks.GRASS_BLOCK), 200, 200, 1).addIngredient(Ingredient.fromItems(Items.DIRT)).addIngredient(Ingredient.fromItems(Items.BONE_MEAL)).addIngredient(Ingredient.fromItems(Items.WHEAT_SEEDS)).build(consumer, BloodMagic.rl(basePath + "grass_block"));
AlchemyTableRecipeBuilder.alchemyTable(new ItemStack(Items.CLAY_BALL, 2), 50, 100, 2).addIngredient(Ingredient.fromTag(Tags.Items.SAND)).addIngredient(Ingredient.fromTag(Tags.Items.SAND)).addIngredient(Ingredient.fromItems(Items.WATER_BUCKET)).build(consumer, BloodMagic.rl(basePath + "clay_from_sand"));
AlchemyTableRecipeBuilder.alchemyTable(new ItemStack(Items.COBWEB), 50, 50, 1).addIngredient(Ingredient.fromTag(Tags.Items.STRING)).addIngredient(Ingredient.fromTag(Tags.Items.STRING)).addIngredient(Ingredient.fromTag(Tags.Items.STRING)).build(consumer, BloodMagic.rl(basePath + "cobweb"));
AlchemyTableRecipeBuilder.alchemyTable(new ItemStack(Items.NETHER_WART), 50, 40, 1).addIngredient(Ingredient.fromItems(Items.NETHER_WART_BLOCK)).build(consumer, BloodMagic.rl(basePath + "nether_wart_from_block"));
AlchemyTableRecipeBuilder.alchemyTable(new ItemStack(Items.GUNPOWDER, 3), 0, 100, 0).addIngredient(Ingredient.fromTag(BloodMagicTags.DUST_SULFUR)).addIngredient(Ingredient.fromTag(BloodMagicTags.DUST_SALTPETER)).addIngredient(Ingredient.fromTag(ItemTags.COALS)).build(consumer, BloodMagic.rl(basePath + "gunpowder"));
AlchemyTableRecipeBuilder.alchemyTable(new ItemStack(BloodMagicItems.PLANT_OIL.get()), 100, 100, 1).addIngredient(Ingredient.fromTag(Tags.Items.CROPS_CARROT)).addIngredient(Ingredient.fromTag(Tags.Items.CROPS_CARROT)).addIngredient(Ingredient.fromTag(Tags.Items.CROPS_CARROT)).addIngredient(Ingredient.fromItems(Items.BONE_MEAL)).build(consumer, BloodMagic.rl(basePath + "plantoil_from_carrots"));
@ -41,7 +43,10 @@ public class AlchemyTableRecipeProvider implements ISubRecipeProvider
AlchemyTableRecipeBuilder.alchemyTable(new ItemStack(BloodMagicItems.BASIC_CUTTING_FLUID.get()), 1000, 200, 1).addIngredient(Ingredient.fromItems(BloodMagicItems.PLANT_OIL.get())).addIngredient(Ingredient.fromTag(Tags.Items.DUSTS_REDSTONE)).addIngredient(Ingredient.fromTag(Tags.Items.GUNPOWDER)).addIngredient(Ingredient.fromItems(Items.SUGAR)).addIngredient(Ingredient.fromTag(BloodMagicTags.DUST_COAL)).addIngredient(Ingredient.fromStacks(new ItemStack(Items.POTION))).build(consumer, BloodMagic.rl(basePath + "basic_cutting_fluid"));
AlchemyTableRecipeBuilder.alchemyTable(new ItemStack(BloodMagicItems.SLATE_VIAL.get(), 8), 500, 200, 1).addIngredient(Ingredient.fromItems(BloodMagicItems.SLATE.get())).addIngredient(Ingredient.fromTag(Tags.Items.GLASS)).addIngredient(Ingredient.fromTag(Tags.Items.GLASS)).addIngredient(Ingredient.fromTag(Tags.Items.GLASS)).addIngredient(Ingredient.fromTag(Tags.Items.GLASS)).addIngredient(Ingredient.fromTag(Tags.Items.GLASS)).build(consumer, BloodMagic.rl(basePath + "slate_vial"));
AlchemyTableRecipeBuilder.alchemyTable(new ItemStack(BloodMagicItems.FORTUNE_ANOINTMENT.get()), 500, 100, 1).addIngredient(Ingredient.fromItems(BloodMagicItems.SLATE_VIAL.get())).addIngredient(Ingredient.fromTag(Tags.Items.CROPS_NETHER_WART)).addIngredient(Ingredient.fromTag(Tags.Items.DUSTS_REDSTONE)).addIngredient(Ingredient.fromTag(BloodMagicTags.DUST_COAL)).build(consumer, BloodMagic.rl(basePath + "anointment_silk_touch"));
AlchemyTableRecipeBuilder.alchemyTable(new ItemStack(BloodMagicItems.FORTUNE_ANOINTMENT.get()), 500, 100, 1).addIngredient(Ingredient.fromItems(BloodMagicItems.SLATE_VIAL.get())).addIngredient(Ingredient.fromTag(Tags.Items.CROPS_NETHER_WART)).addIngredient(Ingredient.fromTag(Tags.Items.DUSTS_REDSTONE)).addIngredient(Ingredient.fromTag(BloodMagicTags.DUST_COAL)).build(consumer, BloodMagic.rl(basePath + "fortune_anointment"));
AlchemyTableRecipeBuilder.alchemyTable(new ItemStack(BloodMagicItems.SILK_TOUCH_ANOINTMENT.get()), 500, 100, 1).addIngredient(Ingredient.fromItems(BloodMagicItems.SLATE_VIAL.get())).addIngredient(Ingredient.fromTag(Tags.Items.CROPS_NETHER_WART)).addIngredient(Ingredient.fromItems(Items.COBWEB)).addIngredient(Ingredient.fromTag(Tags.Items.NUGGETS_GOLD)).build(consumer, BloodMagic.rl(basePath + "silk_touch_anointment"));
AlchemyTableRecipeBuilder.alchemyTable(new ItemStack(BloodMagicItems.MELEE_DAMAGE_ANOINTMENT.get()), 500, 100, 1).addIngredient(Ingredient.fromItems(BloodMagicItems.SLATE_VIAL.get())).addIngredient(Ingredient.fromTag(Tags.Items.CROPS_NETHER_WART)).addIngredient(Ingredient.fromItems(Items.BLAZE_POWDER)).addIngredient(Ingredient.fromTag(Tags.Items.GEMS_QUARTZ)).build(consumer, BloodMagic.rl(basePath + "melee_damage_anointment"));
AlchemyTableRecipeBuilder.alchemyTable(new ItemStack(BloodMagicItems.HOLY_WATER_ANOINTMENT.get()), 500, 100, 1).addIngredient(Ingredient.fromItems(BloodMagicItems.SLATE_VIAL.get())).addIngredient(Ingredient.fromTag(Tags.Items.CROPS_NETHER_WART)).addIngredient(Ingredient.fromItems(Items.GLISTERING_MELON_SLICE)).addIngredient(Ingredient.fromTag(Tags.Items.GEMS_QUARTZ)).build(consumer, BloodMagic.rl(basePath + "holy_water_anointment"));
AlchemyTableRecipeBuilder.alchemyTable(new ItemStack(BloodMagicItems.HIDDEN_KNOWLEDGE_ANOINTMENT.get()), 500, 100, 1).addIngredient(Ingredient.fromItems(BloodMagicItems.SLATE_VIAL.get())).addIngredient(Ingredient.fromTag(Tags.Items.CROPS_NETHER_WART)).addIngredient(Ingredient.fromItems(Items.GLASS_BOTTLE)).addIngredient(Ingredient.fromItems(Items.ENCHANTED_BOOK)).build(consumer, BloodMagic.rl(basePath + "hidden_knowledge_anointment"));
}
}

View file

@ -19,7 +19,7 @@ public class BloodMagicTags
public static final ITag.INamedTag<Item> CRYSTAL_DEMON = ItemTags.makeWrapperTag("bloodmagic:crystals/demon");
public static final ITag.INamedTag<Fluid> LIFE_ESSENCE = FluidTags.makeWrapperTag("bloodmagic:life");
public static final ITag.INamedTag<Fluid> LIFE_ESSENCE = FluidTags.makeWrapperTag("forge:life");
// Ores
public static final ITag.INamedTag<Item> ORE_COPPER = getForgeOreTag("copper");

View file

@ -17,10 +17,13 @@ import mezz.jei.api.recipe.category.IRecipeCategory;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TranslationTextComponent;
import wayoftime.bloodmagic.BloodMagic;
import wayoftime.bloodmagic.recipe.RecipeAlchemyTable;
import wayoftime.bloodmagic.common.block.BloodMagicBlocks;
import wayoftime.bloodmagic.core.registry.OrbRegistry;
import wayoftime.bloodmagic.recipe.RecipeAlchemyTable;
import wayoftime.bloodmagic.util.ChatUtil;
import wayoftime.bloodmagic.util.Constants;
import wayoftime.bloodmagic.util.helper.TextHelper;
@ -51,19 +54,26 @@ public class AlchemyTableRecipeCategory implements IRecipeCategory<RecipeAlchemy
return UID;
}
// @Override
// public List<ITextComponent> getTooltipStrings(RecipeBloodAltar recipe, double mouseX, double mouseY)
// {
// List<ITextComponent> tooltip = Lists.newArrayList();
//
@Override
public List<ITextComponent> getTooltipStrings(RecipeAlchemyTable recipe, double mouseX, double mouseY)
{
List<ITextComponent> tooltip = Lists.newArrayList();
// if (mouseX >= 13 && mouseX <= 64 && mouseY >= 27 && mouseY <= 58)
// {
// tooltip.add(new TranslationTextComponent("jei.bloodmagic.recipe.consumptionrate", ChatUtil.DECIMAL_FORMAT.format(recipe.getConsumeRate())));
// tooltip.add(new TranslationTextComponent("jei.bloodmagic.recipe.drainrate", ChatUtil.DECIMAL_FORMAT.format(recipe.getDrainRate())));
// }
//
// return tooltip;
// }
if (mouseX >= 58 && mouseX <= 78 && mouseY >= 21 && mouseY <= 34)
{
tooltip.add(new TranslationTextComponent("tooltip.bloodmagic.tier", ChatUtil.DECIMAL_FORMAT.format(recipe.getMinimumTier())));
tooltip.add(new TranslationTextComponent("jei.bloodmagic.recipe.lpDrained", ChatUtil.DECIMAL_FORMAT.format(recipe.getSyphon())));
tooltip.add(new TranslationTextComponent("jei.bloodmagic.recipe.ticksRequired", ChatUtil.DECIMAL_FORMAT.format(recipe.getTicks())));
}
return tooltip;
}
@Nonnull
@Override

View file

@ -24,6 +24,8 @@ public class AnointmentRegistrar
private static final Map<String, ResourceLocation> DEFINITIONS = ((Supplier<Map<String, ResourceLocation>>) () -> {
Map<String, ResourceLocation> def = new HashMap<>();
def.put("melee_damage", BloodMagic.rl("melee_damage"));
def.put("holy_water", BloodMagic.rl("holy_water"));
def.put("hidden_knowledge", BloodMagic.rl("hidden_knowledge"));
// def.put("arrow_shot", BloodMagic.rl("arrow_shot"));
// def.put("critical_strike", BloodMagic.rl("critical_strike"));
// def.put("digging", BloodMagic.rl("digging"));
@ -49,17 +51,28 @@ public class AnointmentRegistrar
public static final AnointmentRegistryObject<Anointment> ANOINTMENT_MELEE_DAMAGE = ANOINTMENTS.register("melee_damage", () -> parseDefinition("melee_damage").withDamageProvider((player, weapon, damage, holder, attacked, anoint, level) -> {
return anoint.getBonusValue("damage", level).doubleValue();
}).setConsumeOnAttack());
}).setConsumeOnAttack().addIncompatibility(BloodMagic.rl("holy_water")));
public static final AnointmentRegistryObject<Anointment> ANOINTMENT_SILK_TOUCH = ANOINTMENTS.register("silk_touch", () -> new Anointment(BloodMagic.rl("silk_touch")).setConsumeOnHarvest());
public static final AnointmentRegistryObject<Anointment> ANOINTMENT_SILK_TOUCH = ANOINTMENTS.register("silk_touch", () -> new Anointment(BloodMagic.rl("silk_touch")).setConsumeOnHarvest().addIncompatibility(BloodMagic.rl("fortune")));
public static final AnointmentRegistryObject<Anointment> ANOINTMENT_FORTUNE = ANOINTMENTS.register("fortune", () -> new Anointment(BloodMagic.rl("fortune")).setConsumeOnHarvest());
public static final AnointmentRegistryObject<Anointment> ANOINTMENT_FORTUNE = ANOINTMENTS.register("fortune", () -> new Anointment(BloodMagic.rl("fortune")).setConsumeOnHarvest().addIncompatibility(BloodMagic.rl("silk_touch")));
public static final AnointmentRegistryObject<Anointment> ANOINTMENT_HOLY_WATER = ANOINTMENTS.register("holy_water", () -> parseDefinition("holy_water").withDamageProvider((player, weapon, damage, holder, attacked, anoint, level) -> {
if (attacked.isEntityUndead())
return anoint.getBonusValue("damage", level).doubleValue();
else
return 0;
}).setConsumeOnAttack().addIncompatibility(BloodMagic.rl("melee_damage")));
public static final AnointmentRegistryObject<Anointment> ANOINTMENT_HIDDEN_KNOWLEDGE = ANOINTMENTS.register("hidden_knowledge", () -> parseDefinition("hidden_knowledge").setConsumeOnHarvest());
public static void register()
{
registerAnointment(ANOINTMENT_MELEE_DAMAGE.get());
registerAnointment(ANOINTMENT_SILK_TOUCH.get());
registerAnointment(ANOINTMENT_FORTUNE.get());
registerAnointment(ANOINTMENT_HOLY_WATER.get());
registerAnointment(ANOINTMENT_HIDDEN_KNOWLEDGE.get());
// Registry.register(UPGRADES, UPGRADE_ARROW_PROTECT.getKey(), UPGRADE_ARROW_PROTECT);
// Registry.register(UPGRADES, UPGRADE_ARROW_SHOT.getKey(), UPGRADE_ARROW_SHOT);
// Registry.register(UPGRADES, UPGRADE_CRITICAL_STRIKE.getKey(), UPGRADE_CRITICAL_STRIKE);

View file

@ -482,7 +482,7 @@ public class GenericHandler
event.setNewSpeed((1 + percentIncrease) * event.getNewSpeed());
}
@SubscribeEvent
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void onBreakBlock(BlockEvent.BreakEvent event)
{
PlayerEntity player = event.getPlayer();
@ -511,6 +511,14 @@ public class GenericHandler
event.setExpToDrop(exp);
}
int hiddenLevel = holder.getAnointmentLevel(AnointmentRegistrar.ANOINTMENT_HIDDEN_KNOWLEDGE.get());
if (hiddenLevel > 0)
{
double expBonus = AnointmentRegistrar.ANOINTMENT_HIDDEN_KNOWLEDGE.get().getBonusValue("exp", hiddenLevel).doubleValue();
int expAdded = (int) expBonus + (expBonus % 1 > event.getWorld().getRandom().nextDouble() ? 1 : 0);
event.setExpToDrop(event.getExpToDrop() + expAdded);
}
if (holder.consumeAnointmentDurabilityOnHarvest(heldStack, EquipmentSlotType.MAINHAND))
holder.toItemStack(heldStack);
}

View file

@ -0,0 +1,10 @@
{
"id": "bloodmagic:hidden_knowledge",
"bonuses": {
"exp": [
2,
4,
6
]
}
}

View file

@ -0,0 +1,10 @@
{
"id": "bloodmagic:holy_water",
"bonuses": {
"damage": [
5,
10,
15
]
}
}

View file

@ -2,9 +2,9 @@
"id": "bloodmagic:melee_damage",
"bonuses": {
"damage": [
2,
3,
4
6,
9
]
}
}