->Make EXP rate reach a cap for spawning Malleable Bases.
->Experience that spawns will no longer lose any value due to other nearby experience orbs being spawned.
This commit is contained in:
parent
8be7044e91
commit
55c3ffa6bc
Binary file not shown.
@ -1,6 +1,6 @@
|
||||
name: TwosideKeeper
|
||||
main: sig.plugin.TwosideKeeper.TwosideKeeper
|
||||
version: 3.7.3ar1
|
||||
version: 3.7.3ar2
|
||||
commands:
|
||||
money:
|
||||
description: Tells the player the amount of money they are holding.
|
||||
|
@ -9,6 +9,7 @@ import java.util.Map;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.block.Block;
|
||||
@ -17,6 +18,7 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.ExperienceOrb;
|
||||
import org.bukkit.entity.Guardian;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Monster;
|
||||
@ -2887,4 +2889,9 @@ public class GenericFunctions {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void spawnXP(Location location, int expAmount) {
|
||||
ExperienceOrb orb = location.getWorld().spawn(location, ExperienceOrb.class);
|
||||
orb.setExperience(orb.getExperience() + expAmount);
|
||||
}
|
||||
}
|
||||
|
@ -3926,7 +3926,11 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
double val = Math.random();
|
||||
log("ExpChange event: "+val,5);
|
||||
int amt = ev.getAmount();
|
||||
if (val<=((double)amt/(double)65)*(0.00125)*ARTIFACT_RARITY && amt<=500) {
|
||||
int testamt = amt;
|
||||
if (amt>500) {
|
||||
testamt=500;
|
||||
}
|
||||
if (val<=((double)testamt/(double)65)*(0.00125)*ARTIFACT_RARITY) {
|
||||
ev.getPlayer().getWorld().dropItemNaturally(ev.getPlayer().getLocation(), Artifact.createArtifactItem(ArtifactItem.MALLEABLE_BASE));
|
||||
ev.getPlayer().sendMessage(ChatColor.LIGHT_PURPLE+"A strange item has appeared nearby.");
|
||||
}
|
||||
@ -4237,8 +4241,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
Item it = deathloc.getWorld().dropItemNaturally(mer.getLocation(), drop.get(i));
|
||||
it.setInvulnerable(true);
|
||||
}
|
||||
ExperienceOrb exp = (ExperienceOrb)deathloc.getWorld().spawnEntity(mer.getLocation(), EntityType.EXPERIENCE_ORB);
|
||||
exp.setExperience((int)(expdrop*0.25));
|
||||
GenericFunctions.spawnXP(mer.getLocation(), (int)(expdrop*0.25));
|
||||
}}
|
||||
,50);
|
||||
break;
|
||||
@ -4265,8 +4268,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
Item it = deathloc.getWorld().dropItemNaturally(mer1.getLocation(), drop.get(i));
|
||||
it.setInvulnerable(true);
|
||||
}
|
||||
ExperienceOrb exp = (ExperienceOrb)deathloc.getWorld().spawnEntity(mer1.getLocation(), EntityType.EXPERIENCE_ORB);
|
||||
exp.setExperience((int)(expdrop1*0.25));
|
||||
GenericFunctions.spawnXP(mer1.getLocation(), (int)(expdrop1*0.25));
|
||||
}}
|
||||
,50);
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user