Skip to content

Commit

Permalink
Replaces javafx pairs with Map Entries
Browse files Browse the repository at this point in the history
  • Loading branch information
zessirb committed Jul 22, 2018
1 parent 8a4c8eb commit d870552
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/com/onaple/epicboundaries/WorldAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import java.util.concurrent.CompletableFuture;

public class WorldAction {
private static Map<String, Pair<String, Vector3d>> playersToTransfer = new HashMap<>();
private static Map<String, Map.Entry<String, Vector3d>> playersToTransfer = new HashMap<>();

/**
* Transfer the player into a world
Expand All @@ -36,8 +36,8 @@ public void transferPlayerToWorld(Player player, Location<World> location) {
* @param worldName Name of the world to transfer player(s) to
*/
public void consumePlayerTransferQueue(String worldName) {
for (Map.Entry<String, Pair<String, Vector3d>> entry : playersToTransfer.entrySet()) {
Pair<String, Vector3d> locationPair = entry.getValue();
for (Map.Entry<String, Map.Entry<String, Vector3d>> entry : playersToTransfer.entrySet()) {
Map.Entry<String, Vector3d> locationPair = entry.getValue();
if (locationPair.getKey().equals(worldName)) {
Sponge.getServer().loadWorld(worldName).ifPresent(world -> {
Location<World> location = world.getLocation(locationPair.getValue());
Expand Down Expand Up @@ -88,7 +88,7 @@ private void registerInstance(String worldName) {
* @param position Position to teleport the player to
*/
public void addPlayerToTransferQueue(String playerName, String worldName, Vector3d position) {
playersToTransfer.put(playerName, new Pair<>(worldName, position));
playersToTransfer.put(playerName, new AbstractMap.SimpleEntry<>(worldName, position));
}

/**
Expand Down

0 comments on commit d870552

Please sign in to comment.