In one of my previous commits, while migrating CompassAddon ->
CompassModule I accidentally removed two logical components. The first
prevented compasses from being given out in the pregame lobby, and the
second allowed players who were dead to receive compasses. Both have been
re-added.
This commit is contained in:
samczsun 2017-01-01 11:31:17 -05:00 committed by cnr
parent 283dd23920
commit 4cd643f64f
66 changed files with 404 additions and 22 deletions

View File

@ -89,6 +89,7 @@ import nautilus.game.arcade.game.games.build.Build;
import nautilus.game.arcade.game.games.draw.Draw;
import nautilus.game.arcade.game.games.speedbuilders.SpeedBuilders;
import nautilus.game.arcade.game.modules.Module;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.ChampionsKit;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability;

View File

@ -14,6 +14,7 @@ import nautilus.game.arcade.game.SoloGame;
import nautilus.game.arcade.game.games.baconbrawl.kits.KitMamaPig;
import nautilus.game.arcade.game.games.baconbrawl.kits.KitPig;
import nautilus.game.arcade.game.games.baconbrawl.kits.KitSheepPig;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
public class BaconBrawl extends SoloGame
@ -48,6 +49,12 @@ public class BaconBrawl extends SoloGame
DamageDealt,
DamageTaken
);
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
@EventHandler

View File

@ -42,7 +42,9 @@ public class Barbarians extends SoloGame
this.DamageTeamSelf = true;
new CompassModule().register(this);
new CompassModule()
.setGiveCompassToAlive(true)
.register(this);
this.BlockBreakAllow.add(5);
this.BlockBreakAllow.add(17);

View File

@ -26,6 +26,7 @@ import nautilus.game.arcade.game.TeamGame;
import nautilus.game.arcade.game.games.basketball.data.ScoringManager;
import nautilus.game.arcade.game.games.basketball.data.ThrowData;
import nautilus.game.arcade.game.games.basketball.kit.BasketballPlayerKit;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
import net.minecraft.server.v1_8_R3.BlockPosition;
import org.bukkit.Bukkit;
@ -102,6 +103,12 @@ public class Basketball extends TeamGame
this.AllowParticles = false;
this.GameTimeout = -1;
_score = new ScoringManager(this);
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
private boolean isOutOfBounds(Location loc, boolean ball)

View File

@ -19,6 +19,7 @@ import nautilus.game.arcade.game.games.champions.kits.KitBrute;
import nautilus.game.arcade.game.games.champions.kits.KitKnight;
import nautilus.game.arcade.game.games.champions.kits.KitMage;
import nautilus.game.arcade.game.games.champions.kits.KitRanger;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
import org.bukkit.Bukkit;
import org.bukkit.Location;
@ -55,6 +56,12 @@ public class BossBattles extends TeamGame
CreatureAllowOverride = true;
PrepareFreeze = false;
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
// registerChatStats(Kills);
// Game giving constant errors when loading.
}

View File

@ -14,6 +14,7 @@ import nautilus.game.arcade.GameType;
import nautilus.game.arcade.game.SoloGame;
import nautilus.game.arcade.game.games.bouncyballs.kits.*;
import nautilus.game.arcade.game.games.bouncyballs.Ball;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
@ -37,6 +38,12 @@ public class BouncyBalls extends SoloGame
this.HungerSet = 20;
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
// registerChatStats();
}

View File

@ -206,7 +206,9 @@ public class Bridge extends TeamGame implements OreObsfucation
WorldWaterDamage = 0;
WorldBoundaryKill = false;
new CompassModule().register(this);
new CompassModule()
.setGiveCompassToAlive(true)
.register(this);
DeathDropItems = true;

View File

