-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add global cooldown and throwback sounds
- Loading branch information
Showing
14 changed files
with
152 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
core/src/main/java/com/sekwah/advancedportals/core/serializeddata/Vector.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package com.sekwah.advancedportals.core.serializeddata; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
|
||
public class Vector { | ||
@SerializedName("x") | ||
public final double X; | ||
|
||
@SerializedName("y") | ||
public final double Y; | ||
|
||
@SerializedName("z") | ||
public final double Z; | ||
|
||
public Vector(double X, double Y, double Z) { | ||
this.X = X; | ||
this.Y = Y; | ||
this.Z = Z; | ||
} | ||
|
||
public Vector add(Vector vec) { | ||
return new Vector(this.X + vec.X, this.Y + vec.Y, this.Z + vec.Z); | ||
} | ||
|
||
public Vector multiply(double value) { | ||
return new Vector(this.X * value, this.Y * value, this.Z * value); | ||
} | ||
|
||
public Vector setY(double y) { | ||
return new Vector(this.X, y, this.Z); | ||
} | ||
|
||
public double distanceTo(Vector pos) { | ||
return Math.sqrt(this.distanceToSq(pos)); | ||
} | ||
|
||
private double distanceToSq(Vector pos) { | ||
double dx = this.X - pos.X; | ||
double dy = this.Y - pos.Y; | ||
double dz = this.Z - pos.Z; | ||
return dx * dx + dy * dy + dz * dz; | ||
} | ||
|
||
public double getX() { | ||
return this.X; | ||
} | ||
|
||
public double getY() { | ||
return this.Y; | ||
} | ||
|
||
public double getZ() { | ||
return this.Z; | ||
} | ||
|
||
public Vector normalize() { | ||
return this.multiply(1.0D / this.length()); | ||
} | ||
|
||
private double length() { | ||
return Math.sqrt(this.X * this.X + this.Y * this.Y + this.Z * this.Z); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters