Skip to content

Commit

Permalink
Merge branch 'PaperMC:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
YuanYuanOwO authored May 22, 2024
2 parents ec3e248 + ec6b172 commit 1306bfe
Show file tree
Hide file tree
Showing 12 changed files with 463 additions and 464 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
java
`maven-publish`
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
id("io.papermc.paperweight.patcher") version "1.5.12"
id("io.papermc.paperweight.patcher") version "1.5.15"
}

val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
Expand All @@ -18,7 +18,7 @@ repositories {

dependencies {
remapper("net.fabricmc:tiny-remapper:0.10.1:fat")
decompiler("net.minecraftforge:forgeflower:2.0.627.2")
decompiler("org.vineflower:vineflower:1.10.1")
paperclip("io.papermc:paperclip:3.0.3")
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ group=dev.folia

version=1.20.4-R0.1-SNAPSHOT
mcVersion=1.20.4
paperRef=5436d44bf2509ff89129f8790ee4643f09c72871
paperRef=7ac24a18940da12beb39a030113f6e459f348e2f

org.gradle.caching=true
org.gradle.parallel=true
Expand Down
2 changes: 1 addition & 1 deletion patches/server/0001-Build-changes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ index 9d687da5bdf398bb3f6c84cdf1249a7213d09f2e..e2f704c115fd6e00960bb56bb0779f11
).openBufferedStream()) {
JsonObject json = new Gson().fromJson(reader, JsonObject.class);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index c8772c773f9933ed1d1debfe707af4373c458152..50055e362a0de853c169a38c6cbd8681b73fc96d 100644
index 2dc07e5ef249636e85ad9c78e3729e9e066a8fe8..6c42592bfaf85f23f7ff9966d7869aa0237f59c5 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1865,7 +1865,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
Expand Down
52 changes: 23 additions & 29 deletions patches/server/0002-MC-Dev-fixes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,32 @@ Subject: [PATCH] MC-Dev fixes


diff --git a/src/main/java/net/minecraft/world/entity/ai/Brain.java b/src/main/java/net/minecraft/world/entity/ai/Brain.java
index dea20f16ac97402f754c8e47d03e9ef38de73190..21e5d1451f90194aa415cf0a183d1a731854f605 100644
index afbb027021acfbe25d534a84f1750e420bbde6e0..af6f91c66e9cc7e0d491e6efed992a140947155e 100644
--- a/src/main/java/net/minecraft/world/entity/ai/Brain.java
+++ b/src/main/java/net/minecraft/world/entity/ai/Brain.java
@@ -72,15 +72,15 @@ public class Brain<E extends LivingEntity> {
}
@@ -79,7 +79,7 @@ public class Brain<E extends LivingEntity> {
}

public <T> DataResult<Brain<E>> decode(DynamicOps<T> dynamicOps, MapLike<T> mapLike) {
- MutableObject<DataResult<ImmutableList.Builder<Brain.MemoryValue<?>>>> mutableObject = new MutableObject<>(DataResult.success(ImmutableList.builder()));
+ MutableObject<DataResult<ImmutableList.Builder<Brain.MemoryValue<?>>>> mutableObject2 = new MutableObject<>(DataResult.success(ImmutableList.builder())); // Folia - decompile fix
mapLike.entries().forEach((pair) -> {
DataResult<MemoryModuleType<?>> dataResult = BuiltInRegistries.MEMORY_MODULE_TYPE.byNameCodec().parse(dynamicOps, pair.getFirst());
DataResult<? extends Brain.MemoryValue<?>> dataResult2 = dataResult.flatMap((memoryType) -> {
return this.captureRead(memoryType, dynamicOps, (T)pair.getSecond());
});
- mutableObject.setValue(mutableObject.getValue().apply2(ImmutableList.Builder::add, dataResult2));
+ mutableObject2.setValue(mutableObject2.getValue().apply2(ImmutableList.Builder::add, dataResult2)); // Folia - decompile fix
});
- ImmutableList<Brain.MemoryValue<?>> immutableList = mutableObject.getValue().resultOrPartial(Brain.LOGGER::error).map(ImmutableList.Builder::build).orElseGet(ImmutableList::of);
+ ImmutableList<Brain.MemoryValue<?>> immutableList = mutableObject2.getValue().resultOrPartial(Brain.LOGGER::error).map(ImmutableList.Builder::build).orElseGet(ImmutableList::of); // Folia - decompile fix
return DataResult.success(new Brain<>(memoryModules, sensors, immutableList, mutableObject::getValue));
}

@@ -181,14 +181,14 @@ public class Brain<E extends LivingEntity> {
public <T> DataResult<Brain<E>> decode(DynamicOps<T> dynamicOps, MapLike<T> mapLike) {
- MutableObject<DataResult<Builder<Brain.MemoryValue<?>>>> mutableObject = new MutableObject<>(
+ MutableObject<DataResult<Builder<Brain.MemoryValue<?>>>> mutableObject2 = new MutableObject<>( // Folia - decompile fix
DataResult.success(ImmutableList.builder())
);
mapLike.entries()
@@ -91,10 +91,10 @@ public class Brain<E extends LivingEntity> {
DataResult<? extends Brain.MemoryValue<?>> dataResult2 = dataResult.flatMap(
memoryType -> this.captureRead((MemoryModuleType<T>)memoryType, dynamicOps, (T)pair.getSecond())
);
- mutableObject.setValue(mutableObject.getValue().apply2(Builder::add, dataResult2));
+ mutableObject2.setValue(mutableObject2.getValue().apply2(Builder::add, dataResult2)); // Folia - decompile fix
}
);
- ImmutableList<Brain.MemoryValue<?>> immutableList = mutableObject.getValue()
+ ImmutableList<Brain.MemoryValue<?>> immutableList = mutableObject2.getValue() // Folia - decompile fix
.resultOrPartial(Brain.LOGGER::error)
.map(Builder::build)
.orElseGet(ImmutableList::of);
@@ -194,14 +194,14 @@ public class Brain<E extends LivingEntity> {
if (optional == null) {
throw new IllegalStateException("Unregistered memory fetched: " + type);
} else {
Expand All @@ -44,12 +47,3 @@ index dea20f16ac97402f754c8e47d03e9ef38de73190..21e5d1451f90194aa415cf0a183d1a73
}

public <U> long getTimeUntilExpiry(MemoryModuleType<U> type) {
@@ -483,7 +483,7 @@ public class Brain<E extends LivingEntity> {
private final Optional<? extends ExpirableValue<U>> value;

static <U> Brain.MemoryValue<U> createUnchecked(MemoryModuleType<U> type, Optional<? extends ExpirableValue<?>> data) {
- return new Brain.MemoryValue<>(type, data);
+ return new Brain.MemoryValue<>(type, (Optional<? extends ExpirableValue<U>>)data); // Folia - decompile fix
}

MemoryValue(MemoryModuleType<U> type, Optional<? extends ExpirableValue<U>> data) {
Loading

0 comments on commit 1306bfe

Please sign in to comment.