@ -106,6 +106,7 @@ import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.games.build.gui.MobShop;
import nautilus.game.arcade.game.games.build.gui.OptionsShop;
import nautilus.game.arcade.game.games.build.kits.KitBuilder;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
import nautilus.game.arcade.stats.BlockBreakStatTracker;
@ -164,6 +165,12 @@ public class Build extends Game
public Build(ArcadeManager manager)
{
this(manager, GameType.Build);
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
protected Build(ArcadeManager manager, GameType gameType)

View File

@ -10,6 +10,8 @@ import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.game.games.build.Build;
import nautilus.game.arcade.game.games.build.BuildData;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import org.bukkit.Location;
import org.bukkit.entity.Player;
@ -45,6 +47,12 @@ public class BuildMavericks extends Build
_reposetory = new MavericksBuildRepository();
_notifyFailure = false;
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
@Override

View File

@ -13,6 +13,7 @@ import nautilus.game.arcade.events.PlayerPrepareTeleportEvent;
import nautilus.game.arcade.game.SoloGame;
import nautilus.game.arcade.game.games.GameScore;
import nautilus.game.arcade.game.games.cards.kits.KitPlayer;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
import org.bukkit.Location;
@ -72,6 +73,12 @@ public class Cards extends SoloGame
_cardFactory = new CardFactory();
registerChatStats();
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
@Override

View File

@ -69,6 +69,7 @@ import nautilus.game.arcade.game.games.castlesiege.kits.KitHumanPeasant;
import nautilus.game.arcade.game.games.castlesiege.kits.KitUndeadArcher;
import nautilus.game.arcade.game.games.castlesiege.kits.KitUndeadGhoul;
import nautilus.game.arcade.game.games.castlesiege.kits.KitUndeadZombie;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.NullKit;
import nautilus.game.arcade.stats.BloodThirstyStatTracker;
@ -230,6 +231,12 @@ public class CastleSiege extends TeamGame
);
registerChatStats();
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
@Override

View File

@ -51,6 +51,7 @@ import nautilus.game.arcade.game.games.christmas.parts.Part2;
import nautilus.game.arcade.game.games.christmas.parts.Part3;
import nautilus.game.arcade.game.games.christmas.parts.Part4;
import nautilus.game.arcade.game.games.christmas.parts.Part5;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
import net.minecraft.server.v1_8_R3.PacketPlayOutAttachEntity;
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityDestroy;
@ -158,6 +159,12 @@ public class Christmas extends SoloGame
DamageDealt,
DamageTaken
);
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
//parse 129 19 47 48 103 86 137 56 22 45 121 14 15 16 87 88 89 153 173 172 162

View File

@ -34,6 +34,7 @@ import nautilus.game.arcade.game.games.common.ctf_data.CarrierCombatDeathEvent;
import nautilus.game.arcade.game.games.common.ctf_data.Flag;
import nautilus.game.arcade.game.games.common.dominate_data.PlayerData;
import nautilus.game.arcade.game.games.common.dominate_data.Resupply;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
import org.bukkit.Bukkit;
@ -98,7 +99,13 @@ public class CaptureTheFlag extends TeamGame
this.DeathOut = false;
this.PrepareFreeze = true;
this.HungerSet = 20;
this.WorldTimeSet = 2000;
this.WorldTimeSet = 2000;
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
this.DeathSpectateSecs = 10;
}

View File

@ -23,6 +23,7 @@ import nautilus.game.arcade.game.games.common.dominate_data.CapturePoint;
import nautilus.game.arcade.game.games.common.dominate_data.Emerald;
import nautilus.game.arcade.game.games.common.dominate_data.PlayerData;
import nautilus.game.arcade.game.games.common.dominate_data.Resupply;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
@ -81,6 +82,12 @@ public class Domination extends TeamGame
this.DeathSpectateSecs = 10;
//this.QuitOut = false;
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
@Override

View File

@ -66,7 +66,9 @@ public class TeamDeathmatch extends TeamGame
this.HungerSet = 20;
this.WorldTimeSet = 2000;
new CompassModule().register(this);
new CompassModule()
.setGiveCompassToAlive(true)
.register(this);
//this.EloRanking = true;
//this.EloSetting.setEloSetting(2);

View File

@ -74,7 +74,9 @@ public class DeathTag extends SoloGame
this.DeathOut = false;
this.HungerSet = 20;
new CompassModule().register(this);
new CompassModule()
.setGiveCompassToAlive(true)
.register(this);
this.PrepareFreeze = false;

View File

