Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary casting #268

Merged
merged 1 commit into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions patches/server/0001-Fix-Decompilation-errors.patch
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,10 @@ index 8de31ea2569a2cb68b5a5a2b4d61fbb7007a824d..11218808402b3d88c99b4b44f654907c

public static class CommandNumber {
diff --git a/src/main/java/net/minecraft/server/CustomWorldSettingsFinal.java b/src/main/java/net/minecraft/server/CustomWorldSettingsFinal.java
index 4948ad3499b2eef73cbb46a56ae55095a6bf39a7..0b5785673c53a888e13e1e07f63f32277df70783 100644
index 4948ad3499b2eef73cbb46a56ae55095a6bf39a7..25282602ea0a80ca7bf6761cb89b5bbef0e7add2 100644
--- a/src/main/java/net/minecraft/server/CustomWorldSettingsFinal.java
+++ b/src/main/java/net/minecraft/server/CustomWorldSettingsFinal.java
@@ -284,92 +284,92 @@ public class CustomWorldSettingsFinal {
@@ -284,93 +284,93 @@ public class CustomWorldSettingsFinal {
public JsonElement a(CustomWorldSettingsFinal.CustomWorldSettings customworldsettingsfinal_customworldsettings, Type type, JsonSerializationContext jsonserializationcontext) {
JsonObject jsonobject = new JsonObject();

Expand Down Expand Up @@ -410,10 +410,12 @@ index 4948ad3499b2eef73cbb46a56ae55095a6bf39a7..0b5785673c53a888e13e1e07f63f3227
}

- public JsonElement serialize(Object object, Type type, JsonSerializationContext jsonserializationcontext) {
- return this.a((CustomWorldSettingsFinal.CustomWorldSettings) object, type, jsonserializationcontext);
+ public JsonElement serialize(CustomWorldSettingsFinal.CustomWorldSettings object, Type type, JsonSerializationContext jsonserializationcontext) {
return this.a((CustomWorldSettingsFinal.CustomWorldSettings) object, type, jsonserializationcontext);
+ return this.a(object, type, jsonserializationcontext);
}
}

diff --git a/src/main/java/net/minecraft/server/DedicatedPlayerList.java b/src/main/java/net/minecraft/server/DedicatedPlayerList.java
index c5de460c64e42cf53d2510caa7245e1a08ec07b8..75dc45f2e5fe59333b0e11d50209b1d1cb4ce947 100644
--- a/src/main/java/net/minecraft/server/DedicatedPlayerList.java
Expand Down Expand Up @@ -896,16 +898,17 @@ index 5c91610430ef2bde06c07daa7b752a3b92c5d3ca..58214e1449e964a009d3fc18983f4d02
}
}
diff --git a/src/main/java/net/minecraft/server/PacketEncrypter.java b/src/main/java/net/minecraft/server/PacketEncrypter.java
index bd972ebebe43e82b0eae56882ad21fc4feae84b1..b32a7e67666d372cc9f080b60897f28fb59736fd 100644
index bd972ebebe43e82b0eae56882ad21fc4feae84b1..e8ef4725c4d21c49fcc0219578391e15d0164a67 100644
--- a/src/main/java/net/minecraft/server/PacketEncrypter.java
+++ b/src/main/java/net/minecraft/server/PacketEncrypter.java
@@ -17,7 +17,7 @@ public class PacketEncrypter extends MessageToByteEncoder<ByteBuf> {
this.a.a(bytebuf, bytebuf1);
}

- protected void encode(ChannelHandlerContext channelhandlercontext, Object object, ByteBuf bytebuf) throws Exception {
- this.a(channelhandlercontext, (ByteBuf) object, bytebuf);
+ protected void encode(ChannelHandlerContext channelhandlercontext, ByteBuf object, ByteBuf bytebuf) throws Exception {
this.a(channelhandlercontext, (ByteBuf) object, bytebuf);
+ this.a(channelhandlercontext, object, bytebuf);
}
}
diff --git a/src/main/java/net/minecraft/server/PacketLoginInStart.java b/src/main/java/net/minecraft/server/PacketLoginInStart.java
Expand Down Expand Up @@ -2143,16 +2146,17 @@ index db8af7daaef07fdb34705ef274178150861f60ea..74571c542a269b3d6d3cdf5cb2b85707
- }
}
diff --git a/src/main/java/net/minecraft/server/PacketPrepender.java b/src/main/java/net/minecraft/server/PacketPrepender.java
index e09ede5bfff8c71b82fdcbeb50e84ec7d617f3f1..29d28a45224afbf7f5641a98fee1ae7a416ed6e1 100644
index e09ede5bfff8c71b82fdcbeb50e84ec7d617f3f1..70cb2632a7de8023facb56e218384cee9a15e889 100644
--- a/src/main/java/net/minecraft/server/PacketPrepender.java
+++ b/src/main/java/net/minecraft/server/PacketPrepender.java
@@ -23,7 +23,7 @@ public class PacketPrepender extends MessageToByteEncoder<ByteBuf> {
}
}

- protected void encode(ChannelHandlerContext channelhandlercontext, Object object, ByteBuf bytebuf) throws Exception {
- this.a(channelhandlercontext, (ByteBuf) object, bytebuf);
+ protected void encode(ChannelHandlerContext channelhandlercontext, ByteBuf object, ByteBuf bytebuf) throws Exception {
this.a(channelhandlercontext, (ByteBuf) object, bytebuf);
+ this.a(channelhandlercontext, object, bytebuf);
}
}
diff --git a/src/main/java/net/minecraft/server/PacketStatusInPing.java b/src/main/java/net/minecraft/server/PacketStatusInPing.java
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0038-Optimize-VarInt-reading-and-writing.patch
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ index 0000000000000000000000000000000000000000..c0040dd80559d30f963eb952f6ef3372
+ }
+}
diff --git a/src/main/java/net/minecraft/server/PacketPrepender.java b/src/main/java/net/minecraft/server/PacketPrepender.java
index 29d28a45224afbf7f5641a98fee1ae7a416ed6e1..0c0babf7a0c306e1156b8177fc00334999b5adc2 100644
index 70cb2632a7de8023facb56e218384cee9a15e889..db51c60501d3a498f60147a1c4638903235cfa65 100644
--- a/src/main/java/net/minecraft/server/PacketPrepender.java
+++ b/src/main/java/net/minecraft/server/PacketPrepender.java
@@ -4,26 +4,29 @@ import io.netty.buffer.ByteBuf;
Expand Down Expand Up @@ -217,7 +217,7 @@ index 29d28a45224afbf7f5641a98fee1ae7a416ed6e1..0c0babf7a0c306e1156b8177fc003349
}

protected void encode(ChannelHandlerContext channelhandlercontext, ByteBuf object, ByteBuf bytebuf) throws Exception {
this.a(channelhandlercontext, (ByteBuf) object, bytebuf);
this.a(channelhandlercontext, object, bytebuf);
}
+ // PandaSpigot start
+ @Override
Expand Down
Loading