mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2024-12-28 11:04:21 +00:00
Merge https://github.com/EssentialsX/Essentials into 1.17
This commit is contained in:
commit
01a36b477c
6 changed files with 121 additions and 8 deletions
1
.github/workflows/build-master.yml
vendored
1
.github/workflows/build-master.yml
vendored
|
@ -4,6 +4,7 @@ on:
|
|||
push:
|
||||
branches:
|
||||
- 2.x
|
||||
- dev/*
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
|
1
.github/workflows/build-pr.yml
vendored
1
.github/workflows/build-pr.yml
vendored
|
@ -9,6 +9,7 @@ on:
|
|||
branches:
|
||||
- 2.x
|
||||
- mc/*
|
||||
- dev/*
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
|
|
@ -542,7 +542,7 @@ public class EssentialsPlayerListener implements Listener, FakeAccessor {
|
|||
return;
|
||||
}
|
||||
final User user = ess.getUser(player);
|
||||
if (ess.getSettings().registerBackInListener() && user.isAuthorized("essentials.back.onteleport") && !player.hasMetadata("ess_ignore_teleport")) {
|
||||
if (ess.getSettings().registerBackInListener() && user.isAuthorized("essentials.back.onteleport")) {
|
||||
user.setLastLocation();
|
||||
}
|
||||
if (ess.getSettings().isTeleportInvulnerability()) {
|
||||
|
|
|
@ -0,0 +1,111 @@
|
|||
package net.essentialsx.api.v2.events.discord;
|
||||
|
||||
import net.essentialsx.api.v2.services.discord.InteractionChannel;
|
||||
import net.essentialsx.api.v2.services.discord.InteractionMember;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Fired before a message is relayed to Minecraft.
|
||||
* <p>
|
||||
* Note: This event has no guarantee of the thread it is fired on, please use {@link #isAsynchronous()}} to see if this event is off the main Bukkit thread.
|
||||
*/
|
||||
public class DiscordRelayEvent extends Event implements Cancellable {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
private final InteractionMember member;
|
||||
private final InteractionChannel channel;
|
||||
private final List<String> groupNames;
|
||||
private final String rawMessage;
|
||||
private String formattedMessage;
|
||||
private boolean cancelled = false;
|
||||
|
||||
/**
|
||||
* @param member The member that sent the message.
|
||||
* @param channel The channel the message was sent in.
|
||||
* @param groupNames The message type keys which will be used to determine which player group the message should be sent to.
|
||||
* @param rawMessage The raw message sent from Discord.
|
||||
* @param formattedMessage The formatted message that will be sent to Minecraft.
|
||||
*/
|
||||
public DiscordRelayEvent(final InteractionMember member, final InteractionChannel channel, final List<String> groupNames, final String rawMessage, final String formattedMessage) {
|
||||
super(!Bukkit.isPrimaryThread());
|
||||
this.member = member;
|
||||
this.channel = channel;
|
||||
this.groupNames = groupNames;
|
||||
this.rawMessage = rawMessage;
|
||||
this.formattedMessage = formattedMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the Discord member that sent the message.
|
||||
* @return The member that sent the message.
|
||||
*/
|
||||
public InteractionMember getMember() {
|
||||
return member;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the Discord channel the message was sent in.
|
||||
* @return The channel the message was sent in.
|
||||
*/
|
||||
public InteractionChannel getChannel() {
|
||||
return channel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the message type group keys.
|
||||
* @return The message type group keys.
|
||||
*/
|
||||
public List<String> getGroupNames() {
|
||||
return groupNames;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the raw message sent from Discord.
|
||||
* @return The raw message sent from Discord.
|
||||
*/
|
||||
public String getRawMessage() {
|
||||
return rawMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the formatted message that will be sent to Minecraft.
|
||||
* @return The formatted message.
|
||||
*/
|
||||
public String getFormattedMessage() {
|
||||
return formattedMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the formatted message that will be sent to Minecraft.
|
||||
* @param formattedMessage The formatted message.
|
||||
*/
|
||||
public void setFormattedMessage(final String formattedMessage) {
|
||||
this.formattedMessage = formattedMessage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancelled) {
|
||||
this.cancelled = cancelled;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
}
|
12
README.md
12
README.md
|
@ -26,7 +26,7 @@ EssentialsX is almost a completely drop-in replacement for Essentials. However,
|
|||
|
||||
* **EssentialsX requires Java 8 or higher.** On older versions, the plugin may not work properly.
|
||||
|
||||
* **EssentialsX supports Minecraft versions 1.8.8, 1.9.4, 1.10.2, 1.11.2, 1.12.2, 1.13.2, 1.14.4, 1.15.2, 1.16.5, 1.17.1, and 1.18.1**
|
||||
* **EssentialsX supports Minecraft versions 1.8.8, 1.9.4, 1.10.2, 1.11.2, 1.12.2, 1.13.2, 1.14.4, 1.15.2, 1.16.5, 1.17.1, and 1.18.1.**
|
||||
|
||||
|
||||
Support
|
||||
|
@ -63,11 +63,11 @@ Releases are hosted on the Maven repo at `https://repo.essentialsx.net/releases/
|
|||
|
||||
To add EssentialsX to your build system, you should use the following artifacts:
|
||||
|
||||
| Type | Group ID | Artifact ID | Version |
|
||||
| :-------------- | :-------------- | :---------- | :-------------- |
|
||||
| Latest release | net.essentialsx | EssentialsX | 2.19.0
|
||||
| Snapshots | net.essentialsx | EssentialsX | 2.19.1-SNAPSHOT |
|
||||
| Older releases | net.ess3 | EssentialsX | 2.18.2 |
|
||||
| Type | Group ID | Artifact ID | Version |
|
||||
|:---------------|:----------------|:------------|:----------------|
|
||||
| Latest release | net.essentialsx | EssentialsX | 2.19.2 |
|
||||
| Snapshots | net.essentialsx | EssentialsX | 2.19.3-SNAPSHOT |
|
||||
| Older releases | net.ess3 | EssentialsX | 2.18.2 |
|
||||
|
||||
Note: up until `2.18.2`, EssentialsX used the `net.ess3` group ID, but starting with `2.19.0` snapshots, the group ID is now `net.essentialsx`.
|
||||
When updating your plugin, make sure you use the correct group ID.
|
||||
|
|
|
@ -3,7 +3,7 @@ plugins {
|
|||
}
|
||||
|
||||
group = "net.essentialsx"
|
||||
version = "2.19.1-SNAPSHOT"
|
||||
version = "2.19.3-SNAPSHOT"
|
||||
|
||||
project.ext {
|
||||
GIT_COMMIT = !indraGit.isPresent() ? "unknown" : indraGit.commit().abbreviate(7).name()
|
||||
|
|
Loading…
Reference in a new issue