@ -59,6 +59,7 @@ import nautilus.game.arcade.game.games.dragonescape.kits.KitDigger;
import nautilus.game.arcade.game.games.dragonescape.kits.KitDisruptor;
import nautilus.game.arcade.game.games.dragonescape.kits.KitLeaper;
import nautilus.game.arcade.game.games.dragonescape.kits.KitWarper;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
import nautilus.game.arcade.stats.DistanceTraveledStatTracker;
@ -140,6 +141,12 @@ public class DragonEscape extends SoloGame
BlankLine,
new ChatStatData("kit", "Kit", true)
);
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
@Override

View File

@ -4,6 +4,7 @@ import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.game.SoloGame;
import nautilus.game.arcade.game.games.dragonriders.kits.KitRider;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
public class DragonRiders extends SoloGame
@ -27,5 +28,11 @@ public class DragonRiders extends SoloGame
//Chat stats
registerChatStats();
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
}

View File

@ -28,6 +28,7 @@ import nautilus.game.arcade.events.PlayerStateChangeEvent;
import nautilus.game.arcade.game.SoloGame;
import nautilus.game.arcade.game.GameTeam.PlayerState;
import nautilus.game.arcade.game.games.dragons.kits.*;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.PerkSparkler;
@ -73,6 +74,12 @@ public class Dragons extends SoloGame
BlankLine,
new ChatStatData("kit", "Kit", true)
);
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
@Override

View File

@ -56,6 +56,7 @@ import nautilus.game.arcade.game.games.draw.tools.Tool;
import nautilus.game.arcade.game.games.draw.tools.ToolCircle;
import nautilus.game.arcade.game.games.draw.tools.ToolLine;
import nautilus.game.arcade.game.games.draw.tools.ToolSquare;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
import nautilus.game.arcade.stats.DrawGuessStatTracker;
@ -226,7 +227,12 @@ public class Draw extends SoloGame
new ChatStatData("TotalGuess", "Total Guess'", true),
new ChatStatData("PureLuck", "Lucky Guess'", true)
);
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
@Override

View File

@ -19,6 +19,7 @@ import nautilus.game.arcade.GameType;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.Game;
import nautilus.game.arcade.game.games.event.kits.KitPlayer;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.GameHostManager;
import org.bukkit.*;
@ -117,6 +118,12 @@ public class EventGame extends Game
this.CreatureAllow = true;
_customAreas = new HashMap<>();
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
@EventHandler

View File

@ -119,6 +119,7 @@ public class Evolution extends SoloGame
GemAssistDeathRespawn = .5;
new CompassModule()
.setGiveCompassToAlive(true)
.setGiveCompass(false)
.register(this);

View File

@ -65,6 +65,7 @@ import nautilus.game.arcade.game.games.gladiators.trackers.PrecisionTracker;
import nautilus.game.arcade.game.games.gladiators.trackers.SwiftKillTracker;
import nautilus.game.arcade.game.games.gladiators.trackers.UntouchableTracker;
import nautilus.game.arcade.game.games.gladiators.tutorial.TutorialGladiators;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.gametutorial.events.GameTutorialStartEvent;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
@ -145,6 +146,12 @@ public class Gladiators extends SoloGame
_firstRound = true;
_hotbarEditor = new HotbarEditor(manager.getPlugin(), this);
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
@EventHandler

View File

@ -111,7 +111,9 @@ public class Gravity extends SoloGame
this.WorldTimeSet = 18000;
new CompassModule().register(this);
new CompassModule()
.setGiveCompassToAlive(true)
.register(this);
this.WorldBoundaryKill = false;

View File

@ -55,6 +55,7 @@ import nautilus.game.arcade.game.games.halloween.waves.Wave5;
import nautilus.game.arcade.game.games.halloween.waves.WaveBase;
import nautilus.game.arcade.game.games.halloween.waves.WaveBoss;
import nautilus.game.arcade.game.games.halloween.waves.WaveVictory;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
import net.minecraft.server.v1_8_R3.PacketPlayOutNamedSoundEffect;
@ -167,6 +168,12 @@ public class Halloween extends SoloGame
C.cAqua + "Stick together to survive.",
C.cGreen + "The Pumpkin King gets harder over time!",
};
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
@Override

View File

