Merge branch 'master' into dev

Conflicts:
	BankEconomyMod/src/me/kaZep/Base/Main.java
	BankEconomyMod/src/me/kaZep/Base/PlayerListener.java
	BankEconomyMod/src/me/kaZep/Commands/commandBankEconomy.java
dev
sigonasr2 11 years ago
commit 9f4978751b
  1. 132
      BankEconomyMod/src/me/kaZep/Base/Main.java
  2. 10
      BankEconomyMod/src/me/kaZep/Base/PlayerBuffData.java
  3. 104
      BankEconomyMod/src/me/kaZep/Base/PlayerListener.java
  4. 12
      BankEconomyMod/src/me/kaZep/Commands/commandBankEconomy.java

@ -332,7 +332,7 @@ public class Main extends JavaPlugin
nether_star.setIngredient('d', Material.DIAMOND); nether_star.setIngredient('d', Material.DIAMOND);
Bukkit.addRecipe(nether_star); Bukkit.addRecipe(nether_star);
//Add Recipe for water source crafting. //Add Recipe for water source crafting.
ItemStack water = new ItemStack(Material.WATER, 8); ItemStack water = new ItemStack(Material.WATER, 8);
ItemMeta water_name = water.getItemMeta(); ItemMeta water_name = water.getItemMeta();
@ -355,6 +355,56 @@ public class Main extends JavaPlugin
Bukkit.addRecipe(nether_water); Bukkit.addRecipe(nether_water);
//Add Recipe for orb of distortion
ItemStack orb = new ItemStack(Material.SLIME_BALL, 1);
ItemMeta orb_name = orb.getItemMeta();
List<String> orblore = new ArrayList<String>();
orblore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"");
orblore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"This orb distorts space-time");
orblore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"around it, preventing anyone");
orblore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"from teleporting to its carrier.");
orb_name.setLore(orblore);
orb_name.setDisplayName(ChatColor.AQUA+"Orb of Distortion");
orb.setItemMeta(orb_name);
orb.addUnsafeEnchantment(Enchantment.ARROW_DAMAGE, 1);
ShapedRecipe distortion_orb = new ShapedRecipe(orb);
distortion_orb.shape("aaa", "aba", "aaa");
distortion_orb.setIngredient('a', Material.ENDER_PEARL);
distortion_orb.setIngredient('b', Material.ENDER_STONE);
Bukkit.addRecipe(distortion_orb);
//Add Recipe for rose of distortion
ItemStack rose = new ItemStack(Material.RED_ROSE, 1);
ItemMeta rose_name = rose.getItemMeta();
List<String> roselore = new ArrayList<String>();
roselore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"");
roselore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"This flower is infused with");
roselore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"overwhelming magical power,");
roselore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"causing it to never wilt.");
roselore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"");
roselore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"The holder of this flower");
roselore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"will also be resistant to");
roselore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"any "+ChatColor.RESET+"WITHER"+ChatColor.GRAY+""+ChatColor.ITALIC+" effects.");
rose_name.setLore(roselore);
rose_name.setDisplayName(ChatColor.AQUA+"Unwilting Flower");
rose.setItemMeta(rose_name);
rose.addUnsafeEnchantment(Enchantment.ARROW_DAMAGE, 1);
ShapedRecipe witherless_rose = new ShapedRecipe(rose);
witherless_rose.shape(" a ", "aba", " a ");
witherless_rose.setIngredient('a', Material.NETHER_STAR);
witherless_rose.setIngredient('b', Material.RED_ROSE);
Bukkit.addRecipe(witherless_rose);
//Add Recipe for pocket crafting table //Add Recipe for pocket crafting table
ItemStack table = new ItemStack(Material.WORKBENCH); ItemStack table = new ItemStack(Material.WORKBENCH);
ItemMeta table_name = table.getItemMeta(); ItemMeta table_name = table.getItemMeta();
@ -2707,6 +2757,23 @@ public void checkJukeboxes() {
LOGGING_UPDATE_COUNTS=0; LOGGING_UPDATE_COUNTS=0;
for (int i=0;i<SPEED_CONTROL.size();i++) { for (int i=0;i<SPEED_CONTROL.size();i++) {
SPEED_CONTROL.get(i).updatePlayerSpd(); SPEED_CONTROL.get(i).updatePlayerSpd();
try
{
String filename= "PlayerBuffData.txt";
FileWriter fw = new FileWriter(filename,true); //the true will append the new data
fw.write("["+SERVER_TICK_TIME+"]"+"PlayerBuffData for "+SPEED_CONTROL.get(i).p.getName()+": "+SPEED_CONTROL.get(i).toString()+"\n");//appends the string to the file
if (i+1==SPEED_CONTROL.size()) {
fw.write("========\n");
}
fw.close();
}
catch(IOException ioe)
{
System.err.println("IOException: " + ioe.getMessage());
}
}
if (SPEED_CONTROL.size()!=Bukkit.getOnlinePlayers().length) {
Bukkit.getLogger().warning("["+SERVER_TICK_TIME+"]SPEED_CONTROL and ONLINE PLAYERS list length don't match! ("+SPEED_CONTROL.size()+"/"+Bukkit.getOnlinePlayers().length+")");
} }
LOGGING_UPDATE_COUNTS++; //1 LOGGING_UPDATE_COUNTS++; //1
for (int i=0;i<explorers.size();i++) { for (int i=0;i<explorers.size();i++) {
@ -3805,7 +3872,7 @@ public void payDay(int time)
public void gainMoneyExp(Player p,String job,double amount,double exp) { public void gainMoneyExp(Player p,String job,double amount,double exp) {
String[] jobs = getJobs(p); String[] jobs = getJobs(p);
int slot=-1; int slot=-1;
if (getConfig().getBoolean("halloween-enabled")) { if (getConfig().getBoolean("halloween-enabled") || getConfig().getBoolean("thanksgiving-enabled")) {
amount*=2; amount*=2;
exp*=2; exp*=2;
} }
@ -3896,7 +3963,7 @@ public void payDay(int time)
public void gainMoney(Player p,String job,double amount) { public void gainMoney(Player p,String job,double amount) {
String[] jobs = getJobs(p); String[] jobs = getJobs(p);
int slot=-1; int slot=-1;
if (getConfig().getBoolean("halloween-enabled")) { if (getConfig().getBoolean("halloween-enabled") || getConfig().getBoolean("thanksgiving-enabled")) {
amount*=2; amount*=2;
} }
//Add to how much we've earned so far. //Add to how much we've earned so far.
@ -4888,6 +4955,9 @@ public void payDay(int time)
if (chest.getItemMeta().getLore().get(i).equalsIgnoreCase(ChatColor.GRAY+""+ChatColor.ITALIC+"You can feel a variety of")) { if (chest.getItemMeta().getLore().get(i).equalsIgnoreCase(ChatColor.GRAY+""+ChatColor.ITALIC+"You can feel a variety of")) {
return 4; // Multiloot return 4; // Multiloot
} }
if (chest.getItemMeta().getLore().get(i).equalsIgnoreCase(ChatColor.GRAY+""+ChatColor.ITALIC+"A torrential flow of dark")) {
return 5; // Chaos loot
}
} }
@ -4939,9 +5009,23 @@ public void payDay(int time)
chest_name.setLore(chestlore); chest_name.setLore(chestlore);
chest.setItemMeta(chest_name); chest.setItemMeta(chest_name);
} else if (rand < 0.1 || tier == 4) { } else if (rand < 0.04 || tier == 5) {
// Generate a double chest // Generate a chaos chest
chest_name.setDisplayName(ChatColor.YELLOW+"Closed Chest"); chest_name.setDisplayName(ChatColor.RED+"Chaos Chest");
chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"A mysterious chest!");
chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"");
chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"A torrential flow of dark");
chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"energy causes the chest to");
chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"shake uncontrollably! You");
chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"have absolutely zero idea");
chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"what may be inside.");
chest_name.setLore(chestlore);
chest.setItemMeta(chest_name);
} else if (rand < 0.12 || tier == 4) {
// Generate a loaded chest
chest_name.setDisplayName(ChatColor.YELLOW+"Loaded Chest");
chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"A mysterious chest!"); chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"A mysterious chest!");
chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+""); chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"");
@ -5020,6 +5104,42 @@ public void payDay(int time)
return 0; return 0;
} }
} }
public boolean hasDistortionOrb(Player p) {
for (int m=0;m<p.getInventory().getContents().length;m++) {
if (p.getInventory().getContents()[m]!=null && p.getInventory().getContents()[m].getType()==Material.SLIME_BALL) {
// See if lore matches distortion orb
if (p.getInventory().getContents()[m].getItemMeta().getLore()!=null) {
List<String> data = p.getInventory().getContents()[m].getItemMeta().getLore();
for (int i=0;i<data.size();i++) {
if (data.get(i).contains("This orb distorts space-time")) {
return true;
}
}
}
}
}
return false;
}
public int getWitherlessRoseCount(Player p) {
int count = 0;
for (int m=0;m<p.getInventory().getContents().length;m++) {
if (p.getInventory().getContents()[m]!=null && p.getInventory().getContents()[m].getType()==Material.RED_ROSE) {
// See if lore matches distortion orb
if (p.getInventory().getContents()[m].getItemMeta().getLore()!=null) {
List<String> data = p.getInventory().getContents()[m].getItemMeta().getLore();
for (int i=0;i<data.size();i++) {
if (data.get(i).contains("This flower is infused with")) {
count += p.getInventory().getContents()[m].getAmount();
}
}
}
}
}
return count;
}
public void setLv30Choice(Player p, String arg1, String arg2) { public void setLv30Choice(Player p, String arg1, String arg2) {
if (getJobLv(arg1, p)>=30) { if (getJobLv(arg1, p)>=30) {

@ -30,6 +30,16 @@ public class PlayerBuffData {
double money_gained=0; double money_gained=0;
long last_money_report_time=0; long last_money_report_time=0;
public Main plugin; public Main plugin;
public String toString() {
//A method that outputs this class as a string.
return "PlayerBuffData@{p = "+((p!=null)?p.toString():"null")+", base_spdlv = "+base_spdlv+", base_armorlv = "+base_armorlv+", armorbufflist = "+
((armorbufflist!=null)?armorbufflist.toString():"null")+", base_hplv = "+base_hplv+", hpbufflist = "+((hpbufflist!=null)?hpbufflist.toString():"null")+", helmet_durability = "+
helmet_durability+", chestplate_durability = "+chestplate_durability+", leggings_durability = "+leggings_durability+"," +
" boots_durability = "+boots_durability+", potion_spdlv = "+potion_spdlv+", potion_time = "+potion_time+", hpbuff_time = "+
hpbuff_time+", extra_hp = "+extra_hp+", money_gained = "+money_gained+", last_money_report_time = "+last_money_report_time+"," +
"plugin = "+((plugin!=null)?plugin.toString():"null")+"}";
}
public String healthbar(double curHP,double maxHP) { public String healthbar(double curHP,double maxHP) {
//笆<EFBFBD><EFBFBD> //笆<EFBFBD><EFBFBD>

@ -21,6 +21,7 @@ import net.milkbowl.vault.economy.EconomyResponse;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Chunk; import org.bukkit.Chunk;
@ -178,6 +179,8 @@ import org.bukkit.scoreboard.Team;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import org.bukkit.potion.Potion; import org.bukkit.potion.Potion;
import sig.ItemSets.DiabloDropsHook;
import com.google.common.base.Objects; import com.google.common.base.Objects;
import com.modcrafting.diablodrops.DiabloDrops; import com.modcrafting.diablodrops.DiabloDrops;
import com.sk89q.worldedit.CuboidClipboard; import com.sk89q.worldedit.CuboidClipboard;
@ -321,7 +324,7 @@ implements Listener
if (this.plugin.PlayerinJob(p, "Enchanter") && this.plugin.getJobLv("Enchanter", p)>=5) { if (this.plugin.PlayerinJob(p, "Enchanter") && this.plugin.getJobLv("Enchanter", p)>=5) {
e.setAmount(e.getAmount()*2); e.setAmount(e.getAmount()*2);
} }
if (this.plugin.getAccountsConfig().getBoolean("halloween-enabled")) { if (this.plugin.getAccountsConfig().getBoolean("halloween-enabled") || this.plugin.getConfig().getBoolean("thanksgiving-enabled")) {
e.setAmount(e.getAmount()*2); e.setAmount(e.getAmount()*2);
} }
if (this.plugin.getAccountsConfig().getBoolean(p.getName().toLowerCase()+".settings.notify3")) { if (this.plugin.getAccountsConfig().getBoolean(p.getName().toLowerCase()+".settings.notify3")) {
@ -4502,11 +4505,28 @@ implements Listener
if (result.getResult().getType()==Material.MELON_BLOCK) { if (result.getResult().getType()==Material.MELON_BLOCK) {
result.setResult(new ItemStack(Material.AIR)); result.setResult(new ItemStack(Material.AIR));
} }
if (result.getResult().getType()==Material.WOOL && result.getResult().getAmount() == 1) {
//Make sure the crafting matrix only contains three string.
int stringcount=0;
for (int i=0;i<result.getMatrix().length;i++) {
if (result.getMatrix()[i]!=null && result.getMatrix()[i].getType()==Material.STRING) {
stringcount++;
}
}
if (stringcount!=4) {
result.setResult(new ItemStack(Material.AIR));
return;
}
}
// Increase stairs recipe efficiency // Increase stairs recipe efficiency
if (result.getResult().getType()==Material.WOOD_STAIRS) { if (result.getResult().getType()==Material.WOOD_STAIRS) {
result.setResult(new ItemStack(Material.WOOD_STAIRS, 8)); result.setResult(new ItemStack(Material.WOOD_STAIRS, 8));
} }
if (result.getResult().getType()==Material.COBBLESTONE_STAIRS) {
result.setResult(new ItemStack(Material.COBBLESTONE_STAIRS, 8));
}
if (result.getResult().getType()==Material.BIRCH_WOOD_STAIRS) { if (result.getResult().getType()==Material.BIRCH_WOOD_STAIRS) {
result.setResult(new ItemStack(Material.BIRCH_WOOD_STAIRS, 8)); result.setResult(new ItemStack(Material.BIRCH_WOOD_STAIRS, 8));
} }
@ -5736,6 +5756,8 @@ implements Listener
// 2 = mythic item // 2 = mythic item
// 3 = plentiful items // 3 = plentiful items
// 4 = multiple items // 4 = multiple items
// 5 = chaos items (diablodrops items)
// 999 = Survivor's kit
switch (tier) { switch (tier) {
case 1: { case 1: {
loc.getWorld().dropItemNaturally(loc, getGoodie(0)); loc.getWorld().dropItemNaturally(loc, getGoodie(0));
@ -5745,13 +5767,13 @@ implements Listener
}break; }break;
case 3: { case 3: {
if (Math.random() < 0.1) { if (Math.random() < 0.1) {
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.LOG, (int)(Math.random() * 64) + 1)); loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.NETHER_BRICK, (int)(Math.random() * 64) + 1));
} else } else
if (Math.random() < 0.1) { if (Math.random() < 0.1) {
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.RAW_FISH, (int)(Math.random() * 64) + 1)); loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.RAW_FISH, (int)(Math.random() * 64) + 1));
} else } else
if (Math.random() < 0.1) { if (Math.random() < 0.1) {
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.BOOKSHELF, (int)(Math.random() * 64) + 1)); loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.HAY_BLOCK, (int)(Math.random() * 64) + 1));
} else } else
if (Math.random() < 0.1) { if (Math.random() < 0.1) {
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.CLAY, (int)(Math.random() * 64) + 1)); loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.CLAY, (int)(Math.random() * 64) + 1));
@ -5760,36 +5782,57 @@ implements Listener
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.EXP_BOTTLE, (int)(Math.random() * 64) + 1)); loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.EXP_BOTTLE, (int)(Math.random() * 64) + 1));
} else } else
if (Math.random() < 0.1) { if (Math.random() < 0.1) {
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.OBSIDIAN, (int)(Math.random() * 64) + 1)); loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.NOTE_BLOCK, (int)(Math.random() * 64) + 1));
} else } else
if (Math.random() < 0.1) { if (Math.random() < 0.1) {
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.MOSSY_COBBLESTONE, (int)(Math.random() * 64) + 1)); loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.MOSSY_COBBLESTONE, (int)(Math.random() * 64) + 1));
} else } else
if (Math.random() < 0.1) { if (Math.random() < 0.1) {
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.HAY_BLOCK, (int)(Math.random() * 64) + 1)); loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.BOOKSHELF, (int)(Math.random() * 64) + 1));
} else } else
if (Math.random() < 0.1) { if (Math.random() < 0.1) {
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.QUARTZ_BLOCK, (int)(Math.random() * 64) + 1)); loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.QUARTZ_BLOCK, (int)(Math.random() * 64) + 1));
} else } else
if (Math.random() < 0.1) { if (Math.random() < 0.1) {
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.NETHER_BRICK, (int)(Math.random() * 64) + 1)); loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.OBSIDIAN, (int)(Math.random() * 64) + 1));
} else
if (Math.random() < 0.1) {
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.REDSTONE_LAMP_OFF, (int)(Math.random() * 64) + 1));
} else { } else {
// Damn you got unlucky, better try next time
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.WOOL, (int)(Math.random() * 64) + 1)); loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.WOOL, (int)(Math.random() * 64) + 1));
} }
}break; }break;
case 4: { case 4: {
// Drop at least one stack, and five rolls for a 20% chance at an extra stack. // Drop at least two stacks, and four rolls for a 20% chance at an extra stack.
loc.getWorld().dropItemNaturally(loc, getGoodie(0)); loc.getWorld().dropItemNaturally(loc, getGoodie(0));
for (int i = 0; i < 5; i++) { loc.getWorld().dropItemNaturally(loc, getGoodie(0));
for (int i = 0; i < 4; i++) {
// Averages one extra drop. Can be up to 4.
if (Math.random() < 0.2) { if (Math.random() < 0.2) {
loc.getWorld().dropItemNaturally(loc, getGoodie(0)); loc.getWorld().dropItemNaturally(loc, getGoodie(0));
} }
} }
}break; }break;
case 5: { case 5: {
loc.getWorld().dropItemNaturally(loc, DiabloDropsHook.getRandomItem());
for (int i = 0; i < 10 && Math.random() < 0.2; i++) {
// 20% for one extra, 4% for two extra, 0.8% for three extra, etc.
loc.getWorld().dropItemNaturally(loc, DiabloDropsHook.getRandomItem());
}
}break;
case 6: {
// OMG NOT CODED YET WTF THIS SHOULDN'T HAPPEN // OMG NOT CODED YET WTF THIS SHOULDN'T HAPPEN
}break; }break;
case 999: {
// Not yet obtainable
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.WORKBENCH));
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.FURNACE));
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.WOOD, 16));
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.COBBLESTONE, 16));
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.TORCH, 16));
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.BREAD, 16));
}break;
} }
} }
@ -5799,7 +5842,7 @@ implements Listener
public ItemStack getGoodie(int rar /*1=Mythical 0=Normal -1=Only an equipment*/) { public ItemStack getGoodie(int rar /*1=Mythical 0=Normal -1=Only an equipment*/) {
ItemStack item = null; ItemStack item = null;
if (Math.random()<0.33 || rar==-1) { if (Math.random()<0.33 || rar==-1 || rar==1) {
//Add a weapon/armor piece. //Add a weapon/armor piece.
int rand = (int)(Math.random()*5); int rand = (int)(Math.random()*5);
String type = ""; String type = "";
@ -6716,7 +6759,7 @@ implements Listener
} }
} }
} }
if (this.plugin.getAccountsConfig().getBoolean("halloween-enabled")) { if (this.plugin.getAccountsConfig().getBoolean("halloween-enabled") || this.plugin.getConfig().getBoolean("thanksgiving-enabled")) {
e.setDroppedExp(e.getDroppedExp()*2); e.setDroppedExp(e.getDroppedExp()*2);
} }
if (f.getKiller()!=null && f.getKiller().getType()==EntityType.PLAYER) { if (f.getKiller()!=null && f.getKiller().getType()==EntityType.PLAYER) {
@ -6971,9 +7014,23 @@ implements Listener
@EventHandler @EventHandler
public void onFishCatch(PlayerFishEvent e) { public void onFishCatch(PlayerFishEvent e) {
if (e.getState()==State.CAUGHT_FISH) { if (e.getState()==State.CAUGHT_FISH) {
if (this.plugin.getConfig().getBoolean("thanksgiving-enabled") && Math.random() < 0.10) { if (this.plugin.getConfig().getBoolean("thanksgiving-enabled")) {
// 5% chance of fishing up a loot chest if (Math.random() < 0.50) {
e.getPlayer().getWorld().dropItemNaturally(e.getPlayer().getLocation(), this.plugin.generate_LootChest()); // 50% chance of fishing up a chicken plus feathers
e.setExpToDrop(e.getExpToDrop() * 2);
e.getPlayer().getWorld().dropItemNaturally(e.getPlayer().getLocation(), new ItemStack(Material.RAW_CHICKEN));
e.getPlayer().getWorld().dropItemNaturally(e.getPlayer().getLocation(), new ItemStack(Material.FEATHER, 1 + (int)(Math.random() * 4)));
}
for (int c = 0; c < 5 && Math.random() < 0.20; c++) {
// 20% chance each of catching additional fish
e.setExpToDrop(e.getExpToDrop() + (int)(Math.random() * 6) + 1);
e.getPlayer().getWorld().dropItemNaturally(e.getPlayer().getLocation(), new ItemStack(Material.RAW_FISH));
}
if (Math.random() < 0.10) {
// 10% chance of fishing up a loot chest
e.setExpToDrop(e.getExpToDrop() + (int)(Math.random() * 6) + 1);
e.getPlayer().getWorld().dropItemNaturally(e.getPlayer().getLocation(), this.plugin.generate_LootChest());
}
} }
Player p = e.getPlayer(); Player p = e.getPlayer();
if (this.plugin.PlayerinJob(p, "Fisherman")) { if (this.plugin.PlayerinJob(p, "Fisherman")) {
@ -7398,6 +7455,9 @@ implements Listener
if (e.getCause()==DamageCause.ENTITY_EXPLOSION || e.getCause()==DamageCause.BLOCK_EXPLOSION) { if (e.getCause()==DamageCause.ENTITY_EXPLOSION || e.getCause()==DamageCause.BLOCK_EXPLOSION) {
e.setDamage(e.getDamage()*2); e.setDamage(e.getDamage()*2);
} }
if (e.getCause()==DamageCause.WITHER) {
e.setDamage(e.getDamage()*Math.pow(0.5, this.plugin.getWitherlessRoseCount(p)));
}
Bukkit.getScheduler().scheduleSyncDelayedTask(this.plugin, new Runnable() { Bukkit.getScheduler().scheduleSyncDelayedTask(this.plugin, new Runnable() {
@Override @Override
public void run() { public void run() {
@ -11422,7 +11482,7 @@ implements Listener
Location loc = e.getEntity().getLocation(); Location loc = e.getEntity().getLocation();
ItemStack item = null; ItemStack item = null;
switch ((int)(Math.random()*112)) { switch ((int)(Math.random()*111.01)) {
case 0:{ case 0:{
item = new ItemStack(Material.WOOD_HOE); item = new ItemStack(Material.WOOD_HOE);
}break; }break;
@ -11640,7 +11700,7 @@ implements Listener
item = new ItemStack(Material.BROWN_MUSHROOM); item = new ItemStack(Material.BROWN_MUSHROOM);
}break; }break;
case 92:{ case 92:{
item = new ItemStack(Material.SNOW_BALL); item = new ItemStack(Material.SNOW_BALL, 1 + (int)(Math.random() * 16));
}break; }break;
case 93:{ case 93:{
item = new ItemStack(Material.FENCE); item = new ItemStack(Material.FENCE);
@ -11808,7 +11868,7 @@ implements Listener
item = new ItemStack(Material.DIAMOND); item = new ItemStack(Material.DIAMOND);
}break; }break;
case 3:{ case 3:{
item = new ItemStack(Material.GOLD_INGOT); item = new ItemStack(Material.GOLD_INGOT, 1 + (int)(Math.random() * 2));
}break; }break;
case 4:{ case 4:{
item = new ItemStack(Material.GOLDEN_APPLE); item = new ItemStack(Material.GOLDEN_APPLE);
@ -11867,7 +11927,7 @@ implements Listener
case 1: case 1:
case 2: case 2:
case 3:{ case 3:{
item = new ItemStack(Material.SKULL_ITEM); item = new ItemStack(Material.SKULL_ITEM, 1 + (int)(Math.random() * 6));
item.setData(new MaterialData(Material.SKULL_ITEM, (byte) 1)); item.setData(new MaterialData(Material.SKULL_ITEM, (byte) 1));
}break; }break;
case 4:{ case 4:{
@ -11885,13 +11945,13 @@ implements Listener
} }
}break; }break;
case 107:{ case 107:{
item = new ItemStack(Material.COOKIE, 8); item = new ItemStack(Material.COOKIE, 1 + (int)(Math.random() * 8));
}break; }break;
case 108:{ case 108:{
item = new ItemStack(Material.SEEDS, 42); item = new ItemStack(Material.SEEDS, 1 + (int)(Math.random() * 64));
}break; }break;
case 109:{ case 109:{
item = new ItemStack(Material.PAINTING, 16); item = new ItemStack(Material.PAINTING, 1 + (int)(Math.random() * 32));
}break; }break;
case 110:{ case 110:{
item = getGoodie(0); item = getGoodie(0);
@ -12359,7 +12419,7 @@ implements Listener
p.closeInventory(); p.closeInventory();
} }
for (int i=0;i<this.plugin.SPEED_CONTROL.size();i++) { for (int i=0;i<this.plugin.SPEED_CONTROL.size();i++) {
if (this.plugin.SPEED_CONTROL.get(i).p.getName().compareTo(p.getName().toLowerCase())==0) { if (this.plugin.SPEED_CONTROL.get(i).p.getName().toLowerCase().compareTo(p.getName().toLowerCase())==0) {
p.removePotionEffect(PotionEffectType.SPEED); p.removePotionEffect(PotionEffectType.SPEED);
//If they have a "speed" potion, give it back. //If they have a "speed" potion, give it back.
p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, (int) ((this.plugin.SPEED_CONTROL.get(i).potion_time-Main.SERVER_TICK_TIME)*2), this.plugin.SPEED_CONTROL.get(i).potion_spdlv, true)); p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, (int) ((this.plugin.SPEED_CONTROL.get(i).potion_time-Main.SERVER_TICK_TIME)*2), this.plugin.SPEED_CONTROL.get(i).potion_spdlv, true));

@ -25,6 +25,7 @@ import org.bukkit.Material;
import org.bukkit.OfflinePlayer; import org.bukkit.OfflinePlayer;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.SkullType; import org.bukkit.SkullType;
import org.bukkit.Sound;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.Skull; import org.bukkit.block.Skull;
import org.bukkit.command.Command; import org.bukkit.command.Command;
@ -603,7 +604,8 @@ public String convertToItemName(String val) {
} }
} }
if (args[0].equalsIgnoreCase("loot")) { if (args[0].equalsIgnoreCase("loot")) {
p.getWorld().dropItemNaturally(p.getLocation(), this.plugin.generate_LootChest()); } p.getWorld().dropItemNaturally(p.getLocation(), this.plugin.generate_LootChest());
}
if (args[0].equalsIgnoreCase("thanksgiving")) { if (args[0].equalsIgnoreCase("thanksgiving")) {
if (this.plugin.getConfig().getBoolean("thanksgiving-enabled")) { if (this.plugin.getConfig().getBoolean("thanksgiving-enabled")) {
this.plugin.getConfig().set("thanksgiving-enabled", Boolean.valueOf(false)); this.plugin.getConfig().set("thanksgiving-enabled", Boolean.valueOf(false));
@ -632,6 +634,9 @@ public String convertToItemName(String val) {
} }
} else } else
if (cmd.getName().toLowerCase().equalsIgnoreCase("event") && args.length==2 && p.hasPermission("maintenance-mode-admin")) { if (cmd.getName().toLowerCase().equalsIgnoreCase("event") && args.length==2 && p.hasPermission("maintenance-mode-admin")) {
if (args[0].equalsIgnoreCase("loot")) {
p.getWorld().dropItemNaturally(p.getLocation(), this.plugin.generate_LootChest(Integer.valueOf(args[1])));
}
if (args[0].equalsIgnoreCase("head")) { if (args[0].equalsIgnoreCase("head")) {
ItemStack m = new ItemStack(Material.SKULL_ITEM, 64, (short)SkullType.PLAYER.ordinal()); ItemStack m = new ItemStack(Material.SKULL_ITEM, 64, (short)SkullType.PLAYER.ordinal());
SkullMeta skullMeta = (SkullMeta) m.getItemMeta(); SkullMeta skullMeta = (SkullMeta) m.getItemMeta();
@ -1766,7 +1771,10 @@ public String convertToItemName(String val) {
is_in_vehicle=true; is_in_vehicle=true;
vehicle = p.getVehicle(); vehicle = p.getVehicle();
} }
if (target.getName() == this.plugin.getAccountsConfig().getString(p.getName().toLowerCase() + ".teleplayer")) { if (this.plugin.hasDistortionOrb(target)) {
p.getWorld().playSound(p.getLocation(), Sound.ENDERMAN_TELEPORT, 0.9f, 1);
p.sendMessage(ChatColor.YELLOW + "A strange force prevents you from teleporting!");
} else if (target.getName().equalsIgnoreCase(this.plugin.getAccountsConfig().getString(p.getName().toLowerCase() + ".teleplayer"))) {
//Determine distance of player to other player. //Determine distance of player to other player.
double otherx = target.getLocation().getX(); double otherx = target.getLocation().getX();
double othery = target.getLocation().getY(); double othery = target.getLocation().getY();

Loading…
Cancel
Save