More bugs

This commit is contained in:
Sam 2016-11-17 21:20:00 +00:00
parent 142cf4dd93
commit 53b67214fb
9 changed files with 96 additions and 44 deletions

View File

@ -10,13 +10,9 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.Objects;
<<<<<<< HEAD
import org.apache.commons.lang3.StringUtils;
=======
import net.minecraft.server.v1_8_R3.NBTTagCompound;
import net.minecraft.server.v1_8_R3.NBTTagLong;
>>>>>>> refs/remotes/origin/develop
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;

View File

@ -7,6 +7,7 @@ import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.CompletionStage;
import java.util.concurrent.CompletableFuture;
import java.util.logging.Level;
import java.util.stream.Collectors;
@ -867,4 +868,47 @@ public class ReportManager
{
return NAME + " #" + reportId;
}
public CompletableFuture<List<Long>> a(int reporterId)
{
return _reportRepository.getOpenReports(reporterId);
}
public CompletableFuture<List<CompletableFuture<Optional<Report>>>> b(int reporterId)
{
return _reportRepository.getOpenReports(reporterId)
.thenApply(reportIds ->
reportIds.stream().map(_reportRepository::getReport).collect(Collectors.toList()));
}
public CompletableFuture<List<Optional<Report>>> c(int reporterId)
{
return _reportRepository.getOpenReports(reporterId)
.thenApply(reportIds ->
reportIds.stream().map(_reportRepository::getReport).collect(Collectors.toList()))
.thenCompose(UtilFuture::sequence);
}
public CompletableFuture<List<Report>> d(int reporterId)
{
return _reportRepository.getOpenReports(reporterId)
.thenApply(reportIds ->
reportIds.stream().map(_reportRepository::getReport).collect(Collectors.toList()))
.thenCompose(UtilFuture::sequence)
.thenApply(UtilCollections::unboxPresent);
}
public CompletableFuture<List<Report>> e(int reporterId)
{
return _reportRepository.getOpenReports(reporterId)
.thenApply(reportIds ->
reportIds.stream().map(_reportRepository::getReport).collect(Collectors.toList()))
.thenCompose(UtilFuture::sequence)
.thenApply(UtilCollections::unboxPresent)
.thenCompose(reports -> UtilFuture.filter(reports, this::isActiveReport));
}
public CompletableFuture<List<String>> f(List<String> z) {
return UtilFuture.filter(z, a -> CompletableFuture.completedFuture(true));
}
}

View File

@ -185,7 +185,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
private ArcadeShop _arcadeShop;
//Champions Modules
private boolean _enabled = true;
private boolean _enabled = false;
private Boolean _registered = null;
private ClassManager _classManager;
private SkillFactory _skillFactory;
@ -1739,7 +1739,8 @@ public class ArcadeManager extends MiniPlugin implements IRelation
if (_enabled)
{
enableChampionsModules();
//enableChampionsModules();
disableChampionsModules();
}
else
{

View File

@ -69,6 +69,6 @@ public class GameCmdModeCommand extends CommandBase<ArcadeManager>
}
Plugin.setGameCommandMode(newRank);
caller.sendMessage(F.main("Game", "Players now need at least rank " + rank.getTag(true, true) + " to use game commands."));
caller.sendMessage(F.main("Game", "Players now need at least rank " + newRank.getTag(true, true) + C.cGray + " to use game commands."));
}
}

View File

@ -272,6 +272,7 @@ public abstract class UHC extends Game
new CompassModule().setGiveCompass(false).register(this);
new OreVeinEditorModule().removeNonAirVeins().register(this);
new AntiExpOrbModule().register(this);
new RejoinModule().register(this);
registerDebugCommand(new DebugCommand("startpvp", Rank.ADMIN)
{
@ -635,9 +636,7 @@ public abstract class UHC extends Game
{
return;
}
Bukkit.broadcastMessage("DIE OBJECTS, DIE!!!!");
_border = null;
}
@ -769,7 +768,7 @@ public abstract class UHC extends Game
continue;
}
UtilTextBottom.display(message, UtilServer.getPlayers());
UtilTextBottom.display(message, player);
}
}
}

View File

@ -34,7 +34,8 @@ public class UHCTeams extends UHC
FillTeamsInOrderToCount = 2;
DamageTeamSelf = false;
DontAllowOverfill = true;
ShowTeammateMessage = true;
// Load the Team Module
new TeamModule().register(this);
}

