Made Labels smoother and implemented better. Implemented Custom Models
and fixed a bug allowing Slayers to get HP from the Dawntracker set.
This commit is contained in:
parent
ae2148bed7
commit
6d82052571
Binary file not shown.
@ -12,6 +12,7 @@ public enum Book {
|
|||||||
RANGERGUIDE("RangerGuide.txt"),
|
RANGERGUIDE("RangerGuide.txt"),
|
||||||
SLAYERGUIDE("SlayerGuide.txt"),
|
SLAYERGUIDE("SlayerGuide.txt"),
|
||||||
BARBARIANGUIDE("BarbarianGuide.txt"),
|
BARBARIANGUIDE("BarbarianGuide.txt"),
|
||||||
|
SUMMONERGUIDE("SummonerGuide.txt"),
|
||||||
ADVENTURERGUIDE("AdventurerGuide.txt");
|
ADVENTURERGUIDE("AdventurerGuide.txt");
|
||||||
|
|
||||||
String fileLoc;
|
String fileLoc;
|
||||||
|
@ -1,34 +0,0 @@
|
|||||||
package sig.plugin.TwosideKeeper.HelperStructures;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.ChatColor;
|
|
||||||
import org.bukkit.Location;
|
|
||||||
import org.bukkit.entity.AreaEffectCloud;
|
|
||||||
import org.bukkit.entity.EnderSignal;
|
|
||||||
import org.bukkit.entity.EntityType;
|
|
||||||
import org.bukkit.entity.FallingBlock;
|
|
||||||
|
|
||||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.EntityUtils;
|
|
||||||
|
|
||||||
public class CloudRunnableRemoveLabel implements Runnable{
|
|
||||||
AreaEffectCloud aec;
|
|
||||||
Location loc;
|
|
||||||
String str;
|
|
||||||
double spd;
|
|
||||||
int duration;
|
|
||||||
|
|
||||||
public CloudRunnableRemoveLabel(Location loc,String str,double spd,int duration) {
|
|
||||||
this.loc=loc;
|
|
||||||
this.str=str;
|
|
||||||
this.spd=spd;
|
|
||||||
this.duration=duration;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
aec = EntityUtils.CreateOverlayText(loc, str);
|
|
||||||
Bukkit.getScheduler().runTaskLater(TwosideKeeper.plugin, new CloudRunnable(aec,spd,duration), 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -0,0 +1,207 @@
|
|||||||
|
package sig.plugin.TwosideKeeper.HelperStructures.Common;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.util.EulerAngle;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
import sig.plugin.TwosideKeeper.HelperStructures.Utils.MathUtils;
|
||||||
|
|
||||||
|
public class ArmorStandProperties {
|
||||||
|
final public static ArmorStandProperties SCEPTERBASE = new ArmorStandProperties();
|
||||||
|
final public static ArmorStandProperties SCEPTERTOP = new ArmorStandProperties();
|
||||||
|
|
||||||
|
boolean arms = false;
|
||||||
|
boolean baseplate = false;
|
||||||
|
EulerAngle bodyPose = EulerAngle.ZERO;
|
||||||
|
ItemStack boots = new ItemStack(Material.AIR);
|
||||||
|
ItemStack chestplate = new ItemStack(Material.AIR);
|
||||||
|
EulerAngle headPose = EulerAngle.ZERO;
|
||||||
|
ItemStack helmet = new ItemStack(Material.AIR);
|
||||||
|
ItemStack hand = new ItemStack(Material.AIR);
|
||||||
|
EulerAngle leftArmPose = EulerAngle.ZERO;
|
||||||
|
EulerAngle leftLegPose = EulerAngle.ZERO;
|
||||||
|
ItemStack leggings = new ItemStack(Material.AIR);
|
||||||
|
boolean marker = false;
|
||||||
|
EulerAngle rightArmPose = EulerAngle.ZERO;
|
||||||
|
EulerAngle rightLegPose = EulerAngle.ZERO;
|
||||||
|
|
||||||
|
boolean small = false;
|
||||||
|
boolean visible=true;
|
||||||
|
boolean customNameVisible=false;
|
||||||
|
String customName="";
|
||||||
|
Vector offset = new Vector();
|
||||||
|
|
||||||
|
public ArmorStandProperties() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isArms() {
|
||||||
|
return arms;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setArms(boolean arms) {
|
||||||
|
this.arms = arms;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isBaseplate() {
|
||||||
|
return baseplate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBaseplate(boolean baseplate) {
|
||||||
|
this.baseplate = baseplate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EulerAngle getBodyPose() {
|
||||||
|
return bodyPose;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBodyPose(EulerAngle bodyPose) {
|
||||||
|
this.bodyPose = bodyPose;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack getBoots() {
|
||||||
|
return boots;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBoots(ItemStack boots) {
|
||||||
|
this.boots = boots;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack getChestplate() {
|
||||||
|
return chestplate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChestplate(ItemStack chestplate) {
|
||||||
|
this.chestplate = chestplate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EulerAngle getHeadPose() {
|
||||||
|
return headPose;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHeadPose(EulerAngle headPose) {
|
||||||
|
this.headPose = headPose;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack getHelmet() {
|
||||||
|
return helmet;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHelmet(ItemStack helmet) {
|
||||||
|
this.helmet = helmet;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack getHand() {
|
||||||
|
return hand;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHand(ItemStack hand) {
|
||||||
|
this.hand = hand;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EulerAngle getLeftArmPose() {
|
||||||
|
return leftArmPose;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLeftArmPose(EulerAngle leftArmPose) {
|
||||||
|
this.leftArmPose = leftArmPose;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EulerAngle getLeftLegPose() {
|
||||||
|
return leftLegPose;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLeftLegPose(EulerAngle leftLegPose) {
|
||||||
|
this.leftLegPose = leftLegPose;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack getLeggings() {
|
||||||
|
return leggings;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLeggings(ItemStack leggings) {
|
||||||
|
this.leggings = leggings;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isMarker() {
|
||||||
|
return marker;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMarker(boolean marker) {
|
||||||
|
this.marker = marker;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EulerAngle getRightArmPose() {
|
||||||
|
return rightArmPose;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRightArmPose(EulerAngle rightArmPose) {
|
||||||
|
this.rightArmPose = rightArmPose;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isSmall() {
|
||||||
|
return small;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSmall(boolean small) {
|
||||||
|
this.small = small;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isVisible() {
|
||||||
|
return visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVisible(boolean visible) {
|
||||||
|
this.visible = visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isCustomNameVisible() {
|
||||||
|
return customNameVisible;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCustomNameVisible(boolean customNameVisible) {
|
||||||
|
this.customNameVisible = customNameVisible;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCustomName() {
|
||||||
|
return customName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCustomName(String customName) {
|
||||||
|
this.customName = customName;
|
||||||
|
}
|
||||||
|
public EulerAngle getRightLegPose() {
|
||||||
|
return rightLegPose;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRightLegPose(EulerAngle rightLegPose) {
|
||||||
|
this.rightLegPose = rightLegPose;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Vector getOffset() {
|
||||||
|
return offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOffset(Vector offset) {
|
||||||
|
this.offset = offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void defineAllModels() {
|
||||||
|
SetupScepterBase();
|
||||||
|
SetupScepterTop();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void SetupScepterTop() {
|
||||||
|
SCEPTERTOP.rightArmPose = MathUtils.getEulerAngleDegrees(-90, 0, 0);
|
||||||
|
SCEPTERTOP.hand = new ItemStack(Material.DOUBLE_PLANT);
|
||||||
|
SCEPTERTOP.offset = new Vector(-0.7,0,0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void SetupScepterBase() {
|
||||||
|
SCEPTERBASE.rightArmPose = MathUtils.getEulerAngleDegrees(-90, 90, 0);
|
||||||
|
SCEPTERBASE.small = true;
|
||||||
|
SCEPTERBASE.hand = new ItemStack(Material.BONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -95,7 +95,7 @@ public class Habitation {
|
|||||||
|
|
||||||
public void addKillToLocation(Location location) {
|
public void addKillToLocation(Location location) {
|
||||||
String locationHash = getLocationHash(location);
|
String locationHash = getLocationHash(location);
|
||||||
TwosideKeeper.log("Location hash is "+locationHash, 0);
|
//TwosideKeeper.log("Location hash is "+locationHash, 0);
|
||||||
locationhashes.put(locationHash, locationhashes.getOrDefault(locationHash, 0) + 1);
|
locationhashes.put(locationHash, locationhashes.getOrDefault(locationHash, 0) + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,55 @@
|
|||||||
|
package sig.plugin.TwosideKeeper.HelperStructures;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.entity.ArmorStand;
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
|
|
||||||
|
import sig.plugin.TwosideKeeper.HelperStructures.Common.ArmorStandProperties;
|
||||||
|
|
||||||
|
public class CustomModel {
|
||||||
|
List<ArmorStandProperties> modelParts = new ArrayList<ArmorStandProperties>();
|
||||||
|
List<ArmorStand> stands = new ArrayList<ArmorStand>();
|
||||||
|
|
||||||
|
public CustomModel(Location loc, ArmorStandProperties...modelParts) {
|
||||||
|
for (ArmorStandProperties asp : modelParts) {
|
||||||
|
this.modelParts.add(asp);
|
||||||
|
this.stands.add(setupArmorStand(loc, asp));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private ArmorStand setupArmorStand(Location loc, ArmorStandProperties asp) {
|
||||||
|
ArmorStand stand = (ArmorStand)loc.getWorld().spawnEntity(loc, EntityType.ARMOR_STAND);
|
||||||
|
stand.setArms(asp.isArms());
|
||||||
|
stand.setBasePlate(asp.isBaseplate());
|
||||||
|
stand.setBodyPose(asp.getBodyPose());
|
||||||
|
stand.setBoots(asp.getBoots());
|
||||||
|
stand.setChestplate(asp.getChestplate());
|
||||||
|
stand.setHeadPose(asp.getHeadPose());
|
||||||
|
stand.setHelmet(asp.getHelmet());
|
||||||
|
stand.setItemInHand(asp.getHand());
|
||||||
|
stand.setLeftArmPose(asp.getLeftArmPose());
|
||||||
|
stand.setLeftLegPose(asp.getLeftLegPose());
|
||||||
|
stand.setLeggings(asp.getLeggings());
|
||||||
|
stand.setMarker(asp.isMarker());
|
||||||
|
stand.setRightArmPose(asp.getRightArmPose());
|
||||||
|
stand.setRightLegPose(asp.getRightLegPose());
|
||||||
|
stand.setSmall(asp.isSmall());
|
||||||
|
stand.setVisible(asp.isVisible());
|
||||||
|
stand.setCustomNameVisible(asp.isCustomNameVisible());
|
||||||
|
stand.setCustomName(asp.getCustomName());
|
||||||
|
stand.teleport(loc.add(asp.getOffset()));
|
||||||
|
return stand;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void displayModel(Location loc) {
|
||||||
|
for (int i=0;i<stands.size();i++) {
|
||||||
|
if (stands.get(i)!=null && stands.get(i).isValid()) {
|
||||||
|
stands.get(i).teleport(loc.add(modelParts.get(i).getOffset()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -4,6 +4,7 @@ import org.bukkit.Bukkit;
|
|||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.AreaEffectCloud;
|
import org.bukkit.entity.AreaEffectCloud;
|
||||||
|
import org.bukkit.entity.ArmorStand;
|
||||||
import org.bukkit.entity.EnderSignal;
|
import org.bukkit.entity.EnderSignal;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.FallingBlock;
|
import org.bukkit.entity.FallingBlock;
|
||||||
@ -11,27 +12,35 @@ import org.bukkit.entity.FallingBlock;
|
|||||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.EntityUtils;
|
import sig.plugin.TwosideKeeper.HelperStructures.Utils.EntityUtils;
|
||||||
|
|
||||||
public class CloudRunnable implements Runnable{
|
public class DamageLabel{
|
||||||
AreaEffectCloud aec;
|
ArmorStand aec;
|
||||||
double spd;
|
double spd;
|
||||||
int duration;
|
int duration;
|
||||||
|
|
||||||
public CloudRunnable(AreaEffectCloud 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public boolean run() {
|
||||||
public void run() {
|
|
||||||
if (aec.isValid()) {
|
if (aec.isValid()) {
|
||||||
duration--;
|
duration--;
|
||||||
if (duration>0) {
|
/*if (duration>0) {
|
||||||
Bukkit.getScheduler().runTaskLater(TwosideKeeper.plugin, new CloudRunnableRemoveLabel(aec.getLocation().add(0,spd,0).clone(),aec.getCustomName(),spd,duration), 2);
|
Bukkit.getScheduler().runTaskLater(TwosideKeeper.plugin, new CloudRunnableRemoveLabel(aec.getLocation().add(0,spd,0).clone(),aec.getCustomName(),spd,duration), 1);
|
||||||
}
|
}*/
|
||||||
aec.teleport(aec.getLocation().add(0,spd,0));
|
aec.teleport(aec.getLocation().add(0,spd,0));
|
||||||
aec.remove();
|
if (duration<0) {
|
||||||
|
aec.remove();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void cleanup() {
|
||||||
|
aec.remove();
|
||||||
|
}
|
||||||
}
|
}
|
@ -18,7 +18,7 @@ public enum PlayerMode {
|
|||||||
),
|
),
|
||||||
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",
|
||||||
ChatColor.DARK_PURPLE+""+ChatColor.BOLD+"Summoner mode Perks: "+ChatColor.RESET+"\n"),*/
|
Book.SUMMONERGUIDE),*/
|
||||||
NORMAL(ChatColor.WHITE,"A","Adventurer",Book.ADVENTURERGUIDE);
|
NORMAL(ChatColor.WHITE,"A","Adventurer",Book.ADVENTURERGUIDE);
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ import org.bukkit.Location;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Particle;
|
import org.bukkit.Particle;
|
||||||
import org.bukkit.entity.AreaEffectCloud;
|
import org.bukkit.entity.AreaEffectCloud;
|
||||||
|
import org.bukkit.entity.ArmorStand;
|
||||||
import org.bukkit.entity.EnderCrystal;
|
import org.bukkit.entity.EnderCrystal;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
@ -24,7 +25,7 @@ import sig.plugin.TwosideKeeper.LivingEntityStructure;
|
|||||||
import sig.plugin.TwosideKeeper.MonsterController;
|
import sig.plugin.TwosideKeeper.MonsterController;
|
||||||
import sig.plugin.TwosideKeeper.PlayerStructure;
|
import sig.plugin.TwosideKeeper.PlayerStructure;
|
||||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.CloudRunnable;
|
import sig.plugin.TwosideKeeper.HelperStructures.DamageLabel;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.LivingEntityDifficulty;
|
import sig.plugin.TwosideKeeper.HelperStructures.LivingEntityDifficulty;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.Classes.ColoredParticle;
|
import sig.plugin.TwosideKeeper.HelperStructures.Utils.Classes.ColoredParticle;
|
||||||
@ -78,17 +79,21 @@ 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) {
|
||||||
AreaEffectCloud aec = CreateOverlayText(offsetloc,((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)?" ":""));
|
||||||
Bukkit.getScheduler().runTaskLater(TwosideKeeper.plugin,new CloudRunnable(aec,0.15*Math.min(Math.max(1,(double)damage/50),2),(int)(10*Math.min(Math.max(1,(double)damage/50),2))),1);
|
TwosideKeeper.labelqueue.add(new DamageLabel(aec,0.1,(int)(10*Math.min(Math.max(1,(double)damage/50),2))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static AreaEffectCloud CreateOverlayText(Location loc, String overlay) {
|
public static ArmorStand CreateOverlayText(Location loc, String overlay) {
|
||||||
AreaEffectCloud aec = (AreaEffectCloud)loc.getWorld().spawnEntity(loc, EntityType.AREA_EFFECT_CLOUD);
|
ArmorStand aec = (ArmorStand)loc.getWorld().spawnEntity(loc, EntityType.ARMOR_STAND);
|
||||||
aec.setCustomName(overlay);
|
aec.setCustomName(overlay);
|
||||||
|
aec.setGravity(false);
|
||||||
|
aec.setRemoveWhenFarAway(true);
|
||||||
aec.setCustomNameVisible(true);
|
aec.setCustomNameVisible(true);
|
||||||
aec.setRadius(0);
|
aec.setVisible(false);
|
||||||
aec.setParticle(Particle.ITEM_TAKE);
|
aec.setMarker(true);
|
||||||
|
//aec.setRadius(0);
|
||||||
|
//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);
|
||||||
return aec;
|
return aec;
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,9 @@
|
|||||||
|
package sig.plugin.TwosideKeeper.HelperStructures.Utils;
|
||||||
|
|
||||||
|
import org.bukkit.util.EulerAngle;
|
||||||
|
|
||||||
|
public class MathUtils {
|
||||||
|
public static EulerAngle getEulerAngleDegrees(double degX,double degY,double degZ) {
|
||||||
|
return new EulerAngle(Math.toRadians(degX),Math.toRadians(degY),Math.toRadians(degZ));
|
||||||
|
}
|
||||||
|
}
|
@ -17,6 +17,7 @@ import org.bukkit.boss.BossBar;
|
|||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
import org.bukkit.configuration.file.FileConfiguration;
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
|
import org.bukkit.entity.ArmorStand;
|
||||||
import org.bukkit.entity.Arrow;
|
import org.bukkit.entity.Arrow;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -34,6 +35,7 @@ import sig.plugin.TwosideKeeper.HelperStructures.AdvancedTitle;
|
|||||||
import sig.plugin.TwosideKeeper.HelperStructures.Book;
|
import sig.plugin.TwosideKeeper.HelperStructures.Book;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.BowMode;
|
import sig.plugin.TwosideKeeper.HelperStructures.BowMode;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.Channel;
|
import sig.plugin.TwosideKeeper.HelperStructures.Channel;
|
||||||
|
import sig.plugin.TwosideKeeper.HelperStructures.CustomModel;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.DeathStructure;
|
import sig.plugin.TwosideKeeper.HelperStructures.DeathStructure;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.FilterCubeItem;
|
import sig.plugin.TwosideKeeper.HelperStructures.FilterCubeItem;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.OptionsMenu;
|
import sig.plugin.TwosideKeeper.HelperStructures.OptionsMenu;
|
||||||
@ -302,6 +304,8 @@ public class PlayerStructure {
|
|||||||
public double averageAdjustmentsMade = 0; //Avg Number of adjustments made.
|
public double averageAdjustmentsMade = 0; //Avg Number of adjustments made.
|
||||||
public int averageAdjustmentsMadeCount = 0; //Stored number of adjustments used in average.
|
public int averageAdjustmentsMadeCount = 0; //Stored number of adjustments used in average.
|
||||||
public boolean tooConsistentAdjustments = false; //Adjustments are too consistent.
|
public boolean tooConsistentAdjustments = false; //Adjustments are too consistent.
|
||||||
|
public ArmorStand myStand=null;
|
||||||
|
public CustomModel myModel=null;
|
||||||
|
|
||||||
public String lastplayerHitBy = ""; //The last player that hurt this player.
|
public String lastplayerHitBy = ""; //The last player that hurt this player.
|
||||||
|
|
||||||
|
@ -189,6 +189,8 @@ import org.bukkit.potion.PotionData;
|
|||||||
import org.bukkit.potion.PotionEffect;
|
import org.bukkit.potion.PotionEffect;
|
||||||
import org.bukkit.potion.PotionEffectType;
|
import org.bukkit.potion.PotionEffectType;
|
||||||
import org.bukkit.potion.PotionType;
|
import org.bukkit.potion.PotionType;
|
||||||
|
import org.bukkit.scheduler.BukkitTask;
|
||||||
|
import org.bukkit.util.EulerAngle;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
import org.inventivetalent.glow.GlowAPI;
|
import org.inventivetalent.glow.GlowAPI;
|
||||||
|
|
||||||
@ -222,9 +224,10 @@ import sig.plugin.TwosideKeeper.HelperStructures.ArtifactItemType;
|
|||||||
import sig.plugin.TwosideKeeper.HelperStructures.BankSession;
|
import sig.plugin.TwosideKeeper.HelperStructures.BankSession;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.BowMode;
|
import sig.plugin.TwosideKeeper.HelperStructures.BowMode;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.Channel;
|
import sig.plugin.TwosideKeeper.HelperStructures.Channel;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.CloudRunnable;
|
import sig.plugin.TwosideKeeper.HelperStructures.DamageLabel;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.CubeType;
|
import sig.plugin.TwosideKeeper.HelperStructures.CubeType;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.CustomItem;
|
import sig.plugin.TwosideKeeper.HelperStructures.CustomItem;
|
||||||
|
import sig.plugin.TwosideKeeper.HelperStructures.CustomModel;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.CustomPotion;
|
import sig.plugin.TwosideKeeper.HelperStructures.CustomPotion;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.CustomRecipe;
|
import sig.plugin.TwosideKeeper.HelperStructures.CustomRecipe;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.DamageStructure;
|
import sig.plugin.TwosideKeeper.HelperStructures.DamageStructure;
|
||||||
@ -247,6 +250,7 @@ import sig.plugin.TwosideKeeper.HelperStructures.SpleefArena;
|
|||||||
import sig.plugin.TwosideKeeper.HelperStructures.VerifyItemWasMovedTask;
|
import sig.plugin.TwosideKeeper.HelperStructures.VerifyItemWasMovedTask;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.WorldShop;
|
import sig.plugin.TwosideKeeper.HelperStructures.WorldShop;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.WorldShopSession;
|
import sig.plugin.TwosideKeeper.HelperStructures.WorldShopSession;
|
||||||
|
import sig.plugin.TwosideKeeper.HelperStructures.Common.ArmorStandProperties;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.ArrowQuiver;
|
import sig.plugin.TwosideKeeper.HelperStructures.Common.ArrowQuiver;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.BaublePouch;
|
import sig.plugin.TwosideKeeper.HelperStructures.Common.BaublePouch;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.BlockModifyQueue;
|
import sig.plugin.TwosideKeeper.HelperStructures.Common.BlockModifyQueue;
|
||||||
@ -556,6 +560,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
public static List<HighlightCircle> circles = new ArrayList<HighlightCircle>();
|
public static List<HighlightCircle> circles = new ArrayList<HighlightCircle>();
|
||||||
public static List<EffectPool> effectpools = new ArrayList<EffectPool>();
|
public static List<EffectPool> effectpools = new ArrayList<EffectPool>();
|
||||||
public static List<PVP> pvpsessions = new ArrayList<PVP>();
|
public static List<PVP> pvpsessions = new ArrayList<PVP>();
|
||||||
|
public static List<CustomModel> models = new ArrayList<CustomModel>();
|
||||||
|
public static List<DamageLabel> labelqueue = new ArrayList<DamageLabel>();
|
||||||
public static RecordKeeping dpschallenge_records;
|
public static RecordKeeping dpschallenge_records;
|
||||||
public static RecordKeeping dpschallenge_recordsHOF;
|
public static RecordKeeping dpschallenge_recordsHOF;
|
||||||
public static RecordKeeping tankchallenge_records;
|
public static RecordKeeping tankchallenge_records;
|
||||||
@ -1194,6 +1200,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
Recipes.Initialize_NewRedstoneLamp_Recipe();
|
Recipes.Initialize_NewRedstoneLamp_Recipe();
|
||||||
Recipes.Initialize_BaublePouch_Recipe();
|
Recipes.Initialize_BaublePouch_Recipe();
|
||||||
|
|
||||||
|
ArmorStandProperties.defineAllModels();
|
||||||
|
|
||||||
PVP.InitializeTeams();
|
PVP.InitializeTeams();
|
||||||
|
|
||||||
MonsterTemplate.InitializeMasterMonsterTemplateKeyMap();
|
MonsterTemplate.InitializeMasterMonsterTemplateKeyMap();
|
||||||
@ -1504,6 +1512,11 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
room.killWorld();
|
room.killWorld();
|
||||||
}
|
}
|
||||||
log(ChatColor.YELLOW+" "+(System.currentTimeMillis()-betweentime)+"ms",CLEANUP_DEBUG);
|
log(ChatColor.YELLOW+" "+(System.currentTimeMillis()-betweentime)+"ms",CLEANUP_DEBUG);
|
||||||
|
log("Removing Damage Labels ["+labelqueue.size()+"]",CLEANUP_DEBUG);
|
||||||
|
for (DamageLabel label : labelqueue) {
|
||||||
|
label.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);
|
||||||
}
|
}
|
||||||
@ -2312,10 +2325,10 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}break;
|
}break;
|
||||||
case "SPAWNINVIS":{
|
/*case "SPAWNINVIS":{
|
||||||
AreaEffectCloud aec = EntityUtils.CreateOverlayText(p.getLocation(), ChatColor.YELLOW+"20");
|
AreaEffectCloud aec = EntityUtils.CreateOverlayText(p.getLocation(), ChatColor.YELLOW+"20");
|
||||||
Bukkit.getScheduler().runTaskLater(this,new CloudRunnable(aec,0.15,10),1);
|
Bukkit.getScheduler().runTaskLater(this,new CloudRunnable(aec,0.15,10),1);
|
||||||
}
|
}*/
|
||||||
case "SWIRLY":{
|
case "SWIRLY":{
|
||||||
//p.spawnParticle(Particle.SPELL_MOB_AMBIENT, p.getLocation(), 30);
|
//p.spawnParticle(Particle.SPELL_MOB_AMBIENT, p.getLocation(), 30);
|
||||||
AreaEffectCloud aec = (AreaEffectCloud)p.getWorld().spawnEntity(p.getLocation(), EntityType.AREA_EFFECT_CLOUD);
|
AreaEffectCloud aec = (AreaEffectCloud)p.getWorld().spawnEntity(p.getLocation(), EntityType.AREA_EFFECT_CLOUD);
|
||||||
@ -2720,6 +2733,108 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
case "SETHEALTH":{
|
case "SETHEALTH":{
|
||||||
p.setHealth(Integer.parseInt(args[1]));
|
p.setHealth(Integer.parseInt(args[1]));
|
||||||
}break;
|
}break;
|
||||||
|
case "ARM":{
|
||||||
|
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||||
|
pd.myStand = (ArmorStand)p.getWorld().spawnEntity(p.getLocation(), EntityType.ARMOR_STAND);
|
||||||
|
}break;
|
||||||
|
case "PROP":{
|
||||||
|
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||||
|
switch (Integer.parseInt(args[1])) {
|
||||||
|
case 0:{
|
||||||
|
pd.myStand.setArms(Boolean.parseBoolean(args[2]));
|
||||||
|
}break;
|
||||||
|
case 1:{
|
||||||
|
pd.myStand.setBasePlate(Boolean.parseBoolean(args[2]));
|
||||||
|
}break;
|
||||||
|
case 2:{
|
||||||
|
EulerAngle currentAngle = new EulerAngle(Math.toRadians(Double.parseDouble(args[2])),
|
||||||
|
Math.toRadians(Double.parseDouble(args[3])),
|
||||||
|
Math.toRadians(Double.parseDouble(args[4])));
|
||||||
|
//currentAngle.add(Math.toRadians(Integer.parseInt(args[2])), Math.toRadians(Integer.parseInt(args[3])), Math.toRadians(Integer.parseInt(args[4])));
|
||||||
|
pd.myStand.setBodyPose(currentAngle);
|
||||||
|
}break;
|
||||||
|
case 3:{
|
||||||
|
pd.myStand.setBoots(p.getEquipment().getItemInMainHand());
|
||||||
|
}break;
|
||||||
|
case 4:{
|
||||||
|
pd.myStand.setChestplate(p.getEquipment().getItemInMainHand());
|
||||||
|
}break;
|
||||||
|
case 5:{
|
||||||
|
EulerAngle currentAngle = new EulerAngle(Math.toRadians(Double.parseDouble(args[2])),
|
||||||
|
Math.toRadians(Double.parseDouble(args[3])),
|
||||||
|
Math.toRadians(Double.parseDouble(args[4])));
|
||||||
|
//currentAngle.add(Math.toRadians(Integer.parseInt(args[2])), Math.toRadians(Integer.parseInt(args[3])), Math.toRadians(Integer.parseInt(args[4])));
|
||||||
|
pd.myStand.setHeadPose(currentAngle);
|
||||||
|
}break;
|
||||||
|
case 6:{
|
||||||
|
pd.myStand.setHelmet(p.getEquipment().getItemInMainHand());
|
||||||
|
}break;
|
||||||
|
case 7:{
|
||||||
|
pd.myStand.setItemInHand(p.getEquipment().getItemInMainHand());
|
||||||
|
}break;
|
||||||
|
case 8:{
|
||||||
|
EulerAngle currentAngle = new EulerAngle(Math.toRadians(Double.parseDouble(args[2])),
|
||||||
|
Math.toRadians(Double.parseDouble(args[3])),
|
||||||
|
Math.toRadians(Double.parseDouble(args[4])));
|
||||||
|
//currentAngle.add(Math.toRadians(Integer.parseInt(args[2])), Math.toRadians(Integer.parseInt(args[3])), Math.toRadians(Integer.parseInt(args[4])));
|
||||||
|
pd.myStand.setLeftArmPose(currentAngle);
|
||||||
|
}break;
|
||||||
|
case 9:{
|
||||||
|
EulerAngle currentAngle = new EulerAngle(Math.toRadians(Double.parseDouble(args[2])),
|
||||||
|
Math.toRadians(Double.parseDouble(args[3])),
|
||||||
|
Math.toRadians(Double.parseDouble(args[4])));
|
||||||
|
//currentAngle.add(Math.toRadians(Integer.parseInt(args[2])), Math.toRadians(Integer.parseInt(args[3])), Math.toRadians(Integer.parseInt(args[4])));
|
||||||
|
pd.myStand.setLeftLegPose(currentAngle);
|
||||||
|
}break;
|
||||||
|
case 10:{
|
||||||
|
pd.myStand.setLeggings(p.getEquipment().getItemInMainHand());
|
||||||
|
}break;
|
||||||
|
case 11:{
|
||||||
|
pd.myStand.setMarker(Boolean.parseBoolean(args[2]));
|
||||||
|
}break;
|
||||||
|
case 13:{
|
||||||
|
EulerAngle currentAngle = new EulerAngle(Math.toRadians(Double.parseDouble(args[2])),
|
||||||
|
Math.toRadians(Double.parseDouble(args[3])),
|
||||||
|
Math.toRadians(Double.parseDouble(args[4])));
|
||||||
|
//currentAngle.add(Math.toRadians(Integer.parseInt(args[2])), Math.toRadians(Integer.parseInt(args[3])), Math.toRadians(Integer.parseInt(args[4])));
|
||||||
|
pd.myStand.setRightArmPose(currentAngle);
|
||||||
|
//TwosideKeeper.log(currentAngle.getX()+","+currentAngle.getY()+","+currentAngle.getZ(), 0);
|
||||||
|
}break;
|
||||||
|
case 14:{
|
||||||
|
EulerAngle currentAngle = new EulerAngle(Math.toRadians(Double.parseDouble(args[2])),
|
||||||
|
Math.toRadians(Double.parseDouble(args[3])),
|
||||||
|
Math.toRadians(Double.parseDouble(args[4])));
|
||||||
|
//currentAngle.add(Math.toRadians(Integer.parseInt(args[2])), Math.toRadians(Integer.parseInt(args[3])), Math.toRadians(Integer.parseInt(args[4])));
|
||||||
|
pd.myStand.setRightLegPose(currentAngle);
|
||||||
|
}break;
|
||||||
|
case 15:{
|
||||||
|
pd.myStand.setSmall(Boolean.parseBoolean(args[2]));
|
||||||
|
}break;
|
||||||
|
case 16:{
|
||||||
|
pd.myStand.setVisible(Boolean.parseBoolean(args[2]));
|
||||||
|
}break;
|
||||||
|
case 17:{
|
||||||
|
pd.myStand.setCustomNameVisible(Boolean.parseBoolean(args[2]));
|
||||||
|
}break;
|
||||||
|
case 18:{
|
||||||
|
pd.myStand.setCustomName(ChatColor.translateAlternateColorCodes('&', args[2]));
|
||||||
|
}break;
|
||||||
|
case 19:{
|
||||||
|
Location currentloc = pd.myStand.getLocation().clone();
|
||||||
|
currentloc.add(Double.parseDouble(args[2]),Double.parseDouble(args[3]),Double.parseDouble(args[4]));
|
||||||
|
pd.myStand.teleport(currentloc);
|
||||||
|
}break;
|
||||||
|
}
|
||||||
|
}break;
|
||||||
|
case "TESTMODEL":{
|
||||||
|
CustomModel mymod = new CustomModel(p.getLocation(),new ArmorStandProperties[]{
|
||||||
|
ArmorStandProperties.SCEPTERBASE,
|
||||||
|
ArmorStandProperties.SCEPTERTOP
|
||||||
|
});
|
||||||
|
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||||
|
pd.myModel = mymod;
|
||||||
|
models.add(pd.myModel);
|
||||||
|
}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);
|
||||||
@ -7642,6 +7757,12 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
removalEntities.add(e);
|
removalEntities.add(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (e instanceof ArmorStand) {
|
||||||
|
ArmorStand as = (ArmorStand)e;
|
||||||
|
if (as.getRemoveWhenFarAway()) {
|
||||||
|
removalEntities.add(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for (Entity e : removalEntities) {
|
for (Entity e : removalEntities) {
|
||||||
e.remove();
|
e.remove();
|
||||||
@ -11829,7 +11950,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
TwosideKeeper.HeartbeatLogger.AddEntry("----====]> Barbarian HP Calculation", (int)(System.nanoTime()-time));time = System.nanoTime();
|
TwosideKeeper.HeartbeatLogger.AddEntry("----====]> Barbarian HP Calculation", (int)(System.nanoTime()-time));time = System.nanoTime();
|
||||||
|
|
||||||
|
|
||||||
bonushp+=ItemSet.GetTotalBaseAmount(p, ItemSet.DAWNTRACKER);
|
bonushp+=ItemSet.GetTotalBaseAmount(p, ItemSet.DAWNTRACKER)*ItemSet.GetPlayerModeSpecificMult(p);
|
||||||
bonushp+=ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.DAWNTRACKER, 4, 4);
|
bonushp+=ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.DAWNTRACKER, 4, 4);
|
||||||
TwosideKeeper.HeartbeatLogger.AddEntry("----====]> Dawntracker HP Calculation", (int)(System.nanoTime()-time));time = System.nanoTime();
|
TwosideKeeper.HeartbeatLogger.AddEntry("----====]> Dawntracker HP Calculation", (int)(System.nanoTime()-time));time = System.nanoTime();
|
||||||
bonushp+=ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.SONGSTEEL, 2, 2);
|
bonushp+=ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.SONGSTEEL, 2, 2);
|
||||||
|
@ -6,6 +6,8 @@ import org.bukkit.Material;
|
|||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import sig.plugin.TwosideKeeper.HelperStructures.CustomModel;
|
||||||
|
import sig.plugin.TwosideKeeper.HelperStructures.DamageLabel;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.BlockModifyQueue;
|
import sig.plugin.TwosideKeeper.HelperStructures.Common.BlockModifyQueue;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.Classes.ColoredParticle;
|
import sig.plugin.TwosideKeeper.HelperStructures.Utils.Classes.ColoredParticle;
|
||||||
|
|
||||||
@ -20,6 +22,15 @@ public class runServerTick implements Runnable{
|
|||||||
bmq.run();
|
bmq.run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (int i=0;i<TwosideKeeper.labelqueue.size();i++) {
|
||||||
|
if (!TwosideKeeper.labelqueue.get(i).run()) {
|
||||||
|
TwosideKeeper.labelqueue.remove(i--);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*for (Player p : Bukkit.getOnlinePlayers()) {
|
||||||
|
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||||
|
pd.myModel.displayModel(p.getLocation());
|
||||||
|
}*/
|
||||||
runServerHeartbeat.resetDamageQueue();
|
runServerHeartbeat.resetDamageQueue();
|
||||||
/*if (Bukkit.getPlayer("sigonasr2")!=null) {
|
/*if (Bukkit.getPlayer("sigonasr2")!=null) {
|
||||||
Player p = Bukkit.getPlayer("sigonasr2");
|
Player p = Bukkit.getPlayer("sigonasr2");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user