This commit is contained in:
Camotoy 2023-04-06 14:03:21 -04:00
parent c4f0b0225d
commit a315d04b35

View file

@ -36,6 +36,9 @@ import org.geysermc.geyser.api.item.custom.CustomItemOptions;
import org.geysermc.geyser.api.util.TriState; import org.geysermc.geyser.api.util.TriState;
import org.geysermc.geyser.item.GeyserCustomItemOptions; import org.geysermc.geyser.item.GeyserCustomItemOptions;
import org.geysermc.geyser.item.Items; import org.geysermc.geyser.item.Items;
import org.geysermc.geyser.item.components.ToolTier;
import org.geysermc.geyser.item.type.Item;
import org.geysermc.geyser.item.type.TieredItem;
import org.geysermc.geyser.registry.type.ItemMapping; import org.geysermc.geyser.registry.type.ItemMapping;
import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
@ -47,6 +50,8 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.OptionalInt; import java.util.OptionalInt;
import static org.geysermc.geyser.item.type.Item.builder;
@TestInstance(TestInstance.Lifecycle.PER_CLASS) @TestInstance(TestInstance.Lifecycle.PER_CLASS)
public class CustomItemsTest { public class CustomItemsTest {
private ItemMapping testMappingWithDamage; private ItemMapping testMappingWithDamage;
@ -118,7 +123,7 @@ public class CustomItemsTest {
testMappingWithDamage = ItemMapping.builder() testMappingWithDamage = ItemMapping.builder()
.customItemOptions(customItemOptions) .customItemOptions(customItemOptions)
.javaItem(Items.WOODEN_PICKAXE) .javaItem(new TieredItem("wooden_pickaxe", ToolTier.WOODEN, builder().stackSize(1).maxDamage(59)))
.build(); .build();
// Test differences with items with no max damage // Test differences with items with no max damage
@ -132,7 +137,7 @@ public class CustomItemsTest {
testMappingWithNoDamage = ItemMapping.builder() testMappingWithNoDamage = ItemMapping.builder()
.customItemOptions(customItemOptions) .customItemOptions(customItemOptions)
.javaItem(Items.BEDROCK) .javaItem(new Item("bedrock", builder())) // Must be defined manually since registries aren't initialized
.build(); .build();
} }