This commit is contained in:
tastybento 2021-09-18 12:25:14 -07:00
parent 8eac5070f0
commit 68890eba00

View File

@ -75,7 +75,6 @@ public class Island implements DataObject, MetaDataAble {
//// Island ////
// The center of the island space
@Expose
@Nullable
private Location center;
/**
@ -342,9 +341,9 @@ public class Island implements DataObject, MetaDataAble {
* Returns a clone of the location of the center of this island.
* @return clone of the center Location
*/
@Nullable
@NonNull
public Location getCenter(){
return center == null ? null : center.clone();
return Objects.requireNonNull(center, "Island getCenter requires a non-null center").clone();
}
/**
@ -798,10 +797,8 @@ public class Island implements DataObject, MetaDataAble {
/**
* @param center the center to set
*/
public void setCenter(@Nullable Location center) {
if (center != null) {
this.world = center.getWorld();
}
public void setCenter(@NonNull Location center) {
this.world = center.getWorld();
this.center = center;
setChanged();
}