1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-01-04 23:37:49 +01:00

Fix job editor chat event

This commit is contained in:
Ken B 2018-08-09 00:38:56 -04:00
parent d31d60f4d8
commit af25281ef2
3 changed files with 14 additions and 9 deletions

View File

@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>Jobs</groupId> <groupId>Jobs</groupId>
<artifactId>jobs</artifactId> <artifactId>jobs</artifactId>
<version>4.5.1</version> <version>4.6.3</version>
<name>Jobs</name> <name>Jobs</name>
<url>http://maven.apache.org</url> <url>http://maven.apache.org</url>
<properties> <properties>
@ -16,7 +16,7 @@
<dependency> <dependency>
<groupId>org.spigotmc</groupId> <groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId> <artifactId>spigot-api</artifactId>
<version>1.12-R0.1-SNAPSHOT</version> <version>1.13-R0.1-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<!-- iConomy7 --> <!-- iConomy7 -->
@ -125,14 +125,14 @@
<target>1.7</target> <target>1.7</target>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <!--<plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId> <artifactId>maven-jar-plugin</artifactId>
<version>2.3.1</version> <version>2.3.1</version>
<configuration> <configuration>
<outputDirectory>C:\Users\Arte\Desktop\Server\plugins</outputDirectory> <outputDirectory>C:\Users\Arte\Desktop\Server\plugins</outputDirectory>
</configuration> </configuration>
</plugin> </plugin>-->
</plugins> </plugins>
</build> </build>
</project> </project>

View File

@ -95,23 +95,28 @@ public class JobsListener implements Listener {
} }
@EventHandler(priority = EventPriority.NORMAL) @EventHandler(priority = EventPriority.NORMAL)
public void AsyncPlayerChatEvent(AsyncPlayerChatEvent event) { public void AsyncPlayerChatEvent(final AsyncPlayerChatEvent event) {
if (event.isCancelled()) if (event.isCancelled())
return; return;
if (Util.getJobsEditorMap().isEmpty()) if (Util.getJobsEditorMap().isEmpty())
return; return;
Player player = event.getPlayer(); final Player player = event.getPlayer();
if (!Util.getJobsEditorMap().containsKey(player.getUniqueId())) if (!Util.getJobsEditorMap().containsKey(player.getUniqueId()))
return; return;
String msg = Util.getJobsEditorMap().remove(player.getUniqueId()); final String msg = Util.getJobsEditorMap().remove(player.getUniqueId());
if (msg == null) if (msg == null)
return; 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); event.setCancelled(true);
} }

View File

@ -1,7 +1,7 @@
name: Jobs name: Jobs
description: Jobs Plugin for the BukkitAPI description: Jobs Plugin for the BukkitAPI
main: com.gamingmesh.jobs.Jobs main: com.gamingmesh.jobs.Jobs
version: 4.6.1 version: 4.6.3
api-version: 1.13 api-version: 1.13
website: https://www.spigotmc.org/resources/jobs-reborn.4216/ website: https://www.spigotmc.org/resources/jobs-reborn.4216/
author: phrstbrn author: phrstbrn