Skip to content

Commit

Permalink
Polish up votebook
Browse files Browse the repository at this point in the history
  • Loading branch information
kyrptonaught committed Apr 1, 2024
1 parent 4f06058 commit 3ce9a02
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 101 deletions.
14 changes: 2 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ dependencies {
modImplementation("net.fabricmc.fabric-api:fabric-api:${project.fabric_version}")

//SGui
modImplementation include("eu.pb4:sgui:1.4.1+1.20.4") { exclude group: "net.fabricmc.fabric-api" }
//modImplementation include("eu.pb4:sgui:1.4.2+1.20.4") { exclude group: "net.fabricmc.fabric-api" }
modImplementation include("eu.pb4:sgui:1.4.3-lem-v1-1.20.4") { exclude group: "net.fabricmc.fabric-api" }

//Modified Fantasy
modImplementation include('xyz.nucleoid:fantasy:0.5.0-lem-v1-1.20.4') { exclude group: "net.fabricmc.fabric-api" }
Expand All @@ -38,17 +39,6 @@ dependencies {
compileOnly 'net.luckperms:api:5.4'
modImplementation "com.moandjiezana.toml:toml4j:0.7.2"

//Fabric Proxy Lite
//modImplementation('maven.modrinth:fabricproxy-lite:v2.7.0') { exclude group: "net.fabricmc.fabric-api" }

//Crossstitch
//modImplementation('maven.modrinth:crossstitch:0.1.6') { exclude group: "net.fabricmc.fabric-api" }

//Floodgate
//modImplementation('maven.modrinth:floodgate:2.2.0-SNAPSHOT-8') { exclude group: "net.fabricmc.fabric-api" }
//compileOnly('org.geysermc.floodgate:api:2.2.2-SNAPSHOT')
//modImplementation("org.geysermc.floodgate:floodgate-fabric:2.2.2-SNAPSHOT")

//carpet
modImplementation('maven.modrinth:carpet:1.4.128') { exclude group: "net.fabricmc.fabric-api" }
//modImplementation('carpet:fabric-carpet:1.20.3-1.4.128+v231205') { exclude group: "net.fabricmc.fabric-api" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.mojang.brigadier.arguments.BoolArgumentType;
import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import eu.pb4.sgui.virtual.book.BookScreenHandler;
import net.kyrptonaught.serverutils.customMapLoader.voting.HostOptions;
import net.kyrptonaught.serverutils.customMapLoader.voting.Votebook;
import net.kyrptonaught.serverutils.customMapLoader.voting.Voter;
Expand Down Expand Up @@ -51,18 +52,24 @@ public static void registerCommands(CommandDispatcher<ServerCommandSource> dispa
.then(CommandManager.argument("arg", StringArgumentType.string())
.executes(context -> {
String page = StringArgumentType.getString(context, "page");
String arg = StringArgumentType.getString(context, "arg");
String[] args = StringArgumentType.getString(context, "arg").split(",");

Votebook.getPage(context.getSource().getPlayer(), page, args).open();
if("index".equals(args[0]) && context.getSource().getPlayer().currentScreenHandler instanceof BookScreenHandler screen)
screen.getGui().setPage(Integer.parseInt(args[1]));

Votebook.getPage(context.getSource().getPlayer(), page, arg).open();
return 1;
})
.then(CommandManager.literal("after")
.fork(dispatcher.getRoot(), context -> {
context.getChild().getCommand().run(context.getChild());

String page = StringArgumentType.getString(context, "page");
String arg = StringArgumentType.getString(context, "arg");
Votebook.getPage(context.getSource().getPlayer(), page, arg).open();
String[] args = StringArgumentType.getString(context, "arg").split(",");

Votebook.getPage(context.getSource().getPlayer(), page, args).open();
if("index".equals(args[0]) && context.getSource().getPlayer().currentScreenHandler instanceof BookScreenHandler screen)
screen.getGui().setPage(Integer.parseInt(args[1]));

return List.of();
}))))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,6 @@ public static void serverTick(MinecraftServer server) {
}
}

public static void checkOptionalPackStatus(ServerPlayerEntity player, Identifier mapID) {
if (!"ask".equals(HostOptions.getGlobalAcceptValue(player)) || HostOptions.getOverwriteValue(player, mapID)) {
return;
}

loadingPlayers.add(player.getUuid());
//Votebook.generateMapOptionalPacks(player, CustomMapLoaderMod.BATTLE_MAPS.get(mapID)).open();
}

public static void battleLoad(MinecraftServer server, Identifier addon, Identifier dimID, boolean centralSpawnEnabled, Collection<ServerPlayerEntity> players, Collection<CommandFunction<ServerCommandSource>> functions) {
BattleMapAddon config = CustomMapLoaderMod.BATTLE_MAPS.get(addon);
MapSize mapSize = CustomMapLoaderMod.autoSelectMapSize(config, server.getCurrentPlayerCount());
Expand Down
Loading

0 comments on commit 3ce9a02

Please sign in to comment.