TagFactory -> TagRegistry

This commit is contained in:
CreepyCre 2021-10-11 13:26:32 +02:00
parent 62f99f378e
commit 3a4dfb3e0e

View file

@ -4,6 +4,7 @@ import java.util.Objects;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import net.fabricmc.fabric.api.tag.TagRegistry;
import net.minecraft.advancement.criterion.AbstractCriterion; import net.minecraft.advancement.criterion.AbstractCriterion;
import net.minecraft.advancement.criterion.AbstractCriterionConditions; import net.minecraft.advancement.criterion.AbstractCriterionConditions;
import net.minecraft.block.Block; import net.minecraft.block.Block;
@ -14,14 +15,12 @@ import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.tag.Tag; import net.minecraft.tag.Tag;
import net.minecraft.util.Identifier; import net.minecraft.util.Identifier;
import net.fabricmc.fabric.api.tag.TagFactory;
public class TagBlockBreakCriteria extends AbstractCriterion<TagBlockBreakCriteria.Conditions> { public class TagBlockBreakCriteria extends AbstractCriterion<TagBlockBreakCriteria.Conditions> {
public static final Identifier ID = new Identifier("dimdoors", "tag_block_break"); public static final Identifier ID = new Identifier("dimdoors", "tag_block_break");
@Override @Override
protected Conditions conditionsFromJson(JsonObject obj, EntityPredicate.Extended playerPredicate, AdvancementEntityPredicateDeserializer predicateDeserializer) { protected Conditions conditionsFromJson(JsonObject obj, EntityPredicate.Extended playerPredicate, AdvancementEntityPredicateDeserializer predicateDeserializer) {
return new Conditions(playerPredicate, TagFactory.BLOCK.create(Identifier.tryParse(obj.get("tag").getAsString()))); return new Conditions(playerPredicate, TagRegistry.block(Identifier.tryParse(obj.get("tag").getAsString())));
} }
public void trigger(ServerPlayerEntity player, Block block) { public void trigger(ServerPlayerEntity player, Block block) {