Compare commits

...

2 Commits

Author SHA1 Message Date
Vogog
0710803217 Test commit, seeing if the code submit's successfully. Code just creates
magic wands, but they don't do anything and can't be crafted yet. (Coded
with limited, and since increased experience)
2017-09-04 14:28:50 +12:00
Vogog
3b4684619f Created the 'Vogog' branch. 2017-05-08 17:50:56 +12:00
13 changed files with 302 additions and 18 deletions

View File

@ -3,10 +3,10 @@
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="jgrapht"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="lib" path="D:/Documents/Test Server/plugins/AutoPluginUpdate.jar"/>
<classpathentry kind="lib" path="D:/Documents/Test Server/plugins/GlowAPI_v1.4.4.jar"/>
<classpathentry kind="lib" path="D:/Documents/Test Server/spigot-1.9.2-R0.1-SNAPSHOT.jar"/>
<classpathentry kind="lib" path="D:/Documents/Test Server/plugins/aPlugin (99).jar"/>
<classpathentry kind="lib" path="/Users/victor/Twoside_Keeper_External_Plugins/AutoPluginUpdate.jar"/>
<classpathentry kind="lib" path="/Users/victor/Twoside_Keeper_External_Plugins/GlowAPI_v1.4.4.jar"/>
<classpathentry kind="lib" path="/Users/victor/Twoside_Keeper_External_Plugins/spigot-1.9.2-R0.1-SNAPSHOT.jar"/>
<classpathentry kind="lib" path="/Users/victor/Twoside_Keeper_External_Plugins/aPlugin (99).jar"/>
<classpathentry kind="src" path="/AutoPluginUpdate"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@ -28,7 +28,7 @@
<link>
<name>jgrapht</name>
<type>2</type>
<location>D:/Data/jgrapht-1.0.1/jgrapht-1.0.1/source/jgrapht-core/src/main/java</location>
<location>/Applications/Eclipse.app/Contents/MacOS/D::/Data/jgrapht-1.0.1/jgrapht-1.0.1/source/jgrapht-core/src/main/java</location>
</link>
</linkedResources>
</projectDescription>

Binary file not shown.

View File

@ -3,6 +3,6 @@
<project name="TwosideKeeper.makejar" default="makejar" basedir=".">
<target name ="makejar" description="Create a jar for the TwosideKeeper project">
<jar jarfile="TwosideKeeper.jar" includes="**/*.class,**/*.yml" basedir="bin"/>
<jar jarfile="C:\Users\sigon\Documents\Test Stream Server\plugins\TwosideKeeper.jar" includes="**/*.class,**/*.yml" basedir="bin"/>
<jar jarfile="/Users/victor/Twoside_Keeper_v1/plugins/TwosideKeeper.jar" includes="**/*.class,**/*.yml" basedir="bin"/>
</target>
</project>

View File

