Update to Minecraft 1.17

By: md_5 <git@md-5.net>
This commit is contained in:
Bukkit/Spigot
2021-06-11 15:00:00 +10:00
parent 2e1a3720cf
commit 153752dfac
44 changed files with 3379 additions and 958 deletions

View File

@@ -0,0 +1,90 @@
package org.bukkit;
import org.bukkit.block.Block;
import org.bukkit.entity.Entity;
import org.jetbrains.annotations.NotNull;
/**
* Represents a vibration from a Skulk sensor.
*/
public class Vibration {
private final Location origin;
private final Destination destination;
private final int arrivalTime;
public Vibration(@NotNull Location origin, @NotNull Destination destination, @NotNull int arrivalTime) {
this.origin = origin;
this.destination = destination;
this.arrivalTime = arrivalTime;
}
/**
* Get the origin of the vibration.
*
* @return origin
*/
@NotNull
public Location getOrigin() {
return origin;
}
/**
* Get the vibration destination.
*
* @return destination
*/
@NotNull
public Destination getDestination() {
return destination;
}
/**
* Get the vibration arrival time in ticks.
*
* @return arrival time
*/
public int getArrivalTime() {
return arrivalTime;
}
public interface Destination {
public static class EntityDestination implements Destination {
private final Entity entity;
public EntityDestination(@NotNull Entity entity) {
this.entity = entity;
}
@NotNull
public Entity getEntity() {
return entity;
}
}
public static class BlockDestination implements Destination {
private final Location block;
public BlockDestination(@NotNull Location block) {
this.block = block;
}
public BlockDestination(@NotNull Block block) {
this(block.getLocation());
}
@NotNull
public Location getLocation() {
return block;
}
@NotNull
public Block getBlock() {
return block.getBlock();
}
}
}
}