Search in sources :

Example 1 with HandleMaterialStats

use of slimeknights.tconstruct.tools.stats.HandleMaterialStats 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 2 with HandleMaterialStats

use of slimeknights.tconstruct.tools.stats.HandleMaterialStats 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 3 with HandleMaterialStats

use of slimeknights.tconstruct.tools.stats.HandleMaterialStats 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 4 with HandleMaterialStats

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

the class StatsBuilderTest method buildAttackSpeed_testHandleAttackDamage_average.

@Test
void buildAttackSpeed_testHandleAttackDamage_average() {
    HeadMaterialStats head = new HeadMaterialStats(0, 0, Tiers.WOOD, 4);
    HandleMaterialStats stats1 = new HandleMaterialStats(0, 0, 0, 1.3f);
    HandleMaterialStats stats2 = new HandleMaterialStats(0, 0, 0, 1.7f);
    MeleeHarvestToolStatsBuilder builder = new MeleeHarvestToolStatsBuilder(ToolDefinitionDataBuilder.builder().stat(ToolStats.ATTACK_DAMAGE, 2).build(), ImmutableList.of(head), ImmutableList.of(stats1, stats2), Collections.emptyList());
    assertThat(builder.buildAttackDamage()).isEqualTo(9);
}
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 HandleMaterialStats

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

the class StatsBuilderTest method buildAttackSpeed_testHandleAttackSpeed_average.

@Test
void buildAttackSpeed_testHandleAttackSpeed_average() {
    HandleMaterialStats stats1 = new HandleMaterialStats(0, 0, 1.3f, 0);
    HandleMaterialStats stats2 = new HandleMaterialStats(0, 0, 1.7f, 0);
    MeleeHarvestToolStatsBuilder builder = new MeleeHarvestToolStatsBuilder(ToolDefinitionData.EMPTY, Collections.emptyList(), ImmutableList.of(stats1, stats2), Collections.emptyList());
    assertThat(builder.buildAttackSpeed()).isEqualTo(1.5f);
}
Also used : HandleMaterialStats(slimeknights.tconstruct.tools.stats.HandleMaterialStats) BaseMcTest(slimeknights.tconstruct.test.BaseMcTest) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)8 BaseMcTest (slimeknights.tconstruct.test.BaseMcTest)8 HandleMaterialStats (slimeknights.tconstruct.tools.stats.HandleMaterialStats)8 HeadMaterialStats (slimeknights.tconstruct.tools.stats.HeadMaterialStats)6 ExtraMaterialStats (slimeknights.tconstruct.tools.stats.ExtraMaterialStats)1