Skip to content

Commit 327bcf3

Browse files
authored
v2.17.0
2 parents 16be0c1 + 5c3bb55 commit 327bcf3

File tree

77 files changed

+1851
-1114
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+1851
-1114
lines changed

.github/workflows/maven.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This workflow will build a Java project with Maven
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
33

4-
name: Java CI Dev Build
4+
name: CI
55

66
on:
77
push:
@@ -12,10 +12,10 @@ on:
1212
jobs:
1313
build:
1414
strategy:
15-
fail-fast: false
15+
fail-fast: true
1616
max-parallel: 4
1717
matrix:
18-
java-version: [ 8, 11, 16 ]
18+
java-version: [ 8, 11, 16, 17 ]
1919

2020
runs-on: ubuntu-latest
2121

@@ -27,9 +27,10 @@ jobs:
2727
with:
2828
java-version: "${{ matrix.java-version }}"
2929
distribution: 'adopt'
30+
cache: 'maven'
3031
- name: Build with Maven
3132
run: mvn -B -U package --file pom.xml
32-
- name: Upload a Build Artifact
33+
- name: Upload Build Artifact
3334
if: "${{ matrix.java-version == 8 }}"
3435
uses: actions/upload-artifact@v2
3536
with:

SimpleClans.iml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,6 @@
8686
<orderEntry type="library" scope="PROVIDED" name="Maven: org.flywaydb:flyway-core:3.0" level="project" />
8787
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q:commandbook:2.3" level="project" />
8888
<orderEntry type="library" scope="PROVIDED" name="Maven: com.github.TechFortress:GriefPrevention:16.17.1" level="project" />
89-
<orderEntry type="library" scope="PROVIDED" name="Maven: com.plotsquared:plotsquared-api:3.1" level="project" />
90-
<orderEntry type="library" scope="PROVIDED" name="Maven: com.plotsquared:plotsquared-bukkitapi:3.1" level="project" />
91-
<orderEntry type="library" scope="PROVIDED" name="Maven: net.milkbowl.vault:VaultAPI:1.7" level="project" />
9289
<orderEntry type="library" scope="PROVIDED" name="Maven: com.discordsrv:discordsrv:1.24.1-SNAPSHOT" level="project" />
9390
<orderEntry type="library" scope="PROVIDED" name="Maven: net.dv8tion:JDA:4.3.0_349" level="project" />
9491
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />

dependency-reduced-pom.xml