@ -57,6 +57,7 @@ import nautilus.game.arcade.game.games.halloween2016.wave.Wave4;
import nautilus.game.arcade.game.games.halloween2016.wave.Wave5;
import nautilus.game.arcade.game.games.halloween2016.wave.WaveBoss;
import nautilus.game.arcade.game.games.halloween2016.wave.WaveVictory;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
public class Halloween2016 extends Halloween
@ -124,6 +125,12 @@ public class Halloween2016 extends Halloween
EnableTutorials = DO_TUTORIALS;
doVoices = false;
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
public void setObjective(String objective)

View File

@ -46,6 +46,7 @@ import nautilus.game.arcade.game.games.hideseek.kits.KitHiderSwapper;
import nautilus.game.arcade.game.games.hideseek.kits.KitSeekerLeaper;
import nautilus.game.arcade.game.games.hideseek.kits.KitSeekerRadar;
import nautilus.game.arcade.game.games.hideseek.kits.KitSeekerTNT;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.NullKit;
import nautilus.game.arcade.stats.BadHiderStatTracker;
@ -350,6 +351,12 @@ public class HideSeek extends TeamGame
//Need ideas for this one
registerChatStats();
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
@EventHandler

View File

@ -15,6 +15,7 @@ import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.game.SoloGame;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
import org.bukkit.Bukkit;
@ -59,6 +60,12 @@ public class HoleInTheWall extends SoloGame
WorldTimeSet = 8000;
registerChatStats();
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
private ArrayList<Entry<Integer, Integer>> getWall()

View File

@ -9,6 +9,7 @@ import nautilus.game.arcade.GameType;
import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.TeamGame;
import nautilus.game.arcade.game.games.horsecharge.kits.*;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.NullKit;
@ -37,6 +38,12 @@ public class Horse extends TeamGame
});
registerChatStats();
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
@Override

View File

@ -41,6 +41,7 @@ import nautilus.game.arcade.game.games.lobbers.trackers.TrackerBlastProof;
import nautilus.game.arcade.game.games.lobbers.trackers.TrackerDirectHit;
import nautilus.game.arcade.game.games.lobbers.trackers.TrackerNoDamage;
import nautilus.game.arcade.game.games.lobbers.trackers.TrackerTNTThrown;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
@ -130,6 +131,12 @@ public class BombLobbers extends TeamGame implements IThrown
BlankLine,
new ChatStatData("Thrown", "Bombs Lobbed", true)
);
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
@EventHandler

View File

@ -21,6 +21,7 @@ import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.game.TeamGame;
import nautilus.game.arcade.game.games.micro.kits.*;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
import nautilus.game.arcade.stats.KillsWithinGameStatTracker;
@ -63,6 +64,12 @@ public class Micro extends TeamGame
this.BlockBreak = true;
this.BlockPlace = true;
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
public Micro(ArcadeManager manager)

View File

@ -93,7 +93,9 @@ public class MilkCow extends SoloGame
"First player to 15 points wins!"
});
new CompassModule().register(this);
new CompassModule()
.setGiveCompassToAlive(true)
.register(this);
this.DeathOut = false;
_scoreObj = Scoreboard.getScoreboard().registerNewObjective("Milk", "dummy");

View File

@ -44,6 +44,7 @@ import nautilus.game.arcade.game.games.minecraftleague.tracker.TowerDefenderTrac
import nautilus.game.arcade.game.games.minecraftleague.variation.ExtraScoreboardData;
import nautilus.game.arcade.game.games.minecraftleague.variation.GameVariation;
import nautilus.game.arcade.game.games.minecraftleague.variation.VariationManager;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
@ -213,6 +214,12 @@ public class MinecraftLeague extends RankedTeamGame
Alert = new TowerAlert();
Bukkit.getPluginManager().registerEvents(_freeze, manager.getPlugin());
Bukkit.getPluginManager().registerEvents(_tower, manager.getPlugin());
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
private enum DamageAmount

View File

@ -71,6 +71,7 @@ import nautilus.game.arcade.game.games.minestrike.data.Bomb;
import nautilus.game.arcade.game.games.minestrike.items.guns.Gun;
import nautilus.game.arcade.game.games.minestrike.items.guns.GunStats;
import nautilus.game.arcade.game.games.minestrike.kits.KitPlayer;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
import nautilus.game.arcade.stats.KaboomStatTracker;
@ -178,6 +179,12 @@ public class Minestrike extends TeamGame
_gunModule = new GunModule(this);
_shopManager = new ShopManager(this);
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
public Minestrike(ArcadeManager manager)

