v1.0-SNAPSHOT
This commit is contained in:
parent
c81acd9d18
commit
9df37fa7f5
|
@ -0,0 +1,5 @@
|
||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
|
# GitHub Copilot persisted chat sessions
|
||||||
|
/copilot/chatSessions
|
|
@ -0,0 +1,13 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="CompilerConfiguration">
|
||||||
|
<annotationProcessing>
|
||||||
|
<profile name="Maven default annotation processors profile" enabled="true">
|
||||||
|
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||||
|
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||||
|
<outputRelativeToContentRoot value="true" />
|
||||||
|
<module name="CustomBlockCMD" />
|
||||||
|
</profile>
|
||||||
|
</annotationProcessing>
|
||||||
|
</component>
|
||||||
|
</project>
|
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Encoding">
|
||||||
|
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
|
||||||
|
</component>
|
||||||
|
</project>
|
|
@ -0,0 +1,30 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="RemoteRepositoriesConfiguration">
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="central" />
|
||||||
|
<option name="name" value="Central Repository" />
|
||||||
|
<option name="url" value="https://repo.maven.apache.org/maven2" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="sonatype" />
|
||||||
|
<option name="name" value="sonatype" />
|
||||||
|
<option name="url" value="https://oss.sonatype.org/content/groups/public/" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="spigotmc-repo" />
|
||||||
|
<option name="name" value="spigotmc-repo" />
|
||||||
|
<option name="url" value="https://hub.spigotmc.org/nexus/content/repositories/snapshots/" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="central" />
|
||||||
|
<option name="name" value="Maven Central repository" />
|
||||||
|
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="jboss.community" />
|
||||||
|
<option name="name" value="JBoss Community repository" />
|
||||||
|
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||||
|
</remote-repository>
|
||||||
|
</component>
|
||||||
|
</project>
|
|
@ -0,0 +1,14 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
|
<component name="MavenProjectsManager">
|
||||||
|
<option name="originalFiles">
|
||||||
|
<list>
|
||||||
|
<option value="$PROJECT_DIR$/pom.xml" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17" project-jdk-type="JavaSDK">
|
||||||
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
|
</component>
|
||||||
|
</project>
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/CustomBlockCMD.iml" filepath="$PROJECT_DIR$/CustomBlockCMD.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
|
@ -0,0 +1,13 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module version="4">
|
||||||
|
<component name="FacetManager">
|
||||||
|
<facet type="minecraft" name="Minecraft">
|
||||||
|
<configuration>
|
||||||
|
<autoDetectTypes>
|
||||||
|
<platformType>SPIGOT</platformType>
|
||||||
|
</autoDetectTypes>
|
||||||
|
<projectReimportVersion>1</projectReimportVersion>
|
||||||
|
</configuration>
|
||||||
|
</facet>
|
||||||
|
</component>
|
||||||
|
</module>
|
|
@ -0,0 +1,72 @@
|
||||||
|
<?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>me.nvus</groupId>
|
||||||
|
<artifactId>CustomBlockCMD</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<name>CustomBlockCMD</name>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<java.version>1.8</java.version>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
<url>www.FNGnation.net</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>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/resources</directory>
|
||||||
|
<filtering>true</filtering>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>spigotmc-repo</id>
|
||||||
|
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
||||||
|
</repository>
|
||||||
|
<repository>
|
||||||
|
<id>sonatype</id>
|
||||||
|
<url>https://oss.sonatype.org/content/groups/public/</url>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.spigotmc</groupId>
|
||||||
|
<artifactId>spigot-api</artifactId>
|
||||||
|
<version>1.20.4-R0.1-SNAPSHOT</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
|
@ -0,0 +1,51 @@
|
||||||
|
package me.nvus.customblockcmd;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
|
|
||||||
|
public class CustomBlockCMD extends JavaPlugin implements Listener {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEnable() {
|
||||||
|
// Register events
|
||||||
|
getServer().getPluginManager().registerEvents(this, this);
|
||||||
|
|
||||||
|
// Load configuration
|
||||||
|
saveDefaultConfig();
|
||||||
|
FileConfiguration config = getConfig();
|
||||||
|
config.options().copyDefaults(true);
|
||||||
|
saveConfig();
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onPlayerInteract(PlayerInteractEvent event) {
|
||||||
|
Player player = event.getPlayer();
|
||||||
|
if (event.getAction().toString().contains("RIGHT")) {
|
||||||
|
Material clickedMaterial = event.getClickedBlock().getType();
|
||||||
|
FileConfiguration config = getConfig();
|
||||||
|
|
||||||
|
ConfigurationSection blockSection = config.getConfigurationSection(clickedMaterial.toString());
|
||||||
|
if (blockSection != null) {
|
||||||
|
String cmdType = blockSection.getString("cmd-type");
|
||||||
|
String command = blockSection.getString("command");
|
||||||
|
String message = blockSection.getString("message", "");
|
||||||
|
|
||||||
|
if (cmdType.equalsIgnoreCase("player")) {
|
||||||
|
player.performCommand(command);
|
||||||
|
if (!message.isEmpty()) {
|
||||||
|
player.sendMessage(message);
|
||||||
|
}
|
||||||
|
} else if (cmdType.equalsIgnoreCase("server")) {
|
||||||
|
getServer().dispatchCommand(getServer().getConsoleSender(), command);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
#======================================================================================#
|
||||||
|
# NVus PRISON SETUP #
|
||||||
|
# by never2nv #
|
||||||
|
# www.FNGnation.net #
|
||||||
|
# Discord: FNGnation.net/discord #
|
||||||
|
#======================================================================================#
|
||||||
|
|
||||||
|
GOLD_BLOCK:
|
||||||
|
cmd-type: player
|
||||||
|
command: warp shop
|
||||||
|
message: "Teleporting to the shop..."
|
||||||
|
|
||||||
|
DIAMOND_BLOCK:
|
||||||
|
cmd-type: server
|
||||||
|
command: give @p diamond
|
||||||
|
|
||||||
|
IRON_BLOCK:
|
||||||
|
cmd-type: player
|
||||||
|
command: spawn
|
||||||
|
message: "Teleporting to spawn..."
|
||||||
|
|
||||||
|
EMERALD_BLOCK:
|
||||||
|
cmd-type: server
|
||||||
|
command: give @p emerald
|
|
@ -0,0 +1,8 @@
|
||||||
|
name: CustomBlockCMD
|
||||||
|
version: '${project.version}'
|
||||||
|
main: me.nvus.customblockcmd.CustomBlockCMD
|
||||||
|
api-version: '1.20'
|
||||||
|
prefix: Custom Block CMD
|
||||||
|
load: STARTUP
|
||||||
|
authors: [never2nv]
|
||||||
|
website: www.FNGnation.net
|
Binary file not shown.
|
@ -0,0 +1,24 @@
|
||||||
|
#======================================================================================#
|
||||||
|
# NVus PRISON SETUP #
|
||||||
|
# by never2nv #
|
||||||
|
# www.FNGnation.net #
|
||||||
|
# Discord: FNGnation.net/discord #
|
||||||
|
#======================================================================================#
|
||||||
|
|
||||||
|
GOLD_BLOCK:
|
||||||
|
cmd-type: player
|
||||||
|
command: warp shop
|
||||||
|
message: "Teleporting to the shop..."
|
||||||
|
|
||||||
|
DIAMOND_BLOCK:
|
||||||
|
cmd-type: server
|
||||||
|
command: give @p diamond
|
||||||
|
|
||||||
|
IRON_BLOCK:
|
||||||
|
cmd-type: player
|
||||||
|
command: spawn
|
||||||
|
message: "Teleporting to spawn..."
|
||||||
|
|
||||||
|
EMERALD_BLOCK:
|
||||||
|
cmd-type: server
|
||||||
|
command: give @p emerald
|
Binary file not shown.
|
@ -0,0 +1,8 @@
|
||||||
|
name: CustomBlockCMD
|
||||||
|
version: '1.0-SNAPSHOT'
|
||||||
|
main: me.nvus.customblockcmd.CustomBlockCMD
|
||||||
|
api-version: '1.20'
|
||||||
|
prefix: Custom Block CMD
|
||||||
|
load: STARTUP
|
||||||
|
authors: [never2nv]
|
||||||
|
website: www.FNGnation.net
|
|
@ -0,0 +1,3 @@
|
||||||
|
artifactId=CustomBlockCMD
|
||||||
|
groupId=me.nvus
|
||||||
|
version=1.0-SNAPSHOT
|
|
@ -0,0 +1 @@
|
||||||
|
me\nvus\customblockcmd\CustomBlockCMD.class
|
|
@ -0,0 +1 @@
|
||||||
|
C:\Users\paulm\Gitea\CustomBlockCMD\src\main\java\me\nvus\customblockcmd\CustomBlockCMD.java
|
Binary file not shown.
Loading…
Reference in New Issue