Skip to content

Commit c1455e2

Browse files
committed
Fix conflicts
1 parent 5045dec commit c1455e2

File tree

6 files changed

+252
-19
lines changed

6 files changed

+252
-19
lines changed

bukkit-example/src/main/java/com/lunarclient/apollo/example/ApolloExamplePlugin.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
import com.lunarclient.apollo.example.api.examples.VignetteApiExample;
5050
import com.lunarclient.apollo.example.api.examples.WaypointApiExample;
5151
import com.lunarclient.apollo.example.api.listeners.ApolloPlayerApiListener;
52+
import com.lunarclient.apollo.example.commands.EVNTCommand;
5253
import com.lunarclient.apollo.example.common.commands.SwitchCommand;
5354
import com.lunarclient.apollo.example.common.commands.debug.ApolloDebugCommand;
5455
import com.lunarclient.apollo.example.common.commands.module.BeamCommand;
@@ -83,6 +84,7 @@
8384
import com.lunarclient.apollo.example.common.modules.impl.ColoredFireExample;
8485
import com.lunarclient.apollo.example.common.modules.impl.CombatExample;
8586
import com.lunarclient.apollo.example.common.modules.impl.CooldownExample;
87+
import com.lunarclient.apollo.example.common.modules.impl.EVNTExample;
8688
import com.lunarclient.apollo.example.common.modules.impl.EntityExample;
8789
import com.lunarclient.apollo.example.common.modules.impl.GlowExample;
8890
import com.lunarclient.apollo.example.common.modules.impl.HologramExample;
@@ -109,6 +111,7 @@
109111
import com.lunarclient.apollo.example.json.examples.ColoredFireJsonExample;
110112
import com.lunarclient.apollo.example.json.examples.CombatJsonExample;
111113
import com.lunarclient.apollo.example.json.examples.CooldownJsonExample;
114+
import com.lunarclient.apollo.example.json.examples.EVNTJsonExample;
112115
import com.lunarclient.apollo.example.json.examples.EntityJsonExample;
113116
import com.lunarclient.apollo.example.json.examples.GlowJsonExample;
114117
import com.lunarclient.apollo.example.json.examples.HologramJsonExample;
@@ -129,12 +132,14 @@
129132
import com.lunarclient.apollo.example.json.examples.VignetteJsonExample;
130133
import com.lunarclient.apollo.example.json.examples.WaypointJsonExample;
131134
import com.lunarclient.apollo.example.json.listeners.ApolloPlayerJsonListener;
135+
import com.lunarclient.apollo.example.modules.EVNTApiExample;
132136
import com.lunarclient.apollo.example.proto.examples.BeamProtoExample;
133137
import com.lunarclient.apollo.example.proto.examples.BorderProtoExample;
134138
import com.lunarclient.apollo.example.proto.examples.ChatProtoExample;
135139
import com.lunarclient.apollo.example.proto.examples.ColoredFireProtoExample;
136140
import com.lunarclient.apollo.example.proto.examples.CombatProtoExample;
137141
import com.lunarclient.apollo.example.proto.examples.CooldownProtoExample;
142+
import com.lunarclient.apollo.example.proto.examples.EVNTProtoExample;
138143
import com.lunarclient.apollo.example.proto.examples.EntityProtoExample;
139144
import com.lunarclient.apollo.example.proto.examples.GlowProtoExample;
140145
import com.lunarclient.apollo.example.proto.examples.HologramProtoExample;
@@ -177,6 +182,7 @@ public class ApolloExamplePlugin extends JavaPlugin {
177182
private CombatExample combatExample;
178183
private CooldownExample cooldownExample;
179184
private EntityExample entityExample;
185+
private EVNTExample evntExample;
180186
private GlowExample glowExample;
181187
private HologramExample hologramExample;
182188
private LimbExample limbExample;
@@ -222,6 +228,7 @@ private void registerCommands() {
222228
this.getCommand("combat").setExecutor(new CombatCommand());
223229
this.getCommand("cooldown").setExecutor(new CooldownCommand());
224230
this.getCommand("entity").setExecutor(new EntityCommand());
231+
this.getCommand("evnt").setExecutor(new EVNTCommand());
225232
this.getCommand("glow").setExecutor(new GlowCommand());
226233
this.getCommand("hologram").setExecutor(new HologramCommand());
227234
this.getCommand("limb").setExecutor(new LimbCommand());
@@ -276,6 +283,7 @@ private void registerModuleExamples() {
276283
this.combatExample = new CombatApiExample();
277284
this.cooldownExample = new CooldownApiExample();
278285
this.entityExample = new EntityApiExample();
286+
this.evntExample = new EVNTApiExample();
279287
this.glowExample = new GlowApiExample();
280288
this.hologramExample = new HologramApiExample();
281289
this.limbExample = new LimbApiExample();
@@ -305,6 +313,7 @@ private void registerModuleExamples() {
305313
this.combatExample = new CombatJsonExample();
306314
this.cooldownExample = new CooldownJsonExample();
307315
this.entityExample = new EntityJsonExample();
316+
this.evntExample = new EVNTJsonExample();
308317
this.glowExample = new GlowJsonExample();
309318
this.hologramExample = new HologramJsonExample();
310319
this.limbExample = new LimbJsonExample();
@@ -334,6 +343,7 @@ private void registerModuleExamples() {
334343
this.combatExample = new CombatProtoExample();
335344
this.cooldownExample = new CooldownProtoExample();
336345
this.entityExample = new EntityProtoExample();
346+
this.evntExample = new EVNTProtoExample();
337347
this.glowExample = new GlowProtoExample();
338348
this.hologramExample = new HologramProtoExample();
339349
this.limbExample = new LimbProtoExample();

bukkit-example/src/main/java/com/lunarclient/apollo/example/api/examples/EVNTExample.java renamed to bukkit-example/src/main/java/com/lunarclient/apollo/example/api/examples/EVNTApiExample.java

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
import com.google.common.collect.Sets;
2727
import com.lunarclient.apollo.Apollo;
28+
import com.lunarclient.apollo.example.common.modules.impl.EVNTExample;
2829
import com.lunarclient.apollo.module.evnt.Character;
2930
import com.lunarclient.apollo.module.evnt.CharacterAbility;
3031
import com.lunarclient.apollo.module.evnt.CharacterResource;
@@ -37,22 +38,22 @@
3738
import com.lunarclient.apollo.module.evnt.event.EventTeam;
3839
import com.lunarclient.apollo.player.ApolloPlayer;
3940
import com.lunarclient.apollo.recipients.Recipients;
40-
import net.kyori.adventure.text.Component;
41-
import net.kyori.adventure.text.format.NamedTextColor;
42-
import org.bukkit.entity.Player;
43-
44-
import java.awt.*;
41+
import java.awt.Color;
4542
import java.util.Collections;
4643
import java.util.List;
4744
import java.util.Optional;
4845
import java.util.Set;
4946
import java.util.UUID;
5047
import java.util.concurrent.ThreadLocalRandom;
48+
import net.kyori.adventure.text.Component;
49+
import net.kyori.adventure.text.format.NamedTextColor;
50+
import org.bukkit.entity.Player;
5151

52-
public class EVNTExample {
52+
public class EVNTApiExample extends EVNTExample {
5353

5454
private final EVNTModule evntModule = Apollo.getModuleManager().getModule(EVNTModule.class);
5555

56+
@Override
5657
public void overrideHeartTextureExample(Player viewer) {
5758
Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());
5859

@@ -65,11 +66,13 @@ public void overrideHeartTextureExample(Player viewer) {
6566
});
6667
}
6768

69+
@Override
6870
public void resetHeartTextureExample(Player viewer) {
6971
Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());
7072
apolloPlayerOpt.ifPresent(this.evntModule::resetHeartTexture);
7173
}
7274

75+
@Override
7376
public void openGuiExample(Player viewer) {
7477
Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());
7578

@@ -81,11 +84,13 @@ public void openGuiExample(Player viewer) {
8184
});
8285
}
8386

87+
@Override
8488
public void closeGuiExample(Player viewer) {
8589
Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());
8690
apolloPlayerOpt.ifPresent(this.evntModule::closeGui);
8791
}
8892

93+
@Override
8994
public void overrideCharacterExample(Player viewer) {
9095
Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());
9196

@@ -99,6 +104,7 @@ public void overrideCharacterExample(Player viewer) {
99104
});
100105
}
101106

