Skip to content

Server policies#548

Open
personalized-advertising wants to merge 18 commits into
MinecraftFreecam:mainfrom
personalized-advertising:server-config
Open

Server policies#548
personalized-advertising wants to merge 18 commits into
MinecraftFreecam:mainfrom
personalized-advertising:server-config

Conversation

@personalized-advertising

Copy link
Copy Markdown

The server can now define a set of policies for freecam mod users, i.e disabling clipping or freecam entirely, much more fine-grained than #547 as you requested.

You can implement this now and then if you later want to make a server-side mod its as simple as doing this from the server:

public static final String FREECAM_POLICY_CHANNEL = "freecam:server_config";

public static void sendFreecamPolicy(Player player, boolean allowFreecam, boolean allowClipping, boolean allowFullbright, boolean allowInteract) {
    String json = """
            {
              "allowFreecam": %s,
              "allowClipping": %s,
              "allowFullbright": %s,
              "allowInteract": %s
            }
            """.formatted(
            allowFreecam,
            allowClipping,
            allowFullbright,
            allowInteract
    );
	
    player.sendPluginMessage(FREECAM_POLICY_CHANNEL, json.getBytes(StandardCharsets.UTF_8));
}

Untested, especially the forge code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant