mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2025-12-28 11:29:17 +00:00
improve api
This commit is contained in:
@@ -64,7 +64,7 @@ public class CustomBlockAttemptPlaceEvent extends PlayerEvent implements Cancell
|
||||
|
||||
@NotNull
|
||||
public Location location() {
|
||||
return this.location;
|
||||
return this.location.clone();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -56,7 +56,7 @@ public class CustomBlockBreakEvent extends PlayerEvent implements Cancellable {
|
||||
|
||||
@NotNull
|
||||
public Location location() {
|
||||
return this.location;
|
||||
return this.location.clone();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -81,7 +81,7 @@ public class CustomBlockInteractEvent extends PlayerEvent implements Cancellable
|
||||
|
||||
@NotNull
|
||||
public Location location() {
|
||||
return this.location;
|
||||
return this.location.clone();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -50,7 +50,7 @@ public class CustomBlockPlaceEvent extends PlayerEvent implements Cancellable {
|
||||
|
||||
@NotNull
|
||||
public Location location() {
|
||||
return this.location;
|
||||
return this.location.clone();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -65,7 +65,7 @@ public class FurnitureAttemptPlaceEvent extends PlayerEvent implements Cancellab
|
||||
|
||||
@NotNull
|
||||
public Location location() {
|
||||
return location;
|
||||
return location.clone();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package net.momirealms.craftengine.bukkit.api.event;
|
||||
|
||||
import net.momirealms.craftengine.bukkit.entity.furniture.LoadedFurniture;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
@@ -28,6 +29,11 @@ public class FurnitureBreakEvent extends PlayerEvent implements Cancellable {
|
||||
return this.furniture;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Location location() {
|
||||
return this.furniture.location();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static HandlerList getHandlerList() {
|
||||
return HANDLER_LIST;
|
||||
|
||||
@@ -28,7 +28,7 @@ public class FurnitureInteractEvent extends PlayerEvent implements Cancellable {
|
||||
|
||||
@NotNull
|
||||
public Location interactionPoint() {
|
||||
return interactionPoint;
|
||||
return this.interactionPoint.clone();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -46,6 +46,11 @@ public class FurnitureInteractEvent extends PlayerEvent implements Cancellable {
|
||||
return this.furniture;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Location location() {
|
||||
return this.furniture.location();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static HandlerList getHandlerList() {
|
||||
return HANDLER_LIST;
|
||||
|
||||
@@ -38,7 +38,7 @@ public class FurniturePlaceEvent extends PlayerEvent implements Cancellable {
|
||||
|
||||
@NotNull
|
||||
public Location location() {
|
||||
return this.location;
|
||||
return this.location.clone();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -27,7 +27,7 @@ public class LoadedFurniture {
|
||||
private final CustomFurniture furniture;
|
||||
private final AnchorType anchorType;
|
||||
// location
|
||||
private Location location;
|
||||
private final Location location;
|
||||
// base entity
|
||||
private final WeakReference<Entity> baseEntity;
|
||||
private final int baseEntityId;
|
||||
@@ -86,7 +86,7 @@ public class LoadedFurniture {
|
||||
|
||||
@NotNull
|
||||
public Location location() {
|
||||
return this.location;
|
||||
return this.location.clone();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
Reference in New Issue
Block a user