This commit is contained in:
NewGarbo 2015-11-26 02:49:01 +00:00
parent a19ade0739
commit 7e23f896ca
8 changed files with 49 additions and 11 deletions

View File

@ -1,5 +1,8 @@
package mineplex.game.clans.clans; package mineplex.game.clans.clans;
import java.util.Arrays;
import java.util.List;
/** /**
* ClansBlacklist represents the blacklist of all disallowed names for clan creation. * ClansBlacklist represents the blacklist of all disallowed names for clan creation.
* @author MrTwiggy * @author MrTwiggy
@ -9,7 +12,7 @@ public class ClansBlacklist
{ {
// Set of all blacklisted clan names that are NOT valid. // Set of all blacklisted clan names that are NOT valid.
private final static String[] BLACKLISTED_NAMES = new String[] private final static List<String> BLACKLISTED_NAMES = Arrays.asList(new String[]
{ {
"Youtube", "Owner", "Admin", "Mod", "Trainee", "Twitch", "Youtube", "Owner", "Admin", "Mod", "Trainee", "Twitch",
"Wilderness", "Shops", "Builder", "Spawn", "Clan", "Clans", "Wilderness", "Shops", "Builder", "Spawn", "Clan", "Clans",
@ -17,7 +20,7 @@ public class ClansBlacklist
"join", "leave", "map", "cc", "ac", "invite", "kick", "neutral", "join", "leave", "map", "cc", "ac", "invite", "kick", "neutral",
"enemy", "trust", "unclaim", "claim", "delete", "SrMod", "Twitch", "YouTube", "Event", "enemy", "trust", "unclaim", "claim", "delete", "SrMod", "Twitch", "YouTube", "Event",
"Media", "MapLead", "JrDev", "Developer", "Leader", "LT", "Support" "Media", "MapLead", "JrDev", "Developer", "Leader", "LT", "Support"
}; });
/** /**
* @param clanName - the name of the clan to validate * @param clanName - the name of the clan to validate
@ -35,4 +38,8 @@ public class ClansBlacklist
return true; return true;
} }
public static void addBlacklist(String blacklist) {
BLACKLISTED_NAMES.add(blacklist);
}
} }

View File

@ -608,7 +608,13 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
else else
{ {
String rank = _clientManager.Get(event.getPlayer()).GetRank().getTag(true, false); String rank = _clientManager.Get(event.getPlayer()).GetRank().getTag(true, false);
if (rank.length() > 0) rank += " ";
if (rank.length() > 0)
rank += " ";
if (!_clientManager.Get(event.getPlayer()).GetRank().has(Rank.MEDIA))
rank = "";
String message = event.getMessage(); String message = event.getMessage();
message = _chat.getFilteredMessage(event.getPlayer(), message); message = _chat.getFilteredMessage(event.getPlayer(), message);
ClanRelation rel = _clanUtility.rel(clan, otherClan); ClanRelation rel = _clanUtility.rel(clan, otherClan);
@ -618,7 +624,17 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
} }
} }
System.out.println((clan == null ? "" : clan.getName()) + " " + _clientManager.Get(event.getPlayer()).GetRank().getTag(true, false) + " " + event.getPlayer().getName() + " " + event.getMessage()); System.out.println((clan == null ? "" : clan.getName()) + " " + _clientManager.Get(event.getPlayer()).GetRank().name() + " " + event.getPlayer().getName() + " " + event.getMessage());
}
@EventHandler
public void command(PlayerCommandPreprocessEvent event){
if (event.getMessage().startsWith("/blacklist ")){
String blacklist = event.getMessage().split(" ")[1];
ClansBlacklist.addBlacklist(blacklist);
}
} }
public void messageClan(ClanInfo clan, String message) public void messageClan(ClanInfo clan, String message)

View File

@ -40,7 +40,7 @@ public abstract class ReductionAttribute extends ItemAttribute
} }
else else
{ {
System.out.println("Armor doesn't reduce " + cause); // System.out.println("Armor doesn't reduce " + cause);
} }
} }

View File

@ -20,7 +20,7 @@ public class AlligatorsTooth extends LegendaryItem
private static ValueDistribution boostGen = generateDistribution(0.8d, 1.4d); private static ValueDistribution boostGen = generateDistribution(0.8d, 1.4d);
private double _landDamageBonus = 7; private double _landDamageBonus = 7;
private double _waterDamageBonus = 10; private double _waterDamageBonus = 11;
private double _swimSpeed; private double _swimSpeed;
private int _soundUpdateCounter; private int _soundUpdateCounter;

View File

@ -46,11 +46,11 @@ public class GiantsBroadsword extends LegendaryItem
return; return;
} }
double bonusDamage = 2.0d; // Too much? event.AddMod("Giants Bonus", 9);
event.AddMod("Giants Bonus", bonusDamage);
event.AddKnockback("Giants Sword", 0.5d); event.AddKnockback("Giants Sword", 0.5d);
} }
private void buffPlayer(Player player) private void buffPlayer(Player player)
{ {
grantPotionEffect(player, PotionEffectType.SLOW, 10, 10); grantPotionEffect(player, PotionEffectType.SLOW, 10, 10);

View File

@ -1,4 +1,4 @@
package mineplex.game.clans.items.legendaries; package mineplex.game.clans.items.legendaries;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -10,7 +10,7 @@ import mineplex.minecraft.game.core.damage.CustomDamageEvent;
public class HyperAxe extends LegendaryItem public class HyperAxe extends LegendaryItem
{ {
public static final long ATTACK_RATE_DURATION = 100; public static final long ATTACK_RATE_DURATION = 200;
private static ValueDistribution amountGen = generateDistribution(0, 3); // [1, 4] speed amount private static ValueDistribution amountGen = generateDistribution(0, 3); // [1, 4] speed amount
private static ValueDistribution durationGen = generateDistribution(80, 320); // [4, 16] seconds speed duration private static ValueDistribution durationGen = generateDistribution(80, 320); // [4, 16] seconds speed duration
@ -34,6 +34,7 @@ public class HyperAxe extends LegendaryItem
if (isHoldingRightClick() && canBuff()) if (isHoldingRightClick() && canBuff())
{ {
buffPlayer(wielder); buffPlayer(wielder);
_lastAttack = System.currentTimeMillis();
} }
} }
@ -43,7 +44,13 @@ public class HyperAxe extends LegendaryItem
if (timeSinceLastAttack() >= ATTACK_RATE_DURATION) if (timeSinceLastAttack() >= ATTACK_RATE_DURATION)
{ {
event.SetIgnoreRate(true); event.SetIgnoreRate(true);
log("Ignoring rate!"); // log("Ignoring rate!");
event.AddMod("Hyper Axe", 4);
}
else
{
event.SetCancelled("Hyper Axe Cooldown");
} }
} }

View File

@ -32,6 +32,7 @@ public class MagneticMaul extends LegendaryItem
public void onAttack(CustomDamageEvent event, Player wielder) public void onAttack(CustomDamageEvent event, Player wielder)
{ {
event.AddKnockback("Magnetic Blade", -0.5d); // Pull players with negative knockback event.AddKnockback("Magnetic Blade", -0.5d); // Pull players with negative knockback
event.AddMod("Magnetic Maul", 7);
log("Negative knockback!"); log("Negative knockback!");
// TODO: Apply negative knockback with [???] velocity/power to victims of attacks // TODO: Apply negative knockback with [???] velocity/power to victims of attacks
} }

View File

@ -17,6 +17,7 @@ import mineplex.core.common.util.UtilTextBottom;
import mineplex.core.common.util.UtilTextMiddle; import mineplex.core.common.util.UtilTextMiddle;
import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilTime;
import mineplex.core.recharge.Recharge; import mineplex.core.recharge.Recharge;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
public class WindBlade extends LegendaryItem public class WindBlade extends LegendaryItem
{ {
@ -112,6 +113,12 @@ public class WindBlade extends LegendaryItem
UtilTextBottom.displayProgress(UtilMath.clamp(_power, .0, 80.) / 80., wielder); UtilTextBottom.displayProgress(UtilMath.clamp(_power, .0, 80.) / 80., wielder);
} }
@Override
public void onAttack(CustomDamageEvent event, Player wielder)
{
event.AddMod("Wind Blade", 7);
}
private void propelPlayer(Player player) private void propelPlayer(Player player)
{ {
Vector direction = player.getLocation().getDirection().normalize(); Vector direction = player.getLocation().getDirection().normalize();