Update craftbukkit, add new vegetate head, fix maze, fix SG and UHC borders, fix gust, modify kits to use new vegetate

This commit is contained in:
libraryaddict 2015-10-30 15:44:37 +13:00
parent 7fca42b0e0
commit 388aa1611c
9 changed files with 47 additions and 30 deletions

Binary file not shown.

View File

@ -122,6 +122,11 @@ public class UtilEnt
} }
public static void Vegetate(Entity entity, boolean mute) public static void Vegetate(Entity entity, boolean mute)
{
Vegetate(entity, mute, false);
}
public static void Vegetate(Entity entity, boolean mute, boolean vegetateHead)
{ {
try try
{ {
@ -169,6 +174,8 @@ public class UtilEnt
creature.setVegetated(true); creature.setVegetated(true);
creature.setSilent(mute); creature.setSilent(mute);
creature.getControllerLook().vegetateHead(vegetateHead);
((List)_pathfinderBList.get(((PathfinderGoalSelector)_goalSelector.get(creature)))).clear(); ((List)_pathfinderBList.get(((PathfinderGoalSelector)_goalSelector.get(creature)))).clear();
((List)_pathfinderCList.get(((PathfinderGoalSelector)_goalSelector.get(creature)))).clear(); ((List)_pathfinderCList.get(((PathfinderGoalSelector)_goalSelector.get(creature)))).clear();

View File

@ -428,16 +428,9 @@ public class Maze implements Listener
{ {
data.getValue().Direction = CardinalDirection.WEST; data.getValue().Direction = CardinalDirection.WEST;
} }
UtilEnt.CreatureMove(data.getKey(), data.getValue().Target, 1.4f);
} }
//Timeout Move UtilEnt.CreatureMoveFast(data.getKey(), data.getValue().Target, 1.4f);
if (UtilMath.offset(data.getKey().getLocation(), data.getValue().Last) > 0.1)
data.getValue().Time = System.currentTimeMillis();
if (UtilTime.elapsed(data.getValue().Time, 2000))
UtilEnt.CreatureMove(data.getKey(), data.getValue().Target, 1.4f);
} }
} }

View File

@ -6,14 +6,12 @@ public class MazeMobWaypoint
{ {
public Location Last; public Location Last;
public Location Target; public Location Target;
public long Time;
public CardinalDirection Direction = CardinalDirection.NULL; public CardinalDirection Direction = CardinalDirection.NULL;
public MazeMobWaypoint(Location last) public MazeMobWaypoint(Location last)
{ {
Last = last; Last = last;
Target = null; Target = null;
Time = System.currentTimeMillis();
} }
public enum CardinalDirection public enum CardinalDirection

View File

@ -877,21 +877,28 @@ public abstract class SurvivalGames extends Game
} }
@EventHandler @EventHandler
public void onGameState(PlayerChangedWorldEvent event) public void onGameState(GameStateChangeEvent event)
{ {
if (GetState() == GameState.Prepare || IsLive()) if (GetState() != GameState.Live)
{ {
setupBorder(event.getPlayer()); return;
}
for (Player player : UtilServer.getPlayers())
{
setupBorder(player);
} }
} }
@EventHandler @EventHandler
public void onJoin(PlayerJoinEvent event) public void onJoin(PlayerJoinEvent event)
{ {
if (GetState() == GameState.Prepare || IsLive()) if (!IsLive())
{ {
setupBorder(event.getPlayer()); return;
} }
setupBorder(event.getPlayer());
} }
@EventHandler @EventHandler
@ -1466,6 +1473,7 @@ public abstract class SurvivalGames extends Game
WorldBorder border = new WorldBorder(); WorldBorder border = new WorldBorder();
border.setCenter(_spawn.getX(), _spawn.getZ());
border.transitionSizeBetween(_previousBorder * 2, _currentBorder * 2, border.transitionSizeBetween(_previousBorder * 2, _currentBorder * 2,
_currentBorder != _previousBorder ? 1000 : 0); _currentBorder != _previousBorder ? 1000 : 0);

View File

