1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-12-01 23:13:48 +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> <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;
Bukkit.getServer().getScheduler().runTask(plugin, new Runnable() {
@Override
public void run() {
player.performCommand(msg + event.getMessage()); player.performCommand(msg + event.getMessage());
}
});
event.setCancelled(true); event.setCancelled(true);
} }