mirror of
https://github.com/darksaid98/SiegeEngines.git
synced 2026-12-04 14:38:53 +00:00
.
This commit is contained in:
1 parent
a7d4d036e0
commit
b143bb88b3
6 files changed
+14
-4
No files matched your search
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -129,7 +129,7 @@ public class CrunchSiegeCore extends JavaPlugin {
|
|||||||
stand.addEquipmentLock(EquipmentSlot.FEET, LockType.ADDING_OR_CHANGING);
|
stand.addEquipmentLock(EquipmentSlot.FEET, LockType.ADDING_OR_CHANGING);
|
||||||
ent.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 2000000, 1));
|
ent.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 2000000, 1));
|
||||||
// stand.setSmall(true);
|
// stand.setSmall(true);
|
||||||
stand.setVisible(false);
|
// stand.setVisible(true);
|
||||||
//stand.setSmall(true);
|
//stand.setSmall(true);
|
||||||
ent.getEquipment().setHelmet(item);
|
ent.getEquipment().setHelmet(item);
|
||||||
if (TrackedStands.containsKey(player.getUniqueId())) {
|
if (TrackedStands.containsKey(player.getUniqueId())) {
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ public class RotationHandler implements Listener {
|
|||||||
}
|
}
|
||||||
for (Entity ent : CrunchSiegeCore.TrackedStands.get(player.getUniqueId())) {
|
for (Entity ent : CrunchSiegeCore.TrackedStands.get(player.getUniqueId())) {
|
||||||
if (ent != null) {
|
if (ent != null) {
|
||||||
|
SiegeEquipment equipment = CrunchSiegeCore.equipment.get(ent.getUniqueId());
|
||||||
|
|
||||||
double distance = player.getLocation().distance(ent.getLocation());
|
double distance = player.getLocation().distance(ent.getLocation());
|
||||||
if (distance <= 250) {
|
if (distance <= 250) {
|
||||||
@@ -35,16 +36,25 @@ public class RotationHandler implements Listener {
|
|||||||
LivingEntity living = (LivingEntity) ent;
|
LivingEntity living = (LivingEntity) ent;
|
||||||
Location loc = ent.getLocation();
|
Location loc = ent.getLocation();
|
||||||
|
|
||||||
|
if (equipment.RotateSideways) {
|
||||||
|
|
||||||
|
|
||||||
Location direction = player.getLocation().add(player.getLocation().getDirection().multiply(50));
|
Location direction = player.getLocation().add(player.getLocation().getDirection().multiply(50));
|
||||||
|
|
||||||
Vector dirBetweenLocations = direction.toVector().subtract(loc.toVector());
|
Vector dirBetweenLocations = direction.toVector().subtract(loc.toVector());
|
||||||
|
|
||||||
loc.setDirection(dirBetweenLocations);
|
loc.setDirection(dirBetweenLocations);
|
||||||
|
}
|
||||||
// loc.setYaw(player.getLocation().getYaw());
|
// loc.setYaw(player.getLocation().getYaw());
|
||||||
//loc.setPitch(player.getLocation().getPitch());
|
//loc.setPitch(player.getLocation().getPitch());
|
||||||
|
|
||||||
|
|
||||||
ArmorStand stand = (ArmorStand) living;
|
ArmorStand stand = (ArmorStand) living;
|
||||||
|
|
||||||
stand.setHeadPose(new EulerAngle(player.getLocation().getDirection().getY()*(-1),0,0));
|
if (equipment.RotateUpDown) {
|
||||||
|
stand.setHeadPose(new EulerAngle(player.getLocation().getDirection().getY()*(-1),0,0));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
living.teleport(loc);
|
living.teleport(loc);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,8 +36,8 @@ public class SiegeEquipment {
|
|||||||
public Location location;
|
public Location location;
|
||||||
public int ModelNumberToFireAt;
|
public int ModelNumberToFireAt;
|
||||||
public Boolean CycleThroughModelsBeforeFiring = false;
|
public Boolean CycleThroughModelsBeforeFiring = false;
|
||||||
public Boolean RotateSideways = false;
|
public Boolean RotateSideways = true;
|
||||||
public Boolean RoateUpDown = true;
|
public Boolean RotateUpDown = true;
|
||||||
|
|
||||||
public Boolean HasFired = false;
|
public Boolean HasFired = false;
|
||||||
public Boolean HasReloaded = false;
|
public Boolean HasReloaded = false;
|
||||||
|
|||||||
Reference in new issue
Block a user