Fix Custom Arrows + Item Cube History not fully saving closed cubes.

This commit is contained in:
sigonasr2 2016-08-21 15:15:47 -05:00
parent ba064c96e0
commit 802768a4fb
3 changed files with 16 additions and 1 deletions

Binary file not shown.

View File

@ -145,6 +145,7 @@ public class CustomDamage {
if (headshotdmg!=0.0) {headshot=true;}
dmg += headshotdmg;
dmg += addMultiplierToPlayerLogger(damager,target,"Bow Drawback Mult",dmg * calculateBowDrawbackMultiplier(weapon,damager,target));
dmg += addMultiplierToPlayerLogger(damager,target,"Custom Arrow Mult",dmg * calculateCustomArrowMultiplier(weapon,damager,target));
}
}
} else {
@ -188,6 +189,20 @@ public class CustomDamage {
return dmg;
}
private static double calculateCustomArrowMultiplier(ItemStack weapon, Entity damager, LivingEntity target) {
double mult = 0.0;
if (damager instanceof TippedArrow) {
TippedArrow a = (TippedArrow)damager;
if (a.hasMetadata("QUADRUPLE_DAMAGE_ARR")) {
mult += 4.0;
}
if (a.hasMetadata("DOUBLE_DAMAGE_ARR")) {
mult+=2.0;
}
}
return mult;
}
private static void addToPlayerRawDamage(double damage, LivingEntity target) {
if (target instanceof Player) {
Player p = (Player)target;

View File

@ -38,8 +38,8 @@ public class ItemCubeWindow {
Inventory temp = Bukkit.getServer().createInventory(p, inv_size, "Item Cube #"+itemcubeid);
pd.opened_another_cube=true;
TwosideKeeper.openItemCubeInventory(temp);
pd.opened_another_cube=false;
InventoryView newinv = p.openInventory(temp);
pd.opened_another_cube=false;
pd.isViewingItemCube=true;
p.playSound(p.getLocation(),Sound.BLOCK_CHEST_OPEN,1.0f,1.0f);
} else {