Run Minestrike in Adventure Mode

This commit is contained in:
Nate Mortensen 2016-11-02 14:15:51 -06:00 committed by cnr
parent ee6e6837ac
commit 66eeae2a54
2 changed files with 7 additions and 5 deletions

View File

@ -345,7 +345,7 @@ public class DamageManager extends MiniPlugin
Player damagee = event.GetDamageePlayer();
//Not Survival
if (damagee.getGameMode() != GameMode.SURVIVAL)
if (damagee.getGameMode() != GameMode.SURVIVAL && damagee.getGameMode() != GameMode.ADVENTURE)
{
event.SetCancelled("Damagee in Creative");
return;
@ -373,7 +373,7 @@ public class DamageManager extends MiniPlugin
Player damager = event.GetDamagerPlayer(true);
//Not Survival
if (damager.getGameMode() != GameMode.SURVIVAL)
if (damager.getGameMode() != GameMode.SURVIVAL && damager.getGameMode() != GameMode.ADVENTURE)
{
event.SetCancelled("Damager in Creative");
return;

View File

@ -7,6 +7,7 @@ import java.util.HashSet;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Color;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
@ -248,9 +249,8 @@ public class Minestrike extends TeamGame
GameTeam team = GetTeam(event.getPlayer());
if (team == null)
return;
GadgetManager gadgetManager = Manager.getCosmeticManager().getGadgetManager();
GameModifierMineStrikeSkin knifeSkin = (GameModifierMineStrikeSkin) gadgetManager.getActiveGameModifier(event.getPlayer(),
GadgetManager gadgetManager = Manager.getCosmeticManager().getGadgetManager();
GameModifierMineStrikeSkin knifeSkin = (GameModifierMineStrikeSkin) gadgetManager.getActiveGameModifier(event.getPlayer(),
GameModifierType.MineStrike, GameModifierMineStrikeSkin.getWeaponFilter("Knife"));
Material mat = Material.IRON_AXE;
@ -270,6 +270,7 @@ public class Minestrike extends TeamGame
{
if (IsAlive(event.getPlayer()))
{
event.getPlayer().setGameMode(GameMode.ADVENTURE);
//Pistol
Gun gun = new Gun(GunStats.GLOCK_18, _gunModule);
_gunModule.registerGun(gun, event.getPlayer());
@ -290,6 +291,7 @@ public class Minestrike extends TeamGame
{
if (IsAlive(event.getPlayer()))
{
event.getPlayer().setGameMode(GameMode.ADVENTURE);
//Pistol
Gun gun = new Gun(GunStats.P2000, _gunModule);
_gunModule.registerGun(gun, event.getPlayer());