Initial commit
Dieser Commit ist enthalten in:
Commit
ed3fcaee0f
9
.gitignore
vendored
Normale Datei
9
.gitignore
vendored
Normale Datei
@ -0,0 +1,9 @@
|
|||||||
|
# Maven
|
||||||
|
/target
|
||||||
|
|
||||||
|
# IntelliJ IDEA
|
||||||
|
/.idea
|
||||||
|
*.iml
|
||||||
|
|
||||||
|
# Other
|
||||||
|
/lib
|
77
pom.xml
Normale Datei
77
pom.xml
Normale Datei
@ -0,0 +1,77 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!--
|
||||||
|
~ This file is a part of the SteamWar software.
|
||||||
|
~
|
||||||
|
~ Copyright (C) 2021 SteamWar.de-Serverteam
|
||||||
|
~
|
||||||
|
~ This program is free software: you can redistribute it and/or modify
|
||||||
|
~ it under the terms of the GNU Affero General Public License as published by
|
||||||
|
~ the Free Software Foundation, either version 3 of the License, or
|
||||||
|
~ (at your option) any later version.
|
||||||
|
~
|
||||||
|
~ This program is distributed in the hope that it will be useful,
|
||||||
|
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
~ GNU Affero General Public License for more details.
|
||||||
|
~
|
||||||
|
~ You should have received a copy of the GNU Affero General Public License
|
||||||
|
~ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<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>de.steamwar</groupId>
|
||||||
|
<artifactId>TutorialSystem</artifactId>
|
||||||
|
<version>1.0</version>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
<url>https://maven.apache.org</url>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
<main.basedir>${project.basedir}</main.basedir>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<sourceDirectory>src</sourceDirectory>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>src</directory>
|
||||||
|
<excludes>
|
||||||
|
<exclude>**/*.java</exclude>
|
||||||
|
</excludes>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.6.1</version>
|
||||||
|
<configuration>
|
||||||
|
<source>8</source>
|
||||||
|
<target>8</target>
|
||||||
|
<compilerArgs>-Xlint</compilerArgs>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>steamwar</groupId>
|
||||||
|
<artifactId>Spigot</artifactId>
|
||||||
|
<version>1.15</version>
|
||||||
|
<scope>system</scope>
|
||||||
|
<systemPath>${main.basedir}/lib/Spigot-1.15.jar</systemPath>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>steamwar</groupId>
|
||||||
|
<artifactId>SpigotCore</artifactId>
|
||||||
|
<version>1.0</version>
|
||||||
|
<scope>system</scope>
|
||||||
|
<systemPath>${main.basedir}/lib/SpigotCore.jar</systemPath>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
43
src/de/steamwar/tutorial/TutorialSystem.java
Normale Datei
43
src/de/steamwar/tutorial/TutorialSystem.java
Normale Datei
@ -0,0 +1,43 @@
|
|||||||
|
/*
|
||||||
|
* This file is a part of the SteamWar software.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2021 SteamWar.de-Serverteam
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package de.steamwar.tutorial;
|
||||||
|
|
||||||
|
import de.steamwar.tutorial.listener.RateSign;
|
||||||
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
|
public class TutorialSystem extends JavaPlugin {
|
||||||
|
|
||||||
|
private static TutorialSystem plugin;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onLoad() {
|
||||||
|
plugin = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEnable() {
|
||||||
|
new RateSign();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static TutorialSystem getPlugin() {
|
||||||
|
return plugin;
|
||||||
|
}
|
||||||
|
}
|
30
src/de/steamwar/tutorial/listener/BasicListener.java
Normale Datei
30
src/de/steamwar/tutorial/listener/BasicListener.java
Normale Datei
@ -0,0 +1,30 @@
|
|||||||
|
/*
|
||||||
|
* This file is a part of the SteamWar software.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2022 SteamWar.de-Serverteam
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package de.steamwar.tutorial.listener;
|
||||||
|
|
||||||
|
import de.steamwar.tutorial.TutorialSystem;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
|
||||||
|
public abstract class BasicListener implements Listener {
|
||||||
|
public BasicListener() {
|
||||||
|
Bukkit.getPluginManager().registerEvents(this, TutorialSystem.getPlugin());
|
||||||
|
}
|
||||||
|
}
|
48
src/de/steamwar/tutorial/listener/RateSign.java
Normale Datei
48
src/de/steamwar/tutorial/listener/RateSign.java
Normale Datei
@ -0,0 +1,48 @@
|
|||||||
|
/*
|
||||||
|
* This file is a part of the SteamWar software.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2021 SteamWar.de-Serverteam
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package de.steamwar.tutorial.listener;
|
||||||
|
|
||||||
|
import de.steamwar.comms.packets.ExecuteCommandPacket;
|
||||||
|
import org.bukkit.block.BlockState;
|
||||||
|
import org.bukkit.block.Sign;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.block.Action;
|
||||||
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
|
|
||||||
|
public class RateSign extends BasicListener {
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onInteract(PlayerInteractEvent event) {
|
||||||
|
if(!event.hasBlock() || event.getAction() != Action.RIGHT_CLICK_BLOCK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
BlockState state = event.getClickedBlock().getState();
|
||||||
|
if (!(state instanceof Sign))
|
||||||
|
return;
|
||||||
|
|
||||||
|
Sign sign = (Sign) state;
|
||||||
|
if(!"[rate]".equals(sign.getLine(0)))
|
||||||
|
return;
|
||||||
|
|
||||||
|
Player player = event.getPlayer();
|
||||||
|
new ExecuteCommandPacket(player, "tutorial rate " + System.getProperty("tutorial")).send(player);
|
||||||
|
}
|
||||||
|
}
|
7
src/plugin.yml
Normale Datei
7
src/plugin.yml
Normale Datei
@ -0,0 +1,7 @@
|
|||||||
|
name: TutorialSystem
|
||||||
|
version: "1.0"
|
||||||
|
authors:
|
||||||
|
- Lixfel
|
||||||
|
main: de.steamwar.tutorial.TutorialSystem
|
||||||
|
depend: [SpigotCore]
|
||||||
|
api-version: "1.13"
|
6
steamwarci.yml
Normale Datei
6
steamwarci.yml
Normale Datei
@ -0,0 +1,6 @@
|
|||||||
|
build:
|
||||||
|
- "ln -s /home/gitea/lib"
|
||||||
|
- "mvn package -B"
|
||||||
|
|
||||||
|
artifacts:
|
||||||
|
"/binarys/tutorialsystem.jar": "target/TutorialSystem-1.0.jar"
|
In neuem Issue referenzieren
Einen Benutzer sperren