mirror of
https://bitbucket.org/HeshamTB/greet.git
synced 2024-11-05 14:42:15 +01:00
Merge remote-tracking branch 'BitBucket/master'
This commit is contained in:
commit
e0c1f86938
20
.classpath
20
.classpath
@ -1,11 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
||||
<classpathentry kind="src" path="src">
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||
<attributes>
|
||||
<attribute name="ignore_optional_problems" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="lib" path="C:/Users/Hesham/Desktop/spigot-1.12.2.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
<classpathentry kind="src" output="target/classes" path="src">
|
||||
<attributes>
|
||||
<attribute name="ignore_optional_problems" value="true"/>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="output" path="target/classes"/>
|
||||
</classpath>
|
||||
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/target/
|
6
.project
6
.project
@ -10,8 +10,14 @@
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
|
@ -8,4 +8,5 @@ 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.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
||||
|
4
.settings/org.eclipse.m2e.core.prefs
Normal file
4
.settings/org.eclipse.m2e.core.prefs
Normal file
@ -0,0 +1,4 @@
|
||||
activeProfiles=
|
||||
eclipse.preferences.version=1
|
||||
resolveWorkspaceProjects=true
|
||||
version=1
|
Binary file not shown.
@ -16,3 +16,6 @@ commands:
|
||||
setspwan:
|
||||
usage: /<command>
|
||||
description: sets your current location as bed spwan.
|
||||
beds:
|
||||
usage: /<command>
|
||||
description: enable or disable bed feature.
|
42
pom.xml
Normal file
42
pom.xml
Normal file
@ -0,0 +1,42 @@
|
||||
<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>greet</groupId>
|
||||
<artifactId>greet</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<build>
|
||||
<sourceDirectory>src</sourceDirectory>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.7.0</version>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>spigot-repo</id>
|
||||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<dependencies>
|
||||
<!--Spigot API-->
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.12.2-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!--Bukkit API-->
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>bukkit</artifactId>
|
||||
<version>1.12.2-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</project>
|
@ -11,8 +11,10 @@ import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public class commands extends JavaPlugin {
|
||||
|
||||
public void onEnable() {
|
||||
protected static boolean IsBedEvent;
|
||||
|
||||
public void onEnable() {
|
||||
IsBedEvent = true;
|
||||
Bukkit.getServer().getConsoleSender().sendMessage(ChatColor.AQUA + "greet plugin is Enabled");
|
||||
Bukkit.getServer().getPluginManager().registerEvents(new events(), this);
|
||||
|
||||
@ -58,6 +60,33 @@ public class commands extends JavaPlugin {
|
||||
p.getInventory().addItem(new ItemStack(Material.STONE_SWORD));
|
||||
p.getInventory().addItem(new ItemStack(Material.STONE_SWORD));
|
||||
}
|
||||
|
||||
if (cmd.getName().equalsIgnoreCase("beds")){
|
||||
|
||||
if (args[0].equalsIgnoreCase("disable")) {
|
||||
if (!IsBedEvent) p.sendMessage(greetprefix + "Bed feature is already disabled!");
|
||||
else {
|
||||
|
||||
IsBedEvent = false;
|
||||
Bukkit.getServer().broadcastMessage(greetprefix + ChatColor.BOLD + ChatColor.DARK_RED + p.getDisplayName() + " has Disabled bed feature");
|
||||
}
|
||||
|
||||
}
|
||||
else if (args[0].equalsIgnoreCase("enable")) {
|
||||
|
||||
if (IsBedEvent) p.sendMessage(greetprefix + "Bed feature is already enabled!");
|
||||
|
||||
else {
|
||||
IsBedEvent = true;
|
||||
Bukkit.getServer().broadcastMessage(greetprefix + ChatColor.BOLD + ChatColor.DARK_RED + p.getDisplayName() + " has Enabled bed feature");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else p.sendMessage(greetprefix + "Unknown argument\n Try disable/enable");
|
||||
}
|
||||
|
||||
/*if(cmd.getName().equalsIgnoreCase("setspwan")) { // TODO: give option of new arg to set cords &
|
||||
p.setBedSpawnLocation(p.getLocation());
|
||||
p.sendMessage(ChatColor.GREEN +"Your bed Spwan has been updated to currnet location");
|
||||
|
@ -47,9 +47,11 @@ public class events implements Listener {
|
||||
@EventHandler
|
||||
public void player(PlayerBedLeaveEvent e) {
|
||||
|
||||
if (commands.IsBedEvent) {
|
||||
p = e.getPlayer();
|
||||
Bukkit.getWorld("world").setFullTime(1);
|
||||
p.sendMessage(PREFIX+" Good Morning!");
|
||||
}
|
||||
|
||||
}
|
||||
@EventHandler
|
||||
|
Loading…
Reference in New Issue
Block a user