generated from FabricMC/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
i was drunk when i wrote this but it does work now
- Loading branch information
Showing
5 changed files
with
69 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/main/java/me/ryleu/armornerf/formula/DebugFormula.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package me.ryleu.armornerf.formula; | ||
|
||
import me.ryleu.armornerf.ArmorFormula; | ||
import net.minecraft.entity.LivingEntity; | ||
import net.minecraft.entity.damage.DamageSource; | ||
import net.minecraft.text.Text; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
public class DebugFormula extends ArmorFormula { | ||
private static final Logger LOGGER = LoggerFactory.getLogger(DebugFormula.class); | ||
|
||
private final FlatToughnessFormula flatToughnessFormula = new FlatToughnessFormula(); | ||
private final LargeToughnessFormula largeToughnessFormula = new LargeToughnessFormula(); | ||
private final ToughnessDisabledFormula toughnessDisabledFormula = new ToughnessDisabledFormula(); | ||
private final VanillaFormula vanillaFormula = new VanillaFormula(); | ||
|
||
@Override | ||
public float calculate(LivingEntity armorWearer, float damageAmount, DamageSource damageSource, float armor, float armorToughness) { | ||
Text name = armorWearer.getCustomName(); | ||
LOGGER.debug( | ||
"!![{},{},{},{},{},{}]", | ||
name, | ||
damageAmount, | ||
flatToughnessFormula.calculate(armorWearer, damageAmount, damageSource, armor, armorToughness), | ||
largeToughnessFormula.calculate(armorWearer, damageAmount, damageSource, armor, armorToughness), | ||
toughnessDisabledFormula.calculate(armorWearer, damageAmount, damageSource, armor, armorToughness), | ||
vanillaFormula.calculate(armorWearer, damageAmount, damageSource, armor, armorToughness) | ||
); | ||
|
||
return 0; | ||
} | ||
|
||
public DebugFormula() { | ||
LOGGER.debug("!![name,none,flat,large,disabled,vanilla]"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters