Fixed merge conflicts

This commit is contained in:
AlexTheCoder 2017-09-23 03:41:43 -04:00
parent f05fb3d0e0
commit 567b501dfb
31 changed files with 143 additions and 128 deletions

View File

@ -78,7 +78,7 @@ public class UtilCollections
{ {
for (int i = 0; i < elements.length; i++) for (int i = 0; i < elements.length; i++)
{ {
consumer.accept(Integer.valueOf(i), elements[i]); consumer.accept(i, elements[i]);
} }
} }
@ -91,7 +91,7 @@ public class UtilCollections
{ {
for (int i = min; i < max; i++) for (int i = min; i < max; i++)
{ {
consumer.accept(Integer.valueOf(i)); consumer.accept(i);
} }
} }
@ -281,4 +281,4 @@ public class UtilCollections
{ {
return optionalList.stream().filter(Optional::isPresent).map(Optional::get).collect(Collectors.toList()); return optionalList.stream().filter(Optional::isPresent).map(Optional::get).collect(Collectors.toList());
} }
} }

View File

@ -947,21 +947,22 @@ public class UtilEnt
**/ **/
public static int getNewEntityId(boolean modifynumber) public static int getNewEntityId(boolean modifynumber)
{ {
try try
{ {
Field field = net.minecraft.server.v1_8_R3.Entity.class.getDeclaredField("entityCount"); Field field = net.minecraft.server.v1_8_R3.Entity.class.getDeclaredField("entityCount");
field.setAccessible(true); field.setAccessible(true);
int entityId = field.getInt(null); int entityId = field.getInt(null);
if (modifynumber) { if (modifynumber)
field.set(null, Integer.valueOf(entityId + 1)); {
} field.set(null, entityId + 1);
return entityId; }
} return entityId;
catch (Exception ex) }
{ catch (Exception ex)
ex.printStackTrace(); {
} ex.printStackTrace();
return -1; }
return -1;
} }
public static Entity getEntityById(int entityId) public static Entity getEntityById(int entityId)

View File

@ -137,7 +137,7 @@ public class CommunityJoinRequestsPage extends CommunitiesGUIPage
@EventHandler @EventHandler
public void onMembershipUpdate(CommunityMembershipUpdateEvent event) public void onMembershipUpdate(CommunityMembershipUpdateEvent event)
{ {
if (event.getCommunity().getId().intValue() != _community.getId().intValue()) if (event.getCommunity().getId() != _community.getId())
{ {
return; return;
} }
@ -155,7 +155,7 @@ public class CommunityJoinRequestsPage extends CommunitiesGUIPage
@EventHandler @EventHandler
public void onRequestsUpdate(CommunityJoinRequestsUpdateEvent event) public void onRequestsUpdate(CommunityJoinRequestsUpdateEvent event)
{ {
if (event.getCommunity().getId().intValue() != _community.getId().intValue()) if (event.getCommunity().getId() != _community.getId())
{ {
return; return;
} }
@ -165,7 +165,7 @@ public class CommunityJoinRequestsPage extends CommunitiesGUIPage
@EventHandler @EventHandler
public void onCommunityDisband(CommunityDisbandEvent event) public void onCommunityDisband(CommunityDisbandEvent event)
{ {
if (_community.getId().intValue() == event.getCommunity().getId().intValue()) if (_community.getId() == event.getCommunity().getId())
{ {
Viewer.closeInventory(); Viewer.closeInventory();
} }

View File

@ -158,7 +158,7 @@ public class CommunityMembersPage extends CommunitiesGUIPage
@EventHandler @EventHandler
public void onRequestsUpdate(CommunityJoinRequestsUpdateEvent event) public void onRequestsUpdate(CommunityJoinRequestsUpdateEvent event)
{ {
if (event.getCommunity().getId().intValue() != _community.getId().intValue()) if (event.getCommunity().getId() != _community.getId())
{ {
return; return;
} }
@ -171,7 +171,7 @@ public class CommunityMembersPage extends CommunitiesGUIPage
@EventHandler @EventHandler
public void onMembershipUpdate(CommunityMembershipUpdateEvent event) public void onMembershipUpdate(CommunityMembershipUpdateEvent event)
{ {
if (event.getCommunity().getId().intValue() != _community.getId().intValue()) if (event.getCommunity().getId() != _community.getId())
{ {
return; return;
} }
@ -182,7 +182,7 @@ public class CommunityMembersPage extends CommunitiesGUIPage
@EventHandler @EventHandler
public void onCommunityDisband(CommunityDisbandEvent event) public void onCommunityDisband(CommunityDisbandEvent event)
{ {
if (_community.getId().intValue() == event.getCommunity().getId().intValue()) if (_community.getId() == event.getCommunity().getId())
{ {
Viewer.closeInventory(); Viewer.closeInventory();
} }

View File

@ -109,7 +109,7 @@ public class CommunitySettingsPage extends CommunitiesGUIPage
@EventHandler @EventHandler
public void onRequestsUpdate(CommunityJoinRequestsUpdateEvent event) public void onRequestsUpdate(CommunityJoinRequestsUpdateEvent event)
{ {
if (event.getCommunity().getId().intValue() != _community.getId().intValue()) if (event.getCommunity().getId() != _community.getId())
{ {
return; return;
} }
@ -122,7 +122,7 @@ public class CommunitySettingsPage extends CommunitiesGUIPage
@EventHandler @EventHandler
public void onMembershipUpdate(CommunityMembershipUpdateEvent event) public void onMembershipUpdate(CommunityMembershipUpdateEvent event)
{ {
if (event.getCommunity().getId().intValue() != _community.getId().intValue()) if (event.getCommunity().getId() != _community.getId())
{ {
return; return;
} }
@ -136,7 +136,7 @@ public class CommunitySettingsPage extends CommunitiesGUIPage
@EventHandler @EventHandler
public void onSettingsUpdate(CommunitySettingUpdateEvent event) public void onSettingsUpdate(CommunitySettingUpdateEvent event)
{ {
if (event.getCommunity().getId().intValue() != _community.getId().intValue()) if (event.getCommunity().getId() != _community.getId())
{ {
return; return;
} }
@ -146,7 +146,7 @@ public class CommunitySettingsPage extends CommunitiesGUIPage
@EventHandler @EventHandler
public void onCommunityDisband(CommunityDisbandEvent event) public void onCommunityDisband(CommunityDisbandEvent event)
{ {
if (_community.getId().intValue() == event.getCommunity().getId().intValue()) if (_community.getId() == event.getCommunity().getId())
{ {
Viewer.closeInventory(); Viewer.closeInventory();
} }

View File

@ -5,17 +5,9 @@ import java.util.Arrays;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Set;
import java.util.UUID; import java.util.UUID;
import net.minecraft.server.v1_8_R3.DataWatcher;
import net.minecraft.server.v1_8_R3.EntityArmorStand;
import net.minecraft.server.v1_8_R3.Packet;
import net.minecraft.server.v1_8_R3.PacketPlayOutEntity;
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityDestroy;
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityMetadata;
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityTeleport;
import net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntityLiving;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -23,6 +15,14 @@ import org.bukkit.util.Vector;
import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import net.minecraft.server.v1_8_R3.DataWatcher;
import net.minecraft.server.v1_8_R3.EntityArmorStand;
import net.minecraft.server.v1_8_R3.Packet;
import net.minecraft.server.v1_8_R3.PacketPlayOutEntity;
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityDestroy;
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityMetadata;
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityTeleport;
import net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntityLiving;
/** /**
* Floating text object with interaction and entity follow capabilities. * Floating text object with interaction and entity follow capabilities.
@ -34,7 +34,7 @@ public class Hologram {
/** /**
* 1.7 packets uses both EntityIDs while 1.8 uses only the first. * 1.7 packets uses both EntityIDs while 1.8 uses only the first.
*/ */
private ArrayList<Integer> _entityIds = new ArrayList<>(); private List<Integer> _entityIds = new ArrayList<>();
private Entity _followEntity; private Entity _followEntity;
private HologramManager _hologramManager; private HologramManager _hologramManager;
private String[] _hologramText = new String[0]; private String[] _hologramText = new String[0];
@ -49,8 +49,8 @@ public class Hologram {
private boolean _makeSpawnPackets = true; private boolean _makeSpawnPackets = true;
private Packet[] _packets1_8; private Packet[] _packets1_8;
private Packet[] _packets1_9; private Packet[] _packets1_9;
private HashSet<UUID> _playersInList = new HashSet<>(); private Set<UUID> _playersInList = new HashSet<>();
private ArrayList<Player> _playersTracking = new ArrayList<>(); private List<Player> _playersTracking = new ArrayList<>();
private boolean _removeEntityDeath; private boolean _removeEntityDeath;
private HologramTarget _target = HologramTarget.BLACKLIST; private HologramTarget _target = HologramTarget.BLACKLIST;
private int _viewDistance = 70; private int _viewDistance = 70;
@ -223,7 +223,7 @@ public class Hologram {
/** /**
* @return The list of players that are in the holograms whitelist or blacklist. * @return The list of players that are in the holograms whitelist or blacklist.
*/ */
protected ArrayList<Player> getPlayersTracking() protected List<Player> getPlayersTracking()
{ {
return _playersTracking; return _playersTracking;
} }
@ -334,7 +334,7 @@ public class Hologram {
for (int i = _entityIds.size(); i < _hologramText.length; i++) for (int i = _entityIds.size(); i < _hologramText.length; i++)
{ {
_entityIds.add(Integer.valueOf(UtilEnt.getNewEntityId())); _entityIds.add(UtilEnt.getNewEntityId());
} }
} }
else else

View File

@ -133,7 +133,7 @@ public class LeaderboardManager extends MiniPlugin
final int index = i; final int index = i;
Managers.get(StatsManager.class).loadStatId(board.getStatNames()[index], id -> Managers.get(StatsManager.class).loadStatId(board.getStatNames()[index], id ->
{ {
board.setStatId(index, id.intValue()); board.setStatId(index, id);
}); });
} }
} }

View File

@ -128,7 +128,7 @@ public class StatsManager extends MiniDbClientPlugin<PlayerStats>
{ {
final int statId = _stats.get(statName); final int statId = _stats.get(statName);
runSync(() -> idConsumer.accept(Integer.valueOf(statId))); runSync(() -> idConsumer.accept(statId));
}); });
} }

View File

@ -734,7 +734,7 @@ public class ClansManager extends MiniClientPlugin<ClientClan> implements IRelat
// 0 is set aside for active build so we just dupe build to this row // 0 is set aside for active build so we just dupe build to this row
// whenever we update it. // whenever we update it.
activeBuild.CustomBuildNumber = Integer.valueOf(0); activeBuild.CustomBuildNumber = 0;
_classManager.GetRepository().SaveCustomBuild(activeBuild); _classManager.GetRepository().SaveCustomBuild(activeBuild);
} }
} }

View File

@ -231,7 +231,7 @@ public class MountManager extends MiniDbClientPlugin<MountOwnerData>
{ {
getRepository().deleteMount(token, id -> getRepository().deleteMount(token, id ->
{ {
Get(player).removeMount(id.intValue()); Get(player).removeMount(id);
Pair<Long, MountToken> summonPair = _summoning.get(player); Pair<Long, MountToken> summonPair = _summoning.get(player);
if (summonPair != null) if (summonPair != null)
{ {

View File

@ -90,7 +90,7 @@ public class SiegeManager extends MiniPlugin
System.out.println("[WEAPONS] LOADED SIEGE WEAPON " + weapon.getClass().getSimpleName() + " [" + token.UniqueId + "]"); System.out.println("[WEAPONS] LOADED SIEGE WEAPON " + weapon.getClass().getSimpleName() + " [" + token.UniqueId + "]");
LiveSiegeWeapons.put(Integer.valueOf(token.UniqueId), weapon); LiveSiegeWeapons.put(token.UniqueId, weapon);
}) })
) )
); );
@ -216,7 +216,7 @@ public class SiegeManager extends MiniPlugin
{ {
final SiegeWeaponToken token = weapon.toToken(); final SiegeWeaponToken token = weapon.toToken();
if (UnsyncedSiegeWeapons.containsKey(Integer.valueOf(token.UniqueId))) if (UnsyncedSiegeWeapons.containsKey(token.UniqueId))
continue; continue;
queue.push(() -> _repository.updateWeapon(token)); queue.push(() -> _repository.updateWeapon(token));
@ -357,15 +357,15 @@ public class SiegeManager extends MiniPlugin
{ {
Cannon cannon = new Cannon(location, _clansManager.getClan(player), this, syncWithDb); Cannon cannon = new Cannon(location, _clansManager.getClan(player), this, syncWithDb);
UnsyncedSiegeWeapons.put(Integer.valueOf(cannon.getUniqueId()), cannon); UnsyncedSiegeWeapons.put(cannon.getUniqueId(), cannon);
return cannon; return cannon;
} }
public void dead(SiegeWeapon weapon) public void dead(SiegeWeapon weapon)
{ {
LiveSiegeWeapons.remove(Integer.valueOf(weapon.getUniqueId())); LiveSiegeWeapons.remove(weapon.getUniqueId());
SiegeWeapon unsynced = UnsyncedSiegeWeapons.remove(Integer.valueOf(weapon.getUniqueId())); SiegeWeapon unsynced = UnsyncedSiegeWeapons.remove(weapon.getUniqueId());
if (unsynced == null) if (unsynced == null)
_repository.deleteWeapon(weapon.getUniqueId()); _repository.deleteWeapon(weapon.getUniqueId());

View File

@ -643,18 +643,22 @@ public class Outpost implements Listener
EnclosedObject<Integer> wait = new EnclosedObject<>(0); EnclosedObject<Integer> wait = new EnclosedObject<>(0);
_blocks.values().stream().filter(block -> UtilMath.random.nextBoolean() && UtilMath.random.nextBoolean()).filter(block -> UtilMath.random.nextBoolean()).limit(13).forEach(block -> _blocks.values().stream().filter(block -> UtilMath.random.nextBoolean() && UtilMath.random.nextBoolean()).filter(block -> UtilMath.random.nextBoolean()).limit(13).forEach(block ->
_outpostManager.runSyncLater(() -> { _outpostManager.runSyncLater(() ->
{
UtilParticle.PlayParticleToAll(ParticleType.HUGE_EXPLOSION, block.getLocation(), new Vector(0,0,0), 1f, 1, ViewDist.MAX); UtilParticle.PlayParticleToAll(ParticleType.HUGE_EXPLOSION, block.getLocation(), new Vector(0,0,0), 1f, 1, ViewDist.MAX);
_origin.getWorld().playSound(block.getLocation(), Sound.EXPLODE, 1.0f, 1.0f); _origin.getWorld().playSound(block.getLocation(), Sound.EXPLODE, 1.0f, 1.0f);
}, wait.Set(Integer.valueOf(wait.Get().intValue() + 4 + UtilMath.random.nextInt(4))).longValue()) }, wait.Set(wait.Get() + 4 + UtilMath.random.nextInt(4)))
); );
_outpostManager.runSyncLater(() -> { _outpostManager.runSyncLater(() ->
{
_blocks.values().stream().forEach(OutpostBlock::restore); _blocks.values().stream().forEach(OutpostBlock::restore);
}, wait.Get().intValue() + 5L); }, wait.Get() + 5L);
_outpostManager.runSyncLater(() -> { _outpostManager.runSyncLater(() ->
_blocks.values().stream().forEach(block -> { {
_blocks.values().stream().forEach(block ->
{
Material mat = Material.getMaterial(block.getId()); Material mat = Material.getMaterial(block.getId());
if (UtilItem.isTranslucent(mat) || UtilMath.random.nextBoolean()) if (UtilItem.isTranslucent(mat) || UtilMath.random.nextBoolean())
@ -675,7 +679,7 @@ public class Outpost implements Listener
}); });
cleanup(); cleanup();
}, wait.Get().intValue() + 6L); }, wait.Get() + 6L);
if (_lifetimeLeft != null) _lifetimeLeft.stop(); if (_lifetimeLeft != null) _lifetimeLeft.stop();

View File

@ -201,7 +201,7 @@ public class OutpostManager extends MiniPlugin
} }
_outposts.put(clan.getName(), new Outpost(this, clan, location, type)); _outposts.put(clan.getName(), new Outpost(this, clan, location, type));
_idToOutpost.put(Integer.valueOf(_outposts.get(clan.getName()).getUniqueId()), _outposts.get(clan.getName())); _idToOutpost.put(_outposts.get(clan.getName()).getUniqueId(), _outposts.get(clan.getName()));
return true; return true;
} }
@ -237,7 +237,7 @@ public class OutpostManager extends MiniPlugin
if (event.getType() == UpdateType.FASTER) if (event.getType() == UpdateType.FASTER)
if (!_removalQueue.isEmpty()) if (!_removalQueue.isEmpty())
HandlerList.unregisterAll(_idToOutpost.remove(Integer.valueOf(_outposts.remove(_removalQueue.remove(0)).getUniqueId()))); HandlerList.unregisterAll(_idToOutpost.remove(_outposts.remove(_removalQueue.remove(0)).getUniqueId()));
if (event.getType() == UpdateType.TWOSEC) if (event.getType() == UpdateType.TWOSEC)
_outposts.values() _outposts.values()
@ -268,7 +268,7 @@ public class OutpostManager extends MiniPlugin
public Outpost Get(int outpostId) public Outpost Get(int outpostId)
{ {
return _idToOutpost.get(Integer.valueOf(outpostId)); return _idToOutpost.get(outpostId);
} }
public ClansManager getClansManager() public ClansManager getClansManager()
@ -305,19 +305,23 @@ public class OutpostManager extends MiniPlugin
{ {
final Stack<Runnable> queue = new Stack<>(); final Stack<Runnable> queue = new Stack<>();
_outposts.values().forEach(outpost -> { _outposts.values().forEach(outpost ->
{
final OutpostToken token = outpost.toToken(); final OutpostToken token = outpost.toToken();
queue.push(() -> _repository.updateOutpost(token)); queue.push(() -> _repository.updateOutpost(token));
}); });
runAsync(() -> { runAsync(() ->
{
while (!queue.isEmpty()) while (!queue.isEmpty())
queue.pop().run(); queue.pop().run();
_repository.getOutpostsByServer(_clansManager.getServerId(), tokens -> { _repository.getOutpostsByServer(_clansManager.getServerId(), tokens ->
tokens.forEach(token -> { {
if (!_idToOutpost.containsKey(Integer.valueOf(token.UniqueId))) tokens.forEach(token ->
{
if (!_idToOutpost.containsKey(token.UniqueId))
{ {
System.out.println("[OUTPOSTS] OUTPOST [" + token.UniqueId + "] NO LONGER EXISTS, DELETING"); System.out.println("[OUTPOSTS] OUTPOST [" + token.UniqueId + "] NO LONGER EXISTS, DELETING");
_repository.deleteOutpost(token.UniqueId); _repository.deleteOutpost(token.UniqueId);
@ -331,4 +335,4 @@ public class OutpostManager extends MiniPlugin
{ {
return _repository; return _repository;
} }
} }

View File

@ -146,7 +146,7 @@ public class Cannon extends SiegeWeapon
setFirepowerType(Material.SULPHUR); setFirepowerType(Material.SULPHUR);
setAmmunitionType(Material.TNT); setAmmunitionType(Material.TNT);
setFirepowerSlots(Integer.valueOf(1), Integer.valueOf(3), Integer.valueOf(5), Integer.valueOf(7)); setFirepowerSlots(1, 3, 5, 7);
setMaximumFirepowerPerSlot(3); setMaximumFirepowerPerSlot(3);
setAmmunitionSlot(4); setAmmunitionSlot(4);
@ -154,7 +154,8 @@ public class Cannon extends SiegeWeapon
_baseDamage = 650; _baseDamage = 650;
setFireRule(new AccessRule(AccessType.LCLICK_BB, player -> { setFireRule(new AccessRule(AccessType.LCLICK_BB, player ->
{
if (!isRiding(player)) if (!isRiding(player))
{ {
return false; return false;
@ -189,7 +190,8 @@ public class Cannon extends SiegeWeapon
enableInventory(UtilServer.getServer().createInventory(null, InventoryType.DISPENSER, C.cDAquaB + _name), new AccessRule(AccessType.RCLICK_BB, player -> player.equals(getRider()))); enableInventory(UtilServer.getServer().createInventory(null, InventoryType.DISPENSER, C.cDAquaB + _name), new AccessRule(AccessType.RCLICK_BB, player -> player.equals(getRider())));
setRideable(new AccessRule(AccessType.RCLICK_BB, player -> { setRideable(new AccessRule(AccessType.RCLICK_BB, player ->
{
if (!_ownerClan.isMember(player)) if (!_ownerClan.isMember(player))
{ {
UtilPlayer.message(player, F.main("Clans", "This Cannon is not owned by your Clan.")); UtilPlayer.message(player, F.main("Clans", "This Cannon is not owned by your Clan."));
@ -300,7 +302,7 @@ public class Cannon extends SiegeWeapon
_inventory.setItem(1, new ItemBuilder(Material.SULPHUR).setTitle(C.cWhiteB + "Firepower: " + C.cYellow + _firepower).setAmount(_firepower).build()); _inventory.setItem(1, new ItemBuilder(Material.SULPHUR).setTitle(C.cWhiteB + "Firepower: " + C.cYellow + _firepower).setAmount(_firepower).build());
_inventory.setItem(2, new ItemBuilder(Material.LEVER).setTitle(C.cGreen + "+1 Firepower").build()); _inventory.setItem(2, new ItemBuilder(Material.LEVER).setTitle(C.cGreen + "+1 Firepower").build());
for (int slot : UtilCollections.newList(Integer.valueOf(3), Integer.valueOf(5), Integer.valueOf(6), Integer.valueOf(7), Integer.valueOf(8))) for (int slot : UtilCollections.newList(3, 5, 6, 7, 8))
{ {
_inventory.setItem(slot, new ItemBuilder(Material.COBBLESTONE).setTitle(C.cGray + "Cannon Wall").build()); _inventory.setItem(slot, new ItemBuilder(Material.COBBLESTONE).setTitle(C.cGray + "Cannon Wall").build());
} }
@ -457,4 +459,4 @@ public class Cannon extends SiegeWeapon
false false
); );
}*/ }*/
} }

View File

@ -685,7 +685,7 @@ public abstract class SiegeWeapon implements Listener
} }
} }
} }
else if (_firepowerSlots.contains(Integer.valueOf(slot))) else if (_firepowerSlots.contains(slot))
{ {
if (item.getType() != _firepowerType) if (item.getType() != _firepowerType)
{ {

View File

@ -70,7 +70,7 @@ public class RaidAltar
} }
if (data != null) if (data != null)
{ {
if (item.getData().getData() != data.byteValue()) if (item.getData().getData() != data)
{ {
rejected = true; rejected = true;
} }
@ -84,7 +84,7 @@ public class RaidAltar
if (amount != null) if (amount != null)
{ {
return count >= amount.intValue(); return count >= amount;
} }
else else
{ {
@ -143,7 +143,7 @@ public class RaidAltar
} }
if (data != null) if (data != null)
{ {
if (item.getData().getData() != data.byteValue()) if (item.getData().getData() != data)
{ {
rejected = true; rejected = true;
} }
@ -154,7 +154,7 @@ public class RaidAltar
if (item.getAmount() > (amount - removed)) if (item.getAmount() > (amount - removed))
{ {
removed += (amount - removed); removed += (amount - removed);
item.setAmount(item.getAmount() - (amount - removed)); item.setAmount(item.getAmount() - removed);
} }
else else
{ {

View File

@ -367,7 +367,7 @@ public class WorldData
try try
{ {
return new Location(World, Integer.valueOf(coords[0])+0.5, Integer.valueOf(coords[1]), Integer.valueOf(coords[2])+0.5); return new Location(World, Integer.valueOf(coords[0]) +0.5, Integer.valueOf(coords[1]), Integer.valueOf(coords[2]) + 0.5);
} }
catch (Exception e) catch (Exception e)
{ {

View File

@ -92,9 +92,10 @@ public class TNTGenPage extends ShopPageBase<ClansManager, TNTGenShop>
" ", " ",
C.cWhite + "Purchased by " + F.elem(clan.getMembers().get(generator.getBuyer()).getPlayerName()), C.cWhite + "Purchased by " + F.elem(clan.getMembers().get(generator.getBuyer()).getPlayerName()),
" ", " ",
C.cWhite + "TNT Available: " + F.elem(Integer.valueOf(generator.getStock())), C.cWhite + "TNT Available: " + F.elem(generator.getStock()),
" ", " ",
C.cWhite + "Next TNT: " + F.elem(nextTnt)).build(), (player, click) -> { C.cWhite + "Next TNT: " + F.elem(nextTnt)).build(), (player, click) ->
{
clearPage(); clearPage();
buildPage(); buildPage();
} }
@ -106,7 +107,7 @@ public class TNTGenPage extends ShopPageBase<ClansManager, TNTGenShop>
.setTitle(C.cGreen + "TNT Generator") .setTitle(C.cGreen + "TNT Generator")
.setLore( .setLore(
" ", " ",
C.cWhite + "TNT Available: " + F.elem(Integer.valueOf(generator.getStock())), C.cWhite + "TNT Available: " + F.elem(generator.getStock()),
" ", " ",
C.cWhite + "Next TNT: " + F.elem(nextTnt)).build(), (player, click) -> C.cWhite + "Next TNT: " + F.elem(nextTnt)).build(), (player, click) ->
{ {

View File

@ -14,7 +14,7 @@ import mineplex.game.clans.tutorial.objective.ObjectiveGoal;
public class HoldItemGoal extends ObjectiveGoal<Objective<?, ?>> public class HoldItemGoal extends ObjectiveGoal<Objective<?, ?>>
{ {
private DefaultHashMap<String, EnclosedObject<Integer>> _ticksHeld = new DefaultHashMap<>(key -> new EnclosedObject<>(Integer.valueOf(0))); private DefaultHashMap<String, EnclosedObject<Integer>> _ticksHeld = new DefaultHashMap<>(key -> new EnclosedObject<>(0));
private Material _material; private Material _material;
private long _holdTicks; private long _holdTicks;
@ -63,13 +63,13 @@ public class HoldItemGoal extends ObjectiveGoal<Objective<?, ?>>
return; return;
} }
_ticksHeld.get(player.getName()).Set(Integer.valueOf(_ticksHeld.get(player.getName()).Get().intValue() + 1)); _ticksHeld.get(player.getName()).Set(_ticksHeld.get(player.getName()).Get() + 1);
if (_ticksHeld.get(player.getName()).Get().intValue() >= 80) if (_ticksHeld.get(player.getName()).Get() >= 80)
{ {
finish(player); finish(player);
} }
} }
}); });
} }
} }

View File

@ -9,14 +9,12 @@ import mineplex.core.common.DefaultHashMap;
import mineplex.core.common.util.EnclosedObject; import mineplex.core.common.util.EnclosedObject;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
import mineplex.game.clans.clans.map.events.PlayerGetMapEvent;
import mineplex.game.clans.tutorial.objective.ObjectiveGoal; import mineplex.game.clans.tutorial.objective.ObjectiveGoal;
import mineplex.game.clans.tutorial.tutorials.clans.objective.AttackEnemyObjective;
import mineplex.game.clans.tutorial.tutorials.clans.objective.FieldsObjective; import mineplex.game.clans.tutorial.tutorials.clans.objective.FieldsObjective;
public class IdentifyFieldsGoal extends ObjectiveGoal<FieldsObjective> public class IdentifyFieldsGoal extends ObjectiveGoal<FieldsObjective>
{ {
private DefaultHashMap<String, EnclosedObject<Integer>> _ticksHeld = new DefaultHashMap<>(key -> new EnclosedObject<>(Integer.valueOf(0))); private DefaultHashMap<String, EnclosedObject<Integer>> _ticksHeld = new DefaultHashMap<>(key -> new EnclosedObject<>(0));
public IdentifyFieldsGoal(FieldsObjective objective) public IdentifyFieldsGoal(FieldsObjective objective)
{ {
@ -42,7 +40,8 @@ public class IdentifyFieldsGoal extends ObjectiveGoal<FieldsObjective>
return; return;
} }
getActivePlayers().forEach(uuid -> { getActivePlayers().forEach(uuid ->
{
Player player = Bukkit.getPlayer(uuid); Player player = Bukkit.getPlayer(uuid);
if (player != null && player.isOnline()) if (player != null && player.isOnline())
@ -52,13 +51,13 @@ public class IdentifyFieldsGoal extends ObjectiveGoal<FieldsObjective>
return; return;
} }
_ticksHeld.get(player.getName()).Set(Integer.valueOf(_ticksHeld.get(player.getName()).Get().intValue() + 1)); _ticksHeld.get(player.getName()).Set(_ticksHeld.get(player.getName()).Get() + 1);
if (_ticksHeld.get(player.getName()).Get().intValue() >= 80) if (_ticksHeld.get(player.getName()).Get() >= 80)
{ {
finish(player); finish(player);
} }
} }
}); });
} }
} }

View File

@ -30,7 +30,8 @@ public class TutorialRepository extends RepositoryBase
public void SetTimesPlayed(UUID uuid, int timesPlayed) public void SetTimesPlayed(UUID uuid, int timesPlayed)
{ {
// Prevent duplicate entries for individuals // Prevent duplicate entries for individuals
executeQuery(GET, result -> { executeQuery(GET, result ->
{
if (result.next()) if (result.next())
executeUpdate(UPDATE, new ColumnInt("timesPlayed", timesPlayed), new ColumnVarChar("uuid", 36, uuid.toString())); executeUpdate(UPDATE, new ColumnInt("timesPlayed", timesPlayed), new ColumnVarChar("uuid", 36, uuid.toString()));
else else
@ -42,14 +43,15 @@ public class TutorialRepository extends RepositoryBase
{ {
EnclosedObject<Integer> status = new EnclosedObject<>(); EnclosedObject<Integer> status = new EnclosedObject<>();
executeQuery(GET, result -> { executeQuery(GET, result ->
{
if (result.next()) if (result.next())
status.Set(Integer.valueOf(result.getInt("timesPlayed"))); status.Set(result.getInt("timesPlayed"));
else else
status.Set(Integer.valueOf(0)); status.Set(0);
}, new ColumnVarChar("uuid", 36, uuid.toString())); }, new ColumnVarChar("uuid", 36, uuid.toString()));
return status.Get().intValue(); return status.Get();
} }
public int GetTimesPlayed(String name) public int GetTimesPlayed(String name)
@ -61,4 +63,4 @@ public class TutorialRepository extends RepositoryBase
{ {
executeUpdate(CREATE_TABLE); executeUpdate(CREATE_TABLE);
} }
} }

View File

@ -106,7 +106,7 @@ public class SalesAnnouncementManager extends MiniPlugin
{ {
runSync(() -> runSync(() ->
{ {
_data.remove(Integer.valueOf(id)); _data.remove(id);
UtilServer.CallEvent(new SalesAnnouncementRemoteListUpdateEvent()); UtilServer.CallEvent(new SalesAnnouncementRemoteListUpdateEvent());
}); });
} }
@ -115,7 +115,7 @@ public class SalesAnnouncementManager extends MiniPlugin
{ {
runSync(() -> runSync(() ->
{ {
if (_data.containsKey(Integer.valueOf(id))) if (_data.containsKey(id))
{ {
_repo.loadAnnouncement(id, data -> _repo.loadAnnouncement(id, data ->
{ {

View File

@ -107,7 +107,7 @@ public class SalesAnnouncementManager extends MiniPlugin
{ {
runSync(() -> runSync(() ->
{ {
_data.remove(Integer.valueOf(id)); _data.remove(id);
UtilServer.CallEvent(new SalesAnnouncementRemoteListUpdateEvent()); UtilServer.CallEvent(new SalesAnnouncementRemoteListUpdateEvent());
}); });
} }
@ -116,7 +116,7 @@ public class SalesAnnouncementManager extends MiniPlugin
{ {
runSync(() -> runSync(() ->
{ {
if (_data.containsKey(Integer.valueOf(id))) if (_data.containsKey(id))
{ {
_repo.loadAnnouncement(id, data -> _repo.loadAnnouncement(id, data ->
{ {

View File

@ -153,7 +153,7 @@ public class SalesAnnouncementRepository extends RepositoryBase
{ {
runAsync(() -> runAsync(() ->
{ {
executeUpdate(UPDATE_ANNOUNCEMENT_STATUS, new ColumnBoolean("enabled", data.isEnabled()), new ColumnInt("id", data.getId().intValue())); executeUpdate(UPDATE_ANNOUNCEMENT_STATUS, new ColumnBoolean("enabled", data.isEnabled()), new ColumnInt("id", data.getId()));
if (after != null) if (after != null)
{ {
runSync(after); runSync(after);
@ -165,7 +165,7 @@ public class SalesAnnouncementRepository extends RepositoryBase
{ {
runAsync(() -> runAsync(() ->
{ {
executeUpdate(DELETE_ANNOUNCEMENT, new ColumnInt("id", data.getId().intValue())); executeUpdate(DELETE_ANNOUNCEMENT, new ColumnInt("id", data.getId()));
if (after != null) if (after != null)
{ {
runSync(after); runSync(after);

View File

@ -119,7 +119,8 @@ public class Sharpshooter extends Skill
public void missReset(ProjectileHitEvent event) public void missReset(ProjectileHitEvent event)
{ {
final Projectile projectile = event.getEntity(); final Projectile projectile = event.getEntity();
Factory.runSyncLater(() -> { Factory.runSyncLater(() ->
{
if (!projectile.isDead() && _arrows.containsKey(projectile)) if (!projectile.isDead() && _arrows.containsKey(projectile))
{ {
Player shooter = (Player) projectile.getShooter(); Player shooter = (Player) projectile.getShooter();
@ -131,14 +132,14 @@ public class Sharpshooter extends Skill
if (!_missedCount.containsKey(shooter)) if (!_missedCount.containsKey(shooter))
{ {
_missedCount.put(shooter, Integer.valueOf(1)); _missedCount.put(shooter, 1);
} }
else else
{ {
_missedCount.put(shooter, Integer.valueOf(_missedCount.get(shooter).intValue() + 1)); _missedCount.put(shooter, _missedCount.get(shooter) + 1);
// Reset // Reset
if (_missedCount.get(shooter).intValue() >= 2) if (_missedCount.get(shooter) >= 2)
{ {
_hitCount.remove(shooter); _hitCount.remove(shooter);
_missedCount.remove(shooter); _missedCount.remove(shooter);
@ -199,4 +200,4 @@ public class Sharpshooter extends Skill
_hitCount.remove(player); _hitCount.remove(player);
_missedCount.remove(player); _missedCount.remove(player);
} }
} }

View File

@ -441,7 +441,7 @@ public class CastleAssaultTDM extends TeamGame
GameTeam red = GetTeam(ChatColor.RED); GameTeam red = GetTeam(ChatColor.RED);
GameTeam blue = GetTeam(ChatColor.AQUA); GameTeam blue = GetTeam(ChatColor.AQUA);
if (_teamKills.get(blue).intValue() >= KILLS_TO_WIN) if (_teamKills.get(blue) >= KILLS_TO_WIN)
{ {
AnnounceEnd(blue); AnnounceEnd(blue);
writeFinalScoreboard(blue.GetColor() + blue.GetName(), _teamKills.get(blue)); writeFinalScoreboard(blue.GetColor() + blue.GetName(), _teamKills.get(blue));
@ -495,7 +495,7 @@ public class CastleAssaultTDM extends TeamGame
SetState(GameState.End); SetState(GameState.End);
return; return;
} }
if (_teamKills.get(red).intValue() >= KILLS_TO_WIN) if (_teamKills.get(red) >= KILLS_TO_WIN)
{ {
AnnounceEnd(red); AnnounceEnd(red);
writeFinalScoreboard(red.GetColor() + red.GetName(), _teamKills.get(red)); writeFinalScoreboard(red.GetColor() + red.GetName(), _teamKills.get(red));

View File

@ -43,7 +43,7 @@ public class PerkBloodlust extends Perk
Integer id = _lusting.remove(event.getEntity()); Integer id = _lusting.remove(event.getEntity());
if (id != null) if (id != null)
{ {
Bukkit.getScheduler().cancelTask(id.intValue()); Bukkit.getScheduler().cancelTask(id);
} }
} }
@ -89,7 +89,7 @@ public class PerkBloodlust extends Perk
Integer id = _lusting.remove(player); Integer id = _lusting.remove(player);
if (id != null) if (id != null)
{ {
Bukkit.getScheduler().cancelTask(id.intValue()); Bukkit.getScheduler().cancelTask(id);
} }
player.sendMessage(C.cRed + "You are now channeling bloodlust for " + _duration + " seconds!"); player.sendMessage(C.cRed + "You are now channeling bloodlust for " + _duration + " seconds!");

View File

@ -335,20 +335,23 @@ public class Gun extends StrikeItem
{ {
if(_kills == -1) if(_kills == -1)
{ {
new BukkitRunnable() { new BukkitRunnable()
public void run() { {
public void run()
{
PlayerStats remoteStats = game.getHost().getArcadeManager().GetStatsManager().Get(player);; PlayerStats remoteStats = game.getHost().getArcadeManager().GetStatsManager().Get(player);;
_kills = (int) remoteStats.getStat(game.getHost().GetName() + "." + getStatNameKills(true)); _kills = (int) remoteStats.getStat(game.getHost().GetName() + "." + getStatNameKills(true));
Player owner = UtilPlayer.searchExact(getOwnerName()); Player owner = UtilPlayer.searchExact(getOwnerName());
if(owner != null) { if (owner != null)
{
HashMap<String, Integer> localStatsMap = game.getHost().GetStats().get(owner); HashMap<String, Integer> localStatsMap = game.getHost().GetStats().get(owner);
if(localStatsMap != null) if (localStatsMap != null)
{ {
Integer kills = localStatsMap.get(game.getHost().GetName() + "." + getStatNameKills(true)); Integer kills = localStatsMap.get(game.getHost().GetName() + "." + getStatNameKills(true));
if(kills != null) if (kills != null)
{ {
_kills += kills.intValue(); _kills += kills;
} }
} }
} }
@ -358,12 +361,12 @@ public class Gun extends StrikeItem
} }
} }
int kls = _kills; int kls = _kills;
if(kls == -1) kls = 0; if (kls == -1) kls = 0;
String owner = C.Reset + (getOwnerName() == null ? "" : getOwnerName() + "'s "); String owner = C.Reset + (getOwnerName() == null ? "" : getOwnerName() + "'s ");
String reload = C.Bold + getChatName() + (_reloadTick ? ChatColor.RED : ChatColor.WHITE); String reload = C.Bold + getChatName() + (_reloadTick ? ChatColor.RED : ChatColor.WHITE);
String kills = C.cYellow + " " + kls + " kills"; String kills = C.cYellow + " " + kls + " kills";
if(!hasCustomSkin()) if (!hasCustomSkin())
{ {
kills = ""; kills = "";
} }

View File

@ -14,7 +14,6 @@ import org.bukkit.event.EventHandler;
public class PerfectionistTracker extends StatTracker<SpeedBuilders> public class PerfectionistTracker extends StatTracker<SpeedBuilders>
{ {
private SpeedBuilders _game; private SpeedBuilders _game;
private NautHashMap<Player, Integer> _perfectBuilds = new NautHashMap<Player, Integer>(); private NautHashMap<Player, Integer> _perfectBuilds = new NautHashMap<Player, Integer>();
@ -42,9 +41,8 @@ public class PerfectionistTracker extends StatTracker<SpeedBuilders>
for (Entry<Player, Integer> entry : _perfectBuilds.entrySet()) for (Entry<Player, Integer> entry : _perfectBuilds.entrySet())
{ {
if (entry.getValue().intValue() == _game.getRoundsPlayed()) if (entry.getValue() == _game.getRoundsPlayed())
addStat(entry.getKey(), "PerfectWins", 1, true, false); addStat(entry.getKey(), "PerfectWins", 1, true, false);
} }
} }
}
}

View File

@ -125,7 +125,7 @@ public class TutorialValentines extends GameTutorial
for (Entry<Pig,Integer> data : _pigs.entrySet()) for (Entry<Pig,Integer> data : _pigs.entrySet())
{ {
//Move //Move
if (data.getValue().intValue() == 0) if (data.getValue() == 0)
{ {
if (UtilMath.offset(data.getKey().getLocation(), _pigWaypointA) > 1) if (UtilMath.offset(data.getKey().getLocation(), _pigWaypointA) > 1)
{ {
@ -136,7 +136,7 @@ public class TutorialValentines extends GameTutorial
data.setValue(1); data.setValue(1);
} }
} }
if (data.getValue().intValue() == 1) if (data.getValue() == 1)
{ {
if (UtilMath.offset(data.getKey().getLocation(), _pigWaypointB) > 1) if (UtilMath.offset(data.getKey().getLocation(), _pigWaypointB) > 1)
{ {

View File

@ -714,7 +714,7 @@ public class GameHostManager implements Listener
{ {
if (isCommunityServer()) if (isCommunityServer())
{ {
if (getOwner().getId().intValue() == event.getCommunity().getId().intValue()) if (getOwner().getId() == event.getCommunity().getId())
{ {
setHostExpired(true, getOwner().getName() + " has disbanded and abandoned the server. Thanks for playing!"); setHostExpired(true, getOwner().getName() + " has disbanded and abandoned the server. Thanks for playing!");
} }