-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ViaVersion hook to fix protocol issues
- Loading branch information
1 parent
259f58b
commit c58637a
Showing
5 changed files
with
52 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package cc.ghast.packet.compat; | ||
|
||
import cc.ghast.packet.buffer.ProtocolByteBuf; | ||
import cc.ghast.packet.profile.Profile; | ||
import cc.ghast.packet.protocol.ProtocolDirection; | ||
import cc.ghast.packet.wrapper.netty.MutableByteBuf; | ||
import org.bukkit.Bukkit; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* @author Ghast | ||
* @since 28/12/2020 | ||
* ArtemisPacket © 2020 | ||
*/ | ||
public class HookManager { | ||
private final List<PacketModifier> modifiers = new ArrayList<>(); | ||
|
||
public HookManager() { | ||
this.init(); | ||
} | ||
|
||
public void init() { | ||
final boolean viaversion = Bukkit.getPluginManager().getPlugin("ViaVersion") != null; | ||
|
||
if (viaversion) modifiers.add(new ViaVersionHook()); | ||
} | ||
|
||
public void modifyAll(Profile profile, ProtocolDirection direction, ProtocolByteBuf byteBuf) { | ||
modifiers.forEach(e -> e.modify(profile, direction, byteBuf)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters