- Reverting back to banners

This commit is contained in:
AlexTheCoder 2015-11-08 01:01:18 -05:00
parent fafc92606c
commit fb7fcccf24
2 changed files with 28 additions and 10 deletions

View File

@ -49,6 +49,7 @@ import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.block.BlockPhysicsEvent;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.event.entity.ItemDespawnEvent;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
@ -768,4 +769,12 @@ public class CaptureTheFlag extends TeamGame
}
}
}
@EventHandler
public void debug(BlockPlaceEvent event)
{
Bukkit.broadcastMessage(event.getBlock().toString());
Bukkit.broadcastMessage("SPLIT");
Bukkit.broadcastMessage(event.getBlockReplacedState().getRawData() + "");
}
}

View File

@ -20,13 +20,17 @@ import nautilus.game.arcade.game.games.common.CaptureTheFlag;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.DyeColor;
import org.bukkit.FireworkEffect;
import org.bukkit.FireworkEffect.Type;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Banner;
import org.bukkit.block.Block;
import org.bukkit.craftbukkit.v1_8_R3.block.CraftBanner;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.BannerMeta;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
@ -46,6 +50,7 @@ public class Flag
private ChatColor _enemy;
private ItemStack _representation;
private DyeColor _dyeData;
private Player _holding = null;
@ -69,16 +74,19 @@ public class Flag
ItemStack i;
if (team.GetColor() == ChatColor.RED)
{
i = new ItemStack(Material.REDSTONE_BLOCK);
i = new ItemStack(Material.BANNER);
_dyeData = DyeColor.RED;
_enemy = ChatColor.BLUE;
}
else
{
i = new ItemStack(Material.LAPIS_BLOCK);
i = new ItemStack(Material.BANNER);
_dyeData = DyeColor.BLUE;
_enemy = ChatColor.RED;
}
ItemMeta im = i.getItemMeta();
BannerMeta im = (BannerMeta) i.getItemMeta();
im.setBaseColor(_dyeData);
im.setDisplayName(_displayName);
i.setItemMeta(im);
@ -226,8 +234,7 @@ public class Flag
{
_flagBlocks = new Block[]
{
loc.getBlock(),
loc.clone().add(0, 1, 0).getBlock()
loc.getBlock()
};
for (Block block : _flagBlocks)
@ -237,19 +244,21 @@ public class Flag
_priorBlocks = new Material[]
{
loc.getBlock().getType(),
loc.clone().add(0, 1, 0).getBlock().getType()
loc.getBlock().getType()
};
_priorData = new Byte[]
{
loc.getBlock().getData(),
loc.clone().add(0, 1, 0).getBlock().getData()
loc.getBlock().getData()
};
for (Block block : _flagBlocks)
{
block.setType(_representation.getType());
block.setType(Material.STANDING_BANNER);
block.setData((byte) 0);
//Banner banner = (Banner) block.getState();
//banner.setBaseColor(_dyeData);
//banner.update();
}
if (!_moved)