Skip to content

Commit

Permalink
Update to 1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
MattiDragon committed Jun 29, 2024
1 parent 2acafb5 commit 9e64a6e
Show file tree
Hide file tree
Showing 23 changed files with 46 additions and 26 deletions.
9 changes: 4 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '1.6-SNAPSHOT'
id 'fabric-loom' version '1.7-SNAPSHOT'
id 'maven-publish'
}

Expand All @@ -14,8 +14,7 @@ repositories {
maven {
url "https://kneelawk.com/maven/"
content {
includeGroup "com.kneelawk.graphlib"
includeGroup "com.kneelawk"
includeGroupByRegex "com\\.kneelawk.*"
}
}
maven {
Expand Down Expand Up @@ -81,8 +80,8 @@ dependencies {

// Core apis
modImplementation include("com.github.mattidragon:nodeflow:$nodeflow_version")
include modImplementation("com.kneelawk.graphlib:core-fabric:$graphlib_version")
modLocalRuntime("com.kneelawk.graphlib:debugrender-fabric:$graphlib_version")
include modImplementation("com.kneelawk.graphlib:graphlib-core-fabric:$graphlib_version")
modLocalRuntime("com.kneelawk.graphlib:graphlib-debugrender-fabric:$graphlib_version")
include modApi("teamreborn:energy:$energy_version") {
exclude(group: "net.fabricmc.fabric-api")
}
Expand Down
1 change: 1 addition & 0 deletions changelog/4.0.0+1.21.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Updated to 1.21
4 changes: 0 additions & 4 deletions changelog/4.0.0-beta.1+1.20.6.md

This file was deleted.

18 changes: 9 additions & 9 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
org.gradle.jvmargs=-Xmx1G

minecraft_version=1.20.6
yarn_mappings=1.20.6+build.1
minecraft_version=1.21
yarn_mappings=1.21+build.4
loader_version=0.15.11

mod_version=4.0.0-beta.1
mod_version=4.0.0
maven_group=io.github.mattidragon
archives_base_name=advanced-networking

fabric_version=0.98.0+1.20.6
nodeflow_version=2.0.0-mc.1.20.6
graphlib_version=2.0.0-alpha.17+1.20.6
energy_version=4.0.1
yacl_version=3.4.2+1.20.5
modmenu_version=10.0.0-beta.1
fabric_version=0.100.4+1.21
nodeflow_version=6e969b499d25645b2921303881b5e64328dbb20c
graphlib_version=2.0.0+1.21
energy_version=4.1.0
yacl_version=3.5.0+1.21
modmenu_version=11.0.1
configtoolkit_version=1.1.1
noindium_version=1.1.0+1.20
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class AdvancedNetworking implements ModInitializer {
.build();

public static Identifier id(String path) {
return new Identifier(MOD_ID, path);
return Identifier.of(MOD_ID, path);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ private boolean checkId(Identifier id) {
if (shouldUseRegex()) {
return Pattern.matches(idFilter, id.toString());
} else {
return new Identifier(idFilter).equals(id);
return id.equals(Identifier.tryParse(idFilter));
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package io.github.mattidragon.advancednetworking.mixin;

import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import net.minecraft.data.DataOutput;
import net.minecraft.registry.Registry;
import net.minecraft.registry.RegistryKey;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

// Temporary hack to generate tags correctly. See: https://github.com/FabricMC/fabric/issues/3894
@Mixin(DataOutput.class)
public class DataOutputMixin {
@ModifyExpressionValue(method = "getTagResolver", at = @At(value = "INVOKE", target = "Lnet/minecraft/registry/RegistryKeys;getTagPath(Lnet/minecraft/registry/RegistryKey;)Ljava/lang/String;"))
private String fixTagPath(String original, RegistryKey<? extends Registry<?>> registryRef) {
var id = registryRef.getValue();
if (id.getNamespace().equals("minecraft")) {
return original;
}
return "tags/" + id.getNamespace() + "/" + id.getPath();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
import net.minecraft.block.AbstractBlock;
import net.minecraft.block.MapColor;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.block.enums.Instrument;
import net.minecraft.block.enums.NoteBlockInstrument;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;

public final class ModBlocks {
public static final ControllerBlock CONTROLLER = new ControllerBlock(AbstractBlock.Settings.create().mapColor(MapColor.IRON_GRAY).instrument(Instrument.BASEDRUM).requiresTool().strength(3.5F));
public static final CableBlock CABLE = new CableBlock(AbstractBlock.Settings.create().mapColor(MapColor.DEEPSLATE_GRAY).instrument(Instrument.BASEDRUM).requiresTool().strength(3.5F));
public static final ControllerBlock CONTROLLER = new ControllerBlock(AbstractBlock.Settings.create().mapColor(MapColor.IRON_GRAY).instrument(NoteBlockInstrument.BASEDRUM).requiresTool().strength(3.5F));
public static final CableBlock CABLE = new CableBlock(AbstractBlock.Settings.create().mapColor(MapColor.DEEPSLATE_GRAY).instrument(NoteBlockInstrument.BASEDRUM).requiresTool().strength(3.5F));
public static final BlockEntityType<ControllerBlockEntity> CONTROLLER_BLOCK_ENTITY = BlockEntityType.Builder.create(ControllerBlockEntity::new, ModBlocks.CONTROLLER).build(null);
public static final BlockEntityType<CableBlockEntity> CABLE_BLOCK_ENTITY = BlockEntityType.Builder.create(CableBlockEntity::new, ModBlocks.CABLE).build(null);

Expand Down
1 change: 1 addition & 0 deletions src/main/resources/advanced_networking.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"package": "io.github.mattidragon.advancednetworking.mixin",
"compatibilityLevel": "JAVA_17",
"mixins": [
"DataOutputMixin",
"PlayerEntityMixin",
"RedstoneWireBlockMixin"
],
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/assets/advanced_networking/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"screen.advanced_networking.cable_config.interface_type.interface": "Interface",
"screen.advanced_networking.cable_config.interface_type.blocked": "Blocked",
"screen.advanced_networking.adventure_mode_access": "Adventure mode access",

"tag.item.advanced_networking.wrenches": "Wrenches",

"side.advanced_networking.north": "North",
"side.advanced_networking.south": "South",
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
"accessWidener": "advanced_networking.accesswidener",
"depends": {
"fabricloader": ">=0.15.11",
"fabric-api": ">=0.98.0",
"minecraft": "1.20.6",
"fabric-api": ">=0.100.4",
"minecraft": "1.21",
"nodeflow": "*",
"graphlib": "*"
}
Expand Down

0 comments on commit 9e64a6e

Please sign in to comment.