Skip to content

Commit

Permalink
fix patches for 24w14potato, closes #29
Browse files Browse the repository at this point in the history
  • Loading branch information
MiniDigger committed Apr 23, 2024
1 parent fbd9780 commit c81fcda
Show file tree
Hide file tree
Showing 20 changed files with 73 additions and 31 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
@@ -119,7 +_,7 @@
@@ -123,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));
@@ -175,7 +_,7 @@
@@ -179,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
@@ -236,11 +_,11 @@
private static <T> MapCodec<PlayerPredicate.StatMatcher<T>> createTypedCodec(StatType<T> statType) {
return RecordCodecBuilder.mapCodec(
@@ -239,11 +_,11 @@
private static <T> Codec<PlayerPredicate.StatMatcher<T>> createTypedCodec(StatType<T> type) {
return RecordCodecBuilder.create(
instance -> instance.group(
- (App<Mu<? extends PlayerPredicate.StatMatcher<?>>, Holder<T>>)statType.getRegistry()
+ statType.getRegistry()
- (App<Mu<? extends PlayerPredicate.StatMatcher<?>>, Holder<T>>)type.getRegistry()
+ type.getRegistry()
.holderByNameCodec()
.fieldOf("stat")
.forGetter(PlayerPredicate.StatMatcher::value),
- (App<Mu<? extends PlayerPredicate.StatMatcher<?>>, MinMaxBounds.Ints>)MinMaxBounds.Ints.CODEC
+ MinMaxBounds.Ints.CODEC
.optionalFieldOf("value", MinMaxBounds.Ints.ANY)
- (App<Mu<? extends PlayerPredicate.StatMatcher<?>>, MinMaxBounds.Ints>)ExtraCodecs.strictOptionalField(
+ ExtraCodecs.strictOptionalField(
MinMaxBounds.Ints.CODEC, "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));
}

public void write(FriendlyByteBuf buffer) {
@Nullable
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
@@ -19,7 +_,7 @@
@@ -18,7 +_,7 @@

public final class DataComponentPatch {
public static final DataComponentPatch EMPTY = new DataComponentPatch(Reference2ObjectMaps.emptyMap());
- 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)
- public static final Codec<DataComponentPatch> CODEC = ExtraCodecs.unboundedDispatchMap(
+ public static final Codec<DataComponentPatch> CODEC = ExtraCodecs.<PatchKey, Object>unboundedDispatchMap(
DataComponentPatch.PatchKey.CODEC, DataComponentPatch.PatchKey::valueCodec
)
.xmap(map -> {
if (map.isEmpty()) {
return EMPTY;
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/net/minecraft/core/component/DataComponentPredicate.java
+++ b/net/minecraft/core/component/DataComponentPredicate.java
@@ -13,7 +_,7 @@
import net.minecraft.util.ExtraCodecs;

public final class DataComponentPredicate implements Predicate<DataComponentMap> {
- public static final Codec<DataComponentPredicate> CODEC = ExtraCodecs.unboundedDispatchMap(DataComponentType.CODEC, DataComponentType::codecOrThrow)
+ public static final Codec<DataComponentPredicate> CODEC = ExtraCodecs.<DataComponentType<?>, Object>unboundedDispatchMap(DataComponentType.CODEC, DataComponentType::codecOrThrow)
.xmap(
map -> new DataComponentPredicate(map.entrySet().stream().map(TypedDataComponent::fromEntryUnchecked).collect(Collectors.toList())),
dataComponentPredicate -> dataComponentPredicate.expectedComponents
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
@@ -93,7 +_,7 @@
@@ -86,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
@@ -297,7 +_,7 @@
@@ -298,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
@@ -298,7 +_,7 @@
@@ -342,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
@@ -1569,7 +_,7 @@
@@ -1614,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
@@ -783,7 +_,7 @@
@@ -782,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
@@ -208,7 +_,7 @@
@@ -241,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
@@ -1067,7 +_,7 @@
@@ -1064,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");
@@ -1104,7 +_,7 @@
@@ -1101,7 +_,7 @@
Schema schema162 = builder.addSchema(3087, SAME_NAMESPACED);
builder.addFixer(
new EntityVariantFix(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
--- a/net/minecraft/util/datafix/fixes/BlockPosFormatAndRenamesFix.java
+++ b/net/minecraft/util/datafix/fixes/BlockPosFormatAndRenamesFix.java
@@ -36,11 +_,11 @@

private <T> Dynamic<T> fixMapSavedData(Dynamic<T> dynamic) {
return dynamic.update("frames", dynamic1 -> dynamic1.createList(dynamic1.asStream().map(dynamic2 -> {
- dynamic2 = ExtraDataFixUtils.renameAndFixField((Dynamic<?>)dynamic2, "Pos", "pos", ExtraDataFixUtils::fixBlockPos);
+ dynamic2 = ExtraDataFixUtils.renameAndFixField(dynamic2, "Pos", "pos", ExtraDataFixUtils::fixBlockPos);
dynamic2 = ExtraDataFixUtils.renameField(dynamic2, "Rotation", "rotation");
return ExtraDataFixUtils.renameField(dynamic2, "EntityId", "entity_id");
}))).update("banners", dynamic1 -> dynamic1.createList(dynamic1.asStream().map(dynamic2 -> {
- dynamic2 = ExtraDataFixUtils.renameField((Dynamic<?>)dynamic2, "Pos", "pos");
+ dynamic2 = ExtraDataFixUtils.renameField(dynamic2, "Pos", "pos");
dynamic2 = ExtraDataFixUtils.renameField(dynamic2, "Color", "color");
return ExtraDataFixUtils.renameField(dynamic2, "Name", "name");
})));
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
@@ -492,7 +_,7 @@
@@ -489,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
@@ -73,7 +_,7 @@
@@ -74,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,11 +1,15 @@
--- a/net/minecraft/world/entity/animal/Sheep.java
+++ b/net/minecraft/world/entity/animal/Sheep.java
@@ -81,7 +_,7 @@
@@ -84,10 +_,10 @@
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
@@ -114,7 +_,7 @@
@@ -115,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
@@ -250,8 +_,8 @@
@@ -256,8 +_,8 @@
}

private static <T extends GameRules.Value<T>> void callVisitorCap(GameRules.GameRuleTypeVisitor visitor, GameRules.Key<?> key, GameRules.Type<?> type) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/net/minecraft/world/level/block/PointedDripstoneBlock.java
+++ b/net/minecraft/world/level/block/PointedDripstoneBlock.java
@@ -583,7 +_,7 @@
@Nullable
public static BlockPos findStalactiteTipAboveCauldron(Block block, Level level, BlockPos blockPos) {
if (block instanceof PointedDripstoneBlock pointedDripstoneBlock) {
- BiPredicate biPredicate = (blockPos1, blockState) -> canDripThrough(level, blockPos1, blockState);
+ BiPredicate<BlockPos, BlockState> biPredicate = (blockPos1, blockState) -> canDripThrough(level, blockPos1, blockState);
return findBlockVertical(level, blockPos, Direction.UP.getAxisDirection(), biPredicate, pointedDripstoneBlock::canDrip, 11).orElse(null);
} else {
return null;
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
@@ -27,7 +_,7 @@
@@ -31,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 c81fcda

Please sign in to comment.