mirror of
https://github.com/darksaid98/SiegeEngines.git
synced 2026-12-02 14:38:55 +00:00
.
This commit is contained in:
1 parent
a7d4d036e0
commit
b143bb88b3
6 files changed
+16
-6
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);
|
||||
ent.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 2000000, 1));
|
||||
// stand.setSmall(true);
|
||||
stand.setVisible(false);
|
||||
// stand.setVisible(true);
|
||||
//stand.setSmall(true);
|
||||
ent.getEquipment().setHelmet(item);
|
||||
if (TrackedStands.containsKey(player.getUniqueId())) {
|
||||
|
||||
@@ -28,23 +28,33 @@ public class RotationHandler implements Listener {
|
||||
}
|
||||
for (Entity ent : CrunchSiegeCore.TrackedStands.get(player.getUniqueId())) {
|
||||
if (ent != null) {
|
||||
|
||||
SiegeEquipment equipment = CrunchSiegeCore.equipment.get(ent.getUniqueId());
|
||||
|
||||
double distance = player.getLocation().distance(ent.getLocation());
|
||||
if (distance <= 250) {
|
||||
// player.sendMessage("got id");
|
||||
LivingEntity living = (LivingEntity) ent;
|
||||
Location loc = ent.getLocation();
|
||||
|
||||
|
||||
if (equipment.RotateSideways) {
|
||||
|
||||
|
||||
Location direction = player.getLocation().add(player.getLocation().getDirection().multiply(50));
|
||||
|
||||
Vector dirBetweenLocations = direction.toVector().subtract(loc.toVector());
|
||||
|
||||
loc.setDirection(dirBetweenLocations);
|
||||
}
|
||||
// loc.setYaw(player.getLocation().getYaw());
|
||||
//loc.setPitch(player.getLocation().getPitch());
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -36,8 +36,8 @@ public class SiegeEquipment {
|
||||
public Location location;
|
||||
public int ModelNumberToFireAt;
|
||||
public Boolean CycleThroughModelsBeforeFiring = false;
|
||||
public Boolean RotateSideways = false;
|
||||
public Boolean RoateUpDown = true;
|
||||
public Boolean RotateSideways = true;
|
||||
public Boolean RotateUpDown = true;
|
||||
|
||||
public Boolean HasFired = false;
|
||||
public Boolean HasReloaded = false;
|
||||
|
||||
Reference in new issue
Block a user