mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-12-28 04:37:37 +00:00
Fixing some things that weren't thread safe.
More import / formatting cleanup.
This commit is contained in:
parent
71ec3d3a4d
commit
7b0977d58f
@ -1,5 +1,5 @@
|
||||
#Tue, 19 Mar 2013 18:03:45 -0400
|
||||
#Wed, 20 Mar 2013 20:15:15 -0400
|
||||
|
||||
program.VERSION=2.11
|
||||
program.BUILDNUM=96
|
||||
program.BUILDDATE=03/19/2013 06\:03 PM
|
||||
program.BUILDNUM=103
|
||||
program.BUILDDATE=03/20/2013 08\:15 PM
|
||||
|
@ -1,3 +1,3 @@
|
||||
#Build Number for ANT. Do not edit!
|
||||
#Tue Mar 19 18:03:45 EDT 2013
|
||||
build.number=97
|
||||
#Wed Mar 20 20:15:15 EDT 2013
|
||||
build.number=104
|
||||
|
@ -68,7 +68,7 @@ public class Command_doom extends TFM_Command
|
||||
// generate explosion
|
||||
p.getWorld().createExplosion(p.getLocation(), 4F);
|
||||
|
||||
server.getScheduler().runTaskLaterAsynchronously(plugin, new Runnable()
|
||||
server.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
@ -81,7 +81,7 @@ public class Command_doom extends TFM_Command
|
||||
}
|
||||
}, 40L); // 2 seconds
|
||||
|
||||
server.getScheduler().runTaskLaterAsynchronously(plugin, new Runnable()
|
||||
server.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
|
@ -176,7 +176,7 @@ public class TFM_PlayerListener implements Listener
|
||||
last_block = test_block;
|
||||
}
|
||||
|
||||
Bukkit.getScheduler().runTaskLaterAsynchronously(TotalFreedomMod.plugin, new Runnable()
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(TotalFreedomMod.plugin, new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
@ -695,7 +695,7 @@ public class TFM_PlayerListener implements Listener
|
||||
|
||||
if (TotalFreedomMod.adminOnlyMode)
|
||||
{
|
||||
TotalFreedomMod.plugin.getServer().getScheduler().runTaskLaterAsynchronously(TotalFreedomMod.plugin, new Runnable()
|
||||
TotalFreedomMod.plugin.getServer().getScheduler().scheduleSyncDelayedTask(TotalFreedomMod.plugin, new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
|
@ -8,7 +8,6 @@ import org.bukkit.entity.Player;
|
||||
public class TFM_LandmineData
|
||||
{
|
||||
public static List<TFM_LandmineData> landmines = new ArrayList<TFM_LandmineData>();
|
||||
|
||||
public Location landmine_pos;
|
||||
public Player player;
|
||||
public double radius;
|
||||
|
@ -13,9 +13,7 @@ import org.bukkit.entity.Player;
|
||||
public class TFM_UserList
|
||||
{
|
||||
private static final String USERLIST_FILENAME = "userlist.yml";
|
||||
|
||||
private static TFM_UserList instance = null;
|
||||
|
||||
private Map<String, TFM_UserListEntry> _userlist = new HashMap<String, TFM_UserListEntry>();
|
||||
private final TotalFreedomMod _plugin;
|
||||
|
||||
|
@ -18,7 +18,6 @@ import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang.exception.ExceptionUtils;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.*;
|
||||
|
||||
@ -973,4 +972,16 @@ public class TFM_Util
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static String inputStreamToString(InputStream is, boolean preserveNewlines) throws IOException
|
||||
{
|
||||
BufferedReader br = new BufferedReader(new InputStreamReader(is));
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String line;
|
||||
while ((line = br.readLine()) != null)
|
||||
{
|
||||
sb.append(line).append(preserveNewlines ? System.lineSeparator() : "");
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ public class TotalFreedomMod extends JavaPlugin
|
||||
|
||||
TFM_Util.deleteFolder(new File("./_deleteme"));
|
||||
|
||||
server.getScheduler().runTaskTimerAsynchronously(this, new TFM_Heartbeat(this), HEARTBEAT_RATE * 20L, HEARTBEAT_RATE * 20L);
|
||||
server.getScheduler().scheduleSyncRepeatingTask(this, new TFM_Heartbeat(this), HEARTBEAT_RATE * 20L, HEARTBEAT_RATE * 20L);
|
||||
|
||||
// metrics @ http://mcstats.org/plugin/TotalFreedomMod
|
||||
try
|
||||
@ -298,7 +298,7 @@ public class TotalFreedomMod extends JavaPlugin
|
||||
TFM_Log.severe("Error loading superadmin list: " + ex.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static List<String> permbanned_players = new ArrayList<String>();
|
||||
public static List<String> permbanned_ips = new ArrayList<String>();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user