-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #69 from TheBusyBiscuit/feature/assert-hear
Added Sound Assertions for PlayerMock
- Loading branch information
Showing
6 changed files
with
323 additions
and
188 deletions.
There are no files selected for viewing
81 changes: 81 additions & 0 deletions
81
src/main/java/be/seeseemelk/mockbukkit/entity/AudioExperience.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,81 @@ | ||
package be.seeseemelk.mockbukkit.entity; | ||
|
||
import org.bukkit.Location; | ||
import org.bukkit.Sound; | ||
import org.bukkit.SoundCategory; | ||
import org.bukkit.entity.Player; | ||
|
||
/** | ||
* This class represents a {@link Sound} that was heard by a {@link Player}. | ||
* | ||
* @author TheBusyBiscuit | ||
* | ||
*/ | ||
public final class AudioExperience | ||
{ | ||
private final Sound sound; | ||
private final SoundCategory category; | ||
private final Location location; | ||
private final float volume; | ||
private final float pitch; | ||
|
||
AudioExperience(Sound sound, SoundCategory category, Location l, float volume, float pitch) | ||
{ | ||
this.sound = sound; | ||
this.category = category; | ||
this.location = l; | ||
this.volume = volume; | ||
this.pitch = pitch; | ||
} | ||
|
||
/** | ||
* This returns the {@link Sound} that was played. | ||
* | ||
* @return The {@link Sound} | ||
*/ | ||
public Sound getSound() | ||
{ | ||
return sound; | ||
} | ||
|
||
/** | ||
* This method returns the {@link SoundCategory} with which the {@link Sound} was played. | ||
* | ||
* @return The {@link SoundCategory} | ||
*/ | ||
public SoundCategory getCategory() | ||
{ | ||
return category; | ||
} | ||
|
||
/** | ||
* This returns the {@link Location} at which this {@link Sound} was played. | ||
* | ||
* @return The {@link Location} | ||
*/ | ||
public Location getLocation() | ||
{ | ||
return location; | ||
} | ||
|
||
/** | ||
* The volume of this {@link Sound} | ||
* | ||
* @return The volume | ||
*/ | ||
public float getVolume() | ||
{ | ||
return volume; | ||
} | ||
|
||
/** | ||
* The pitch of this {@link Sound} | ||
* | ||
* @return The pitch | ||
*/ | ||
public float getPitch() | ||
{ | ||
return pitch; | ||
} | ||
|
||
} |
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
Oops, something went wrong.