Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #117

Merged
merged 9 commits into from
Aug 30, 2024
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2101.1.2]

### Fixed
* Fixed `/ftblibrary clientconfig` command not being usable without op perms

## [2101.1.1]

### Fixed
* Fixed a couple of minor GUI drawing artifacts in some screens

## [2101.1.0]

### Changed
* Updated to MC 1.21.1

### Added
* Sidebar buttons (from FTB Library and all mods which add buttons) are now all repositionable and toggleable
* New sidebar button to open client config for FTB Library (can be used to hide sidebar entirely)
* Client config can also be opened via `/ftblibrary clientconfig` command
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package dev.ftb.mods.ftblibrary;

import com.mojang.brigadier.Command;
import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.context.CommandContext;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
Expand Down Expand Up @@ -39,29 +40,32 @@ public class FTBLibraryCommands {

public static void registerCommands(CommandDispatcher<CommandSourceStack> dispatcher, CommandBuildContext commandBuildContext, Commands.CommandSelection type) {
var command = Commands.literal("ftblibrary")
.requires(commandSource -> commandSource.hasPermission(2))
.then(Commands.literal("gamemode")
.requires(commandSource -> commandSource.hasPermission(Commands.LEVEL_GAMEMASTERS))
.executes(context -> {
if (!context.getSource().getPlayerOrException().isCreative()) {
context.getSource().getPlayerOrException().setGameMode(GameType.CREATIVE);
} else {
context.getSource().getPlayerOrException().setGameMode(GameType.SURVIVAL);
}

return 1;
return Command.SINGLE_SUCCESS;
})
)
.then(Commands.literal("rain")
.requires(commandSource -> commandSource.hasPermission(Commands.LEVEL_GAMEMASTERS))
.executes(context -> {
if (context.getSource().getLevel().isRaining()) {
context.getSource().getLevel().setWeatherParameters(6000, 0, false, false); // clear
//Use overworld as that controls the weather for the whole server
if (context.getSource().getServer().overworld().isRaining()) {
context.getSource().getServer().overworld().setWeatherParameters(6000, 0, false, false); // clear
} else {
context.getSource().getLevel().setWeatherParameters(0, 6000, true, false);// rain
context.getSource().getServer().overworld().setWeatherParameters(0, 6000, true, false);// rain
}
return 1;
return Command.SINGLE_SUCCESS;
})
)
.then(Commands.literal("day")
.requires(commandSource -> commandSource.hasPermission(Commands.LEVEL_GAMEMASTERS))
.executes(context -> {
var addDay = (24000L - (context.getSource().getLevel().getDayTime() % 24000L) + 6000L) % 24000L;

Expand All @@ -71,10 +75,11 @@ public static void registerCommands(CommandDispatcher<CommandSourceStack> dispat
}
}

return 1;
return Command.SINGLE_SUCCESS;
})
)
.then(Commands.literal("night")
.requires(commandSource -> commandSource.hasPermission(Commands.LEVEL_GAMEMASTERS))
.executes(context -> {
var addDay = (24000L - (context.getSource().getLevel().getDayTime() % 24000L) + 18000L) % 24000L;

Expand All @@ -84,10 +89,11 @@ public static void registerCommands(CommandDispatcher<CommandSourceStack> dispat
}
}

return 1;
return Command.SINGLE_SUCCESS;
})
)
.then(Commands.literal("nbtedit")
.requires(commandSource -> commandSource.hasPermission(Commands.LEVEL_GAMEMASTERS))
.then(Commands.literal("block")
.then(Commands.argument("pos", BlockPosArgument.blockPos())
.executes(context -> editNBT(context, (info, tag) -> editBlockNBT(context, info, tag)))
Expand All @@ -111,7 +117,7 @@ public static void registerCommands(CommandDispatcher<CommandSourceStack> dispat
.requires(CommandSourceStack::isPlayer)
.executes(context -> {
NetworkManager.sendToPlayer(context.getSource().getPlayerOrException(), new EditConfigPacket(true));
return 1;
return Command.SINGLE_SUCCESS;
})
);

Expand All @@ -123,7 +129,7 @@ public static void registerCommands(CommandDispatcher<CommandSourceStack> dispat
} else {
UITesting.openTestScreen();
}
return 1;
return Command.SINGLE_SUCCESS;
})
);
}
Expand All @@ -140,7 +146,7 @@ private static int editNBT(CommandContext<CommandSourceStack> context, NBTEditCa
if (!info.isEmpty()) {
EDITING_NBT.put(player.getUUID(), info);
NetworkManager.sendToPlayer(player, new EditNBTPacket(info, tag));
return 1;
return Command.SINGLE_SUCCESS;
}

return 0;
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ org.gradle.daemon=false
# Mod
mod_id=ftblibrary
readable_name=FTB Library
mod_version=2101.1.1
mod_version=2101.1.2
mod_author=FTB Team
# Maven
archives_base_name=ftb-library
Expand All @@ -16,7 +16,7 @@ neoforge_version=21.1.13
neoforge_version_range=[21.1.0,)
neoforge_loader_version=4
fabric_loader_version=0.15.11
fabric_api_version=0.101.2+1.21
fabric_api_version=0.102.1+1.21.1
fabric_api_version_range=>=0.100.1+1.21
architectury_version=13.0.6
# There are too many of these now
Expand Down
Loading