Skip to content

Commit

Permalink
Disable DeniedMessageEvent
Browse files Browse the repository at this point in the history
I don't know if this is the problem regarding another similar issue, but
I'd rather not risk it + it's likely not being used
  • Loading branch information
RoboMWM committed Jun 16, 2017
1 parent 8e484ad commit f918ee1
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 17 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -58,7 +58,7 @@
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.12-pre2-SNAPSHOT</version>
<version>1.12-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<!--Worldguard dependency-->
Expand Down
44 changes: 28 additions & 16 deletions src/me/ryanhamshire/GriefPrevention/DataStore.java
Expand Up @@ -18,16 +18,15 @@

package me.ryanhamshire.GriefPrevention;

import java.io.*;
import java.nio.charset.Charset;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.regex.Pattern;

import com.google.common.io.Files;
import me.ryanhamshire.GriefPrevention.events.ClaimDeletedEvent;

import me.ryanhamshire.GriefPrevention.events.DeniedMessageEvent;
import org.bukkit.*;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Chunk;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.OfflinePlayer;
import org.bukkit.World;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.AnimalTamer;
Expand All @@ -37,7 +36,26 @@
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;

import com.google.common.io.Files;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import java.util.regex.Pattern;

//singleton class which manages all GriefPrevention data (except for config options)
public abstract class DataStore
Expand Down Expand Up @@ -1686,12 +1704,6 @@ synchronized public String getMessage(Messages messageID, String... args)
message = message.replace("{" + i + "}", param);
}

if (Bukkit.isPrimaryThread())
{
DeniedMessageEvent event = new DeniedMessageEvent(messageID, message);
Bukkit.getPluginManager().callEvent(event);
return event.getMessage();
}
return message;
}

Expand Down

0 comments on commit f918ee1

Please sign in to comment.