->Ranger mode allows you to use items in your offhand now while
maintaining Ranger mode status. ->Fix a bug with AoE applying to every type of weapon, even with no AoE. ->Artifact pickaxes are no longer considered weapons. ->Fix MalleableBaseQuest not accepting player-made potions as valid items. ->Lowered speed of Shadow Walker by one tier. ->Fix Hellfire Endermen being set on fire.
This commit is contained in:
parent
d53916335e
commit
7ba0208943
Binary file not shown.
@ -1,6 +1,6 @@
|
||||
name: TwosideKeeper
|
||||
main: sig.plugin.TwosideKeeper.TwosideKeeper
|
||||
version: 3.6.2a
|
||||
version: 3.6.2r1
|
||||
commands:
|
||||
money:
|
||||
description: Tells the player the amount of money they are holding.
|
||||
|
@ -176,10 +176,12 @@ public enum ArtifactAbility {
|
||||
}
|
||||
|
||||
public double GetBaseValue(int tier) {
|
||||
if (tier<=0) {tier=1;}
|
||||
return this.baseval[tier-1];
|
||||
}
|
||||
|
||||
public double GetDecayValue(int tier) {
|
||||
if (tier<=0) {tier=1;}
|
||||
return this.decayval[tier-1];
|
||||
}
|
||||
|
||||
@ -195,7 +197,6 @@ public enum ArtifactAbility {
|
||||
|
||||
public static double calculateValue(ArtifactAbility ability, int artifacttier, int abilitylevel) {
|
||||
double sum=0;
|
||||
if (artifacttier<=0) {artifacttier=1;}
|
||||
TwosideKeeper.log("Ability "+ability.GetName(), 4);
|
||||
for(int i=0;i<abilitylevel;i++){
|
||||
TwosideKeeper.log("Old Sum:"+sum+"::i:"+i, 5);
|
||||
|
@ -1531,6 +1531,9 @@ public class GenericFunctions {
|
||||
case GOLD_SWORD:{
|
||||
return "Golden Sword";
|
||||
}
|
||||
case HAY_BLOCK:{
|
||||
return "Hay Bale";
|
||||
}
|
||||
default:{
|
||||
return GenericFunctions.CapitalizeFirstLetters(type.getType().toString().replace("_", " "));
|
||||
}
|
||||
@ -1804,7 +1807,7 @@ public class GenericFunctions {
|
||||
public static boolean isArtifactWeapon(ItemStack item) {
|
||||
if (item!=null &&
|
||||
item.getType()!=Material.AIR && (item.getType().toString().contains("BOW") ||
|
||||
item.getType().toString().contains("AXE") ||
|
||||
(item.getType().toString().contains("AXE") && !item.getType().toString().contains("PICKAXE")) ||
|
||||
item.getType().toString().contains("SWORD") ||
|
||||
item.getType().toString().contains("FISHING_ROD") ||
|
||||
item.getType().toString().contains("HOE"))) {
|
||||
@ -1853,7 +1856,7 @@ public class GenericFunctions {
|
||||
}
|
||||
public static boolean isRanger(Player p) {
|
||||
if (p!=null && !p.isDead() && p.getEquipment().getItemInMainHand()!=null && p.getEquipment().getItemInMainHand().getType()==Material.BOW &&
|
||||
(p.getInventory().getExtraContents()[0]==null || p.getInventory().getExtraContents()[0].getType().toString().contains("ARROW")) &&
|
||||
(p.getInventory().getExtraContents()[0]==null || !p.getInventory().getExtraContents()[0].getType().toString().contains("SHIELD")) &&
|
||||
AllLeatherArmor(p)) {
|
||||
return true;
|
||||
} else {
|
||||
|
@ -115,6 +115,18 @@ public class MalleableBaseQuest {
|
||||
ItemMeta m = base.getItemMeta();
|
||||
List<String> lore = m.getLore();
|
||||
String material_name = lore.get(1).split("'")[1];
|
||||
if (lore.get(1).contains("Arrow of")) {
|
||||
return "Tipped Arrow";
|
||||
} else
|
||||
if (lore.get(1).contains("Splash Potion")) {
|
||||
return "Splash Potion";
|
||||
} else
|
||||
if (lore.get(1).contains("Lingering Potion")) {
|
||||
return "Lingering Potion";
|
||||
} else
|
||||
if (lore.get(1).contains("Potion")) {
|
||||
return "Potion";
|
||||
} else
|
||||
if (lore.get(1).contains("Jack o")) {
|
||||
return "Jack o'Lantern";
|
||||
} else {
|
||||
|
81
src/sig/plugin/TwosideKeeper/ItemCubeWindow.java
Normal file
81
src/sig/plugin/TwosideKeeper/ItemCubeWindow.java
Normal file
@ -0,0 +1,81 @@
|
||||
package sig.plugin.TwosideKeeper;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.InventoryView;
|
||||
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.ItemCube;
|
||||
|
||||
public class ItemCubeWindow {
|
||||
int id = 0;
|
||||
int size = 0;
|
||||
|
||||
public ItemCubeWindow(int id, int size) {
|
||||
this.id=id;
|
||||
this.size=size;
|
||||
}
|
||||
|
||||
public static void addItemCubeWindow(Player p, int id, int size) {
|
||||
PlayerStructure pd = (PlayerStructure)TwosideKeeper.playerdata.get(p.getUniqueId());
|
||||
pd.openeditemcube.add(new ItemCubeWindow(id, size));
|
||||
pd.opened_inventory = true;
|
||||
TwosideKeeper.log("Item Cube Window added. List is now size "+pd.openeditemcube.size(),2);
|
||||
}
|
||||
|
||||
public static void popItemCubeWindow(Player p) {
|
||||
PlayerStructure pd = (PlayerStructure)TwosideKeeper.playerdata.get(p.getUniqueId());
|
||||
if (!pd.opened_inventory &&
|
||||
pd.openeditemcube.size()>0) {
|
||||
ItemCubeWindow window = pd.openeditemcube.remove(pd.openeditemcube.size()-1);
|
||||
TwosideKeeper.log("Item Cube Window removed. List is now size "+pd.openeditemcube.size(),2);
|
||||
pd.opened_inventory=true;
|
||||
openItemCube(p,window.id,window.size,false); //Open this item cube without adding it to the list. We're not nesting this one.
|
||||
}
|
||||
TwosideKeeper.log("pd.opened_inventory was "+pd.opened_inventory+". List size is "+pd.openeditemcube.size(),2);
|
||||
}
|
||||
|
||||
public static void removeAllItemCubeWindows(Player p) {
|
||||
PlayerStructure pd = (PlayerStructure)TwosideKeeper.playerdata.get(p.getUniqueId());
|
||||
pd.openeditemcube.clear();
|
||||
}
|
||||
|
||||
//New open item cube method to handle all opening of item cubes.
|
||||
public static void openItemCube(Player p, int id, int size, boolean addToList) {
|
||||
TwosideKeeper.log("Called.", 2);
|
||||
PlayerStructure pd = (PlayerStructure)TwosideKeeper.playerdata.get(p.getUniqueId());
|
||||
if (addToList &&
|
||||
isViewingItemCubeInventory(p)) {
|
||||
addItemCubeWindow(p,getViewingItemCubeID(p),getViewingItemCubeInventorySize(p));
|
||||
}
|
||||
if (!ItemCube.isSomeoneViewingItemCube(id,p)) {
|
||||
InventoryView newinv = p.openInventory(Bukkit.getServer().createInventory(p, size, "Item Cube #"+id));
|
||||
TwosideKeeper.loadItemCubeInventory(newinv.getTopInventory(),newinv);
|
||||
p.playSound(p.getLocation(), Sound.BLOCK_CHEST_OPEN, 1.0f, 1.0f);
|
||||
} else {
|
||||
//ItemCube.displayErrorMessage(p);
|
||||
p.openInventory(ItemCube.getViewingItemCubeInventory(id, p));
|
||||
p.playSound(p.getLocation(), Sound.BLOCK_CHEST_OPEN, 1.0f, 1.0f);
|
||||
}
|
||||
pd.isViewingItemCube=true;
|
||||
pd.opened_inventory=false;
|
||||
}
|
||||
|
||||
public static boolean isViewingItemCubeInventory(Player p) {
|
||||
PlayerStructure pd = (PlayerStructure)TwosideKeeper.playerdata.get(p.getUniqueId());
|
||||
TwosideKeeper.log("Are we viewing it? "+pd.isViewingItemCube,2);
|
||||
return pd.isViewingItemCube;
|
||||
}
|
||||
|
||||
public static int getViewingItemCubeID(Player p) {
|
||||
if (p.getOpenInventory().getTitle().contains("#")) {
|
||||
String inventoryTitle = p.getOpenInventory().getTitle();
|
||||
return Integer.parseInt(inventoryTitle.split("#")[1]);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public static int getViewingItemCubeInventorySize(Player p) {
|
||||
return p.getOpenInventory().getTopInventory().getSize();
|
||||
}
|
||||
}
|
@ -602,8 +602,6 @@ public class MonsterController {
|
||||
m.setHealth(m.getMaxHealth());
|
||||
if (m.getType()!=EntityType.ENDERMAN) {
|
||||
m.setFireTicks(999999);
|
||||
} else {
|
||||
m.setFireTicks(120);
|
||||
}
|
||||
if (isAllowedToEquipItems(m)) {
|
||||
m.getEquipment().clear();
|
||||
|
@ -65,7 +65,7 @@ public class PlayerStructure {
|
||||
public boolean hasfullrangerset=false;
|
||||
public double lastarrowpower=0;
|
||||
public int headshotcombo=0;
|
||||
public List<InventoryView> itemcubeviews;
|
||||
public List<ItemCubeWindow> openeditemcube;
|
||||
public boolean openinginventory=false;
|
||||
public boolean fulldodge=false;
|
||||
public long last_dodge=TwosideKeeper.getServerTickTime();
|
||||
@ -110,7 +110,7 @@ public class PlayerStructure {
|
||||
this.nextarrowxp=0;
|
||||
this.hasfullrangerset=false;
|
||||
this.last_strikerspell=TwosideKeeper.getServerTickTime();
|
||||
this.itemcubeviews = new ArrayList<InventoryView>();
|
||||
this.openeditemcube = new ArrayList<ItemCubeWindow>();
|
||||
this.openinginventory = false;
|
||||
this.fulldodge=false;
|
||||
this.last_dodge=TwosideKeeper.getServerTickTime();
|
||||
|
@ -611,12 +611,12 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
for (int i3=0;i3<p.getEquipment().getArmorContents().length;i3++) {
|
||||
if (ArtifactAbility.containsEnchantment(ArtifactAbility.SHADOWWALKER, p.getEquipment().getArmorContents()[i3]) &&
|
||||
p.isOnGround() && p.getLocation().getY()>=0 && p.getLocation().add(0,0,0).getBlock().getLightLevel()<=4) {
|
||||
p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED,20,2));
|
||||
p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED,20,1));
|
||||
}
|
||||
}
|
||||
if (ArtifactAbility.containsEnchantment(ArtifactAbility.SHADOWWALKER, p.getEquipment().getItemInMainHand()) &&
|
||||
p.isOnGround() && p.getLocation().getY()>=0 && p.getLocation().add(0,0,0).getBlock().getLightLevel()<=4) {
|
||||
p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED,20,2));
|
||||
p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED,20,1));
|
||||
//log("Apply speed. The light level here is "+p.getLocation().add(0,-1,0).getBlock().getLightLevel(),2);
|
||||
}
|
||||
|
||||
@ -834,7 +834,9 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
p.getLocation().add(0,0,0).getBlock().setType(Material.AIR);
|
||||
}
|
||||
if (SERVER_TYPE==ServerType.TEST || SERVER_TYPE==ServerType.QUIET) {
|
||||
TwosideKeeperAPI.spawnAdjustedMonster(MonsterType.GIANT, p.getLocation());
|
||||
//TwosideKeeperAPI.spawnAdjustedMonster(MonsterType.GIANT, p.getLocation());
|
||||
|
||||
Arrow newar = p.getWorld().spawnArrow(p.getLocation(), p.getLocation().getDirection(), 1f, 12f);
|
||||
//GenericFunctions.setBowMode(p.getEquipment().getItemInMainHand(), BowMode.SNIPE);
|
||||
//p.sendMessage("This is bow mode "+GenericFunctions.getBowMode(p.getEquipment().getItemInMainHand()));
|
||||
/*for (int i=0;i<p.getEquipment().getArmorContents().length;i++) {
|
||||
@ -1953,7 +1955,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
//0-8 are the hotbar slots.
|
||||
for (int i=0;i<=8;i++) {
|
||||
if (ev.getPlayer().getInventory().getItem(i)!=null) {
|
||||
log("Malleable Base Quest: Comparing "+ev.getPlayer().getInventory().getItem(i).getType()+" to "+ev.getPlayer().getInventory().getItem(i).getType(),4);
|
||||
log("Malleable Base Quest: Comparing "+GenericFunctions.UserFriendlyMaterialName(ev.getPlayer().getInventory().getItem(i))+" to "+MalleableBaseQuest.getItem(ev.getPlayer().getEquipment().getItemInMainHand()),2);
|
||||
}
|
||||
if (ev.getPlayer().getInventory().getItem(i)!=null && GenericFunctions.hasNoLore(ev.getPlayer().getInventory().getItem(i)) && !Artifact.isArtifact(ev.getPlayer().getInventory().getItem(i)) && GenericFunctions.UserFriendlyMaterialName(ev.getPlayer().getInventory().getItem(i)).equalsIgnoreCase(MalleableBaseQuest.getItem(ev.getPlayer().getEquipment().getItemInMainHand()))) {
|
||||
//This is good. Take one away from the player to continue the quest.
|
||||
@ -4158,7 +4160,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
}
|
||||
|
||||
//Headshot detection.
|
||||
log("Abs() subtraction: "+(((Arrow)(ev.getDamager())).getLocation().subtract(m.getEyeLocation())).toString(),4);
|
||||
//log("Abs() subtraction: "+(((Arrow)(ev.getDamager())).getLocation().subtract(m.getEyeLocation())).toString(),2);
|
||||
|
||||
//Headshot conditions:
|
||||
/*
|
||||
@ -4169,8 +4171,13 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
ev.setDamage(DamageModifier.RESISTANCE,0);
|
||||
ev.setDamage(DamageModifier.ARMOR,0);
|
||||
|
||||
Location arrowLoc = ((Arrow)(ev.getDamager())).getLocation();
|
||||
Location monsterHead = m.getEyeLocation().add(0,0.105,0);
|
||||
Location arrowLoc = ((Arrow)(ev.getDamager())).getLocation().add(ev.getDamager().getVelocity());
|
||||
|
||||
|
||||
Location monsterHead = m.getEyeLocation();
|
||||
|
||||
log("Arrow Original Hit: "+((Arrow)(ev.getDamager())).getLocation().toString()+", Arrow+Velocity: "+arrowLoc.toString()+"::Velocity: "+ev.getDamager().getVelocity().toString()+", Head Target: "+monsterHead.toString(),2);
|
||||
|
||||
boolean headshot=false;
|
||||
|
||||
ev.setDamage(CalculateWeaponDamage(p,m));
|
||||
@ -4196,6 +4203,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
headshotvalx*=3;
|
||||
headshotvaly*=3;
|
||||
headshotvalz*=3;
|
||||
aPlugin.API.sendSoundlessExplosion(arrowLoc, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -4210,6 +4218,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
|
||||
log("Headshot hitbox size Multiplier: x"+mult,4);
|
||||
log(headshotvalx+","+headshotvaly+","+headshotvalz,5);
|
||||
log("X: "+Math.abs(arrowLoc.getX()-monsterHead.getX())+", Y: "+Math.abs(arrowLoc.getY()-monsterHead.getY())+", Z: "+Math.abs(arrowLoc.getZ()-monsterHead.getZ()),2);
|
||||
|
||||
if (ev.getDamager().getTicksLived()>=4 || GenericFunctions.isRanger(p)) {
|
||||
if (Math.abs(arrowLoc.getY()-monsterHead.getY())<=headshotvaly) {
|
||||
@ -4984,16 +4993,21 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
public void onArrowShoot(ProjectileLaunchEvent ev) {
|
||||
if (ev.getEntity() instanceof Arrow) {
|
||||
Arrow arr = (Arrow)ev.getEntity();
|
||||
if (arr.getShooter() instanceof Player) {
|
||||
//Arrow newarrow = arr.getLocation().getWorld().spawnArrow(arr.getLocation(), arr.getVelocity(), 1, 12);
|
||||
ev.setCancelled(true);
|
||||
if (arr.getShooter() instanceof Player &&
|
||||
arr.getCustomName()==null) {
|
||||
Player p = (Player)arr.getShooter();
|
||||
if (GenericFunctions.isRanger(p)) {
|
||||
arr.setVelocity(arr.getVelocity().multiply(4));
|
||||
//arr.setVelocity(arr.getVelocity().multiply(4));
|
||||
if (GenericFunctions.getBowMode(p.getEquipment().getItemInMainHand())==BowMode.SNIPE) {
|
||||
aPlugin.API.damageItem(p, p.getEquipment().getItemInMainHand(), 3);
|
||||
//p.getEquipment().getItemInMainHand().setDurability((short)(p.getEquipment().getItemInMainHand().getDurability()+1));
|
||||
}
|
||||
//p.getWorld().spawnArrow(arr.getLocation(), arr.getLocation().getDirection(), 20, 1);
|
||||
}
|
||||
Arrow newarrow = arr.getLocation().getWorld().spawnArrow(arr.getLocation(), arr.getLocation().getDirection(), 1, 12);
|
||||
newarrow.setCustomName("HIT");
|
||||
PlayerStructure pd = (PlayerStructure)playerdata.get(p.getUniqueId());
|
||||
pd.lastarrowpower=arr.getVelocity().lengthSquared();
|
||||
log("Arrow velocity is "+arr.getVelocity().lengthSquared(),4);
|
||||
@ -5006,13 +5020,9 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
if (ev.getEntity() instanceof Arrow) {
|
||||
Arrow ar = (Arrow)ev.getEntity();
|
||||
if (ar.getShooter()!=null &&
|
||||
ar.getCustomName()==null &&
|
||||
(ar.getShooter() instanceof Player)) {
|
||||
Player p = (Player)ar.getShooter();
|
||||
if (GenericFunctions.isRanger(p)
|
||||
&& GenericFunctions.getBowMode(p.getEquipment().getItemInMainHand())==BowMode.SNIPE) {
|
||||
//This arrow was shot from a sniper.
|
||||
aPlugin.API.sendSoundlessExplosion(ar.getLocation(), 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -6137,7 +6147,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
String MonsterName = pd2.target.getType().toString().toLowerCase();
|
||||
if (pd2.target.getCustomName()!=null) {
|
||||
MonsterName = pd2.target.getCustomName();
|
||||
if (MonsterName.contains(ChatColor.DARK_RED+"Hellfire")) {
|
||||
if (MonsterName.contains(ChatColor.DARK_RED+"Hellfire") &&
|
||||
pd2.target.getType()!=EntityType.ENDERMAN) {
|
||||
pd2.target.setFireTicks(99999);
|
||||
}
|
||||
if (pd2.target.getCustomName()!=null &&
|
||||
@ -6301,6 +6312,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
|
||||
if (GenericFunctions.isHardenedItem(weapon)) {
|
||||
basedmg*=2;
|
||||
log("Damage: "+basedmg,2);
|
||||
}
|
||||
|
||||
if (weapon.getType()==Material.BOW) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user