Skip to content

Commit 302769d

Browse files
committed
release commit
1 parent ab17ef0 commit 302769d

File tree

5 files changed

+54
-64
lines changed

5 files changed

+54
-64
lines changed

.github/workflows/main.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Build DEV Jars
2+
3+
on:
4+
pull_request:
5+
paths-ignore:
6+
- '.github/PULL_REQUEST_TEMPLATE.md'
7+
- '.gitignore'
8+
- 'LICENSE'
9+
- 'CODE_OF_CONDUCT.md'
10+
- 'CONTRIBUTING.md'
11+
- 'README.md'
12+
push:
13+
paths-ignore:
14+
- '.github/PULL_REQUEST_TEMPLATE.md'
15+
- '.gitignore'
16+
- 'LICENSE'
17+
- 'CODE_OF_CONDUCT.md'
18+
- 'CONTRIBUTING.md'
19+
- 'README.md'
20+
21+
jobs:
22+
build_dev_jars:
23+
name: Build DEV jars
24+
runs-on: ubuntu-latest
25+
permissions: write-all
26+
steps:
27+
- uses: actions/checkout@v2
28+
with:
29+
fetch-depth: 0
30+
- name: Setup JDK
31+
uses: actions/setup-java@v4
32+
with:
33+
java-version: '17'
34+
distribution: 'temurin'
35+
cache: maven
36+
- name: Build
37+
run: |
38+
mvn -B package --file pom.xml
39+
git_hash=$(git rev-parse --short "$GITHUB_SHA")
40+
echo "git_hash=$git_hash" >> $GITHUB_ENV
41+
echo "snapshotVersion=5.5-SNAPSHOT" >> $GITHUB_ENV
42+
echo "artifactPath=$(pwd)/builds" >> $GITHUB_ENV

Readme.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
# WorldGuard Events
22

3-
## This project is abandoned.
4-
It has still been tested to work on every version from 1.15 to 1.20.5, and will probably work for the forseeable future, but no update or fix will be made.
5-
6-
You are very welcome to fork it, or to take over the repo if you are serious enough.
7-
8-
## For server admins
9-
10-
This plugin may be required by some other plugins. If so, simply drop the JAR in the **plugins** folder of your server, reload it, and you're set.
11-
12-
It doesn't do anything on its own and is useless unless required by another plugin.
3+
Version modifiée de [Webbeh/WorldGuard-Events](https://github.com/Webbeh/WorldGuard-Events) pour OpenMC
134

145
## For developers
156
### Events

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
<artifactId>maven-compiler-plugin</artifactId>
5252
<version>3.5.1</version>
5353
<configuration>
54-
<source>1.8</source>
55-
<target>1.8</target>
54+
<source>21</source>
55+
<target>21</target>
5656
</configuration>
5757
</plugin>
5858

src/main/java/net/raidstone/wgevents/WorldGuardEvents.java

Lines changed: 9 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
import com.sk89q.worldguard.protection.regions.RegionQuery;
99
import org.bukkit.Bukkit;
1010
import org.bukkit.entity.Player;
11+
import org.bukkit.event.EventHandler;
1112
import org.bukkit.event.Listener;
12-
import org.bukkit.plugin.Plugin;
13-
import org.bukkit.plugin.PluginManager;
13+
import org.bukkit.event.server.PluginDisableEvent;
1414
import org.bukkit.plugin.java.JavaPlugin;
1515

1616
import javax.annotation.Nonnull;
@@ -19,58 +19,22 @@
1919
import java.util.HashSet;
2020
import java.util.Set;
2121
import java.util.UUID;
22-
import java.util.logging.Logger;
2322
import java.util.stream.Collectors;
2423
/**
2524
* @author Weby &amp; Anrza ([email protected])
2625
* @since 2/24/19
2726
*/
28-
public class WorldGuardEvents extends JavaPlugin implements Listener {
27+
public class WorldGuardEvents implements Listener {
2928
static RegionContainer container;
30-
31-
// Listeners listeners = null;
32-
public void onEnable() {
33-
Logger log = Bukkit.getLogger();
34-
PluginManager pm = Bukkit.getPluginManager();
35-
Plugin p = Bukkit.getPluginManager().getPlugin("WorldGuard");
36-
37-
if (p == null) {
38-
log.severe("[WorldGuardEvents] WorldGuard wasn't found. Disabling WorldGuardEvents.");
39-
pm.disablePlugin(this);
40-
return;
41-
}
42-
43-
String version = WorldGuard.getVersion();
44-
45-
if (version.isEmpty()) {
46-
log.severe("[WorldGuardEvents] WorldGuard's version not detected. Are you sure it's installed properly ?");
47-
log.severe("[WorldGuardEvents] Disabling WorldGuardEvents.");
48-
49-
pm.disablePlugin(this);
50-
return;
51-
}
52-
53-
if (!version.startsWith("7.")) {
54-
log.warning("[WorldGuardEvents] Detected WorldGuard version \"" + version + "\".");
55-
log.warning("[WorldGuardEvents] This plugin is meant to work with WorldGuard version \"7.0.0\" or higher,");
56-
log.warning("[WorldGuardEvents] and may not work properly with any other major revision.");
57-
log.warning("[WorldGuardEvents] Please update WorldGuard if your version is below \"7.0.0\" or wait for");
58-
log.warning("[WorldGuardEvents] an update of WorldGuardEvents to support WorldGuard "+version+".");
59-
}
60-
61-
if (!WorldGuard.getInstance().getPlatform().getSessionManager().registerHandler(Entry.factory, null)) {
62-
log.severe("[WorldGuardEvents] Could not register the entry handler !");
63-
log.severe("[WorldGuardEvents] Please report this error. The plugin will now be disabled.");
64-
65-
pm.disablePlugin(this);
66-
return;
67-
}
68-
29+
30+
public void enable(JavaPlugin plugin) {
6931
container = WorldGuard.getInstance().getPlatform().getRegionContainer();
32+
WorldGuard.getInstance().getPlatform().getSessionManager().registerHandler(Entry.factory, null);
33+
plugin.getServer().getPluginManager().registerEvents(this, plugin);
7034
}
7135

72-
@Override
73-
public void onDisable()
36+
@EventHandler
37+
public void onDisable(PluginDisableEvent event)
7438
{
7539
container = null;
7640
}

src/main/resources/plugin.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)