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++)
{
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++)
{
consumer.accept(Integer.valueOf(i));
consumer.accept(i);
}
}

View File

@ -952,8 +952,9 @@ public class UtilEnt
Field field = net.minecraft.server.v1_8_R3.Entity.class.getDeclaredField("entityCount");
field.setAccessible(true);
int entityId = field.getInt(null);
if (modifynumber) {
field.set(null, Integer.valueOf(entityId + 1));
if (modifynumber)
{
field.set(null, entityId + 1);
}
return entityId;
}

View File

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

View File

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

View File

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

View File

@ -5,17 +5,9 @@ import java.util.Arrays;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
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.entity.Entity;
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.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.
@ -34,7 +34,7 @@ public class Hologram {
/**
* 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 HologramManager _hologramManager;
private String[] _hologramText = new String[0];
@ -49,8 +49,8 @@ public class Hologram {
private boolean _makeSpawnPackets = true;
private Packet[] _packets1_8;
private Packet[] _packets1_9;
private HashSet<UUID> _playersInList = new HashSet<>();
private ArrayList<Player> _playersTracking = new ArrayList<>();
private Set<UUID> _playersInList = new HashSet<>();
private List<Player> _playersTracking = new ArrayList<>();
private boolean _removeEntityDeath;
private HologramTarget _target = HologramTarget.BLACKLIST;
private int _viewDistance = 70;
@ -223,7 +223,7 @@ public class Hologram {
/**
* @return The list of players that are in the holograms whitelist or blacklist.
*/
protected ArrayList<Player> getPlayersTracking()
protected List<Player> getPlayersTracking()
{
return _playersTracking;
}
@ -334,7 +334,7 @@ public class Hologram {
for (int i = _entityIds.size(); i < _hologramText.length; i++)
{
_entityIds.add(Integer.valueOf(UtilEnt.getNewEntityId()));
_entityIds.add(UtilEnt.getNewEntityId());
}
}
else

View File

@ -133,7 +133,7 @@ public class LeaderboardManager extends MiniPlugin
final int index = i;
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);
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
// whenever we update it.
activeBuild.CustomBuildNumber = Integer.valueOf(0);
activeBuild.CustomBuildNumber = 0;
_classManager.GetRepository().SaveCustomBuild(activeBuild);
}
}

View File

