Skip to content

Commit

Permalink
Fix patches for 25w04a
Browse files Browse the repository at this point in the history
  • Loading branch information
lynxplay committed Jan 22, 2025
1 parent 0dc6b1b commit 2b9868d
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 34 deletions.
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
--- a/net/minecraft/advancements/critereon/MinMaxBounds.java
+++ b/net/minecraft/advancements/critereon/MinMaxBounds.java
@@ -119,7 +_,7 @@
@@ -148,8 +_,8 @@
public record Doubles(@Override Optional<Double> min, @Override Optional<Double> max, Optional<Double> minSq, Optional<Double> maxSq)
implements MinMaxBounds<Double> {
public static final MinMaxBounds.Doubles ANY = new MinMaxBounds.Doubles(Optional.empty(), Optional.empty());
- public static final Codec<MinMaxBounds.Doubles> CODEC = MinMaxBounds.createCodec(Codec.DOUBLE, MinMaxBounds.Doubles::new);
- public static final StreamCodec<ByteBuf, MinMaxBounds.Doubles> STREAM_CODEC = MinMaxBounds.createStreamCodec(
+ public static final Codec<MinMaxBounds.Doubles> CODEC = MinMaxBounds.<Double, MinMaxBounds.Doubles>createCodec(Codec.DOUBLE, MinMaxBounds.Doubles::new);
+ public static final StreamCodec<ByteBuf, MinMaxBounds.Doubles> STREAM_CODEC = MinMaxBounds.<ByteBuf, Double, MinMaxBounds.Doubles>createStreamCodec(
ByteBufCodecs.DOUBLE, MinMaxBounds.Doubles::new
);

private Doubles(Optional<Double> min, Optional<Double> max) {
this(min, max, squareOpt(min), squareOpt(max));
@@ -175,7 +_,7 @@
@@ -207,8 +_,8 @@
public record Ints(@Override Optional<Integer> min, @Override Optional<Integer> max, Optional<Long> minSq, Optional<Long> maxSq)
implements MinMaxBounds<Integer> {
public static final MinMaxBounds.Ints ANY = new MinMaxBounds.Ints(Optional.empty(), Optional.empty());
- public static final Codec<MinMaxBounds.Ints> CODEC = MinMaxBounds.createCodec(Codec.INT, MinMaxBounds.Ints::new);
- public static final StreamCodec<ByteBuf, MinMaxBounds.Ints> STREAM_CODEC = MinMaxBounds.createStreamCodec(ByteBufCodecs.INT, MinMaxBounds.Ints::new);
+ public static final Codec<MinMaxBounds.Ints> CODEC = MinMaxBounds.<Integer, MinMaxBounds.Ints>createCodec(Codec.INT, MinMaxBounds.Ints::new);
+ public static final StreamCodec<ByteBuf, MinMaxBounds.Ints> STREAM_CODEC = MinMaxBounds.<ByteBuf, Integer, MinMaxBounds.Ints>createStreamCodec(ByteBufCodecs.INT, MinMaxBounds.Ints::new);

private Ints(Optional<Integer> min, Optional<Integer> max) {
this(min, max, min.map(integer -> integer.longValue() * integer.longValue()), squareOpt(max));
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/net/minecraft/core/registries/BuiltInRegistries.java
+++ b/net/minecraft/core/registries/BuiltInRegistries.java
@@ -337,7 +_,7 @@
@@ -338,7 +_,7 @@
Bootstrap.checkBootstrapCalled(() -> "registry " + key.location());
ResourceLocation resourceLocation = key.location();
LOADERS.put(resourceLocation, () -> bootstrap.run(registry));
Expand Down
17 changes: 0 additions & 17 deletions versions/25w04a/patches/net/minecraft/nbt/TagParser.java.patch

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/net/minecraft/resources/RegistryDataLoader.java
+++ b/net/minecraft/resources/RegistryDataLoader.java
@@ -77,7 +_,7 @@
@@ -79,7 +_,7 @@

public class RegistryDataLoader {
private static final Logger LOGGER = LogUtils.getLogger();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
--- a/net/minecraft/util/PlaceholderLookupProvider.java
+++ b/net/minecraft/util/PlaceholderLookupProvider.java
@@ -101,11 +_,11 @@
}

public <T> HolderGetter<T> castAsLookup() {
- return this;
+ return (HolderGetter<T>) this;
}

public <T> HolderOwner<T> castAsOwner() {
- return this;
+ return (HolderOwner<T>) this;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
--- a/net/minecraft/util/datafix/DataFixers.java
+++ b/net/minecraft/util/datafix/DataFixers.java
@@ -1150,7 +_,7 @@
Schema schema161 = builder.addSchema(3086, SAME_NAMESPACED);
@@ -1158,7 +_,7 @@
Schema schema162 = builder.addSchema(3086, SAME_NAMESPACED);
builder.addFixer(
new EntityVariantFix(
- schema161, "Change cat variant type", References.ENTITY, "minecraft:cat", "CatType", Util.make(new Int2ObjectOpenHashMap(), map5 -> {
+ schema161, "Change cat variant type", References.ENTITY, "minecraft:cat", "CatType", Util.make(new Int2ObjectOpenHashMap<String>(), map5 -> {
- schema162, "Change cat variant type", References.ENTITY, "minecraft:cat", "CatType", Util.make(new Int2ObjectOpenHashMap(), map5 -> {
+ schema162, "Change cat variant type", References.ENTITY, "minecraft:cat", "CatType", Util.make(new Int2ObjectOpenHashMap<String>(), map5 -> {
map5.defaultReturnValue("minecraft:tabby");
map5.put(0, "minecraft:tabby");
map5.put(1, "minecraft:black");
@@ -1187,7 +_,7 @@
Schema schema162 = builder.addSchema(3087, SAME_NAMESPACED);
@@ -1195,7 +_,7 @@
Schema schema163 = builder.addSchema(3087, SAME_NAMESPACED);
builder.addFixer(
new EntityVariantFix(
- schema162, "Change frog variant type", References.ENTITY, "minecraft:frog", "Variant", Util.make(new Int2ObjectOpenHashMap(), map5 -> {
+ schema162, "Change frog variant type", References.ENTITY, "minecraft:frog", "Variant", Util.make(new Int2ObjectOpenHashMap<String>(), map5 -> {
- schema163, "Change frog variant type", References.ENTITY, "minecraft:frog", "Variant", Util.make(new Int2ObjectOpenHashMap(), map5 -> {
+ schema163, "Change frog variant type", References.ENTITY, "minecraft:frog", "Variant", Util.make(new Int2ObjectOpenHashMap<String>(), map5 -> {
map5.put(0, "minecraft:temperate");
map5.put(1, "minecraft:warm");
map5.put(2, "minecraft:cold");
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/net/minecraft/world/entity/variant/PriorityProvider.java
+++ b/net/minecraft/world/entity/variant/PriorityProvider.java
@@ -99,7 +_,7 @@
}

public record UnpackedEntry<C, T>(T entry, int priority, PriorityProvider.SelectorCondition<C> condition) {
- public static final Comparator<PriorityProvider.UnpackedEntry<?, ?>> HIGHEST_PRIORITY_FIRST = Comparator.comparingInt(
+ public static final Comparator<PriorityProvider.UnpackedEntry<?, ?>> HIGHEST_PRIORITY_FIRST = Comparator.<PriorityProvider.UnpackedEntry<?, ?>>comparingInt(
PriorityProvider.UnpackedEntry::priority
)
.reversed();
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/net/minecraft/world/item/AdventureModePredicate.java
+++ b/net/minecraft/world/item/AdventureModePredicate.java
@@ -117,7 +_,7 @@
@@ -95,7 +_,7 @@
return predicates.stream()
.flatMap(blockPredicate1 -> blockPredicate1.blocks().orElseThrow().stream())
.distinct()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/net/minecraft/world/level/block/Block.java
+++ b/net/minecraft/world/level/block/Block.java
@@ -528,7 +_,7 @@
@@ -524,7 +_,7 @@
}

private static <S extends StateHolder<?, S>, T extends Comparable<T>> S setValueHelper(S stateHolder, Property<T> property, Object object) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/net/minecraft/world/level/block/entity/TestInstanceBlockEntity.java
+++ b/net/minecraft/world/level/block/entity/TestInstanceBlockEntity.java
@@ -98,7 +_,7 @@
@@ -99,7 +_,7 @@
}

public Component getTestName() {
Expand Down

0 comments on commit 2b9868d

Please sign in to comment.