-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to 1.20.4; use new networking API on neoforge and switch aroun…
…d system on fabric
- Loading branch information
1 parent
68d5e41
commit da129a8
Showing
15 changed files
with
293 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
common/src/main/java/dev/lukebemish/excavatedvariants/impl/network/AckOresPayload.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* Copyright (C) 2024 Luke Bemish and contributors | ||
* SPDX-License-Identifier: LGPL-3.0-or-later | ||
*/ | ||
|
||
package dev.lukebemish.excavatedvariants.impl.network; | ||
|
||
import dev.lukebemish.excavatedvariants.impl.ExcavatedVariants; | ||
import net.minecraft.network.FriendlyByteBuf; | ||
import net.minecraft.resources.ResourceLocation; | ||
|
||
public record AckOresPayload() { | ||
public static final ResourceLocation ID = ExcavatedVariants.id("ack_ores"); | ||
public static AckOresPayload decode(FriendlyByteBuf buffer) { | ||
return new AckOresPayload(); | ||
} | ||
|
||
public void encode(FriendlyByteBuf buffer) {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 8 additions & 12 deletions
20
...a/dev/lukebemish/excavatedvariants/impl/fabriquilt/ExcavatedVariantsClientFabriQuilt.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,22 @@ | ||
/* | ||
* Copyright (C) 2023 Luke Bemish and contributors | ||
* Copyright (C) 2023-2024 Luke Bemish and contributors | ||
* SPDX-License-Identifier: LGPL-3.0-or-later | ||
*/ | ||
|
||
package dev.lukebemish.excavatedvariants.impl.fabriquilt; | ||
|
||
import dev.lukebemish.excavatedvariants.impl.S2CConfigAgreementPacket; | ||
import dev.lukebemish.excavatedvariants.impl.network.SyncOresPayload; | ||
import net.fabricmc.api.ClientModInitializer; | ||
import net.fabricmc.fabric.api.client.networking.v1.ClientLoginNetworking; | ||
import net.minecraft.network.FriendlyByteBuf; | ||
|
||
import java.util.concurrent.CompletableFuture; | ||
import net.fabricmc.fabric.api.client.networking.v1.ClientConfigurationNetworking; | ||
import net.minecraft.network.chat.Component; | ||
import net.minecraft.network.protocol.common.ClientboundDisconnectPacket; | ||
|
||
public class ExcavatedVariantsClientFabriQuilt implements ClientModInitializer { | ||
@Override | ||
public void onInitializeClient() { | ||
ClientLoginNetworking.registerGlobalReceiver(ExcavatedVariantsFabriQuilt.S2C_CONFIG_AGREEMENT_PACKET, ((client, handler, buf, listenerAdder) -> { | ||
S2CConfigAgreementPacket msg = S2CConfigAgreementPacket.decoder(buf); | ||
msg.consumeMessage(string -> handler.handleDisconnect(new S2CConfigAgreementPacket.ExcavatedVariantsDisconnectPacket(string))); | ||
CompletableFuture<FriendlyByteBuf> future = new CompletableFuture<>(); | ||
future.complete(null); | ||
return future; | ||
ClientConfigurationNetworking.registerGlobalReceiver(SyncOresPayload.ID, ((client, handler, buf, listenerAdder) -> { | ||
SyncOresPayload msg = SyncOresPayload.decode(buf); | ||
msg.consumeMessage(string -> handler.handleDisconnect(new ClientboundDisconnectPacket(Component.literal(string)))); | ||
})); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.