Skip to content

Commit

Permalink
Fix post merge issues
Browse files Browse the repository at this point in the history
  • Loading branch information
modmuss50 committed Sep 23, 2024
1 parent d38542c commit 7076b16
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
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;
Expand Down Expand Up @@ -66,7 +67,7 @@ public void onInitialize() {
EntityPropertiesLootCondition.builder(
LootContext.EntityTarget.THIS,
EntityPredicate.Builder.create()
.type(EntityTypePredicate.create(EntityType.ZOMBIE))
.type(EntityTypePredicate.create(Registries.ENTITY_TYPE, EntityType.ZOMBIE))
)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void weirdImpalingSetsFireToTargets(TestContext context) {

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");
}
Expand Down Expand Up @@ -86,6 +86,6 @@ public void weirdImpalingHasTwoDamageEffects(TestContext context) {

private static Registry<Enchantment> getEnchantmentRegistry(TestContext context) {
DynamicRegistryManager registryManager = context.getWorld().getRegistryManager();
return registryManager.get(RegistryKeys.ENCHANTMENT);
return registryManager.getOrThrow(RegistryKeys.ENCHANTMENT);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
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)
Expand Down Expand Up @@ -81,8 +80,8 @@ public void diamondPickaxeIsRenamed(TestContext context) {
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!";

Expand Down

0 comments on commit 7076b16

Please sign in to comment.