Skip to content

Commit

Permalink
Bug fixes and pom file changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tecnio committed Apr 12, 2024
1 parent 916eeb1 commit 3a666ad
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 20 deletions.
30 changes: 22 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<modelVersion>4.0.0</modelVersion>

<groupId>me.tecnio</groupId>
<artifactId>AntiHaxerman</artifactId>
<version>4.0.1</version>
<artifactId>antihaxerman</artifactId>
<version>4.0.2</version>

<properties>
<maven.compiler.source>8</maven.compiler.source>
Expand Down Expand Up @@ -43,17 +43,27 @@
<relocations>
<relocation>
<pattern>org.atteo.classindex</pattern>
<shadedPattern>me.tecnio.ahm.classindex</shadedPattern>
<shadedPattern>me.tecnio.ahm.libs.classindex</shadedPattern>
</relocation>

<relocation>
<pattern>co.aikar</pattern>
<shadedPattern>me.tecnio.ahm.aikar</shadedPattern>
<shadedPattern>me.tecnio.ahm.libs.aikar</shadedPattern>
</relocation>

<relocation>
<pattern>org.bstats</pattern>
<shadedPattern>me.tecnio.ahm</shadedPattern>
<shadedPattern>me.tecnio.ahm.libs.bstats</shadedPattern>
</relocation>
<relocation>
<pattern>ac.artemis.packet</pattern>
<shadedPattern>me.tecnio.ahm.libs.artemis</shadedPattern>
</relocation>
<relocation>
<pattern>cc.ghast.packet</pattern>
<shadedPattern>me.tecnio.ahm.libs.ghast</shadedPattern>
</relocation>
<relocation>
<pattern>com.github.steveice10.opennbt</pattern>
<shadedPattern>me.tecnio.ahm.libs.opennbt</shadedPattern>
</relocation>
</relocations>
</configuration>
Expand Down Expand Up @@ -94,28 +104,32 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.30</version>
<version>1.18.32</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.artemisac.artemis-packet-api</groupId>
<artifactId>api</artifactId>
<version>2.0.0-beta-3</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.github.artemisac.artemis-packet-api</groupId>
<artifactId>spigot</artifactId>
<version>2.0.0-beta-3</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.atteo.classindex</groupId>
<artifactId>classindex</artifactId>
<version>3.13</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>co.aikar</groupId>
<artifactId>acf-paper</artifactId>
<version>0.5.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.bstats</groupId>
Expand Down
25 changes: 18 additions & 7 deletions src/main/java/me/tecnio/ahm/AHM.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ public enum AHM {
public void start(final JavaPlugin plugin) {
this.plugin = plugin;

if (!Bukkit.getVersion().contains("1.8.8")) {
logger.severe("AntiHaxerman is only compatible with 1.8.8 servers.");
logger.severe("AntiHaxerman is only compatible with 1.8.8 servers.");
logger.severe("AntiHaxerman is only compatible with 1.8.8 servers.");

Bukkit.getPluginManager().disablePlugin(this.plugin);

return;
}

registerMetrics();
registerManagers();
registerConfiguration();
Expand All @@ -57,34 +67,35 @@ public void end() {
terminateManagers();
}

public void registerMetrics() {

private void registerMetrics() {
System.setProperty("bstats.relocatecheck", "false");
new Metrics(this.plugin, 11350);
}

public void registerManagers() {
private void registerManagers() {
install(CheckManager.class, new CheckManager());
install(ConfigManager.class, new ConfigManager());
install(PlayerDataManager.class, new PlayerDataManager());
install(AlertManager.class, new AlertManager());
install(PaperCommandManager.class, new PaperCommandManager(this.plugin));
}

public void registerConfiguration() {
private void registerConfiguration() {
get(ConfigManager.class).generate();
get(ConfigManager.class).load();
}

public void registerListeners() {
private void registerListeners() {
Bukkit.getPluginManager().registerEvents(new RegistrationListener(), this.plugin);
}

public void registerPacketAPI() {
private void registerPacketAPI() {
PacketManager.INSTANCE.init(this.plugin);
PacketAPI.addListener(new NetworkListener());
}

public void registerCommands() {
private void registerCommands() {
get(PaperCommandManager.class).enableUnstableAPI("help");

Arrays.asList(
Expand All @@ -97,7 +108,7 @@ public void registerCommands() {
});
}

public void terminateManagers() {
private void terminateManagers() {
this.dataManager = null;
this.checkManager = null;
this.alertManager = null;
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/me/tecnio/ahm/alert/AlertManager.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package me.tecnio.ahm.alert;

import lombok.Getter;
import me.tecnio.ahm.AHM;
import me.tecnio.ahm.alert.alert.AlertHandler;
import me.tecnio.ahm.alert.alert.AlertHandlerFactory;
Expand All @@ -14,6 +15,7 @@

public class AlertManager {

@Getter
private final Set<PlayerData> players = new HashSet<>();

private final String format = ChatUtil.translate(
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/me/tecnio/ahm/data/PlayerData.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public PlayerData(final Player player) {
}

public void terminate() {
// in case I need it idk
AHM.get(AlertManager.class).getPlayers().remove(this);
}

public void updateTicks() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,15 @@ public void handle(final GPacket packet) {
else if (packet instanceof PacketPlayServerPosition) {
final GPacketPlayServerPosition wrapper = ((GPacketPlayServerPosition) packet);

data.getConnectionTracker().confirm(() -> this.teleportQueue.add(new Teleport(wrapper.getX(), wrapper.getY(), wrapper.getZ(), wrapper.getFlags())));
data.getConnectionTracker().confirm(() -> this.teleportQueue.add(
new Teleport(wrapper.getX(), wrapper.getY(), wrapper.getZ(), wrapper.getFlags())));
}
}

@Override
public void handlePost(final GPacket packet) {
if (packet instanceof PacketPlayClientFlying && ((PacketPlayClientFlying) packet).isPos()) {
if (packet instanceof PacketPlayClientFlying
&& ((PacketPlayClientFlying) packet).isPos()) {
this.delayedFlyingTicks = 0;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: AntiHaxerman
version: 4.0.1
version: 4.0.2
main: me.tecnio.ahm.AHMPlugin
authors: [Tecnio, Incognito, aSwitch]
authors: [Tecnio, Incognito, aSwitch, Mexify, Cyanade]
description: An open-sourced anti-cheat solution.
load: STARTUP

0 comments on commit 3a666ad

Please sign in to comment.