Skip to content

Commit ef3f4e4

Browse files
committed
Fix example build
1 parent 5f6e597 commit ef3f4e4

5 files changed

Lines changed: 10 additions & 8 deletions

File tree

examples/velocity/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@ sourceSets.test {
4343
}
4444

4545
tasks.runVelocity {
46-
velocityVersion("1.21.11")
46+
velocityVersion("${Versions.VELOCITY_API}")
4747
}

examples/velocity/src/main/java/com/eternalcode/example/ExampleVelocityPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public ExampleVelocityPlugin(ProxyServer server, @DataDirectory Path dataDirecto
4141
@Subscribe
4242
void onProxyInitialize(ProxyInitializeEvent event) {
4343
MessagesConfig messagesConfig = new MessagesConfig();
44-
ExampleMultification multification = new ExampleMultification((Plugin) this, this.server, messagesConfig);
44+
ExampleMultification multification = new ExampleMultification(this, this.server, messagesConfig);
4545

4646
ConfigurationManager configurationManager = new ConfigurationManager(this.dataDirectory.toFile(),
4747
multification.getNoticeRegistry());

examples/velocity/src/main/java/com/eternalcode/example/PlayerConnectListener.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ public PlayerConnectListener(ExampleMultification multification) {
1414

1515
@Subscribe
1616
void onPlayerConnect(ServerConnectedEvent event) {
17-
this.multification.all(messagesConfig -> messagesConfig.joinedTheServer);
17+
this.multification.create()
18+
.all()
19+
.notice(messagesConfig -> messagesConfig.joinedTheServer)
20+
.placeholder("<server>", event.getServer().getServerInfo().getName())
21+
.send();
1822
}
1923

2024
}

examples/velocity/src/main/java/com/eternalcode/example/notice/ExampleMultification.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import com.eternalcode.multification.translation.TranslationProvider;
77
import com.eternalcode.multification.velocity.VelocityMultification;
88
import com.velocitypowered.api.command.CommandSource;
9-
import com.velocitypowered.api.plugin.Plugin;
109
import com.velocitypowered.api.proxy.ProxyServer;
1110
import net.kyori.adventure.text.Component;
1211
import net.kyori.adventure.text.minimessage.MiniMessage;
@@ -18,7 +17,7 @@ public class ExampleMultification extends VelocityMultification<MessagesConfig>
1817
private final MessagesConfig messagesConfig;
1918
private final MiniMessage miniMessage;
2019

21-
public ExampleMultification(Plugin plugin, ProxyServer server, MessagesConfig messagesConfig) {
20+
public ExampleMultification(Object plugin, ProxyServer server, MessagesConfig messagesConfig) {
2221
super(server, plugin);
2322
this.messagesConfig = messagesConfig;
2423
this.miniMessage = MiniMessage.miniMessage();

multification-velocity/src/com/eternalcode/multification/velocity/VelocityMultification.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import com.eternalcode.multification.locate.LocaleProvider;
66
import com.eternalcode.multification.viewer.ViewerProvider;
77
import com.velocitypowered.api.command.CommandSource;
8-
import com.velocitypowered.api.plugin.Plugin;
98
import com.velocitypowered.api.proxy.ProxyServer;
109
import org.jetbrains.annotations.NotNull;
1110

@@ -14,10 +13,10 @@ public abstract class VelocityMultification<TRANSLATION> extends Multification<C
1413
public static final LocaleProvider<CommandSource> DEFAULT_LOCALE_PROVIDER = new VelocityLocaleProvider();
1514

1615
private final ProxyServer server;
17-
private final Plugin plugin;
16+
private final Object plugin;
1817
private final ViewerProvider<CommandSource> defaultViewerProvider;
1918

20-
protected VelocityMultification(ProxyServer server, Plugin plugin) {
19+
protected VelocityMultification(ProxyServer server, Object plugin) {
2120
super();
2221
this.server = server;
2322
this.plugin = plugin;

0 commit comments

Comments
 (0)