Skip to content

Commit

Permalink
Update to 1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
Patbox committed Jun 5, 2024
1 parent d9c3297 commit fa029c2
Show file tree
Hide file tree
Showing 15 changed files with 30 additions and 30 deletions.
16 changes: 8 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/use
minecraft_version=1.20.5-rc1
yarn_mappings=1.20.5-rc1+build.1
loader_version=0.15.10
minecraft_version=1.21-pre2
yarn_mappings=1.21-pre2+build.2
loader_version=0.15.11

#Fabric api
fabric_version=0.97.3+1.20.5
# Fabric API
fabric_version=0.99.4+1.21

# Mod Properties
mod_version = 0.4.0+1.20.5
maven_group = eu.pb4
archives_base_name = predicate-api
mod_version = 0.5.0+1.21
maven_group = eu.pb4
archives_base_name = predicate-api

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import net.minecraft.util.Identifier;

public final class PermissionOptionPredicate extends AbstractPredicate {
public static final Identifier ID = new Identifier("permission_option");
public static final Identifier ID = Identifier.of("permission_option");
public static final MapCodec<PermissionOptionPredicate> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
Codec.STRING.fieldOf("option").forGetter(PermissionOptionPredicate::permission)
).apply(instance, PermissionOptionPredicate::new));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import net.minecraft.util.Identifier;

