Skip to content

Commit

Permalink
Use Labs' Server MOTD Substitutions (Nomi-CEu#863)
Browse files Browse the repository at this point in the history
[SKIP]
  • Loading branch information
IntegerLimit authored Aug 4, 2024
1 parent c6a6e17 commit 371c9f6
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 78 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@
},
{
"projectID": 932060,
"fileID": 5594636,
"fileID": 5595320,
"required": true
},
{
Expand Down
10 changes: 8 additions & 2 deletions overrides/config/nomilabs.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ advanced {
# NOMI
S:languageModifyOption=NOMI

# Whether to enable Substitutions for the Server Properties MOTD.
# Substitutions: {version} for the Modpack Formatted Version (from 'nomilabs-version.cfg'), {mode} for the Modpack Formatted Mode (from LabsModeHelper & the PackMode Mod).
# Note: Only the First Substitution in the String is Replaced!
# [default: false]
B:serverMotdSubstitutions=true

##########################################################################################################
# fluid registry
#--------------------------------------------------------------------------------------------------------#
Expand Down Expand Up @@ -424,8 +430,8 @@ content {
##########################################################################################################

"groovyscript settings" {
# Whether to enable GroovyScript Hand Additions.
# [default: true]
# Whether to enable Labs' GroovyScript Hand Additions.
# [default: false]
B:enableGroovyHandAdditions=false

# Mode to Use for GT Recipe Output Searching.
Expand Down
17 changes: 10 additions & 7 deletions serverfiles/server.properties
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
# FOR DEVELOPMENT, DO NOT EDIT THIS FILE! EDIT THE TEMPlATES INSTEAD!
# See https://github.com/Nomi-CEu/Nomi-CEu/wiki/Part-1:-Contributing-Information#section-5-template-information!
#Minecraft server properties
#Sun Aug 04 22:13:15 AEST 2024
generator-settings=
op-permission-level=4
allow-nether=true
level-name=world
enable-query=false
allow-flight=true
prevent-proxy-connections=false
server-port=25565
max-world-size=29999984
level-seed=
level-type=lostcities
enable-rcon=false
force-gamemode=false
level-seed=
server-ip=
network-compression-threshold=256
max-build-height=256
spawn-npcs=true
white-list=false
spawn-animals=true
hardcore=false
snooper-enabled=true
snooper-enabled=false
resource-pack-sha1=
online-mode=true
resource-pack=
Expand All @@ -26,9 +30,8 @@ enable-command-block=false
gamemode=0
player-idle-timeout=0
max-players=20
max-tick-time=60000
spawn-monsters=true
view-distance=10
generate-structures=true
motd=Nomi CEu Server, v1.7-beta-5c, Normal Mode
level-type=lostcities
generator-settings=
motd=Nomi CEu Server, {version}, {mode} Mode
1 change: 0 additions & 1 deletion tools/gulpfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export const pruneCache = pruneCacheTask;
import * as transformFiles from "./tasks/misc/transformFiles.ts";
export const updateFilesIssue = transformFiles.updateFilesIssue;
export const updateFilesLabsVersion = transformFiles.updateFilesVersion;
export const updateFilesServer = transformFiles.updateFilesServer;
export const updateFilesMainMenu = transformFiles.updateFilesMainMenu;
export const updateFilesAll = transformFiles.updateAll;

Expand Down
23 changes: 0 additions & 23 deletions tools/tasks/misc/transformFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,29 +217,11 @@ export async function updateLabsVersion(rootDir: string): Promise<void> {
return modifyFile(readPath, writePath, replacementObject);
}

export async function updateServerProperties(rootDir: string): Promise<void> {
const fileName = "server.properties";
const readPath: string = upath.join(templatesFolder, fileName);
const writePath: string = upath.join(rootDir, fileName);

const replacementObject: Record<string, unknown> = {
versionTitle: updateFiles
? updateFileTransformedVersion
: buildData.transformedVersion,
};

return modifyFile(readPath, writePath, replacementObject);
}

// Main Closures
const updateFilesLabsVersion = async () => {
await updateLabsVersion(rootDirectory);
};

const updateFilesServerProperties = async () => {
await updateServerProperties(upath.join(rootDirectory, "serverfiles"));
};

export const updateFilesIssue = gulp.series(
updateFilesSetup,
updateIssueTemplates,
Expand All @@ -248,10 +230,6 @@ export const updateFilesVersion = gulp.series(
updateFilesSetup,
updateFilesLabsVersion,
);
export const updateFilesServer = gulp.series(
updateFilesSetup,
updateFilesServerProperties,
);
export const updateFilesMainMenu = gulp.series(
updateFilesSetup,
updateMainMenuConfig,
Expand All @@ -262,7 +240,6 @@ export const updateAll = gulp.series(
gulp.parallel(
updateIssueTemplates,
updateFilesLabsVersion,
updateFilesServerProperties,
updateMainMenuConfig,
),
);
10 changes: 0 additions & 10 deletions tools/tasks/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ import {
sharedDestDirectory,
} from "#globals";
import { deleteAsync } from "del";
import {
updateFilesBuildSetup,
updateServerProperties,
} from "../misc/transformFiles.ts";
import logInfo, { logWarn } from "#utils/log.ts";

let g_forgeJar: string | undefined = undefined;
Expand Down Expand Up @@ -262,10 +258,6 @@ function processLaunchscripts() {
.pipe(dest(serverDestDirectory));
}

const updateBuildServerProperties = async () => {
await updateServerProperties(serverDestDirectory);
};

export default series(
serverCleanUp,
createServerDirs,
Expand All @@ -278,6 +270,4 @@ export default series(
copyServerChangelog,
copyServerUpdateNotes,
processLaunchscripts,
updateFilesBuildSetup,
updateBuildServerProperties,
);
1 change: 0 additions & 1 deletion tools/tasks/shared/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ async function createSharedDirs() {
* Copies modpack overrides.
*/
async function copyOverrides() {
// Don't copy server.properties files in config-overrides, it is auto transformed into the server build folder
// Copy, not Symlink, so we can transform the files as we wish
return new Promise((resolve) => {
src(buildConfig.copyToSharedDirGlobs, {
Expand Down
32 changes: 0 additions & 32 deletions tools/templates/server.properties

This file was deleted.

2 changes: 1 addition & 1 deletion tools/utils/buildConfig.default.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"launchscriptsMinRAM": "2048M",
"launchscriptsMaxRAM": "2048M",
"launchscriptsJVMArgs": "",
"copyToSharedDirGlobs": ["overrides/**/*", "!overrides/**/server.properties"],
"copyToSharedDirGlobs": ["overrides/**/*"],
"copyFromSharedServerGlobs": ["overrides/**/*", "!overrides/resources/**/*"],
"copyFromSharedClientGlobs": ["overrides/**/*"],
"buildDestinationDirectory": "../build",
Expand Down

0 comments on commit 371c9f6

Please sign in to comment.