->Fix Item Cube viewing if you do not click an item cube.

->Fix damage dealing for non-spell attacks.
->'Auto Repair' durability healing reduced by half.
This commit is contained in:
sigonasr2 2016-07-16 01:06:09 -05:00
parent ebd359d9fe
commit 04cb3b2b55
6 changed files with 42 additions and 15 deletions

Binary file not shown.

View File

@ -1,6 +1,6 @@
name: TwosideKeeper name: TwosideKeeper
main: sig.plugin.TwosideKeeper.TwosideKeeper main: sig.plugin.TwosideKeeper.TwosideKeeper
version: 3.5.4r4 version: 3.5.4r5
commands: commands:
money: money:
description: Tells the player the amount of money they are holding. description: Tells the player the amount of money they are holding.

View File

@ -107,7 +107,7 @@ public enum ArtifactAbility {
new double[]{0.6,0.575,0.55,0.525,0.5,0.475,0.45,0.425,0.4,0.375},100,10,UpgradePath.SCYTHE), new double[]{0.6,0.575,0.55,0.525,0.5,0.475,0.45,0.425,0.4,0.375},100,10,UpgradePath.SCYTHE),
//General abilities //General abilities
AUTOREPAIR("Auto Repair","1% chance every second to repair [VAL] durability to the artifact item\n\nThe item must be sitting in your hotbar or must be equipped for this ability to work. This ability is less effective with no sunlight!",new double[]{6,7,8,9,10,11,12,13,14,15}, AUTOREPAIR("Auto Repair","1% chance every second to repair [VAL] durability to the artifact item\n\nThe item must be sitting in your hotbar or must be equipped for this ability to work. This ability is less effective with no sunlight!",new double[]{3,3.5,4,4.5,5,5.5,6,6.5,7,7.5},
new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},10,1,UpgradePath.ALL), new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},10,1,UpgradePath.ALL),
GREED("Greed","Increases Drop rate by [VAL]% . Health is halved, health regeneration is halved, and damage reduction is halved. Consumes one level of Greed per level up.",new double[]{50,55,60,65,70,75,80,85,90,95}, GREED("Greed","Increases Drop rate by [VAL]% . Health is halved, health regeneration is halved, and damage reduction is halved. Consumes one level of Greed per level up.",new double[]{50,55,60,65,70,75,80,85,90,95},
new double[]{2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0},100,10,UpgradePath.ALL), new double[]{2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0},100,10,UpgradePath.ALL),

View File

@ -1484,9 +1484,27 @@ public class GenericFunctions {
} }
} }
} }
case BOAT:{
return "Oak Boat";
}
case CLAY_BRICK:{
return "Brick";
}
case BRICK:{
return "Bricks";
}
case FIREWORK:{
return "Firework Rocket";
}
case FIREWORK_CHARGE:{
return "Firework Star";
}
case EXP_BOTTLE:{ case EXP_BOTTLE:{
return "Bottle o' Enchanting"; return "Bottle o' Enchanting";
} }
case GOLD_SWORD:{
return "Golden Sword";
}
default:{ default:{
return GenericFunctions.CapitalizeFirstLetters(type.getType().toString().replace("_", " ")); return GenericFunctions.CapitalizeFirstLetters(type.getType().toString().replace("_", " "));
} }
@ -2196,15 +2214,14 @@ public class GenericFunctions {
TwosideKeeper.log("Attack is dealing "+finaldmg, 2); TwosideKeeper.log("Attack is dealing "+finaldmg, 2);
if (target.getHealth()>finaldmg) { if (target.getHealth()>finaldmg) {
TwosideKeeper.log("NOT FULL HEALTH. HP: "+target.getHealth(), 2); TwosideKeeper.log("NOT FULL HEALTH. HP: "+target.getHealth(), 2);
target.setHealth(target.getHealth()-finaldmg); //target.setHealth(target.getHealth()-finaldmg);
target.damage(0.01); target.damage(finaldmg);
target.setNoDamageTicks(20); target.setNoDamageTicks(20);
} else { } else {
//Bukkit.getPluginManager().callEvent(new EntityDamageByEntityEvent(damager,target,DamageCause.ENTITY_ATTACK,finaldmg)); //Bukkit.getPluginManager().callEvent(new EntityDamageByEntityEvent(damager,target,DamageCause.ENTITY_ATTACK,finaldmg));
//target.setHealth(0); target.setHealth(0);
TwosideKeeper.log("FINISHING IT OFF. "+target.getHealth(), 2); //target.damage(999999);
target.setHealth(0.001); //TwosideKeeper.log("New Health."+target.getHealth(), 2);
target.damage(9999999);
target.setNoDamageTicks(20); target.setNoDamageTicks(20);
} }
} }