public final class PermissionPredicate extends AbstractPredicate {
public static final Identifier ID = new Identifier("permission");
public static final Identifier ID = Identifier.of("permission");
public static final MapCodec<PermissionPredicate> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
Codec.STRING.fieldOf("permission").forGetter(PermissionPredicate::permission),
Codec.INT.optionalFieldOf("operator", -1).forGetter(PermissionPredicate::operator)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import net.minecraft.util.Identifier;

public final class PlaceholderPredicate extends AbstractPredicate {
public static final Identifier ID = new Identifier("placeholder");
public static final Identifier ID = Identifier.of("placeholder");
public static final MapCodec<PlaceholderPredicate> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
Codec.STRING.fieldOf("placeholder").forGetter(PlaceholderPredicate::value),
Codec.BOOL.optionalFieldOf("raw", false).forGetter(PlaceholderPredicate::raw)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import java.util.List;

public final class AllPredicate extends AbstractPredicate {
public static final Identifier ID = new Identifier("all");
public static final Identifier ID = Identifier.of("all");
public static final MapCodec<AllPredicate> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
Codec.list(PredicateRegistry.CODEC).fieldOf("values").forGetter(AllPredicate::values)
).apply(instance, AllPredicate::new));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import java.util.List;

public final class AnyPredicate extends AbstractPredicate {
public static final Identifier ID = new Identifier("any");
public static final Identifier ID = Identifier.of("any");
public static final MapCodec<AnyPredicate> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
Codec.list(PredicateRegistry.CODEC).fieldOf("values").forGetter(AnyPredicate::values)
).apply(instance, AnyPredicate::new));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public final class ConstantUnitPredicate extends AbstractPredicate {
private final PredicateResult<Object> value;

public <T extends MinecraftPredicate> ConstantUnitPredicate(Object value) {
super(new Identifier("unit"), MapCodec.unit(null));
super(Identifier.of("unit"), MapCodec.unit(null));

this.value = PredicateResult.ofNullable(value);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

public final class EqualityPredicate extends AbstractPredicate {

public static final Identifier ID = new Identifier("equal");
public static final Identifier ID = Identifier.of("equal");
public static final MapCodec<EqualityPredicate> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
GenericObject.CODEC.fieldOf("value_1").forGetter(EqualityPredicate::valueA),
GenericObject.CODEC.fieldOf("value_2").forGetter(EqualityPredicate::valueB)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import net.minecraft.util.Identifier;

public final class NegatePredicate extends AbstractPredicate {
public static final Identifier ID = new Identifier("negate");
public static final Identifier ID = Identifier.of("negate");
public static final MapCodec<NegatePredicate> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
PredicateRegistry.CODEC.fieldOf("value").forGetter(NegatePredicate::value)
).apply(instance, NegatePredicate::new));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public PredicateResult<?> test(PredicateContext context) {
protected abstract boolean check(double a, double b);

public static final class LessThan extends NumberPredicate {
public static final Identifier ID = new Identifier("less_than");
public static final Identifier ID = Identifier.of("less_than");
public static final MapCodec<LessThan> CODEC = NumberPredicate.codec(LessThan::new);

public LessThan(Object valueA, Object valueB) {
Expand All @@ -68,7 +68,7 @@ protected boolean check(double a, double b) {
}

public static final class LessEqual extends NumberPredicate {
public static final Identifier ID = new Identifier("less_or_equal");
public static final Identifier ID = Identifier.of("less_or_equal");
public static final MapCodec<LessEqual> CODEC = NumberPredicate.codec(LessEqual::new);

public LessEqual(Object valueA, Object valueB) {
Expand All @@ -82,7 +82,7 @@ protected boolean check(double a, double b) {
}

public static final class MoreThan extends NumberPredicate {
public static final Identifier ID = new Identifier("more_than");
public static final Identifier ID = Identifier.of("more_than");
public static final MapCodec<MoreThan> CODEC = NumberPredicate.codec(MoreThan::new);

public MoreThan(Object valueA, Object valueB) {
Expand All @@ -96,7 +96,7 @@ protected boolean check(double a, double b) {
}

public static final class MoreEqual extends NumberPredicate {
public static final Identifier ID = new Identifier("more_or_equal");
public static final Identifier ID = Identifier.of("more_or_equal");
public static final MapCodec<MoreEqual> CODEC = NumberPredicate.codec(MoreEqual::new);

public MoreEqual(Object valueA, Object valueB) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
import java.util.function.Predicate;

public final class SimplePredicate extends AbstractPredicate {
public static final MinecraftPredicate HAS_PLAYER = new SimplePredicate(new Identifier("has_player"), PredicateContext::hasPlayer);
public static final MinecraftPredicate HAS_ENTITY = new SimplePredicate(new Identifier("has_entity"), PredicateContext::hasEntity);
public static final MinecraftPredicate HAS_WORLD = new SimplePredicate(new Identifier("has_world"), PredicateContext::hasWorld);
public static final MinecraftPredicate HAS_GAME_PROFILE = new SimplePredicate(new Identifier("has_game_profile"), PredicateContext::hasGameProfile);
public static final MinecraftPredicate HAS_PLAYER = new SimplePredicate(Identifier.of("has_player"), PredicateContext::hasPlayer);
public static final MinecraftPredicate HAS_ENTITY = new SimplePredicate(Identifier.of("has_entity"), PredicateContext::hasEntity);
public static final MinecraftPredicate HAS_WORLD = new SimplePredicate(Identifier.of("has_world"), PredicateContext::hasWorld);
public static final MinecraftPredicate HAS_GAME_PROFILE = new SimplePredicate(Identifier.of("has_game_profile"), PredicateContext::hasGameProfile);

private final Function<PredicateContext, PredicateResult<?>> function;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public PredicateResult<?> test(PredicateContext context) {
protected abstract PredicateResult<?> testString(String a, String b);

public static final class StartsWith extends StringPredicate {
public static final Identifier ID = new Identifier("starts_with");
public static final Identifier ID = Identifier.of("starts_with");
public static final MapCodec<StartsWith> CODEC = StringPredicate.codec(StartsWith::new);

public <T extends MinecraftPredicate> StartsWith(Object value, Object argument) {
Expand All @@ -67,7 +67,7 @@ protected PredicateResult<?> testString(String a, String b) {
}

public static final class EndsWith extends StringPredicate {
public static final Identifier ID = new Identifier("ends_with");
public static final Identifier ID = Identifier.of("ends_with");
public static final MapCodec<EndsWith> CODEC = StringPredicate.codec(EndsWith::new);

public <T extends MinecraftPredicate> EndsWith(Object value, Object argument) {
Expand All @@ -81,7 +81,7 @@ protected PredicateResult<?> testString(String a, String b) {
}

public static final class Join extends StringPredicate {
public static final Identifier ID = new Identifier("join_string");
public static final Identifier ID = Identifier.of("join_string");
public static final MapCodec<Join> CODEC = StringPredicate.codec(Join::new);

public <T extends MinecraftPredicate> Join(Object value, Object argument) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import net.minecraft.util.dynamic.Codecs;

public class EntityPredicatePredicate extends AbstractPredicate {
public static final Identifier ID = new Identifier("entity");
public static final Identifier ID = Identifier.of("entity");

public static final MapCodec<EntityPredicatePredicate> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
EntityPredicate.CODEC.fieldOf("value").forGetter(EntityPredicatePredicate::predicate)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import net.minecraft.util.Identifier;

public final class OperatorPredicate extends AbstractPredicate {
public static final Identifier ID = new Identifier("operator");
public static final Identifier ID = Identifier.of("operator");
public static final MapCodec<OperatorPredicate> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
Codec.INT.fieldOf("operator").forGetter(OperatorPredicate::operator)
).apply(instance, OperatorPredicate::new));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import net.minecraft.util.Identifier;

public final class StatisticPredicate extends AbstractPredicate {
public static final Identifier ID = new Identifier("statistic");
public static final Identifier ID = Identifier.of("statistic");
public static final MapCodec<StatisticPredicate> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
Registries.STAT_TYPE.getCodec().optionalFieldOf("stat_type", Stats.CUSTOM).forGetter(StatisticPredicate::statType),
Identifier.CODEC.fieldOf("key").forGetter(StatisticPredicate::key)
Expand Down

0 comments on commit fa029c2

Please sign in to comment.