mirror of
https://github.com/veralol/VeraSpigotAPI.git
synced 2024-11-10 01:01:32 +01:00
movement and packet handler
This commit is contained in:
parent
f26908ecf2
commit
85c33ba2f1
6
pom.xml
6
pom.xml
@ -28,6 +28,12 @@
|
||||
<version>1.8.8-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>minecraft-server</artifactId>
|
||||
<version>1.8.8-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
|
@ -1,5 +1,6 @@
|
||||
package lol.vera.spigot;
|
||||
|
||||
import lol.vera.spigot.implementation.ApiImplementation;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
|
17
src/main/java/lol/vera/spigot/handler/IMovementHandler.java
Normal file
17
src/main/java/lol/vera/spigot/handler/IMovementHandler.java
Normal file
@ -0,0 +1,17 @@
|
||||
package lol.vera.spigot.handler;
|
||||
|
||||
import net.minecraft.server.PacketPlayInFlying;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public interface IMovementHandler {
|
||||
|
||||
/**
|
||||
* @param player The {@link Player} who has moved
|
||||
* @param to The {@link Location} the player came from
|
||||
* @param from The {@link Location} the player is going to
|
||||
* @param packet The {@link PacketPlayInFlying} flying packet
|
||||
*/
|
||||
void handleMove(Player player, Location to, Location from, PacketPlayInFlying packet);
|
||||
|
||||
}
|
20
src/main/java/lol/vera/spigot/handler/IPacketHandler.java
Normal file
20
src/main/java/lol/vera/spigot/handler/IPacketHandler.java
Normal file
@ -0,0 +1,20 @@
|
||||
package lol.vera.spigot.handler;
|
||||
|
||||
import net.minecraft.server.Packet;
|
||||
import net.minecraft.server.PlayerConnection;
|
||||
|
||||
public interface IPacketHandler {
|
||||
|
||||
/**
|
||||
* @param connection The player who we are sending the packet to
|
||||
* @param packet The {@link Packet} which has been sent
|
||||
*/
|
||||
void handleSent(PlayerConnection connection, Packet<?> packet);
|
||||
|
||||
/**
|
||||
* @param connection The player who receives the packet
|
||||
* @param packet The {@link Packet} which has been received
|
||||
*/
|
||||
void handleReceived(PlayerConnection connection, Packet<?> packet);
|
||||
|
||||
}
|
@ -1,10 +1,17 @@
|
||||
package lol.vera.spigot;
|
||||
package lol.vera.spigot.implementation;
|
||||
|
||||
import lol.vera.spigot.handler.IMovementHandler;
|
||||
import lol.vera.spigot.handler.IPacketHandler;
|
||||
import lol.vera.spigot.knockback.KnockbackProfile;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public interface ApiImplementation {
|
||||
|
||||
void registerMovementHandlers(JavaPlugin plugin, IMovementHandler... movementHandlers);
|
||||
|
||||
void registerPacketHandlers(JavaPlugin plugin, IPacketHandler... packetHandlers);
|
||||
|
||||
KnockbackProfile getActiveKnockbackProfile();
|
||||
|
||||
KnockbackProfile getKnockbackProfile(String name);
|
||||
@ -15,6 +22,16 @@ public interface ApiImplementation {
|
||||
|
||||
class DEFAULT implements ApiImplementation {
|
||||
|
||||
@Override
|
||||
public void registerMovementHandlers(JavaPlugin plugin, IMovementHandler... movementHandlers) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerPacketHandlers(JavaPlugin plugin, IPacketHandler... packetHandlers) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public KnockbackProfile getActiveKnockbackProfile() {
|
||||
return null;
|
Loading…
Reference in New Issue
Block a user