Merge remote-tracking branch 'remotes/origin/master' into virizion_speed_builder

This commit is contained in:
Virizion 2015-11-30 18:50:21 -05:00
commit ae8a10d55d
5 changed files with 493 additions and 29 deletions

View File

@ -843,4 +843,398 @@ public class UtilBlock
return blocks;
}
public static ItemStack blockToInventoryItemStack(Block block)
{
ItemStack itemStack = new ItemStack(block.getType(), 1, block.getData());
switch (block.getType())
{
case SAPLING:
itemStack.setDurability((short) 0);
break;
case WATER:
itemStack.setType(Material.WATER_BUCKET);
itemStack.setDurability((short) 0);
break;
case STATIONARY_WATER:
itemStack.setType(Material.WATER_BUCKET);
itemStack.setDurability((short) 0);
break;
case LAVA:
itemStack.setType(Material.LAVA_BUCKET);
itemStack.setDurability((short) 0);
break;
case STATIONARY_LAVA:
itemStack.setType(Material.LAVA_BUCKET);
itemStack.setDurability((short) 0);
break;
case LOG:
itemStack.setDurability((short) (itemStack.getDurability() % 4));
break;
case LEAVES:
itemStack.setDurability((short) (itemStack.getDurability() % 4));
break;
case DISPENSER:
itemStack.setDurability((short) 0);
break;
case BED_BLOCK:
itemStack.setType(Material.BED);
itemStack.setDurability((short) 0);
break;
case POWERED_RAIL:
itemStack.setDurability((short) 0);
break;
case DETECTOR_RAIL:
itemStack.setDurability((short) 0);
break;
case PISTON_STICKY_BASE:
itemStack.setDurability((short) 0);
break;
case PISTON_BASE:
itemStack.setDurability((short) 0);
break;
case PISTON_EXTENSION:
itemStack.setType(Material.AIR);
itemStack.setDurability((short) 0);
break;
case PISTON_MOVING_PIECE:
itemStack.setType(Material.AIR);
itemStack.setDurability((short) 0);
break;
case DOUBLE_STEP:
itemStack.setType(Material.STEP);
itemStack.setAmount(2);
break;
case STEP:
itemStack.setDurability((short) (itemStack.getDurability() % 8));
break;
case TORCH:
itemStack.setDurability((short) 0);
break;
case FIRE:
itemStack.setType(Material.FIREBALL);
itemStack.setDurability((short) 0);
break;
case WOOD_STAIRS:
itemStack.setDurability((short) 0);
break;
case CHEST:
itemStack.setDurability((short) 0);
break;
case REDSTONE_WIRE:
itemStack.setType(Material.REDSTONE);
itemStack.setDurability((short) 0);
break;
case CROPS:
itemStack.setType(Material.SEEDS);
itemStack.setDurability((short) 0);
break;
case SOIL:
itemStack.setType(Material.DIRT);
itemStack.setDurability((short) 0);
break;
case FURNACE:
itemStack.setDurability((short) 0);
break;
case BURNING_FURNACE:
itemStack.setType(Material.FURNACE);
itemStack.setDurability((short) 0);
break;
case SIGN_POST:
itemStack.setType(Material.SIGN);
itemStack.setDurability((short) 0);
break;
case WOODEN_DOOR:
itemStack.setType(Material.WOOD_DOOR);
itemStack.setDurability((short) 0);
break;
case LADDER:
itemStack.setDurability((short) 0);
break;
case RAILS:
itemStack.setDurability((short) 0);
break;
case COBBLESTONE_STAIRS:
itemStack.setDurability((short) 0);
break;
case WALL_SIGN:
itemStack.setType(Material.SIGN);
itemStack.setDurability((short) 0);
break;
case LEVER:
itemStack.setDurability((short) 0);
break;
case STONE_PLATE:
itemStack.setDurability((short) 0);
break;
case IRON_DOOR_BLOCK:
itemStack.setType(Material.IRON_DOOR);
itemStack.setDurability((short) 0);
break;
case WOOD_PLATE:
itemStack.setDurability((short) 0);
break;
case GLOWING_REDSTONE_ORE:
itemStack.setType(Material.REDSTONE_ORE);
break;
case REDSTONE_TORCH_OFF:
itemStack.setType(Material.REDSTONE_TORCH_ON);
itemStack.setDurability((short) 0);
break;
case REDSTONE_TORCH_ON:
itemStack.setDurability((short) 0);
break;
case STONE_BUTTON:
itemStack.setDurability((short) 0);
break;
case SNOW:
itemStack.setAmount(1 + itemStack.getDurability());
itemStack.setDurability((short) 0);
break;
case CACTUS:
itemStack.setDurability((short) 0);
break;
case SUGAR_CANE_BLOCK:
itemStack.setType(Material.SUGAR_CANE);
itemStack.setDurability((short) 0);
break;
case JUKEBOX:
itemStack.setDurability((short) 0);
break;
case PORTAL:
itemStack.setType(Material.AIR);
itemStack.setDurability((short) 0);
break;
case CAKE_BLOCK:
itemStack.setType(Material.CAKE);
itemStack.setDurability((short) 0);
break;
case DIODE_BLOCK_OFF:
itemStack.setType(Material.DIODE);
itemStack.setDurability((short) 0);
break;
case DIODE_BLOCK_ON:
itemStack.setType(Material.DIODE);
itemStack.setDurability((short) 0);
break;
case TRAP_DOOR:
itemStack.setDurability((short) 0);
break;
case HUGE_MUSHROOM_1:
itemStack.setDurability((short) 0);
break;
case HUGE_MUSHROOM_2:
itemStack.setDurability((short) 0);
break;
case PUMPKIN_STEM:
itemStack.setType(Material.PUMPKIN_SEEDS);
itemStack.setDurability((short) 0);
break;
case MELON_STEM:
itemStack.setType(Material.MELON_SEEDS);
itemStack.setDurability((short) 0);
break;
case VINE:
itemStack.setDurability((short) 0);
break;
case FENCE_GATE:
itemStack.setDurability((short) 0);
break;
case BRICK_STAIRS:
itemStack.setDurability((short) 0);
break;
case SMOOTH_STAIRS:
itemStack.setDurability((short) 0);
break;
case NETHER_BRICK_STAIRS:
itemStack.setDurability((short) 0);
break;
case NETHER_WARTS:
itemStack.setType(Material.NETHER_STALK);
itemStack.setDurability((short) 0);
break;
case BREWING_STAND:
itemStack.setType(Material.BREWING_STAND_ITEM);
itemStack.setDurability((short) 0);
break;
case CAULDRON:
itemStack.setType(Material.CAULDRON_ITEM);
itemStack.setDurability((short) 0);
break;
case ENDER_PORTAL:
itemStack.setType(Material.AIR);
itemStack.setDurability((short) 0);
break;
case ENDER_PORTAL_FRAME:
itemStack.setDurability((short) 0);
break;
case REDSTONE_LAMP_ON:
itemStack.setType(Material.REDSTONE_LAMP_OFF);
break;
case WOOD_DOUBLE_STEP:
itemStack.setType(Material.WOOD_STEP);
itemStack.setAmount(2);
break;
case WOOD_STEP:
itemStack.setDurability((short) (itemStack.getDurability() % 8));
break;
case COCOA:
itemStack.setType(Material.INK_SACK);
itemStack.setDurability((short) 3);
break;
case SANDSTONE_STAIRS:
itemStack.setDurability((short) 0);
break;
case ENDER_CHEST:
itemStack.setDurability((short) 0);
break;
case TRIPWIRE_HOOK:
itemStack.setDurability((short) 0);
break;
case TRIPWIRE:
itemStack.setType(Material.STRING);
itemStack.setDurability((short) 0);
break;
case SPRUCE_WOOD_STAIRS:
itemStack.setDurability((short) 0);
break;
case BIRCH_WOOD_STAIRS:
itemStack.setDurability((short) 0);
break;
case JUNGLE_WOOD_STAIRS:
itemStack.setDurability((short) 0);
break;
case COMMAND:
itemStack.setDurability((short) 0);
break;
case FLOWER_POT:
itemStack.setType(Material.FLOWER_POT_ITEM);
itemStack.setDurability((short) 0);
break;
case CARROT:
itemStack.setType(Material.CARROT_ITEM);
itemStack.setDurability((short) 0);
break;
case POTATO:
itemStack.setType(Material.POTATO_ITEM);
itemStack.setDurability((short) 0);
break;
case WOOD_BUTTON:
itemStack.setDurability((short) 0);
break;
case SKULL:
itemStack.setType(Material.SKULL_ITEM);
break;
case TRAPPED_CHEST:
itemStack.setDurability((short) 0);
break;
case GOLD_PLATE:
itemStack.setDurability((short) 0);
break;
case IRON_PLATE:
itemStack.setDurability((short) 0);
break;
case REDSTONE_COMPARATOR_OFF:
itemStack.setType(Material.REDSTONE_COMPARATOR);
itemStack.setDurability((short) 0);
break;
case REDSTONE_COMPARATOR_ON:
itemStack.setType(Material.REDSTONE_COMPARATOR);
itemStack.setDurability((short) 0);
break;
case DAYLIGHT_DETECTOR:
itemStack.setDurability((short) 0);
break;
case HOPPER:
itemStack.setDurability((short) 0);
break;
case QUARTZ_STAIRS:
itemStack.setDurability((short) 0);
break;
case ACTIVATOR_RAIL:
itemStack.setDurability((short) 0);
break;
case DROPPER:
itemStack.setDurability((short) 0);
break;
case LEAVES_2:
itemStack.setDurability((short) (itemStack.getDurability() % 4));
break;
case LOG_2:
itemStack.setDurability((short) (itemStack.getDurability() % 4));
break;
case ACACIA_STAIRS:
itemStack.setDurability((short) 0);
break;
case DARK_OAK_STAIRS:
itemStack.setDurability((short) 0);
break;
case IRON_TRAPDOOR:
itemStack.setDurability((short) 0);
break;
case HAY_BLOCK:
itemStack.setDurability((short) 0);
break;
case STANDING_BANNER:
itemStack.setType(Material.BANNER);
itemStack.setDurability((short) 0);
break;
case WALL_BANNER:
itemStack.setType(Material.BANNER);
itemStack.setDurability((short) 0);
break;
case DAYLIGHT_DETECTOR_INVERTED:
itemStack.setType(Material.DAYLIGHT_DETECTOR);
itemStack.setDurability((short) 0);
break;
case RED_SANDSTONE_STAIRS:
itemStack.setDurability((short) 0);
break;
case DOUBLE_STONE_SLAB2:
itemStack.setType(Material.STONE_SLAB2);
itemStack.setAmount(2);
break;
case STONE_SLAB2:
itemStack.setDurability((short) (itemStack.getDurability() % 8));
break;
case SPRUCE_FENCE_GATE:
itemStack.setDurability((short) 0);
break;
case BIRCH_FENCE_GATE:
itemStack.setDurability((short) 0);
break;
case JUNGLE_FENCE_GATE:
itemStack.setDurability((short) 0);
break;
case DARK_OAK_FENCE_GATE:
itemStack.setDurability((short) 0);
break;
case ACACIA_FENCE_GATE:
itemStack.setDurability((short) 0);
break;
case SPRUCE_DOOR:
itemStack.setType(Material.SPRUCE_DOOR_ITEM);
itemStack.setDurability((short) 0);
break;
case BIRCH_DOOR:
itemStack.setType(Material.BIRCH_DOOR_ITEM);
itemStack.setDurability((short) 0);
break;
case JUNGLE_DOOR:
itemStack.setType(Material.JUNGLE_DOOR_ITEM);
itemStack.setDurability((short) 0);
break;
case ACACIA_DOOR:
itemStack.setType(Material.ACACIA_DOOR_ITEM);
itemStack.setDurability((short) 0);
break;
case DARK_OAK_DOOR:
itemStack.setType(Material.DARK_OAK_DOOR_ITEM);
itemStack.setDurability((short) 0);
break;
}
return itemStack;
}
}