View File

@ -6,6 +6,7 @@ import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.game.TeamGame;
import nautilus.game.arcade.game.games.sheep.kits.*;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.NullKit;
@ -33,6 +34,12 @@ public class Moba extends TeamGame
this.HungerSet = 20;
registerChatStats();
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
@Override

View File

@ -27,6 +27,7 @@ import nautilus.game.arcade.GameType;
import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.TeamGame;
import nautilus.game.arcade.game.games.monsterleague.kits.*;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
public class MonsterLeague extends TeamGame
@ -65,6 +66,12 @@ public class MonsterLeague extends TeamGame
this.TeamArmorHotbar = true;
registerChatStats();
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
//Supports anywhere from 2-4 teams on a map

View File

@ -32,6 +32,7 @@ import nautilus.game.arcade.game.games.monstermaze.trackers.FirstToSafepadTracke
import nautilus.game.arcade.game.games.monstermaze.trackers.PilotTracker;
import nautilus.game.arcade.game.games.monstermaze.trackers.SnowmanHitTracker;
import nautilus.game.arcade.game.games.monstermaze.trackers.SurvivePast10thSafepadTracker;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
@ -112,6 +113,12 @@ public class MonsterMaze extends SoloGame
BlankLine,
new ChatStatData("kit", "Kit", true)
);
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
public Maze getMaze()

View File

@ -37,6 +37,7 @@ import nautilus.game.arcade.game.SoloGame;
import nautilus.game.arcade.game.games.oldmineware.order.Order;
import nautilus.game.arcade.game.games.oldmineware.random.*;
import nautilus.game.arcade.game.games.runner.kits.KitLeaper;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
public class OldMineWare extends SoloGame
@ -90,6 +91,12 @@ public class OldMineWare extends SoloGame
PopulateOrders();
registerChatStats();
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
@Override

View File

@ -74,6 +74,7 @@ import nautilus.game.arcade.game.games.paintball.kits.KitSniper;
import nautilus.game.arcade.game.games.paintball.trackers.KillingSpreeTracker;
import nautilus.game.arcade.game.games.paintball.trackers.LastStandStatTracker;
import nautilus.game.arcade.game.games.paintball.trackers.MedicStatTracker;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.stats.WinFastStatTracker;
import nautilus.game.arcade.stats.WinWithoutLosingTeammateStatTracker;
@ -125,6 +126,12 @@ public class Paintball extends TeamGame
DamageTaken,
DamageDealt
);
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
@EventHandler

View File

@ -38,6 +38,7 @@ import nautilus.game.arcade.game.games.quiver.kits.KitEnchanter;
import nautilus.game.arcade.game.games.quiver.kits.KitLeaper;
import nautilus.game.arcade.game.games.quiver.kits.KitNinja;
import nautilus.game.arcade.game.games.quiver.kits.KitSlamShot;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.stats.SharpShooterStatTracker;
import nautilus.game.arcade.stats.WinWithoutBowStatTracker;
@ -87,6 +88,12 @@ public class Quiver extends SoloGame
DamageTaken,
DamageDealt
);
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
@SuppressWarnings("deprecation")

View File

@ -31,6 +31,7 @@ import nautilus.game.arcade.game.games.quiver.module.ModuleUltimate;
import nautilus.game.arcade.game.games.quiver.module.QuiverTeamModule;
import nautilus.game.arcade.game.games.quiver.module.game.QuiverPayload;
import nautilus.game.arcade.game.modules.VersionModule;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.stats.WinWithoutBowStatTracker;
@ -95,6 +96,12 @@ public class QuiverTeamBase extends TeamGame
// There was no game identifier in the map. Use Payload as the default
getQuiverTeamModule(QuiverPayload.class);
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
@Override

View File

@ -27,6 +27,7 @@ import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.TeamGame;
import nautilus.game.arcade.game.games.quiver.kits.*;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
public class QuiverTeams extends TeamGame
@ -75,6 +76,12 @@ public class QuiverTeams extends TeamGame
DamageTaken,
DamageDealt
);
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
@EventHandler(priority = EventPriority.HIGH)

