mirror of
https://github.com/FabricMC/fabric.git
synced 2025-04-11 22:45:38 -04:00
Fix post merge issues
This commit is contained in:
parent
d38542c645
commit
7076b16a70
3 changed files with 6 additions and 6 deletions
fabric-item-api-v1/src/testmod/java/net/fabricmc/fabric/test/item
|
@ -29,6 +29,7 @@ import net.minecraft.loot.context.LootContext;
|
|||
import net.minecraft.predicate.entity.DamageSourcePredicate;
|
||||
import net.minecraft.predicate.entity.EntityPredicate;
|
||||
import net.minecraft.predicate.entity.EntityTypePredicate;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
@ -66,7 +67,7 @@ public class CustomEnchantmentEffectsTest implements ModInitializer {
|
|||
EntityPropertiesLootCondition.builder(
|
||||
LootContext.EntityTarget.THIS,
|
||||
EntityPredicate.Builder.create()
|
||||
.type(EntityTypePredicate.create(EntityType.ZOMBIE))
|
||||
.type(EntityTypePredicate.create(Registries.ENTITY_TYPE, EntityType.ZOMBIE))
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ public class CustomEnchantmentEffectsGameTest implements FabricGameTest {
|
|||
|
||||
ItemStack trident = Items.TRIDENT.getDefaultStack();
|
||||
Optional<RegistryEntry.Reference<Enchantment>> impaling = getEnchantmentRegistry(context)
|
||||
.getEntry(CustomEnchantmentEffectsTest.WEIRD_IMPALING);
|
||||
.getOptional(CustomEnchantmentEffectsTest.WEIRD_IMPALING);
|
||||
if (impaling.isEmpty()) {
|
||||
throw new GameTestException("Weird Impaling enchantment is not present");
|
||||
}
|
||||
|
@ -86,6 +86,6 @@ public class CustomEnchantmentEffectsGameTest implements FabricGameTest {
|
|||
|
||||
private static Registry<Enchantment> getEnchantmentRegistry(TestContext context) {
|
||||
DynamicRegistryManager registryManager = context.getWorld().getRegistryManager();
|
||||
return registryManager.get(RegistryKeys.ENCHANTMENT);
|
||||
return registryManager.getOrThrow(RegistryKeys.ENCHANTMENT);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,7 +29,6 @@ import net.minecraft.test.TestContext;
|
|||
import net.minecraft.text.Text;
|
||||
|
||||
import net.fabricmc.fabric.api.gametest.v1.FabricGameTest;
|
||||
import net.fabricmc.fabric.test.item.DefaultItemComponentTest;
|
||||
|
||||
public class DefaultItemComponentGameTest implements FabricGameTest {
|
||||
@GameTest(templateName = EMPTY_STRUCTURE)
|
||||
|
@ -81,8 +80,8 @@ public class DefaultItemComponentGameTest implements FabricGameTest {
|
|||
Item testItem = Items.DIAMOND_PICKAXE;
|
||||
ItemStack stack = testItem.getDefaultStack();
|
||||
|
||||
Text itemName = stack.getOrDefault(DataComponentTypes.ITEM_NAME, Text.literal(""));
|
||||
Text expectedName = DefaultItemComponentTest.prependModifiedLiteral(testItem.getName());
|
||||
String itemName = stack.getName().getString();
|
||||
String expectedName = "Modified Diamond Pickaxe";
|
||||
|
||||
String errorMessage = "Expected '%s' to be contained in '%s', but it was not!";
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue