Skip to content

Commit

Permalink
Disable in-game testing
Browse files Browse the repository at this point in the history
  • Loading branch information
kernitus committed Mar 16, 2024
1 parent 8dc8986 commit e6b94b1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
18 changes: 11 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ plugins {
`java-library`
id("com.github.johnrengelman.shadow") version "8.1.1"
// For ingametesting
id("io.papermc.paperweight.userdev") version "1.5.10"
//id("io.papermc.paperweight.userdev") version "1.5.10"
idea
}

Expand Down Expand Up @@ -52,16 +52,18 @@ dependencies {
// For BSON file serialisation
implementation("org.mongodb:bson:4.11.1")
// Spigot
//compileOnly("org.spigotmc:spigot-api:1.20.4-R0.1-SNAPSHOT")
compileOnly("org.spigotmc:spigot-api:1.20.3-R0.1-SNAPSHOT")
// ProtocolLib
compileOnly("com.comphenix.protocol:ProtocolLib:5.1.0")

//For ingametesting
// Mojang mappings for NMS
/*
compileOnly("com.mojang:authlib:4.0.43")
paperweight.paperDevBundle("1.19.2-R0.1-SNAPSHOT")
// For reflection remapping
implementation("xyz.jpenilla:reflection-remapper:0.1.1")
*/
}

group = "kernitus.plugin.OldCombatMechanics"
Expand All @@ -71,14 +73,14 @@ description = "OldCombatMechanics"
java {
toolchain {
// At least 17 required for MC 1.19 for ingametesting
languageVersion.set(JavaLanguageVersion.of(17))
languageVersion.set(JavaLanguageVersion.of(8))
}
}

sourceSets {
main {
java {
//exclude("kernitus/plugin/OldCombatMechanics/tester/**")
exclude("kernitus/plugin/OldCombatMechanics/tester/**")
}
}
}
Expand All @@ -97,19 +99,21 @@ tasks.withType<JavaCompile> {

tasks.named<ShadowJar>("shadowJar") {
dependsOn("jar")
//archiveFileName.set("${project.name}.jar")
archiveFileName.set("${project.name}.jar")
dependencies {
relocate("org.bstats", "kernitus.plugin.OldCombatMechanics.lib.bstats")
}
}

// For ingametesting
/*
tasks.reobfJar {
outputJar.set(File(buildDir, "libs/${project.name}.jar"))
}
*/

tasks.assemble {
// For ingametesting
dependsOn("reobfJar")
//dependsOn("shadowJar")
//dependsOn("reobfJar")
dependsOn("shadowJar")
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@

import kernitus.plugin.OldCombatMechanics.ModuleLoader;
import kernitus.plugin.OldCombatMechanics.OCMMain;
import kernitus.plugin.OldCombatMechanics.tester.InGameTester;
import kernitus.plugin.OldCombatMechanics.utilities.Config;
import kernitus.plugin.OldCombatMechanics.utilities.Messenger;
import kernitus.plugin.OldCombatMechanics.utilities.storage.PlayerData;
import kernitus.plugin.OldCombatMechanics.utilities.storage.PlayerStorage;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
Expand All @@ -31,7 +29,7 @@ public class OCMCommandHandler implements CommandExecutor {

private final OCMMain plugin;

enum Subcommand {reload, mode, test}
enum Subcommand {reload, mode }

public OCMCommandHandler(OCMMain instance) {
this.plugin = instance;
Expand Down Expand Up @@ -136,13 +134,15 @@ private void mode(CommandSender sender, String[] args) {
ModuleLoader.getModules().forEach(module -> module.onModesetChange(playerCopy));
}

/*
private void test(OCMMain plugin, CommandSender sender) {
final Location location = sender instanceof Player ?
((Player) sender).getLocation() :
sender.getServer().getWorlds().get(0).getSpawnLocation();
new InGameTester(plugin).performTests(sender, location);
}
*/

public boolean onCommand(@NotNull CommandSender sender, @NotNull Command cmd, @NotNull String label, String[] args) {
if (args.length < 1) {
Expand All @@ -156,9 +156,11 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command cmd, @N
case reload:
reload(sender);
break;
/*
case test:
test(plugin, sender);
break;
*/
case mode:
mode(sender, args);
break;
Expand Down

0 comments on commit e6b94b1

Please sign in to comment.