@ -231,7 +231,7 @@ public class MountManager extends MiniDbClientPlugin<MountOwnerData>
{
getRepository().deleteMount(token, id ->
{
Get(player).removeMount(id.intValue());
Get(player).removeMount(id);
Pair<Long, MountToken> summonPair = _summoning.get(player);
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 + "]");
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();
if (UnsyncedSiegeWeapons.containsKey(Integer.valueOf(token.UniqueId)))
if (UnsyncedSiegeWeapons.containsKey(token.UniqueId))
continue;
queue.push(() -> _repository.updateWeapon(token));
@ -357,15 +357,15 @@ public class SiegeManager extends MiniPlugin
{
Cannon cannon = new Cannon(location, _clansManager.getClan(player), this, syncWithDb);
UnsyncedSiegeWeapons.put(Integer.valueOf(cannon.getUniqueId()), cannon);
UnsyncedSiegeWeapons.put(cannon.getUniqueId(), cannon);
return cannon;
}
public void dead(SiegeWeapon weapon)
{
LiveSiegeWeapons.remove(Integer.valueOf(weapon.getUniqueId()));
SiegeWeapon unsynced = UnsyncedSiegeWeapons.remove(Integer.valueOf(weapon.getUniqueId()));
LiveSiegeWeapons.remove(weapon.getUniqueId());
SiegeWeapon unsynced = UnsyncedSiegeWeapons.remove(weapon.getUniqueId());
if (unsynced == null)
_repository.deleteWeapon(weapon.getUniqueId());

View File

@ -643,18 +643,22 @@ public class Outpost implements Listener
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 ->
_outpostManager.runSyncLater(() -> {
_outpostManager.runSyncLater(() ->
{
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);
}, 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);
}, wait.Get().intValue() + 5L);
}, wait.Get() + 5L);
_outpostManager.runSyncLater(() -> {
_blocks.values().stream().forEach(block -> {
_outpostManager.runSyncLater(() ->
{
_blocks.values().stream().forEach(block ->
{
Material mat = Material.getMaterial(block.getId());
if (UtilItem.isTranslucent(mat) || UtilMath.random.nextBoolean())
@ -675,7 +679,7 @@ public class Outpost implements Listener
});
cleanup();
}, wait.Get().intValue() + 6L);
}, wait.Get() + 6L);
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));
_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;
}
@ -237,7 +237,7 @@ public class OutpostManager extends MiniPlugin
if (event.getType() == UpdateType.FASTER)
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)
_outposts.values()
@ -268,7 +268,7 @@ public class OutpostManager extends MiniPlugin
public Outpost Get(int outpostId)
{
return _idToOutpost.get(Integer.valueOf(outpostId));
return _idToOutpost.get(outpostId);
}
public ClansManager getClansManager()
@ -305,19 +305,23 @@ public class OutpostManager extends MiniPlugin
{
final Stack<Runnable> queue = new Stack<>();
_outposts.values().forEach(outpost -> {
_outposts.values().forEach(outpost ->
{
final OutpostToken token = outpost.toToken();
queue.push(() -> _repository.updateOutpost(token));
});
runAsync(() -> {
runAsync(() ->
{
while (!queue.isEmpty())
queue.pop().run();
_repository.getOutpostsByServer(_clansManager.getServerId(), tokens -> {
tokens.forEach(token -> {
if (!_idToOutpost.containsKey(Integer.valueOf(token.UniqueId)))
_repository.getOutpostsByServer(_clansManager.getServerId(), tokens ->
{
tokens.forEach(token ->
{
if (!_idToOutpost.containsKey(token.UniqueId))
{
System.out.println("[OUTPOSTS] OUTPOST [" + token.UniqueId + "] NO LONGER EXISTS, DELETING");
_repository.deleteOutpost(token.UniqueId);

View File

@ -146,7 +146,7 @@ public class Cannon extends SiegeWeapon
setFirepowerType(Material.SULPHUR);
setAmmunitionType(Material.TNT);
setFirepowerSlots(Integer.valueOf(1), Integer.valueOf(3), Integer.valueOf(5), Integer.valueOf(7));
setFirepowerSlots(1, 3, 5, 7);
setMaximumFirepowerPerSlot(3);
setAmmunitionSlot(4);
@ -154,7 +154,8 @@ public class Cannon extends SiegeWeapon
_baseDamage = 650;
setFireRule(new AccessRule(AccessType.LCLICK_BB, player -> {
setFireRule(new AccessRule(AccessType.LCLICK_BB, player ->
{
if (!isRiding(player))
{
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())));
setRideable(new AccessRule(AccessType.RCLICK_BB, player -> {
setRideable(new AccessRule(AccessType.RCLICK_BB, player ->
{
if (!_ownerClan.isMember(player))
{
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(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());
}

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)
{

View File

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

View File

@ -367,7 +367,7 @@ public class WorldData
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)
{

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 + "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();
buildPage();
}
@ -106,7 +107,7 @@ public class TNTGenPage extends ShopPageBase<ClansManager, TNTGenShop>
.setTitle(C.cGreen + "TNT Generator")
.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) ->
{

View File

@ -14,7 +14,7 @@ import mineplex.game.clans.tutorial.objective.ObjectiveGoal;
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 long _holdTicks;
@ -63,9 +63,9 @@ public class HoldItemGoal extends ObjectiveGoal<Objective<?, ?>>
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);
}

View File

@ -9,14 +9,12 @@ import mineplex.core.common.DefaultHashMap;
import mineplex.core.common.util.EnclosedObject;
import mineplex.core.updater.UpdateType;
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.tutorials.clans.objective.AttackEnemyObjective;
import mineplex.game.clans.tutorial.tutorials.clans.objective.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)
{
@ -42,7 +40,8 @@ public class IdentifyFieldsGoal extends ObjectiveGoal<FieldsObjective>
return;
}
getActivePlayers().forEach(uuid -> {
getActivePlayers().forEach(uuid ->
{
Player player = Bukkit.getPlayer(uuid);
if (player != null && player.isOnline())
@ -52,9 +51,9 @@ public class IdentifyFieldsGoal extends ObjectiveGoal<FieldsObjective>
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);
}

View File

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

View File

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

View File

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

View File

@ -153,7 +153,7 @@ public class SalesAnnouncementRepository extends RepositoryBase
{
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)
{
runSync(after);
@ -165,7 +165,7 @@ public class SalesAnnouncementRepository extends RepositoryBase
{
runAsync(() ->
{
executeUpdate(DELETE_ANNOUNCEMENT, new ColumnInt("id", data.getId().intValue()));
executeUpdate(DELETE_ANNOUNCEMENT, new ColumnInt("id", data.getId()));
if (after != null)
{
runSync(after);

View File

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

View File

@ -441,7 +441,7 @@ public class CastleAssaultTDM extends TeamGame
GameTeam red = GetTeam(ChatColor.RED);
GameTeam blue = GetTeam(ChatColor.AQUA);
if (_teamKills.get(blue).intValue() >= KILLS_TO_WIN)
if (_teamKills.get(blue) >= KILLS_TO_WIN)
{
AnnounceEnd(blue);
writeFinalScoreboard(blue.GetColor() + blue.GetName(), _teamKills.get(blue));
@ -495,7 +495,7 @@ public class CastleAssaultTDM extends TeamGame
SetState(GameState.End);
return;
}
if (_teamKills.get(red).intValue() >= KILLS_TO_WIN)
if (_teamKills.get(red) >= KILLS_TO_WIN)
{
AnnounceEnd(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());
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);
if (id != null)
{
Bukkit.getScheduler().cancelTask(id.intValue());
Bukkit.getScheduler().cancelTask(id);
}
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)
{
new BukkitRunnable() {
public void run() {
new BukkitRunnable()
{
public void run()
{
PlayerStats remoteStats = game.getHost().getArcadeManager().GetStatsManager().Get(player);;
_kills = (int) remoteStats.getStat(game.getHost().GetName() + "." + getStatNameKills(true));
Player owner = UtilPlayer.searchExact(getOwnerName());
if(owner != null) {
if (owner != null)
{
HashMap<String, Integer> localStatsMap = game.getHost().GetStats().get(owner);
if(localStatsMap != null)
if (localStatsMap != null)
{
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;
if(kls == -1) kls = 0;
if (kls == -1) kls = 0;
String owner = C.Reset + (getOwnerName() == null ? "" : getOwnerName() + "'s ");
String reload = C.Bold + getChatName() + (_reloadTick ? ChatColor.RED : ChatColor.WHITE);
String kills = C.cYellow + " " + kls + " kills";
if(!hasCustomSkin())
if (!hasCustomSkin())
{
kills = "";
}

View File

@ -14,7 +14,6 @@ import org.bukkit.event.EventHandler;
public class PerfectionistTracker extends StatTracker<SpeedBuilders>
{
private SpeedBuilders _game;
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())
{
if (entry.getValue().intValue() == _game.getRoundsPlayed())
if (entry.getValue() == _game.getRoundsPlayed())
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())
{
//Move
if (data.getValue().intValue() == 0)
if (data.getValue() == 0)
{
if (UtilMath.offset(data.getKey().getLocation(), _pigWaypointA) > 1)
{
@ -136,7 +136,7 @@ public class TutorialValentines extends GameTutorial
data.setValue(1);
}
}
if (data.getValue().intValue() == 1)
if (data.getValue() == 1)
{
if (UtilMath.offset(data.getKey().getLocation(), _pigWaypointB) > 1)
{

View File

@ -714,7 +714,7 @@ public class GameHostManager implements Listener
{
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!");
}