Skip to content

Commit

Permalink
fix patches for 24w14a, closes #30
Browse files Browse the repository at this point in the history
  • Loading branch information
MiniDigger committed Apr 23, 2024
1 parent 63d3351 commit 717227f
Show file tree
Hide file tree
Showing 22 changed files with 35 additions and 88 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/net/minecraft/advancements/critereon/MinMaxBounds.java
+++ b/net/minecraft/advancements/critereon/MinMaxBounds.java
@@ -123,7 +_,7 @@
@@ -119,7 +_,7 @@
public static 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());
Expand All @@ -9,7 +9,7 @@

private Doubles(Optional<Double> min, Optional<Double> max) {
this(min, max, squareOpt(min), squareOpt(max));
@@ -179,7 +_,7 @@
@@ -175,7 +_,7 @@
public static 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());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
--- a/net/minecraft/advancements/critereon/PlayerPredicate.java
+++ b/net/minecraft/advancements/critereon/PlayerPredicate.java
@@ -239,11 +_,11 @@
private static <T> Codec<PlayerPredicate.StatMatcher<T>> createTypedCodec(StatType<T> type) {
return RecordCodecBuilder.create(
@@ -236,11 +_,11 @@
private static <T> MapCodec<PlayerPredicate.StatMatcher<T>> createTypedCodec(StatType<T> statType) {
return RecordCodecBuilder.mapCodec(
instance -> instance.group(
- (App<Mu<? extends PlayerPredicate.StatMatcher<?>>, Holder<T>>)type.getRegistry()
+ type.getRegistry()
- (App<Mu<? extends PlayerPredicate.StatMatcher<?>>, Holder<T>>)statType.getRegistry()
+ statType.getRegistry()
.holderByNameCodec()
.fieldOf("stat")
.forGetter(PlayerPredicate.StatMatcher::value),
- (App<Mu<? extends PlayerPredicate.StatMatcher<?>>, MinMaxBounds.Ints>)ExtraCodecs.strictOptionalField(
+ ExtraCodecs.strictOptionalField(
MinMaxBounds.Ints.CODEC, "value", MinMaxBounds.Ints.ANY
)
- (App<Mu<? extends PlayerPredicate.StatMatcher<?>>, MinMaxBounds.Ints>)MinMaxBounds.Ints.CODEC
+ MinMaxBounds.Ints.CODEC
.optionalFieldOf("value", MinMaxBounds.Ints.ANY)
.forGetter(PlayerPredicate.StatMatcher::range)
)
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
+ this(buffer.readCollection(FriendlyByteBuf.<List<ArgumentSignatures.Entry>>limitValue(ArrayList::new, 8), ArgumentSignatures.Entry::new));
}

@Nullable
public void write(FriendlyByteBuf buffer) {
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
--- a/net/minecraft/core/component/DataComponentPatch.java
+++ b/net/minecraft/core/component/DataComponentPatch.java
@@ -18,7 +_,7 @@
@@ -19,7 +_,7 @@

public final class DataComponentPatch {
public static final DataComponentPatch EMPTY = new DataComponentPatch(Reference2ObjectMaps.emptyMap());
- public static final Codec<DataComponentPatch> CODEC = ExtraCodecs.unboundedDispatchMap(
+ public static final Codec<DataComponentPatch> CODEC = ExtraCodecs.<PatchKey, Object>unboundedDispatchMap(
DataComponentPatch.PatchKey.CODEC, DataComponentPatch.PatchKey::valueCodec
)
- public static final Codec<DataComponentPatch> CODEC = Codec.dispatchedMap(DataComponentPatch.PatchKey.CODEC, DataComponentPatch.PatchKey::valueCodec)
+ public static final Codec<DataComponentPatch> CODEC = Codec.<PatchKey, Object>dispatchedMap(DataComponentPatch.PatchKey.CODEC, DataComponentPatch.PatchKey::valueCodec)
.xmap(map -> {
if (map.isEmpty()) {
return EMPTY;

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/net/minecraft/core/component/DataComponentType.java
+++ b/net/minecraft/core/component/DataComponentType.java
@@ -86,7 +_,7 @@
@@ -93,7 +_,7 @@

@Override
public String toString() {
Expand Down
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
@@ -298,7 +_,7 @@
@@ -297,7 +_,7 @@
Bootstrap.checkBootstrapCalled(() -> "registry " + resourceKey);
ResourceLocation resourceLocation = resourceKey.location();
LOADERS.put(resourceLocation, () -> registryBootstrap.run(writableRegistry));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/net/minecraft/network/codec/StreamCodec.java
+++ b/net/minecraft/network/codec/StreamCodec.java
@@ -342,7 +_,7 @@
@@ -298,7 +_,7 @@
}

default <S extends B> StreamCodec<S, V> cast() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/net/minecraft/server/level/ServerLevel.java
+++ b/net/minecraft/server/level/ServerLevel.java
@@ -1614,7 +_,7 @@
@@ -1569,7 +_,7 @@

return map.object2IntEntrySet()
.stream()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -782,7 +_,7 @@
@@ -783,7 +_,7 @@
if (item.is(Items.WRITABLE_BOOK)) {
ItemStack itemStack = item.transmuteCopy(Items.WRITTEN_BOOK, 1);
itemStack.remove(DataComponents.WRITABLE_BOOK_CONTENT);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/net/minecraft/util/ExtraCodecs.java
+++ b/net/minecraft/util/ExtraCodecs.java
@@ -241,7 +_,7 @@
@@ -208,7 +_,7 @@
P object1 = list1.get(1);
return factory.apply(object, object1);
}), object -> ImmutableList.of(minGetter.apply((I)object), maxGetter.apply((I)object)));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/net/minecraft/util/datafix/DataFixers.java
+++ b/net/minecraft/util/datafix/DataFixers.java
@@ -1064,7 +_,7 @@
@@ -1067,7 +_,7 @@
Schema schema161 = builder.addSchema(3086, SAME_NAMESPACED);
builder.addFixer(
new EntityVariantFix(
Expand All @@ -9,7 +9,7 @@
map5.defaultReturnValue("minecraft:tabby");
map5.put(0, "minecraft:tabby");
map5.put(1, "minecraft:black");
@@ -1101,7 +_,7 @@
@@ -1104,7 +_,7 @@
Schema schema162 = builder.addSchema(3087, SAME_NAMESPACED);
builder.addFixer(
new EntityVariantFix(
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/Mob.java
+++ b/net/minecraft/world/entity/Mob.java
@@ -489,7 +_,7 @@
@@ -492,7 +_,7 @@
if (compound.contains("leash", 10)) {
this.delayedLeashInfo = Either.left(compound.getCompound("leash").getUUID("UUID"));
} else if (compound.contains("leash", 11)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/SpawnPlacements.java
+++ b/net/minecraft/world/entity/SpawnPlacements.java
@@ -74,7 +_,7 @@
@@ -73,7 +_,7 @@
EntityType<T> entityType, ServerLevelAccessor serverLevel, MobSpawnType spawnType, BlockPos pos, RandomSource random
) {
SpawnPlacements.Data data = DATA_BY_TYPE.get(entityType);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
--- a/net/minecraft/world/entity/animal/Sheep.java
+++ b/net/minecraft/world/entity/animal/Sheep.java
@@ -84,10 +_,10 @@
@@ -81,7 +_,7 @@
map.put(DyeColor.RED, Blocks.RED_WOOL);
map.put(DyeColor.BLACK, Blocks.BLACK_WOOL);
});
- private static final Map<DyeColor, float[]> COLORARRAY_BY_COLOR = Maps.newEnumMap(
+ private static final Map<DyeColor, float[]> COLORARRAY_BY_COLOR = Maps.<DyeColor, float[]>newEnumMap(
Arrays.stream(DyeColor.values()).collect(Collectors.toMap(color -> (DyeColor)color, Sheep::createSheepColor))
);
- private static final Map<DyeColor, float[]> COLORARRAY_BY_POTATO = Maps.newEnumMap(
+ private static final Map<DyeColor, float[]> COLORARRAY_BY_POTATO = Maps.<DyeColor, float[]>newEnumMap(
Arrays.stream(DyeColor.values()).collect(Collectors.toMap(dyeColor -> (DyeColor)dyeColor, Sheep::createSheepColorPotato))
);
private int eatAnimationTick;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/net/minecraft/world/item/crafting/RecipeManager.java
+++ b/net/minecraft/world/item/crafting/RecipeManager.java
@@ -115,7 +_,7 @@
@@ -114,7 +_,7 @@
}

private <C extends Container, T extends Recipe<C>> Map<ResourceLocation, RecipeHolder<T>> byType(RecipeType<T> recipeType) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/net/minecraft/world/level/GameRules.java
+++ b/net/minecraft/world/level/GameRules.java
@@ -256,8 +_,8 @@
@@ -250,8 +_,8 @@
}

private static <T extends GameRules.Value<T>> void callVisitorCap(GameRules.GameRuleTypeVisitor visitor, GameRules.Key<?> key, GameRules.Type<?> type) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
--- a/net/minecraft/world/level/levelgen/DensityFunctions.java
+++ b/net/minecraft/world/level/levelgen/DensityFunctions.java
@@ -294,7 +_,7 @@
@@ -300,7 +_,7 @@
}
break;
case MIN:
- double d1 = this.argument2.minValue();
+ d1 = this.argument2.minValue();
case MAX:
- double d1 = this.argument2.maxValue();
+ d1 = this.argument2.maxValue();

for (int i2 = 0; i2 < array.length; i2++) {
double d2 = array[i2];
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/net/minecraft/world/level/storage/loot/predicates/LootItemBlockStatePropertyCondition.java
+++ b/net/minecraft/world/level/storage/loot/predicates/LootItemBlockStatePropertyCondition.java
@@ -31,7 +_,7 @@
@@ -27,7 +_,7 @@
private static DataResult<LootItemBlockStatePropertyCondition> validate(LootItemBlockStatePropertyCondition condition) {
return condition.properties()
.flatMap(statePropertiesPredicate -> statePropertiesPredicate.checkState(condition.block().value().getStateDefinition()))
Expand Down

0 comments on commit 717227f

Please sign in to comment.