View File

@ -4,6 +4,7 @@ import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
@ -37,7 +38,7 @@ public class UHCFreezer implements Listener
{
return;
}
UtilServer.Unregister(this);
}

View File

@ -3,6 +3,7 @@ package nautilus.game.arcade.game.modules;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import org.bukkit.Bukkit;
import org.bukkit.Location;
@ -18,7 +19,6 @@ import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.NautHashMap;
import mineplex.core.common.util.UtilTime;
import mineplex.core.common.util.UtilTime.TimeUnit;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
@ -31,7 +31,7 @@ public class RejoinModule extends Module
private Set<RejoinPlayerData> _data = new HashSet<>();
private int _rejoinTime;
private int _rejoinTime = (int) TimeUnit.MINUTES.toMillis(2);
@Override
protected void setup()
@ -71,32 +71,26 @@ public class RejoinModule extends Module
@EventHandler(priority = EventPriority.LOW)
public void playerQuit(PlayerQuitEvent event)
{
Bukkit.broadcastMessage(event.getEventName());
Player player = event.getPlayer();
GameTeam team = getGame().GetTeam(player);
if (team == null)
{
Bukkit.broadcastMessage("Team was null :(");
return;
}
if (!team.IsAlive(player))
{
Bukkit.broadcastMessage("Player was dead? I mean they shouldn\'t be");
return;
}
if (player.isDead())
{
Bukkit.broadcastMessage("So they are minecraft dead");
return;
}
if (player.getWorld().getName().equalsIgnoreCase("world"))
{
Bukkit.broadcastMessage("They were in the Lobby?");
return;
}
@ -117,7 +111,7 @@ public class RejoinModule extends Module
team.RemovePlayer(player);
// Announcement
getGame().Announce(team.GetColor() + C.Bold + player.getName() + " has disconnected! " + UtilTime.convert(_rejoinTime, 0, TimeUnit.MINUTES) + " minutes to rejoin.", false);
getGame().Announce(team.GetColor() + C.Bold + player.getName() + " has disconnected! " + UtilTime.MakeStr(_rejoinTime) + " minutes to rejoin.", false);
}
@EventHandler(priority = EventPriority.LOWEST)
@ -189,8 +183,11 @@ public class RejoinModule extends Module
continue;
}
getGame().Announce(team.GetColor() + C.Bold + data.getName() + " did not reconnect in time!", false);
if (data.getTeam() != null)
{
getGame().Announce(team.GetColor() + C.Bold + data.getName() + " did not reconnect in time!", false);
}
iterator.remove();
}
}

View File

@ -4,26 +4,11 @@ import java.util.EnumMap;
import java.util.HashSet;
import java.util.Iterator;
import mineplex.core.common.util.*;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.gadget.gadgets.particle.unrelated.HalloweenSmashedEffect;
import mineplex.core.inventory.InventoryManager;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.reward.RewardPool;
import mineplex.core.reward.RewardRarity;
import mineplex.core.titangiveaway.TitanGiveawayManager;
import mineplex.core.treasure.TreasureType;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.Game;
import nautilus.game.arcade.game.Game.GameState;
import net.minecraft.server.v1_8_R3.BlockPosition;
import net.minecraft.server.v1_8_R3.PacketPlayOutBlockAction;
import org.bukkit.*;
import org.bukkit.Color;
import org.bukkit.Effect;
import org.bukkit.FireworkEffect;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.craftbukkit.v1_8_R3.util.CraftMagicNumbers;
@ -36,6 +21,34 @@ import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerPickupItemEvent;
import org.bukkit.util.Vector;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTime;
import mineplex.core.common.util.UtilWorld;
import mineplex.core.inventory.InventoryManager;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.particleeffects.HalloweenSmashedEffect;
import mineplex.core.rankGiveaway.titangiveaway.TitanGiveawayManager;
import mineplex.core.reward.RewardPool;
import mineplex.core.reward.RewardRarity;
import mineplex.core.treasure.TreasureType;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.Game;
import nautilus.game.arcade.game.Game.GameState;
import net.minecraft.server.v1_8_R3.BlockPosition;
import net.minecraft.server.v1_8_R3.PacketPlayOutBlockAction;
public class HolidayManager implements Listener
{
public enum HolidayType