Fix Loot drop rate, fix items being permanently lost.
This commit is contained in:
parent
d9e1e43ef1
commit
68e402cf78
Binary file not shown.
@ -3308,6 +3308,18 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
@EventHandler(priority=EventPriority.LOW,ignoreCancelled = true)
|
@EventHandler(priority=EventPriority.LOW,ignoreCancelled = true)
|
||||||
public void onPlayerKick(PlayerKickEvent ev) {
|
public void onPlayerKick(PlayerKickEvent ev) {
|
||||||
if (DeathManager.deathStructureExists(ev.getPlayer())) {
|
if (DeathManager.deathStructureExists(ev.getPlayer())) {
|
||||||
|
DeathStructure ds = DeathManager.getDeathStructure(ev.getPlayer());
|
||||||
|
Location deathloc = ds.deathloc;
|
||||||
|
Player p = ev.getPlayer();
|
||||||
|
deathloc.getWorld().loadChunk(deathloc.getChunk());
|
||||||
|
for (int i=0;i<p.getOpenInventory().getTopInventory().getSize();i++) {
|
||||||
|
if (p.getOpenInventory().getTopInventory().getItem(i)!=null &&
|
||||||
|
p.getOpenInventory().getTopInventory().getItem(i).getType()!=Material.AIR) {
|
||||||
|
deathloc.getWorld().dropItemNaturally(deathloc, p.getOpenInventory().getTopInventory().getItem(i));
|
||||||
|
log("Dropping "+p.getOpenInventory().getTopInventory().getItem(i).toString()+" at Death location "+deathloc,3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
DeathManager.removeDeathStructure(p);
|
||||||
DeathManager.removeDeathStructure(ev.getPlayer());
|
DeathManager.removeDeathStructure(ev.getPlayer());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4590,10 +4602,6 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
isBoss=GenericFunctions.isBossMonster(m);
|
isBoss=GenericFunctions.isBossMonster(m);
|
||||||
isElite=GenericFunctions.isEliteMonster(m);
|
isElite=GenericFunctions.isEliteMonster(m);
|
||||||
|
|
||||||
if (isElite) {
|
|
||||||
isBoss=true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (killedByPlayer && GenericFunctions.isCoreMonster(m) && Math.random()<RARE_DROP_RATE*dropmult*ARTIFACT_RARITY) {
|
if (killedByPlayer && GenericFunctions.isCoreMonster(m) && Math.random()<RARE_DROP_RATE*dropmult*ARTIFACT_RARITY) {
|
||||||
switch ((int)(Math.random()*4)) {
|
switch ((int)(Math.random()*4)) {
|
||||||
case 0:{
|
case 0:{
|
||||||
@ -4656,7 +4664,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
Player pl = participants.get(i);
|
Player pl = participants.get(i);
|
||||||
ExperienceOrb exp = GenericFunctions.spawnXP(pl.getLocation(), ev.getDroppedExp()*300);
|
ExperienceOrb exp = GenericFunctions.spawnXP(pl.getLocation(), ev.getDroppedExp()*300);
|
||||||
exp.setInvulnerable(true);
|
exp.setInvulnerable(true);
|
||||||
GenericFunctions.giveItem(p,aPlugin.API.getEliteBox());
|
GenericFunctions.giveItem(pl,aPlugin.API.getEliteBox());
|
||||||
log("Dropping "+aPlugin.API.getEliteBox().toString(),2);
|
log("Dropping "+aPlugin.API.getEliteBox().toString(),2);
|
||||||
if (participants_list.length()<1) {
|
if (participants_list.length()<1) {
|
||||||
participants_list.append(pl.getName());
|
participants_list.append(pl.getName());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user