mirror of https://github.com/Minestom/Minestom.git
Merge branch 'master' into new-block-api
This commit is contained in:
commit
06ebb14991
|
@ -14,7 +14,7 @@ application {
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
maven { url "https://repo.minestom.net/repository/maven-public/" }
|
//maven { url "https://repo.minestom.net/repository/maven-public/" }
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
@ -26,7 +26,7 @@ dependencies {
|
||||||
// SLF4J is the base logger for most libraries, therefore we can hook it into log4j2.
|
// SLF4J is the base logger for most libraries, therefore we can hook it into log4j2.
|
||||||
implementation 'org.apache.logging.log4j:log4j-slf4j-impl:2.14.0'
|
implementation 'org.apache.logging.log4j:log4j-slf4j-impl:2.14.0'
|
||||||
// This is the data Minestom uses. from https://github.com/Minestom/MinestomDataGenerator
|
// This is the data Minestom uses. from https://github.com/Minestom/MinestomDataGenerator
|
||||||
implementation "net.minestom:minestom-data-full:${rootProject.properties.get("mcVersion")}"
|
//implementation "net.minestom:minestom-data-full:${rootProject.properties.get("mcVersion")}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -39,18 +39,7 @@ public interface EventListener<T extends Event> {
|
||||||
*/
|
*/
|
||||||
@Contract(pure = true)
|
@Contract(pure = true)
|
||||||
static <T extends Event> @NotNull EventListener<T> of(@NotNull Class<T> eventType, @NotNull Consumer<@NotNull T> listener) {
|
static <T extends Event> @NotNull EventListener<T> of(@NotNull Class<T> eventType, @NotNull Consumer<@NotNull T> listener) {
|
||||||
return new EventListener<>() {
|
return builder(eventType).handler(listener).build();
|
||||||
@Override
|
|
||||||
public @NotNull Class<T> getEventType() {
|
|
||||||
return eventType;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public @NotNull Result run(@NotNull T event) {
|
|
||||||
listener.accept(event);
|
|
||||||
return Result.SUCCESS;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class Builder<T extends Event> {
|
class Builder<T extends Event> {
|
||||||
|
|
|
@ -305,7 +305,9 @@ public final class ConnectionManager {
|
||||||
* or even {@link AsyncPlayerPreLoginEvent}.
|
* or even {@link AsyncPlayerPreLoginEvent}.
|
||||||
*
|
*
|
||||||
* @param playerInitialization the {@link Player} initialization consumer
|
* @param playerInitialization the {@link Player} initialization consumer
|
||||||
|
* @deprecated use the event API instead
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public void addPlayerInitialization(@NotNull Consumer<Player> playerInitialization) {
|
public void addPlayerInitialization(@NotNull Consumer<Player> playerInitialization) {
|
||||||
this.playerInitializations.add(playerInitialization);
|
this.playerInitializations.add(playerInitialization);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue