adjust gold drops

This commit is contained in:
Shaun Bennett 2015-11-27 01:24:03 -05:00
parent e211fe182d
commit 94090c9434

View File

@ -235,14 +235,14 @@ public class GoldManager extends MiniPlugin
public void dropGold(Location location, int amount, double velMult) public void dropGold(Location location, int amount, double velMult)
{ {
int count = amount / 700; int count = amount / 1000;
int extraGold = amount % 700; int extraGold = amount % 1000;
for (int i = 0; i < count; i++) for (int i = 0; i < count; i++)
{ {
double x = Math.random() * 2 * Math.PI; double x = Math.random() * 2 * Math.PI;
Vector velocity = new Vector(Math.sin(x), 0, Math.cos(x)); Vector velocity = new Vector(Math.sin(x), 0, Math.cos(x));
dropGold(location, 1000, velocity, velMult); dropGold(location, 1000, velocity, velMult, "" + i);
} }
// Drop Extra // Drop Extra
@ -250,16 +250,17 @@ public class GoldManager extends MiniPlugin
{ {
double x = Math.random() * 2 * Math.PI; double x = Math.random() * 2 * Math.PI;
Vector velocity = new Vector(Math.sin(x), 0, Math.cos(x)); Vector velocity = new Vector(Math.sin(x), 0, Math.cos(x));
dropGold(location, extraGold, velocity, velMult); dropGold(location, extraGold, velocity, velMult, "extra");
} }
} }
private void dropGold(Location location, int amount, Vector velocity, double velMult) private void dropGold(Location location, int amount, Vector velocity, double velMult, String name)
{ {
Item item = location.getWorld().dropItem(location, new ItemStack(Material.GOLD_NUGGET)); Item item = location.getWorld().dropItem(location, new ItemStack(Material.GOLD_NUGGET));
item.setCustomName(name);
item.setPickupDelay(40); item.setPickupDelay(40);
item.setMetadata(META_STRING, new FixedMetadataValue(getPlugin(), amount)); item.setMetadata(META_STRING, new FixedMetadataValue(getPlugin(), amount));
_itemSet.add(item); _itemSet.add(item);
// Velocity // Velocity