refactor: migrate to Stonecutter for multi-version management
Replace 20 separate mc-* submodules and common module with a single Stonecutter-managed source tree using preprocessor comments. This eliminates massive code duplication while preserving all version-specific behavior across 1.19.4 through 1.21.11. Co-Authored-By: Claude Opus 4.6 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
d2676ac1d2
commit
0a3b019962
@@ -0,0 +1,45 @@
|
||||
package net.blockhost.anarchymod;
|
||||
|
||||
//? if <1.20.5 {
|
||||
/*import net.minecraft.resources.ResourceLocation;
|
||||
|
||||
public class JoinPayload {
|
||||
|
||||
public static final ResourceLocation ID = new ResourceLocation("anarchymod", "join");
|
||||
}
|
||||
*///?} else {
|
||||
import net.minecraft.network.FriendlyByteBuf;
|
||||
import net.minecraft.network.codec.StreamCodec;
|
||||
import net.minecraft.network.protocol.common.custom.CustomPacketPayload;
|
||||
//? if >=1.21.11 {
|
||||
import net.minecraft.resources.Identifier;
|
||||
//? } else {
|
||||
/*import net.minecraft.resources.ResourceLocation;
|
||||
*///?}
|
||||
|
||||
public class JoinPayload implements CustomPacketPayload {
|
||||
|
||||
//? if >=1.21.11 {
|
||||
public static final Identifier ID = Identifier.fromNamespaceAndPath("anarchymod", "join");
|
||||
//? } elif >=1.21.7 {
|
||||
/*public static final ResourceLocation ID = ResourceLocation.fromNamespaceAndPath("anarchymod", "join");
|
||||
*///?} else {
|
||||
/*public static final ResourceLocation ID = ResourceLocation.tryBuild("anarchymod", "join");
|
||||
*///?}
|
||||
|
||||
public static final StreamCodec<FriendlyByteBuf, JoinPayload> CODEC =
|
||||
StreamCodec.of(
|
||||
(payload, buf) -> {
|
||||
},
|
||||
buf -> new JoinPayload()
|
||||
);
|
||||
|
||||
public static final Type<JoinPayload> TYPE =
|
||||
new Type<>(ID);
|
||||
|
||||
@Override
|
||||
public Type<? extends CustomPacketPayload> type() {
|
||||
return TYPE;
|
||||
}
|
||||
}
|
||||
//?}
|
||||
Reference in New Issue
Block a user