Skip to content

Commit

Permalink
Fix conflicts and decompiler issues
Browse files Browse the repository at this point in the history
  • Loading branch information
lynxplay committed Jan 15, 2025
1 parent a314912 commit 840fd63
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 15 deletions.
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 +_,10 @@
@@ -117,11 +_,11 @@
register(registry, "dimension", DimensionArgument.class, SingletonArgumentInfo.contextFree(DimensionArgument::dimension));
register(registry, "gamemode", GameModeArgument.class, SingletonArgumentInfo.contextFree(GameModeArgument::gameMode));
register(registry, "time", TimeArgument.class, new TimeArgument.Info());
- register(registry, "resource_or_tag", fixClassType(ResourceOrTagArgument.class), new ResourceOrTagArgument.Info());
- register(registry, "resource_or_tag_key", fixClassType(ResourceOrTagKeyArgument.class), new ResourceOrTagKeyArgument.Info());
- register(registry, "resource", fixClassType(ResourceArgument.class), new ResourceArgument.Info());
- register(registry, "resource_key", fixClassType(ResourceKeyArgument.class), new ResourceKeyArgument.Info());
- register(registry, "resource_selector", fixClassType(ResourceSelectorArgument.class), new ResourceSelectorArgument.Info());
+ register(registry, "resource_or_tag", fixClassType(ResourceOrTagArgument.class), new ResourceOrTagArgument.Info<>());
+ register(registry, "resource_or_tag_key", fixClassType(ResourceOrTagKeyArgument.class), new ResourceOrTagKeyArgument.Info<>());
+ register(registry, "resource", fixClassType(ResourceArgument.class), new ResourceArgument.Info<>());
+ register(registry, "resource_key", fixClassType(ResourceKeyArgument.class), new ResourceKeyArgument.Info<>());
+ register(registry, "resource_selector", fixClassType(ResourceSelectorArgument.class), new ResourceSelectorArgument.Info<>());
register(registry, "template_mirror", TemplateMirrorArgument.class, SingletonArgumentInfo.contextFree(TemplateMirrorArgument::templateMirror));
register(registry, "template_rotation", TemplateRotationArgument.class, SingletonArgumentInfo.contextFree(TemplateRotationArgument::templateRotation));
register(registry, "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
@@ -325,7 +_,7 @@
@@ -337,7 +_,7 @@
Bootstrap.checkBootstrapCalled(() -> "registry " + key.location());
ResourceLocation resourceLocation = key.location();
LOADERS.put(resourceLocation, () -> bootstrap.run(registry));
Expand Down
4 changes: 2 additions & 2 deletions versions/25w03a/patches/net/minecraft/nbt/NbtUtils.java.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/net/minecraft/nbt/NbtUtils.java
+++ b/net/minecraft/nbt/NbtUtils.java
@@ -306,7 +_,7 @@
@@ -311,7 +_,7 @@
indent(indentLevel + 1, stringBuilder);
}

Expand All @@ -9,7 +9,7 @@
String stringx = Strings.repeat(" ", ix);

