Renamed to BalloonData

This commit is contained in:
LCastr0 2016-12-27 00:01:42 -02:00
parent cd70305afb
commit 092cde9973
2 changed files with 13 additions and 13 deletions

View File

@ -17,7 +17,7 @@ import org.bukkit.event.player.PlayerJoinEvent;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.util.UtilBalloons;
import mineplex.core.gadget.util.BalloonData;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
@ -25,9 +25,9 @@ public abstract class BalloonGadget extends Gadget
{
private static final List<Entity> ENTITY_LIST = new ArrayList<>();
private static final Map<UUID, Map<EntityType, UtilBalloons>> PLAYER_BALLOONS = new HashMap<>();
private static final Map<UUID, Map<EntityType, BalloonData>> PLAYER_BALLOONS = new HashMap<>();
private Map<UUID, UtilBalloons> _playerBalloons = new HashMap<>();
private Map<UUID, BalloonData> _playerBalloons = new HashMap<>();
private List<Entity> _entities = new ArrayList<>();
private EntityType _balloon;
@ -73,7 +73,7 @@ public abstract class BalloonGadget extends Gadget
return false;
PLAYER_BALLOONS.computeIfAbsent(player.getUniqueId(), map -> new HashMap<>());
PLAYER_BALLOONS.get(player.getUniqueId()).put(_balloon, new UtilBalloons(player, spawnEntity(player)));
PLAYER_BALLOONS.get(player.getUniqueId()).put(_balloon, new BalloonData(player, spawnEntity(player)));
return true;
}
@ -84,10 +84,10 @@ public abstract class BalloonGadget extends Gadget
{
if (PLAYER_BALLOONS.get(player.getUniqueId()).containsKey(_balloon))
{
UtilBalloons utilBalloons = PLAYER_BALLOONS.get(player.getUniqueId()).get(_balloon);
Entity entity = utilBalloons.getBalloon();
BalloonData balloonData = PLAYER_BALLOONS.get(player.getUniqueId()).get(_balloon);
Entity entity = balloonData.getBalloon();
entity.remove();
Bat bat = utilBalloons.getBat();
Bat bat = balloonData.getBat();
bat.remove();
PLAYER_BALLOONS.get(player.getUniqueId()).remove(_balloon);
}
@ -102,11 +102,11 @@ public abstract class BalloonGadget extends Gadget
if (event.getType() != UpdateType.TICK)
return;
for (Map.Entry<UUID, Map<EntityType, UtilBalloons>> entry : PLAYER_BALLOONS.entrySet())
for (Map.Entry<UUID, Map<EntityType, BalloonData>> entry : PLAYER_BALLOONS.entrySet())
{
for (UtilBalloons utilBalloons : entry.getValue().values())
for (BalloonData balloonData : entry.getValue().values())
{
utilBalloons.update();
balloonData.update();
}
}
}
@ -115,7 +115,7 @@ public abstract class BalloonGadget extends Gadget
{
if (PLAYER_BALLOONS.containsKey(player.getUniqueId()))
{
Map<EntityType, UtilBalloons> balloonGadgets = PLAYER_BALLOONS.get(player.getUniqueId());
Map<EntityType, BalloonData> balloonGadgets = PLAYER_BALLOONS.get(player.getUniqueId());
if (balloonGadgets.containsKey(_balloon))
return false;
return balloonGadgets.size() < 10;

View File

@ -13,7 +13,7 @@ import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilMath;
public class UtilBalloons
public class BalloonData
{
/**
@ -29,7 +29,7 @@ public class UtilBalloons
private long _idleTime;
private Bat _bat;
public UtilBalloons(Player player, Entity balloon)
public BalloonData(Player player, Entity balloon)
{
_player = player;
_balloon = balloon;