107+
@Override
102108
public void overrideCharacterAbilityExample(Player viewer) {
103109
Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());
104110

@@ -116,6 +122,7 @@ public void overrideCharacterAbilityExample(Player viewer) {
116122
});
117123
}
118124

125+
@Override
119126
public void overrideCharacterCosmeticExample(Player viewer) {
120127
Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());
121128

@@ -124,6 +131,7 @@ public void overrideCharacterCosmeticExample(Player viewer) {
124131
});
125132
}
126133

134+
@Override
127135
public void overrideCharacterResources(Player viewer) {
128136
Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());
129137

@@ -141,6 +149,7 @@ public void overrideCharacterResources(Player viewer) {
141149
});
142150
}
143151

152+
@Override
144153
public void updateGameOverviewExample() {
145154
EventTeam teamOne = EventTeam.builder()
146155
.bottomCrystalHealth(1.0F)
@@ -159,6 +168,7 @@ public void updateGameOverviewExample() {
159168
this.evntModule.updateGameOverview(Recipients.ofEveryone(), eventGame);
160169
}
161170

171+
@Override
162172
public void updateStatusOverviewExample() {
163173
Set<EventPlayer> teamOne = Sets.newHashSet(
164174
EventPlayer.builder()

bukkit-example/src/main/java/com/lunarclient/apollo/example/common/commands/module/EVNTCommand.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
package com.lunarclient.apollo.example.commands;
2525

2626
import com.lunarclient.apollo.example.ApolloExamplePlugin;
27-
import com.lunarclient.apollo.example.modules.EVNTExample;
27+
import com.lunarclient.apollo.example.common.modules.impl.EVNTExample;
2828
import org.bukkit.command.Command;
2929
import org.bukkit.command.CommandExecutor;
3030
import org.bukkit.command.CommandSender;
@@ -33,8 +33,6 @@
3333

3434
public class EVNTCommand implements CommandExecutor {
3535

36-
private final EVNTExample evntExample = ApolloExamplePlugin.getPlugin().getEvntExample();
37-
3836
@Override
3937
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
4038
if (!(sender instanceof Player)) {
@@ -58,63 +56,65 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command
5856
return true;
5957
}
6058

59+
EVNTExample evntExample = ApolloExamplePlugin.getPlugin().getEvntExample();
60+
6161
switch (args[0].toLowerCase()) {
6262
case "overridehearttexture": {
63-
this.evntExample.overrideHeartTextureExample(player);
63+
evntExample.overrideHeartTextureExample(player);
6464
player.sendMessage("Displaying heart texture...");
6565
break;
6666
}
6767

6868
case "resethearttexture": {
69-
this.evntExample.resetHeartTextureExample(player);
69+
evntExample.resetHeartTextureExample(player);
7070
player.sendMessage("Resetting heart texture...");
7171
break;
7272
}
7373

7474
case "opengui": {
75-
this.evntExample.openGuiExample(player);
75+
evntExample.openGuiExample(player);
7676
player.sendMessage("Opening GUI...");
7777
break;
7878
}
7979

8080
case "closegui": {
81-
this.evntExample.closeGuiExample(player);
81+
evntExample.closeGuiExample(player);
8282
player.sendMessage("Closing GUI...");
8383
break;
8484
}
8585

8686
case "overridecharacter": {
87-
this.evntExample.overrideCharacterExample(player);
87+
evntExample.overrideCharacterExample(player);
8888
player.sendMessage("Overriding character...");
8989
break;
9090
}
9191

9292
case "overridecharacterability": {
93-
this.evntExample.overrideCharacterAbilityExample(player);
93+
evntExample.overrideCharacterAbilityExample(player);
9494
player.sendMessage("Overriding character ability...");
9595
break;
9696
}
9797

9898
case "overridecharactercosmetic": {
99-
this.evntExample.overrideCharacterCosmeticExample(player);
99+
evntExample.overrideCharacterCosmeticExample(player);
100100
player.sendMessage("Overriding character cosmetic...");
101101
break;
102102
}
103103

104104
case "overridecharacterresources": {
105-
this.evntExample.overrideCharacterResources(player);
105+
evntExample.overrideCharacterResources(player);
106106
player.sendMessage("Overriding character resources...");
107107
break;
108108
}
109109

110110
case "updategameoverview": {
111-
this.evntExample.updateGameOverviewExample();
111+
evntExample.updateGameOverviewExample();
112112
player.sendMessage("Updaing game overview...");
113113
break;
114114
}
115115

116116
case "updatestatusoverview": {
117-
this.evntExample.updateStatusOverviewExample();
117+
evntExample.updateStatusOverviewExample();
118118
player.sendMessage("Updaing status overview...");
119119
break;
120120
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* This file is part of Apollo, licensed under the MIT License.
3+
*
4+
* Copyright (c) 2023 Moonsworth
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in all
14+
* copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
* SOFTWARE.
23+
*/
24+
package com.lunarclient.apollo.example.common.modules.impl;
25+
26+
import com.lunarclient.apollo.example.common.modules.ApolloExample;
27+
import org.bukkit.entity.Player;
28+
29+
public abstract class EVNTExample extends ApolloExample {
30+
31+
public abstract void overrideHeartTextureExample(Player viewer);
32+
33+
public abstract void resetHeartTextureExample(Player viewer);
34+
35+
public abstract void openGuiExample(Player viewer);
36+
37+
public abstract void closeGuiExample(Player viewer);
38+
39+
public abstract void overrideCharacterExample(Player viewer);
40+
41+
public abstract void overrideCharacterAbilityExample(Player viewer);
42+
43+
public abstract void overrideCharacterCosmeticExample(Player viewer);
44+
45+
public abstract void overrideCharacterResources(Player viewer);
46+
47+
public abstract void updateGameOverviewExample();
48+
49+
public abstract void updateStatusOverviewExample();
50+
51+
}

0 commit comments

Comments
 (0)