Lines changed: 28 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<groupId>net.sacredlabyrinth.phaed.simpleclans</groupId>
55
<artifactId>SimpleClans</artifactId>
66
<name>SimpleClans</name>
7-
<version>2.16.0</version>
7+
<version>2.16.2</version>
88
<url>https://www.spigotmc.org/resources/simpleclans.71242/</url>
99
<build>
1010
<resources>
@@ -84,6 +84,31 @@
8484
</artifactSet>
8585
</configuration>
8686
</plugin>
87+
<plugin>
88+
<artifactId>maven-dependency-plugin</artifactId>
89+
<version>3.2.0</version>
90+
<executions>
91+
<execution>
92+
<id>copy-installed</id>
93+
<phase>package</phase>
94+
<goals>
95+
<goal>copy</goal>
96+
</goals>
97+
<configuration>
98+
<artifactItems>
99+
<artifactItem>
100+
<groupId>${project.groupId}</groupId>
101+
<artifactId>${project.artifactId}</artifactId>
102+
<version>${project.version}</version>
103+
<type>${project.packaging}</type>
104+
</artifactItem>
105+
</artifactItems>
106+
<outputDirectory>${env.TEST_SERVER}\plugins</outputDirectory>
107+
<silent>true</silent>
108+
</configuration>
109+
</execution>
110+
</executions>
111+
</plugin>
87112
<plugin>
88113
<groupId>pl.project13.maven</groupId>
89114
<artifactId>git-commit-id-plugin</artifactId>
@@ -142,10 +167,6 @@
142167
<id>sk89q-repo</id>
143168
<url>https://maven.enginehub.org/repo/</url>
144169
</repository>
145-
<repository>
146-
<id>plotsquared</id>
147-
<url>https://plotsquared.com/mvn/</url>
148-
</repository>
149170
<repository>
150171
<id>Scarsz-Nexus</id>
151172
<url>https://nexus.scarsz.me/content/groups/public/</url>
@@ -274,54 +295,6 @@
274295
<version>16.17.1</version>
275296
<scope>provided</scope>
276297
</dependency>
277-
<dependency>
278-
<groupId>com.plotsquared</groupId>
279-
<artifactId>plotsquared-api</artifactId>
280-
<version>3.1</version>
281-
<scope>provided</scope>
282-
<exclusions>
283-
<exclusion>
284-
<artifactId>*</artifactId>
285-
<groupId>com.sk89q.worldedit</groupId>
286-
</exclusion>
287-
<exclusion>
288-
<artifactId>snakeyaml</artifactId>
289-
<groupId>org.yaml</groupId>
290-
</exclusion>
291-
<exclusion>
292-
<artifactId>gson</artifactId>
293-
<groupId>com.google.code.gson</groupId>
294-
</exclusion>
295-
<exclusion>
296-
<artifactId>guava</artifactId>
297-
<groupId>com.google.guava</groupId>
298-
</exclusion>
299-
</exclusions>
300-
</dependency>
301-
<dependency>
302-
<groupId>com.plotsquared</groupId>
303-
<artifactId>plotsquared-bukkitapi</artifactId>
304-
<version>3.1</version>
305-
<scope>provided</scope>
306-
<exclusions>
307-
<exclusion>
308-
<artifactId>*</artifactId>
309-
<groupId>com.sk89q.worldedit</groupId>
310-
</exclusion>
311-
<exclusion>
312-
<artifactId>Core</artifactId>
313-
<groupId>PlotSquared</groupId>
314-
</exclusion>
315-
<exclusion>
316-
<artifactId>VaultAPI</artifactId>
317-
<groupId>net.milkbowl.vault</groupId>
318-
</exclusion>
319-
<exclusion>
320-
<artifactId>guava</artifactId>
321-
<groupId>com.google.guava</groupId>
322-
</exclusion>
323-
</exclusions>
324-
</dependency>
325298
<dependency>
326299
<groupId>com.discordsrv</groupId>
327300
<artifactId>discordsrv</artifactId>
@@ -437,13 +410,9 @@
437410
</dependencies>
438411
<distributionManagement>
439412
<repository>
440-
<id>codemc-releases</id>
441-
<url>https://repo.codemc.io/repository/maven-releases/</url>
413+
<id>reposilite</id>
414+
<url>https://repo.roinujnosde.me/releases/</url>
442415
</repository>
443-
<snapshotRepository>
444-
<id>codemc-snapshots</id>
445-
<url>https://repo.codemc.io/repository/maven-snapshots/</url>
446-
</snapshotRepository>
447416
</distributionManagement>
448417
<properties>
449418
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

pom.xml

Lines changed: 29 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,34 @@
101101
</executions>
102102
</plugin>
103103

104+
<!-- Dependency plugin -->
105+
<plugin>
106+
<groupId>org.apache.maven.plugins</groupId>
107+
<artifactId>maven-dependency-plugin</artifactId>
108+
<version>3.2.0</version>
109+
<executions>
110+
<execution>
111+
<id>copy-installed</id>
112+
<phase>package</phase>
113+
<goals>
114+
<goal>copy</goal>
115+
</goals>
116+
<configuration>
117+
<artifactItems>
118+
<artifactItem>
119+
<groupId>${project.groupId}</groupId>
120+
<artifactId>${project.artifactId}</artifactId>
121+
<version>${project.version}</version>
122+
<type>${project.packaging}</type>
123+
</artifactItem>
124+
</artifactItems>
125+
<outputDirectory>${env.TEST_SERVER}\plugins</outputDirectory>
126+
<silent>true</silent>
127+
</configuration>
128+
</execution>
129+
</executions>
130+
</plugin>
131+
104132
<plugin>
105133
<groupId>pl.project13.maven</groupId>
106134
<artifactId>git-commit-id-plugin</artifactId>
@@ -207,52 +235,6 @@
207235
<version>16.17.1</version>
208236
<scope>provided</scope>
209237
</dependency>
210-
<!-- <dependency>-->
211-
<!-- <groupId>com.plotsquared</groupId>-->
212-
<!-- <artifactId>PlotSquared-Core</artifactId>-->
213-
<!-- <version>5.13.3</version>-->
214-
<!-- <scope>provided</scope>-->
215-
<!-- </dependency>-->
216-
<!-- <dependency>-->
217-
<!-- <groupId>com.plotsquared</groupId>-->
218-
<!-- <artifactId>PlotSquared-Bukkit</artifactId>-->
219-
<!-- <version>5.13.3</version>-->
220-
<!-- <scope>provided</scope>-->
221-
<!-- <exclusions>-->
222-
<!-- <exclusion>-->
223-
<!-- <groupId>*</groupId>-->
224-
<!-- <artifactId>PlotSquared-Core</artifactId>-->
225-
<!-- </exclusion>-->
226-
<!-- </exclusions>-->
227-
<!-- </dependency>-->
228-
<dependency>
229-
<groupId>com.plotsquared</groupId>
230-
<artifactId>plotsquared-api</artifactId>
231-
<version>3.1</version>
232-
<scope>provided</scope>
233-
<exclusions>
234-
<exclusion>
235-
<groupId>com.sk89q.worldedit</groupId>
236-
<artifactId>*</artifactId>
237-
</exclusion>
238-
</exclusions>
239-
</dependency>
240-
<dependency>
241-
<groupId>com.plotsquared</groupId>
242-
<artifactId>plotsquared-bukkitapi</artifactId>
243-
<version>3.1</version>
244-
<scope>provided</scope>
245-
<exclusions>
246-
<exclusion>
247-
<groupId>com.sk89q.worldedit</groupId>
248-
<artifactId>*</artifactId>
249-
</exclusion>
250-
<exclusion>
251-
<groupId>PlotSquared</groupId>
252-
<artifactId>Core</artifactId>
253-
</exclusion>
254-
</exclusions>
255-
</dependency>
256238
<dependency>
257239
<groupId>com.discordsrv</groupId>
258240
<artifactId>discordsrv</artifactId>
@@ -293,14 +275,6 @@
293275
<id>sk89q-repo</id>
294276
<url>https://maven.enginehub.org/repo/</url>
295277
</repository>
296-
<!-- <repository>-->
297-
<!-- <id>IntellectualSites</id>-->
298-
<!-- <url>https://mvn.intellectualsites.com/content/groups/public/</url>-->
299-
<!-- </repository>-->
300-
<repository>
301-
<id>plotsquared</id>
302-
<url>https://plotsquared.com/mvn/</url>
303-
</repository>
304278
<repository>
305279
<id>Scarsz-Nexus</id>
306280
<url>https://nexus.scarsz.me/content/groups/public/</url>
@@ -316,7 +290,7 @@
316290
</repositories>
317291

318292
<properties>
319-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
293+
<project.build.sourcfeEncoding>UTF-8</project.build.sourcfeEncoding>
320294
</properties>
321295

322296
<!-- Upstream Distribution -->

