Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.21 port #18

Merged
merged 1 commit into from
Jun 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified examples/revelationary_demo_datapack.zip
Binary file not shown.
14 changes: 7 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
org.gradle.jvmargs = -Xmx2G

# Fabric Properties
minecraft_version=1.20.5
yarn_mappings=1.20.5+build.1
loader_version=0.15.10
minecraft_version=1.21
yarn_mappings=1.21+build.1
loader_version=0.15.11

# Mod Properties
mod_version = 1.3.7+1.20.5
mod_version = 1.3.7+1.21
maven_group = de.dafuqs.revelationary
archives_base_name = revelationary

# https://fabricmc.net/develop/
fabric_version=0.97.8+1.20.5
fabric_version=0.100.1+1.21

jade_version=lwgbRGaY
wthit_version=11.1.2
jade_version=pc7Loi6P
wthit_version=12.0.0
5 changes: 3 additions & 2 deletions src/main/java/de/dafuqs/revelationary/ClientAdvancements.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import net.fabricmc.api.Environment;
import net.minecraft.advancement.AdvancementEntry;
import net.minecraft.advancement.AdvancementProgress;
import net.minecraft.advancement.PlacedAdvancement;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.network.ClientAdvancementManager;
import net.minecraft.client.network.ClientPlayNetworkHandler;
Expand Down Expand Up @@ -47,10 +48,10 @@ public static boolean hasDone(Identifier identifier) {
ClientPlayNetworkHandler conn = MinecraftClient.getInstance().getNetworkHandler();
if (conn != null) {
ClientAdvancementManager cm = conn.getAdvancementHandler();
AdvancementEntry adv = cm.getManager().get(identifier).getAdvancementEntry();
PlacedAdvancement adv = cm.getManager().get(identifier);
if (adv != null) {
Map<AdvancementEntry, AdvancementProgress> progressMap = ((AccessorClientAdvancementManager) cm).getAdvancementProgresses();
AdvancementProgress progress = progressMap.get(adv);
AdvancementProgress progress = progressMap.get(adv.getAdvancementEntry());
return progress != null && progress.isDone();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ protected void apply(Map<Identifier, JsonElement> prepared, ResourceManager mana

@Override
public Identifier getFabricId() {
return new Identifier(Revelationary.MOD_ID, "revelations");
return Identifier.of(Revelationary.MOD_ID, "revelations");
}
}
2 changes: 0 additions & 2 deletions src/main/java/de/dafuqs/revelationary/RevelationRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ public static boolean isVisibleTo(BlockState state, PlayerEntity player) {

public static Map<Identifier, List<BlockState>> getBlockStateEntries() {
// fighting invariance of java generic types
//noinspection unchecked
return (Map<Identifier, List<BlockState>>) (Map<?, ?>) advToBlockStates;
}

Expand Down Expand Up @@ -364,7 +363,6 @@ public static BlockState getCloak(BlockState blockState) {

public static Map<Identifier, List<Item>> getItemEntries() {
// fighting invariance of java generic types
//noinspection unchecked
return (Map<Identifier, List<Item>>) (Map<?,?>) advToItems;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking;
import net.fabricmc.fabric.api.networking.v1.PayloadTypeRegistry;
import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.command.argument.BlockArgumentParser;
Expand Down Expand Up @@ -57,7 +56,7 @@ public record RevelationSync(Object2ObjectOpenHashMap<Identifier, ObjectArrayLis
Object2ObjectOpenHashMap<Block, MutableText> cloakedBlockNameTranslations,
Object2ObjectOpenHashMap<Item, MutableText> cloakedItemNameTranslations) implements CustomPayload {
public static final PacketCodec<RegistryByteBuf, RevelationSync> CODEC = CustomPayload.codecOf(RevelationSync::write, RevelationSync::read);
public static final CustomPayload.Id<RevelationSync> ID = new Id<>(new Identifier(Revelationary.MOD_ID, "revelation_sync"));
public static final CustomPayload.Id<RevelationSync> ID = new Id<>(Identifier.of(Revelationary.MOD_ID, "revelation_sync"));

private static void writeText(RegistryByteBuf buf, Text text) {
TextCodecs.REGISTRY_PACKET_CODEC.encode(buf, text);
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"depends": {
"fabricloader": "*",
"fabric": "*",
"minecraft": ">=1.20.5",
"minecraft": ">=1.21",
"java": ">=21"
},
"suggests": {
Expand Down
Loading