Get emblems to spawn

This commit is contained in:
Sam 2017-08-18 16:51:50 +01:00
parent 01fb5a312f
commit c0ed39d9f9
6 changed files with 23 additions and 18 deletions

View File

@ -6,6 +6,7 @@ import java.util.HashMap;
import java.util.Map;
import org.bukkit.Location;
import org.bukkit.Material;
import mineplex.core.common.block.schematic.Schematic;
import mineplex.core.common.block.schematic.SchematicData;
@ -47,6 +48,19 @@ public class EmblemGadget extends GameModifierGadget
try
{
Schematic schematic = UtilSchematic.loadSchematic(file);
int spongeId = Material.SPONGE.getId();
// Remove all sponge blocks
for (int i = 0; i < schematic.getBlocks().length; i++)
{
short blockId = schematic.getBlocks()[i];
if (blockId == spongeId)
{
schematic.getBlocks()[i] = 0;
}
}
SCHEMATICS.put(file.getName(), schematic);
}
catch (IOException e)
@ -69,7 +83,7 @@ public class EmblemGadget extends GameModifierGadget
C.cGray + "to " + type.getName() + ".",
}, cost, type.getMaterial(), type.getMaterialData());
_schematic = SCHEMATICS.get(type.getSchematic());
_schematic = SCHEMATICS.get(type.getSchematic() + ".schematic");
}
public SchematicData buildAt(Location location, boolean inverse)

View File

@ -7,7 +7,7 @@ import mineplex.core.reward.RewardRarity;
public enum EmblemType
{
TEST("Test", "EmblemTest", Material.WOOD_DOOR, RewardRarity.RARE),
HEART("Heart", "Heart", Material.NAME_TAG, RewardRarity.RARE),
;

View File

@ -53,7 +53,7 @@ public class SkillFloralLeap extends HeroSkill
private static final ItemStack SKILL_ITEM = new ItemStack(Material.FEATHER);
private static final DustSpellColor[] COLOURS = {
new DustSpellColor(Color.RED),
new DustSpellColor(Color.GREEN),
new DustSpellColor(Color.CYAN),
new DustSpellColor(Color.MAGENTA)
};
private static final long DURATION = TimeUnit.SECONDS.toMillis(5);
@ -214,18 +214,9 @@ public class SkillFloralLeap extends HeroSkill
}
private Pair<Material, Byte> getRandomFlower()
{
double random = Math.random();
if (random > 0.6)
{
return Pair.create(Material.LONG_GRASS, (byte) 1);
}
else
{
return Pair.create(Material.RED_ROSE, (byte) (UtilMath.r(8) + 1));
}
}
private class FlowerBedData
{

View File

@ -386,9 +386,9 @@ public class MinionWave implements Listener
if (minion != null)
{
if (event.GetReason() != null && event.GetReason().equals("Tower"))
if (event.GetReason() != null && event.GetReason().contains("Tower"))
{
event.AddMod("Tower Damage", event.GetDamage() / 2D);
event.AddMod("Tower Damage", -event.GetDamage() / 2D);
}
minion.updateDisplay(minion.getEntity().getHealth() - event.GetDamage());

View File

@ -62,10 +62,10 @@ public class MobaMap implements Listener
break;
}
Location location = schematicSpawns.get(index++);
Location location = schematicSpawns.get(index++).add(0, 1, 0);
Vector direction = UtilAlg.getTrajectory(location, _host.GetSpectatorLocation());
gadget.buildAt(location, direction.getZ() < 0);
gadget.buildAt(location, direction.getX() < 0);
}
}
}

View File

@ -194,7 +194,7 @@ public class MobaProgression implements Listener
{
MobaPlayer mobaPlayer = _host.getMobaData(player);
if (mobaPlayer == null)
if (mobaPlayer == null || mobaPlayer.getRole() == null || mobaPlayer.getKit() == null)
{
return;
}