View File

@ -32,6 +32,7 @@ import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.events.PlayerGameRespawnEvent;
import nautilus.game.arcade.game.SoloGame;
import nautilus.game.arcade.game.games.uhc.KitUHC;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
public class ElytraRings extends SoloGame
@ -52,6 +53,12 @@ public class ElytraRings extends SoloGame
DeathOut = false;
DeathMessages = false;
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
public void RespawnPlayer(final Player player)

View File

@ -31,6 +31,7 @@ import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.game.SoloGame;
import nautilus.game.arcade.game.games.runner.kits.*;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
import nautilus.game.arcade.stats.DistanceTraveledStatTracker;
@ -78,6 +79,12 @@ public class Runner extends SoloGame implements IThrown
this.WorldWaterDamage = 4;
this.PrepareFreeze = false;
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
@EventHandler

View File

@ -18,6 +18,7 @@ import nautilus.game.arcade.GameType;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.TeamGame;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
import org.bukkit.Bukkit;
@ -77,6 +78,12 @@ public class SearchAndDestroy extends TeamGame
Kills,
Assists
);
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
public ArrayList<TeamBomb> getBombs()

View File

@ -56,6 +56,7 @@ import nautilus.game.arcade.game.TeamGame;
import nautilus.game.arcade.game.games.sheep.kits.KitArcher;
import nautilus.game.arcade.game.games.sheep.kits.KitBeserker;
import nautilus.game.arcade.game.games.sheep.kits.KitBrute;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
import nautilus.game.arcade.stats.SheepDropStatTracker;
@ -182,6 +183,12 @@ public class SheepGame extends TeamGame
this.TeamArmor = true;
this.TeamArmorHotbar = true;
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
@Override

View File

@ -218,7 +218,9 @@ public abstract class Skyfall extends Game
SoupEnabled = true;
StrictAntiHack = false;
new CompassModule().register(this);
new CompassModule()
.setGiveCompassToAlive(true)
.register(this);
SpeedMeasurement = true;

View File

@ -169,7 +169,9 @@ public abstract class Skywars extends Game
HideTeamSheep = true;
new CompassModule().register(this);
new CompassModule()
.setGiveCompassToAlive(true)
.register(this);
StrictAntiHack = true;

View File

@ -125,7 +125,9 @@ public abstract class SuperSmash extends Game
WorldWaterDamage = 1000;
HideTeamSheep = true;
ReplaceTeamsWithKits = true;
new CompassModule().register(this);
new CompassModule()
.setGiveCompassToAlive(true)
.register(this);
}
@EventHandler(priority = EventPriority.HIGH)

View File

@ -53,6 +53,7 @@ import nautilus.game.arcade.game.games.snake.events.TailGrowEvent;
import nautilus.game.arcade.game.games.snake.kits.KitInvulnerable;
import nautilus.game.arcade.game.games.snake.kits.KitReverser;
import nautilus.game.arcade.game.games.snake.kits.KitSpeed;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
import nautilus.game.arcade.stats.ChooChooStatTracker;
@ -114,6 +115,12 @@ public class Snake extends SoloGame
BlankLine,
new ChatStatData("kit", "Kit", true)
);
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
@EventHandler

View File

@ -82,6 +82,7 @@ public class SneakyAssassins extends SoloGame
this.HungerSet = 20;
new CompassModule()
.setGiveCompassToAlive(true)
.setGiveCompass(false)
.register(this);

View File

@ -87,6 +87,7 @@ public class SnowFight extends TeamGame
this.HungerSet = 20;
new CompassModule()
.setGiveCompassToAlive(true)
.setGiveCompass(false)
.register(this);

View File

@ -42,6 +42,7 @@ import nautilus.game.arcade.game.games.speedbuilders.stattrackers.DependableTrac
import nautilus.game.arcade.game.games.speedbuilders.stattrackers.FirstBuildTracker;
import nautilus.game.arcade.game.games.speedbuilders.stattrackers.PerfectionistTracker;
import nautilus.game.arcade.game.games.speedbuilders.stattrackers.SpeediestBuilderizerTracker;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
import nautilus.game.arcade.stats.BlockPlaceStatTracker;
@ -194,6 +195,12 @@ public class SpeedBuilders extends SoloGame
new ChatStatData("BlocksPlaced", "Blocks Placed", true),
new ChatStatData("BlocksBroken", "Blocks Broken", true)
);
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
@EventHandler

View File

@ -31,6 +31,7 @@ import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.game.SoloGame;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
import nautilus.game.arcade.stats.SpleefBlockDestroyStatTracker;
@ -72,6 +73,12 @@ public class Spleef extends SoloGame
BlankLine,
new ChatStatData("kit", "Kit", true)
);
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
@EventHandler

View File

@ -47,7 +47,9 @@ public class SquidShooter extends SoloGame
this.DamageSelf = false;
this.DamageTeamSelf = true;
this.PrepareFreeze = false;
new CompassModule().register(this);
new CompassModule()
.setGiveCompassToAlive(true)
.register(this);
this.KitRegisterState = GameState.Prepare;
registerChatStats();

View File

@ -32,6 +32,7 @@ import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.game.SoloGame;
import nautilus.game.arcade.game.games.stacker.kits.*;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
public class Stacker extends SoloGame implements IThrown
@ -56,6 +57,12 @@ public class Stacker extends SoloGame implements IThrown
});
registerChatStats();
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
@EventHandler

View File

@ -124,6 +124,7 @@ import nautilus.game.arcade.game.games.survivalgames.kit.KitHorseman;
import nautilus.game.arcade.game.games.survivalgames.kit.KitKnight;
import nautilus.game.arcade.game.games.survivalgames.kit.KitLooter;
import nautilus.game.arcade.game.games.survivalgames.kit.KitNecromancer;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
public abstract class SurvivalGames extends Game
@ -271,6 +272,12 @@ public abstract class SurvivalGames extends Game
// "chestsOpened");
setupLoot();
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
@EventHandler

View File

@ -35,6 +35,7 @@ import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.game.TeamGame;
import nautilus.game.arcade.game.games.tug.kits.*;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
public class Tug extends TeamGame
@ -73,6 +74,12 @@ public class Tug extends TeamGame
this.DeathSpectateSecs = 20;
registerChatStats();
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
@Override

View File

@ -58,6 +58,7 @@ import nautilus.game.arcade.game.TeamGame;
import nautilus.game.arcade.game.games.turfforts.kits.KitInfiltrator;
import nautilus.game.arcade.game.games.turfforts.kits.KitMarksman;
import nautilus.game.arcade.game.games.turfforts.kits.KitShredder;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
import nautilus.game.arcade.stats.BehindEnemyLinesStatTracker;
@ -169,6 +170,13 @@ public class TurfForts extends TeamGame
new ChatStatData("BlocksPlaced", "Blocks Placed", true),
new ChatStatData("BlocksBroken", "Blocks Broken", true)
);
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
@Override

View File

@ -37,6 +37,7 @@ import nautilus.game.arcade.game.games.typewars.stats.PerfectionistStatTracker;
import nautilus.game.arcade.game.games.typewars.stats.TimeInGameTracker;
import nautilus.game.arcade.game.games.typewars.stats.WaitForItStatTracker;
import nautilus.game.arcade.game.games.typewars.tutorial.TutorialTypeWars;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.gametutorial.events.GameTutorialEndEvent;
import nautilus.game.arcade.gametutorial.events.GameTutorialStartEvent;
import nautilus.game.arcade.kit.Kit;
@ -173,6 +174,12 @@ public class TypeWars extends TeamGame
);
manager.GetCreature().SetDisableCustomDrops(true);
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
@EventHandler

View File

@ -284,7 +284,10 @@ public abstract class UHC extends Game
_freezer = new UHCFreezer(this);
new PlayerHeadModule().register(this);
new CompassModule().setGiveCompass(false).register(this);
new CompassModule()
.setGiveCompassToAlive(true)
.setGiveCompass(false)
.register(this);
new OreVeinEditorModule().removeNonAirVeins().register(this);
new AntiExpOrbModule().register(this);
new RejoinModule().register(this);

View File

