Fixed Living Upgrade Tomes so that you cannot over upgrade the armour.
Also updated the changelog for the next version.
This commit is contained in:
parent
e947f7d4f6
commit
5aae0d5c0b
|
@ -13,7 +13,7 @@ apply plugin: 'net.minecraftforge.gradle'
|
|||
apply plugin: 'eclipse'
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
version = '1.16.4-3.1.0-14'
|
||||
version = '1.16.4-3.1.0-15'
|
||||
group = 'com.yourname.modid' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||
archivesBaseName = 'BloodMagic'
|
||||
|
||||
|
|
|
@ -1,11 +1,37 @@
|
|||
------------------------------------------------------
|
||||
Version 3.1.0
|
||||
------------------------------------------------------
|
||||
- Fixed Plunderer's Glint
|
||||
- Majorly refactored the progression of the mod. Instead of starting with a Snare, you instead start by crafting the Blood Altar. The changes are documented in the guide, and you can follow its "Getting Started" entry!
|
||||
|
||||
- Changed the tooltips so that they are gray, more easily differentiating them from the name of the item.
|
||||
- Added the Sigil of Holding
|
||||
- Changed the crafting of Tartaric Gems so that you no longer need to use the previous tier gem in the gem slot.
|
||||
-> The Hellfire Forge will now syphon from the gem in the crafting table first, and all unused will from the consumed gem will be placed in the crafted gem.
|
||||
|
||||
- Fixed the Blood Altar so that it can now properly receive Fluids inputted into it.
|
||||
- Changed the GUI for the Alchemy Table
|
||||
-> You can now select which sides that an input/output slot is accessible from. Click on the slot you wish to change, then click on the directional toggle buttons.
|
||||
|
||||
- Fixed Plunderer's Glint not properly applying the Looting level.
|
||||
- Also fixed a NPE crash due to the bow anointments. Fixes some crashes due to mods using the ItemUsedFinish event.
|
||||
|
||||
- Fixed the Blood Altar not being able to input fluids. About time, Way!
|
||||
- Added new Shaped Charges
|
||||
-> Fungal Charge, which is very useful for giant mushrooms and nether mushrooms
|
||||
-> Controlled Charge, which will destroy only blocks that match the block it is placed on.
|
||||
- Added the ability to apply a few select Anointments to the charges. Only one can be applied to a charge at a time.
|
||||
-> Soft Touch, Fortuna, and Smelting
|
||||
|
||||
- Fixed the Living Armour so that you cannot use an upgrade tom to usurp the point cap.
|
||||
-> Also fixed the "Melee Damage" upgrade not working. Oops.json.
|
||||
-> Fixed "Strong Legs" so that it no longer runs the program "CrunchyLegs.exe" - as a result, you no longer suffer fall damage from jumping on the same level.
|
||||
-> Removed the direct fall damage mitigation from "Strong Legs"
|
||||
|
||||
- Added two types of Throwing Daggers to the Blood Mage's offensive kit.
|
||||
-> Iron Throwing Dagger
|
||||
-> Syringe Throwing Dagger
|
||||
|
||||
- Refactored the guide so that it provides +2 to awesomeness.
|
||||
|
||||
|
||||
------------------------------------------------------
|
||||
|
|
|
@ -3,6 +3,8 @@ package wayoftime.bloodmagic.common.item;
|
|||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.Item;
|
||||
|
@ -49,8 +51,10 @@ public class ItemLivingTome extends Item implements ILivingContainer
|
|||
if (armorStats.getLevel(k.getKey()) >= tomeStats.getLevel(k.getKey()))
|
||||
return;
|
||||
|
||||
LivingUtil.applyNewExperience(player, k, v); // FIXME set levels directly, don't add experience
|
||||
flag[0] = true;
|
||||
Pair<LivingStats, Boolean> upgraded = LivingUtil.applyNewExperience(player, k, v); // FIXME set levels
|
||||
// directly, don't add
|
||||
// experience
|
||||
flag[0] = flag[0] || upgraded.getRight();
|
||||
});
|
||||
// LivingStats.toPlayer(player, armorStats);
|
||||
if (flag[0])
|
||||
|
|
|
@ -3,6 +3,8 @@ package wayoftime.bloodmagic.core.living;
|
|||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
|
@ -21,20 +23,22 @@ import wayoftime.bloodmagic.event.LivingEquipmentEvent;
|
|||
|
||||
public class LivingUtil
|
||||
{
|
||||
public static LivingStats applyNewExperience(PlayerEntity player, LivingUpgrade upgrade, double experience)
|
||||
// @return Pair containing the LivingStats of the player, and if the LivingStats
|
||||
// upgraded due to the applied EXP.
|
||||
public static Pair<LivingStats, Boolean> applyNewExperience(PlayerEntity player, LivingUpgrade upgrade, double experience)
|
||||
{
|
||||
LivingStats stats = LivingStats.fromPlayer(player, true);
|
||||
if (stats == null)
|
||||
return null;
|
||||
return Pair.of(null, false);
|
||||
|
||||
if (!canTrain(player, upgrade, upgrade.getLevel((int) experience)))
|
||||
return stats;
|
||||
return Pair.of(stats, false);
|
||||
|
||||
LivingEquipmentEvent.GainExperience event = new LivingEquipmentEvent.GainExperience(player, stats, upgrade, experience);
|
||||
// EventResult result = LivingEquipmentEvent.EXPERIENCE_GAIN.invoker().gainExperience(event);
|
||||
MinecraftForge.EVENT_BUS.post(event);
|
||||
if (event.isCanceled())
|
||||
return stats;
|
||||
return Pair.of(stats, false);
|
||||
|
||||
experience = event.getExperience();
|
||||
|
||||
|
@ -48,34 +52,36 @@ public class LivingUtil
|
|||
// If we're already capped or somehow over the cap, we don't want to add
|
||||
// experience
|
||||
if (currentPoints >= stats.getMaxPoints())
|
||||
return stats;
|
||||
return Pair.of(stats, false);
|
||||
|
||||
int currentPointCost = upgrade.getLevelCost(upgrade.getLevel((int) currentExperience));
|
||||
int nextPointCost = upgrade.getLevelCost(upgrade.getLevel((int) currentExperience) + 1);
|
||||
int nextPointCost = upgrade.getLevelCost(upgrade.getLevel((int) (currentExperience + experience)));
|
||||
|
||||
// System.out.println("Current point cost: " + currentPointCost + ", Next point cost: " + nextPointCost);
|
||||
// If there's no more levels in this upgrade, we don't want to add experience
|
||||
if (nextPointCost == -1)
|
||||
return stats;
|
||||
return Pair.of(stats, false);
|
||||
|
||||
int pointDif = nextPointCost - currentPointCost;
|
||||
if (pointDif < 0)
|
||||
{
|
||||
return stats;
|
||||
return Pair.of(stats, false);
|
||||
}
|
||||
|
||||
// If applying this new level will go over our cap, we don't want to add
|
||||
// experience
|
||||
if (currentPoints + pointDif > stats.getMaxPoints())
|
||||
return stats;
|
||||
return Pair.of(stats, false);
|
||||
}
|
||||
|
||||
int newLevel = upgrade.getLevel((int) (currentExperience + experience));
|
||||
boolean didUpgrade = false;
|
||||
if (upgrade.getLevel((int) currentExperience) != newLevel)
|
||||
{
|
||||
LivingEquipmentEvent.LevelUp levelUpEvent = new LivingEquipmentEvent.LevelUp(player, stats, upgrade);
|
||||
// LivingEquipmentEvent.LEVEL_UP.invoker().levelUp(levelUpEvent);
|
||||
MinecraftForge.EVENT_BUS.post(levelUpEvent);
|
||||
didUpgrade = true;
|
||||
|
||||
player.sendStatusMessage(new TranslationTextComponent("chat.bloodmagic.living_upgrade_level_increase", new TranslationTextComponent(upgrade.getTranslationKey()), newLevel), true);
|
||||
}
|
||||
|
@ -84,7 +90,7 @@ public class LivingUtil
|
|||
|
||||
stats.addExperience(upgrade.getKey(), experience);
|
||||
LivingStats.toPlayer(player, stats);
|
||||
return stats;
|
||||
return Pair.of(stats, didUpgrade);
|
||||
}
|
||||
|
||||
public static double getDamageReceivedForArmour(PlayerEntity player, DamageSource source, double damage)
|
||||
|
|
Loading…
Reference in a new issue