1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-29 14:05:25 +01:00
This commit is contained in:
Zrips 2018-08-20 17:01:41 +03:00
commit 7fc27936ab
3 changed files with 12 additions and 7 deletions

View File

@ -125,14 +125,14 @@
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<!--<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<outputDirectory>C:\Users\Arte\Desktop\Server\plugins</outputDirectory>
</configuration>
</plugin>
</plugin>-->
</plugins>
</build>
</project>

View File

@ -95,23 +95,28 @@ public class JobsListener implements Listener {
}
@EventHandler(priority = EventPriority.NORMAL)
public void AsyncPlayerChatEvent(AsyncPlayerChatEvent event) {
public void AsyncPlayerChatEvent(final AsyncPlayerChatEvent event) {
if (event.isCancelled())
return;
if (Util.getJobsEditorMap().isEmpty())
return;
Player player = event.getPlayer();
final Player player = event.getPlayer();
if (!Util.getJobsEditorMap().containsKey(player.getUniqueId()))
return;
String msg = Util.getJobsEditorMap().remove(player.getUniqueId());
final String msg = Util.getJobsEditorMap().remove(player.getUniqueId());
if (msg == null)
return;
player.performCommand(msg + event.getMessage());
Bukkit.getServer().getScheduler().runTask(plugin, new Runnable() {
@Override
public void run() {
player.performCommand(msg + event.getMessage());
}
});
event.setCancelled(true);
}

View File

@ -190,4 +190,4 @@ permissions:
default: true
jobs.command.edititembonus:
description: Grants access to the edititembonus command
default: op
default: op