Skip to content

Commit afe9068

Browse files
committed
Update
1 parent fba2587 commit afe9068

File tree

9 files changed

+50
-72
lines changed

9 files changed

+50
-72
lines changed

CONFIG.md

+38-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,43 @@
11
# Config
22
All config file are stored in the JSON format, and a default config file will be automatically generated if missing.
3-
## Main Config
4-
The config file are located in `Your Fabric Instance/config/svrutil/config.json`.
5-
6-
| Key | Description | Default Value |
7-
|--------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------|
8-
| fallingBlockDelay | This sets the tick of when falling block like Sand and Gravel should start falling after placing.<br>-1 to disable falling block entirely. | 2 (Vanilla) |
9-
| fixedItemFrame | Whether all item frames in the world should be fixed. (Does not get detached or affected by explosions) | false |
10-
| minItemFrameInteractOpLevel | The minimum OP Level required to interact with item frames (Rotate/Place/Break) in the world. | 0 (All) |
11-
| silentKickMessage | The message sent to the player being kicked with the /silentkick command. (Minecraft RAW Text Format) | "Internal Exception: java.lang.StackOverflowError" |
12-
| whitelistedMessage | The message sent to the player being kicked due to being whitelisted. (Minecraft RAW Text Format) | null (Use vanilla default) |
13-
| joinMessages | An array of JSON Object representing a welcome message, see below. | [...] |
3+
## Feature Config
4+
The config file are located in `Your Fabric Instance/config/svrutil/feature.json`.
5+
6+
### join_message
7+
This section describes a list of join message to show when player joined the server.
8+
9+
#### Welcome Message Entry
10+
11+
| Key | Description | Default Value |
12+
|--------------|------------------------------------------------------------------------------------------|----------------------------------------------------|
13+
| title | A Color-Text entry for the main title to appear at the center of the screen | 2 (Vanilla) |
14+
| subtitle | A Color-Text entry for the subtitle to appear below title at the center of the screen | false |
15+
| message | A Color-Text entry for the chat message to be sent. | 0 (All) |
16+
| delayTick | How much Minecraft tick to delay before sending this welcome message to the player. | "Internal Exception: java.lang.StackOverflowError" |
17+
| permLevels | The OP level that this welcome message is sent to. | [1, 2, 3, 4] |
18+
19+
#### Color-Text Entry
20+
| Key | Description |
21+
|-----------------------------|-------------------------------------------------------------------------------------------------------|
22+
| color | Human readable color name (i.e. "green") |
23+
| text | The text content to show |
24+
25+
### hunger
26+
This section enforces the hunger range for all players, at a scale from 0 to 20.
27+
28+
| Key | Description |
29+
|----------|---------------------------------------------------|
30+
| minLevel | The minimum hunger level the player must stay at. |
31+
| maxLevel | The maximum hunger level the player must stay at. |
32+
33+
### vanilla_mechanics
34+
This section contains configurations that overrides Vanilla Minecraft mechanics.
35+
36+
| Key | Description |
37+
|-----------------------------|------------------------------------------------------------------------------------------------------------|
38+
| fixedItemFrame | Whether all item frame in the world should be treated as fixed. (Same effect as {Fixed:1b} Entity NBT Tag) |
39+
| minItemFrameInteractOpLevel | The minimum OP Level required to be able to interact with item frame. |
40+
| fallingBlockDelay | How much tick it should take for falling block (i.e. Sand & Gravel) to start falling after placing. |
1441

1542
### Welcome Message Object
1643
| Key | Description |

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import groovy.json.JsonSlurper
22
plugins {
3-
id 'fabric-loom' version '1.7-SNAPSHOT'
3+
id 'fabric-loom' version '1.8-SNAPSHOT'
44
id 'maven-publish'
55
}
66

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ org.gradle.jvmargs=-Xmx1G
55
# check these on https://fabricmc.net/use
66
minecraft_version=1.19.2
77
yarn_mappings=1.19.2+build.28
8-
loader_version=0.16.2
8+
loader_version=0.16.9
99
fabric_version=0.77.0+1.19.2
1010

1111
# Mod Properties
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip
44
networkTimeout=10000
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

src/main/java/com/lx862/svrutil/commands/msg.java

-54
This file was deleted.

src/main/java/com/lx862/svrutil/feature/FancyMessageFeature.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
public class FancyMessageFeature extends Feature {
77

88
public FancyMessageFeature() {
9-
super("Fancy Message", "fancy_message");
9+
super("Fancy Message", "fancy_msg");
1010
}
1111

1212
@Override

src/main/java/com/lx862/svrutil/feature/JoinMessageFeature.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class JoinMessageFeature extends Feature {
2020
public final List<JoinMessage> joinMessages = new ArrayList<>();
2121

2222
public JoinMessageFeature() {
23-
super("Join Message", "joinMessage");
23+
super("Join Message", "join_message");
2424
this.joinMessages.add(new JoinMessage(null, null, Text.literal("Please edit 'config/svrutil/feature.json' to change the welcome message. Thanks for installing Svrutil.").formatted(Formatting.AQUA), 60, List.of(1,2,3,4)));
2525
}
2626

src/main/java/com/lx862/svrutil/feature/TextOverrideFeature.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.lx862.svrutil.feature;
22

33
import com.google.gson.JsonElement;
4+
import com.google.gson.JsonNull;
45
import com.google.gson.JsonObject;
56
import net.minecraft.text.Text;
67

@@ -31,7 +32,11 @@ public void readConfig(JsonObject jsonObject) {
3132
@Override
3233
public JsonObject writeConfig() {
3334
JsonObject jsonObject = super.writeConfig();
34-
jsonObject.addProperty("whitelistedMessage", Text.Serializer.toJson(whitelistedMessage));
35+
if(whitelistedMessage == null) {
36+
jsonObject.add("whitelistedMessage", JsonNull.INSTANCE);
37+
} else {
38+
jsonObject.addProperty("whitelistedMessage", Text.Serializer.toJson(whitelistedMessage));
39+
}
3540
return jsonObject;
3641
}
3742

src/main/java/com/lx862/svrutil/mixin/ItemFrameMixin.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public void damage(DamageSource source, float amount, CallbackInfoReturnable<Boo
4040

4141
@Inject(method = "interact", at = @At("HEAD"), cancellable = true)
4242
public void interact(PlayerEntity player, Hand hand, CallbackInfoReturnable<ActionResult> cir) {
43-
if(FeatureSet.VANILLA_MECHANICS.feature.enabled && !player.getWorld().isClient()) {
43+
if(!player.getWorld().isClient() && FeatureSet.VANILLA_MECHANICS.feature.enabled) {
4444
if(player.hasPermissionLevel(((VanillaMechanicsFeature) FeatureSet.VANILLA_MECHANICS.feature).getMinItemFrameInteractOpLevel())) {
4545
cir.setReturnValue(ActionResult.PASS);
4646
}

0 commit comments

Comments
 (0)