mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-04-10 05:13:14 +00:00
Revert "Wrapped rollback with a Callable to make sure that it executes on the Bukkit thread."
This reverts commit 65ba053aee248f6b3175f1b0c3d08ba65d2dd648.
This commit is contained in:
parent
65ba053aee
commit
927e46a431
@ -6,8 +6,6 @@ import java.util.Iterator;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.ListIterator;
|
import java.util.ListIterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.Callable;
|
|
||||||
import java.util.concurrent.Future;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
@ -85,11 +83,6 @@ public class TFM_RollbackManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static int rollback(final String playerName)
|
public static int rollback(final String playerName)
|
||||||
{
|
|
||||||
final Future<Integer> future = Bukkit.getScheduler().callSyncMethod(TotalFreedomMod.plugin, new Callable<Integer>()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public Integer call() throws Exception
|
|
||||||
{
|
{
|
||||||
final List<RollbackEntry> entries = getEntriesByPlayer(playerName);
|
final List<RollbackEntry> entries = getEntriesByPlayer(playerName);
|
||||||
if (entries == null)
|
if (entries == null)
|
||||||
@ -125,17 +118,6 @@ public class TFM_RollbackManager
|
|||||||
}.runTaskLater(TotalFreedomMod.plugin, 20L * 20L);
|
}.runTaskLater(TotalFreedomMod.plugin, 20L * 20L);
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
return future.get();
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int undoRollback(String playerName)
|
public static int undoRollback(String playerName)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user