mirror of
https://github.com/GTNewHorizons/ForgeMultipart.git
synced 2026-11-18 19:39:19 +00:00
test: characterize saw strength mutation
This commit is contained in:
1 parent
59149d7c69
commit
098e747485
1 file changed
+18
@@ -115,6 +115,24 @@ class ItemSawCharacterizationTest {
|
||||
assertEquals(37, explicitSaw.getMaxDamage());
|
||||
}
|
||||
|
||||
@Test
|
||||
void iguanaReflectionUpdatesCuttingStrengthWithoutReconfiguringDurability(@TempDir Path directory)
|
||||
throws Exception {
|
||||
ItemSaw saw = saw(directory, "iguana", 2, null);
|
||||
int maxDamage = saw.getMaxDamage();
|
||||
|
||||
Field harvestLevel = ItemSaw.class.getDeclaredField("harvestLevel");
|
||||
harvestLevel.setAccessible(true);
|
||||
Integer oldStrength = (Integer) harvestLevel.get(saw);
|
||||
harvestLevel.set(saw, 5);
|
||||
|
||||
assertEquals(2, oldStrength);
|
||||
assertEquals(5, saw.harvestLevel());
|
||||
assertEquals(5, saw.getCuttingStrength(new ItemStack(saw)));
|
||||
assertEquals(5, saw.getMaxCuttingStrength());
|
||||
assertEquals(maxDamage, saw.getMaxDamage());
|
||||
}
|
||||
|
||||
@Test
|
||||
void damagesContainerOnlyWhenTheSawIsDamageable(@TempDir Path directory) {
|
||||
ItemSaw damageableSaw = saw(directory, "damageable", 2, 20);
|
||||
|
||||
Reference in new issue
Block a user