@ -63,7 +63,7 @@ public class SigDrop extends Drop{
armorsuffix="CHESTPLATE";
}
if (Math.random()<=0.33) {
if (Math.random()<=0.33) { //Funny how this works, the rarest tool is pickaxe, the most common is hoe
toolsuffix="HOE";
} else
if (Math.random()<=0.33) {
@ -75,6 +75,8 @@ public class SigDrop extends Drop{
{
toolsuffix="AXE";
}
//hoe is 0.33ish, spade is 0.2178ish, pickaxe is 0.143748ish, axe is 0.287496ish
//Same ones apply to boots,helm,leggings,chest? Maybe im wrong
switch (diff) {
case NORMAL:{ //We are stone/wood tier.

View File

@ -0,0 +1,87 @@
package sig.plugin.TwosideKeeper.HelperStructures.Common;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.block.Block;
import org.bukkit.block.Dropper;
import org.bukkit.block.Hopper;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import net.md_5.bungee.api.ChatColor;
import sig.plugin.TwosideKeeper.HelperStructures.Utils.ItemCubeUtils;
import sig.plugin.TwosideKeeper.HelperStructures.Utils.ItemUtils;
import sig.plugin.TwosideKeeper.HelperStructures.Utils.SoundUtils;
public class MagicWand {
public static final String MAGICWANDID_LINE = ChatColor.DARK_GREEN+"MAGICWAND#";
public static boolean isMagicWand(ItemStack item) {
return (ItemUtils.isValidItem(item) &&
ItemUtils.LoreContainsSubstring(item, MAGICWANDID_LINE));
}
public static Location getMagicWandLoc(int id) {
int posx = id % 960;
int posy = 70; //This should be right above bauble pouches (67, 70 for testing), and shouldn't interact with them.
int posz = id / 960;
return new Location(Bukkit.getWorld("FilterCube"),posx,posy,posz);
}
public static Block getMagicWandBlock(int id) {
Block b = Bukkit.getWorld("FilterCube").getBlockAt(getMagicWandLoc(id));
return b;
}
public static Dropper getMagicWandDropper(int id) {
Dropper h = (Dropper)Bukkit.getWorld("FilterCube").getBlockAt(getMagicWandLoc(id)).getState();
return h;
}
public static void createNewMagicWand(int id) {
Block b = getMagicWandBlock(id);
b.getWorld().getBlockAt(getMagicWandLoc(id)).setType(Material.DROPPER);
}
public static int getMagicWandID(ItemStack item) {
if (isMagicWand(item)) {
String id = ItemUtils.GetLoreLineContainingSubstring(item, MAGICWANDID_LINE).split("#")[1];
return Integer.parseInt(id);
}
else {
return -1;
}
}
public static HashMap<Integer, ItemStack> insertItemsIntoMagicWand(int id, ItemStack...items) {
Dropper d = getMagicWandDropper(id);
Inventory inv = d.getInventory();
return inv.addItem(items);
}
public static void openMagicWand(Player p, ItemStack item) {
if (isMagicWand(item)) {
int id = getMagicWandID(item);
Dropper d = getMagicWandDropper(id);
d.getChunk().load();
GenericFunctions.renameDropper(d, ChatColor.stripColor(((ItemUtils.hasDisplayName(item))?ItemUtils.getDisplayName(item):"Magic Wand #"+id)));
p.openInventory(d.getInventory());
SoundUtils.playLocalSound(p, Sound.ITEM_ARMOR_EQUIP_LEATHER, 1.0f, 1.0f);
}
else {
p.sendMessage(ChatColor.RED+"Could not open Magic Wand Inventory! Please let the admin know this did not work.");
}
}
public static List<ItemStack> getMagicWandContents(int id) {
List<ItemStack> itemlist = new ArrayList<ItemStack>();
Dropper d = getMagicWandDropper(id);
Inventory inv = d.getInventory();
for (ItemStack item : inv.getContents()) {
if (ItemUtils.isValidItem(item)) {
itemlist.add(item);
}
}
return itemlist;
}
}
//Will not use bauble pouch implementation due to enchanting tables not being containers.
//Go dive into the item cube spaghetti code.

View File

@ -3,7 +3,7 @@ package sig.plugin.TwosideKeeper.HelperStructures;
import sig.plugin.TwosideKeeper.TwosideKeeper;
public enum CubeType {
NORMAL(0,9),LARGE(1,27),ENDER(2,27),VACUUM(3,54),FILTER(4,27);
NORMAL(0,9),LARGE(1,27),ENDER(2,27),VACUUM(3,54),FILTER(4,27),MAGICWAND(5,2);
int id=0;
int size=9;
@ -43,6 +43,8 @@ public enum CubeType {
return 9;
case VACUUM:
return 54;
case MAGICWAND:
return 2;
default:
return 27;
}

View File

@ -25,6 +25,7 @@ import sig.plugin.TwosideKeeper.Recipes;
import sig.plugin.TwosideKeeper.TwosideKeeper;
import sig.plugin.TwosideKeeper.HelperStructures.Common.ArrowQuiver;
import sig.plugin.TwosideKeeper.HelperStructures.Common.BaublePouch;
import sig.plugin.TwosideKeeper.HelperStructures.Common.MagicWand;
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
import sig.plugin.TwosideKeeper.HelperStructures.Utils.ItemUtils;
@ -118,7 +119,98 @@ public class CustomItem {
TwosideKeeper.WORLD_SHOP_RECIPE = WorldShopRecipe();
TwosideKeeper.WORLD_SHOP2_RECIPE = WorldShop2Recipe();
TwosideKeeper.BAUBLE_POUCH_RECIPE = BaublePouchRecipe();
//Vogog's Code here.
boolean wandsActive = false; //Remove the boolean statement when the wands are released.
if (wandsActive) {
TwosideKeeper.MAGIC_WAND_RECIPE = MagicWandRecipe();
TwosideKeeper.SPELLWEAVING_WAND_RECIPE = SpellweavingWandRecipe();
TwosideKeeper.EMPOWERED_WAND_RECIPE = EmpoweredWandRecipe();
}
boolean scrollTeaser = true; //Tease scroll drops on the server :^)
if (scrollTeaser) {
}
}
//Basic Wand.
private static ShapelessRecipe MagicWandRecipe() {
ShapelessRecipe magicWandRec = new ShapelessRecipe(MagicWand());
magicWandRec.addIngredient(1, Material.DIAMOND);
magicWandRec.addIngredient(1, Material.NETHER_STAR);
magicWandRec.addIngredient(2, Material.DIAMOND);
magicWandRec.addIngredient(1, Material.STICK);
magicWandRec.addIngredient(2, Material.DIAMOND);
magicWandRec.addIngredient(1, Material.STICK);
magicWandRec.addIngredient(1, Material.DIAMOND);
return magicWandRec;
}
public static ItemStack MagicWand() {
ItemStack magicWand = new ItemStack(Material.TORCH);
ItemUtils.addLore(magicWand, ChatColor.AQUA+"A slightly magical stick");
ItemUtils.addLore(magicWand, ChatColor.AQUA+"that can store one");
ItemUtils.addLore(magicWand, ChatColor.AQUA+"offensive and one");
ItemUtils.addLore(magicWand, ChatColor.AQUA+"utility magic scroll.");
ItemUtils.addLore(magicWand, MagicWand.MAGICWANDID_LINE+"0");
ItemUtils.setDisplayName(magicWand, ChatColor.DARK_GREEN+"Magic Wand");
magicWand.addUnsafeEnchantment(Enchantment.LOOT_BONUS_MOBS, 1);
return magicWand.clone();
}
//Speed Wand, weaker spell power, faster cast speed.
private static ShapelessRecipe SpellweavingWandRecipe() {
ShapelessRecipe spellweavingWandRec = new ShapelessRecipe(SpellweavingWand());
//Recipe. (Includes Spellweaving Etching x2 and Magic Wand)
//Remaining items are 6 ender pearls.
spellweavingWandRec.addIngredient(Material.DRAGON_EGG);
//Placeholder item cause dupes.
return spellweavingWandRec;
}
public static ItemStack SpellweavingWand() {
ItemStack spellweavingWand = new ItemStack(Material.END_ROD);
ItemUtils.addLore(spellweavingWand, ChatColor.AQUA+"A modified wand");
ItemUtils.addLore(spellweavingWand, ChatColor.AQUA+"that increases");
ItemUtils.addLore(spellweavingWand, ChatColor.AQUA+"casting speed at");
ItemUtils.addLore(spellweavingWand, ChatColor.AQUA+"the cost of");
ItemUtils.addLore(spellweavingWand, ChatColor.AQUA+"spell power.");
ItemUtils.addLore(spellweavingWand, ChatColor.AQUA+"Stores one offensive");
ItemUtils.addLore(spellweavingWand, ChatColor.AQUA+"and one utility");
ItemUtils.addLore(spellweavingWand, ChatColor.AQUA+"magic scroll");
ItemUtils.setDisplayName(spellweavingWand, ChatColor.LIGHT_PURPLE+"Spellweaving Wand");
spellweavingWand.addUnsafeEnchantment(Enchantment.LOOT_BONUS_MOBS, 1);
return spellweavingWand.clone();
}
//Power Wand, increased spell power, slower cast speed.
private static ShapelessRecipe EmpoweredWandRecipe() {
ShapelessRecipe empoweredWandRec = new ShapelessRecipe(EmpoweredWand());
//Recipe. (Includes Empowerment Etching x2 and Magic Wand)
//Remaining items are 6 emeralds.
empoweredWandRec.addIngredient(1, Material.NETHER_STAR);
empoweredWandRec.addIngredient(2, Material.STICK);
//Placeholders for testing purposes.
return empoweredWandRec;
}
public static ItemStack EmpoweredWand() {
ItemStack empoweredWand = new ItemStack(Material.REDSTONE_TORCH_ON);
ItemUtils.addLore(empoweredWand, ChatColor.AQUA+"A modified wand");
ItemUtils.addLore(empoweredWand, ChatColor.AQUA+"that increases");
ItemUtils.addLore(empoweredWand, ChatColor.AQUA+"spell power at");
ItemUtils.addLore(empoweredWand, ChatColor.AQUA+"the cost of");
ItemUtils.addLore(empoweredWand, ChatColor.AQUA+"casting speed.");
ItemUtils.addLore(empoweredWand, ChatColor.AQUA+"Stores one offensive");
ItemUtils.addLore(empoweredWand, ChatColor.AQUA+"and one utility");
ItemUtils.addLore(empoweredWand, ChatColor.AQUA+"magic scroll");
ItemUtils.setDisplayName(empoweredWand, ChatColor.LIGHT_PURPLE+"Empowered Wand");
empoweredWand.addUnsafeEnchantment(Enchantment.LOOT_BONUS_MOBS, 1);
return empoweredWand.clone();
}
//Maybe implement 2 offensive, no utility, and 2 utility, no offensive wands later?
//Vogog's Code Ends.
private static ShapelessRecipe BaublePouchRecipe() {
ShapelessRecipe rec = new ShapelessRecipe(BaublePouch());

View File

@ -0,0 +1,47 @@
package sig.plugin.TwosideKeeper.HelperStructures;
public enum SpellScrollItem {
//BASIC SPELLS (OFFENSE)
FIREBALL, //Simple fireball with splash damage.
WINDBLAST, //Small AOE, increased knockback.
ARCANEBOLT, //Simple single target damage. Highest basic spell damage for single targets.
ICYWINDS, //Large area AOE, low damage, reduces movement speed.
//BASIC SPELLS (UTILITY)
LIGHTHEAL, //Basic healing spell, heals 10HP. Can only be applied to the caster.
BULWARK, //Basic defensive spell, temporarily adds a small amount of damage reduction (multiplicative, 30%?). Can only be applied to the caster.
LIGHTSTEP, //Simple utility spell, temporarily increases movement speed by a small amount. Can only be applied to the caster.
EMPOWERMENT, //Simple augmentation spell, temporarily increases damage dealt by a small amount (2.5%?). Can only be applied to the caster.
//SECONDARY SPELLS (OFFENSE)
POISONOUSHEX, //A single target spell that applies a poison to a target for 10 seconds. Stacks up to 10 times.
ENTANGLINGROOTS, //A single target spell that deals a minor amount of damage and roots a target for 10 seconds. Repeated applications within 20 seconds have diminishing effects (50%, stacks indefinitely).
RADIANCE, //An AOE spell with circular radius, and short range. Deals minor damage and staggers (slows) all targets hit.
DETONATE, //A spell with a delayed explosion, and a small AOE radius. Does not agro on the initial placement.
//SECONDARY SPELLS (UTILITY)
MAGICDOMAIN, //A domain class spell. Creates an area zone at the caster's location that increases magic damage dealt by players while within the domain.
WEIGHTLESSNESS, //A spell that affects only the caster. Temporarily increases jump height and massively decreases fall damage taken.
INVISIBILITY, //A spell that affects only the caster. Temporarily provides invisibility to the user.
REJUVINATION, //A spell that affects only the caster. Temporarily provides Regeneration 3 to the user. (5 seconds?)
//RANK 1 COMBINATION SPELLS (OFFENSE)
FIREBLAST, //(FIREBALL+FIREBALL) A stronger fireball spell with increased damage and range.
HOWLINGGALE, //(WINDBLAST+WINDBLAST) An improved wind spell with massively increased knockback, and wider AOE. Also deals a small amount of damage.
ARCANEMISSILE, //(ARCANEBOLT+ARCANEBOLT) A single target spell. Initially weaker than ARCANEBOLT, but successful hits increase the damage of further ARCANEMISSILES by 10% temporarily. Further hits refresh the duration and stack, up to 200% base damage. (Starts at about 50% the damage of ARCANEBOLT).
FREEZINGCLOUD, //(ICYWINDS+ICYWINDS) Extremely wide area AOE, low damage, reduces movement speed. (This may be underpowered on release?).
//RANK 2 COMBINATION SPELLS (OFFENSE)
TOXICROOTS, //(POISONOUSHEX+ENTANGLINGROOTS) A single target spell. Applies Poison 5 to the target, and roots them for 20 seconds. Shares diminishing effects with ENTANGLINGROOTS. Deals minor damage (Same as ARCANEBOLT).
ARCANEBARRAGE, //(ARCANEMISSILE+ARCANEBOLT) A channeled spell that fires a barrage of arcane arrows at a target. Caster's spellpower temporarily rises during the duration of the channel, causing each successive arrow to deal increasing damage.
NOVA, //(DETONATE+RADIANCE) An instantaneous spell centered on the caster with a circular AOE radius. Medium range, and deals massive damage, with a very long cooldown. (30 minutes anyone?)
//RANK 3 COMBINATION SPELLS (OFFENSE)
ANNIHILATE, //(NOVA+ARCANEBARRAGE) A CHANNELED SPELL WITH INFINITE DURATION. The caster is cannot move during the channel, and each successive hit deals increasing damage. Increases damage taken by 50%.
CHANGESTATE_SPELLEFFECT_FORM_BARBEQUE_BIRD, //PHOENIXDRIVE. The caster temporarily gains the aspect of the phoenix. While active, the caster periodically pulses flame damage, and gains a single offensive spell to use, Inferno.
INFERNO, //An extremely powerful fireball with small AOE damage. Only accessible while under the effects of PHOENIXDRIVE.
//RANK 1 COMBINATION SPELLS (UTILITY)
SOOTHINGLIGHT, //(LIGHTHEAL+LIGHTHEAL) A significantly stronger self target healing spell than LIGHTHEAL. Heals 35HP
RESTORATIVELIGHTS, //(LIGHTHEAL+MAGICDOMAIN) A domain class spell. Heals 5HP per second for 4 seconds to all party members in an area.
//RANK 2 COMBINATION SPELLS (UTILITY)
GRAVITYWELL, //(MAGICDOMAIN+ICYWINDS) A domain class spell. Temporarily slows all hostile targets in an area.
//RANK 3 COMBINATION SPELLS (UTILITY)
LOCKDOWN, //(GRAVITYWELL+?) A domain class spell. Temporarily prevents all non-ability movement movement in an area. Both players and monsters take 100% increased damage for the duration.
}

View File

@ -369,4 +369,14 @@ public class Recipes {
public static void Initialize_BaublePouch_Recipe() {
Bukkit.addRecipe(TwosideKeeper.BAUBLE_POUCH_RECIPE);
}
//Vogog's Code.
public static void Initialize_MagicWand_Recipe() {
Bukkit.addRecipe(TwosideKeeper.MAGIC_WAND_RECIPE);
}
public static void Inititalize_SpellweavingWand_Recipe() {
Bukkit.addRecipe(TwosideKeeper.SPELLWEAVING_WAND_RECIPE);
}
public static void Initialize_EmpoweredWand_Recipe() {
Bukkit.addRecipe(TwosideKeeper.EMPOWERED_WAND_RECIPE);
}
}

View File

@ -0,0 +1 @@
package sig.plugin.TwosideKeeper;

View File

@ -35,6 +35,7 @@ import org.bukkit.block.BlockState;
import org.bukkit.block.Chest;
import org.bukkit.block.DoubleChest;
import org.bukkit.block.Dropper;
//import org.bukkit.block.EnchantingTable;
import org.bukkit.block.Hopper;
import org.bukkit.block.Sign;
import org.bukkit.command.Command;
@ -163,6 +164,7 @@ import org.bukkit.event.weather.LightningStrikeEvent;
import org.bukkit.event.world.ChunkLoadEvent;
import org.bukkit.event.world.ChunkUnloadEvent;
import org.bukkit.event.world.WorldSaveEvent;
import org.bukkit.inventory.EnchantingInventory; //For wands.
import org.bukkit.inventory.EquipmentSlot;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
@ -234,6 +236,7 @@ import sig.plugin.TwosideKeeper.HelperStructures.WorldShop;
import sig.plugin.TwosideKeeper.HelperStructures.WorldShopSession;
import sig.plugin.TwosideKeeper.HelperStructures.Common.ArrowQuiver;
import sig.plugin.TwosideKeeper.HelperStructures.Common.BaublePouch;
import sig.plugin.TwosideKeeper.HelperStructures.Common.MagicWand;
import sig.plugin.TwosideKeeper.HelperStructures.Common.BlockModifyQueue;
import sig.plugin.TwosideKeeper.HelperStructures.Common.Camera;
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
@ -287,6 +290,9 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
public static double DAYMULT=2.0; //How much the day and night length will be multiplied by.
public static int ITEMCUBEID=0; //The current number of Item Cubes in existence.
public static int BAUBLEPOUCHID=0; //The current number of Bauble Pouches in existence.
public static int MAGICWANDID=0; //The current number of Magic Wands in existence. (Vogog)
public static int SPELLWEAVINGWANDID=0; //The current number of Spellweaving Wands in existence. (Vogog)
public static int EMPOWEREDWANDID=0; //The current number of Empowered Wands in existence. (Vogog)
public static int ARROWQUIVERID=0; //The current number of Arrow Quivers in existence.
public static String MOTD=""; //The MOTD announcement to be announced every hour.
public static double ARMOR_LEATHER_HP=0.5f;
@ -431,6 +437,10 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
public static CustomPotion HARDENING_VIAL;
public static ItemStack DEAL_OF_THE_DAY_ITEM;
public static ShapelessRecipe BAUBLE_POUCH_RECIPE;
//Vogog code.
public static ShapelessRecipe MAGIC_WAND_RECIPE;
public static ShapelessRecipe SPELLWEAVING_WAND_RECIPE;
public static ShapelessRecipe EMPOWERED_WAND_RECIPE;
public static final int POTION_DEBUG_LEVEL=5;
public static final int SPAWN_DEBUG_LEVEL=5;
@ -543,7 +553,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
public final static boolean CHRISTMASEVENT_ACTIVATED=false;
public final static boolean CHRISTMASLINGERINGEVENT_ACTIVATED=false;
public final static boolean ELITEGUARDIANS_ACTIVATED=false;
public final static boolean ELITEGUARDIANS_ACTIVATED=true;
public final static boolean NEWARTIFACTABILITIES_ACTIVATED=false;
public static final Set<EntityType> LIVING_ENTITY_TYPES = ImmutableSet.of(
@ -976,6 +986,11 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
Recipes.Initialize_NewRedstoneLamp_Recipe();
Recipes.Initialize_BaublePouch_Recipe();
//Vogog's Code.
Recipes.Initialize_MagicWand_Recipe();
Recipes.Inititalize_SpellweavingWand_Recipe();
Recipes.Initialize_EmpoweredWand_Recipe();
MonsterTemplate.InitializeMasterMonsterTemplateKeyMap();
Bukkit.getScheduler().runTaskLater(this,()->{
@ -1793,6 +1808,10 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
case "BAUBLEPOUCH":{
BaublePouch.getBaublePouchContents(BaublePouch.getBaublePouchID(p.getEquipment().getItemInOffHand()));
}break;
//Vogog
case "MAGICWAND":{
MagicWand.getMagicWandContents(MagicWand.getMagicWandID(p.getEquipment().getItemInMainHand()));
}break;
case "TIMINGSREPORT":{
runServerHeartbeat.performTimingsReport(true);
}break;
@ -3760,6 +3779,14 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
return;
}
}
//Vogog
if (ev.getAction()==Action.RIGHT_CLICK_AIR || (ev.getPlayer().isSneaking() && ev.getAction()==Action.RIGHT_CLICK_AIR) || (ev.getPlayer().isSneaking() && ev.getAction()==Action.RIGHT_CLICK_BLOCK)) {
if (MagicWand.isMagicWand(ev.getPlayer().getInventory().getItemInMainHand())) {
MagicWand.openMagicWand(ev.getPlayer(), ev.getPlayer().getInventory().getItemInMainHand());
ev.setCancelled(true);
return;
}
}
if (ev.getAction()==Action.RIGHT_CLICK_AIR || (ev.getPlayer().isSneaking() && ev.getAction()==Action.RIGHT_CLICK_AIR) || (ev.getPlayer().isSneaking() && ev.getAction()==Action.RIGHT_CLICK_BLOCK && !GenericFunctions.isDumpableContainer(ev.getClickedBlock().getType()))) {
if (ev.getPlayer().getInventory().getItemInMainHand().hasItemMeta() &&
ev.getPlayer().getInventory().getItemInMainHand().getItemMeta().hasLore() &&
@ -4446,6 +4473,11 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
ev.setCancelled(true);
return;
}
//Vogog
if (MagicWand.isMagicWand(ev.getItemInHand())) {
ev.setCancelled(true);
return;
}
}
@EventHandler(priority=EventPriority.LOWEST,ignoreCancelled = true)
@ -4771,6 +4803,17 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
BAUBLEPOUCHID++;
}
}
//Vogog
if (MagicWand.isMagicWand(ev.getCurrentItem())) {
if (ev.isShiftClick()) {
ev.setCancelled(true);
}
else {
ItemUtils.ModifyLoreLineContainingSubstring(ev.getCurrentItem(), MagicWand.MAGICWANDID_LINE, MagicWand.MAGICWANDID_LINE+MAGICWANDID);
MagicWand.createNewMagicWand(MAGICWANDID);
MAGICWANDID++;
}
}
}