Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 23 additions & 23 deletions src/main/java/minevalley/regions/api/Regions.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
@SuppressWarnings({"unused", "UnusedReturnValue"})
public class Regions {

private static RegionsServer server;
private static RegionsProvider provider;

/**
* Gets the region with the specific id.
Expand All @@ -34,7 +34,7 @@ public class Regions {
@Nullable
@Contract(pure = true)
public static Region getRegion(int id) {
return server.getRegion(id);
return provider.getRegion(id);
}

/**
Expand All @@ -49,7 +49,7 @@ public static Region getRegion(int id) {
@Nonnull
@Contract(pure = true)
public static List<Region> getRegions(@Nonnull Block block) throws IllegalArgumentException {
return server.getRegions(block);
return provider.getRegions(block);
}

/**
Expand Down Expand Up @@ -78,7 +78,7 @@ public static List<Region> getRegions(@Nonnull Location location) throws Illegal
@Nonnull
@Contract("_, _ -> new")
public static Region createRegion(@Nonnull List<Area> included, @Nonnull List<Area> excluded) throws IllegalArgumentException {
return server.createRegion(included, excluded);
return provider.createRegion(included, excluded);
}


Expand All @@ -91,7 +91,7 @@ public static Region createRegion(@Nonnull List<Area> included, @Nonnull List<Ar
@Nullable
@Contract(pure = true)
public static Residence getResidence(int id) {
return server.getResidence(id);
return provider.getResidence(id);
}

/**
Expand All @@ -105,7 +105,7 @@ public static Residence getResidence(int id) {
@Nullable
@Contract("null -> null")
public static Residence getResidence(@Nullable Region region) {
return server.getResidence(region);
return provider.getResidence(region);
}

/**
Expand Down Expand Up @@ -175,7 +175,7 @@ public static Stream<Residence> getResidences(@Nonnull Block block) throws Illeg
@Nonnull
@Contract(pure = true)
public static List<Residence> getResidences(@Nonnull Registrant registrant) throws IllegalArgumentException {
return server.getResidences(registrant);
return provider.getResidences(registrant);
}

/**
Expand All @@ -186,7 +186,7 @@ public static List<Residence> getResidences(@Nonnull Registrant registrant) thro
@Nonnull
@Contract(pure = true)
public static List<Residence> getResidences() {
return server.getResidences();
return provider.getResidences();
}

/**
Expand All @@ -198,7 +198,7 @@ public static List<Residence> getResidences() {
@Nullable
@Contract(pure = true)
public static Plot getPlot(int id) {
return server.getPlot(id);
return provider.getPlot(id);
}

/**
Expand Down Expand Up @@ -250,7 +250,7 @@ public static PlotTile getPlotTile(@Nullable Block block) {
@Nullable
@Contract(value = "null -> null", pure = true)
public static PlotTile getPlotTile(@Nullable Region region) {
return server.getPlotTile(region);
return provider.getPlotTile(region);
}


Expand All @@ -263,7 +263,7 @@ public static PlotTile getPlotTile(@Nullable Region region) {
@Nullable
@Contract(pure = true)
public static Apartment getApartment(int id) {
return server.getApartment(id);
return provider.getApartment(id);
}

/**
Expand Down Expand Up @@ -301,7 +301,7 @@ public static Apartment getApartment(@Nullable Block block) {
@Nonnull
@Contract(pure = true)
public static List<ApartmentBlock> getApartmentBlocks() {
return server.getApartmentBlocks();
return provider.getApartmentBlocks();
}

/**
Expand All @@ -315,7 +315,7 @@ public static List<ApartmentBlock> getApartmentBlocks() {
@Contract(pure = true)
public static List<ApartmentBlock> getApartmentBlocks(@Nonnull RealEstateGroup realEstateGroup)
throws IllegalArgumentException {
return server.getApartmentBlocks(realEstateGroup);
return provider.getApartmentBlocks(realEstateGroup);
}

/**
Expand All @@ -327,7 +327,7 @@ public static List<ApartmentBlock> getApartmentBlocks(@Nonnull RealEstateGroup r
@Nullable
@Contract(pure = true)
public static ApartmentBlock getApartmentBlock(int id) {
return server.getApartmentBlock(id);
return provider.getApartmentBlock(id);
}

/**
Expand All @@ -338,7 +338,7 @@ public static ApartmentBlock getApartmentBlock(int id) {
@Nonnull
@Contract(pure = true)
public static List<Street> getStreets() {
return server.getStreets();
return provider.getStreets();
}

/**
Expand All @@ -350,7 +350,7 @@ public static List<Street> getStreets() {
@Nullable
@Contract(pure = true)
public static Street getStreet(int id) {
return server.getStreet(id);
return provider.getStreet(id);
}

/**
Expand All @@ -361,7 +361,7 @@ public static Street getStreet(int id) {
@Nonnull
@Contract(pure = true)
public static List<District> getDistricts() {
return server.getDistricts();
return provider.getDistricts();
}

/**
Expand All @@ -373,7 +373,7 @@ public static List<District> getDistricts() {
@Nullable
@Contract(pure = true)
public static District getDistrict(int id) {
return server.getDistrict(id);
return provider.getDistrict(id);
}


Expand All @@ -386,7 +386,7 @@ public static District getDistrict(int id) {
@Nullable
@Contract("null -> null")
public static District getDistrict(@Nullable Chunk chunk) {
return server.getDistrict(chunk);
return provider.getDistrict(chunk);
}

/**
Expand Down Expand Up @@ -426,7 +426,7 @@ public static District getDistrict(@Nullable Location location) {
@Nullable
@Contract("null -> null")
public static RadioMast getNearestRadioMast(@Nullable Location location) {
return server.getNearestRadioMast(location);
return provider.getNearestRadioMast(location);
}

/**
Expand All @@ -440,7 +440,7 @@ public static RadioMast getNearestRadioMast(@Nullable Location location) {
@Nonnull
@Contract("_, _ -> new")
public static Area getArea(@Nonnull Block loc1, @Nonnull Block loc2) throws IllegalArgumentException {
return server.getArea(loc1, loc2);
return provider.getArea(loc1, loc2);
}

/**
Expand All @@ -453,7 +453,7 @@ public static Area getArea(@Nonnull Block loc1, @Nonnull Block loc2) throws Ille
@Nonnull
@Contract("_ -> new")
public static Area getAreaOfBlock(@Nonnull Block block) throws IllegalArgumentException {
return server.getArea(block, block);
return provider.getArea(block, block);
}

/**
Expand All @@ -469,6 +469,6 @@ public static Area getAreaOfBlock(@Nonnull Block block) throws IllegalArgumentEx
*/
public static void loadPreset(@Nonnull Area presetArea, @Nonnull Block presetPivot, @Nonnull Block mainWorldPivot)
throws IllegalArgumentException, IllegalStateException {
server.loadPreset(presetArea, presetPivot, mainWorldPivot);
provider.loadPreset(presetArea, presetPivot, mainWorldPivot);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import java.util.List;

@ApiStatus.Internal
public interface RegionsServer {
public interface RegionsProvider {

@Nullable
@Contract(pure = true)
Expand Down