├── .gitignore ├── src └── main │ └── java │ └── pl │ └── hackshield │ └── plugin │ └── api │ ├── HsPacket.java │ ├── HsUser.java │ ├── HackShield.java │ ├── bossbar │ ├── BossBarPacket.java │ └── BossInfo.java │ └── HackShieldAPI.java └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea 2 | /HackShield-API.iml 3 | /pom.xml 4 | -------------------------------------------------------------------------------- /src/main/java/pl/hackshield/plugin/api/HsPacket.java: -------------------------------------------------------------------------------- 1 | package pl.hackshield.plugin.api; 2 | 3 | public interface HsPacket { 4 | } 5 | -------------------------------------------------------------------------------- /src/main/java/pl/hackshield/plugin/api/HsUser.java: -------------------------------------------------------------------------------- 1 | package pl.hackshield.plugin.api; 2 | 3 | import java.util.UUID; 4 | 5 | public interface HsUser { 6 | 7 | UUID getUuid(); 8 | 9 | UUID getMinecraftUuid(); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/pl/hackshield/plugin/api/HackShield.java: -------------------------------------------------------------------------------- 1 | package pl.hackshield.plugin.api; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | public final class HackShield { 7 | 8 | @Getter 9 | @Setter 10 | private static HackShieldAPI api; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/pl/hackshield/plugin/api/bossbar/BossBarPacket.java: -------------------------------------------------------------------------------- 1 | package pl.hackshield.plugin.api.bossbar; 2 | 3 | import lombok.Getter; 4 | import pl.hackshield.plugin.api.HsPacket; 5 | 6 | @Getter 7 | public final class BossBarPacket implements HsPacket { 8 | 9 | private Operation operation; 10 | private BossInfo data; 11 | 12 | public BossBarPacket(Operation operation, BossInfo data) { 13 | this.operation = operation; 14 | this.data = data; 15 | } 16 | 17 | public enum Operation { 18 | ADD, 19 | REMOVE, 20 | UPDATE_PCT, 21 | UPDATE_NAME, 22 | UPDATE_STYLE, 23 | UPDATE_PROPERTIES 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # HackShield API 2 | Repozytorium zawierające dokumentację API pluginu HackShield oraz informacje potrzebne do prawidłowego wdrożenia pluginu 3 | 4 | ## Spis treści 5 | 6 | #### Plugin 7 | - [Instalacja](https://github.com/HackShield-pl/HackShield-Plugin-API/wiki/Instalacja) 8 | - [API](https://github.com/HackShield-pl/HackShield-Plugin-API/wiki/API) 9 | - [BossBar](https://github.com/HackShield-pl/HackShield-Plugin-API/wiki/BossBar) 10 | - [Tylko dla Proxy](https://github.com/HackShield-pl/HackShield-Plugin-API/wiki/Tylko-dla-proxy) 11 | #### Klient 12 | - [Dodatkowe funkcje](https://github.com/HackShield-pl/HackShield-Plugin-API/wiki/Dodatkowe-funkcje-w-kliencie) 13 | 14 | ## Instalacja 15 | Pobierz najnowszy [build API](https://github.com/HackShield-pl/HackShield-Plugin-API/releases), a następnie dodaj jako bibliotekę go swojego projektu. 16 | -------------------------------------------------------------------------------- /src/main/java/pl/hackshield/plugin/api/HackShieldAPI.java: -------------------------------------------------------------------------------- 1 | package pl.hackshield.plugin.api; 2 | 3 | import java.util.Collection; 4 | import java.util.UUID; 5 | 6 | public interface HackShieldAPI { 7 | 8 | HsUser getUser(UUID minecraftUuid); 9 | 10 | Collection getUsers(); 11 | 12 | void sendPackets(HsUser hsUser, Collection packets); 13 | 14 | /** 15 | * Only proxy 16 | * 17 | * @param serverName server name used in Proxy's config.yml 18 | * @return {@code boolean} true if added server successful 19 | */ 20 | default boolean addPassiveVerificationServer(String serverName) { 21 | throw new UnsupportedOperationException("The method is available only on the proxy server!"); 22 | } 23 | 24 | /** 25 | * Only proxy 26 | * 27 | * @param serverName server name used in Proxy's config.yml 28 | * @return {@code boolean} true if removed server successful 29 | */ 30 | default boolean removePassiveVerificationServer(String serverName) { 31 | throw new UnsupportedOperationException("The method is available only on the proxy server!"); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/pl/hackshield/plugin/api/bossbar/BossInfo.java: -------------------------------------------------------------------------------- 1 | package pl.hackshield.plugin.api.bossbar; 2 | 3 | import lombok.Getter; 4 | 5 | import java.util.Objects; 6 | import java.util.UUID; 7 | 8 | @Getter 9 | public class BossInfo { 10 | 11 | private final UUID uniqueId; 12 | 13 | private boolean darkenSky, playEndBossMusic, createFog; 14 | private Overlay overlay; 15 | private float percent; 16 | private String name; 17 | private Color color; 18 | 19 | public BossInfo(UUID uniqueId, String name, Color color, Overlay overlay) { 20 | this.uniqueId = uniqueId; 21 | this.name = name; 22 | this.color = color; 23 | this.overlay = overlay; 24 | this.percent = 1.0F; 25 | } 26 | 27 | public BossInfo(String name, Color color, Overlay overlay) { 28 | this(UUID.randomUUID(), name, color, overlay); 29 | } 30 | 31 | public boolean hasDisplayName() { 32 | return Objects.nonNull(name); 33 | } 34 | 35 | public BossInfo setOverlay(Overlay overlay) { 36 | this.overlay = overlay; 37 | return this; 38 | } 39 | 40 | public BossInfo setPercent(float percent) { 41 | this.percent = Float.max(percent, 0.0F); 42 | this.percent = Float.min(1.0F, this.percent); 43 | return this; 44 | } 45 | 46 | public BossInfo setName(String name) { 47 | this.name = name; 48 | return this; 49 | } 50 | 51 | public BossInfo setColor(Color color) { 52 | this.color = color; 53 | return this; 54 | } 55 | 56 | public BossInfo setDarkenSky(boolean darkenSky) { 57 | this.darkenSky = darkenSky; 58 | return this; 59 | } 60 | 61 | public BossInfo setPlayEndBossMusic(boolean playEndBossMusic) { 62 | this.playEndBossMusic = playEndBossMusic; 63 | return this; 64 | } 65 | 66 | public BossInfo setCreateFog(boolean createFog) { 67 | this.createFog = createFog; 68 | return this; 69 | } 70 | 71 | public enum Color { 72 | PINK, 73 | BLUE, 74 | RED, 75 | GREEN, 76 | YELLOW, 77 | PURPLE, 78 | WHITE 79 | } 80 | 81 | public enum Overlay { 82 | PROGRESS, 83 | NOTCHED_6, 84 | NOTCHED_10, 85 | NOTCHED_12, 86 | NOTCHED_20 87 | } 88 | 89 | } --------------------------------------------------------------------------------