Skip to content

Commit

Permalink
Update patches
Browse files Browse the repository at this point in the history
  • Loading branch information
coehlrich committed Jan 15, 2025
1 parent b955d42 commit c6025df
Show file tree
Hide file tree
Showing 18 changed files with 78 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
- HoverEvent.ShowText hoverevent$showtext1 = hoverevent$showtext;
-
- try {
- component1 = hoverevent$showtext1.text();
- component1 = hoverevent$showtext1.value();
- } catch (Throwable throwable) {
- throwable4 = throwable;
- boolean flag2 = false;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/net/minecraft/client/renderer/item/properties/select/ComponentContents.java
+++ b/net/minecraft/client/renderer/item/properties/select/ComponentContents.java
@@ -20,7 +20,7 @@
Codec<? extends DataComponentType<?>> codec = BuiltInRegistries.DATA_COMPONENT_TYPE
.byNameCodec()
.validate(p_398049_ -> p_398049_.isTransient() ? DataResult.error(() -> "Component can't be serialized") : DataResult.success(p_398049_));
- MapCodec<SelectItemModel.UnbakedSwitch<ComponentContents<T>, T>> mapcodec = codec.dispatchMap(
+ MapCodec<SelectItemModel.UnbakedSwitch<ComponentContents<T>, T>> mapcodec = ((Codec<DataComponentType<T>>)codec).dispatchMap(
"component",
p_397332_ -> p_397332_.property().componentType,
p_397367_ -> SelectItemModelProperty.Type.createCasesFieldCodec(p_397367_.codecOrThrow())
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
- HoverEvent.ShowText hoverevent$showtext1 = hoverevent$showtext;
-
- try {
- component1 = hoverevent$showtext1.text();
- component1 = hoverevent$showtext1.value();
- } catch (Throwable throwable) {
- throwable4 = throwable;
- boolean flag2 = false;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/net/minecraft/client/renderer/item/properties/select/ComponentContents.java
+++ b/net/minecraft/client/renderer/item/properties/select/ComponentContents.java
@@ -23,7 +23,7 @@
Codec<? extends DataComponentType<?>> codec = BuiltInRegistries.DATA_COMPONENT_TYPE
.byNameCodec()
.validate(p_398049_ -> p_398049_.isTransient() ? DataResult.error(() -> "Component can't be serialized") : DataResult.success(p_398049_));
- MapCodec<SelectItemModel.UnbakedSwitch<ComponentContents<T>, T>> mapcodec = codec.dispatchMap(
+ MapCodec<SelectItemModel.UnbakedSwitch<ComponentContents<T>, T>> mapcodec = ((Codec<DataComponentType<T>>)codec).dispatchMap(
"component",
p_397332_ -> p_397332_.property().componentType,
p_397367_ -> SelectItemModelProperty.Type.createCasesFieldCodec(p_397367_.codecOrThrow())

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
--- a/net/minecraft/commands/synchronization/ArgumentTypeInfos.java
+++ b/net/minecraft/commands/synchronization/ArgumentTypeInfos.java
@@ -119,10 +119,10 @@
@@ -117,11 +117,11 @@
register(p_235385_, "dimension", DimensionArgument.class, SingletonArgumentInfo.contextFree(DimensionArgument::dimension));
register(p_235385_, "gamemode", GameModeArgument.class, SingletonArgumentInfo.contextFree(GameModeArgument::gameMode));
register(p_235385_, "time", TimeArgument.class, new TimeArgument.Info());
- register(p_235385_, "resource_or_tag", fixClassType(ResourceOrTagArgument.class), new ResourceOrTagArgument.Info());
- register(p_235385_, "resource_or_tag_key", fixClassType(ResourceOrTagKeyArgument.class), new ResourceOrTagKeyArgument.Info());
- register(p_235385_, "resource", fixClassType(ResourceArgument.class), new ResourceArgument.Info());
- register(p_235385_, "resource_key", fixClassType(ResourceKeyArgument.class), new ResourceKeyArgument.Info());
- register(p_235385_, "resource_selector", fixClassType(ResourceSelectorArgument.class), new ResourceSelectorArgument.Info());
+ register(p_235385_, "resource_or_tag", fixClassType(ResourceOrTagArgument.class), new ResourceOrTagArgument.Info<Object>());
+ register(p_235385_, "resource_or_tag_key", fixClassType(ResourceOrTagKeyArgument.class), new ResourceOrTagKeyArgument.Info<Object>());
+ register(p_235385_, "resource", fixClassType(ResourceArgument.class), new ResourceArgument.Info<Object>());
+ register(p_235385_, "resource_key", fixClassType(ResourceKeyArgument.class), new ResourceKeyArgument.Info<Object>());
+ register(p_235385_, "resource_selector", fixClassType(ResourceSelectorArgument.class), new ResourceSelectorArgument.Info<Object>());
register(p_235385_, "template_mirror", TemplateMirrorArgument.class, SingletonArgumentInfo.contextFree(TemplateMirrorArgument::templateMirror));
register(p_235385_, "template_rotation", TemplateRotationArgument.class, SingletonArgumentInfo.contextFree(TemplateRotationArgument::templateRotation));
register(p_235385_, "heightmap", HeightmapTypeArgument.class, SingletonArgumentInfo.contextFree(HeightmapTypeArgument::heightmap));
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
@@ -327,7 +327,7 @@
@@ -339,7 +339,7 @@
Bootstrap.checkBootstrapCalled(() -> "registry " + p_259230_.location());
ResourceLocation resourcelocation = p_259230_.location();
LOADERS.put(resourcelocation, () -> p_259210_.run(p_260327_));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
- HoverEvent.ShowText hoverevent$showtext1 = hoverevent$showtext;
-
- try {
- component = hoverevent$showtext1.text();
- component = hoverevent$showtext1.value();
- } catch (Throwable throwable) {
- throw new MatchException(throwable.toString(), throwable);
- }
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
@@ -388,7 +388,7 @@
@@ -440,7 +440,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/resources/RegistryDataLoader.java
+++ b/net/minecraft/resources/RegistryDataLoader.java
@@ -75,7 +75,7 @@
@@ -77,7 +77,7 @@

public class RegistryDataLoader {
private static final Logger LOGGER = LogUtils.getLogger();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -425,6 +425,7 @@
@@ -434,6 +434,7 @@
}

entity.move(MoverType.PLAYER, new Vec3(d6, d7, d8));
+ double d11 = d7;
d6 = d3 - entity.getX();
d7 = d4 - entity.getY();
if (d7 > -0.5 || d7 < 0.5) {
@@ -454,7 +455,7 @@
@@ -463,7 +464,7 @@
entity.setOnGroundWithMovement(p_9876_.onGround(), vec3);
entity.doCheckFallDamage(vec3.x, vec3.y, vec3.z, p_9876_.onGround());
this.player.checkMovementStatistics(vec3.x, vec3.y, vec3.z);
Expand All @@ -17,7 +17,7 @@
&& !flag1
&& !this.server.isFlightAllowed()
&& !entity.isNoGravity()
@@ -853,7 +854,7 @@
@@ -921,7 +922,7 @@
if (itemstack.has(DataComponents.WRITABLE_BOOK_CONTENT)) {
ItemStack itemstack1 = itemstack.transmuteCopy(Items.WRITTEN_BOOK);
itemstack1.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/datafix/DataFixers.java
+++ b/net/minecraft/util/datafix/DataFixers.java
@@ -1145,7 +1145,7 @@
@@ -1153,7 +1153,7 @@
Schema schema161 = p_14514_.addSchema(3086, SAME_NAMESPACED);
p_14514_.addFixer(
new EntityVariantFix(
Expand All @@ -9,7 +9,7 @@
p_216528_.defaultReturnValue("minecraft:tabby");
p_216528_.put(0, "minecraft:tabby");
p_216528_.put(1, "minecraft:black");
@@ -1185,7 +1185,7 @@
@@ -1193,7 +1193,7 @@
Schema schema162 = p_14514_.addSchema(3087, SAME_NAMESPACED);
p_14514_.addFixer(
new EntityVariantFix(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--- a/net/minecraft/util/datafix/fixes/EntitySpawnerItemVariantComponentFix.java
+++ b/net/minecraft/util/datafix/fixes/EntitySpawnerItemVariantComponentFix.java
@@ -32,9 +32,9 @@
String s = p_397051_.getOptional(opticfinder).map(Pair::getSecond).orElse("");

return switch (s) {
- case "minecraft:salmon_bucket" -> p_397051_.updateTyped(opticfinder1, EntitySpawnerItemVariantComponentFix::fixSalmonBucket);
- case "minecraft:axolotl_bucket" -> p_397051_.updateTyped(opticfinder1, EntitySpawnerItemVariantComponentFix::fixAxolotlBucket);
- case "minecraft:tropical_fish_bucket" -> p_397051_.updateTyped(opticfinder1, EntitySpawnerItemVariantComponentFix::fixTropicalFishBucket);
+ case "minecraft:salmon_bucket" -> p_397051_.updateTyped(opticfinder1, (Fixer)EntitySpawnerItemVariantComponentFix::fixSalmonBucket);
+ case "minecraft:axolotl_bucket" -> p_397051_.updateTyped(opticfinder1, (Fixer)EntitySpawnerItemVariantComponentFix::fixAxolotlBucket);
+ case "minecraft:tropical_fish_bucket" -> p_397051_.updateTyped(opticfinder1, (Fixer)EntitySpawnerItemVariantComponentFix::fixTropicalFishBucket);
case "minecraft:painting" -> p_397051_.updateTyped(
opticfinder1, p_398017_ -> Util.writeAndReadTypedOrThrow(p_398017_, p_398017_.getType(), EntitySpawnerItemVariantComponentFix::fixPainting)
);
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
@@ -495,7 +495,7 @@
@@ -497,7 +497,7 @@

this.firstTick = false;
if (this.level() instanceof ServerLevel serverlevel1 && this instanceof Leashable) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/monster/creaking/CreakingAi.java
+++ b/net/minecraft/world/entity/monster/creaking/CreakingAi.java
@@ -44,7 +44,7 @@
@@ -49,7 +49,7 @@
static void initCoreActivity(Brain<Creaking> p_379953_) {
p_379953_.addActivity(Activity.CORE, 0, ImmutableList.of(new Swim<Creaking>(0.8F) {
protected boolean checkExtraStartConditions(ServerLevel p_380301_, Creaking p_380034_) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/monster/piglin/PiglinAi.java
+++ b/net/minecraft/world/entity/monster/piglin/PiglinAi.java
@@ -167,8 +167,8 @@
@@ -169,8 +169,8 @@
p_34905_.addActivityAndRemoveMemoryWhenStopped(
Activity.FIGHT,
10,
Expand All @@ -11,7 +11,7 @@
BehaviorBuilder.triggerIf(PiglinAi::hasCrossbow, BackUpIfTooClose.create(5, 0.75F)),
SetWalkTargetFromAttackTargetIfTargetOutOfReach.create(1.0F),
MeleeAttack.create(20),
@@ -184,13 +184,13 @@
@@ -186,13 +186,13 @@
p_34921_.addActivityAndRemoveMemoryWhenStopped(
Activity.CELEBRATE,
10,
Expand All @@ -29,7 +29,7 @@
ImmutableList.of(
Pair.of(SetEntityLookTarget.create(EntityType.PIGLIN, 8.0F), 1),
Pair.of(RandomStroll.stroll(0.6F, 2, 1), 1),
@@ -223,7 +223,7 @@
@@ -225,7 +225,7 @@
SetWalkTargetAwayFrom.entity(MemoryModuleType.AVOID_TARGET, 1.0F, 12, true),
createIdleLookBehaviors(),
createIdleMovementBehaviors(),
Expand All @@ -38,7 +38,7 @@
),
MemoryModuleType.AVOID_TARGET
);
@@ -245,7 +245,7 @@
@@ -247,7 +247,7 @@
.build()
)
),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
--- a/net/minecraft/world/level/GameRules.java
+++ b/net/minecraft/world/level/GameRules.java
@@ -283,8 +283,8 @@
@@ -231,7 +231,7 @@
.filter(p_396932_ -> p_396932_.getValue().valueClass == p_397496_)
.map(Entry::getKey)
.filter(p_396927_ -> p_396927_.getId().equals(p_396930_))
- .map(p_396934_ -> (GameRules.Key)p_396934_)
+ .map(p_396934_ -> (GameRules.Key<T>)p_396934_)
.findFirst()
.map(DataResult::success)
.orElseGet(() -> DataResult.error(() -> "Invalid game rule ID for type: " + p_396930_)),
@@ -305,8 +305,8 @@

private <T extends GameRules.Value<T>> void callVisitorCap(GameRules.GameRuleTypeVisitor p_46167_, GameRules.Key<?> p_46168_, GameRules.Type<?> p_46169_) {
if (p_46169_.requiredFeatures.isSubsetOf(this.enabledFeatures)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/net/minecraft/world/level/block/entity/TestInstanceBlockEntity.java
+++ b/net/minecraft/world/level/block/entity/TestInstanceBlockEntity.java
@@ -100,7 +100,7 @@
}

public Component getTestName() {
- return this.test().map(p_397722_ -> Component.literal(p_397722_.location().toString())).orElse(INVALID_TEST_NAME);
+ return this.test().map(p_397722_ -> (Component)Component.literal(p_397722_.location().toString())).orElse(INVALID_TEST_NAME);
}

private Optional<Holder.Reference<GameTestInstance>> getTestHolder() {

0 comments on commit c6025df

Please sign in to comment.