Compare commits

..

3 Commits

Author SHA1 Message Date
626b5fc866 Update build.yml 2023-01-15 20:29:33 +01:00
f0b4d9b103 Build on macos only 2023-01-15 18:54:50 +01:00
2c8331e82e Debug shadowJar 2023-01-15 18:40:05 +01:00
2 changed files with 19 additions and 86 deletions

View File

@ -3,12 +3,12 @@ name: build
on: on:
push: push:
branches: branches:
- v6 - shadow-debug
jobs: jobs:
build: build:
if: github.repository_owner == 'IntellectualSites' if: github.repository_owner == 'IntellectualSites'
runs-on: ubuntu-latest runs-on: macos-latest
steps: steps:
- name: Checkout Repository - name: Checkout Repository
uses: actions/checkout@v3 uses: actions/checkout@v3
@ -19,51 +19,5 @@ jobs:
with: with:
distribution: temurin distribution: temurin
java-version: 17 java-version: 17
- name: Clean Build - name: Build on macos-latest
run: ./gradlew clean build run: ./gradlew clean build --warning-mode all
- name: Determine release status
if: ${{ runner.os == 'Linux' }}
run: |
if [ "$(./gradlew properties | awk '/^version:/ { print $2; }' | grep '\-SNAPSHOT')" ]; then
echo "STATUS=snapshot" >> $GITHUB_ENV
else
echo "STATUS=release" >> $GITHUB_ENV
fi
- name: Publish Release
if: ${{ runner.os == 'Linux' && env.STATUS == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/v6'}}
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
env:
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
- name: Publish Snapshot
if: ${{ runner.os == 'Linux' && env.STATUS != 'release' && github.event_name == 'push' && github.ref == 'refs/heads/v6' }}
run: ./gradlew publishToSonatype
env:
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
- name: Publish core javadoc
if: ${{ runner.os == 'Linux' && env.STATUS == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/v6'}}
uses: cpina/github-action-push-to-another-repository@main
env:
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
with:
source-directory: 'Core/build/docs/javadoc'
destination-github-username: 'IntellectualSites'
destination-repository-name: 'plotsquared-javadocs'
user-email: ${{ secrets.USER_EMAIL }}
target-branch: main
target-directory: core
- name: Publish bukkit javadoc
if: ${{ runner.os == 'Linux' && env.STATUS == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/v6'}}
uses: cpina/github-action-push-to-another-repository@main
env:
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
with:
source-directory: 'Bukkit/build/docs/javadoc'
destination-github-username: 'IntellectualSites'
destination-repository-name: 'plotsquared-javadocs'
user-email: ${{ secrets.USER_EMAIL }}
target-branch: main
target-directory: bukkit

View File

@ -220,6 +220,17 @@ public final class PlotModificationManager {
if (isDelete) { if (isDelete) {
this.removeSign(); this.removeSign();
} }
PlotUnlinkEvent event = PlotSquared.get().getEventDispatcher()
.callUnlink(
this.plot.getArea(),
this.plot,
true,
!isDelete,
isDelete ? PlotUnlinkEvent.REASON.DELETE : PlotUnlinkEvent.REASON.CLEAR
);
if (event.getEventResult() != Result.DENY && this.unlinkPlot(event.isCreateRoad(), event.isCreateSign())) {
PlotSquared.get().getEventDispatcher().callPostUnlink(plot, event.getReason());
}
final PlotManager manager = this.plot.getArea().getPlotManager(); final PlotManager manager = this.plot.getArea().getPlotManager();
Runnable run = new Runnable() { Runnable run = new Runnable() {
@Override @Override
@ -270,21 +281,7 @@ public final class PlotModificationManager {
manager.clearPlot(current, this, actor, null); manager.clearPlot(current, this, actor, null);
} }
}; };
PlotUnlinkEvent event = PlotSquared.get().getEventDispatcher() run.run();
.callUnlink(
this.plot.getArea(),
this.plot,
true,
!isDelete,
isDelete ? PlotUnlinkEvent.REASON.DELETE : PlotUnlinkEvent.REASON.CLEAR
);
if (event.getEventResult() != Result.DENY) {
if (this.unlinkPlot(event.isCreateRoad(), event.isCreateSign(), run)) {
PlotSquared.get().getEventDispatcher().callPostUnlink(plot, event.getReason());
}
} else {
run.run();
}
return true; return true;
} }
@ -324,22 +321,7 @@ public final class PlotModificationManager {
* @return success/!cancelled * @return success/!cancelled
*/ */
public boolean unlinkPlot(final boolean createRoad, final boolean createSign) { public boolean unlinkPlot(final boolean createRoad, final boolean createSign) {
return unlinkPlot(createRoad, createSign, null);
}
/**
* Unlink the plot and all connected plots.
*
* @param createRoad whether to recreate road
* @param createSign whether to recreate signs
* @param whenDone Task to run when unlink is complete
* @return success/!cancelled
*/
public boolean unlinkPlot(final boolean createRoad, final boolean createSign, final Runnable whenDone) {
if (!this.plot.isMerged()) { if (!this.plot.isMerged()) {
if (whenDone != null) {
whenDone.run();
}
return false; return false;
} }
final Set<Plot> plots = this.plot.getConnectedPlots(); final Set<Plot> plots = this.plot.getConnectedPlots();
@ -384,17 +366,14 @@ public final class PlotModificationManager {
current.getPlotModificationManager().setSign(PlayerManager.resolveName(current.getOwnerAbs()).getComponent( current.getPlotModificationManager().setSign(PlayerManager.resolveName(current.getOwnerAbs()).getComponent(
LocaleHolder.console())); LocaleHolder.console()));
} }
if (whenDone != null) {
TaskManager.runTask(whenDone);
}
})); }));
} else if (whenDone != null) {
queue.setCompleteTask(whenDone);
} }
if (createRoad) { if (createRoad) {
manager.finishPlotUnlink(ids, queue); manager.finishPlotUnlink(ids, queue);
} }
queue.enqueue(); if (queue != null) {
queue.enqueue();
}
return true; return true;
} }