@ -12,22 +12,25 @@ import org.bukkit.Material;
import org.bukkit.Sound; import org.bukkit.Sound;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.block.BlockFace; import org.bukkit.block.BlockFace;
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftArrow; import org.bukkit.craftbukkit.v1_8_R3.entity.CraftArrow;
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
import org.bukkit.entity.Arrow; import org.bukkit.entity.Arrow;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockEvent; import org.bukkit.event.block.BlockEvent;
import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.entity.EntityShootBowEvent; import org.bukkit.event.entity.EntityShootBowEvent;
import org.bukkit.event.entity.ItemSpawnEvent;
import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.entity.ProjectileHitEvent; import org.bukkit.event.entity.ProjectileHitEvent;
import net.minecraft.server.v1_7_R4.EntityArrow; import net.minecraft.server.v1_8_R3.EntityArrow;
import net.minecraft.server.v1_7_R4.Item; import net.minecraft.server.v1_8_R3.Item;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.MapUtil; import mineplex.core.common.util.MapUtil;

View File

@ -32,6 +32,7 @@ import nautilus.game.arcade.GameType;
import nautilus.game.arcade.events.GameStateChangeEvent; import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.GameTeam; import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.TeamGame; import nautilus.game.arcade.game.TeamGame;
import nautilus.game.arcade.game.Game.GameState;
import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.kit.Kit;
import net.minecraft.server.v1_8_R3.PacketPlayOutWorldBorder; import net.minecraft.server.v1_8_R3.PacketPlayOutWorldBorder;
import net.minecraft.server.v1_8_R3.WorldBorder; import net.minecraft.server.v1_8_R3.WorldBorder;
@ -349,21 +350,28 @@ public class UHC extends TeamGame
} }
@EventHandler @EventHandler
public void onGameState(PlayerChangedWorldEvent event) public void onGameState(GameStateChangeEvent event)
{ {
if (GetState() == GameState.Prepare || IsLive()) if (GetState() != GameState.Live)
{ {
setupBorder(event.getPlayer()); return;
}
for (Player player : UtilServer.getPlayers())
{
setupBorder(player);
} }
} }
@EventHandler @EventHandler
public void onJoin(PlayerJoinEvent event) public void onJoin(PlayerJoinEvent event)
{ {
if (GetState() == GameState.Prepare || IsLive()) if (!IsLive())
{ {
setupBorder(event.getPlayer()); return;
} }
setupBorder(event.getPlayer());
} }
private void setupBorder(Player player) private void setupBorder(Player player)

View File

@ -5,6 +5,7 @@ import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.Map.Entry; import java.util.Map.Entry;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.minecraft.game.core.damage.DamageChange; import mineplex.minecraft.game.core.damage.DamageChange;
import nautilus.game.arcade.game.games.wizards.Spell; import nautilus.game.arcade.game.games.wizards.Spell;
@ -61,7 +62,7 @@ public class SpellGust extends Spell implements SpellClick
Wizards.Manager.GetDamage().GetCombatManager().Get(target).Attacked(player.getName(), 0, player, "Gust", new ArrayList<DamageChange>()); Wizards.Manager.GetDamage().GetCombatManager().Get(target).Attacked(player.getName(), 0, player, "Gust", new ArrayList<DamageChange>());
target.setVelocity(vec); UtilAction.velocity(target, vec);
target.getWorld().playSound(target.getLocation(), Sound.BAT_TAKEOFF, 1, 0.7F); target.getWorld().playSound(target.getLocation(), Sound.BAT_TAKEOFF, 1, 0.7F);
} }

View File

@ -147,8 +147,7 @@ public abstract class Kit implements Listener
skel.setSkeletonType(SkeletonType.WITHER); skel.setSkeletonType(SkeletonType.WITHER);
} }
UtilEnt.Vegetate(entity); UtilEnt.Vegetate(entity, true, true);
UtilEnt.silence(entity, true);
UtilEnt.ghost(entity, true, false); UtilEnt.ghost(entity, true, false);
SpawnCustom(entity); SpawnCustom(entity);