mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-07 11:20:32 +01:00
Cannon Refactor, Info fixes, Permissions clarification
This commit is contained in:
parent
06830f4e98
commit
e551b7184d
@ -143,10 +143,15 @@ public class MVPermissions implements PermissionsInterface {
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
if (this.permissions != null) {
|
||||
return "Permissions " + this.plugin.getServer().getPluginManager().getPlugin("Permissions").getDescription().getVersion();
|
||||
String opsfallback = "";
|
||||
if(this.plugin.getConfig().getBoolean("opfallback", true)) {
|
||||
opsfallback = " WITH OPs.txt fallback";
|
||||
}
|
||||
return "Bukkit Permissions/OPs.txt";
|
||||
if (this.permissions != null) {
|
||||
return "Permissions " + this.plugin.getServer().getPluginManager().getPlugin("Permissions").getDescription().getVersion() + opsfallback;
|
||||
}
|
||||
|
||||
return "Bukkit Permissions" + opsfallback;
|
||||
}
|
||||
|
||||
public boolean hasAnyPermission(CommandSender sender, List<String> nodes, boolean isOpRequired) {
|
||||
|
@ -157,6 +157,12 @@ public class InfoCommand extends MultiverseCommand {
|
||||
}
|
||||
|
||||
private String toCommaSeperated(List<String> list) {
|
||||
if(list == null || list.size() == 0) {
|
||||
return "";
|
||||
}
|
||||
if(list.size() == 1) {
|
||||
return list.get(0);
|
||||
}
|
||||
String result = list.get(0);
|
||||
|
||||
for (int i = 1; i < list.size() - 1; i++) {
|
||||
|
@ -17,11 +17,14 @@ public class CannonDestination implements MVDestination {
|
||||
private double speed;
|
||||
|
||||
public Vector getVelocity() {
|
||||
double x = Math.sin(Math.toRadians(location.getYaw())) * speed * -1;
|
||||
double y = Math.sin(Math.toRadians(location.getPitch())) * speed * -1;
|
||||
double z = Math.cos(Math.toRadians(location.getYaw())) * speed;
|
||||
x = Math.cos(Math.toRadians(location.getPitch())) * x;
|
||||
z = Math.cos(Math.toRadians(location.getPitch())) * z;
|
||||
double pitchRadians = Math.toRadians(location.getPitch());
|
||||
double yawRadians = Math.toRadians(location.getPitch());
|
||||
double x = Math.sin(yawRadians) * speed * -1;
|
||||
double y = Math.sin(pitchRadians) * speed * -1;
|
||||
double z = Math.cos(yawRadians) * speed;
|
||||
// Account for the angle they were pointed, and take away velocity
|
||||
x = Math.cos(pitchRadians) * x;
|
||||
z = Math.cos(pitchRadians) * z;
|
||||
return new Vector(x, y, z);
|
||||
}
|
||||
|
||||
@ -81,7 +84,6 @@ public class CannonDestination implements MVDestination {
|
||||
return;
|
||||
}
|
||||
List<String> parsed = Arrays.asList(dest.split(":"));
|
||||
System.out.print(parsed);
|
||||
// Need at least: e:world:x,y,z
|
||||
// OR e:world:x,y,z:pitch:yaw
|
||||
// so basically 3 or 5
|
||||
|
Loading…
Reference in New Issue
Block a user