Skip to content

Commit f5d3aac

Browse files
UbivashkaUbivashka
authored andcommitted
Added velocity support
1 parent da21738 commit f5d3aac

File tree

66 files changed

+1970
-3
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1970
-3
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,7 @@
1414
/core/.classpath
1515
/core/target
1616
/core/.settings
17+
/velocity/.settings
18+
/velocity/.classpath
19+
/velocity/.project
20+
/velocity/target

bukkit/src/main/java/com/ubivashka/vk/bukkit/BukkitVkApiPlugin.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import com.ubivashka.vk.api.VkApiPlugin;
1111
import com.ubivashka.vk.api.config.PluginConfig;
12+
import com.ubivashka.vk.api.listeners.LongpoolAPIListener;
1213
import com.ubivashka.vk.api.parsers.LongpoolEventParser;
1314
import com.ubivashka.vk.api.providers.VkApiProvider;
1415
import com.ubivashka.vk.bukkit.config.BukkitPluginConfig;
@@ -31,6 +32,8 @@ public void onEnable() {
3132
pluginConfig = new BukkitPluginConfig(this);
3233
vkApiProvider = new BukkitVkApiProvider(pluginConfig);
3334

35+
new LongpoolAPIListener<>(this);
36+
3437
Bukkit.getConsoleSender()
3538
.sendMessage("\n\r" + ChatColor.BLUE + " ## ## ## ## ## ####### ##\r\n"
3639
+ ChatColor.BLUE + "/## /##/## ## #### /##////##/##\r\n" + ChatColor.BLUE
@@ -43,16 +46,19 @@ public void onEnable() {
4346

4447
}
4548

49+
@Deprecated
4650
@Override
4751
public GroupActor getActor() {
4852
return vkApiProvider.getActor();
4953
}
5054

55+
@Deprecated
5156
@Override
5257
public VkApiClient getVK() {
5358
return vkApiProvider.getVkApiClient();
5459
}
5560

61+
@Deprecated
5662
@Override
5763
public LongpoolEventParser getLongpoolParser() {
5864
return vkApiProvider.getLongpoolParser();
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.ubivashka.vk.bukkit.events;
2+
3+
import org.bukkit.event.Event;
4+
5+
import com.ubivashka.vk.bukkit.BukkitVkApiPlugin;
6+
import com.ubivashka.vk.event.VkGroupEvent;
7+
8+
public abstract class AbstractVkEvent extends Event implements VkGroupEvent {
9+
private static final BukkitVkApiPlugin PLUGIN = BukkitVkApiPlugin.getPlugin(BukkitVkApiPlugin.class);
10+
private final Integer groupId;
11+
12+
public AbstractVkEvent(Integer groupId) {
13+
this.groupId = groupId;
14+
}
15+
16+
@Override
17+
public int groupId() {
18+
return groupId;
19+
}
20+
21+
public void callEvent() {
22+
PLUGIN.callEvent(this);
23+
}
24+
}

bukkit/src/main/java/com/ubivashka/vk/bukkit/events/VKMessageEditEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public class VKMessageEditEvent extends VKMessageUpdateEvent {
88
private static final HandlerList handlers = new HandlerList();
99

1010
public VKMessageEditEvent(Message message, Integer groupId) {
11-
super(message);
11+
super(message,groupId);
1212
}
1313

1414
public static HandlerList getHandlerList() {

bungee/src/main/java/com/ubivashka/vk/bungee/BungeeVkApiPlugin.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import com.ubivashka.vk.api.VkApiPlugin;
88
import com.ubivashka.vk.api.config.PluginConfig;
9+
import com.ubivashka.vk.api.listeners.LongpoolAPIListener;
910
import com.ubivashka.vk.api.parsers.LongpoolEventParser;
1011
import com.ubivashka.vk.api.providers.VkApiProvider;
1112
import com.ubivashka.vk.bungee.config.BungeePluginConfig;
@@ -32,6 +33,8 @@ public void onEnable() {
3233
pluginConfig = new BungeePluginConfig(this);
3334
vkApiProvider = new BungeeVkApiProvider(pluginConfig);
3435

36+
new LongpoolAPIListener<>(this);
37+
3538
System.out.println("\r\n\r\n" + ChatColor.DARK_AQUA
3639
+ "█████╗█████╗█████╗█████╗█████╗█████╗█████╗\r\n".replaceAll("╗",
3740
ChatColor.AQUA + "╗" + ChatColor.DARK_AQUA)
@@ -48,16 +51,19 @@ public void onEnable() {
4851

4952
}
5053

54+
@Deprecated
5155
@Override
5256
public GroupActor getActor() {
5357
return vkApiProvider.getActor();
5458
}
5559

60+
@Deprecated
5661
@Override
5762
public VkApiClient getVK() {
5863
return vkApiProvider.getVkApiClient();
5964
}
6065

66+
@Deprecated
6167
@Override
6268
public LongpoolEventParser getLongpoolParser() {
6369
return vkApiProvider.getLongpoolParser();
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.ubivashka.vk.bungee.events;
2+
3+
import com.ubivashka.vk.bungee.BungeeVkApiPlugin;
4+
import com.ubivashka.vk.event.VkGroupEvent;
5+
6+
import net.md_5.bungee.api.plugin.Event;
7+
8+
public abstract class AbstractVkEvent extends Event implements VkGroupEvent {
9+
private static final BungeeVkApiPlugin PLUGIN = BungeeVkApiPlugin.getInstance();
10+
private final Integer groupId;
11+
12+
public AbstractVkEvent(Integer groupId) {
13+
this.groupId = groupId;
14+
}
15+
16+
@Override
17+
public int groupId() {
18+
return groupId;
19+
}
20+
21+
public void callEvent() {
22+
PLUGIN.callEvent(this);
23+
}
24+
}

0 commit comments

Comments
 (0)