Skip to content

Commit

Permalink
Make constructors of abstract classes protected
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgH93 committed Dec 11, 2021
1 parent 914235a commit 472145b
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package at.pcgamingfreaks.MarriageMaster.Bukkit.API;
Expand All @@ -28,7 +28,7 @@ public abstract class AcceptPendingRequest extends at.pcgamingfreaks.MarriageMas
* @param hasToAccept The player that has to accept the request.
* @param canCancel The players that can cancel the request.
*/
public AcceptPendingRequest(@NotNull MarriagePlayer hasToAccept, @NotNull MarriagePlayer... canCancel)
protected AcceptPendingRequest(@NotNull MarriagePlayer hasToAccept, @NotNull MarriagePlayer... canCancel)
{
super(hasToAccept, canCancel);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package at.pcgamingfreaks.MarriageMaster.Bukkit.API;
Expand All @@ -31,30 +31,23 @@ public abstract class Home extends at.pcgamingfreaks.MarriageMaster.API.Home
{
private final Location location;

public Home(Location location)
protected Home(Location location)
{
this(location, null);
}

public Home(@NotNull Location location, @Nullable String homeServer)
protected Home(@NotNull Location location, @Nullable String homeServer)
{
super(location.getWorld().getName(), homeServer, location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
this.location = location;
}

public Home(final @NotNull String world, final @Nullable String server, final double x, final double y, final double z, final float yaw, final float pitch)
protected Home(final @NotNull String world, final @Nullable String server, final double x, final double y, final double z, final float yaw, final float pitch)
{
super(world, server, x, y, z, yaw, pitch);
this.location = new Location(Bukkit.getServer().getWorld(world), x, y, z, yaw, pitch);
}

@Deprecated
public Home(final @NotNull String world, final @Nullable String server, final double x, final double y, final double z)
{
super(world, server, x, y, z);
this.location = new Location(Bukkit.getServer().getWorld(world), x, y, z, 0, 0);
}

/**
* Gets the location of the represented home.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package at.pcgamingfreaks.MarriageMaster.Bukkit.API;
Expand Down Expand Up @@ -54,7 +54,7 @@ public abstract class MarryCommand extends SubCommand implements at.pcgamingfrea
* @param description The description of the command.
* @param aliases List of aliases for that command.
*/
public MarryCommand(@NotNull JavaPlugin plugin, @NotNull String name, @NotNull String description, @Nullable String... aliases)
protected MarryCommand(@NotNull JavaPlugin plugin, @NotNull String name, @NotNull String description, @Nullable String... aliases)
{
this(plugin, name, description, null, aliases);
}
Expand All @@ -68,7 +68,7 @@ public MarryCommand(@NotNull JavaPlugin plugin, @NotNull String name, @NotNull S
* @param permission The permission to be checked for this command. Players without the permission neither can use the command nor will they see it in help.
* @param aliases List of aliases for that command.
*/
public MarryCommand(@NotNull JavaPlugin plugin, @NotNull String name, @NotNull String description, @Nullable String permission, @Nullable String... aliases)
protected MarryCommand(@NotNull JavaPlugin plugin, @NotNull String name, @NotNull String description, @Nullable String permission, @Nullable String... aliases)
{
super(name, description, permission, aliases);
this.plugin = plugin;
Expand All @@ -84,7 +84,7 @@ public MarryCommand(@NotNull JavaPlugin plugin, @NotNull String name, @NotNull S
* @param playerOnly Limits the command to players, console can't use and can't see the command.
* @param aliases List of aliases for that command.
*/
public MarryCommand(@NotNull JavaPlugin plugin, @NotNull String name, @NotNull String description, @Nullable String permission, boolean playerOnly, @Nullable String... aliases)
protected MarryCommand(@NotNull JavaPlugin plugin, @NotNull String name, @NotNull String description, @Nullable String permission, boolean playerOnly, @Nullable String... aliases)
{
this(plugin, name, description, permission, aliases);
this.playerOnly = playerOnly;
Expand All @@ -101,7 +101,7 @@ public MarryCommand(@NotNull JavaPlugin plugin, @NotNull String name, @NotNull S
* @param partnerSelectorInHelpForMoreThanOnePartner If the help should contain a partner name parameter (for polygamy).
* @param aliases List of aliases for that command.
*/
public MarryCommand(@NotNull JavaPlugin plugin, @NotNull String name, @NotNull String description, @Nullable String permission, boolean mustBeMarried, boolean partnerSelectorInHelpForMoreThanOnePartner, @Nullable String... aliases)
protected MarryCommand(@NotNull JavaPlugin plugin, @NotNull String name, @NotNull String description, @Nullable String permission, boolean mustBeMarried, boolean partnerSelectorInHelpForMoreThanOnePartner, @Nullable String... aliases)
{
this(plugin, name, description, permission, true, aliases);
this.mustBeMarried = mustBeMarried;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package at.pcgamingfreaks.MarriageMaster.Bungee.API;
Expand Down Expand Up @@ -55,7 +55,7 @@ public abstract class MarryCommand extends SubCommand implements at.pcgamingfrea
* @param description The description of the command.
* @param aliases List of aliases for that command.
*/
public MarryCommand(@NotNull Plugin plugin, @NotNull String name, @NotNull String description, @Nullable String... aliases)
protected MarryCommand(@NotNull Plugin plugin, @NotNull String name, @NotNull String description, @Nullable String... aliases)
{
this(plugin, name, description, null, aliases);
}
Expand All @@ -69,7 +69,7 @@ public MarryCommand(@NotNull Plugin plugin, @NotNull String name, @NotNull Strin
* @param permission The permission to be checked for this command. Players without the permission neither can use the command nor will they see it in help.
* @param aliases List of aliases for that command.
*/
public MarryCommand(@NotNull Plugin plugin, @NotNull String name, @NotNull String description, @Nullable String permission, @Nullable String... aliases)
protected MarryCommand(@NotNull Plugin plugin, @NotNull String name, @NotNull String description, @Nullable String permission, @Nullable String... aliases)
{
super(name, description, permission, aliases);
this.plugin = plugin;
Expand All @@ -85,7 +85,7 @@ public MarryCommand(@NotNull Plugin plugin, @NotNull String name, @NotNull Strin
* @param playerOnly Limits the command to players, console can't use and can't see the command.
* @param aliases List of aliases for that command.
*/
public MarryCommand(@NotNull Plugin plugin, @NotNull String name, @NotNull String description, @Nullable String permission, boolean playerOnly, @Nullable String... aliases)
protected MarryCommand(@NotNull Plugin plugin, @NotNull String name, @NotNull String description, @Nullable String permission, boolean playerOnly, @Nullable String... aliases)
{
this(plugin, name, description, permission, aliases);
this.playerOnly = playerOnly;
Expand All @@ -102,7 +102,7 @@ public MarryCommand(@NotNull Plugin plugin, @NotNull String name, @NotNull Strin
* @param partnerSelectorInHelpForMoreThanOnePartner If the help should contain a partner name parameter (for polygamy).
* @param aliases List of aliases for that command.
*/
public MarryCommand(@NotNull Plugin plugin, @NotNull String name, @NotNull String description, @Nullable String permission, boolean mustBeMarried, boolean partnerSelectorInHelpForMoreThanOnePartner, @Nullable String... aliases)
protected MarryCommand(@NotNull Plugin plugin, @NotNull String name, @NotNull String description, @Nullable String permission, boolean mustBeMarried, boolean partnerSelectorInHelpForMoreThanOnePartner, @Nullable String... aliases)
{
this(plugin, name, description, permission, true, aliases);
this.mustBeMarried = mustBeMarried;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package at.pcgamingfreaks.MarriageMaster.API;
Expand Down Expand Up @@ -41,7 +41,7 @@ public abstract class AcceptPendingRequest<T extends MarriagePlayer>
* @param canCancel The players that can cancel the request.
*/
@SafeVarargs
public AcceptPendingRequest(@NotNull T hasToAccept, @NotNull T... canCancel)
protected AcceptPendingRequest(@NotNull T hasToAccept, @NotNull T... canCancel)
{
playerThatHasToAccept = hasToAccept;
playersThatCanCancel = canCancel;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020 GeorgH93
* Copyright (C) 2021 GeorgH93
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -12,7 +12,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package at.pcgamingfreaks.MarriageMaster.Bukkit.Database;
Expand All @@ -34,7 +34,7 @@

import java.util.UUID;

public class Database extends BaseDatabase<MarriageMaster, MarriagePlayerData, MarriageData, MarriageHome> implements Listener
public final class Database extends BaseDatabase<MarriageMaster, MarriagePlayerData, MarriageData, MarriageHome> implements Listener
{
private final BaseUnCacheStrategy unCacheStrategy;

Expand Down

0 comments on commit 472145b

Please sign in to comment.