View File

@ -49,7 +49,7 @@ import net.minecraft.server.v1_8_R3.MinecraftServer;
public class Clans extends JavaPlugin
{
public static final String VERSION = "0.14";
public static final String VERSION = "0.16";
private String WEB_CONFIG = "webServer";
// Modules

View File

@ -86,7 +86,8 @@ public class ItemMapRenderer extends MapRenderer
{
boolean colorAll = scale > 0;
Color clanColor = null;
Color clanColor2 = null;
if (owningClan == clan)
{
clanColor = Color.CYAN;
@ -94,18 +95,33 @@ public class ItemMapRenderer extends MapRenderer
else
{
ClansUtility.ClanRelation relation = _manager.getClansUtility().rel(clan, owningClan);
if (owningClan.isAdmin())
{
colorAll = false;
if (owningClan.getName().equals("Shops") || owningClan.getName().equals("Spawn"))
if (owningClan.getName().equals("Shops"))
{
clanColor = Color.WHITE;
clanColor2 = new Color(50, 150, 255);
if (_manager.getClansUtility().relPT(player, chunk) == ClansUtility.ClanRelation.SAFE)
clanColor2 = new Color(50, 150, 255);
}
else if (owningClan.getName().equals("Spawn"))
{
clanColor = Color.WHITE;
clanColor2 = new Color(0, 255, 100);
}
else if (owningClan.getName().equals("Fields"))
{
clanColor = Color.WHITE;
clanColor2 = new Color(255, 120, 0);
}
else
{
clanColor = Color.GRAY;
clanColor = Color.WHITE;
clanColor2 = Color.GRAY;
}
}
else if (relation == ClansUtility.ClanRelation.WAR_LOSING)
@ -138,44 +154,68 @@ public class ItemMapRenderer extends MapRenderer
int chunkX1 = (int) Math.floor(blockX / 16D);
int chunkZ1 = (int) Math.floor(blockZ / 16D);
//Border
if (colorAll ||
((chunkBX == 0 || zoom == 13) &&
owningClan != _manager.getClansUtility().getOwner("world," + (chunkX1 - 1) + "," + chunkZ1))
|| ((chunkBZ == 0 || zoom == 13) &&
owningClan != _manager.getClansUtility().getOwner("world," + chunkX1 + "," + (chunkZ1 - 1)))
|| ((chunkBX + zoom > 15 || zoom == 13) &&
owningClan != _manager.getClansUtility().getOwner("world," + (chunkX1 + 1) + "," + chunkZ1))
|| ((chunkBZ + zoom > 15 || zoom == 13) &&
owningClan != _manager.getClansUtility().getOwner("world," + chunkX1 + "," + (chunkZ1 + 1))))
((chunkBX == 0 || zoom == 13) &&
owningClan != _manager.getClansUtility().getOwner("world," + (chunkX1 - 1) + "," + chunkZ1))
|| ((chunkBZ == 0 || zoom == 13) &&
owningClan != _manager.getClansUtility().getOwner("world," + chunkX1 + "," + (chunkZ1 - 1)))
|| ((chunkBX + zoom > 15 || zoom == 13) &&
owningClan != _manager.getClansUtility().getOwner("world," + (chunkX1 + 1) + "," + chunkZ1))
|| ((chunkBZ + zoom > 15 || zoom == 13) &&
owningClan != _manager.getClansUtility().getOwner("world," + chunkX1 + "," + (chunkZ1 + 1))))
{
Color cColor = MapPalette.getColor(color);
double clans = colorAll ? 1 : 0.8;// 0.65;
//Use clanColor2 no matter what for admins
Color drawColor = clanColor;
if (owningClan.isAdmin() && clanColor2 != null)
{
drawColor = clanColor2;
clans = 1;
}
double base = 1 - clans;
int r = (int) ((cColor.getRed() * base) + (clanColor.getRed() * clans));
int b = (int) ((cColor.getBlue() * base) + (clanColor.getBlue() * clans));
int g = (int) ((cColor.getGreen() * base) + (clanColor.getGreen() * clans));
int r = (int) ((cColor.getRed() * base) + (drawColor.getRed() * clans));
int b = (int) ((cColor.getBlue() * base) + (drawColor.getBlue() * clans));
int g = (int) ((cColor.getGreen() * base) + (drawColor.getGreen() * clans));
color = MapPalette.matchColor(r, g, b);
}
//Inside
else
{
Color cColor = MapPalette.getColor(color);
double clans = 0.65;// 0.4;
double clans = 0.065;
//Stripes
boolean checker = (mapX + (mapZ % 4)) % 4 == 0;
Color drawColor = clanColor;
if (checker && owningClan.isAdmin() && clanColor2 != null)
{
drawColor = clanColor2;
clans = 1;
}
double base = 1 - clans;
int r = (int) ((cColor.getRed() * base) + (clanColor.getRed() * clans));
int b = (int) ((cColor.getBlue() * base) + (clanColor.getBlue() * clans));
int g = (int) ((cColor.getGreen() * base) + (clanColor.getGreen() * clans));
int r = (int) ((cColor.getRed() * base) + (drawColor.getRed() * clans));
int b = (int) ((cColor.getBlue() * base) + (drawColor.getBlue() * clans));
int g = (int) ((cColor.getGreen() * base) + (drawColor.getGreen() * clans));
color = MapPalette.matchColor(r, g, b);
}

View File

@ -197,6 +197,30 @@ public class MarkedForDeath extends SkillActive
if (arrow.isDead() || !arrow.isValid() || arrow.isOnGround())
arrowIterator.remove();
}
for (Iterator<Player> activeIterator = _active.iterator(); activeIterator.hasNext();)
{
Player player = activeIterator.next();
if (!player.isOnline())
activeIterator.remove();
}
for (Iterator<LivingEntity> markedTimeIterator = _markedTime.keySet().iterator(); markedTimeIterator.hasNext();)
{
LivingEntity markedTime = markedTimeIterator.next();
if (markedTime.isDead() || !markedTime.isValid())
markedTimeIterator.remove();
}
for (Iterator<LivingEntity> markedDamageIterator = _markedDamage.keySet().iterator(); markedDamageIterator.hasNext();)
{
LivingEntity markedDamage = markedDamageIterator.next();
if (markedDamage.isDead() || !markedDamage.isValid())
markedDamageIterator.remove();
}
}
@Override

View File

@ -66,6 +66,7 @@ import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.event.player.PlayerPickupItemEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.potion.PotionEffect;
import org.bukkit.util.Vector;
public class GameFlagManager implements Listener
@ -676,6 +677,11 @@ public class GameFlagManager implements Listener
final Player player = event.getEntity();
//Remove all conditions
Manager.GetCondition().EndCondition(player, null, null);
for (PotionEffect potion : player.getActivePotionEffects())
player.removePotionEffect(potion.getType());
//Visual
Manager.GetCondition().Factory().Blind("Ghost", player, player, 2.5, 0, false, false, false);