Skip to content
This repository has been archived by the owner on Oct 20, 2024. It is now read-only.

Commit

Permalink
1.20.5
Browse files Browse the repository at this point in the history
  • Loading branch information
melontini committed May 5, 2024
1 parent 1d59e14 commit 150e7cf
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[versions]
dark-matter = "4.0.0-1.20.4-build.482"
dark-matter = "4.0.1-1.20.5-build.79"

[libraries]
fabric-loader = { group = "net.fabricmc", name = "fabric-loader", version = "0.15.10" }
fabric-api = { group = "net.fabricmc.fabric-api", name = "fabric-api", version = "0.97.0+1.20.4" }
fabric-api = { group = "net.fabricmc.fabric-api", name = "fabric-api", version = "0.97.7+1.20.5" }
evalx = { group = "com.ezylang", name = "EvalEx", version = "3.2.0" }
mapping-io = { group = "net.fabricmc", name = "mapping-io", version = "0.6.1" }
dark-matter-base = { group = "me.melontini", name = "dark-matter-base", version.ref = "dark-matter" }
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/me/melontini/commander/impl/Commander.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
public class Commander {

public static final PrependingLogger LOGGER = PrependingLogger.get();
public static final LootNumberProviderType ARITHMETICA_PROVIDER = Registry.register(Registries.LOOT_NUMBER_PROVIDER_TYPE, id("arithmetica"), new LootNumberProviderType(ArithmeticaLootNumberProvider.CODEC.codec()));
public static final LootConditionType EXPRESSION_CONDITION = Registry.register(Registries.LOOT_CONDITION_TYPE, id("expression"), new LootConditionType(ExpressionLootCondition.CODEC.codec()));
public static final LootNumberProviderType ARITHMETICA_PROVIDER = Registry.register(Registries.LOOT_NUMBER_PROVIDER_TYPE, id("arithmetica"), new LootNumberProviderType(ArithmeticaLootNumberProvider.CODEC));
public static final LootConditionType EXPRESSION_CONDITION = Registry.register(Registries.LOOT_CONDITION_TYPE, id("expression"), new LootConditionType(ExpressionLootCondition.CODEC));

private static final Path BASE_PATH = FabricLoader.getInstance().getGameDir().resolve(".commander");
public static final String MINECRAFT_VERSION = getVersion();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,14 @@
import me.melontini.dark_matter.api.data.codecs.ExtraCodecs;
import net.minecraft.util.Identifier;

import java.util.IdentityHashMap;
import java.util.Objects;

@UtilityClass
public final class CommandTypes {

private static final BiMap<Identifier, CommandType> COMMANDS = HashBiMap.create();
private static final Codec<CommandType> TYPE_CODEC = ExtraCodecs.mapLookup(Identifier.CODEC, COMMANDS);
private static final IdentityHashMap<CommandType, Codec<? extends Command>> CACHE = new IdentityHashMap<>();
public static final Codec<Command> CODEC = TYPE_CODEC.dispatch("type", Command::type, type -> CACHE.computeIfAbsent(type, t -> t.codec().codec()));
public static final Codec<Command> CODEC = TYPE_CODEC.dispatch("type", Command::type, CommandType::codec);

public static Identifier getId(CommandType type) {
return Objects.requireNonNull(COMMANDS.inverse().get(type), () -> "Unregistered CommandType %s!".formatted(type));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import me.melontini.commander.impl.Commander;

import java.io.InputStreamReader;
import java.net.URI;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
Expand All @@ -22,7 +23,7 @@ public final class MinecraftDownloader {

@SneakyThrows
static URL url(String s) {
return new URL(s);
return new URI(s).toURL();
}

@SneakyThrows
Expand Down

0 comments on commit 150e7cf

Please sign in to comment.