Skip to content

Commit

Permalink
Several bug fixes
Browse files Browse the repository at this point in the history
 - Fix mod info not being bundled in Forge build.
 - Add phase ordering to Fabric version, to ensure we run after CC:R.
  • Loading branch information
SquidDev committed May 13, 2022
1 parent e560b8f commit 346ea7f
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 81 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/.gradle
/.idea

.gradle/
build/
run/
14 changes: 0 additions & 14 deletions fabric/.gradle/loom-cache/launch.cfg

This file was deleted.

62 changes: 0 additions & 62 deletions fabric/.gradle/loom-cache/log4j.xml

This file was deleted.

1 change: 0 additions & 1 deletion fabric/.gradle/loom-cache/remapClasspath.txt

This file was deleted.

10 changes: 9 additions & 1 deletion fabric/src/main/java/cc/tweaked/prometheus/FabricMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
import dan200.computercraft.fabric.mixin.LevelResourceAccess;
import dan200.computercraft.shared.util.CommentedConfigSpec;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.event.Event;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.MinecraftServer;
import net.minecraft.world.level.storage.LevelResource;

Expand Down Expand Up @@ -37,7 +39,13 @@ public class FabricMod implements ModInitializer {
public void onInitialize() {
ServerLifecycleEvents.SERVER_STARTING.register(this::onServerStarting);

ServerLifecycleEvents.SERVER_STARTED.register(server -> ServerMetrics.onServerStart(server, config));
// Need to run after CC:R has reset the tracker. Some additional ugliness due to
// https://github.com/QuiltMC/quilted-fabric-api/issues/12
var phase = new ResourceLocation(Constants.MOD_ID, "after_cc");
ServerLifecycleEvents.SERVER_STARTED.addPhaseOrdering(Event.DEFAULT_PHASE, phase);
ServerLifecycleEvents.SERVER_STARTED.addPhaseOrdering(new ResourceLocation("quilt", "default"), phase);
ServerLifecycleEvents.SERVER_STARTED.register(phase, server -> ServerMetrics.onServerStart(server, config));

ServerLifecycleEvents.SERVER_STOPPED.register(server -> ServerMetrics.onServerStop());
ServerTickEvents.END_SERVER_TICK.register(server -> ServerMetrics.onServerTick());
}
Expand Down
2 changes: 1 addition & 1 deletion forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ shadowJar {
relocate 'io.prometheus', 'cc.tweaked.prometheus.shadow.prometheus'
configurations = [project.configurations.shadow]
minimize()
exclude("META-INF/**")
exclude("META-INF/maven/**")
}

reobf {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=2.0.0
version=2.0.1
group=cc.tweaked

# Global dependencies
Expand Down

0 comments on commit 346ea7f

Please sign in to comment.