parent
74ed906f2d
commit
cc8f213848
11 changed files with 131 additions and 12 deletions
@ -0,0 +1,15 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<classpath> |
||||||
|
<classpathentry kind="src" path="src"/> |
||||||
|
<classpathentry kind="lib" path="E:/Spigot/BuildTools/spigot-1.18.1.jar"> |
||||||
|
<attributes> |
||||||
|
<attribute name="module" value="true"/> |
||||||
|
</attributes> |
||||||
|
</classpathentry> |
||||||
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-16"> |
||||||
|
<attributes> |
||||||
|
<attribute name="module" value="true"/> |
||||||
|
</attributes> |
||||||
|
</classpathentry> |
||||||
|
<classpathentry kind="output" path="bin"/> |
||||||
|
</classpath> |
@ -0,0 +1 @@ |
|||||||
|
/bin/ |
@ -0,0 +1,17 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<projectDescription> |
||||||
|
<name>Spigot-Motd</name> |
||||||
|
<comment></comment> |
||||||
|
<projects> |
||||||
|
</projects> |
||||||
|
<buildSpec> |
||||||
|
<buildCommand> |
||||||
|
<name>org.eclipse.jdt.core.javabuilder</name> |
||||||
|
<arguments> |
||||||
|
</arguments> |
||||||
|
</buildCommand> |
||||||
|
</buildSpec> |
||||||
|
<natures> |
||||||
|
<nature>org.eclipse.jdt.core.javanature</nature> |
||||||
|
</natures> |
||||||
|
</projectDescription> |
@ -0,0 +1,2 @@ |
|||||||
|
eclipse.preferences.version=1 |
||||||
|
encoding/config.yml=UTF-8 |
@ -0,0 +1,15 @@ |
|||||||
|
eclipse.preferences.version=1 |
||||||
|
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled |
||||||
|
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate |
||||||
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=16 |
||||||
|
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve |
||||||
|
org.eclipse.jdt.core.compiler.compliance=16 |
||||||
|
org.eclipse.jdt.core.compiler.debug.lineNumber=generate |
||||||
|
org.eclipse.jdt.core.compiler.debug.localVariable=generate |
||||||
|
org.eclipse.jdt.core.compiler.debug.sourceFile=generate |
||||||
|
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error |
||||||
|
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled |
||||||
|
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error |
||||||
|
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning |
||||||
|
org.eclipse.jdt.core.compiler.release=enabled |
||||||
|
org.eclipse.jdt.core.compiler.source=16 |
@ -1,9 +0,0 @@ |
|||||||
MIT License |
|
||||||
|
|
||||||
Copyright (c) 2022 |
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: |
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|
@ -1,3 +0,0 @@ |
|||||||
# Minecraft-Motd |
|
||||||
|
|
||||||
Ein einfaches Plugin um in Minecraft ein Motd anzuzeigen. |
|
@ -0,0 +1,21 @@ |
|||||||
|
############################################################### |
||||||
|
# # |
||||||
|
# ███╗░░░███╗░█████╗░███╗░░░███╗░█████╗░████████╗██████╗░ # |
||||||
|
# ████╗░████║██╔══██╗████╗░████║██╔══██╗╚══██╔══╝██╔══██╗ # |
||||||
|
# ██╔████╔██║██║░░╚═╝██╔████╔██║██║░░██║░░░██║░░░██║░░██║ # |
||||||
|
# ██║╚██╔╝██║██║░░██╗██║╚██╔╝██║██║░░██║░░░██║░░░██║░░██║ # |
||||||
|
# ██║░╚═╝░██║╚█████╔╝██║░╚═╝░██║╚█████╔╝░░░██║░░░██████╔╝ # |
||||||
|
# ╚═╝░░░░░╚═╝░╚════╝░╚═╝░░░░░╚═╝░╚════╝░░░░╚═╝░░░╚═════╝░ # |
||||||
|
# By: 006mi4 Version: 1.17 # |
||||||
|
############################################################### |
||||||
|
|
||||||
|
#English: Create a cool MOTD for your server. |
||||||
|
#Deutsch: Erstelle einen coolen MOTD für deinen Server. |
||||||
|
|
||||||
|
|
||||||
|
#English: You can use two lines with the MOTD Plugin. LineOne is the top line and LineTwo is the bottom line. |
||||||
|
#Deutsch: Du kannst bei dem MOTD Plugin zwei Zeilen nutzen. LineOne ist die obere Zeile und LineTwo die untere. |
||||||
|
|
||||||
|
LineOne: '&eServername.de &f- &bName Network &f- &f[&d1.17&f]' |
||||||
|
|
||||||
|
LineTwo: '&a&lMCMOTD PLUGIN &r&f- &eInfo&f: &bhttps://spigotmc.org' |
@ -0,0 +1,5 @@ |
|||||||
|
name: McMotd |
||||||
|
version: 1.0.0 |
||||||
|
api-version: 1.16 |
||||||
|
|
||||||
|
main: me.motd.Motd |
@ -0,0 +1,34 @@ |
|||||||
|
package me.motd; |
||||||
|
|
||||||
|
import org.bukkit.Bukkit; |
||||||
|
import org.bukkit.plugin.Plugin; |
||||||
|
import org.bukkit.plugin.PluginManager; |
||||||
|
import org.bukkit.plugin.java.JavaPlugin; |
||||||
|
|
||||||
|
import me.motd.utils.ServerPing; |
||||||
|
|
||||||
|
public class Motd extends JavaPlugin { |
||||||
|
|
||||||
|
public static Plugin pl; |
||||||
|
|
||||||
|
@Override |
||||||
|
public void onEnable() { |
||||||
|
pl = this; |
||||||
|
|
||||||
|
reloadConfig(); |
||||||
|
saveDefaultConfig(); |
||||||
|
|
||||||
|
PluginManager pm = Bukkit.getPluginManager(); |
||||||
|
pm.registerEvents(new ServerPing(), this); |
||||||
|
|
||||||
|
super.onEnable(); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void onDisable() { |
||||||
|
|
||||||
|
super.onDisable(); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
} |
@ -0,0 +1,21 @@ |
|||||||
|
package me.motd.utils; |
||||||
|
|
||||||
|
import org.bukkit.event.EventHandler; |
||||||
|
import org.bukkit.event.Listener; |
||||||
|
import org.bukkit.event.server.ServerListPingEvent; |
||||||
|
|
||||||
|
import me.motd.Motd; |
||||||
|
|
||||||
|
public class ServerPing implements Listener { |
||||||
|
|
||||||
|
@EventHandler |
||||||
|
public void onServerPing(ServerListPingEvent e) { |
||||||
|
|
||||||
|
String lineOne = Motd.pl.getConfig().getString("LineOne"); |
||||||
|
String lineTwo = Motd.pl.getConfig().getString("LineTwo"); |
||||||
|
|
||||||
|
e.setMotd(lineOne.replace("&", "§")+"\n"+lineTwo.replace("&", "§")); |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
} |
Loading…
Reference in new issue