Verified Commit bef0e54c authored by Hunter Wignall's avatar Hunter Wignall
Browse files

Commit GordonRamsay plugin

parents
Pipeline #129 passed with stages
in 1 minute and 9 seconds
.idea/
target/
*.iml
\ No newline at end of file
variables:
MAVEN_SETTINGS: "maven_settings.xml"
MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true -s $MAVEN_SETTINGS"
GIT_SUBMODULE_STRATEGY: recursive
image: maven:latest
cache:
paths:
- .m2/repository
stages: ['verify', 'deploy']
verify:
stage: verify
script:
- 'mvn $MAVEN_CLI_OPTS verify'
deploy:
stage: deploy
script:
- 'mvn $MAVEN_CLI_OPTS clean deploy'
only:
- master
\ No newline at end of file
<settings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>mcdevs-releases</id>
<username>${env.NEXUS_USERNAME}</username>
<password>${env.NEXUS_PASSWORD}</password>
</server>
<server>
<id>mcdevs-snapshots</id>
<username>${env.NEXUS_USERNAME}</username>
<password>${env.NEXUS_PASSWORD}</password>
</server>
</servers>
</settings>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
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>us.mcdevs.spigot</groupId>
<artifactId>GordonRamsay</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<kotlin.version>1.3.72</kotlin.version>
<java.version>1.8</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<repositories>
<repository>
<id>mcdevs</id>
<url>https://nexus.mcdevs.us/repository/mcdevs/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<version>${kotlin.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-test</artifactId>
<version>${kotlin.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.16.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<version>${kotlin.version}</version>
<executions>
<execution>
<id>compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>test-compile</id>
<phase>test-compile</phase>
<goals>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
<configuration>
<jvmTarget>${java.version}</jvmTarget>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<executions>
<execution>
<id>compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>testCompile</id>
<phase>test-compile</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<distributionManagement>
<repository>
<id>mcdevs-releases</id>
<!--suppress UnresolvedMavenProperty -->
<url>${env.NEXUS_RELEASES}</url>
</repository>
<snapshotRepository>
<id>mcdevs-snapshots</id>
<!--suppress UnresolvedMavenProperty -->
<url>${env.NEXUS_SNAPSHOTS}</url>
</snapshotRepository>
</distributionManagement>
</project>
\ No newline at end of file
package us.mcdevs.spigot.gordonramsay
import org.bukkit.Bukkit
import org.bukkit.Material.*
import org.bukkit.event.EventHandler
import org.bukkit.event.Listener
import org.bukkit.event.player.PlayerItemConsumeEvent
import org.bukkit.plugin.java.JavaPlugin
/**
* Entrypoint class for the GordonRamsay plugin
*
* This plugin berates players for attempting to eat raw food, as does any good chef.
*
* @author Hunter Wignall
* @version June 29, 2020
*/
class GordonRamsay : JavaPlugin(), Listener {
private val messages = setOf(
"Are you fucking kidding me? This is fucking raw!",
"Cook it, you fucking donkey!",
"Are you an idiot sandwich? Put it in a fucking oven!"
)
override fun onEnable() = Bukkit.getPluginManager().registerEvents(this, this)
@EventHandler
private fun onRawFoodConsume(event: PlayerItemConsumeEvent) {
when (event.item.type) {
BEEF, CHICKEN, MUTTON, PORKCHOP, RABBIT, COD, SALMON -> {
event.isCancelled = true
event.player.sendMessage("Gordon Ramsay§7:§r ${messages.random()}")
}
else -> return
}
}
}
\ No newline at end of file
name: ${project.artifactId}
version: ${project.version}
main: us.mcdevs.spigot.gordonramsay.GordonRamsay
author: Hwiggy
api-version: 1.13
depend: [Kotlin]
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment