Skip to content
Closed
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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,8 @@ eclipse
run/
logs/
/.apt_generated_tests/
.kilo
fix_*.ps1
error*.txt
PScommand.txt
PROGRESS.md
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ A [Tool-Assisted Speedrun](https://tasvideos.org/WelcomeToTASVideos) mod for Min
Adds tools such as input playback, slowdown and savestates for creating TASes,
which aim to beat the game as fast as possible.

> [!Warning]
This port project is AI slop!!

# Installation
This mod uses the modloader [LegacyFabric](https://legacyfabric.net/), a fork of [Fabric](https://fabricmc.net/) for versions below 1.14.4.
**Does NOT need LegacyFabric-API**
Expand Down
41 changes: 14 additions & 27 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
plugins {
// loom plugin
id "fabric-loom" version "${loom_version}"
id "ploceus" version "${loom_version}"
id "net.fabricmc.fabric-loom" version "${loom_version}"
id "com.palantir.git-version" version "4.2.0"
id "com.diffplug.spotless" version "8.1.0"
}
Expand All @@ -19,8 +17,7 @@ base {
}

java {
// compile for java 8
sourceCompatibility = targetCompatibility = 8
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_25
}

loom {
Expand All @@ -35,31 +32,23 @@ repositories {
mavenCentral()
maven { url = "https://maven.minecrafttas.com/main" }
maven { url = "https://maven.legacyfabric.net/" }
//maven { url = "https://maven.minecrafttas.com/snapshots" }
maven { url = "https://jitpack.io" }
maven { url = "https://repo.spongepowered.org/maven" }
}

// dependency configurations
configurations {
// embed dependency included in build
implementation.extendsFrom(embed)
}

ploceus {
setIntermediaryGeneration(2)
}

// dependencies
dependencies {
// tasmod dependencies
embed "com.dselent:bigarraylist:1.6"
embed "com.github.KaptainWutax:SeedUtils:b6a383113c"
implementation "com.dselent:bigarraylist:1.6"
include "com.dselent:bigarraylist:1.6"
implementation "com.github.KaptainWutax:SeedUtils:b6a383113c"
include "com.github.KaptainWutax:SeedUtils:b6a383113c"

// loom dependencies
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings ploceus.mcpMappings(project.mcp_channel, project.mcp_mcversion, project.mcp_build)
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
implementation "net.fabricmc:fabric-loader:${project.loader_version}"
implementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"
implementation "org.lwjgl:lwjgl-glfw:3.4.3"

// testing dependencies
testImplementation "org.junit.jupiter:junit-jupiter:5.14.1"
Expand All @@ -68,7 +57,7 @@ dependencies {


compileJava {
options.release = 8
options.release = 25
}

// process fabric mod json
Expand All @@ -83,13 +72,11 @@ processResources {

// configure jar file
jar {

// pack embedded stuff
from {
configurations.embed.collect { it.isDirectory() ? it : zipTree(it) }
configurations.include.collect { it.isDirectory() ? it : zipTree(it) }
} {
exclude "LICENSE.txt", "META-INF/MANIFSET.MF", "META-INF/maven/**", "META-INF/*.RSA", "META-INF/*.SF"
}
exclude "LICENSE.txt", "META-INF/MANIFEST.MF", "META-INF/maven/**", "META-INF/*.RSA", "META-INF/*.SF"
}
}

// configure testing
Expand All @@ -109,4 +96,4 @@ spotless {
eclipse().configFile("formatter/TASmodFormatter.xml")
}
enforceCheck false
}
}
14 changes: 6 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
org.gradle.jvmargs=-Xmx3G

# Fabric properties
minecraft_version=1.12.2
loader_version=0.18.4
loom_version=1.15-SNAPSHOT
mcp_channel=stable
mcp_build=39
mcp_mcversion=1.12
minecraft_version=26.3
loader_version=0.19.5
loom_version=1.17-SNAPSHOT
fabric_api_version=0.161.0+26.3

# Mod properties
mod_name=Tool-Assisted Speedrun Mod
Expand All @@ -18,6 +16,6 @@ mod_email=scribble@minecrafttas.com

# TASmod properties
group=com.minecrafttas
artifact=TASmod-1.12.2
artifact=TASmod-26.3
version=Beta2.2
release=false
release=false
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-9.3.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
18 changes: 11 additions & 7 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
// configure plugin management
pluginManagement {
// add repositories for plugins
repositories {
maven { url = "https://maven.minecrafttas.com/main" }
maven { url = "https://maven.fabricmc.net/" }
maven { url = "https://maven.ornithemc.net/releases" }
maven { url = "https://maven.ornithemc.net/snapshots" }
maven {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
}
maven {
url = 'https://maven.minecrafttas.com/main'
}
maven { url = 'https://maven.legacyfabric.net/' }
maven { url = 'https://jitpack.io' }
maven { url = 'https://repo.spongepowered.org/maven' }
mavenCentral()
gradlePluginPortal()
}
}
}
14 changes: 0 additions & 14 deletions src/main/java/com/minecrafttas/mctcommon/CommandRegistry.java

This file was deleted.

This file was deleted.

This file was deleted.

51 changes: 27 additions & 24 deletions src/main/java/com/minecrafttas/tasmod/TASmod.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import com.minecrafttas.mctcommon.CommandRegistry;
import com.minecrafttas.mctcommon.events.EventListenerRegistry;
import com.minecrafttas.mctcommon.events.EventServer.EventServerInit;
import com.minecrafttas.mctcommon.events.EventServer.EventServerStop;
import com.minecrafttas.mctcommon.networking.PacketHandlerRegistry;
import com.minecrafttas.mctcommon.networking.Server;
import com.minecrafttas.tasmod.mctcommon.events.EventListenerRegistry;
import com.minecrafttas.tasmod.mctcommon.events.EventServer.EventServerInit;
import com.minecrafttas.tasmod.mctcommon.events.EventServer.EventServerStop;
import com.minecrafttas.tasmod.mctcommon.networking.PacketHandlerRegistry;
import com.minecrafttas.tasmod.mctcommon.networking.Server;
import com.minecrafttas.tasmod.commands.CommandClearInputs;
import com.minecrafttas.tasmod.commands.CommandFileCommand;
import com.minecrafttas.tasmod.commands.CommandFullPlay;
Expand Down Expand Up @@ -39,8 +38,10 @@
import com.minecrafttas.tasmod.util.TabCompletionUtils;

import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback;
import net.fabricmc.loader.api.FabricLoader;
import net.fabricmc.loader.impl.FabricLoaderImpl;
import com.mojang.brigadier.CommandDispatcher;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.server.MinecraftServer;

/**
Expand Down Expand Up @@ -73,7 +74,7 @@ public class TASmod implements ModInitializer, EventServerInit, EventServerStop

public static final int networkingport = 8999;

public static final boolean isDevEnvironment = FabricLoaderImpl.INSTANCE.isDevelopmentEnvironment();
public static final boolean isDevEnvironment = FabricLoader.getInstance().isDevelopmentEnvironment();

public static final StartpositionMetadataExtension startPositionMetadataExtension = new StartpositionMetadataExtension();

Expand All @@ -96,12 +97,28 @@ public void onInitialize() {
version = modVersion;
}

// Register commands
CommandRegistrationCallback.EVENT.register((dispatcher, registryAccess, environment) -> {
CommandTickrate.register(dispatcher);
CommandRecord.register(dispatcher);
CommandPlay.register(dispatcher);
CommandSaveTAS.register(dispatcher);
CommandLoadTAS.register(dispatcher);
CommandClearInputs.register(dispatcher);
CommandSavestate.register(dispatcher);
CommandFullRecord.register(dispatcher);
CommandFullPlay.register(dispatcher);
CommandRestartAndPlay.register(dispatcher);
CommandPlayUntil.register(dispatcher);
CommandFileCommand.register(dispatcher);
});

// Start ticksync
ticksyncServer = new TickSyncServer();

// Initilize KillTheRNG
LOGGER.info("Testing connection with KillTheRNG");
// ktrngHandler = new KillTheRNGHandler(FabricLoaderImpl.INSTANCE.isModLoaded("killtherng"));
// ktrngHandler = new KillTheRNGHandler(FabricLoader.getInstance().isModLoaded("killtherng"));

// Initialize TickrateChanger
tickratechanger = new TickrateChangerServer(LOGGER);
Expand Down Expand Up @@ -139,21 +156,6 @@ public void onServerInit(MinecraftServer server) {
LOGGER.info("Initializing server");
serverInstance = server;

// Command handling

CommandRegistry.registerServerCommand(new CommandTickrate(), server);
CommandRegistry.registerServerCommand(new CommandRecord(), server);
CommandRegistry.registerServerCommand(new CommandPlay(), server);
CommandRegistry.registerServerCommand(new CommandSaveTAS(), server);
CommandRegistry.registerServerCommand(new CommandLoadTAS(), server);
CommandRegistry.registerServerCommand(new CommandClearInputs(), server);
CommandRegistry.registerServerCommand(new CommandSavestate(), server);
CommandRegistry.registerServerCommand(new CommandFullRecord(), server);
CommandRegistry.registerServerCommand(new CommandFullPlay(), server);
CommandRegistry.registerServerCommand(new CommandRestartAndPlay(), server);
CommandRegistry.registerServerCommand(new CommandPlayUntil(), server);
CommandRegistry.registerServerCommand(commandFileCommand, server);

savestateHandlerServer = new SavestateHandlerServer(server, LOGGER);
PacketHandlerRegistry.register(savestateHandlerServer);
PacketHandlerRegistry.register(savestateHandlerServer.getPlayerHandler());
Expand Down Expand Up @@ -202,3 +204,4 @@ public static MinecraftServer getServerInstance() {
return serverInstance;
}
}

Loading