diff --git a/TwosideKeeper.jar b/TwosideKeeper.jar index faae6d3..ebbaf6c 100644 Binary files a/TwosideKeeper.jar and b/TwosideKeeper.jar differ diff --git a/src/plugin.yml b/src/plugin.yml index b11bcf7..85ec5a0 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -1,6 +1,6 @@ name: TwosideKeeper main: sig.plugin.TwosideKeeper.TwosideKeeper -version: 3.6.1r1 +version: 3.6.2 commands: money: description: Tells the player the amount of money they are holding. diff --git a/src/sig/plugin/TwosideKeeper/HelperStructures/AnvilItem.java b/src/sig/plugin/TwosideKeeper/HelperStructures/AnvilItem.java new file mode 100644 index 0000000..001cdf2 --- /dev/null +++ b/src/sig/plugin/TwosideKeeper/HelperStructures/AnvilItem.java @@ -0,0 +1,52 @@ +package sig.plugin.TwosideKeeper.HelperStructures; + +import org.bukkit.ChatColor; +import org.bukkit.Material; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; + +import sig.plugin.TwosideKeeper.TwosideKeeper; + +public class AnvilItem { + ItemStack olditem; + ItemStack newitem; + + public AnvilItem(ItemStack olditem, ItemStack newitem) { + this.olditem=olditem; + this.newitem=newitem; + } + + public static boolean validitem(ItemStack item) { + return (item!=null && item.getType()!=Material.AIR && + item.hasItemMeta() && item.getItemMeta().hasDisplayName()); + } + + public String getColorCodes() { + ItemMeta m = olditem.getItemMeta(); + return m.getDisplayName().replace(ChatColor.stripColor(m.getDisplayName()), ""); + } + + public ItemStack renameItemProperly() { + if (validitem(olditem) && validitem(newitem)) { + //Input Item : ᶲ2+Test New Item: 2Jelly + String var = getColorCodes(); //var = ChatColor.RED (ᶲ2) + TwosideKeeper.log("var = "+var, 2); + String newcol = newitem.getItemMeta().getDisplayName(); //2Jelly + String colors = ""; + if (var.length()>=2) { + colors = var.replace(ChatColor.COLOR_CHAR+"", ""); //2 + } + + if (newcol.indexOf(colors)==0) { + //See if the new name starts with the color codes. + ItemMeta m = newitem.getItemMeta(); + m.setDisplayName(newcol.replace(colors, var)); //ᶲ2+jelly + newitem.setItemMeta(m); + return newitem; + } + + } + + return newitem; + } +} diff --git a/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java b/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java index 49e7165..9bc4379 100644 --- a/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java +++ b/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java @@ -2377,6 +2377,9 @@ public class GenericFunctions { if (isRanger(p)) { dodgechance+=0.5; } + if (pd.fulldodge) { + dodgechance = 1.0; + } return dodgechance; } diff --git a/src/sig/plugin/TwosideKeeper/MonsterController.java b/src/sig/plugin/TwosideKeeper/MonsterController.java index e298b7e..201c72c 100644 --- a/src/sig/plugin/TwosideKeeper/MonsterController.java +++ b/src/sig/plugin/TwosideKeeper/MonsterController.java @@ -37,13 +37,19 @@ public class MonsterController { * @return Returns false if this spawn is not allowed. */ public static boolean MobHeightControl(LivingEntity ent, boolean minion) { + + if (ent instanceof Monster) { + Monster m = (Monster)ent; + m.setAI(true); + } + //Modify spawning algorithm. int ylv = ent.getLocation().getBlockY(); if (minion) { ylv+=16; ent.addPotionEffect(new PotionEffect(PotionEffectType.SPEED,999999,1)); - ent.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE,999999,1)); - ent.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE,999999,4)); + ent.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE,999999,0)); + ent.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE,999999,3)); ent.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION,999999,4)); } if (isZombieLeader(ent)) { diff --git a/src/sig/plugin/TwosideKeeper/PlayerStructure.java b/src/sig/plugin/TwosideKeeper/PlayerStructure.java index 82af08f..efe7a8a 100644 --- a/src/sig/plugin/TwosideKeeper/PlayerStructure.java +++ b/src/sig/plugin/TwosideKeeper/PlayerStructure.java @@ -14,6 +14,7 @@ import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.entity.Entity; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; +import org.bukkit.inventory.InventoryView; import org.bukkit.inventory.ItemStack; import org.bukkit.util.Vector; @@ -64,6 +65,10 @@ public class PlayerStructure { public boolean hasfullrangerset=false; public double lastarrowpower=0; public int headshotcombo=0; + public List itemcubeviews; + public boolean openinginventory=false; + public boolean fulldodge=false; + public long last_dodge=TwosideKeeper.getServerTickTime(); public double prev_weapondmg=0.0; public double prev_buffdmg=0.0; @@ -105,6 +110,10 @@ public class PlayerStructure { this.nextarrowxp=0; this.hasfullrangerset=false; this.last_strikerspell=TwosideKeeper.getServerTickTime(); + this.itemcubeviews = new ArrayList(); + this.openinginventory = false; + this.fulldodge=false; + this.last_dodge=TwosideKeeper.getServerTickTime(); //Set defaults first, in case this is a new user. loadConfig(); diff --git a/src/sig/plugin/TwosideKeeper/TwosideKeeper.java b/src/sig/plugin/TwosideKeeper/TwosideKeeper.java index 24fd1ca..e4ebfad 100644 --- a/src/sig/plugin/TwosideKeeper/TwosideKeeper.java +++ b/src/sig/plugin/TwosideKeeper/TwosideKeeper.java @@ -158,6 +158,7 @@ import net.md_5.bungee.api.chat.HoverEvent; import net.md_5.bungee.api.chat.TextComponent; import net.minecraft.server.v1_9_R1.MinecraftServer; import net.minecraft.server.v1_9_R1.Vector3f; +import sig.plugin.TwosideKeeper.HelperStructures.AnvilItem; import sig.plugin.TwosideKeeper.HelperStructures.ArtifactAbility; import sig.plugin.TwosideKeeper.HelperStructures.ArtifactItem; import sig.plugin.TwosideKeeper.HelperStructures.ArtifactItemType; @@ -269,7 +270,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener { sig.plugin.TwosideKeeper.Recipes.Initialize_ItemCube_Recipes(); sig.plugin.TwosideKeeper.Recipes.Initialize_ArrowQuiver_Recipe(); sig.plugin.TwosideKeeper.Recipes.Initialize_BlockArmor_Recipes(); - sig.plugin.TwosideKeeper.Recipes.Initialize_ItemDeconstruction_Recipes(); + //sig.plugin.TwosideKeeper.Recipes.Initialize_ItemDeconstruction_Recipes(); sig.plugin.TwosideKeeper.Recipes.Initialize_WoolRecolor_Recipes(); sig.plugin.TwosideKeeper.Recipes.Initialize_SlabReconstruction_Recipes(); sig.plugin.TwosideKeeper.Recipes.Initialize_Artifact_Recipes(); @@ -826,6 +827,7 @@ 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()); //GenericFunctions.setBowMode(p.getEquipment().getItemInMainHand(), BowMode.SNIPE); //p.sendMessage("This is bow mode "+GenericFunctions.getBowMode(p.getEquipment().getItemInMainHand())); /*for (int i=0;i