for (int i2 = 0; i2 < list.size(); i2++) {
@@ -333,7 +_,7 @@
@@ -338,7 +_,7 @@
case 11:
IntArrayTag intArrayTag = (IntArrayTag)tag;
int[] asIntArray = intArrayTag.getAsIntArray();
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
@@ -390,7 +_,7 @@
@@ -442,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/resources/RegistryDataLoader.java
+++ b/net/minecraft/resources/RegistryDataLoader.java
@@ -75,7 +_,7 @@
@@ -77,7 +_,7 @@

public class RegistryDataLoader {
private static final Logger LOGGER = LogUtils.getLogger();
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
@@ -854,7 +_,7 @@
@@ -922,7 +_,7 @@
if (item.has(DataComponents.WRITABLE_BOOK_CONTENT)) {
ItemStack itemStack = item.transmuteCopy(Items.WRITTEN_BOOK);
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/datafix/DataFixers.java
+++ b/net/minecraft/util/datafix/DataFixers.java
@@ -1142,7 +_,7 @@
@@ -1150,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");
@@ -1179,7 +_,7 @@
@@ -1187,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,15 @@
--- a/net/minecraft/util/datafix/fixes/EntitySpawnerItemVariantComponentFix.java
+++ b/net/minecraft/util/datafix/fixes/EntitySpawnerItemVariantComponentFix.java
@@ -32,9 +_,9 @@
String string = typed.getOptional(opticFinder).map(Pair::getSecond).orElse("");

return switch (string) {
- case "minecraft:salmon_bucket" -> typed.updateTyped(opticFinder1, EntitySpawnerItemVariantComponentFix::fixSalmonBucket);
- case "minecraft:axolotl_bucket" -> typed.updateTyped(opticFinder1, EntitySpawnerItemVariantComponentFix::fixAxolotlBucket);
- case "minecraft:tropical_fish_bucket" -> typed.updateTyped(opticFinder1, EntitySpawnerItemVariantComponentFix::fixTropicalFishBucket);
+ case "minecraft:salmon_bucket" -> typed.updateTyped(opticFinder1, (Fixer) EntitySpawnerItemVariantComponentFix::fixSalmonBucket);
+ case "minecraft:axolotl_bucket" -> typed.updateTyped(opticFinder1, (Fixer) EntitySpawnerItemVariantComponentFix::fixAxolotlBucket);
+ case "minecraft:tropical_fish_bucket" -> typed.updateTyped(opticFinder1, (Fixer) EntitySpawnerItemVariantComponentFix::fixTropicalFishBucket);
case "minecraft:painting" -> typed.updateTyped(
opticFinder1, typed1 -> Util.writeAndReadTypedOrThrow(typed1, typed1.getType(), EntitySpawnerItemVariantComponentFix::fixPainting)
);
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
@@ -45,7 +_,7 @@
@@ -50,7 +_,7 @@
brain.addActivity(Activity.CORE, 0, ImmutableList.of(new Swim<Creaking>(0.8F) {
@Override
protected boolean checkExtraStartConditions(ServerLevel level, Creaking owner) {
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,7 +_,7 @@
@@ -169,7 +_,7 @@
brain.addActivityAndRemoveMemoryWhenStopped(
Activity.FIGHT,
10,
Expand All @@ -9,7 +9,7 @@
StopAttackingIfTargetInvalid.create((level, entity) -> !isNearestValidAttackTarget(level, piglin, entity)),
BehaviorBuilder.triggerIf(PiglinAi::hasCrossbow, BackUpIfTooClose.create(5, 0.75F)),
SetWalkTargetFromAttackTargetIfTargetOutOfReach.create(1.0F),
@@ -190,7 +_,7 @@
@@ -192,7 +_,7 @@
StartAttacking.<Piglin>create((level, piglin) -> piglin.isAdult(), PiglinAi::findNearestValidAttackTarget),
BehaviorBuilder.triggerIf(level -> !level.isDancing(), GoToTargetLocation.create(MemoryModuleType.CELEBRATE_LOCATION, 2, 1.0F)),
BehaviorBuilder.triggerIf(Piglin::isDancing, GoToTargetLocation.create(MemoryModuleType.CELEBRATE_LOCATION, 4, 0.6F)),
Expand All @@ -18,7 +18,7 @@
ImmutableList.of(
Pair.of(SetEntityLookTarget.create(EntityType.PIGLIN, 8.0F), 1),
Pair.of(RandomStroll.stroll(0.6F, 2, 1), 1),
@@ -223,7 +_,7 @@
@@ -225,7 +_,7 @@
SetWalkTargetAwayFrom.entity(MemoryModuleType.AVOID_TARGET, 1.0F, 12, true),
createIdleLookBehaviors(),
createIdleMovementBehaviors(),
Expand All @@ -27,7 +27,7 @@
),
MemoryModuleType.AVOID_TARGET
);
@@ -245,7 +_,7 @@
@@ -247,7 +_,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
@@ -281,8 +_,8 @@
@@ -230,7 +_,7 @@
.filter(entry -> entry.getValue().valueClass == clazz)
.map(Entry::getKey)
.filter(key -> key.getId().equals(string))
- .map(key -> (GameRules.Key)key)
+ .map(key -> (GameRules.Key<T>)key)
.findFirst()
.map(DataResult::success)
.orElseGet(() -> DataResult.error(() -> "Invalid game rule ID for type: " + string)),
@@ -303,8 +_,8 @@

private <T extends GameRules.Value<T>> void callVisitorCap(GameRules.GameRuleTypeVisitor visitor, GameRules.Key<?> key, GameRules.Type<?> type) {
if (type.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
@@ -98,7 +_,7 @@
}

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

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

0 comments on commit 840fd63

Please sign in to comment.