Compare commits
2 Commits
daily_nerf
...
master
Author | SHA1 | Date | |
---|---|---|---|
c3dff18aef | |||
862b7399d6 |
@ -4,9 +4,9 @@
|
|||||||
<classpathentry kind="src" path="jgrapht"/>
|
<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="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/AutoPluginUpdate.jar"/>
|
||||||
<classpathentry kind="lib" path="D:/Documents/Test Server/plugins/GlowAPI_v1.4.4.jar"/>
|
<classpathentry kind="lib" path="D:/Documents/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/spigot-1.9.2-R0.1-SNAPSHOT.jar"/>
|
||||||
<classpathentry kind="lib" path="D:/Documents/Test Server/plugins/aPlugin (102).jar"/>
|
<classpathentry kind="lib" path="D:/Documents/aPlugin.jar"/>
|
||||||
<classpathentry kind="src" path="/AutoPluginUpdate"/>
|
<classpathentry kind="src" path="/AutoPluginUpdate"/>
|
||||||
<classpathentry kind="output" path="bin"/>
|
<classpathentry kind="output" path="bin"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
Binary file not shown.
@ -1,6 +1,6 @@
|
|||||||
name: TwosideKeeper
|
name: TwosideKeeper
|
||||||
main: sig.plugin.TwosideKeeper.TwosideKeeper
|
main: sig.plugin.TwosideKeeper.TwosideKeeper
|
||||||
version: 3.12.2a
|
version: 3.X
|
||||||
loadbefore: [aPlugin]
|
loadbefore: [aPlugin]
|
||||||
commands:
|
commands:
|
||||||
money:
|
money:
|
||||||
|
@ -2495,15 +2495,6 @@ public class CustomDamage {
|
|||||||
return true; //Cancel any damage events in Spectator mode or Creative Mode.
|
return true; //Cancel any damage events in Spectator mode or Creative Mode.
|
||||||
}
|
}
|
||||||
if (target.isInvulnerable()) {
|
if (target.isInvulnerable()) {
|
||||||
if (shooter instanceof Player && shooter.hasPermission("TwosideKeeper.modifyModels")) {
|
|
||||||
Player p = (Player)shooter;
|
|
||||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
|
||||||
if (EntityUtils.isValidEntity(target) &&
|
|
||||||
target instanceof ArmorStand) {
|
|
||||||
shooter.sendMessage("Selected Armor Stand "+ChatColor.GREEN+target.getUniqueId());
|
|
||||||
pd.myStand = (ArmorStand)target;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true; //Cancel any damage events when the target is invulnerable.
|
return true; //Cancel any damage events when the target is invulnerable.
|
||||||
}
|
}
|
||||||
if (isFlagSet(flags,IGNORE_DAMAGE_TICK)) {
|
if (isFlagSet(flags,IGNORE_DAMAGE_TICK)) {
|
||||||
@ -4218,7 +4209,7 @@ public class CustomDamage {
|
|||||||
*/
|
*/
|
||||||
private static double getDamageLimit(LivingEntity target) {
|
private static double getDamageLimit(LivingEntity target) {
|
||||||
double pct = 1.0;
|
double pct = 1.0;
|
||||||
if (target!=null && !(target instanceof Player) && GenericFunctions.isBossMonster(target)) {
|
if (GenericFunctions.isBossMonster(target)) {
|
||||||
pct = BOSS_DAMAGE_LIMIT;
|
pct = BOSS_DAMAGE_LIMIT;
|
||||||
}
|
}
|
||||||
return pct;
|
return pct;
|
||||||
|
@ -1,33 +0,0 @@
|
|||||||
package sig.plugin.TwosideKeeper.HelperStructures;
|
|
||||||
|
|
||||||
import org.bukkit.Location;
|
|
||||||
import org.bukkit.entity.ArmorStand;
|
|
||||||
import org.bukkit.entity.EntityType;
|
|
||||||
|
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.ArmorStandProperties;
|
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.EntityUtils;
|
|
||||||
|
|
||||||
public class ArmorStandLinker {
|
|
||||||
ArmorStandProperties myModel;
|
|
||||||
ArmorStand ent;
|
|
||||||
Location loc;
|
|
||||||
|
|
||||||
public ArmorStandLinker(Location loc) {
|
|
||||||
ent = (ArmorStand)loc.getWorld().spawnEntity(loc, EntityType.ARMOR_STAND);
|
|
||||||
this.loc=loc;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void run() {
|
|
||||||
if (!EntityUtils.isValidEntity(ent)) {
|
|
||||||
ent = (ArmorStand)loc.getWorld().spawnEntity(loc, EntityType.ARMOR_STAND);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLocation(Location loc) {
|
|
||||||
this.loc=loc.clone();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Location getLocation() {
|
|
||||||
return loc;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,20 +1,15 @@
|
|||||||
package sig.plugin.TwosideKeeper.HelperStructures.Common;
|
package sig.plugin.TwosideKeeper.HelperStructures.Common;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
|
||||||
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.util.EulerAngle;
|
import org.bukkit.util.EulerAngle;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.JavaUtils;
|
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.MathUtils;
|
import sig.plugin.TwosideKeeper.HelperStructures.Utils.MathUtils;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.ReflectUtils;
|
|
||||||
|
|
||||||
public class ArmorStandProperties {
|
public class ArmorStandProperties {
|
||||||
final public static ArmorStandProperties SCEPTERBASE = new ArmorStandProperties();
|
final public static ArmorStandProperties SCEPTERBASE = new ArmorStandProperties();
|
||||||
final public static ArmorStandProperties SCEPTERTOP = new ArmorStandProperties();
|
final public static ArmorStandProperties SCEPTERTOP = new ArmorStandProperties();
|
||||||
final public static ArmorStandProperties BLANK = new ArmorStandProperties();
|
|
||||||
|
|
||||||
boolean arms = false;
|
boolean arms = false;
|
||||||
boolean baseplate = false;
|
boolean baseplate = false;
|
||||||
@ -35,46 +30,12 @@ public class ArmorStandProperties {
|
|||||||
boolean visible=true;
|
boolean visible=true;
|
||||||
boolean customNameVisible=false;
|
boolean customNameVisible=false;
|
||||||
String customName="";
|
String customName="";
|
||||||
boolean gravity=false;
|
|
||||||
Vector offset = new Vector();
|
Vector offset = new Vector();
|
||||||
Vector dir = new Vector();
|
|
||||||
|
|
||||||
public ArmorStandProperties() {
|
public ArmorStandProperties() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArmorStandProperties clone() {
|
|
||||||
ArmorStandProperties newpos = new ArmorStandProperties();
|
|
||||||
for (Field f : this.getClass().getDeclaredFields()) {
|
|
||||||
if (ReflectUtils.isCloneable(f)) {
|
|
||||||
try {
|
|
||||||
f.set(newpos, f.get(this));
|
|
||||||
} catch (IllegalArgumentException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (IllegalAccessException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return newpos;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Vector getFacingDirection() {
|
|
||||||
return dir;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFacingDirection(Vector dir) {
|
|
||||||
this.dir=dir;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setGravity(boolean gravity) {
|
|
||||||
this.gravity=gravity;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isGravityOn() {
|
|
||||||
return this.gravity;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isArms() {
|
public boolean isArms() {
|
||||||
return arms;
|
return arms;
|
||||||
}
|
}
|
||||||
|
@ -99,7 +99,6 @@ import sig.plugin.TwosideKeeper.HelperStructures.CubeType;
|
|||||||
import sig.plugin.TwosideKeeper.HelperStructures.CustomItem;
|
import sig.plugin.TwosideKeeper.HelperStructures.CustomItem;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.EliteMonsterLocationFinder;
|
import sig.plugin.TwosideKeeper.HelperStructures.EliteMonsterLocationFinder;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.ItemSet;
|
import sig.plugin.TwosideKeeper.HelperStructures.ItemSet;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.LivingEntityDifficulty;
|
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.PlayerMode;
|
import sig.plugin.TwosideKeeper.HelperStructures.PlayerMode;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.WorldShop;
|
import sig.plugin.TwosideKeeper.HelperStructures.WorldShop;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.Effects.WindSlash;
|
import sig.plugin.TwosideKeeper.HelperStructures.Effects.WindSlash;
|
||||||
@ -2312,16 +2311,12 @@ public class GenericFunctions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isBossMonster(LivingEntity m) {
|
public static boolean isBossMonster(LivingEntity m) {
|
||||||
LivingEntityDifficulty dif = null;
|
|
||||||
if (m!=null) {
|
|
||||||
dif = MonsterController.getLivingEntityDifficulty(m);
|
|
||||||
}
|
|
||||||
if (MonsterController.isZombieLeader(m) ||
|
if (MonsterController.isZombieLeader(m) ||
|
||||||
(m.getType()==EntityType.GUARDIAN &&
|
(m.getType()==EntityType.GUARDIAN &&
|
||||||
((Guardian)m).isElder()) ||
|
((Guardian)m).isElder()) ||
|
||||||
m.getType()==EntityType.ENDER_DRAGON ||
|
m.getType()==EntityType.ENDER_DRAGON ||
|
||||||
m.getType()==EntityType.WITHER ||
|
m.getType()==EntityType.WITHER ||
|
||||||
(dif!=null && dif.name().contains("MINIBOSS")) ||
|
MonsterController.getLivingEntityDifficulty(m).name().contains("MINIBOSS") ||
|
||||||
LivingEntityStructure.GetLivingEntityStructure(m).getLeader() ||
|
LivingEntityStructure.GetLivingEntityStructure(m).getLeader() ||
|
||||||
LivingEntityStructure.GetLivingEntityStructure(m).getElite()) {
|
LivingEntityStructure.GetLivingEntityStructure(m).getElite()) {
|
||||||
return true;
|
return true;
|
||||||
@ -5846,14 +5841,14 @@ public class GenericFunctions {
|
|||||||
for (String key : map.keySet()) {
|
for (String key : map.keySet()) {
|
||||||
List<ItemContainer> list = map.get(key);
|
List<ItemContainer> list = map.get(key);
|
||||||
if (discordOutput) {
|
if (discordOutput) {
|
||||||
sb.append("Items in **"+key+"**:\n\n```");
|
sb.append("Items in **"+key+"**:\n\n");
|
||||||
} else {
|
} else {
|
||||||
sb.append("Items in "+ChatColor.BOLD+key+ChatColor.RESET+":\n\n");
|
sb.append("Items in "+ChatColor.BOLD+key+ChatColor.RESET+":\n\n");
|
||||||
}
|
}
|
||||||
for (int i=0;i<list.size();i++) {
|
for (int i=0;i<list.size();i++) {
|
||||||
sb.append(ChatColor.GRAY+GenericFunctions.UserFriendlyMaterialName(list.get(i).getItem())+(TwosideKeeperAPI.isSetItem(list.get(i).getItem())?" (T"+TwosideKeeperAPI.getItemTier(list.get(i).getItem())+")":"")+(list.get(i).getAmount()>1?ChatColor.YELLOW+" x"+list.get(i).getAmount():"")+ChatColor.RESET+(i+1!=list.size()?", ":""));
|
sb.append(ChatColor.GRAY+GenericFunctions.UserFriendlyMaterialName(list.get(i).getItem())+(TwosideKeeperAPI.isSetItem(list.get(i).getItem())?" (T"+TwosideKeeperAPI.getItemTier(list.get(i).getItem())+")":"")+(list.get(i).getAmount()>1?ChatColor.YELLOW+" x"+list.get(i).getAmount():"")+ChatColor.RESET+(i+1!=list.size()?", ":""));
|
||||||
}
|
}
|
||||||
sb.append((discordOutput)?"```":""+"\n ___________________ \n");
|
sb.append("\n ___________________ \n");
|
||||||
}
|
}
|
||||||
if (sb.length()==0) {
|
if (sb.length()==0) {
|
||||||
sb.append("Could not find any items!");
|
sb.append("Could not find any items!");
|
||||||
|
@ -1,62 +1,28 @@
|
|||||||
package sig.plugin.TwosideKeeper.HelperStructures;
|
package sig.plugin.TwosideKeeper.HelperStructures;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.enchantments.Enchantment;
|
|
||||||
import org.bukkit.entity.ArmorStand;
|
import org.bukkit.entity.ArmorStand;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.inventory.ItemStack;
|
|
||||||
import org.bukkit.util.EulerAngle;
|
|
||||||
import org.bukkit.util.Vector;
|
|
||||||
|
|
||||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.ArmorStandProperties;
|
import sig.plugin.TwosideKeeper.HelperStructures.Common.ArmorStandProperties;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.EntityUtils;
|
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.FileUtils;
|
|
||||||
|
|
||||||
public class CustomModel {
|
public class CustomModel {
|
||||||
public List<ArmorStandProperties> modelParts = new ArrayList<ArmorStandProperties>();
|
List<ArmorStandProperties> modelParts = new ArrayList<ArmorStandProperties>();
|
||||||
public List<ArmorStand> stands = new ArrayList<ArmorStand>();
|
List<ArmorStand> stands = new ArrayList<ArmorStand>();
|
||||||
Location origin;
|
|
||||||
|
|
||||||
public CustomModel(Location loc, ArmorStandProperties...modelParts) {
|
public CustomModel(Location loc, ArmorStandProperties...modelParts) {
|
||||||
origin = loc.clone();
|
|
||||||
for (ArmorStandProperties asp : modelParts) {
|
for (ArmorStandProperties asp : modelParts) {
|
||||||
AddModelPart(asp);
|
this.modelParts.add(asp);
|
||||||
|
this.stands.add(setupArmorStand(loc, asp));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ArmorStandProperties getPropertyFromStand(UUID id) {
|
private ArmorStand setupArmorStand(Location loc, ArmorStandProperties asp) {
|
||||||
for (CustomModel model : TwosideKeeper.models) {
|
ArmorStand stand = (ArmorStand)loc.getWorld().spawnEntity(loc, EntityType.ARMOR_STAND);
|
||||||
for (int i=0;i<model.stands.size();i++) {
|
|
||||||
ArmorStand stand = model.stands.get(i);
|
|
||||||
if (EntityUtils.isValidEntity(stand) &&
|
|
||||||
stand.getUniqueId().equals(id)) {
|
|
||||||
return model.modelParts.get(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ArmorStandProperties getPropertyFromStand(ArmorStand stand) {
|
|
||||||
return getPropertyFromStand(stand.getUniqueId());
|
|
||||||
}
|
|
||||||
|
|
||||||
private ArmorStand setupArmorStand(ArmorStandProperties asp) {
|
|
||||||
return setupArmorStand(origin,asp);
|
|
||||||
}
|
|
||||||
|
|
||||||
private ArmorStand setupArmorStand(Location defaultSpawn, ArmorStandProperties asp) {
|
|
||||||
ArmorStand stand = (ArmorStand)origin.getWorld().spawnEntity(defaultSpawn.clone(), EntityType.ARMOR_STAND);
|
|
||||||
stand.setArms(asp.isArms());
|
stand.setArms(asp.isArms());
|
||||||
stand.setBasePlate(asp.isBaseplate());
|
stand.setBasePlate(asp.isBaseplate());
|
||||||
stand.setBodyPose(asp.getBodyPose());
|
stand.setBodyPose(asp.getBodyPose());
|
||||||
@ -75,183 +41,15 @@ public class CustomModel {
|
|||||||
stand.setVisible(asp.isVisible());
|
stand.setVisible(asp.isVisible());
|
||||||
stand.setCustomNameVisible(asp.isCustomNameVisible());
|
stand.setCustomNameVisible(asp.isCustomNameVisible());
|
||||||
stand.setCustomName(asp.getCustomName());
|
stand.setCustomName(asp.getCustomName());
|
||||||
stand.teleport(origin.add(asp.getOffset()));
|
stand.teleport(loc.add(asp.getOffset()));
|
||||||
stand.setRemoveWhenFarAway(true);
|
|
||||||
stand.setGravity(false);
|
|
||||||
stand.setInvulnerable(true);
|
|
||||||
return stand;
|
return stand;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddModelPart(ArmorStandProperties aspOld) {
|
public void displayModel(Location loc) {
|
||||||
AddModelPart(origin,aspOld);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void AddModelPart(Location defaultSpawn, ArmorStandProperties aspOld) {
|
|
||||||
//ArmorStandProperties asp = aspOld.clone();
|
|
||||||
//asp.setOffset(new Vector(loc.getX()-origin.getX(),loc.getY()-origin.getY(),loc.getZ()-origin.getZ()));
|
|
||||||
this.modelParts.add(aspOld);
|
|
||||||
this.stands.add(setupArmorStand(defaultSpawn,aspOld));
|
|
||||||
TwosideKeeper.log("Added model! New part count: "+stands.size(), 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void displayModel() {
|
|
||||||
for (int i=0;i<stands.size();i++) {
|
for (int i=0;i<stands.size();i++) {
|
||||||
if (stands.get(i)!=null && stands.get(i).isValid()) {
|
if (stands.get(i)!=null && stands.get(i).isValid()) {
|
||||||
Location newpos = origin.clone().add(modelParts.get(i).getOffset());
|
stands.get(i).teleport(loc.add(modelParts.get(i).getOffset()));
|
||||||
stands.get(i).teleport(newpos);
|
|
||||||
} else {
|
|
||||||
Location oldPos = stands.get(i).getLocation().clone();
|
|
||||||
stands.get(i).remove();
|
|
||||||
stands.set(i, setupArmorStand(oldPos,modelParts.get(i)));
|
|
||||||
TwosideKeeper.log("Recreated Part "+i, 1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void loadModel(Location loc, String modelName) {
|
|
||||||
String[] properties = FileUtils.readFromFile(TwosideKeeper.plugin.getDataFolder()+"/models/"+modelName);
|
|
||||||
int modelCount = properties[0].split(",").length-1;
|
|
||||||
cleanup();
|
|
||||||
for (int i=0;i<modelCount;i++) {
|
|
||||||
String[] modelprops = new String[properties.length];
|
|
||||||
for (int j=0;j<properties.length;j++) {
|
|
||||||
modelprops[j] = properties[j].split(",")[i+1];
|
|
||||||
}
|
|
||||||
|
|
||||||
int k=0;
|
|
||||||
ArmorStandProperties modelProp = new ArmorStandProperties();
|
|
||||||
modelProp.setArms(Boolean.parseBoolean(modelprops[k++]));
|
|
||||||
modelProp.setBaseplate(Boolean.parseBoolean(modelprops[k++]));
|
|
||||||
modelProp.setBodyPose(parseEulerAngle(modelprops[k++]));
|
|
||||||
modelProp.setBoots(parseItemStack(modelprops[k++]));
|
|
||||||
modelProp.setChestplate(parseItemStack(modelprops[k++]));
|
|
||||||
modelProp.setHeadPose(parseEulerAngle(modelprops[k++]));
|
|
||||||
modelProp.setHelmet(parseItemStack(modelprops[k++]));
|
|
||||||
modelProp.setHand(parseItemStack(modelprops[k++]));
|
|
||||||
modelProp.setLeftArmPose(parseEulerAngle(modelprops[k++]));
|
|
||||||
modelProp.setLeftLegPose(parseEulerAngle(modelprops[k++]));
|
|
||||||
modelProp.setLeggings(parseItemStack(modelprops[k++]));
|
|
||||||
modelProp.setMarker(Boolean.parseBoolean(modelprops[k++]));
|
|
||||||
modelProp.setRightArmPose(parseEulerAngle(modelprops[k++]));
|
|
||||||
modelProp.setRightLegPose(parseEulerAngle(modelprops[k++]));
|
|
||||||
modelProp.setSmall(Boolean.parseBoolean(modelprops[k++]));
|
|
||||||
modelProp.setVisible(Boolean.parseBoolean(modelprops[k++]));
|
|
||||||
modelProp.setCustomNameVisible(Boolean.parseBoolean(modelprops[k++]));
|
|
||||||
modelProp.setCustomName(modelprops[k++]);
|
|
||||||
modelProp.setOffset(parseVector(modelprops[k++]));
|
|
||||||
modelProp.setFacingDirection(parseVector(modelprops[k++]));
|
|
||||||
modelProp.setGravity(Boolean.parseBoolean(modelprops[k++]));
|
|
||||||
|
|
||||||
|
|
||||||
Bukkit.getScheduler().runTaskLater(TwosideKeeper.plugin, ()->{
|
|
||||||
AddModelPart(origin.clone().add(modelProp.getOffset()),modelProp);
|
|
||||||
},(i+1)*20);
|
|
||||||
/*modelParts.add(modelProp);
|
|
||||||
stands.add(setupArmorStand(loc,modelProp));*/
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public ItemStack parseItemStack(String csvString) {
|
|
||||||
String[] parse = csvString.split(";");
|
|
||||||
ItemStack item = new ItemStack(Material.valueOf(parse[0]));
|
|
||||||
boolean isEnchanted = Boolean.parseBoolean(parse[1]);
|
|
||||||
if (isEnchanted) {
|
|
||||||
item.addUnsafeEnchantment(Enchantment.values()[(int)(Math.random()*Enchantment.values().length)], 9);
|
|
||||||
}
|
|
||||||
return item;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Vector parseVector(String csvString) {
|
|
||||||
String[] parse = csvString.split(";");
|
|
||||||
return new Vector(Double.parseDouble(parse[0]),Double.parseDouble(parse[1]),Double.parseDouble(parse[2]));
|
|
||||||
}
|
|
||||||
|
|
||||||
public EulerAngle parseEulerAngle(String csvString) {
|
|
||||||
String[] parse = csvString.split(";");
|
|
||||||
return new EulerAngle(Double.parseDouble(parse[0]),Double.parseDouble(parse[1]),Double.parseDouble(parse[2]));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void saveModel(String modelName) {
|
|
||||||
StringBuilder[] propertyName = new StringBuilder[]{new StringBuilder("Arms,"),
|
|
||||||
new StringBuilder("BasePlate,"),
|
|
||||||
new StringBuilder("BodyPose,"),
|
|
||||||
new StringBuilder("Boots,"),
|
|
||||||
new StringBuilder("Chestplate,"),
|
|
||||||
new StringBuilder("HeadPose,"),
|
|
||||||
new StringBuilder("Helmet,"),
|
|
||||||
new StringBuilder("ItemInHand,"),
|
|
||||||
new StringBuilder("LeftArmPose,"),
|
|
||||||
new StringBuilder("LeftLegPose,"),
|
|
||||||
new StringBuilder("Leggings,"),
|
|
||||||
new StringBuilder("Marker,"),
|
|
||||||
new StringBuilder("RighArmPose,"),
|
|
||||||
new StringBuilder("RightLegPose,"),
|
|
||||||
new StringBuilder("Small,"),
|
|
||||||
new StringBuilder("Visible,"),
|
|
||||||
new StringBuilder("CustomNameVisible,"),
|
|
||||||
new StringBuilder("CustomName,"),
|
|
||||||
new StringBuilder("Offset,"),
|
|
||||||
new StringBuilder("Direction,"),
|
|
||||||
new StringBuilder("Gravity,")};
|
|
||||||
for (int j=0;j<stands.size();j++) {
|
|
||||||
ArmorStand stand = stands.get(j);
|
|
||||||
ArmorStandProperties asp = modelParts.get(j);
|
|
||||||
int i=0;
|
|
||||||
propertyName[i++].append(stand.hasArms()+",");
|
|
||||||
propertyName[i++].append(stand.hasBasePlate()+",");
|
|
||||||
propertyName[i++].append(ConvertEulerAngle(stand.getBodyPose())+",");
|
|
||||||
propertyName[i++].append(ConvertItemStack(stand.getBoots())+",");
|
|
||||||
propertyName[i++].append(ConvertItemStack(stand.getChestplate())+",");
|
|
||||||
propertyName[i++].append(ConvertEulerAngle(stand.getHeadPose())+",");
|
|
||||||
propertyName[i++].append(ConvertItemStack(stand.getHelmet())+",");
|
|
||||||
propertyName[i++].append(ConvertItemStack(stand.getItemInHand())+",");
|
|
||||||
propertyName[i++].append(ConvertEulerAngle(stand.getLeftArmPose())+",");
|
|
||||||
propertyName[i++].append(ConvertEulerAngle(stand.getLeftLegPose())+",");
|
|
||||||
propertyName[i++].append(ConvertItemStack(stand.getLeggings())+",");
|
|
||||||
propertyName[i++].append(stand.isMarker()+",");
|
|
||||||
propertyName[i++].append(ConvertEulerAngle(stand.getRightArmPose())+",");
|
|
||||||
propertyName[i++].append(ConvertEulerAngle(stand.getRightLegPose())+",");
|
|
||||||
propertyName[i++].append(stand.isSmall()+",");
|
|
||||||
propertyName[i++].append(stand.isVisible()+",");
|
|
||||||
propertyName[i++].append(stand.isCustomNameVisible()+",");
|
|
||||||
propertyName[i++].append(stand.getCustomName()+",");
|
|
||||||
propertyName[i++].append(ConvertVector(asp.getOffset())+",");
|
|
||||||
propertyName[i++].append(ConvertVector(asp.getFacingDirection())+",");
|
|
||||||
propertyName[i++].append(stand.hasGravity()+",");
|
|
||||||
}
|
|
||||||
String[] finalString = new String[propertyName.length];
|
|
||||||
int j=0;
|
|
||||||
for (int i=0;i<propertyName.length;i++) {
|
|
||||||
StringBuilder builder = propertyName[i];
|
|
||||||
finalString[j++] = builder.toString();
|
|
||||||
}
|
|
||||||
FileUtils.writetoFile(finalString, TwosideKeeper.plugin.getDataFolder()+"/models/"+modelName);
|
|
||||||
}
|
|
||||||
|
|
||||||
private String ConvertItemStack(ItemStack item) {
|
|
||||||
return item.getType()+";"+((item.getEnchantments().size()>0)?Boolean.toString(true):Boolean.toString(false));
|
|
||||||
}
|
|
||||||
|
|
||||||
private String ConvertEulerAngle(EulerAngle angle) {
|
|
||||||
return angle.getX()+";"+angle.getY()+";"+angle.getZ();
|
|
||||||
}
|
|
||||||
|
|
||||||
private String ConvertVector(Vector angle) {
|
|
||||||
return angle.getX()+";"+angle.getY()+";"+angle.getZ();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void cleanup(CustomModel model) {
|
|
||||||
model.cleanup();
|
|
||||||
TwosideKeeper.models.remove(model);
|
|
||||||
model=null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void cleanup() {
|
|
||||||
for (ArmorStand stand : stands) {
|
|
||||||
TwosideKeeper.log("Removing entity ("+GenericFunctions.getDisplayName(stand)+")"+stand.getUniqueId(), 1);
|
|
||||||
stand.remove();
|
|
||||||
}
|
|
||||||
stands.clear();
|
|
||||||
modelParts.clear();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -16,13 +16,11 @@ public class DamageLabel{
|
|||||||
ArmorStand aec;
|
ArmorStand aec;
|
||||||
double spd;
|
double spd;
|
||||||
int duration;
|
int duration;
|
||||||
Location loc;
|
|
||||||
|
|
||||||
public DamageLabel(Location loc, ArmorStand aec, double spd, int duration) {
|
public DamageLabel(ArmorStand aec, double spd, int duration) {
|
||||||
this.aec=aec;
|
this.aec=aec;
|
||||||
this.spd=spd;
|
this.spd=spd;
|
||||||
this.duration=duration;
|
this.duration=duration;
|
||||||
this.loc=loc;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean run() {
|
public boolean run() {
|
||||||
@ -31,11 +29,7 @@ public class DamageLabel{
|
|||||||
/*if (duration>0) {
|
/*if (duration>0) {
|
||||||
Bukkit.getScheduler().runTaskLater(TwosideKeeper.plugin, new CloudRunnableRemoveLabel(aec.getLocation().add(0,spd,0).clone(),aec.getCustomName(),spd,duration), 1);
|
Bukkit.getScheduler().runTaskLater(TwosideKeeper.plugin, new CloudRunnableRemoveLabel(aec.getLocation().add(0,spd,0).clone(),aec.getCustomName(),spd,duration), 1);
|
||||||
}*/
|
}*/
|
||||||
if (loc!=null) {
|
|
||||||
aec.teleport(loc.add(0,spd,0));
|
|
||||||
} else {
|
|
||||||
aec.teleport(aec.getLocation().add(0,spd,0));
|
aec.teleport(aec.getLocation().add(0,spd,0));
|
||||||
}
|
|
||||||
if (duration<0) {
|
if (duration<0) {
|
||||||
aec.remove();
|
aec.remove();
|
||||||
return false;
|
return false;
|
||||||
|
@ -1,42 +0,0 @@
|
|||||||
package sig.plugin.TwosideKeeper.HelperStructures;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.bukkit.Location;
|
|
||||||
|
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.ArmorStandProperties;
|
|
||||||
import utils.Utils.Vector3D;
|
|
||||||
|
|
||||||
public class Model {
|
|
||||||
List<ArmorStandProperties> modelParts = new ArrayList<ArmorStandProperties>();
|
|
||||||
List<ArmorStandLinker> models = new ArrayList<ArmorStandLinker>();
|
|
||||||
|
|
||||||
Location loc;
|
|
||||||
Vector3D offset = new Vector3D(0,0,0);
|
|
||||||
double degreeRotation = 0;
|
|
||||||
|
|
||||||
public Model(Location loc, ArmorStandProperties...modelParts) {
|
|
||||||
this.modelParts = Arrays.asList(modelParts);
|
|
||||||
for (ArmorStandProperties prop : modelParts) {
|
|
||||||
models.add(new ArmorStandLinker(loc));
|
|
||||||
}
|
|
||||||
this.loc=loc;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void run() {
|
|
||||||
for (ArmorStandLinker parts : models) {
|
|
||||||
parts.run();
|
|
||||||
parts.setLocation(loc);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLocation(Location loc) {
|
|
||||||
this.loc = loc.clone();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Location getLocation() {
|
|
||||||
return loc;
|
|
||||||
}
|
|
||||||
}
|
|
@ -17,8 +17,8 @@ public enum PlayerMode {
|
|||||||
BARBARIAN(ChatColor.GOLD,"B","Barbarian",Book.BARBARIANGUIDE
|
BARBARIAN(ChatColor.GOLD,"B","Barbarian",Book.BARBARIANGUIDE
|
||||||
),
|
),
|
||||||
SLAYER(ChatColor.DARK_BLUE,"SL","Slayer",Book.SLAYERGUIDE),
|
SLAYER(ChatColor.DARK_BLUE,"SL","Slayer",Book.SLAYERGUIDE),
|
||||||
/*SUMMONER(ChatColor.DARK_PURPLE,"SM","Summoner",
|
SUMMONER(ChatColor.DARK_PURPLE,"SM","Summoner",
|
||||||
Book.SUMMONERGUIDE),*/
|
Book.SUMMONERGUIDE),
|
||||||
NORMAL(ChatColor.WHITE,"A","Adventurer",Book.ADVENTURERGUIDE);
|
NORMAL(ChatColor.WHITE,"A","Adventurer",Book.ADVENTURERGUIDE);
|
||||||
;
|
;
|
||||||
|
|
||||||
@ -63,9 +63,9 @@ public enum PlayerMode {
|
|||||||
if (Check_isRanger(p)) {
|
if (Check_isRanger(p)) {
|
||||||
pd.lastmode=PlayerMode.RANGER;
|
pd.lastmode=PlayerMode.RANGER;
|
||||||
} else
|
} else
|
||||||
/*if (Check_isSummoner(p)) {
|
if (Check_isSummoner(p)) {
|
||||||
pd.lastmode=PlayerMode.SUMMONER;
|
pd.lastmode=PlayerMode.SUMMONER;
|
||||||
} else*/ {
|
} else {
|
||||||
pd.lastmode=PlayerMode.NORMAL;
|
pd.lastmode=PlayerMode.NORMAL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -149,7 +149,7 @@ public enum PlayerMode {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*public static boolean isSummoner(Player p) {
|
public static boolean isSummoner(Player p) {
|
||||||
if (p!=null && !p.isDead()) {
|
if (p!=null && !p.isDead()) {
|
||||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||||
if (needsUpdating(pd)) {
|
if (needsUpdating(pd)) {
|
||||||
@ -160,7 +160,7 @@ public enum PlayerMode {
|
|||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
|
||||||
public static boolean isNormal(Player p) {
|
public static boolean isNormal(Player p) {
|
||||||
if (p!=null && !p.isDead()) {
|
if (p!=null && !p.isDead()) {
|
||||||
@ -268,7 +268,6 @@ public enum PlayerMode {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
public static boolean Check_isSummoner(Player p) {
|
public static boolean Check_isSummoner(Player p) {
|
||||||
if (p!=null && !p.isDead()) {
|
if (p!=null && !p.isDead()) {
|
||||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||||
@ -285,7 +284,7 @@ public enum PlayerMode {
|
|||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
|
||||||
String name="";
|
String name="";
|
||||||
Book helperBook;
|
Book helperBook;
|
||||||
@ -306,6 +305,6 @@ public enum PlayerMode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isLeatherPlayerMode(PlayerMode mode) {
|
public static boolean isLeatherPlayerMode(PlayerMode mode) {
|
||||||
return mode==PlayerMode.RANGER /*|| mode==PlayerMode.SUMMONER*/;
|
return mode==PlayerMode.RANGER || mode==PlayerMode.SUMMONER;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -79,8 +79,8 @@ public class EntityUtils {
|
|||||||
public static void applyDamageIndicator(Entity e, double damage, IndicatorType type) {
|
public static void applyDamageIndicator(Entity e, double damage, IndicatorType type) {
|
||||||
Location offsetloc = e.getLocation().add(Math.random()/2-0.25,0.5,Math.random()/2-0.25);
|
Location offsetloc = e.getLocation().add(Math.random()/2-0.25,0.5,Math.random()/2-0.25);
|
||||||
if (damage>=1) {
|
if (damage>=1) {
|
||||||
ArmorStand aec = CreateOverlayText(new Location(offsetloc.getWorld(),offsetloc.getX(),32648,offsetloc.getZ()),((damage>=100)?ChatColor.BOLD+" ":"")+type.getColor()+Integer.toString((int)damage)+((damage>=100)?" ":""));
|
ArmorStand aec = CreateOverlayText(offsetloc,((damage>=100)?ChatColor.BOLD+" ":"")+type.getColor()+Integer.toString((int)damage)+((damage>=100)?" ":""));
|
||||||
TwosideKeeper.labelqueue.add(new DamageLabel(offsetloc,aec,0.1,(int)(10*Math.min(Math.max(1,(double)damage/50),2))));
|
TwosideKeeper.labelqueue.add(new DamageLabel(aec,0.1,(int)(10*Math.min(Math.max(1,(double)damage/50),2))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,7 +92,6 @@ public class EntityUtils {
|
|||||||
aec.setCustomNameVisible(true);
|
aec.setCustomNameVisible(true);
|
||||||
aec.setVisible(false);
|
aec.setVisible(false);
|
||||||
aec.setMarker(true);
|
aec.setMarker(true);
|
||||||
aec.setInvulnerable(true);
|
|
||||||
//aec.setRadius(0);
|
//aec.setRadius(0);
|
||||||
//aec.setParticle(Particle.ITEM_TAKE);
|
//aec.setParticle(Particle.ITEM_TAKE);
|
||||||
//Bukkit.getScheduler().runTaskLater(TwosideKeeper.plugin,new CloudRunnable(aec,0.15,10),1);
|
//Bukkit.getScheduler().runTaskLater(TwosideKeeper.plugin,new CloudRunnable(aec,0.15,10),1);
|
||||||
|
@ -1,24 +1,12 @@
|
|||||||
package sig.plugin.TwosideKeeper.HelperStructures.Utils;
|
package sig.plugin.TwosideKeeper.HelperStructures.Utils;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.FileReader;
|
import java.io.FileReader;
|
||||||
import java.io.FileWriter;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
|
||||||
import java.io.InputStreamReader;
|
|
||||||
import java.io.PrintWriter;
|
|
||||||
import java.io.Reader;
|
|
||||||
import java.net.URL;
|
|
||||||
import java.nio.channels.FileChannel;
|
|
||||||
import java.nio.charset.Charset;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.json.JSONException;
|
|
||||||
import org.json.JSONObject;
|
|
||||||
|
|
||||||
public class FileUtils {
|
public class FileUtils {
|
||||||
public static String[] readFromFile(String filename) {
|
public static String[] readFromFile(String filename) {
|
||||||
File file = new File(filename);
|
File file = new File(filename);
|
||||||
@ -44,114 +32,4 @@ public class FileUtils {
|
|||||||
}
|
}
|
||||||
return contents.toArray(new String[contents.size()]);
|
return contents.toArray(new String[contents.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String readAll(Reader rd) throws IOException {
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
int cp;
|
|
||||||
while ((cp = rd.read()) != -1) {
|
|
||||||
sb.append((char) cp);
|
|
||||||
}
|
|
||||||
return sb.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static JSONObject readJsonFromUrl(String url) throws IOException, JSONException {
|
|
||||||
InputStream is = new URL(url).openStream();
|
|
||||||
try {
|
|
||||||
BufferedReader rd = new BufferedReader(new InputStreamReader(is, Charset.forName("UTF-8")));
|
|
||||||
String jsonText = readAll(rd);
|
|
||||||
JSONObject json = new JSONObject(jsonText);
|
|
||||||
jsonText=null;
|
|
||||||
return json;
|
|
||||||
} finally {
|
|
||||||
is.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static JSONObject readJsonFromFile(String file) throws IOException, JSONException {
|
|
||||||
InputStream is = new FileInputStream(new File(file));
|
|
||||||
try {
|
|
||||||
BufferedReader rd = new BufferedReader(new InputStreamReader(is, Charset.forName("UTF-8")));
|
|
||||||
String jsonText = readAll(rd);
|
|
||||||
JSONObject json = new JSONObject(jsonText);
|
|
||||||
jsonText=null;
|
|
||||||
return json;
|
|
||||||
} finally {
|
|
||||||
is.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static JSONObject readJsonFromUrl(String url, String file, boolean writeToFile) throws IOException, JSONException {
|
|
||||||
InputStream is = new URL(url).openStream();
|
|
||||||
try {
|
|
||||||
BufferedReader rd = new BufferedReader(new InputStreamReader(is, Charset.forName("UTF-8")));
|
|
||||||
String jsonText = readAll(rd);
|
|
||||||
if (writeToFile) {
|
|
||||||
writetoFile(new String[]{jsonText},file);
|
|
||||||
}
|
|
||||||
JSONObject json = new JSONObject(jsonText);
|
|
||||||
return json;
|
|
||||||
} finally {
|
|
||||||
is.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void logToFile(String message, String filename) {
|
|
||||||
File file = new File(filename);
|
|
||||||
try {
|
|
||||||
|
|
||||||
if (!file.exists()) {
|
|
||||||
file.createNewFile();
|
|
||||||
}
|
|
||||||
|
|
||||||
FileWriter fw = new FileWriter(file, true);
|
|
||||||
PrintWriter pw = new PrintWriter(fw);
|
|
||||||
|
|
||||||
pw.println(message);
|
|
||||||
pw.flush();
|
|
||||||
pw.close();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void writetoFile(String[] data, String filename) {
|
|
||||||
File file = new File(filename);
|
|
||||||
try {
|
|
||||||
|
|
||||||
if (!file.exists()) {
|
|
||||||
file.createNewFile();
|
|
||||||
}
|
|
||||||
|
|
||||||
FileWriter fw = new FileWriter(file,false);
|
|
||||||
PrintWriter pw = new PrintWriter(fw);
|
|
||||||
|
|
||||||
for (String s : data) {
|
|
||||||
pw.println(s);
|
|
||||||
}
|
|
||||||
pw.flush();
|
|
||||||
pw.close();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void copyFile(File source, File dest) throws IOException {
|
|
||||||
FileChannel sourceChannel = null;
|
|
||||||
FileChannel destChannel = null;
|
|
||||||
try {
|
|
||||||
sourceChannel = new FileInputStream(source).getChannel();
|
|
||||||
destChannel = new FileOutputStream(dest).getChannel();
|
|
||||||
destChannel.transferFrom(sourceChannel, 0, sourceChannel.size());
|
|
||||||
}finally{
|
|
||||||
sourceChannel.close();
|
|
||||||
destChannel.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void deleteFile(String filename) {
|
|
||||||
File file = new File(filename);
|
|
||||||
if (file.exists()) {
|
|
||||||
file.delete();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,49 +0,0 @@
|
|||||||
package sig.plugin.TwosideKeeper.HelperStructures.Utils;
|
|
||||||
import java.lang.reflect.Field;
|
|
||||||
|
|
||||||
public class JavaUtils {
|
|
||||||
public JavaUtils clone() {
|
|
||||||
JavaUtils newpos = new JavaUtils();
|
|
||||||
for (Field f : this.getClass().getDeclaredFields()) {
|
|
||||||
if (ReflectUtils.isCloneable(f)) {
|
|
||||||
try {
|
|
||||||
f.set(newpos, f.get(this));
|
|
||||||
} catch (IllegalArgumentException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (IllegalAccessException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return newpos;
|
|
||||||
}
|
|
||||||
public String toString() {
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
sb.append(this.getClass().getName()+"(");
|
|
||||||
boolean first=false;
|
|
||||||
for (Field f : this.getClass().getDeclaredFields()) {
|
|
||||||
if (!ReflectUtils.isCloneable(f)) {
|
|
||||||
if (!first) {
|
|
||||||
try {
|
|
||||||
sb.append(f.getName()+"="+f.get(this));
|
|
||||||
first=true;
|
|
||||||
} catch (IllegalArgumentException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (IllegalAccessException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
sb.append(","+f.getName()+"="+f.get(this));
|
|
||||||
} catch (IllegalArgumentException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (IllegalAccessException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
sb.append(")");
|
|
||||||
return sb.toString();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,9 +0,0 @@
|
|||||||
package sig.plugin.TwosideKeeper.HelperStructures.Utils;
|
|
||||||
import java.lang.reflect.Field;
|
|
||||||
|
|
||||||
public class ReflectUtils {
|
|
||||||
public static boolean isCloneable(Field f) {
|
|
||||||
int mods = f.getModifiers();
|
|
||||||
return mods<8;
|
|
||||||
}
|
|
||||||
}
|
|
@ -729,11 +729,7 @@ public class PlayerStructure {
|
|||||||
this.holidaychest4 = workable.getBoolean("holidaychest4");
|
this.holidaychest4 = workable.getBoolean("holidaychest4");
|
||||||
this.lastsantabox2 = workable.getLong("lastsantabox2");
|
this.lastsantabox2 = workable.getLong("lastsantabox2");
|
||||||
this.lastvendettastack = workable.getLong("lastvendettastack");
|
this.lastvendettastack = workable.getLong("lastvendettastack");
|
||||||
try {
|
|
||||||
this.playermode_on_death = PlayerMode.valueOf(workable.getString("playermode_on_death"));
|
this.playermode_on_death = PlayerMode.valueOf(workable.getString("playermode_on_death"));
|
||||||
} catch (IllegalArgumentException e) {
|
|
||||||
this.playermode_on_death = PlayerMode.NORMAL;
|
|
||||||
}
|
|
||||||
this.last_deathmark = workable.getLong("COOLDOWN_deathmark");
|
this.last_deathmark = workable.getLong("COOLDOWN_deathmark");
|
||||||
this.last_shovelspell = workable.getLong("COOLDOWN_shovelspell");
|
this.last_shovelspell = workable.getLong("COOLDOWN_shovelspell");
|
||||||
this.last_strikerspell = workable.getLong("COOLDOWN_strikerspell");
|
this.last_strikerspell = workable.getLong("COOLDOWN_strikerspell");
|
||||||
|
@ -1180,15 +1180,6 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetupFolders(String...folders) {
|
|
||||||
for (String s : folders) {
|
|
||||||
File fold = new File(TwosideKeeper.plugin.getDataFolder()+"/"+s);
|
|
||||||
if (!fold.exists()) {
|
|
||||||
fold.mkdirs();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
Bukkit.getPluginManager().registerEvents(this, this);
|
Bukkit.getPluginManager().registerEvents(this, this);
|
||||||
@ -1197,18 +1188,6 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
|
|
||||||
loadConfig();
|
loadConfig();
|
||||||
|
|
||||||
SetupFolders("arrowquivers",
|
|
||||||
"books",
|
|
||||||
"debug",
|
|
||||||
"inventorybackup",
|
|
||||||
"itemcubes",
|
|
||||||
"itemrecords",
|
|
||||||
"logs",
|
|
||||||
"models",
|
|
||||||
"records",
|
|
||||||
"updates",
|
|
||||||
"users");
|
|
||||||
|
|
||||||
CustomItem.InitializeItemRecipes();
|
CustomItem.InitializeItemRecipes();
|
||||||
Recipes.Initialize_ItemCube_Recipes();
|
Recipes.Initialize_ItemCube_Recipes();
|
||||||
Recipes.Initialize_ArrowQuiver_Recipe();
|
Recipes.Initialize_ArrowQuiver_Recipe();
|
||||||
@ -1452,10 +1431,10 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
HashMap<String,List<ItemStack>> recyclingCenterItems = populateRecyclingCenterItems();
|
HashMap<String,List<ItemStack>> recyclingCenterItems = populateRecyclingCenterItems();
|
||||||
if (args.length==1) {
|
if (args.length==1) {
|
||||||
//Get a master list of all Recycling Center items.
|
//Get a master list of all Recycling Center items.
|
||||||
aPlugin.API.discordSendRaw("\n"+
|
aPlugin.API.discordSendRaw("```\n"+
|
||||||
GenericFunctions.generateItemList(
|
GenericFunctions.generateItemList(
|
||||||
GenericFunctions.getItemList(recyclingCenterItems)
|
GenericFunctions.getItemList(recyclingCenterItems)
|
||||||
,null,true)+"\n"
|
,null,true)+"\n```"
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
//Try to use the search phrase given.
|
//Try to use the search phrase given.
|
||||||
@ -1464,11 +1443,11 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
newargs[i-1]=args[i];
|
newargs[i-1]=args[i];
|
||||||
}
|
}
|
||||||
args = newargs;
|
args = newargs;
|
||||||
aPlugin.API.discordSendRaw("\n"+
|
aPlugin.API.discordSendRaw("```\n"+
|
||||||
GenericFunctions.generateItemList(
|
GenericFunctions.generateItemList(
|
||||||
GenericFunctions.getItemList(recyclingCenterItems)
|
GenericFunctions.getItemList(recyclingCenterItems)
|
||||||
,args, true
|
,args, true
|
||||||
)+"\n"
|
)+"\n```"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},"search");
|
},"search");
|
||||||
@ -1547,7 +1526,6 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
ReplaceBlockTask.CleanupTemporaryBlock(tb);
|
ReplaceBlockTask.CleanupTemporaryBlock(tb);
|
||||||
}
|
}
|
||||||
log(ChatColor.YELLOW+" "+(System.currentTimeMillis()-betweentime)+"ms",CLEANUP_DEBUG);
|
log(ChatColor.YELLOW+" "+(System.currentTimeMillis()-betweentime)+"ms",CLEANUP_DEBUG);
|
||||||
betweentime = System.currentTimeMillis();
|
|
||||||
log("Resetting Mob Names ["+livingentitydata.size()+"]",CLEANUP_DEBUG);
|
log("Resetting Mob Names ["+livingentitydata.size()+"]",CLEANUP_DEBUG);
|
||||||
for (UUID id : livingentitydata.keySet()) {
|
for (UUID id : livingentitydata.keySet()) {
|
||||||
//TemporaryBlock tb = temporaryblocks.get(ss);
|
//TemporaryBlock tb = temporaryblocks.get(ss);
|
||||||
@ -1557,24 +1535,16 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
//TwosideKeeper.log("Saving unloaded monster "+les.getUnloadedName(), 0);
|
//TwosideKeeper.log("Saving unloaded monster "+les.getUnloadedName(), 0);
|
||||||
}
|
}
|
||||||
log(ChatColor.YELLOW+" "+(System.currentTimeMillis()-betweentime)+"ms",CLEANUP_DEBUG);
|
log(ChatColor.YELLOW+" "+(System.currentTimeMillis()-betweentime)+"ms",CLEANUP_DEBUG);
|
||||||
betweentime = System.currentTimeMillis();
|
|
||||||
log("Removing Instances ["+roominstances.size()+"]",CLEANUP_DEBUG);
|
log("Removing Instances ["+roominstances.size()+"]",CLEANUP_DEBUG);
|
||||||
for (Room room : roominstances) {
|
for (Room room : roominstances) {
|
||||||
room.killWorld();
|
room.killWorld();
|
||||||
}
|
}
|
||||||
log(ChatColor.YELLOW+" "+(System.currentTimeMillis()-betweentime)+"ms",CLEANUP_DEBUG);
|
log(ChatColor.YELLOW+" "+(System.currentTimeMillis()-betweentime)+"ms",CLEANUP_DEBUG);
|
||||||
betweentime = System.currentTimeMillis();
|
|
||||||
log("Removing Damage Labels ["+labelqueue.size()+"]",CLEANUP_DEBUG);
|
log("Removing Damage Labels ["+labelqueue.size()+"]",CLEANUP_DEBUG);
|
||||||
for (DamageLabel label : labelqueue) {
|
for (DamageLabel label : labelqueue) {
|
||||||
label.cleanup();
|
label.cleanup();
|
||||||
}
|
}
|
||||||
log(ChatColor.YELLOW+" "+(System.currentTimeMillis()-betweentime)+"ms",CLEANUP_DEBUG);
|
log(ChatColor.YELLOW+" "+(System.currentTimeMillis()-betweentime)+"ms",CLEANUP_DEBUG);
|
||||||
betweentime = System.currentTimeMillis();
|
|
||||||
log("Removing Models ["+models.size()+"]",CLEANUP_DEBUG);
|
|
||||||
for (CustomModel model : models) {
|
|
||||||
model.cleanup();
|
|
||||||
}
|
|
||||||
log(ChatColor.YELLOW+" "+(System.currentTimeMillis()-betweentime)+"ms",CLEANUP_DEBUG);
|
|
||||||
long endtime = System.currentTimeMillis();
|
long endtime = System.currentTimeMillis();
|
||||||
log("Cleanup Maintenance completed. Total Time: "+(endtime-starttime)+"ms.",CLEANUP_DEBUG);
|
log("Cleanup Maintenance completed. Total Time: "+(endtime-starttime)+"ms.",CLEANUP_DEBUG);
|
||||||
}
|
}
|
||||||
@ -1789,7 +1759,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
//Try to use the search phrase given. abc
|
//Try to use the search phrase given.
|
||||||
sender.sendMessage(GenericFunctions.generateItemList(
|
sender.sendMessage(GenericFunctions.generateItemList(
|
||||||
GenericFunctions.getItemList(recyclingCenterItems)
|
GenericFunctions.getItemList(recyclingCenterItems)
|
||||||
,args
|
,args
|
||||||
@ -2901,14 +2871,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
case 19:{
|
case 19:{
|
||||||
Location currentloc = pd.myStand.getLocation().clone();
|
Location currentloc = pd.myStand.getLocation().clone();
|
||||||
currentloc.add(Double.parseDouble(args[2]),Double.parseDouble(args[3]),Double.parseDouble(args[4]));
|
currentloc.add(Double.parseDouble(args[2]),Double.parseDouble(args[3]),Double.parseDouble(args[4]));
|
||||||
ArmorStandProperties prop = CustomModel.getPropertyFromStand(pd.myStand.getUniqueId());
|
pd.myStand.teleport(currentloc);
|
||||||
Vector currentOffset = prop.getOffset();
|
|
||||||
prop.setOffset(new Vector(currentOffset.getX()+Double.parseDouble(args[2]),currentOffset.getY()+Double.parseDouble(args[3]),currentOffset.getZ()+Double.parseDouble(args[4])));
|
|
||||||
}break;
|
|
||||||
case 20:{
|
|
||||||
ArmorStandProperties prop = CustomModel.getPropertyFromStand(pd.myStand.getUniqueId());
|
|
||||||
Vector facingDirection = p.getLocation().getDirection();
|
|
||||||
prop.setFacingDirection(facingDirection);
|
|
||||||
}break;
|
}break;
|
||||||
}
|
}
|
||||||
}break;
|
}break;
|
||||||
@ -2962,36 +2925,6 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
aPlugin.API.setItem(p, p.getOpenInventory(), i, new ItemStack(Material.ACACIA_DOOR_ITEM));
|
aPlugin.API.setItem(p, p.getOpenInventory(), i, new ItemStack(Material.ACACIA_DOOR_ITEM));
|
||||||
}
|
}
|
||||||
}break;
|
}break;
|
||||||
case "MODELS":{
|
|
||||||
if (args.length==1) {
|
|
||||||
CustomModel mymod = new CustomModel(p.getLocation(),new ArmorStandProperties[]{
|
|
||||||
ArmorStandProperties.BLANK
|
|
||||||
});
|
|
||||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
|
||||||
pd.myModel = mymod;
|
|
||||||
models.add(pd.myModel);
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
switch (args[1]) {
|
|
||||||
case "add":{
|
|
||||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
|
||||||
pd.myModel.AddModelPart(ArmorStandProperties.BLANK);
|
|
||||||
}break;
|
|
||||||
case "save":{
|
|
||||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
|
||||||
pd.myModel.saveModel(args[2]);
|
|
||||||
}break;
|
|
||||||
case "load":{
|
|
||||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
|
||||||
pd.myModel.loadModel(p.getLocation(),args[2]);
|
|
||||||
}break;
|
|
||||||
case "remove":{
|
|
||||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
|
||||||
CustomModel.cleanup(pd.myModel);
|
|
||||||
}break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//LivingEntity m = MonsterController.convertMonster((Monster)p.getWorld().spawnEntity(p.getLocation(),EntityType.ZOMBIE), MonsterDifficulty.ELITE);
|
//LivingEntity m = MonsterController.convertMonster((Monster)p.getWorld().spawnEntity(p.getLocation(),EntityType.ZOMBIE), MonsterDifficulty.ELITE);
|
||||||
@ -4832,11 +4765,11 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
PerformShieldCharge(p, pd);
|
PerformShieldCharge(p, pd);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*if (PlayerMode.getPlayerMode(p)==PlayerMode.SUMMONER) {
|
if (PlayerMode.getPlayerMode(p)==PlayerMode.SUMMONER) {
|
||||||
if (!Summoner.HandleSummonerInteraction(ev)) {
|
if (!Summoner.HandleSummonerInteraction(ev)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
|
||||||
if (!Christmas.RunPlayerInteractEvent(ev)) {return;}
|
if (!Christmas.RunPlayerInteractEvent(ev)) {return;}
|
||||||
|
|
||||||
@ -7975,23 +7908,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
}
|
}
|
||||||
if (e instanceof ArmorStand) {
|
if (e instanceof ArmorStand) {
|
||||||
ArmorStand as = (ArmorStand)e;
|
ArmorStand as = (ArmorStand)e;
|
||||||
if (as.isInvulnerable()) {
|
if (as.getRemoveWhenFarAway()) {
|
||||||
removalEntities.add(e);
|
removalEntities.add(e);
|
||||||
CustomModel killModel = null;
|
|
||||||
for (CustomModel model : models) {
|
|
||||||
for (ArmorStand stands : model.stands) {
|
|
||||||
if (stands.getUniqueId().equals(e.getUniqueId())) {
|
|
||||||
killModel = model;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (killModel!=null) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (killModel!=null) {
|
|
||||||
CustomModel.cleanup(killModel);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -110,7 +110,7 @@ final public class runServerHeartbeat implements Runnable {
|
|||||||
if (TwosideKeeper.SERVER_TYPE!=ServerType.QUIET) {
|
if (TwosideKeeper.SERVER_TYPE!=ServerType.QUIET) {
|
||||||
DecimalFormat df = new DecimalFormat("0.00");
|
DecimalFormat df = new DecimalFormat("0.00");
|
||||||
DecimalFormat df2 = new DecimalFormat("0");
|
DecimalFormat df2 = new DecimalFormat("0");
|
||||||
aPlugin.API.discordSendRaw("*The Deal of the Day has been updated!*\n **"+GenericFunctions.UserFriendlyMaterialName(TwosideKeeper.DEAL_OF_THE_DAY_ITEM)+"** ~~$"+df.format(WorldShop.getBaseWorldShopPrice(TwosideKeeper.DEAL_OF_THE_DAY_ITEM))+"~~ $"+df.format(WorldShop.getBaseWorldShopPrice(TwosideKeeper.DEAL_OF_THE_DAY_ITEM)*(1-TwosideKeeper.DEAL_OF_THE_DAY_PCT))+" **"+df2.format(TwosideKeeper.DEAL_OF_THE_DAY_PCT*100)+"% Off!**");
|
//aPlugin.API.discordSendRaw("*The Deal of the Day has been updated!*\n **"+GenericFunctions.UserFriendlyMaterialName(TwosideKeeper.DEAL_OF_THE_DAY_ITEM)+"** ~~$"+df.format(WorldShop.getBaseWorldShopPrice(TwosideKeeper.DEAL_OF_THE_DAY_ITEM))+"~~ $"+df.format(WorldShop.getBaseWorldShopPrice(TwosideKeeper.DEAL_OF_THE_DAY_ITEM)*(1-TwosideKeeper.DEAL_OF_THE_DAY_PCT))+" **"+df2.format(TwosideKeeper.DEAL_OF_THE_DAY_PCT*100)+"% Off!**");
|
||||||
//MessageUtils.announceMessage("The Deal of the Day has been updated!");
|
//MessageUtils.announceMessage("The Deal of the Day has been updated!");
|
||||||
}
|
}
|
||||||
for (Player p : Bukkit.getOnlinePlayers()) {
|
for (Player p : Bukkit.getOnlinePlayers()) {
|
||||||
@ -121,7 +121,7 @@ final public class runServerHeartbeat implements Runnable {
|
|||||||
if (Calendar.getInstance().get(Calendar.DAY_OF_WEEK)==Calendar.SUNDAY && TwosideKeeper.LAST_WEEKLY_RESET+6912000<=TwosideKeeper.getServerTickTime()) {
|
if (Calendar.getInstance().get(Calendar.DAY_OF_WEEK)==Calendar.SUNDAY && TwosideKeeper.LAST_WEEKLY_RESET+6912000<=TwosideKeeper.getServerTickTime()) {
|
||||||
TwosideKeeper.LAST_WEEKLY_RESET = TwosideKeeper.getServerTickTime();
|
TwosideKeeper.LAST_WEEKLY_RESET = TwosideKeeper.getServerTickTime();
|
||||||
|
|
||||||
aPlugin.API.discordSendRaw("__**Last Week's Challenge Standings**__ *(Use !daily to see Hall of Fame)*");
|
//aPlugin.API.discordSendRaw("__**Last Week's Challenge Standings**__ *(Use !daily to see Hall of Fame)*");
|
||||||
if (TwosideKeeper.dpschallenge_records.recordlist.size()>0) {
|
if (TwosideKeeper.dpschallenge_records.recordlist.size()>0) {
|
||||||
TwosideKeeper.dpschallenge_records.announceRecords();
|
TwosideKeeper.dpschallenge_records.announceRecords();
|
||||||
}
|
}
|
||||||
@ -132,7 +132,7 @@ final public class runServerHeartbeat implements Runnable {
|
|||||||
TwosideKeeper.parkourchallenge_records.announceRecords();
|
TwosideKeeper.parkourchallenge_records.announceRecords();
|
||||||
}
|
}
|
||||||
|
|
||||||
aPlugin.API.discordSendRawItalicized("All Weekly Challenge Leaderboards have been reset!");
|
//aPlugin.API.discordSendRawItalicized("All Weekly Challenge Leaderboards have been reset!");
|
||||||
TwosideKeeper.dpschallenge_records.resetRecords();
|
TwosideKeeper.dpschallenge_records.resetRecords();
|
||||||
TwosideKeeper.tankchallenge_records.resetRecords();
|
TwosideKeeper.tankchallenge_records.resetRecords();
|
||||||
TwosideKeeper.parkourchallenge_records.resetRecords();
|
TwosideKeeper.parkourchallenge_records.resetRecords();
|
||||||
|
@ -33,18 +33,14 @@ public class runServerTick implements Runnable{
|
|||||||
TwosideKeeper.labelqueue.remove(i--);
|
TwosideKeeper.labelqueue.remove(i--);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (CustomModel model : TwosideKeeper.models) {
|
|
||||||
model.displayModel();
|
|
||||||
}
|
|
||||||
for (Player p : Bukkit.getOnlinePlayers()) {
|
for (Player p : Bukkit.getOnlinePlayers()) {
|
||||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||||
if (!aPluginAPIWrapper.isAFK(p)) {
|
if (!aPluginAPIWrapper.isAFK(p)) {
|
||||||
//pd.myModel.displayModel(p.getLocation());
|
//pd.myModel.displayModel(p.getLocation());
|
||||||
//pd.myModel.displayModel();
|
|
||||||
if (pd.myPet!=null) {
|
if (pd.myPet!=null) {
|
||||||
pd.myPet.run();
|
pd.myPet.run();
|
||||||
}
|
}
|
||||||
/*if (PlayerMode.isSummoner(p)) {
|
if (PlayerMode.isSummoner(p)) {
|
||||||
//long timer = System.nanoTime();
|
//long timer = System.nanoTime();
|
||||||
LivingEntity targetent = aPlugin.API.rayTraceTargetEntity(p, 16);
|
LivingEntity targetent = aPlugin.API.rayTraceTargetEntity(p, 16);
|
||||||
if (targetent!=null) {
|
if (targetent!=null) {
|
||||||
@ -64,7 +60,7 @@ public class runServerTick implements Runnable{
|
|||||||
pd.lastTarget=targetent;
|
pd.lastTarget=targetent;
|
||||||
}
|
}
|
||||||
//TwosideKeeper.log("Time Execution took: "+((System.nanoTime()-timer)/1000000)+"ms", 1);
|
//TwosideKeeper.log("Time Execution took: "+((System.nanoTime()-timer)/1000000)+"ms", 1);
|
||||||
}*/
|
}
|
||||||
if (pd.mouseoverhealthbar && pd.lastGrabbedTarget+10<=TwosideKeeper.getServerTickTime()) {
|
if (pd.mouseoverhealthbar && pd.lastGrabbedTarget+10<=TwosideKeeper.getServerTickTime()) {
|
||||||
LivingEntity targetent = aPlugin.API.rayTraceTargetEntity(p, 16);
|
LivingEntity targetent = aPlugin.API.rayTraceTargetEntity(p, 16);
|
||||||
if (targetent!=null && (!(targetent instanceof ArmorStand) || (targetent instanceof ArmorStand && ((ArmorStand)targetent).isVisible())) &&
|
if (targetent!=null && (!(targetent instanceof ArmorStand) || (targetent instanceof ArmorStand && ((ArmorStand)targetent).isVisible())) &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user