-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 64ae67c
Showing
9 changed files
with
963 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4"> | ||
<component name="FacetManager"> | ||
<facet type="minecraft" name="Minecraft"> | ||
<configuration> | ||
<autoDetectTypes> | ||
<platformType>PAPER</platformType> | ||
<platformType>ADVENTURE</platformType> | ||
</autoDetectTypes> | ||
</configuration> | ||
</facet> | ||
</component> | ||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8"> | ||
<output url="file://$MODULE_DIR$/target/classes" /> | ||
<output-test url="file://$MODULE_DIR$/target/test-classes" /> | ||
<content url="file://$MODULE_DIR$"> | ||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" /> | ||
<excludeFolder url="file://$MODULE_DIR$/target" /> | ||
</content> | ||
<orderEntry type="inheritedJdk" /> | ||
<orderEntry type="sourceFolder" forTests="false" /> | ||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.destroystokyo.paper:paper-api:1.16.5-R0.1-SNAPSHOT" level="project" /> | ||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.kyori:adventure-api:4.7.0" level="project" /> | ||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.kyori:adventure-key:4.7.0" level="project" /> | ||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.kyori:examination-api:1.1.0" level="project" /> | ||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.kyori:examination-string:1.1.0" level="project" /> | ||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.checkerframework:checker-qual:3.11.0" level="project" /> | ||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.jetbrains:annotations:20.1.0" level="project" /> | ||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.kyori:adventure-text-serializer-gson:4.7.0" level="project" /> | ||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.kyori:adventure-text-serializer-legacy:4.7.0" level="project" /> | ||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.kyori:adventure-text-serializer-plain:4.7.0" level="project" /> | ||
<orderEntry type="library" scope="PROVIDED" name="Maven: commons-lang:commons-lang:2.6" level="project" /> | ||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.findbugs:jsr305:1.3.9" level="project" /> | ||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.googlecode.json-simple:json-simple:1.1.1" level="project" /> | ||
<orderEntry type="library" scope="PROVIDED" name="Maven: junit:junit:4.10" level="project" /> | ||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.hamcrest:hamcrest-core:1.1" level="project" /> | ||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.guava:guava:21.0" level="project" /> | ||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.gson:gson:2.8.0" level="project" /> | ||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.md-5:bungeecord-chat:1.16-R0.4" level="project" /> | ||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.yaml:snakeyaml:1.27" level="project" /> | ||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.slf4j:slf4j-api:1.7.25" level="project" /> | ||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.ow2.asm:asm:9.0" level="project" /> | ||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.ow2.asm:asm-commons:9.0" level="project" /> | ||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.ow2.asm:asm-tree:9.0" level="project" /> | ||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.ow2.asm:asm-analysis:9.0" level="project" /> | ||
</component> | ||
</module> |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# JuePlugin | ||
|
||
#### 介绍 | ||
撅人插件 | ||
提供者:盐鸡 | ||
|
||
#### 使用教程 | ||
1.16.5以及以上的BukkitAPI服务端均可使用 | ||
|
||
拖入plugins文件夹即可 | ||
|
||
#### 使用说明 | ||
|
||
1.本仓库使用GPL V3协议开源 | ||
|
||
2.若需要修改代码并发布视频/文章等,请在视频/文章底下放上此仓库的开源链接并且注明开发者 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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>top.mpt</groupId> | ||
<artifactId>JuePlugin</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<packaging>jar</packaging> | ||
|
||
<name>JuePlugin</name> | ||
|
||
<description>撅人插件</description> | ||
<properties> | ||
<java.version>1.8</java.version> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
<url>https://www.minept.top</url> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.8.1</version> | ||
<configuration> | ||
<source>${java.version}</source> | ||
<target>${java.version}</target> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-shade-plugin</artifactId> | ||
<version>3.2.4</version> | ||
<executions> | ||
<execution> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>shade</goal> | ||
</goals> | ||
<configuration> | ||
<createDependencyReducedPom>false</createDependencyReducedPom> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
<resources> | ||
<resource> | ||
<directory>src/main/resources</directory> | ||
<filtering>true</filtering> | ||
</resource> | ||
</resources> | ||
</build> | ||
|
||
<repositories> | ||
<repository> | ||
<id>papermc-repo</id> | ||
<url>https://repo.papermc.io/repository/maven-public/</url> | ||
</repository> | ||
<repository> | ||
<id>sonatype</id> | ||
<url>https://oss.sonatype.org/content/groups/public/</url> | ||
</repository> | ||
</repositories> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.destroystokyo.paper</groupId> | ||
<artifactId>paper-api</artifactId> | ||
<version>1.16.5-R0.1-SNAPSHOT</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package top.mpt.jueplugin; | ||
|
||
import org.bukkit.ChatColor; | ||
import org.bukkit.plugin.java.JavaPlugin; | ||
import top.mpt.jueplugin.commands.jue; | ||
import top.mpt.jueplugin.commands.setjue; | ||
|
||
import java.util.Objects; | ||
|
||
public final class JuePlugin extends JavaPlugin { | ||
|
||
public static String normal = ChatColor.BLUE + "[JuePlugin] "; | ||
@Override | ||
public void onEnable() { | ||
getConfig().options().copyDefaults(); | ||
saveDefaultConfig(); | ||
Objects.requireNonNull(getCommand("jue")).setExecutor(new jue()); | ||
Objects.requireNonNull(getCommand("setjue")).setExecutor(new setjue()); | ||
|
||
System.out.println(normal + "插件已启用"); | ||
} | ||
|
||
@Override | ||
public void onDisable() { | ||
// Plugin shutdown logic | ||
System.out.println(normal + "插件已禁用"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package top.mpt.jueplugin.commands; | ||
|
||
import org.bukkit.Bukkit; | ||
import org.bukkit.ChatColor; | ||
import org.bukkit.command.Command; | ||
import org.bukkit.command.CommandExecutor; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.plugin.Plugin; | ||
import org.jetbrains.annotations.NotNull; | ||
import top.mpt.jueplugin.JuePlugin; | ||
|
||
import java.util.List; | ||
|
||
import static top.mpt.jueplugin.JuePlugin.normal; | ||
|
||
public class jue implements CommandExecutor { | ||
@Override | ||
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) { | ||
Plugin config = JuePlugin.getPlugin(JuePlugin.class); | ||
config.reloadConfig(); | ||
if(args.length != 1){ | ||
sender.sendMessage(normal + ChatColor.RED + "格式错误!正确格式:/jue <玩家名>"); | ||
return false; | ||
} | ||
if(Bukkit.getConsoleSender() == sender){ | ||
sender.sendMessage(normal + ChatColor.RED + "控制台禁止撅人!"); | ||
return false; | ||
} | ||
Player player = Bukkit.getPlayer(args[0]); | ||
List<String> jueList = config.getConfig().getStringList("unJueablePlayerList"); | ||
if(player == null){ | ||
sender.sendMessage(normal + ChatColor.RED + "该玩家不在线,请稍后再撅(悲)."); | ||
return false; | ||
} | ||
if(jueList.contains(args[0])){ | ||
sender.sendMessage(normal + ChatColor.RED + "该玩家不想让你撅"); | ||
return false; | ||
} | ||
if(jueList.contains(sender.getName())){ | ||
sender.sendMessage(normal + ChatColor.RED + "己所不欲,勿施于人"); | ||
return false; | ||
} | ||
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), | ||
"effect give " + args[0] + " minecraft:nausea 15 0"); | ||
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), | ||
"effect give " + args[0] + " minecraft:blindness 10 0"); | ||
player.sendMessage(ChatColor.YELLOW + "你被" + sender.getName() + "撅了"); | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package top.mpt.jueplugin.commands; | ||
|
||
import org.bukkit.Bukkit; | ||
import org.bukkit.ChatColor; | ||
import org.bukkit.command.Command; | ||
import org.bukkit.command.CommandExecutor; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.plugin.Plugin; | ||
import org.jetbrains.annotations.NotNull; | ||
import top.mpt.jueplugin.JuePlugin; | ||
|
||
import java.util.List; | ||
|
||
import static top.mpt.jueplugin.JuePlugin.normal; | ||
|
||
public class setjue implements CommandExecutor { | ||
@Override | ||
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) { | ||
Plugin config = JuePlugin.getPlugin(JuePlugin.class); | ||
List<String> jueList = config.getConfig().getStringList("unJueablePlayerList"); | ||
if(Bukkit.getConsoleSender() == sender){ | ||
sender.sendMessage(normal + ChatColor.RED + "控制台设置个锤子的jue,怕有人jue你?"); | ||
return false; | ||
} | ||
|
||
if(args.length != 1){ | ||
sender.sendMessage(normal + ChatColor.RED + "格式错误!/setjue on/off 启用/禁用被jue"); | ||
} | ||
else if(args[0].equals("on")){ | ||
if(!jueList.contains(sender.getName())){ | ||
sender.sendMessage(normal + ChatColor.RED + "您已经允许被jue了,请勿重复开启"); | ||
return false; | ||
} | ||
jueList.remove(sender.getName()); | ||
config.getConfig().set("unJueablePlayerList", jueList); | ||
sender.sendMessage(normal + ChatColor.YELLOW + "已允许其他玩家撅你"); | ||
} | ||
else if(args[0].equals("off")){ | ||
if(jueList.contains(sender.getName())){ | ||
sender.sendMessage(normal + ChatColor.RED + "您已经禁止被jue了,请勿重复开启"); | ||
return false; | ||
} | ||
jueList.add(sender.getName()); | ||
config.getConfig().set("unJueablePlayerList", jueList); | ||
sender.sendMessage(normal + ChatColor.GRAY + "已禁止其他玩家撅你"); | ||
} | ||
else{ | ||
sender.sendMessage(normal + ChatColor.RED + "格式错误!/setjue on/off 启用/禁用被jue"); | ||
} | ||
config.saveConfig(); | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# 不允许被jue的玩家: | ||
unJueablePlayerList: | ||
- X_huihui |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: JuePlugin | ||
version: '${project.version}' | ||
main: top.mpt.jueplugin.JuePlugin | ||
api-version: 1.16 | ||
authors: [ XHUIHUI ] | ||
description: 撅人插件 | ||
website: https://www.minept.top | ||
commands: | ||
jue: | ||
description: 撅人指令,被撅者获得短暂失明+反胃。 用法 /jue <玩家名> | ||
setjue: | ||
description: 设置自己是否可以被撅(如果为off则你撅不了人,别人也撅不了你)。 用法:/setjue on/off |