View File

@ -219,7 +219,6 @@ public class MalleableBaseQuest {
blacklisted_items.add(Material.FIRE); blacklisted_items.add(Material.FIRE);
blacklisted_items.add(Material.FIREBALL); blacklisted_items.add(Material.FIREBALL);
blacklisted_items.add(Material.FLOWER_POT); blacklisted_items.add(Material.FLOWER_POT);
blacklisted_items.add(Material.FROSTED_ICE);
blacklisted_items.add(Material.GLOWING_REDSTONE_ORE); blacklisted_items.add(Material.GLOWING_REDSTONE_ORE);
blacklisted_items.add(Material.GOLD_RECORD); blacklisted_items.add(Material.GOLD_RECORD);
blacklisted_items.add(Material.GRASS); blacklisted_items.add(Material.GRASS);

View File

@ -818,16 +818,18 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
p.getEquipment().getItemInMainHand().setType(Material.STONE_SPADE); p.getEquipment().getItemInMainHand().setType(Material.STONE_SPADE);
} }
} }
if (p.getLocation().add(0,0,0).getBlock().getType()==Material.PISTON_MOVING_PIECE) {
p.getLocation().add(0,0,0).getBlock().setType(Material.AIR);
}
if (SERVER_TYPE==ServerType.TEST || SERVER_TYPE==ServerType.QUIET) { if (SERVER_TYPE==ServerType.TEST || SERVER_TYPE==ServerType.QUIET) {
/*for (int i=0;i<p.getEquipment().getArmorContents().length;i++) {
for (int i=0;i<p.getEquipment().getArmorContents().length;i++) {
if (GenericFunctions.isArtifactEquip(p.getEquipment().getArmorContents()[i]) && if (GenericFunctions.isArtifactEquip(p.getEquipment().getArmorContents()[i]) &&
GenericFunctions.isArtifactArmor(p.getEquipment().getArmorContents()[i])) { GenericFunctions.isArtifactArmor(p.getEquipment().getArmorContents()[i])) {
AwakenedArtifact.addPotentialEXP(p.getEquipment().getArmorContents()[i], 500, p); AwakenedArtifact.addPotentialEXP(p.getEquipment().getArmorContents()[i], 500, p);
} }
} }
ItemStack item = p.getEquipment().getItemInMainHand(); ItemStack item = p.getEquipment().getItemInMainHand();
AwakenedArtifact.addPotentialEXP(item, 50000, p); AwakenedArtifact.addPotentialEXP(item, 50000, p);*/
//p.sendMessage(tpstracker.getTPS()+""); //p.sendMessage(tpstracker.getTPS()+"");
//GenericFunctions.addObscureHardenedItemBreaks(p.getEquipment().getItemInMainHand(), 4); //GenericFunctions.addObscureHardenedItemBreaks(p.getEquipment().getItemInMainHand(), 4);
} }
@ -3139,7 +3141,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
ev.setCancelled(true); ev.setCancelled(true);
ev.setResult(Result.DENY); ev.setResult(Result.DENY);
InventoryView newinv = p.openInventory(Bukkit.getServer().createInventory(p, inventory_size, "Item Cube #"+idnumb)); InventoryView newinv = p.openInventory(Bukkit.getServer().createInventory(p, inventory_size, "Item Cube #"+idnumb));
openItemCubeInventory(p.getOpenInventory().getTopInventory(),newinv); openItemCubeInventory(newinv.getTopInventory(),newinv);
pd.isViewingItemCube=true; pd.isViewingItemCube=true;
p.playSound(p.getLocation(),Sound.BLOCK_CHEST_OPEN,1.0f,1.0f); p.playSound(p.getLocation(),Sound.BLOCK_CHEST_OPEN,1.0f,1.0f);
} else { } else {
@ -3320,6 +3322,10 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
@EventHandler(priority=EventPriority.LOW,ignoreCancelled = true) @EventHandler(priority=EventPriority.LOW,ignoreCancelled = true)
public void updateHealthbarDamageEvent(EntityDamageEvent ev) { public void updateHealthbarDamageEvent(EntityDamageEvent ev) {
Entity e = ev.getEntity(); Entity e = ev.getEntity();
log(ev.getCause().toString(),2);
log(ev.getDamage()+"",2);
if (ev.getCause()==DamageCause.FIRE || ev.getCause()==DamageCause.FIRE_TICK || if (ev.getCause()==DamageCause.FIRE || ev.getCause()==DamageCause.FIRE_TICK ||
ev.getCause()==DamageCause.WITHER || ev.getCause()==DamageCause.POISON ev.getCause()==DamageCause.WITHER || ev.getCause()==DamageCause.POISON
@ -3690,12 +3696,16 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
ev.getEntity() instanceof LivingEntity)) { ev.getEntity() instanceof LivingEntity)) {
final Player p = (Player)ev.getDamager(); final Player p = (Player)ev.getDamager();
final LivingEntity m = (LivingEntity)ev.getEntity(); final LivingEntity m = (LivingEntity)ev.getEntity();
ev.setDamage(DamageModifier.MAGIC,0);
ev.setDamage(DamageModifier.RESISTANCE,0);
ev.setDamage(DamageModifier.ARMOR,0);
if (m.getType()==EntityType.ZOMBIE && if (m.getType()==EntityType.ZOMBIE &&
MonsterController.getMonsterDifficulty((Monster)m)==MonsterDifficulty.HELLFIRE && MonsterController.getMonsterDifficulty((Monster)m)==MonsterDifficulty.HELLFIRE &&
!chargezombies.contains((Monster)m)) { !chargezombies.contains((Monster)m)) {
chargezombies.add(new ChargeZombie((Monster)m)); chargezombies.add(new ChargeZombie((Monster)m));
} }
ev.setDamage(CalculateWeaponDamage(p,m));
if (GenericFunctions.isStriker(p) && if (GenericFunctions.isStriker(p) &&
p.getHealth()==p.getMaxHealth() && p.getHealth()==p.getMaxHealth() &&
@ -3708,7 +3718,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
//Damage dealt by the player is calculated differently, therefore we will cancel the normal damage calculation in favor //Damage dealt by the player is calculated differently, therefore we will cancel the normal damage calculation in favor
//of a new custom damage calculation. //of a new custom damage calculation.
if (p.getInventory().getItemInMainHand().getType()!=Material.BOW) { if (p.getInventory().getItemInMainHand().getType()!=Material.BOW) {
GenericFunctions.DealDamageToMob(CalculateWeaponDamage(p,m),m,p,false); //GenericFunctions.DealDamageToMob(CalculateWeaponDamage(p,m),m,p,false);
if (ArtifactAbility.containsEnchantment(ArtifactAbility.PROVOKE, p.getEquipment().getItemInMainHand())) { if (ArtifactAbility.containsEnchantment(ArtifactAbility.PROVOKE, p.getEquipment().getItemInMainHand())) {
ArtifactAbility.calculateValue(ArtifactAbility.PROVOKE, p.getEquipment().getItemInMainHand().getEnchantmentLevel(Enchantment.LUCK), ArtifactAbility.getEnchantmentLevel(ArtifactAbility.PROVOKE, p.getEquipment().getItemInMainHand())); ArtifactAbility.calculateValue(ArtifactAbility.PROVOKE, p.getEquipment().getItemInMainHand().getEnchantmentLevel(Enchantment.LUCK), ArtifactAbility.getEnchantmentLevel(ArtifactAbility.PROVOKE, p.getEquipment().getItemInMainHand()));
ItemStack equip = p.getEquipment().getItemInMainHand(); ItemStack equip = p.getEquipment().getItemInMainHand();
@ -3879,6 +3889,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
} }
} }
ev.setDamage(CalculateDamageReduction(ev.getDamage(),m,p));
//ev.setCancelled(true); //ev.setCancelled(true);
m.setNoDamageTicks(20); m.setNoDamageTicks(20);
@ -4308,7 +4319,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
} else } else
{ {
p.playSound(p.getLocation(), Sound.ENTITY_ITEM_BREAK, 1.0f, 1.0f); p.playSound(p.getLocation(), Sound.ENTITY_ITEM_BREAK, 1.0f, 1.0f);
p.sendMessage(ChatColor.DARK_RED+"Your "+ChatColor.YELLOW+GenericFunctions.UserFriendlyMaterialName(item)+ChatColor.DARK_RED+" has broken!"); p.sendMessage(ChatColor.DARK_RED+"Your "+ChatColor.YELLOW+((item.hasItemMeta() && item.getItemMeta().hasDisplayName())?item.getItemMeta().getDisplayName():GenericFunctions.UserFriendlyMaterialName(item))+ChatColor.DARK_RED+" has broken!");
} }
} }