Skip to content

Commit

Permalink
Inject MendedMinecarts Settings packet at construction
Browse files Browse the repository at this point in the history
  • Loading branch information
2No2Name committed Apr 19, 2024
1 parent 885d97d commit 1af478e
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import mendedminecarts.settings.SettingSync;
import net.minecraft.network.PacketByteBuf;
import net.minecraft.network.packet.CustomPayload;
import net.minecraft.network.packet.s2c.common.CustomPayloadS2CPacket;
import net.minecraft.util.Identifier;
import org.spongepowered.asm.mixin.Mixin;
Expand All @@ -19,11 +18,13 @@ public class CustomPayloadS2CPacketMixin {
at = @At(
value = "INVOKE",
remap = false,
target = "Lcom/google/common/collect/ImmutableMap$Builder;build()Lcom/google/common/collect/ImmutableMap;"
target = "Lcom/google/common/collect/ImmutableMap;builder()Lcom/google/common/collect/ImmutableMap$Builder;",
ordinal = 0
)
)
private static ImmutableMap<Identifier, PacketByteBuf.PacketReader<? extends CustomPayload>> put_MendedMinecartsSettings(ImmutableMap.Builder<Identifier, PacketByteBuf.PacketReader<? extends CustomPayload>> instance, Operation<ImmutableMap<Identifier, PacketByteBuf.PacketReader<? extends CustomPayload>>> original) {
private static ImmutableMap.Builder<Identifier, PacketByteBuf.PacketReader<?>> put_MendedMinecartsSettings(Operation<ImmutableMap.Builder<Identifier, PacketByteBuf.PacketReader<?>>> original) {
ImmutableMap.Builder<Identifier, PacketByteBuf.PacketReader<?>> instance = original.call();
instance.put(SettingSync.CHANNEL, SettingSync.MendedMinecartsSettingPayload::new);
return original.call(instance);
return instance;
}
}

0 comments on commit 1af478e

Please sign in to comment.