Initial commit: Minecraft plugin that detects 'oye' in chat and prints it in green

This commit is contained in:
2026-02-03 01:46:21 -05:00
commit a5a8a8f158
10 changed files with 115 additions and 0 deletions

66
pom.xml Normal file
View File

@@ -0,0 +1,66 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>party.cybsec</groupId>
<artifactId>oye</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>OyePlugin</name>
<description>A Minecraft plugin that detects "oye" in chat and prints it in green</description>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.21.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<configuration>
<source>17</source>
<target>17</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.6.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
</project>

View File

@@ -0,0 +1,36 @@
package party.cybsec.oye;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.event.Listener;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.AsyncPlayerChatEvent;
import org.bukkit.ChatColor;
public class OyePlugin extends JavaPlugin implements Listener {
@Override
public void onEnable() {
// register the event listener
getServer().getPluginManager().registerEvents(this, this);
getLogger().info("Oye plugin enabled!");
}
@Override
public void onDisable() {
getLogger().info("Oye plugin disabled!");
}
@EventHandler
public void onPlayerChat(AsyncPlayerChatEvent event) {
String message = event.getMessage().toLowerCase();
// check if the message contains "oye"
if (message.contains("oye")) {
// cancel the original message
event.setCancelled(true);
// send a green "oye" message
getServer().broadcastMessage(ChatColor.GREEN + "oye");
}
}
}

View File

@@ -0,0 +1,4 @@
name: OyePlugin
version: 1.0
main: party.cybsec.oye.OyePlugin
api-version: 1.21

Binary file not shown.

View File

@@ -0,0 +1,4 @@
name: OyePlugin
version: 1.0
main: party.cybsec.oye.OyePlugin
api-version: 1.21

View File

@@ -0,0 +1,3 @@
artifactId=oye
groupId=party.cybsec
version=1.0

View File

@@ -0,0 +1 @@
party/cybsec/oye/OyePlugin.class

View File

@@ -0,0 +1 @@
/Users/jacktotonchi/Documents/oye/oye/src/main/java/com/example/oye/OyePlugin.java

BIN
target/original-oye-1.0.jar Normal file

Binary file not shown.

BIN
target/oye-1.0.jar Normal file

Binary file not shown.