Skip to content
This repository was archived by the owner on Aug 13, 2022. It is now read-only.

Commit 6cd8b68

Browse files
authored
1.18.1 changes (#49)
* optimized imports * changed base directory * fixed 1.18 dependency not working correctly * disabled WorldEdit flag if FAWE is present * added collision flag * removed debug messages * updated gradle wrapper * updated CI Java version and distribution to 17 Zulu * changed version schema * changes to the bug report template * Updated files * re-added support for 1.17 * changed url in checklist * Update gradle to v7.3.3 * updated spigradle to v2.3.3 * downgraded back to java 16 * updated example version * Disable Block patch option * added the ability to disable the patch for allow/deny block place/break flags * removed FAWEManager * removed FAWE Dependency * #51: PAPI support suffix/prefix * added missing dependency * spigradle fix * updated README.md * updated build scripts * simplify expressions * updated to 1.18.1 * fix an issue that causes chat to not change for OP users * removed annotation * some small changes in fly flag * downgraded spigradle back to v2.2.4
1 parent c060e8e commit 6cd8b68

File tree

28 files changed

+304
-330
lines changed

28 files changed

+304
-330
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ body:
2929
multiple: false
3030
options:
3131
- '1.17.1'
32-
- '1.17'
32+
- '1.18.1'
3333
validations:
3434
required: true
3535

@@ -73,7 +73,7 @@ body:
7373
attributes:
7474
label: WGEF-Reborn version
7575
description: What version of WGEF-Reborn are you running? (`/version WGEF-REBORN`)
76-
placeholder: "For example: WGEF-REBORN version 2.0.0"
76+
placeholder: "For example: WGEF-REBORN version 2.2-beta-f2c5e86"
7777
validations:
7878
required: true
7979

@@ -82,9 +82,9 @@ body:
8282
label: Checklist
8383
description: Make sure you have followed each of the steps outlined here.
8484
options:
85-
- label: I'm using java 16+ and running my server in 1.17.1+
85+
- label: I'm using java 16+ and running my server in 1.17+
8686
required: true
87-
- label: I am using the newest build from https://github.com/Invvk/WorldGuardExtraFlagsPlugin/releases and the issue still persists.
87+
- label: I am using the newest build from https://www.spigotmc.org/resources/96894/ and the issue still persists.
8888
required: true
8989

9090
- type: textarea

.github/workflows/gradle.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ jobs:
1717
uses: actions/setup-java@v2
1818
with:
1919
java-version: '16'
20-
distribution: 'adopt'
20+
distribution: 'zulu'
2121
cache: gradle
2222
- name: Grant execute permission for gradlew
2323
run: chmod +x gradlew
2424
- name: Build with Gradle
25-
run: ./gradlew -Pbase117=jarFile build
25+
run: ./gradlew -Pbase118=jarFile build

README.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,29 @@
1-
# WorldGuardExtraFlags Reborn
1+
<div align="center">
2+
<h1> WorldGuard Extra Flags </h1>
23

3-
ORIGINAL: https://github.com/aromaa/WorldGuardExtraFlagsPlugin
4+
[![Discord](https://discordapp.com/api/guilds/892834164448063489/widget.png?style=shield)](https://discord.gg/xcFJvXYsnD) [![BStats](https://img.shields.io/bstats/servers/13119)](https://bstats.org/plugin/bukkit/WGEF-Reborn/13119)
45

5-
Spigot page: https://www.spigotmc.org/resources/beta-worldgaurdextraflags-reborn.96894/
6+
<a ref="https://github.com/aromaa/WorldGuardExtraFlagsPlugin">ORIGINAL</a> |
7+
<a ref="https://www.spigotmc.org/resources/96894/">SPIGOT PAGE</a> |
8+
<a ref="https://github.com/Invvk/WorldGuardExtraFlags/wiki">WIKI</a> |
9+
<a ref="https://github.com/Invvk/WorldGuardExtraFlags/wiki/FAQ">FAQ</a>
10+
11+
<h2>Discription</h2>
12+
<p>WGEF is an extension to WorldGuard plugin, originally developed by aromaa. it offers variety of new features and flags.</p>
13+
14+
<h2>System requirements</h2>
15+
<p>This plugin runs on spigot. Spigot forks without compiled NMS code are not supported. Officially supported servers are spigot and paper 1.17+. It is recommended to use Java 16+.</p>
16+
17+
<h2>Community Servers</h2>
18+
<p>Servers that uses this plugin (contact me in discord to add your server): </p>
19+
- currently no servers wants to be listed :(
20+
21+
<h2>Contributing</h2>
22+
<p>To contribute to this project, please make sure that you read <a href="https://github.com/Invvk/WorldGuardExtraFlags/blob/main/CODE_OF_CONDUCT.md"> CODE OF CONDUCT</a> first and follow all the rules there.</p>
23+
<p>After you finish follow the <a href="https://github.com/Invvk/WorldGuardExtraFlags/blob/main/CONTRIBUTING.md">Contributing</a> page and make sure that you meet the requirement in order for your contribution to be accepted.</p>
24+
<p>Remember that by contributing, your changes will be also under the <a href="https://github.com/Invvk/WorldGuardExtraFlags/blob/main/LICENSE">MIT License</a>. if you don't agree with the MIT license, then please don't contribute!</p>
25+
26+
<h2>Contact</h2>
27+
28+
[![Discord Server](https://discordapp.com/api/guilds/892834164448063489/widget.png?style=banner3)](https://discord.gg/xcFJvXYsnD)
29+
</div>

WG7/src/main/java/io/github/invvk/wgef/v7/worldedit/fawe/FAWEManager.java

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

WGEF-Abstraction/src/main/java/io/github/invvk/wgef/abstraction/IManager.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package io.github.invvk.wgef.abstraction;
22

33
import io.github.invvk.wgef.abstraction.dependencies.IEssentialsDependency;
4-
import io.github.invvk.wgef.abstraction.dependencies.IFAWEDependency;
54

65
import java.util.Optional;
76

@@ -16,6 +15,5 @@ public interface IManager {
1615
IWGFork getFork();
1716

1817
Optional<IEssentialsDependency> getEssentials();
19-
Optional<IFAWEDependency> getFAWE();
2018

2119
}

WGEF-Abstraction/src/main/java/io/github/invvk/wgef/abstraction/WGEFUtils.java

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,11 @@ public static StateFlag.State queryState(Player player, World world, Set<Protect
5555
}
5656

5757
public static <T> T queryValue(Player player, World world, Set<ProtectedRegion> regions, Flag<T> flag) {
58-
return WGEFUtils.createFlagValueCalculator(player, world, regions, flag)
59-
.queryValue(WGEFUtils.wrapPlayer(player), flag);
58+
return WGEFUtils.createFlagValueCalculator(player, world, regions, flag).queryValue(WGEFUtils.wrapPlayer(player), flag);
6059
}
6160

6261
public static <T> T queryValueUnchecked(Player player, World world, Set<ProtectedRegion> regions, Flag<T> flag) {
63-
return WGEFUtils.createFlagValueCalculator(player, world, regions, flag).queryValue(WGEFUtils.wrapPlayer(player), flag);
62+
return WGEFUtils.createFlagValueCalculatorUnchecked(world, regions, flag).queryValue(WGEFUtils.wrapPlayer(player), flag);
6463
}
6564

6665
public static <T> FlagValueCalculator createFlagValueCalculator(Player player, World world, Set<ProtectedRegion> regions, Flag<T> flag) {
@@ -82,6 +81,12 @@ public static <T> FlagValueCalculator createFlagValueCalculator(Player player, W
8281
return new FlagValueCalculator(checkForRegions, global);
8382
}
8483

84+
public static <T> FlagValueCalculator createFlagValueCalculatorUnchecked(World world, Set<ProtectedRegion> regions, Flag<T> flag) {
85+
final List<ProtectedRegion> checkForRegions = List.copyOf(regions);
86+
ProtectedRegion global = WGEFUtils.getFork().getRegionContainer().get(world).getRegion(ProtectedRegion.GLOBAL_REGION);
87+
return new FlagValueCalculator(checkForRegions, global);
88+
}
89+
8590
public static boolean isDeny(StateFlag.State state) {
8691
return state == StateFlag.State.DENY;
8792
}
@@ -95,4 +100,13 @@ public static boolean isFAWEPresent() {
95100
return true;
96101
}
97102

103+
public static boolean isPAPIPresent() {
104+
try {
105+
Class.forName("me.clip.placeholderapi.PlaceholderAPI");
106+
} catch (ClassNotFoundException e) {
107+
return false;
108+
}
109+
return true;
110+
}
111+
98112
}

WGEF-Abstraction/src/main/java/io/github/invvk/wgef/abstraction/dependencies/IFAWEDependency.java

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

WGEF-Abstraction/src/main/java/io/github/invvk/wgef/abstraction/flags/WGEFlags.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ public final class WGEFlags {
6464
public final static SetFlag<EntityType> ALLOW_ENTITY_PLACE = new SetFlag<EntityType>("allow-entity-place", new EntityTypeFlag(null));
6565
public final static SetFlag<EntityType> DENY_ENTITY_PLACE = new SetFlag<EntityType>("deny-entity-place", new EntityTypeFlag(null));
6666

67+
public final static BooleanFlag DISABLE_COLLISION = new BooleanFlag("disable-collision");
68+
6769
public static Set<Flag<?>> values() {
6870
return Arrays.stream(WGEFlags.class.getFields())
6971
.map(field -> {
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
package io.github.invvk.wgef.abstraction.flags.handler;
2+
3+
import org.bukkit.entity.Player;
4+
import org.bukkit.scoreboard.Scoreboard;
5+
import org.bukkit.scoreboard.Team;
6+
7+
public final class CollisionTeamHandler {
8+
9+
public static final String TEAM_NAME = "WGEF_NO_COLLISION";
10+
11+
private Team team;
12+
13+
private final Player player;
14+
private boolean contains;
15+
16+
public CollisionTeamHandler(Player player) {
17+
this.player = player;
18+
}
19+
20+
public void checkTeam() {
21+
final Scoreboard scoreboard = this.getScoreboard();
22+
this.team = scoreboard.getTeam(TEAM_NAME);
23+
if (this.team == null) {
24+
this.team = scoreboard.registerNewTeam(TEAM_NAME);
25+
}
26+
this.team.setOption(Team.Option.COLLISION_RULE, Team.OptionStatus.NEVER);
27+
}
28+
29+
public void add() {
30+
this.checkTeam();
31+
if (!this.team.hasEntry(player.getName()))
32+
this.team.addEntry(player.getName());
33+
this.contains = true;
34+
}
35+
36+
public void remove() {
37+
this.checkTeam();
38+
if (this.team.hasEntry(player.getName()))
39+
this.team.removeEntry(player.getName());
40+
41+
this.contains = false;
42+
}
43+
44+
public boolean isContains() {
45+
return contains;
46+
}
47+
48+
public Scoreboard getScoreboard() {
49+
return player.getScoreboard();
50+
}
51+
52+
}

0 commit comments

Comments
 (0)