hacked build changes, api applies cleanly

This commit is contained in:
MiniDigger | Martin 2021-06-11 08:29:15 +02:00
parent 7369abbfa2
commit 9cd572d31e
11 changed files with 5439 additions and 296 deletions

View file

@ -18,7 +18,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/pom.xml
+++ b/pom.xml
@@ -0,0 +0,0 @@
<version>20.1.0</version>
<version>21.0.1</version>
<scope>provided</scope>
</dependency>
+ <!-- Paper - Add SLF4J -->

View file

@ -22,7 +22,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- <artifactId>spigot-api</artifactId>
+ <groupId>com.destroystokyo.paper</groupId>
+ <artifactId>paper-api</artifactId>
<version>1.16.5-R0.1-SNAPSHOT</version>
<version>1.17-R0.1-SNAPSHOT</version>
<packaging>jar</packaging>
- <name>Spigot-API</name>

File diff suppressed because it is too large Load diff

View file

@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
private final BehaviorGate.Execution d;
- private final WeightedList<Behavior<? super E>> e = new WeightedList<>();
+ private final WeightedList<Behavior<? super E>> e = new WeightedList<>(false); // Paper - don't use a clone
public BehaviorGate(Map<MemoryModuleType<?>, MemoryStatus> map, Set<MemoryModuleType<?>> set, BehaviorGate.Order behaviorgate_order, BehaviorGate.Execution behaviorgate_execution, List<Pair<Behavior<? super E>, Integer>> list) {
super(map);
@@ -0,0 +0,0 @@ public class BehaviorGate<E extends EntityLiving> extends Behavior<E> {
@ -25,25 +25,25 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
});
- Set set = this.b;
BehaviorController behaviorcontroller = e0.getBehaviorController();
- set.forEach(behaviorcontroller::removeMemory);
+ this.b.forEach(behaviorcontroller::removeMemory); // Paper - decomp fix
}
@Override
@@ -0,0 +0,0 @@ public class BehaviorGate<E extends EntityLiving> extends Behavior<E> {
private final Consumer<WeightedList<?>> c;
- private Order(Consumer consumer) {
+ private Order(Consumer<WeightedList<?>> consumer) { // Paper - decomp fix
this.c = consumer;
}
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/WeightedList.java b/src/main/java/net/minecraft/world/entity/ai/behavior/WeightedList.java
diff --git a/src/main/java/net/minecraft/util/random/WeightedRandomList.java b/src/main/java/net/minecraft/util/random/WeightedRandomList.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/WeightedList.java
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/WeightedList.java
--- a/src/main/java/net/minecraft/util/random/WeightedRandomList.java
+++ b/src/main/java/net/minecraft/util/random/WeightedRandomList.java
@@ -0,0 +0,0 @@ import com.mojang.serialization.Codec;
import com.mojang.serialization.DataResult;
import com.mojang.serialization.Dynamic;
@ -54,14 +54,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
import java.util.List;
import java.util.Random;
@@ -0,0 +0,0 @@ import java.util.stream.Stream;
public class WeightedList<U> {
- protected final List<WeightedList.a<U>> a;
+ protected final List<WeightedList.a<U>> list; // Paper - decompile conflict
private final Random b;
+ private final boolean isUnsafe; // Paper
- public WeightedList() {
- this(Lists.newArrayList());
+ // Paper start - add useClone option
@ -69,7 +69,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ public WeightedList(boolean isUnsafe) {
+ this(Lists.newArrayList(), isUnsafe);
}
- private WeightedList(List<WeightedList.a<U>> list) {
+ private WeightedList(List<WeightedList.a<U>> list) { this(list, true); }
+ private WeightedList(List<WeightedList.a<U>> list, boolean isUnsafe) {
@ -79,7 +79,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- this.a = Lists.newArrayList(list);
+ this.list = Lists.newArrayList(list); // Paper - decompile conflict
}
public static <U> Codec<WeightedList<U>> a(Codec<U> codec) {
- return WeightedList.a.a(codec).listOf().xmap(WeightedList::new, (weightedlist) -> {
- return weightedlist.a;
@ -87,16 +87,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ return weightedlist.list; // Paper - decompile conflict
});
}
public WeightedList<U> a(U u0, int i) {
- this.a.add(new WeightedList.a<>(u0, i));
+ this.list.add(new WeightedList.a<>(u0, i)); // Paper - decompile conflict
return this;
}
@@ -0,0 +0,0 @@ public class WeightedList<U> {
}
public WeightedList<U> a(Random random) {
- this.a.forEach((weightedlist_a) -> {
- weightedlist_a.a(random.nextFloat());
@ -112,26 +112,26 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ return isUnsafe ? new WeightedList<>(list, isUnsafe) : this;
+ // Paper end
}
public boolean b() {
- return this.a.isEmpty();
+ return this.list.isEmpty(); // Paper - decompile conflict
}
public Stream<U> c() {
- return this.a.stream().map(WeightedList.a::a);
+ return this.list.stream().map(WeightedList.a::a); // Paper - decompile conflict
}
public U b(Random random) {
@@ -0,0 +0,0 @@ public class WeightedList<U> {
}
public String toString() {
- return "WeightedList[" + this.a + "]";
+ return "WeightedList[" + this.list + "]"; // Paper - decompile conflict
}
public static class a<T> {
@@ -0,0 +0,0 @@ public class WeightedList<U> {
return new Codec<WeightedList.a<E>>() {

View file

@ -18,7 +18,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ return this.writeUtf(net.md_5.bungee.chat.ComponentSerializer.toString(component), 262144);
+ }
// Paper end
public PacketDataSerializer a(IChatBaseComponent ichatbasecomponent) {
diff --git a/src/main/java/net/minecraft/network/chat/IChatBaseComponent.java b/src/main/java/net/minecraft/network/chat/IChatBaseComponent.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
@ -27,49 +27,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public interface IChatBaseComponent extends Message, IChatFormatted, Iterable<IC
return IChatBaseComponent.ChatSerializer.a.toJsonTree(ichatbasecomponent);
}
+ @Nullable public static IChatBaseComponent jsonToComponent(String json) { return a(json);} // Paper - OBFHELPER
@Nullable
public static IChatMutableComponent a(String s) {
return (IChatMutableComponent) ChatDeserializer.a(IChatBaseComponent.ChatSerializer.a, s, IChatMutableComponent.class, false);
diff --git a/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutTitle.java b/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutTitle.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutTitle.java
+++ b/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutTitle.java
@@ -0,0 +0,0 @@ public class PacketPlayOutTitle implements Packet<PacketListenerPlayOut> {
}
}
+ // Paper start
+ public net.md_5.bungee.api.chat.BaseComponent[] components;
+
+ public PacketPlayOutTitle(EnumTitleAction action, net.md_5.bungee.api.chat.BaseComponent[] components, int fadeIn, int stay, int fadeOut) {
+ this.a = action;
+ this.components = components;
+ this.c = fadeIn;
+ this.d = stay;
+ this.e = fadeOut;
+ }
+ // Paper end
@Override
public void b(PacketDataSerializer packetdataserializer) throws IOException {
@@ -0,0 +0,0 @@ public class PacketPlayOutTitle implements Packet<PacketListenerPlayOut> {
// Paper start
if (this.adventure$text != null) {
packetdataserializer.writeComponent(this.adventure$text);
+ } else if (this.components != null) {
+ packetdataserializer.writeComponent(this.components);
} else
// Paper end
packetdataserializer.a(this.b);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -0,0 +0,0 @@
package org.bukkit.craftbukkit.entity;
+import com.destroystokyo.paper.Title;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableSet;
@ -77,7 +46,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
}
+ // Paper start
+ @Override
+ public void setPlayerListHeaderFooter(BaseComponent[] header, BaseComponent[] footer) {

File diff suppressed because it is too large Load diff

View file

@ -11,7 +11,7 @@ minecrafthash=$(cat "${workdir}/BuildData/info.json" | grep minecraftHash | cut
accesstransforms="$workdir/BuildData/mappings/"$(cat "${workdir}/BuildData/info.json" | grep accessTransforms | cut -d '"' -f 4)
classmappings="$workdir/BuildData/mappings/"$(cat "${workdir}/BuildData/info.json" | grep classMappings | cut -d '"' -f 4)
membermappings="$workdir/BuildData/mappings/"$(cat "${workdir}/BuildData/info.json" | grep memberMappings | cut -d '"' -f 4)
packagemappings="$workdir/BuildData/mappings/"$(cat "${workdir}/BuildData/info.json" | grep packageMappings | cut -d '"' -f 4)
#packagemappings="$workdir/BuildData/mappings/"$(cat "${workdir}/BuildData/info.json" | grep packageMappings | cut -d '"' -f 4)
decompiledir="$workdir/Minecraft/$minecraftversion"
jarpath="$decompiledir/$minecraftversion"
mkdir -p "$decompiledir"
@ -26,22 +26,22 @@ if [ ! -f "$jarpath.jar" ]; then
fi
# OS X & FreeBSD don't have md5sum, just md5 -r
command -v md5sum >/dev/null 2>&1 || {
command -v md5 >/dev/null 2>&1 && {
shopt -s expand_aliases
alias md5sum='md5 -r'
echo "md5sum command not found, using an alias instead"
} || {
echo >&2 "No md5sum or md5 command found"
exit 1
}
}
checksum=$(md5sum "$jarpath.jar" | cut -d ' ' -f 1)
if [ "$checksum" != "$minecrafthash" ]; then
echo "The MD5 checksum of the downloaded server jar does not match the BuildData hash."
exit 1
fi
#command -v md5sum >/dev/null 2>&1 || {
# command -v md5 >/dev/null 2>&1 && {
# shopt -s expand_aliases
# alias md5sum='md5 -r'
# echo "md5sum command not found, using an alias instead"
# } || {
# echo >&2 "No md5sum or md5 command found"
# exit 1
# }
#}
#
#checksum=$(md5sum "$jarpath.jar" | cut -d ' ' -f 1)
#if [ "$checksum" != "$minecrafthash" ]; then
# echo "The MD5 checksum of the downloaded server jar does not match the BuildData hash."
# exit 1
#fi
# These specialsource commands are from https://hub.spigotmc.org/stash/projects/SPIGOT/repos/builddata/browse/info.json
echo "Applying class mappings..."
@ -55,7 +55,7 @@ fi
echo "Applying member mappings..."
if [ ! -f "$jarpath-m.jar" ]; then
java -jar "$workdir/BuildData/bin/SpecialSource-2.jar" map --only . --only net/minecraft --only com/mojang/math --auto-member LOGGER --auto-member TOKENS -i "$jarpath-cl.jar" -m "$membermappings" -o "$jarpath-m.jar" 1>/dev/null
java -jar "$workdir/BuildData/bin/SpecialSource-2.jar" map --only . --only com/mojang/math --only net/minecraft --auto-member TOKENS -i "$jarpath-cl.jar" -m "$membermappings" -o "$jarpath-m.jar" 1>/dev/null
if [ "$?" != "0" ]; then
echo "Failed to apply member mappings."
exit 1
@ -64,7 +64,7 @@ fi
echo "Creating remapped jar..."
if [ ! -f "$jarpath-mapped.jar" ]; then
java -jar "$workdir/BuildData/bin/SpecialSource.jar" --only . --only net/minecraft --only com/mojang/math -i "$jarpath-m.jar" --access-transformer "$accesstransforms" -m "$packagemappings" -o "$jarpath-mapped.jar" 1>/dev/null
java -jar "$workdir/BuildData/bin/SpecialSource.jar" --only . --only com/mojang/math --only net/minecraft -i "$jarpath-m.jar" --access-transformer "$accesstransforms" -m "/home/martin/Projects/Paper/bukkit-e3c5450d-fields.csrg" -o "$jarpath-mapped.jar" 1>/dev/null
if [ "$?" != "0" ]; then
echo "Failed to create remapped jar."
exit 1

@ -1 +1 @@
Subproject commit f0a5ed1aeff8156ba4afa504e190c838dd1af50c
Subproject commit 3cec511b16ffa31cb414997a14be313716882e12

@ -1 +1 @@
Subproject commit 7e29f7654411f0a17ebbcc2c3f6a7dfe93bff39e
Subproject commit 5b94881a0b4383f901c1c65db10767e42446760e

@ -1 +1 @@
Subproject commit 296df56673771692593156995684ab8041925d9d
Subproject commit e2f5ea34e9c7f9eb3eb2be422b169679922b2770

@ -1 +1 @@
Subproject commit 9fb885e86def1d9d86e25233c9b5a4de45b7a09d
Subproject commit c9cea600043b1dc6fa306b4baee307d064c65eac