1
0
mirror of https://bitbucket.org/HeshamTB/greet.git synced 2024-11-21 23:22:16 +01:00

Merge remote-tracking branch 'BitBucket/master'

This commit is contained in:
HeshamTB 2018-05-13 05:33:47 +03:00
commit e0c1f86938
10 changed files with 107 additions and 9 deletions

View File

@ -1,11 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> <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">
<attributes> <attributes>
<attribute name="ignore_optional_problems" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="lib" path="C:/Users/Hesham/Desktop/spigot-1.12.2.jar"/> <classpathentry kind="src" output="target/classes" path="src">
<classpathentry kind="output" path="bin"/> <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> </classpath>

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/target/

View File

@ -10,8 +10,14 @@
<arguments> <arguments>
</arguments> </arguments>
</buildCommand> </buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec> </buildSpec>
<natures> <natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature> <nature>org.eclipse.jdt.core.javanature</nature>
</natures> </natures>
</projectDescription> </projectDescription>

View File

@ -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.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=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 org.eclipse.jdt.core.compiler.source=1.8

View File

@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1

Binary file not shown.

View File

@ -15,4 +15,7 @@ commands:
description: Basic survival kit. description: Basic survival kit.
setspwan: setspwan:
usage: /<command> usage: /<command>
description: sets your current location as bed spwan. description: sets your current location as bed spwan.
beds:
usage: /<command>
description: enable or disable bed feature.

42
pom.xml Normal file
View 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>

View File

@ -11,8 +11,10 @@ import org.bukkit.plugin.java.JavaPlugin;
public class commands extends JavaPlugin { public class commands extends JavaPlugin {
protected static boolean IsBedEvent;
public void onEnable() { public void onEnable() {
IsBedEvent = true;
Bukkit.getServer().getConsoleSender().sendMessage(ChatColor.AQUA + "greet plugin is Enabled"); Bukkit.getServer().getConsoleSender().sendMessage(ChatColor.AQUA + "greet plugin is Enabled");
Bukkit.getServer().getPluginManager().registerEvents(new events(), this); Bukkit.getServer().getPluginManager().registerEvents(new events(), this);
@ -57,7 +59,34 @@ public class commands extends JavaPlugin {
p.getInventory().addItem(new ItemStack(Material.STONE_SWORD)); p.getInventory().addItem(new ItemStack(Material.STONE_SWORD));
p.getInventory().addItem(new ItemStack(Material.STONE_SWORD)); p.getInventory().addItem(new ItemStack(Material.STONE_SWORD));
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 & /*if(cmd.getName().equalsIgnoreCase("setspwan")) { // TODO: give option of new arg to set cords &
p.setBedSpawnLocation(p.getLocation()); p.setBedSpawnLocation(p.getLocation());
p.sendMessage(ChatColor.GREEN +"Your bed Spwan has been updated to currnet location"); p.sendMessage(ChatColor.GREEN +"Your bed Spwan has been updated to currnet location");

View File

@ -47,9 +47,11 @@ public class events implements Listener {
@EventHandler @EventHandler
public void player(PlayerBedLeaveEvent e) { public void player(PlayerBedLeaveEvent e) {
if (commands.IsBedEvent) {
p = e.getPlayer(); p = e.getPlayer();
Bukkit.getWorld("world").setFullTime(1); Bukkit.getWorld("world").setFullTime(1);
p.sendMessage(PREFIX+" Good Morning!"); p.sendMessage(PREFIX+" Good Morning!");
}
} }
@EventHandler @EventHandler