src/main/java/net/sacredlabyrinth/phaed/simpleclans/Clan.java

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import net.sacredlabyrinth.phaed.simpleclans.hooks.papi.Placeholder;
77
import net.sacredlabyrinth.phaed.simpleclans.loggers.BankLog;
88
import net.sacredlabyrinth.phaed.simpleclans.loggers.BankLogger;
9+
import net.sacredlabyrinth.phaed.simpleclans.loggers.BankOperator;
910
import net.sacredlabyrinth.phaed.simpleclans.managers.PermissionsManager;
1011
import net.sacredlabyrinth.phaed.simpleclans.managers.SettingsManager;
1112
import net.sacredlabyrinth.phaed.simpleclans.utils.ChatUtils;
@@ -128,7 +129,7 @@ public void deposit(double amount, Player player) {
128129
/**
129130
* Deposits money to the clan
130131
*/
131-
public EconomyResponse deposit(@Nullable CommandSender sender, @NotNull Cause cause, double amount) {
132+
public EconomyResponse deposit(@NotNull BankOperator sender, @NotNull Cause cause, double amount) {
132133
EconomyResponse response = null;
133134

134135
if (amount < 0) {
@@ -162,7 +163,7 @@ public void withdraw(double amount, Player player) {
162163
/**
163164
* Withdraws money from the clan
164165
*/
165-
public EconomyResponse withdraw(@Nullable CommandSender sender, @NotNull Cause cause, double amount) {
166+
public EconomyResponse withdraw(@NotNull BankOperator sender, @NotNull Cause cause, double amount) {
166167
EconomyResponse response = null;
167168

168169
if (amount < 0) {
@@ -250,14 +251,15 @@ public double getBalance() {
250251
*
251252
* @param balance the balance to set
252253
*/
253-
public void setBalance(double balance) {
254-
setBalance(null, Cause.API, SET, balance);
254+
private void setBalance(double balance) {
255+
setBalance(BankOperator.INTERNAL, Cause.INTERNAL, SET, balance);
255256
}
256257

257-
public EconomyResponse setBalance(@Nullable CommandSender updater, @NotNull Cause cause, @NotNull BankLogger.Operation operation, double balance) {
258+
public EconomyResponse setBalance(@NotNull BankOperator operator, @NotNull Cause cause,
259+
@NotNull BankLogger.Operation operation, double balance) {
258260
EconomyResponse response = SUCCESS;
259261

260-
ClanBalanceUpdateEvent event = new ClanBalanceUpdateEvent(updater, this, getBalance(), balance, cause);
262+
ClanBalanceUpdateEvent event = new ClanBalanceUpdateEvent(operator, this, getBalance(), balance, cause);
261263
Bukkit.getPluginManager().callEvent(event);
262264
if (event.isCancelled()) {
263265
response = CANCELLED;
@@ -266,7 +268,7 @@ public EconomyResponse setBalance(@Nullable CommandSender updater, @NotNull Caus
266268
this.balance = event.getNewBalance();
267269
if (cause != Cause.LOADING) {
268270
if (operation == SET) {
269-
SimpleClans.getInstance().getBankLogger().log(new BankLog(updater, this, response, SET, cause, balance));
271+
SimpleClans.getInstance().getBankLogger().log(new BankLog(operator, this, response, SET, cause, balance));
270272
}
271273
SimpleClans.getInstance().getStorageManager().updateClan(this);
272274
}
@@ -776,8 +778,10 @@ public boolean isLeader(String playerName) {
776778
* @return the fee payers
777779
*/
778780
public Set<ClanPlayer> getFeePayers() {
779-
PermissionsManager permissions = SimpleClans.getInstance().getPermissionsManager();
780-
return getNonLeaders().stream().filter(cp -> !permissions.has(cp.toPlayer(), "simpleclans.member.bypass-fee")).collect(Collectors.toSet());
781+
return getMembers().stream().filter(cp -> !cp.isLeader()).filter(cp -> {
782+
Rank rank = getRank(cp.getRankId());
783+
return rank == null || !rank.getPermissions().contains(RankPermission.FEE_BYPASS.toString());
784+
}).collect(Collectors.toSet());
781785
}
782786

783787
/**
@@ -1632,11 +1636,8 @@ public void setHomeLocation(@Nullable Location home) {
16321636
double z = flags.getNumber("homeZ").doubleValue();
16331637
float yaw = flags.getNumber("homeYaw").floatValue();
16341638
float pitch = flags.getNumber("homePitch").floatValue();
1635-
Location location = new Location(world, x, y, z, yaw, pitch);
1636-
if (!Helper.isAir(location.getBlock().getType(), location.clone().add(0, 1, 0).getBlock().getType())) {
1637-
location.setY(world.getHighestBlockYAt(location) + 1);
1638-
}
1639-
return location;
1639+
1640+
return new Location(world, x, y, z, yaw, pitch);
16401641
}
16411642

16421643
public String getTagLabel(boolean isLeader) {

src/main/java/net/sacredlabyrinth/phaed/simpleclans/ClanPlayer.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ public Long getResignTime(String tag) {
616616
/**
617617
* Sets the resign times (does not update to db)
618618
*/
619-
public void setResignTimes(Map<String, Long> resignTimes) {
619+
public void setResignTimes(@Nullable Map<String, Long> resignTimes) {
620620
if (resignTimes != null) {
621621
final int cooldown = SimpleClans.getInstance().getSettingsManager().getInt(REJOIN_COOLDOWN);
622622
resignTimes.forEach((k, v) -> {
@@ -845,10 +845,7 @@ public void setRank(@Nullable String rank) {
845845
flags.put("rank", rank == null ? "" : rank);
846846
}
847847

848-
public @NotNull Locale getLocale() {
849-
if (locale == null) {
850-
return SimpleClans.getInstance().getSettingsManager().getLanguage();
851-
}
848+
public @Nullable Locale getLocale() {
852849
return locale;
853850
}
854851

0 commit comments

Comments
 (0)