mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-22 13:09:59 +00:00
1.20.6 Initial Update
New Decompiler Runtime Official mappings ItemStacks arnt Capability providers anymore, use Vanilla's system. Co-authored-by: RealMangoRage <[email protected]> Co-authored-by: Paint_Ninja <[email protected]>
This commit is contained in:
1114 files changed
+24245
-28536
No files matched your search
+1
-1
@@ -62,7 +62,7 @@ public class VanillaConnectionNetworkFilter extends VanillaPacketFilter {
|
||||
ClientboundUpdateAttributesPacket newPacket = new ClientboundUpdateAttributesPacket(msg.getEntityId(), Collections.emptyList());
|
||||
msg.getValues().stream()
|
||||
.filter(snapshot -> {
|
||||
ResourceLocation key = ForgeRegistries.ATTRIBUTES.getKey(snapshot.getAttribute());
|
||||
ResourceLocation key = ForgeRegistries.ATTRIBUTES.getKey(snapshot.attribute().get());
|
||||
return key != null && key.getNamespace().equals("minecraft");
|
||||
})
|
||||
.forEach(snapshot -> newPacket.getValues().add(snapshot));
|
||||
|
||||
@@ -13,6 +13,7 @@ import net.minecraft.client.gui.screens.MenuScreens;
|
||||
import net.minecraft.core.registries.BuiltInRegistries;
|
||||
import net.minecraft.network.FriendlyByteBuf;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.ComponentSerialization;
|
||||
import net.minecraft.world.inventory.AbstractContainerMenu;
|
||||
import net.minecraft.world.inventory.MenuType;
|
||||
import net.minecraftforge.event.network.CustomPayloadEvent;
|
||||
@@ -41,14 +42,19 @@ public class OpenContainer {
|
||||
public static void encode(OpenContainer msg, FriendlyByteBuf buf) {
|
||||
buf.writeVarInt(msg.id);
|
||||
buf.writeVarInt(msg.windowId);
|
||||
buf.writeComponent(msg.name);
|
||||
ComponentSerialization.TRUSTED_CONTEXT_FREE_STREAM_CODEC.encode(buf, msg.name);
|
||||
msg.additionalData.markReaderIndex();
|
||||
buf.writeByteArray(msg.additionalData.readByteArray());
|
||||
msg.additionalData.resetReaderIndex();
|
||||
}
|
||||
|
||||
public static OpenContainer decode(FriendlyByteBuf buf) {
|
||||
return new OpenContainer(buf.readVarInt(), buf.readVarInt(), buf.readComponent(), new FriendlyByteBuf(Unpooled.wrappedBuffer(buf.readByteArray(32600))));
|
||||
return new OpenContainer(
|
||||
buf.readVarInt(),
|
||||
buf.readVarInt(),
|
||||
ComponentSerialization.TRUSTED_CONTEXT_FREE_STREAM_CODEC.decode(buf),
|
||||
new FriendlyByteBuf(Unpooled.wrappedBuffer(buf.readByteArray(32600)))
|
||||
);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
||||
Reference in new issue
Block a user