Skip to content

Commit

Permalink
properties: stop abusing 'private'
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Mar 22, 2023
1 parent c008938 commit bd8932f
Show file tree
Hide file tree
Showing 38 changed files with 46 additions and 46 deletions.
Expand Up @@ -49,7 +49,7 @@ public static AreaShopPlayerProperties getFrom(ObjectTag object) {
public static final String[] handledMechs = new String[] {
}; // None

private AreaShopPlayerProperties(PlayerTag player) {
public AreaShopPlayerProperties(PlayerTag player) {
this.player = player;
}

Expand Down
Expand Up @@ -27,7 +27,7 @@ public static BetonQuestPlayerProperties getFrom(ObjectTag player) {
public static final String[] handledMechs = new String[] {
}; // None

private BetonQuestPlayerProperties(PlayerTag player) {
public BetonQuestPlayerProperties(PlayerTag player) {
this.player = player;
}

Expand Down
Expand Up @@ -22,7 +22,7 @@ public class CrackShotEntityProperties implements Property {

EntityTag entity;

private CrackShotEntityProperties(EntityTag entity) {
public CrackShotEntityProperties(EntityTag entity) {
this.entity = entity;
}

Expand Down
Expand Up @@ -19,7 +19,7 @@ public class CrackShotItemProperties implements Property {

ItemTag item;

private CrackShotItemProperties(ItemTag item) {
public CrackShotItemProperties(ItemTag item) {
this.item = item;
}

Expand Down
Expand Up @@ -45,7 +45,7 @@ public static EssentialsItemProperties getFrom(ObjectTag object) {
"worth"
};

private EssentialsItemProperties(ItemTag item) {
public EssentialsItemProperties(ItemTag item) {
this.item = item;
}

Expand Down
Expand Up @@ -53,7 +53,7 @@ public static EssentialsPlayerProperties getFrom(ObjectTag object) {
"is_afk", "god_mode", "is_muted", "socialspy", "vanish", "essentials_ignore"
};

private EssentialsPlayerProperties(PlayerTag player) {
public EssentialsPlayerProperties(PlayerTag player) {
this.player = player;
}

Expand Down
Expand Up @@ -46,7 +46,7 @@ public static FactionsLocationProperties getFrom(ObjectTag object) {
public static final String[] handledMechs = new String[] {
}; // None

private FactionsLocationProperties(LocationTag location) {
public FactionsLocationProperties(LocationTag location) {
this.location = location;
}

Expand Down
Expand Up @@ -48,7 +48,7 @@ public static FactionsNPCProperties getFrom(ObjectTag object) {
public static final String[] handledMechs = new String[] {
}; // None

private FactionsNPCProperties(NPCTag object) {
public FactionsNPCProperties(NPCTag object) {
npc = object;
}

Expand Down
Expand Up @@ -47,7 +47,7 @@ public static FactionsPlayerProperties getFrom(ObjectTag object) {
public static final String[] handledMechs = new String[] {
}; // None

private FactionsPlayerProperties(PlayerTag object) {
public FactionsPlayerProperties(PlayerTag object) {
player = object;
}

Expand Down
Expand Up @@ -45,7 +45,7 @@ public static GriefPreventionLocationProperties getFrom(ObjectTag object) {
public static final String[] handledMechs = new String[] {
}; // None

private GriefPreventionLocationProperties(LocationTag location) {
public GriefPreventionLocationProperties(LocationTag location) {
this.location = location;
}

Expand Down
Expand Up @@ -48,7 +48,7 @@ public static GriefPreventionPlayerProperties getFrom(ObjectTag object) {
"bonus_blocks", "normal_blocks"
};

private GriefPreventionPlayerProperties(PlayerTag player) {
public GriefPreventionPlayerProperties(PlayerTag player) {
this.player = player;
data = dataStore.getPlayerData(player.getUUID());
}
Expand Down
Expand Up @@ -38,7 +38,7 @@ public static GriefPreventionWorldProperties getFrom(ObjectTag object) {
public static final String[] handledMechs = new String[] {
}; // None

private GriefPreventionWorldProperties(WorldTag world) {
public GriefPreventionWorldProperties(WorldTag world) {
this.world = world;
}

Expand Down
Expand Up @@ -48,7 +48,7 @@ public static JobsPlayerProperties getFrom(ObjectTag object) {
public static final String[] handledMechs = new String[] {
}; // None

private JobsPlayerProperties(PlayerTag player) {
public JobsPlayerProperties(PlayerTag player) {
this.player = Jobs.getPlayerManager().getJobsPlayer(player.getName());
}

Expand Down
Expand Up @@ -46,7 +46,7 @@ public static LuckPermsPlayerProperties getFrom(ObjectTag object) {
public static final String[] handledMechs = new String[] {
}; // None

private LuckPermsPlayerProperties(PlayerTag player) {
public LuckPermsPlayerProperties(PlayerTag player) {
this.player = player;
}

Expand Down
Expand Up @@ -49,11 +49,11 @@ public static MagicSpellsPlayerProperties getFrom(ObjectTag object) {
public static final String[] handledMechs = new String[] {
}; // None

private MagicSpellsPlayerProperties(PlayerTag player) {
public MagicSpellsPlayerProperties(PlayerTag player) {
this.player = player;
}

private PlayerTag player;
public PlayerTag player;

@Override
public ObjectTag getObjectAttribute(Attribute attribute) {
Expand Down
Expand Up @@ -46,7 +46,7 @@ public static McMMOEntityProperties getFrom(ObjectTag object) {
public static final String[] handledMechs = new String[] {
}; // None

private McMMOEntityProperties(EntityTag entity) {
public McMMOEntityProperties(EntityTag entity) {
this.entity = entity;
}

Expand Down
Expand Up @@ -45,7 +45,7 @@ public static McMMOLocationProperties getFrom(ObjectTag object) {
public static final String[] handledMechs = new String[] {
}; // None

private McMMOLocationProperties(LocationTag location) {
public McMMOLocationProperties(LocationTag location) {
this.location = location;
}

Expand Down
Expand Up @@ -48,7 +48,7 @@ public static McMMOPlayerProperties getFrom(ObjectTag object) {
public static final String[] handledMechs = new String[] {
}; // None

private McMMOPlayerProperties(PlayerTag player) {
public McMMOPlayerProperties(PlayerTag player) {
this.player = player;
}

Expand Down
Expand Up @@ -40,7 +40,7 @@ public static NoCheatPlusPlayerProperties getFrom(ObjectTag object) {
public static final String[] handledMechs = new String[] {
}; // None

private NoCheatPlusPlayerProperties(PlayerTag player) {
public NoCheatPlusPlayerProperties(PlayerTag player) {
this.player = player;
}

Expand Down
Expand Up @@ -40,7 +40,7 @@ public static NoteBlockAPIPlayerProperties getFrom(ObjectTag object) {
public static final String[] handledMechs = new String[] {
}; // None

private NoteBlockAPIPlayerProperties(PlayerTag player) {
public NoteBlockAPIPlayerProperties(PlayerTag player) {
this.player = player;
}

Expand Down
Expand Up @@ -41,7 +41,7 @@ public static PlayerPointsPlayerProperties getFrom(ObjectTag object) {
public static final String[] handledMechs = new String[] {
}; // None

private PlayerPointsPlayerProperties(PlayerTag player) {
public PlayerPointsPlayerProperties(PlayerTag player) {
this.player = player;
}

Expand Down
Expand Up @@ -42,7 +42,7 @@ public static PlotSquaredLocationProperties getFrom(ObjectTag object) {
public static final String[] handledMechs = new String[] {
}; // None

private PlotSquaredLocationProperties(LocationTag location) {
public PlotSquaredLocationProperties(LocationTag location) {
this.location = location;
}

Expand Down
Expand Up @@ -43,7 +43,7 @@ public static PlotSquaredPlayerProperties getFrom(ObjectTag object) {
public static final String[] handledMechs = new String[] {
}; // None

private PlotSquaredPlayerProperties(PlayerTag player) {
public PlotSquaredPlayerProperties(PlayerTag player) {
this.player = player;
}

Expand Down
Expand Up @@ -47,7 +47,7 @@ public static PVPArenaPlayerProperties getFrom(ObjectTag object) {
public static final String[] handledMechs = new String[] {
}; // None

private PVPArenaPlayerProperties(PlayerTag player) {
public PVPArenaPlayerProperties(PlayerTag player) {
this.player = ArenaPlayer.parsePlayer(player.getName());
}

Expand Down
Expand Up @@ -44,7 +44,7 @@ public static QuestsPlayerProperties getFrom(ObjectTag object) {
public static final String[] handledMechs = new String[] {
}; // None

private QuestsPlayerProperties(PlayerTag player) {
public QuestsPlayerProperties(PlayerTag player) {
this.player = player;
}

Expand Down
Expand Up @@ -53,7 +53,7 @@ public static SentinelNPCProperties getFrom(ObjectTag object) {
public static final String[] handledMechs = new String[] {
}; // None

private SentinelNPCProperties(NPCTag npc) {
public SentinelNPCProperties(NPCTag npc) {
this.npc = npc;
}

Expand Down
Expand Up @@ -46,7 +46,7 @@ public static TCLocationProperties getFrom(ObjectTag object) {
public static final String[] handledMechs = new String[] {
}; // None

private TCLocationProperties(LocationTag object) {
public TCLocationProperties(LocationTag object) {
location = object;
}

Expand Down
Expand Up @@ -48,7 +48,7 @@ public static TownyChatPlayerProperties getFrom(ObjectTag object) {
public static final String[] handledMechs = new String[] {
}; // None

private TownyChatPlayerProperties(PlayerTag player) {
public TownyChatPlayerProperties(PlayerTag player) {
this.player = player;
}

Expand Down
Expand Up @@ -52,7 +52,7 @@ public static TownyCuboidProperties getFrom(ObjectTag object) {
public static final String[] handledMechs = new String[] {
}; // None

private TownyCuboidProperties(CuboidTag cuboid) {
public TownyCuboidProperties(CuboidTag cuboid) {
this.cuboid = cuboid;
}

Expand Down
Expand Up @@ -134,7 +134,7 @@ public static void register() {
});
}

private static PlayerTag getResidentAtLocation(LocationTag location) throws NotRegisteredException {
public static PlayerTag getResidentAtLocation(LocationTag location) throws NotRegisteredException {
TownBlock block = TownyAPI.getInstance().getTownBlock(location);
if (block == null) {
return null;
Expand Down
Expand Up @@ -51,7 +51,7 @@ public static TownyPlayerProperties getFrom(ObjectTag object) {
public static final String[] handledMechs = new String[] {
}; // None

private TownyPlayerProperties(PlayerTag player) {
public TownyPlayerProperties(PlayerTag player) {
this.player = player;
}

Expand Down
Expand Up @@ -40,7 +40,7 @@ public static TownyWorldProperties getFrom(ObjectTag object) {
public static final String[] handledMechs = new String[] {
}; // None

private TownyWorldProperties(WorldTag world) {
public TownyWorldProperties(WorldTag world) {
this.world = world;
}

Expand Down
Expand Up @@ -41,7 +41,7 @@ public static ViaVersionPlayerProperties getFrom(ObjectTag object) {
public static final String[] handledMechs = new String[] {
}; // None

private ViaVersionPlayerProperties(PlayerTag player) {
public ViaVersionPlayerProperties(PlayerTag player) {
this.player = player;
}

Expand Down
Expand Up @@ -63,7 +63,7 @@ public static WorldEditPlayerProperties getFrom(ObjectTag object) {
"we_selection"
};

private WorldEditPlayerProperties(PlayerTag player) {
public WorldEditPlayerProperties(PlayerTag player) {
this.player = player.getPlayerEntity();
}

Expand Down
Expand Up @@ -56,13 +56,13 @@ public static WorldGuardCuboidProperties getFrom(ObjectTag cuboid) {
public static final String[] handledMechs = new String[] {
}; // None

private WorldGuardCuboidProperties(CuboidTag cuboid) {
public WorldGuardCuboidProperties(CuboidTag cuboid) {
this.cuboid = cuboid;
}

CuboidTag cuboid;

private ApplicableRegionSet getApplicableRegions() {
public ApplicableRegionSet getApplicableRegions() {
WorldGuardPlugin worldGuard = (WorldGuardPlugin) WorldGuardBridge.instance.plugin;
LocationTag low = cuboid.getLow(0);
LocationTag high = cuboid.getHigh(0);
Expand All @@ -72,11 +72,11 @@ private ApplicableRegionSet getApplicableRegions() {
return WorldGuard.getInstance().getPlatform().getRegionContainer().get(BukkitAdapter.adapt(cuboid.getWorld().getWorld())).getApplicableRegions(region);
}

private boolean hasRegion() {
public boolean hasRegion() {
return getApplicableRegions().size() > 0;
}

private ListTag getRegions(World world) {
public ListTag getRegions(World world) {
ListTag regionList = new ListTag();
for (ProtectedRegion protectedRegion : getApplicableRegions()) {
regionList.addObject(new WorldGuardRegionTag(protectedRegion, world));
Expand Down
Expand Up @@ -51,22 +51,22 @@ public static WorldGuardLocationProperties getFrom(ObjectTag loc) {
public static final String[] handledMechs = new String[] {
}; // None

private WorldGuardLocationProperties(LocationTag loc) {
public WorldGuardLocationProperties(LocationTag loc) {
location = loc;
}

LocationTag location;

private ApplicableRegionSet getApplicableRegions() {
public ApplicableRegionSet getApplicableRegions() {
return WorldGuard.getInstance().getPlatform().getRegionContainer().get(BukkitAdapter.adapt(location.getWorld()))
.getApplicableRegions(BukkitAdapter.asBlockVector(location));
}

private boolean inRegion() {
public boolean inRegion() {
return getApplicableRegions().size() > 0;
}

private boolean inRegion(String region) {
public boolean inRegion(String region) {
for (ProtectedRegion protectedRegion : getApplicableRegions()) {
if (protectedRegion.getId().equalsIgnoreCase(region)) {
return true;
Expand All @@ -75,7 +75,7 @@ private boolean inRegion(String region) {
return false;
}

private ListTag getRegions(World world) {
public ListTag getRegions(World world) {
ListTag regionList = new ListTag();
for (ProtectedRegion protectedRegion : getApplicableRegions()) {
regionList.addObject(new WorldGuardRegionTag(protectedRegion, world));
Expand Down
Expand Up @@ -56,7 +56,7 @@ public static WorldGuardPlayerProperties getFrom(ObjectTag object) {
public static final String[] handledMechs = new String[] {
}; // None

private WorldGuardPlayerProperties(PlayerTag player) {
public WorldGuardPlayerProperties(PlayerTag player) {
this.player = player.getPlayerEntity();
}

Expand Down
Expand Up @@ -46,7 +46,7 @@ public static WorldGuardWorldProperties getFrom(ObjectTag object) {
public static final String[] handledMechs = new String[] {
}; // None

private WorldGuardWorldProperties(WorldTag world) {
public WorldGuardWorldProperties(WorldTag world) {
this.world = world.getWorld();
this.manager = WorldGuard.getInstance().getPlatform().getRegionContainer().get(BukkitAdapter.adapt(this.world));
}
Expand Down

0 comments on commit bd8932f

Please sign in to comment.