@ -31,6 +31,7 @@ import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.SoloGame;
import nautilus.game.arcade.game.games.valentines.kit.KitMasterOfLove;
import nautilus.game.arcade.game.games.valentines.tutorial.TutorialValentines;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
import org.bukkit.EntityEffect;
import org.bukkit.Location;
@ -131,6 +132,12 @@ public class Valentines extends SoloGame
{
e.printStackTrace();
}
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
@Override

View File

@ -64,6 +64,7 @@ import nautilus.game.arcade.game.games.wither.kit.KitHumanArcher;
import nautilus.game.arcade.game.games.wither.kit.KitHumanEditor;
import nautilus.game.arcade.game.games.wither.kit.KitHumanMedic;
import nautilus.game.arcade.game.games.wither.kit.KitWitherMinion;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.NullKit;
import nautilus.game.arcade.kit.perks.data.IBlockRestorer;
@ -157,6 +158,12 @@ public class WitherGame extends TeamGame implements IBlockRestorer
BlankLine,
new ChatStatData("kit", "Kit", true)
);
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
@Override

View File

@ -49,6 +49,7 @@ import nautilus.game.arcade.game.games.wizards.kit.KitWitchDoctor;
import nautilus.game.arcade.game.games.wizards.spellinterfaces.SpellClick;
import nautilus.game.arcade.game.games.wizards.spellinterfaces.SpellClickBlock;
import nautilus.game.arcade.game.games.wizards.spellinterfaces.SpellClickEntity;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
import net.minecraft.server.v1_8_R3.EntityFireball;
@ -295,6 +296,13 @@ public class Wizards extends SoloGame
}
}
};
new CompassModule()
.setGiveCompass(true)
.setGiveCompassToSpecs(true)
.setGiveCompassToAlive(false)
.register(this);
}
@EventHandler

View File

@ -70,7 +70,9 @@ public class ZombieSurvival extends SoloGame
this.DeathOut = false;
this.HungerSet = 20;
new CompassModule().register(this);
new CompassModule()
.setGiveCompassToAlive(true)
.register(this);
registerChatStats(
Kills,

View File

@ -2,7 +2,7 @@ package nautilus.game.arcade.game.modules.compass;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.Comparator;
import java.util.List;
import java.util.function.Supplier;
import java.util.stream.Collectors;
@ -50,6 +50,7 @@ public class CompassModule extends Module
private List<Supplier<Collection<CompassEntry>>> _suppliers = new ArrayList<>();
private CompassMenu _compassMenu;
private boolean _giveCompassToAlive = false;
private boolean _giveCompassItem = true;
private boolean _giveCompassItemToSpectators = true;
@ -59,6 +60,12 @@ public class CompassModule extends Module
return this;
}
public CompassModule setGiveCompassToAlive(boolean b)
{
_giveCompassToAlive = b;
return this;
}
public CompassModule setGiveCompass(boolean b)
{
_giveCompassItem = b;
@ -97,15 +104,21 @@ public class CompassModule extends Module
if (event.getType() != UpdateType.FASTER)
return;
if (!getGame().IsLive())
return;
for (Player player : UtilServer.getPlayers())
{
if (!_giveCompassToAlive && getGame().IsAlive(player))
continue;
GameTeam team = getGame().GetTeam(player);
stream()
.filter(entry -> entry.getEntity() != player)
.filter(entry -> getGame().GetTeamList().size() <= 1 || team == null || !team.equals(entry.getTeam()))
.filter(entry -> !UtilServer.CallEvent(new CompassAttemptTargetEvent(player, entry.getEntity())).isCancelled())
.min((a, b) -> Double.compare(UtilMath.offset(player, a.getEntity()), UtilMath.offset(player, b.getEntity())))
.min(Comparator.comparingDouble(a -> UtilMath.offset(player, a.getEntity())))
.ifPresent(target ->
{
Entity targetEntity = target.getEntity();
@ -156,12 +169,7 @@ public class CompassModule extends Module
@EventHandler
public void DeathRemove(PlayerDeathEvent event)
{
for (Iterator<ItemStack> it = event.getDrops().iterator(); it.hasNext(); )
{
ItemStack item = it.next();
if (isCompassItem(item))
it.remove();
}
event.getDrops().removeIf(this::isCompassItem);
}
@EventHandler