Fixed custom potion effects not displaying for item info. Poison now
increases damage taken by 50% per level from all damage sources. Damage from Fire, Fire Ticks, Poison, and Wither effects are now true damage effects, making them much more scary.
This commit is contained in:
parent
ce0dc8c206
commit
1b217b968d
Binary file not shown.
@ -1,6 +1,6 @@
|
|||||||
name: TwosideKeeper
|
name: TwosideKeeper
|
||||||
main: sig.plugin.TwosideKeeper.TwosideKeeper
|
main: sig.plugin.TwosideKeeper.TwosideKeeper
|
||||||
version: 3.4.6
|
version: 3.4.7
|
||||||
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.
|
||||||
|
@ -22,6 +22,8 @@ import org.bukkit.inventory.meta.ItemMeta;
|
|||||||
import org.bukkit.inventory.meta.PotionMeta;
|
import org.bukkit.inventory.meta.PotionMeta;
|
||||||
import org.bukkit.material.MaterialData;
|
import org.bukkit.material.MaterialData;
|
||||||
import org.bukkit.material.Wool;
|
import org.bukkit.material.Wool;
|
||||||
|
import org.bukkit.potion.PotionEffect;
|
||||||
|
import org.bukkit.potion.PotionEffectType;
|
||||||
|
|
||||||
import sig.plugin.TwosideKeeper.Artifact;
|
import sig.plugin.TwosideKeeper.Artifact;
|
||||||
import sig.plugin.TwosideKeeper.MonsterController;
|
import sig.plugin.TwosideKeeper.MonsterController;
|
||||||
@ -161,6 +163,46 @@ public class GenericFunctions {
|
|||||||
return UserFriendlyMaterialName(new ItemStack(type,1,b));
|
return UserFriendlyMaterialName(new ItemStack(type,1,b));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String UserFriendlyPotionEffectTypeName(PotionEffectType type) {
|
||||||
|
switch (type.getName()) {
|
||||||
|
|
||||||
|
case "UNLUCK":{
|
||||||
|
return "Bad Luck";
|
||||||
|
}
|
||||||
|
case "SLOW_DIGGING":{
|
||||||
|
return "Mining Fatigue";
|
||||||
|
}
|
||||||
|
case "SLOW":{
|
||||||
|
return "Slowness";
|
||||||
|
}
|
||||||
|
case "JUMP":{
|
||||||
|
return "Jump Boost";
|
||||||
|
}
|
||||||
|
case "INCREASE_DAMAGE":{
|
||||||
|
return "Strength";
|
||||||
|
}
|
||||||
|
case "HEAL":{
|
||||||
|
return "Instant Health";
|
||||||
|
}
|
||||||
|
case "HARM":{
|
||||||
|
return "Harming";
|
||||||
|
}
|
||||||
|
case "FAST_DIGGING":{
|
||||||
|
return "Haste";
|
||||||
|
}
|
||||||
|
case "DAMAGE_RESISTANCE":{
|
||||||
|
return "Resistance";
|
||||||
|
}
|
||||||
|
case "CONFUSION":{
|
||||||
|
return "Nausea";
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
return GenericFunctions.CapitalizeFirstLetters(type.getName().replace("_", " "));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static String UserFriendlyMaterialName(ItemStack type) {
|
public static String UserFriendlyMaterialName(ItemStack type) {
|
||||||
switch (type.getType()) {
|
switch (type.getType()) {
|
||||||
case ACACIA_DOOR_ITEM:{
|
case ACACIA_DOOR_ITEM:{
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package sig.plugin.TwosideKeeper.HelperStructures;
|
package sig.plugin.TwosideKeeper.HelperStructures;
|
||||||
|
|
||||||
|
import java.text.DecimalFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
@ -32,6 +33,7 @@ import org.bukkit.inventory.meta.ItemMeta;
|
|||||||
import org.bukkit.inventory.meta.PotionMeta;
|
import org.bukkit.inventory.meta.PotionMeta;
|
||||||
import org.bukkit.inventory.meta.Repairable;
|
import org.bukkit.inventory.meta.Repairable;
|
||||||
import org.bukkit.material.MaterialData;
|
import org.bukkit.material.MaterialData;
|
||||||
|
import org.bukkit.potion.PotionEffect;
|
||||||
import org.bukkit.potion.PotionType;
|
import org.bukkit.potion.PotionType;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
@ -132,6 +134,15 @@ public class WorldShop {
|
|||||||
if (item.getType()==Material.POTION || item.getType()==Material.SPLASH_POTION || item.getType()==Material.LINGERING_POTION) {
|
if (item.getType()==Material.POTION || item.getType()==Material.SPLASH_POTION || item.getType()==Material.LINGERING_POTION) {
|
||||||
if (item.getItemMeta() instanceof PotionMeta) {
|
if (item.getItemMeta() instanceof PotionMeta) {
|
||||||
PotionMeta pot = (PotionMeta)item.getItemMeta();
|
PotionMeta pot = (PotionMeta)item.getItemMeta();
|
||||||
|
List<PotionEffect> effects = pot.getCustomEffects();
|
||||||
|
|
||||||
|
for (int i=0;i<effects.size();i++) {
|
||||||
|
DecimalFormat df = new DecimalFormat("00");
|
||||||
|
message+="\n"+ChatColor.GRAY+GenericFunctions.UserFriendlyPotionEffectTypeName(effects.get(i).getType())+" "+toRomanNumeral(effects.get(i).getAmplifier()+1)+ ((effects.get(i).getAmplifier()+1>0)?" ":"")+"("+effects.get(i).getDuration()/1200+":"+df.format((effects.get(i).getDuration()/20)%60)+")";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (effects.size()==0) { //Try this instead. It might be a legacy potion.
|
||||||
|
|
||||||
String duration = " "+(pot.getBasePotionData().isExtended()?"(8:00)":(pot.getBasePotionData().isUpgraded())?"(1:30)":"(3:00)");
|
String duration = " "+(pot.getBasePotionData().isExtended()?"(8:00)":(pot.getBasePotionData().isUpgraded())?"(1:30)":"(3:00)");
|
||||||
String badduration = " "+(pot.getBasePotionData().isExtended()?"(4:00)":"(1:30)");
|
String badduration = " "+(pot.getBasePotionData().isExtended()?"(4:00)":"(1:30)");
|
||||||
String poisonduration = " "+(pot.getBasePotionData().isExtended()?"(1:30)":(pot.getBasePotionData().isUpgraded())?"(0:21)":"(0:45)");
|
String poisonduration = " "+(pot.getBasePotionData().isExtended()?"(1:30)":(pot.getBasePotionData().isUpgraded())?"(0:21)":"(0:45)");
|
||||||
@ -194,6 +205,7 @@ public class WorldShop {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -48,6 +48,8 @@ import org.bukkit.entity.Monster;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.entity.Skeleton;
|
import org.bukkit.entity.Skeleton;
|
||||||
import org.bukkit.entity.Skeleton.SkeletonType;
|
import org.bukkit.entity.Skeleton.SkeletonType;
|
||||||
|
import org.bukkit.entity.ThrownPotion;
|
||||||
|
import org.bukkit.entity.Witch;
|
||||||
import org.bukkit.entity.EnderDragon.Phase;
|
import org.bukkit.entity.EnderDragon.Phase;
|
||||||
import org.bukkit.event.Event.Result;
|
import org.bukkit.event.Event.Result;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
@ -73,6 +75,7 @@ import org.bukkit.event.entity.FoodLevelChangeEvent;
|
|||||||
import org.bukkit.event.entity.ItemDespawnEvent;
|
import org.bukkit.event.entity.ItemDespawnEvent;
|
||||||
import org.bukkit.event.entity.ItemSpawnEvent;
|
import org.bukkit.event.entity.ItemSpawnEvent;
|
||||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||||
|
import org.bukkit.event.entity.PotionSplashEvent;
|
||||||
import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason;
|
import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason;
|
||||||
import org.bukkit.event.inventory.ClickType;
|
import org.bukkit.event.inventory.ClickType;
|
||||||
import org.bukkit.event.inventory.CraftItemEvent;
|
import org.bukkit.event.inventory.CraftItemEvent;
|
||||||
@ -80,6 +83,7 @@ import org.bukkit.event.inventory.InventoryAction;
|
|||||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||||
import org.bukkit.event.inventory.InventoryCloseEvent;
|
import org.bukkit.event.inventory.InventoryCloseEvent;
|
||||||
import org.bukkit.event.inventory.InventoryDragEvent;
|
import org.bukkit.event.inventory.InventoryDragEvent;
|
||||||
|
import org.bukkit.event.inventory.InventoryMoveItemEvent;
|
||||||
import org.bukkit.event.inventory.InventoryOpenEvent;
|
import org.bukkit.event.inventory.InventoryOpenEvent;
|
||||||
import org.bukkit.event.inventory.InventoryPickupItemEvent;
|
import org.bukkit.event.inventory.InventoryPickupItemEvent;
|
||||||
import org.bukkit.event.inventory.InventoryType;
|
import org.bukkit.event.inventory.InventoryType;
|
||||||
@ -124,6 +128,7 @@ import org.bukkit.plugin.Plugin;
|
|||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
import org.bukkit.potion.PotionEffect;
|
import org.bukkit.potion.PotionEffect;
|
||||||
import org.bukkit.potion.PotionEffectType;
|
import org.bukkit.potion.PotionEffectType;
|
||||||
|
import org.bukkit.projectiles.ProjectileSource;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
@ -1367,6 +1372,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
log("pos is "+pos+" message is: {"+ev.getMessage()+"}",5);
|
log("pos is "+pos+" message is: {"+ev.getMessage()+"}",5);
|
||||||
DiscordMessageSender.sendRawMessageDiscord(("**"+ev.getPlayer().getName()+"** "+ev.getMessage().substring(0, pos)+"**["+ChatColor.stripColor(GenericFunctions.GetItemName(ev.getPlayer().getEquipment().getItemInMainHand()))+"]**"+"\n```"+WorldShop.GetItemInfo(ev.getPlayer().getEquipment().getItemInMainHand())+" ```\n"+ev.getMessage().substring(pos)));
|
DiscordMessageSender.sendRawMessageDiscord(("**"+ev.getPlayer().getName()+"** "+ev.getMessage().substring(0, pos)+"**["+ChatColor.stripColor(GenericFunctions.GetItemName(ev.getPlayer().getEquipment().getItemInMainHand()))+"]**"+"\n```"+WorldShop.GetItemInfo(ev.getPlayer().getEquipment().getItemInMainHand())+" ```\n"+ev.getMessage().substring(pos)));
|
||||||
Bukkit.dispatchCommand(Bukkit.getConsoleSender(),"tellraw @a [\"\",{\"text\":\"<"+ev.getPlayer().getName()+"> \"},{\"text\":\""+ev.getMessage().substring(0, pos)+"\"},{\"text\":\""+ChatColor.GREEN+"["+ChatColor.stripColor(GenericFunctions.GetItemName(ev.getPlayer().getEquipment().getItemInMainHand()))+ChatColor.GREEN+"]"+ChatColor.WHITE+"\",\"hoverEvent\":{\"action\":\"show_text\",\"value\":\""+GenericFunctions.GetItemName(ev.getPlayer().getEquipment().getItemInMainHand())+""+WorldShop.GetItemInfo(ev.getPlayer().getEquipment().getItemInMainHand()).replace("\"", "\\\"")+"\"}},{\"text\":\""+ev.getMessage().substring(pos)+"\"}]");
|
Bukkit.dispatchCommand(Bukkit.getConsoleSender(),"tellraw @a [\"\",{\"text\":\"<"+ev.getPlayer().getName()+"> \"},{\"text\":\""+ev.getMessage().substring(0, pos)+"\"},{\"text\":\""+ChatColor.GREEN+"["+ChatColor.stripColor(GenericFunctions.GetItemName(ev.getPlayer().getEquipment().getItemInMainHand()))+ChatColor.GREEN+"]"+ChatColor.WHITE+"\",\"hoverEvent\":{\"action\":\"show_text\",\"value\":\""+GenericFunctions.GetItemName(ev.getPlayer().getEquipment().getItemInMainHand())+""+WorldShop.GetItemInfo(ev.getPlayer().getEquipment().getItemInMainHand()).replace("\"", "\\\"")+"\"}},{\"text\":\""+ev.getMessage().substring(pos)+"\"}]");
|
||||||
|
|
||||||
ev.setCancelled(true);
|
ev.setCancelled(true);
|
||||||
}
|
}
|
||||||
//Bukkit.dispatchCommand(Bukkit.getConsoleSender(),"tellraw @a [\"\",{\"text\":\""+ChatColor.GREEN+"[Item]"+ChatColor.WHITE+"\",\"hoverEvent\":{\"action\":\"show_text\",\"value\":\""+(ev.getPlayer().getEquipment().getItemInMainHand().getType())+"\"}},{\"text\":\" "+ev.getMessage().substring(0, pos)+" \"}]");
|
//Bukkit.dispatchCommand(Bukkit.getConsoleSender(),"tellraw @a [\"\",{\"text\":\""+ChatColor.GREEN+"[Item]"+ChatColor.WHITE+"\",\"hoverEvent\":{\"action\":\"show_text\",\"value\":\""+(ev.getPlayer().getEquipment().getItemInMainHand().getType())+"\"}},{\"text\":\" "+ev.getMessage().substring(0, pos)+" \"}]");
|
||||||
@ -2669,12 +2675,73 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
,5);
|
,5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority=EventPriority.LOW)
|
||||||
|
public void PotionSplash(PotionSplashEvent ev) {
|
||||||
|
ThrownPotion tp = (ThrownPotion)ev.getEntity();
|
||||||
|
LivingEntity ps = (LivingEntity)tp.getShooter();
|
||||||
|
if (ps instanceof Witch) {
|
||||||
|
//We know a witch threw this. Apply Poison IV to all affected entities.
|
||||||
|
Witch w = (Witch)ps;
|
||||||
|
boolean isPoison=false;
|
||||||
|
int duration=0;
|
||||||
|
for (int j=0;j<ev.getPotion().getEffects().size();j++) {
|
||||||
|
if (Iterables.get(ev.getPotion().getEffects(), j).getType().equals(PotionEffectType.POISON)) {
|
||||||
|
isPoison=true;
|
||||||
|
duration=Iterables.get(ev.getPotion().getEffects(), j).getDuration();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isPoison) {
|
||||||
|
for (int i=0;i<ev.getAffectedEntities().size();i++) {
|
||||||
|
switch (MonsterController.getMonsterDifficulty(w)) {
|
||||||
|
case DANGEROUS:{
|
||||||
|
Iterables.get(ev.getAffectedEntities(), i).addPotionEffect(new PotionEffect(PotionEffectType.POISON,duration+1,1)); //Poison II
|
||||||
|
}break;
|
||||||
|
case DEADLY:{
|
||||||
|
Iterables.get(ev.getAffectedEntities(), i).addPotionEffect(new PotionEffect(PotionEffectType.POISON,duration+1,2)); //Poison III
|
||||||
|
}break;
|
||||||
|
case HELLFIRE:{
|
||||||
|
Iterables.get(ev.getAffectedEntities(), i).addPotionEffect(new PotionEffect(PotionEffectType.POISON,duration+1,3)); //Poison IV
|
||||||
|
}break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler(priority=EventPriority.LOW)
|
@EventHandler(priority=EventPriority.LOW)
|
||||||
public void updateHealthbarDamageEvent(EntityDamageEvent ev) {
|
public void updateHealthbarDamageEvent(EntityDamageEvent ev) {
|
||||||
Entity e = ev.getEntity();
|
Entity e = ev.getEntity();
|
||||||
|
|
||||||
|
if (ev.getCause()==DamageCause.FIRE || ev.getCause()==DamageCause.FIRE_TICK ||
|
||||||
|
ev.getCause()==DamageCause.WITHER || ev.getCause()==DamageCause.POISON
|
||||||
|
|| ev.getCause()==DamageCause.THORNS) {
|
||||||
|
if (ev.getEntity() instanceof LivingEntity) {
|
||||||
|
ev.setDamage(DamageModifier.MAGIC,0);
|
||||||
|
ev.setDamage(DamageModifier.RESISTANCE,0);
|
||||||
|
ev.setDamage(DamageModifier.ARMOR,0);
|
||||||
|
//Calculate as true damage.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (e instanceof Player) {
|
if (e instanceof Player) {
|
||||||
log("Damage reason is "+ev.getCause().toString(),4);
|
log("Damage reason is "+ev.getCause().toString(),4);
|
||||||
final Player p = (Player)e;
|
final Player p = (Player)e;
|
||||||
|
|
||||||
|
int poisonlv = 0;
|
||||||
|
if (p.hasPotionEffect(PotionEffectType.POISON)) {
|
||||||
|
for (int j=0;j<p.getActivePotionEffects().size();j++) {
|
||||||
|
if (Iterables.get(p.getActivePotionEffects(), j).getType().equals(PotionEffectType.POISON)) {
|
||||||
|
poisonlv = Iterables.get(p.getActivePotionEffects(), j).getAmplifier()+1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (poisonlv>0 && ev.getCause()!=DamageCause.POISON) {
|
||||||
|
ev.setDamage(ev.getDamage()+(ev.getDamage()*poisonlv*0.5));
|
||||||
|
log("New damage set to "+ev.getDamage()+" from Poison "+poisonlv,3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (ev.getCause()==DamageCause.ENTITY_EXPLOSION ||
|
if (ev.getCause()==DamageCause.ENTITY_EXPLOSION ||
|
||||||
ev.getCause()==DamageCause.BLOCK_EXPLOSION) {
|
ev.getCause()==DamageCause.BLOCK_EXPLOSION) {
|
||||||
//Calculate new damage based on armor worn.
|
//Calculate new damage based on armor worn.
|
||||||
@ -2950,7 +3017,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.
|
||||||
CalculateDamageDealtToMob(p.getInventory().getItemInMainHand(),p,m);
|
DealDamageToMob(p.getInventory().getItemInMainHand(),p,m);
|
||||||
if (m instanceof Monster) {
|
if (m instanceof Monster) {
|
||||||
if (!m.hasPotionEffect(PotionEffectType.GLOWING) || GenericFunctions.isDefender(p)) {
|
if (!m.hasPotionEffect(PotionEffectType.GLOWING) || GenericFunctions.isDefender(p)) {
|
||||||
if (GenericFunctions.isDefender(p)) {
|
if (GenericFunctions.isDefender(p)) {
|
||||||
@ -3122,6 +3189,28 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (killedByPlayer) {
|
if (killedByPlayer) {
|
||||||
|
//Get the player that killed the monster.
|
||||||
|
int luckmult = 0;
|
||||||
|
int unluckmult = 0;
|
||||||
|
Player p = (Player)m.getKiller();
|
||||||
|
if (p.hasPotionEffect(PotionEffectType.LUCK) ||
|
||||||
|
p.hasPotionEffect(PotionEffectType.UNLUCK)) {
|
||||||
|
for (int i=0;i<p.getActivePotionEffects().size();i++) {
|
||||||
|
if (Iterables.get(p.getActivePotionEffects(), i).getType().equals(PotionEffectType.LUCK)) {
|
||||||
|
luckmult = Iterables.get(p.getActivePotionEffects(), i).getAmplifier()+1;
|
||||||
|
} else
|
||||||
|
if (Iterables.get(p.getActivePotionEffects(), i).getType().equals(PotionEffectType.UNLUCK)) {
|
||||||
|
unluckmult = Iterables.get(p.getActivePotionEffects(), i).getAmplifier()+1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dropmult = dropmult + (luckmult * 0.5) - (unluckmult * 0.5);
|
||||||
|
|
||||||
|
if (luckmult>0 || unluckmult>0) {
|
||||||
|
log("Modified luck rate is now "+dropmult,3);
|
||||||
|
}
|
||||||
|
|
||||||
droplist.addAll(MonsterController.getMonsterDifficulty((Monster)ev.getEntity()).RandomizeDrops(dropmult, isBoss));
|
droplist.addAll(MonsterController.getMonsterDifficulty((Monster)ev.getEntity()).RandomizeDrops(dropmult, isBoss));
|
||||||
final List<ItemStack> drop = new ArrayList<ItemStack>();
|
final List<ItemStack> drop = new ArrayList<ItemStack>();
|
||||||
drop.addAll(droplist);
|
drop.addAll(droplist);
|
||||||
@ -3462,6 +3551,17 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority=EventPriority.LOW)
|
||||||
|
public void onHopperSuction(InventoryMoveItemEvent ev) {
|
||||||
|
Inventory source = ev.getSource();
|
||||||
|
Location l = source.getLocation();
|
||||||
|
//See if this block is a world shop.
|
||||||
|
if (WorldShop.grabShopSign(l)!=null) {
|
||||||
|
//This is a world shop. DO NOT allow this to happen.
|
||||||
|
ev.setCancelled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler(priority=EventPriority.LOW)
|
@EventHandler(priority=EventPriority.LOW)
|
||||||
public void onHopperSuction(InventoryPickupItemEvent ev) {
|
public void onHopperSuction(InventoryPickupItemEvent ev) {
|
||||||
//Check the item getting sucked in.
|
//Check the item getting sucked in.
|
||||||
@ -4197,7 +4297,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
Iterables.get(p.getActivePotionEffects(), i).getType().equals(PotionEffectType.SLOW) ||
|
Iterables.get(p.getActivePotionEffects(), i).getType().equals(PotionEffectType.SLOW) ||
|
||||||
Iterables.get(p.getActivePotionEffects(), i).getType().equals(PotionEffectType.SLOW_DIGGING) ||
|
Iterables.get(p.getActivePotionEffects(), i).getType().equals(PotionEffectType.SLOW_DIGGING) ||
|
||||||
Iterables.get(p.getActivePotionEffects(), i).getType().equals(PotionEffectType.WEAKNESS) ||
|
Iterables.get(p.getActivePotionEffects(), i).getType().equals(PotionEffectType.WEAKNESS) ||
|
||||||
Iterables.get(p.getActivePotionEffects(), i).getType().equals(PotionEffectType.WITHER)) {
|
Iterables.get(p.getActivePotionEffects(), i).getType().equals(PotionEffectType.WITHER) ||
|
||||||
|
Iterables.get(p.getActivePotionEffects(), i).getType().equals(PotionEffectType.UNLUCK)) {
|
||||||
hasDebuff=true;
|
hasDebuff=true;
|
||||||
}
|
}
|
||||||
if (Iterables.get(p.getActivePotionEffects(), i).getType().equals(PotionEffectType.ABSORPTION)) {
|
if (Iterables.get(p.getActivePotionEffects(), i).getType().equals(PotionEffectType.ABSORPTION)) {
|
||||||
@ -4590,7 +4691,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
}}
|
}}
|
||||||
,1);*/
|
,1);*/
|
||||||
|
|
||||||
public double CalculateWeaponDamage(LivingEntity p, LivingEntity target) {
|
public static double CalculateWeaponDamage(LivingEntity p, LivingEntity target) {
|
||||||
|
|
||||||
ItemStack weapon = p.getEquipment().getItemInMainHand();
|
ItemStack weapon = p.getEquipment().getItemInMainHand();
|
||||||
|
|
||||||
@ -4763,7 +4864,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
return finalamt;
|
return finalamt;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CalculateDamageDealtToMob(ItemStack weapon, LivingEntity p, LivingEntity target) {
|
public static void DealDamageToMob(ItemStack weapon, LivingEntity p, LivingEntity target) {
|
||||||
//Deals custom calculated damage to a given target.
|
//Deals custom calculated damage to a given target.
|
||||||
//Because we do not want to use Minecraft's built-in combat system, we will
|
//Because we do not want to use Minecraft's built-in combat system, we will
|
||||||
//create our own.
|
//create our own.
|
||||||
|
@ -99,8 +99,11 @@ public final class TwosideKeeperAPI {
|
|||||||
public static double getModifiedDamage(double dmg_amt, LivingEntity p) {
|
public static double getModifiedDamage(double dmg_amt, LivingEntity p) {
|
||||||
return TwosideKeeper.CalculateDamageReduction(dmg_amt, p, p);
|
return TwosideKeeper.CalculateDamageReduction(dmg_amt, p, p);
|
||||||
}
|
}
|
||||||
|
public static void DealModifiedDamageToEntity(ItemStack weapon, LivingEntity damager, LivingEntity target) {
|
||||||
|
TwosideKeeper.DealDamageToMob(weapon, damager, target);
|
||||||
|
}
|
||||||
|
|
||||||
//Spleef COMMANDS.
|
//Message COMMANDS.
|
||||||
public static void playMessageNotification(Player sender) {
|
public static void playMessageNotification(Player sender) {
|
||||||
TwosideKeeper.playMessageNotification(sender);
|
TwosideKeeper.playMessageNotification(sender);
|
||||||
}
|
}
|
||||||
@ -110,7 +113,7 @@ public final class TwosideKeeperAPI {
|
|||||||
return SpleefManager.playerIsPlayingSpleef(p);
|
return SpleefManager.playerIsPlayingSpleef(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Friendly Name COMMANDS.
|
//Localization COMMANDS.
|
||||||
public static String getLocalizedItemName(ItemStack i) {
|
public static String getLocalizedItemName(ItemStack i) {
|
||||||
return GenericFunctions.UserFriendlyMaterialName(i);
|
return GenericFunctions.UserFriendlyMaterialName(i);
|
||||||
}
|
}
|
||||||
|
@ -188,6 +188,7 @@ public class WorldShopManager {
|
|||||||
UpdateSession(type,p);
|
UpdateSession(type,p);
|
||||||
WorldShopSession ss = GetSession(p);
|
WorldShopSession ss = GetSession(p);
|
||||||
ss.SetSign(s);
|
ss.SetSign(s);
|
||||||
|
ss.UpdateTime();
|
||||||
return ss;
|
return ss;
|
||||||
} else {
|
} else {
|
||||||
WorldShopSession sss = new WorldShopSession(p, TwosideKeeper.getServerTickTime(), type, s);
|
WorldShopSession sss = new WorldShopSession(p, TwosideKeeper.getServerTickTime(), type, s);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user