Regenerate patches with relative headers. This should lower conflicts in future PRs.

Convert Forge to use Official mappings.
Mojang released their obfuscation mappings but we have not used them up until now due to wanting to get their license to be more explicitly permissive.
It is clear that their intent is to allow us to use their names for developing mods like this.
See the full wording, and our interpretation here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
This commit is contained in:
LexManos committed 2021-03-09 14:21:48 -08:00
1 parent 802298d99d
commit a95b968c13
832 files changed
+4464 -4373

No files matched your search

@@ -34,7 +34,7 @@ public class ForgeConnectionNetworkFilter extends VanillaPacketFilter
protected boolean isNecessary(NetworkManager manager)
{
// not needed on local connections, because packets are not encoded to bytes there
return !manager.isLocalChannel() && !NetworkHooks.isVanillaConnection(manager);
return !manager.isMemoryConnection() && !NetworkHooks.isVanillaConnection(manager);
}
private static void splitPacket(IPacket<?> packet, List<? super IPacket<?>> out)
@@ -77,12 +77,12 @@ public class VanillaConnectionNetworkFilter extends VanillaPacketFilter
private static SEntityPropertiesPacket filterEntityProperties(SEntityPropertiesPacket msg)
{
SEntityPropertiesPacket newPacket = new SEntityPropertiesPacket(msg.getEntityId(), Collections.emptyList());
msg.getSnapshots().stream()
msg.getValues().stream()
.filter(snapshot -> {
ResourceLocation key = ForgeRegistries.ATTRIBUTES.getKey(snapshot.func_240834_a_());
ResourceLocation key = ForgeRegistries.ATTRIBUTES.getKey(snapshot.getAttribute());
return key != null && key.getNamespace().equals("minecraft");
})
.forEach(snapshot -> newPacket.getSnapshots().add(snapshot));
.forEach(snapshot -> newPacket.getValues().add(snapshot));
return newPacket;
}
@@ -75,7 +75,7 @@ public class VanillaPacketSplitter
PacketBuffer buf = new PacketBuffer(Unpooled.buffer());
try
{
packet.writePacketData(buf);
packet.write(buf);
}
catch (IOException e)
{
@@ -158,7 +158,7 @@ public class VanillaPacketSplitter
{
PacketBuffer full = new PacketBuffer(Unpooled.wrappedBuffer(receivedBuffers.toArray(new PacketBuffer[0])));
int packetId = full.readVarInt();
IPacket<?> packet = protocol.getPacket(direction, packetId);
IPacket<?> packet = protocol.createPacket(direction, packetId);
if (packet == null)
{
LOGGER.error("Received invalid packet ID {} in forge:split", packetId);
@@ -171,7 +171,7 @@ public class VanillaPacketSplitter
{
try
{
packet.readPacketData(full);
packet.read(full);
}
catch (IOException e)
{
@@ -180,7 +180,7 @@ public class VanillaPacketSplitter
receivedBuffers.clear();
full.release();
}
ctx.enqueueWork(() -> ((IPacket<ClientPlayNetHandler>)packet).processPacket(Minecraft.getInstance().getConnection()));
ctx.enqueueWork(() -> ((IPacket<ClientPlayNetHandler>)packet).handle(Minecraft.getInstance().getConnection()));
}
}
}