Skip to content

Commit

Permalink
Updates for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Travja committed Nov 10, 2022
1 parent ecd359b commit 182ba91
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 20 deletions.
9 changes: 8 additions & 1 deletion pom.xml
Expand Up @@ -106,7 +106,6 @@
</dependencies>

<build>
<directory>../ProBuilds</directory>
<finalName>${project.artifactId}-${project.version}</finalName>
<resources>
<resource>
Expand Down Expand Up @@ -167,6 +166,14 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<outputDirectory>${outputDir}</outputDirectory>
</configuration>
</plugin>
</plugins>
</build>

Expand Down
31 changes: 15 additions & 16 deletions src/main/java/mc/promcteam/engine/core/Version.java
Expand Up @@ -6,36 +6,35 @@

public enum Version {

// !!! KEEP THE VERSIONS LIST IN A ORDER FROM LOWER TO HIGHER !!!
V1_13_R2,
V1_14_R1,
V1_15_R1,
V1_16_R2,
V1_16_R3,
// !!! KEEP THE VERSIONS LIST IN A ORDER FROM LOWER TO HIGHER !!!
V1_13_R2,
V1_14_R1,
V1_15_R1,
V1_16_R2,
V1_16_R3,
V1_17_R1,
V1_18_R1,
V1_18_R2,
V1_19_R1
;

V1_19_R1;

public static final Version CURRENT;

static {
String[] split = Bukkit.getServer().getClass().getPackage().getName().split("\\.");
String versionRaw = split[split.length - 1];
String[] split = Bukkit.getServer().getClass().getPackage().getName().split("\\.");
String versionRaw = split[split.length - 1];

CURRENT = CollectionsUT.getEnum(versionRaw, Version.class);
}

public boolean isLower(@NotNull Version version) {
return this.ordinal() < version.ordinal();
}

public boolean isHigher(@NotNull Version version) {
return this.ordinal() > version.ordinal();
}

public boolean isCurrent() {
return this == Version.CURRENT;
return this == Version.CURRENT;
}
}
Expand Up @@ -254,6 +254,14 @@ public static void save(DataSection data, String path) {
* @param file file to dump to
*/
public static void save(DataSection data, File file) {
if (!file.exists()) {
file.getParentFile().mkdirs();
try {
file.createNewFile();
} catch (IOException e) {
throw new RuntimeException("Couldn't save config to " + file.getName(), e);
}
}
try (FileOutputStream out = new FileOutputStream(file);
BufferedWriter write = new BufferedWriter(new OutputStreamWriter(out, StandardCharsets.UTF_8))) {

Expand Down
Expand Up @@ -18,7 +18,7 @@
public class PacketManager extends IManager<NexEngine> {

protected static final Set<IPacketHandler> PACKET_HANDLERS = new HashSet<>();
private static final String INJECTOR_ID = "nex_handler";
private static final String INJECTOR_ID = "nex_handler";

public PacketManager(@NotNull NexEngine plugin) {
super(plugin);
Expand Down Expand Up @@ -65,7 +65,7 @@ public void sendPacket(@NotNull Player player, @NotNull Object packet) {
}


private final void removePlayer(@NotNull Player player) {
private void removePlayer(@NotNull Player player) {
Channel channel = this.getChannel(player);
if (channel.pipeline().get(INJECTOR_ID) != null) {
channel.pipeline().remove(INJECTOR_ID);
Expand All @@ -76,7 +76,7 @@ private final void removePlayer(@NotNull Player player) {
});*/
}

private final void injectPlayer(@NotNull Player player) {
private void injectPlayer(@NotNull Player player) {
ChannelPipeline pipe = this.getChannel(player).pipeline();
if (pipe.get(INJECTOR_ID) != null) return;

Expand Down
1 change: 1 addition & 0 deletions src/main/java/mc/promcteam/engine/utils/Reflex.java
@@ -1,6 +1,7 @@
package mc.promcteam.engine.utils;

import mc.promcteam.engine.NexEngine;
import mc.promcteam.engine.NexPlugin;
import org.bukkit.Bukkit;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
Expand Down

0 comments on commit 182ba91

Please sign in to comment.