Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions projects/server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,10 @@ allprojects {
targetCompatibility = JavaVersion.VERSION_21
}

repositories {
mavenCentral()
maven {
name = "JCenter"
url = uri("https://repo.papermc.io/repository/maven-public/")
}
}

dependencies {
implementation(project(":projects:common"))

// Spigot. Duh.
compileOnly("org.spigotmc", "spigot-api", "1.21.8-R0.1-SNAPSHOT")

// PlaceholderAPI
compileOnly("me.clip", "placeholderapi", "2.11.6")

// bStats
implementation("org.bstats", "bstats-bukkit", "3.1.0")

// Mock Testing
testImplementation("org.mockbukkit.mockbukkit", "mockbukkit-v1.21", "4.72.6")

// Artifact Version Comparison
// TODO: Eventually remove this.
implementation("org.apache.maven", "maven-artifact", "3.9.11")
Expand Down
22 changes: 22 additions & 0 deletions projects/server/fabric/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
plugins {
id("fabric-loom") version "1.7-SNAPSHOT"
id("maven-publish")
}

dependencies {
minecraft("com.mojang:minecraft:1.21.1")
mappings("net.fabricmc:yarn:1.21.1+build.3:v2")
modImplementation("net.fabricmc:fabric-loader:0.16.5")

modImplementation("net.fabricmc.fabric-api:fabric-api:0.102.1+1.21.1")

implementation(project(":projects:server:shared"))
}

tasks.processResources {
inputs.property("version", project.version)

filesMatching("fabric.mod.json") {
expand("version" to project.version)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.beanbeanjuice.simpleproxychathelper.fabric;

import com.beanbeanjuice.simpleproxychathelper.shared.config.Config;
import net.fabricmc.api.ModInitializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class SimpleProxyChatHelperFabric implements ModInitializer {

public static final String MOD_ID = "simpleproxychathelper";
public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);

private Config options;

@Override
public void onInitialize() {
LOGGER.info("SimpleProxyChatHelper Fabric initializing...");
options = new Config();

// Initial setup for Fabric mod.
// Full plugin messaging and silent join/quit implementation will follow.
}
}
13 changes: 13 additions & 0 deletions projects/server/forge/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
plugins {
id("net.minecraftforge.gradle") version "6.0.+"
id("org.spongepowered.mixin") version "0.7.+"
}

minecraft {
mappings(channel: "official", version: "1.21.1")
}

dependencies {
minecraft("net.minecraftforge:forge:1.21.1-52.0.0")
implementation(project(":projects:server:shared"))
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ public Config() {

private void setup() {
this.options.put(ConfigKey.PLACEHOLDER_API_SUPPORT, false);
this.options.put(ConfigKey.SILENT_JOIN, true);
this.options.put(ConfigKey.SILENT_QUIT, true);
}

public boolean getOption(ConfigKey key) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.beanbeanjuice.simpleproxychathelper.shared.config;

public enum ConfigKey {
PLACEHOLDER_API_SUPPORT
PLACEHOLDER_API_SUPPORT,
SILENT_JOIN,
SILENT_QUIT
}
12 changes: 12 additions & 0 deletions projects/server/spigot/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
dependencies {
implementation(project(":projects:server:shared"))

// Spigot. Duh.
compileOnly("org.spigotmc", "spigot-api", "1.21.8-R0.1-SNAPSHOT")

// PlaceholderAPI
compileOnly(files("libs/PlaceholderAPI-2.11.6.jar"))

// bStats
implementation("org.bstats", "bstats-bukkit", "3.1.0")

// Mock Testing
testImplementation("org.mockbukkit.mockbukkit", "mockbukkit-v1.21", "4.72.6")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package com.beanbeanjuice.simpleproxychathelper;

import com.beanbeanjuice.simpleproxychathelper.shared.config.ConfigKey;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;

public class ConnectionListener implements Listener {

private final SimpleProxyChatHelper plugin;

public ConnectionListener(SimpleProxyChatHelper plugin) {
this.plugin = plugin;
}

@EventHandler
public void onPlayerJoin(PlayerJoinEvent event) {
if (plugin.getOptions().getOption(ConfigKey.SILENT_JOIN)) {
event.setJoinMessage(null);
}
}

@EventHandler
public void onPlayerQuit(PlayerQuitEvent event) {
if (plugin.getOptions().getOption(ConfigKey.SILENT_QUIT)) {
event.setQuitMessage(null);
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,22 @@ public class SimpleProxyChatHelper extends JavaPlugin {

@Override
public void onEnable() {
this.saveDefaultConfig();
options = new Config();

// Load values from config.yml
options.setOption(ConfigKey.SILENT_JOIN, this.getConfig().getBoolean("silentJoin", true));
options.setOption(ConfigKey.SILENT_QUIT, this.getConfig().getBoolean("silentQuit", true));

this.getLogger().info("Casting hooks...");
setupPlaceholderAPI();

this.getLogger().info("Setting up plugin-messaging...");
setupPluginMessaging();

this.getLogger().info("Registering events...");
this.getServer().getPluginManager().registerEvents(new ConnectionListener(this), this);

this.getLogger().info("The plugin has been enabled!");

metrics = new Metrics(this, 22052);
Expand Down
9 changes: 9 additions & 0 deletions projects/server/spigot/src/main/resources/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# ==========================================================
# INFORMATION
# ==========================================================

# Whether to suppress the default Minecraft join message.
silentJoin: true

# Whether to suppress the default Minecraft quit message.
silentQuit: true