Merge branch 'development'
This commit is contained in:
commit
51ca041eed
2
pom.xml
2
pom.xml
|
@ -2,7 +2,7 @@
|
|||
<groupId>com.songoda</groupId>
|
||||
<artifactId>UltimateModeration</artifactId>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<version>1.2.4</version>
|
||||
<version>1.2.5</version>
|
||||
<build>
|
||||
<defaultGoal>clean install</defaultGoal>
|
||||
<finalName>UltimateModeration-${project.version}</finalName>
|
||||
|
|
|
@ -158,7 +158,7 @@ public class UltimateModeration extends SongodaPlugin {
|
|||
row.get("duration").asLong(),
|
||||
row.get("reason").asString(),
|
||||
UUID.fromString(row.get("victim").asString()),
|
||||
UUID.fromString(row.get("punisher").asString()),
|
||||
row.get("punisher").asObject() == null ? null : UUID.fromString(row.get("punisher").asString()),
|
||||
row.get("expiration").asLong(),
|
||||
playerUUID);
|
||||
PlayerPunishData playerPunishData = getPunishmentManager().getPlayer(playerUUID);
|
||||
|
|
|
@ -2,7 +2,6 @@ package com.songoda.ultimatemoderation.listeners;
|
|||
|
||||
import com.songoda.ultimatemoderation.UltimateModeration;
|
||||
import com.songoda.ultimatemoderation.staffchat.StaffChatManager;
|
||||
import java.util.List;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
|
@ -11,32 +10,34 @@ import org.bukkit.event.EventHandler;
|
|||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.BlockBreakEvent;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockListener implements Listener {
|
||||
|
||||
|
||||
private UltimateModeration instance;
|
||||
private StaffChatManager chat = UltimateModeration.getInstance().getStaffChatManager();
|
||||
|
||||
|
||||
public BlockListener(UltimateModeration ultimateModeration) {
|
||||
this.instance = ultimateModeration;
|
||||
}
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void onBlockBreak(BlockBreakEvent event) {
|
||||
|
||||
|
||||
Player player = event.getPlayer();
|
||||
Block block = event.getBlock();
|
||||
Material material = block.getType();
|
||||
|
||||
|
||||
List<String> blocks = instance.getConfig().getStringList("Main.Notify Blocks List");
|
||||
|
||||
for(String broken : blocks) {
|
||||
if(broken.equalsIgnoreCase(material.name())) {
|
||||
if(player.hasPermission("um.staffchat.join") && instance.getConfig().getBoolean("Main.Notify Blocks")) {
|
||||
chat.getChat("notify").messageAll("&7[UM] &a" + Bukkit.getPlayer(player.getUniqueId()).getDisplayName()
|
||||
+ UltimateModeration.getInstance().getLocale().getMessage("notify.block.main").getMessage().replace("%material%", material.name()) + "(" + block.getX() + ", " + block.getY() + ", " + block.getZ() + ")&a!");
|
||||
}
|
||||
|
||||
for (String broken : blocks) {
|
||||
if (!broken.equalsIgnoreCase(material.name())) continue;
|
||||
|
||||
if (player.hasPermission("um.trackblockbreaks") && instance.getConfig().getBoolean("Main.Notify Blocks")) {
|
||||
chat.getChat("notify").messageAll("&7[UM] &a" + Bukkit.getPlayer(player.getUniqueId()).getDisplayName()
|
||||
+ UltimateModeration.getInstance().getLocale().getMessage("notify.block.main").getMessage().replace("%material%", material.name()) + "(" + block.getX() + ", " + block.getY() + ", " + block.getZ() + ")&a!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue