Search in sources :

Example 1 with HeadMaterialStats

use of slimeknights.tconstruct.tools.stats.HeadMaterialStats in project TinkersConstruct by SlimeKnights.

the class StatsBuilderTest method buildDurability_ensureAverage_head.

@Test
void buildDurability_ensureAverage_head() {
    HeadMaterialStats stats1 = new HeadMaterialStats(100, 0, Tiers.WOOD, 0);
    HeadMaterialStats stats2 = new HeadMaterialStats(50, 0, Tiers.WOOD, 0);
    MeleeHarvestToolStatsBuilder builder = new MeleeHarvestToolStatsBuilder(ToolDefinitionDataBuilder.builder().stat(ToolStats.DURABILITY, 100).build(), ImmutableList.of(stats1, stats2), Collections.emptyList(), Collections.emptyList());
    assertThat(builder.buildDurability()).isEqualTo(175);
}
Also used : HeadMaterialStats(slimeknights.tconstruct.tools.stats.HeadMaterialStats) BaseMcTest(slimeknights.tconstruct.test.BaseMcTest) Test(org.junit.jupiter.api.Test)

Example 2 with HeadMaterialStats

use of slimeknights.tconstruct.tools.stats.HeadMaterialStats in project TinkersConstruct by SlimeKnights.

the class StatsBuilderTest method buildDurability_testHandleDurability.

@Test
void buildDurability_testHandleDurability() {
    HeadMaterialStats statsHead = new HeadMaterialStats(200, 0, Tiers.WOOD, 0);
    HandleMaterialStats statsHandle = new HandleMaterialStats(0.5f, 0, 0, 0);
    MeleeHarvestToolStatsBuilder builder = new MeleeHarvestToolStatsBuilder(ToolDefinitionData.EMPTY, ImmutableList.of(statsHead), ImmutableList.of(statsHandle), Collections.emptyList());
    assertThat(builder.buildDurability()).isEqualTo(100);
}
Also used : HandleMaterialStats(slimeknights.tconstruct.tools.stats.HandleMaterialStats) HeadMaterialStats(slimeknights.tconstruct.tools.stats.HeadMaterialStats) BaseMcTest(slimeknights.tconstruct.test.BaseMcTest) Test(org.junit.jupiter.api.Test)

Example 3 with HeadMaterialStats

use of slimeknights.tconstruct.tools.stats.HeadMaterialStats in project TinkersConstruct by SlimeKnights.

the class StatsBuilderTest method buildMiningSpeed_testHandleMiningSpeed.

@Test
void buildMiningSpeed_testHandleMiningSpeed() {
    HeadMaterialStats statsHead = new HeadMaterialStats(0, 2.0f, Tiers.WOOD, 0);
    HandleMaterialStats statsHandle = new HandleMaterialStats(0, 0.5f, 0, 0);
    ExtraMaterialStats statsExtra = ExtraMaterialStats.DEFAULT;
    MeleeHarvestToolStatsBuilder builder = new MeleeHarvestToolStatsBuilder(ToolDefinitionData.EMPTY, ImmutableList.of(statsHead), ImmutableList.of(statsHandle), ImmutableList.of(statsExtra));
    assertThat(builder.buildMiningSpeed()).isEqualTo(1.0f);
}
Also used : HandleMaterialStats(slimeknights.tconstruct.tools.stats.HandleMaterialStats) HeadMaterialStats(slimeknights.tconstruct.tools.stats.HeadMaterialStats) ExtraMaterialStats(slimeknights.tconstruct.tools.stats.ExtraMaterialStats) BaseMcTest(slimeknights.tconstruct.test.BaseMcTest) Test(org.junit.jupiter.api.Test)

Example 4 with HeadMaterialStats

use of slimeknights.tconstruct.tools.stats.HeadMaterialStats in project TinkersConstruct by SlimeKnights.

the class StatsBuilderTest method buildDurability_testHandleDurability_average.

@Test
void buildDurability_testHandleDurability_average() {
    HeadMaterialStats statsHead = new HeadMaterialStats(200, 0, Tiers.WOOD, 0);
    HandleMaterialStats statsHandle1 = new HandleMaterialStats(0.3f, 0, 0, 0);
    HandleMaterialStats statsHandle2 = new HandleMaterialStats(0.7f, 0, 0, 0);
    MeleeHarvestToolStatsBuilder builder = new MeleeHarvestToolStatsBuilder(ToolDefinitionData.EMPTY, ImmutableList.of(statsHead), ImmutableList.of(statsHandle1, statsHandle2), Collections.emptyList());
    assertThat(builder.buildDurability()).isEqualTo(100);
}
Also used : HandleMaterialStats(slimeknights.tconstruct.tools.stats.HandleMaterialStats) HeadMaterialStats(slimeknights.tconstruct.tools.stats.HeadMaterialStats) BaseMcTest(slimeknights.tconstruct.test.BaseMcTest) Test(org.junit.jupiter.api.Test)

Example 5 with HeadMaterialStats

use of slimeknights.tconstruct.tools.stats.HeadMaterialStats in project TinkersConstruct by SlimeKnights.

the class StatsBuilderTest method buildAttack_ensureAverage.

@Test
void buildAttack_ensureAverage() {
    HeadMaterialStats stats1 = new HeadMaterialStats(1, 0, Tiers.WOOD, 5);
    HeadMaterialStats stats2 = new HeadMaterialStats(1, 0, Tiers.WOOD, 10);
    MeleeHarvestToolStatsBuilder builder = new MeleeHarvestToolStatsBuilder(ToolDefinitionDataBuilder.builder().stat(ToolStats.ATTACK_DAMAGE, 10).build(), ImmutableList.of(stats1, stats2), Collections.emptyList(), Collections.emptyList());
    assertThat(builder.buildAttackDamage()).isEqualTo(17.5f);
}
Also used : HeadMaterialStats(slimeknights.tconstruct.tools.stats.HeadMaterialStats) BaseMcTest(slimeknights.tconstruct.test.BaseMcTest) Test(org.junit.jupiter.api.Test)

Aggregations

HeadMaterialStats (slimeknights.tconstruct.tools.stats.HeadMaterialStats)11 Test (org.junit.jupiter.api.Test)10 BaseMcTest (slimeknights.tconstruct.test.BaseMcTest)10 HandleMaterialStats (slimeknights.tconstruct.tools.stats.HandleMaterialStats)6 ExtraMaterialStats (slimeknights.tconstruct.tools.stats.ExtraMaterialStats)1 RepairKitStats (slimeknights.tconstruct.tools.stats.RepairKitStats)1 SkullStats (slimeknights.tconstruct.tools.stats.SkullStats)1